{"version":3,"sources":["node_modules/jwt-decode/build/esm/index.js"],"sourcesContent":["export class InvalidTokenError extends Error {}\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 } 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 } 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 } catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);\n }\n}"],"mappings":"AAAO,IAAMA,EAAN,cAAgC,KAAM,CAAC,EAC9CA,EAAkB,UAAU,KAAO,oBACnC,SAASC,EAAiBC,EAAK,CAC7B,OAAO,mBAAmB,KAAKA,CAAG,EAAE,QAAQ,OAAQ,CAACC,EAAGC,IAAM,CAC5D,IAAIC,EAAOD,EAAE,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,YAAY,EACpD,OAAIC,EAAK,OAAS,IAChBA,EAAO,IAAMA,GAER,IAAMA,CACf,CAAC,CAAC,CACJ,CACA,SAASC,EAAgBJ,EAAK,CAC5B,IAAIK,EAASL,EAAI,QAAQ,KAAM,GAAG,EAAE,QAAQ,KAAM,GAAG,EACrD,OAAQK,EAAO,OAAS,EAAG,CACzB,IAAK,GACH,MACF,IAAK,GACHA,GAAU,KACV,MACF,IAAK,GACHA,GAAU,IACV,MACF,QACE,MAAM,IAAI,MAAM,4CAA4C,CAChE,CACA,GAAI,CACF,OAAON,EAAiBM,CAAM,CAChC,MAAc,CACZ,OAAO,KAAKA,CAAM,CACpB,CACF,CACO,SAASC,EAAUC,EAAOC,EAAS,CACxC,GAAI,OAAOD,GAAU,SACnB,MAAM,IAAIT,EAAkB,2CAA2C,EAEzEU,IAAYA,EAAU,CAAC,GACvB,IAAMC,EAAMD,EAAQ,SAAW,GAAO,EAAI,EACpCE,EAAOH,EAAM,MAAM,GAAG,EAAEE,CAAG,EACjC,GAAI,OAAOC,GAAS,SAClB,MAAM,IAAIZ,EAAkB,0CAA0CW,EAAM,CAAC,EAAE,EAEjF,IAAIE,EACJ,GAAI,CACFA,EAAUP,EAAgBM,CAAI,CAChC,OAASE,EAAG,CACV,MAAM,IAAId,EAAkB,qDAAqDW,EAAM,CAAC,KAAKG,EAAE,OAAO,GAAG,CAC3G,CACA,GAAI,CACF,OAAO,KAAK,MAAMD,CAAO,CAC3B,OAASC,EAAG,CACV,MAAM,IAAId,EAAkB,mDAAmDW,EAAM,CAAC,KAAKG,EAAE,OAAO,GAAG,CACzG,CACF","names":["InvalidTokenError","b64DecodeUnicode","str","m","p","code","base64UrlDecode","output","jwtDecode","token","options","pos","part","decoded","e"],"x_google_ignoreList":[0]}