Prodigy-Hacking / ProdigyMathGameHacking

Prodigy Hacking: Hacking for the right reasons. | Questions? Ask on our Discord. https://discord.gg/XQDfbfq
https://prodigyhacking.com
Other
17 stars 10 forks source link

[HR] how to (maybe) bring hacks back up. #747

Closed hellonearth311 closed 3 years ago

hellonearth311 commented 3 years ago

Describe the hack in 5 words or less: Additional info could patch hacks.

(Optional) Additional information This is the load indentity code for prodigy. Might be able to patch hacks if reviewed. "use strict";(SW=SW||{}).LoadIdentity={},SW.Errors={};var settings={store:window.sessionStorage};SW.LoadIdentity.browserName=null,SW.LoadIdentity.env=null,SW.LoadIdentity.devicePlatform=null,SW.LoadIdentity.DISPLAY_HIDE="none",SW.LoadIdentity.DISPLAY_SHOW="",SW.LoadIdentity.DIV_GAME_LOADING_CONTAINER="game-loading-container-div",SW.LoadIdentity.DIV_ERROR="error-div",SW.LoadIdentity.DIV_LOADING="loading-div",SW.LoadIdentity.DIV_SPLASH_IMAGE="splash-image",SW.LoadIdentity.CSS_ED_PROGRESS_BAR=".ed-progress-bar",SW.LoadIdentity.STORAGE_START_EVENT_TS="startEventTimestamp",SW.LoadIdentity.STORAGE_EVENT_DATA="eventData",SW.LoadIdentity.STORAGE_DEVICE_INFO="device-information",SW.LoadIdentity.ERROR_TITLE_DEFAULT="Error Code",SW.LoadIdentity.ERROR_DESCRIPTION_DEFAULT="Oops something went wrong!
Try logging in again or come back later.",SW.LoadIdentity.ERROR_TITLE_CLOCK_SKEW="Clock Error",SW.LoadIdentity.ERROR_DESCRIPTION_CLOCK_SKEW="Ensure that the clock on your device is the
correct time and then try logging in again.",SW.LoadIdentity.SENTRY_URL="https://a84188f8494e47ea9adc6469ec4f4deb@sentry.io/1217080",SW.LoadIdentity.SENTRY_SAMPLE_RATE_PROD=.01,SW.LoadIdentity.SENTRY_SAMPLE_RATE_STAGING=.01,SW.LoadIdentity.SENTRY_SAMPLE_RATE_DEFAULT=0,SW.Errors.ERROR_CODE_GAME_STATUS=10,SW.Errors.ERROR_CODE_GAME_MAINTENANCE=12,SW.Errors.ERROR_CODE_OIDC_REDIRECT_CALLBACK=20,SW.Errors.ERROR_CODE_OIDC_REDIRECT_SIGNIN=30,SW.Errors.ERROR_CODE_LOGIN_GAME_AUTH_API=36,SW.Errors.ERROR_CODE_LOADER_GAME_MAINTENANCE=40,SW.Errors.ERROR_CODE_NO_USER=48,SW.Errors.ERROR_CODE_LOAD_GAME_BUNDLES=50,SW.Errors.ERROR_CODE_OIDC_SIGNIN=60,SW.Errors.ERROR_CODE_EDUCATION_STATUS=70,SW.Errors.ERROR_CODE_CHARACTER=72,SW.Errors.ERROR_CODE_EDUCATION_API=84,SW.Errors.ERROR_CODE_QI=96,SW.Errors.ERROR_CODE_MENU_ASSETS=108,SW.Errors.ERROR_CODE_SECURE_CHARACTER=132;var ENVIRONMENTS={PRODUCTION:"production",STAGING:"staging",DEVELOPMENT:"dev",LOCAL:"local"};function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}SW.LoadIdentity.pendingError=!1,SW.LoadIdentity.pendingErrorTitle,SW.LoadIdentity.pendingErrorDesc,SW.LoadIdentity.pendingErrorID=0,SW.LoadIdentity.setDivDisplay=function(e,t){var n=!1,r=document.getElementById(e);return r?(r.style.display=t?SW.LoadIdentity.DISPLAY_SHOW:SW.LoadIdentity.DISPLAY_HIDE,n=!0):console.log("setDivDisplay div not found: ".concat(e)),n},SW.LoadIdentity.setDivCSS=function(e,t){var n=!1,r=document.getElementById(e);return r?(r.style.cssText=t,n=!0):console.log("setDivCSS div not found: ".concat(e)),n},SW.LoadIdentity.getUrlVariables=function(e){var t={};return e.replace(/[?&]+([^=&]+)=([^&])/gi,(function(e,n,r){return t[n]=r})),t},SW.LoadIdentity.isAutoLogin=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=SW.LoadIdentity.getUrlVariables(window.location.href);if("true"===t.autoLogin){if(!e)return!0;var n=window.localStorage.getItem("autoLogin");if(n)return n.length>0}else void 0!==t.autoLogin&&window.localStorage.removeItem("autoLogin");return!1},SW.LoadIdentity.redirectToIdentity=function(e,t,n,r,o){var i=SW.LoadIdentity.getUrlVariables(window.location.href),s=SW.LoadIdentity.getUrlVariables(n),a="",u=-1!==n.indexOf("?")?"&":"?";if(SW.Device.isNativeApp()&&!i.mobilePlatform){i.mobilePlatform=SW.Device.getOS().toLowerCase();var c=window.expoReleaseChannel;c&&c.indexOf("amazon")>-1&&(i.mobilePlatform="amazon")}for(var l=0,p=Object.keys(i);l<p.length;l++){var f=p[l];s[f]||(a="".concat(a).concat(u).concat(f,"=").concat(i[f])),"?"===u&&(u="&")}var d="".concat(n).concat(a);o&&SW.LoadIdentity.isAutoLogin()?window.location.href=d:new Oidc.UserManager({userStore:new Oidc.WebStorageStateStore(settings),authority:e,client_id:t,scope:"openid profile email sid identity_provider",redirect_uri:d,response_type:"id_token token",automaticSilentRenew:!0,prompt:r,extraQueryParams:{mobilePlatform:i.mobilePlatform}}).signinRedirect().catch((function(e){SW.LoadIdentity.setErrorScreen("Identity signin redirect failed ".concat(e),void 0,void 0,SW.Errors.ERROR_CODE_OIDC_SIGNIN)}))},SW.LoadIdentity.logout=function(){settings.store.clear()},SW.LoadIdentity.isErrorScreen=function(){var e=SW.LoadIdentity.pending;if(!e){var t=document.getElementById("error-div");t&&(e="none"!==t.style.display)}return e},SW.LoadIdentity.toggleErrorScreen=function(e){SW.LoadIdentity.setDivDisplay(SW.LoadIdentity.DIV_ERROR,e),document.getElementById(SW.LoadIdentity.DIV_LOADING)&&SW.LoadIdentity.setDivDisplay(SW.LoadIdentity.DIV_LOADING,!e),document.getElementById(SW.LoadIdentity.DIV_SPLASH_IMAGE)&&SW.LoadIdentity.setDivDisplay(SW.LoadIdentity.DIV_SPLASH_IMAGE,!e)},SW.LoadIdentity.setErrorScreen=function(e,t,n,r){if(e&&Sentry.captureMessage("Loader Error: ".concat(e)),document.getElementById("error-div")){SW.LoadIdentity.toggleErrorScreen(!0);var o=t||"".concat(SW.LoadIdentity.ERROR_TITLE_DEFAULT,": ").concat(r);document.getElementById("error-title").innerHTML=o;var i=n||SW.LoadIdentity.ERROR_DESCRIPTION_DEFAULT;document.getElementById("error-text").innerHTML=i,document.getElementById("try-again-button").onclick=function(){location.reload()}}else SW.LoadIdentity.pendingError=!0,SW.LoadIdentity.pendingErrorTitle=t,SW.LoadIdentity.pendingErrorDesc=n,SW.LoadIdentity.pendingErrorID=r},SW.LoadIdentity.checkPendingErrorScreen=function(){SW.LoadIdentity.pendingError&&(SW.LoadIdentity.setErrorScreen(null,SW.LoadIdentity.pendingErrorTitle,SW.LoadIdentity.pendingErrorDesc,SW.LoadIdentity.pendingErrorID),SW.LoadIdentity.pendingError=!1,SW.LoadIdentity.pendingErrorTitle=void 0,SW.LoadIdentity.pendingErrorDesc=void 0,SW.LoadIdentity.pendingErrorID=0)},SW.LoadIdentity.getServiceURL=function(){return prodigyServiceUrl},SW.LoadIdentity.setupEventParams=function(){var e=window.location.host,t=window.location.search,n="dev";e.indexOf("-qa")>=0||e.indexOf("dev.prodigygame.org")>=0?n=ENVIRONMENTS.LOCAL:e.indexOf("prodigygame.net")>=0||t.indexOf("env=dev")>=0?n=ENVIRONMENTS.DEVELOPMENT:e.indexOf("prodigygame.org")>=0||t.indexOf("env=staging")>=0?n=ENVIRONMENTS.STAGING:(e.indexOf("prodigygame.com")>=0||t.indexOf("env=production")>=0||t.indexOf("env=prod")>=0)&&(n=ENVIRONMENTS.PRODUCTION);var r,o="unknown",i=window.navigator.userAgent;i.indexOf("Opera")>-1||i.indexOf("OPR")>-1?o="Opera":i.indexOf("Chrome")>-1?o="Chrome":i.indexOf("Safari")>-1?o="Safari":i.indexOf("Firefox")>-1?o="Firefox":i.indexOf("SamsungBrowser")>-1?o="Samsung Internet for Android":i.indexOf("Trident")>-1?o="Internet Explorer":i.indexOf("Edge")>-1?o="Microsoft Edge":i.indexOf("Silk")>-1&&(o="Amazon Silk"),r=/iPad|iPhone|iPod/.test(navigator.platform)?/nativeApp/.test(window.location.href)?"iOS-App":"iOS-Browser":/Android/.test(navigator.platform)?/nativeApp/.test(window.location.href)?"Android-App":"Android-Browser":"Desktop-Browser",SW.LoadIdentity.browserName=o,SW.LoadIdentity.env=n,SW.LoadIdentity.devicePlatform=r},SW.LoadIdentity.sendV3Event=function(e,t){var n={name:"anonymous_game_complete_v3",version:3,uuid:window.eventData.uuid,timestamp:Date.now(),timezone_offset:(new Date).getTimezoneOffset(),client_version:SW.LoadIdentity.env,device_platform:SW.LoadIdentity.devicePlatform,browser:SW.LoadIdentity.browserName,meta:t},r=new XMLHttpRequest;r.open("POST",e),r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify({events:JSON.stringify([n])}))},SW.LoadIdentity.sendLoginStart=function(){SW.LoadIdentity.setupEventParams();var e="".concat(SW.LoadIdentity.getServiceURL(),"events-api/v3/anonymous-events");SW.LoadIdentity.sendV3Event(e,{type:"login_time_funnel",name:"load_start",timeDelta:0})},SW.LoadIdentity.sentryInit=function(e){var t,n=e.env,r="PGL-".concat(e.version);t=n===ENVIRONMENTS.PRODUCTION?SW.LoadIdentity.SENTRY_SAMPLE_RATE_PROD:n===ENVIRONMENTS.STAGING?SW.LoadIdentity.SENTRY_SAMPLE_RATE_STAGING:SW.LoadIdentity.SENTRY_SAMPLE_RATE_DEFAULT,Sentry.init({dsn:SW.LoadIdentity.SENTRY_URL,release:r,environment:n,sampleRate:t,attachStacktrace:!0});var o={id:window.eventData.uuid};Sentry.setUser(o)},SW.LoadIdentity.uuidv4=function(){var e=window.crypto||window.msCrypto;return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^e.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)}))},SW.LoadIdentity.setTrackingCookie=function(){var e=SW.Cookie.getTrackingCookie()||SW.LoadIdentity.uuidv4();SW.Cookie.setTrackingCookie(e)},SW.LoadIdentity.displayVersion=function(){var e=["%c ♥ Prodigy Loader v"+eventData.version+" ♥ ","color: #ffffff; background: #fc8cb2"];return console.log.apply(console,e),e},function(){var e=function(e,t,n,r){var o=24(n||7),i=new Date((new Date).getTime()+60o60*1e3);document.cookie="".concat(e,"=").concat(t).concat(r?";path=".concat(r):"","; expires=").concat(i.toUTCString(),"; domain=").concat(SW.Cookie._getSecondLevelDomain())};SW.Cookie={},SW.Cookie.REDIRECT_COUNT="redirect_count",SW.Cookie._getSecondLevelDomain=function(){var e=window.location.host.split(".").slice(-2).join(".");return e.indexOf("localhost")>=0?"localhost":e},SW.Cookie.get=function(e){return function(e){var t,n,r="".concat(e,"="),o=document.cookie.split(";");for(n=0;n<o.length;n+=1){for(t=o[n];" "===t.charAt(0);)t=t.substring(1,t.length);if(0===t.indexOf(r))return t.substring(r.length,t.length)}return null}("sw.".concat(e))},SW.Cookie.set=function(t,n,r,o){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=i?JSON.stringify(n):encodeURIComponent(n),a="sw.".concat(t);e(a,s,r,o)},SW.Cookie.expire=function(e,t){document.cookie="sw.".concat(e,"=").concat(t?";path=".concat(t):"","; expires=Thu, 01 Jan 1970 00:00:01 GMT;"),document.cookie="sw.".concat(e,"=").concat(t?";path=".concat(t):"","; expires=Thu, 01 Jan 1970 00:00:01 GMT; domain=").concat(SW.Cookie._getSecondLevelDomain())},SW.Cookie.setTrackingCookie=function(e){SW.Cookie.set("track_id",e,730,"/")},SW.Cookie.getTrackingCookie=function(){return SW.Cookie.get("track_id")},SW.Cookie.setRedirectCookie=function(){SW.Cookie.set(SW.Cookie.REDIRECT_COUNT,1,1,"/")},SW.Cookie.getRedirectCookie=function(){return SW.Cookie.get(SW.Cookie.REDIRECT_COUNT)},SW.Cookie.clearRedirectCookie=function(){SW.Cookie.set(SW.Cookie.REDIRECT_COUNT,"",1,"/")}}();var Oidc=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==_typeof(e)&&e&&e.esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=62)}([function(e,t,n){Object.defineProperty(t,"esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o={debug:function(){},info:function(){},warn:function(){},error:function(){}},i=void 0,s=void 0;(t.Log=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.reset=function(){s=3,i=o},e.debug=function(){if(s>=4){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];i.debug.apply(i,Array.from(t))}},e.info=function(){if(s>=3){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];i.info.apply(i,Array.from(t))}},e.warn=function(){if(s>=2){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];i.warn.apply(i,Array.from(t))}},e.error=function(){if(s>=1){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];i.error.apply(i,Array.from(t))}},r(e,null,[{key:"NONE",get:function(){return 0}},{key:"ERROR",get:function(){return 1}},{key:"WARN",get:function(){return 2}},{key:"INFO",get:function(){return 3}},{key:"DEBUG",get:function(){return 4}},{key:"level",get:function(){return s},set:function(e){if(!(0<=e&&e<=4))throw new Error("Invalid log level");s=e}},{key:"logger",get:function(){return i},set:function(e){if(!e.debug&&e.info&&(e.debug=e.info),!(e.debug&&e.info&&e.warn&&e.error))throw new Error("Invalid logger");i=e}}]),e}()).reset()},function(e,t,n){var r=n(22)("wks"),o=n(24),i=n(2).Symbol,s="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=s&&i[e]||(s?i:o)("Symbol."+e))}).store=r},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof g&&(g=n)},function(e,t){var n=e.exports={version:"2.6.4"};"number"==typeof e&&(e=n)},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o={setInterval:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t){return setInterval(e,t)})),clearInterval:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return clearInterval(e)}))},i=!1,s=null;t.Global=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e._testing=function(){i=!0},e.setXMLHttpRequest=function(e){s=e},r(e,null,[{key:"location",get:function(){if(!i)return location}},{key:"localStorage",get:function(){if(!i&&"undefined"!=typeof window)return localStorage}},{key:"sessionStorage",get:function(){if(!i&&"undefined"!=typeof window)return sessionStorage}},{key:"XMLHttpRequest",get:function(){if(!i&&"undefined"!=typeof window)return s||XMLHttpRequest}},{key:"timer",get:function(){if(!i)return o}}]),e}()},function(e,t,n){var r=n(6);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){return"object"==typeof(e)?null!==e:"function"==typeof e}},function(e,t,n){var r=n(2),o=n(3),i=n(8),s=n(11),a=n(13),u=function e(t,n,u){var c,l,p,f,d=t&e.F,h=t&e.G,g=t&e.P,v=t&e.B,=h?r:t&e.S?r[n]||(r[n]={}):(r[n]||{}).prototype,y=h?o:o[n]||(o[n]={}),m=y.prototype||(y.prototype={});for(c in h&&(u=n),u)p=((l=!d&&&&void 0!==[c])?:u)[c],f=v&&l?a(p,r):g&&"function"==typeof p?a(Function.call,p):p,&&s(_,c,p,t&e.U),y[c]!=p&&i(y,c,f),g&&m[c]!=p&&(m[c]=p)};r.core=o,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(17),o=n(39);e.exports=n(12)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.MetadataService=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=n(37);t.MetadataService=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.JsonService;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw o.Log.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=t,this._jsonService=new n(["application/jwk-set+json"])}return e.prototype.getMetadata=function(){var e=this;return this._settings.metadata?(o.Log.debug("MetadataService.getMetadata: Returning metadata from settings"),Promise.resolve(this._settings.metadata)):this.metadataUrl?(o.Log.debug("MetadataService.getMetadata: getting metadata from",this.metadataUrl),this._jsonService.getJson(this.metadataUrl).then((function(t){return o.Log.debug("MetadataService.getMetadata: json received"),e._settings.metadata=t,t}))):(o.Log.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"),Promise.reject(new Error("No authority or metadataUrl configured on settings")))},e.prototype.getIssuer=function(){return this._getMetadataProperty("issuer")},e.prototype.getAuthorizationEndpoint=function(){return this._getMetadataProperty("authorization_endpoint")},e.prototype.getUserInfoEndpoint=function(){return this._getMetadataProperty("userinfo_endpoint")},e.prototype.getTokenEndpoint=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._getMetadataProperty("token_endpoint",e)},e.prototype.getCheckSessionIframe=function(){return this._getMetadataProperty("check_session_iframe",!0)},e.prototype.getEndSessionEndpoint=function(){return this._getMetadataProperty("end_session_endpoint",!0)},e.prototype.getRevocationEndpoint=function(){return this._getMetadataProperty("revocation_endpoint",!0)},e.prototype.getKeysEndpoint=function(){return this._getMetadataProperty("jwks_uri",!0)},e.prototype._getMetadataProperty=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return o.Log.debug("MetadataService.getMetadataProperty for: "+e),this.getMetadata().then((function(n){if(o.Log.debug("MetadataService.getMetadataProperty: metadata recieved"),void 0===n[e]){if(!0===t)return void o.Log.warn("MetadataService.getMetadataProperty: Metadata does not contain optional property "+e);throw o.Log.error("MetadataService.getMetadataProperty: Metadata does not contain property "+e),new Error("Metadata does not contain property "+e)}return n[e]}))},e.prototype.getSigningKeys=function(){var e=this;return this._settings.signingKeys?(o.Log.debug("MetadataService.getSigningKeys: Returning signingKeys from settings"),Promise.resolve(this._settings.signingKeys)):this._getMetadataProperty("jwks_uri").then((function(t){return o.Log.debug("MetadataService.getSigningKeys: jwks_uri received",t),e._jsonService.getJson(t).then((function(t){if(o.Log.debug("MetadataService.getSigningKeys: key set received",t),!t.keys)throw o.Log.error("MetadataService.getSigningKeys: Missing keys on keyset"),new Error("Missing keys on keyset");return e._settings.signingKeys=t.keys,e._settings.signingKeys}))}))},r(e,[{key:"metadataUrl",get:function(){return this._metadataUrl||(this._settings.metadataUrl?this._metadataUrl=this._settings.metadataUrl:(this._metadataUrl=this._settings.authority,this._metadataUrl&&this._metadataUrl.indexOf(".well-known/openid-configuration")<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=".well-known/openid-configuration"))),this._metadataUrl}}]),e}()},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(2),o=n(8),i=n(19),s=n(24)("src"),a=n(68),u=(""+a).split("toString");n(3).inspectSource=function(e){return a.call(e)},(e.exports=function(e,t,n,a){var c="function"==typeof n;c&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(c&&(i(n,s)||o(n,s,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:a?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[s]||a.call(this)}))},function(e,t,n){e.exports=!n(18)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(14);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports={}},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.UrlUtility=void 0;var r=n(0),o=n(4);t.UrlUtility=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.addQueryParam=function(e,t,n){return e.indexOf("?")<0&&(e+="?"),"?"!==e[e.length-1]&&(e+="&"),e+=encodeURIComponent(t),(e+="=")+encodeURIComponent(n)},e.parseUrlFragment=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.Global;"string"!=typeof e&&(e=n.location.href);var i=e.lastIndexOf(t);i>=0&&(e=e.substr(i+1)),"?"===t&&(i=e.indexOf("#"))>=0&&(e=e.substr(0,i));for(var s,a={},u=/([^&=]+)=([^&]*)/g,c=0;s=u.exec(e);)if(a[decodeURIComponent(s[1])]=decodeURIComponent(s[2]),c++>50)return r.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",e),{error:"Response exceeded expected number of parameters"};for(var l in a)return a;return{}},e}()},function(e,t,n){var r=n(5),o=n(66),i=n(67),s=Object.defineProperty;t.f=n(12)?Object.defineProperty:function(t,n,a){if(r(t),n=i(n,!0),r(a),o)try{return s(t,n,a)}catch(e){}if("get"in a||"set"in a)throw TypeError("Accessors not supported!");return"value"in a&&(t[n]=a.value),t}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.JoseUtil=void 0;var r=n(116),o=function(e){return e&&e.esModule?e:{default:e}}(n(121));t.JoseUtil=(0,o.default)({jws:r.jws,KeyUtil:r.KeyUtil,X509:r.X509,crypto:r.crypto,hextob64u:r.hextob64u,b64tohex:r.b64tohex,AllowedSigningAlgs:r.AllowedSigningAlgs})},function(e,t,n){var r=n(10),o=n(1)("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t,n){var r=n(3),o=n(2),i=o["core-js_shared"]||(o["core-js_shared"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(23)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports=!1},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(6),o=n(2).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(74),o=n(41);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(30),o=n(27);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(10);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(26),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(22)("keys"),o=n(24);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t,n){var r=n(17).f,o=n(19),i=n(1)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){var r=n(27);e.exports=function(e){return Object(r(e))}},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.OidcClientSettings=void 0;var r="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return _typeof(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof(e)},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),s=n(36),a=n(114),u=n(9),c="id_token",l="openid";t.OidcClientSettings=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.authority,o=t.metadataUrl,i=t.metadata,p=t.signingKeys,f=t.client_id,d=t.client_secret,h=t.responsetype,g=void 0===h?c:h,v=t.scope,=void 0===v?l:v,y=t.redirect_uri,m=t.post_logout_redirect_uri,S=t.prompt,b=t.display,w=t.max_age,k=t.ui_locales,E=t.acr_values,T=t.resource,L=t.response_mode,R=t.filterProtocolClaims,x=void 0===R||R,O=t.loadUserInfo,I=void 0===O||O,P=t.staleStateAge,C=void 0===P?900:P,U=t.clockSkew,M=void 0===U?300:U,j=t.userInfoJwtIssuer,N=void 0===j?"OP":j,A=t.stateStore,W=void 0===A?new s.WebStorageStateStore:A,D=t.ResponseValidatorCtor,F=void 0===D?a.ResponseValidator:D,q=t.MetadataServiceCtor,B=void 0===q?u.MetadataService:q,V=t.extraQueryParams,J=void 0===V?{}:V,H=t.extraTokenParams,G=void 0===H?{}:H;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._authority=n,this._metadataUrl=o,this._metadata=i,this._signingKeys=p,this._client_id=f,this._client_secret=d,this._response_type=g,this.scope=,this._redirect_uri=y,this._post_logout_redirect_uri=m,this._prompt=S,this._display=b,this._max_age=w,this._ui_locales=k,this._acr_values=E,this._resource=T,this._response_mode=L,this._filterProtocolClaims=!!x,this._loadUserInfo=!!I,this._staleStateAge=C,this._clockSkew=M,this._userInfoJwtIssuer=N,this._stateStore=W,this._validator=new F(this),this._metadataService=new B(this),this._extraQueryParams="object"===(void 0===J?"undefined":r(J))?J:{},this._extraTokenParams="object"===(void 0===G?"undefined":r(G))?G:{}}return o(e,[{key:"client_id",get:function(){return this._client_id},set:function(e){if(this._client_id)throw i.Log.error("OidcClientSettings.set_client_id: client_id has already been assigned."),new Error("client_id has already been assigned.");this._client_id=e}},{key:"client_secret",get:function(){return this._client_secret}},{key:"response_type",get:function(){return this._response_type}},{key:"scope",get:function(){return this._scope}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"post_logout_redirect_uri",get:function(){return this._post_logout_redirect_uri}},{key:"prompt",get:function(){return this._prompt}},{key:"display",get:function(){return this._display}},{key:"max_age",get:function(){return this._max_age}},{key:"ui_locales",get:function(){return this._ui_locales}},{key:"acr_values",get:function(){return this._acr_values}},{key:"resource",get:function(){return this._resource}},{key:"response_mode",get:function(){return this._response_mode}},{key:"authority",get:function(){return this._authority},set:function(e){if(this._authority)throw i.Log.error("OidcClientSettings.set_authority: authority has already been assigned."),new Error("authority has already been assigned.");this._authority=e}},{key:"metadataUrl",get:function(){return this._metadataUrl||(this._metadataUrl=this.authority,this._metadataUrl&&this._metadataUrl.indexOf(".well-known/openid-configuration")<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=".well-known/openid-configuration")),this._metadataUrl}},{key:"metadata",get:function(){return this._metadata},set:function(e){this._metadata=e}},{key:"signingKeys",get:function(){return this._signingKeys},set:function(e){this._signingKeys=e}},{key:"filterProtocolClaims",get:function(){return this._filterProtocolClaims}},{key:"loadUserInfo",get:function(){return this._loadUserInfo}},{key:"staleStateAge",get:function(){return this._staleStateAge}},{key:"clockSkew",get:function(){return this._clockSkew}},{key:"userInfoJwtIssuer",get:function(){return this._userInfoJwtIssuer}},{key:"stateStore",get:function(){return this._stateStore}},{key:"validator",get:function(){return this._validator}},{key:"metadataService",get:function(){return this._metadataService}},{key:"extraQueryParams",get:function(){return this._extraQueryParams},set:function(e){"object"===(void 0===e?"undefined":r(e))?this._extraQueryParams=e:this._extraQueryParams={}}},{key:"extraTokenParams",get:function(){return this._extraTokenParams},set:function(e){"object"===(void 0===e?"undefined":r(e))?this._extraTokenParams=e:this._extraTokenParams={}}}]),e}()},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.WebStorageStateStore=void 0;var r=n(0),o=n(4);t.WebStorageStateStore=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.prefix,r=void 0===n?"oidc.":n,i=t.store,s=void 0===i?o.Global.localStorage:i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._store=s,this._prefix=r}return e.prototype.set=function(e,t){return r.Log.debug("WebStorageStateStore.set",e),e=this._prefix+e,this._store.setItem(e,t),Promise.resolve()},e.prototype.get=function(e){r.Log.debug("WebStorageStateStore.get",e),e=this._prefix+e;var t=this._store.getItem(e);return Promise.resolve(t)},e.prototype.remove=function(e){r.Log.debug("WebStorageStateStore.remove",e),e=this._prefix+e;var t=this._store.getItem(e);return this._store.removeItem(e),Promise.resolve(t)},e.prototype.getAllKeys=function(){r.Log.debug("WebStorageStateStore.getAllKeys");for(var e=[],t=0;t<this._store.length;t++){var n=this._store.key(t);0===n.indexOf(this._prefix)&&e.push(n.substr(this._prefix.length))}return Promise.resolve(e)},e}()},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.JsonService=void 0;var r=n(0),o=n(4);t.JsonService=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.XMLHttpRequest,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t&&Array.isArray(t)?this._contentTypes=t.slice():this._contentTypes=[],this._contentTypes.push("application/json"),r&&this._contentTypes.push("application/jwt"),this._XMLHttpRequest=n,this._jwtHandler=r}return e.prototype.getJson=function(e,t){var n=this;if(!e)throw r.Log.error("JsonService.getJson: No url passed"),new Error("url");return r.Log.debug("JsonService.getJson, url: ",e),new Promise((function(o,i){var s=new n._XMLHttpRequest;s.open("GET",e);var a=n._contentTypes,u=n._jwtHandler;s.onload=function(){if(r.Log.debug("JsonService.getJson: HTTP response received, status",s.status),200===s.status){var t=s.getResponseHeader("Content-Type");if(t){var n=a.find((function(e){if(t.startsWith(e))return!0}));if("application/jwt"==n)return void u(s).then(o,i);if(n)try{return void o(JSON.parse(s.responseText))}catch(o){return r.Log.error("JsonService.getJson: Error parsing JSON response",o.message),void i(o)}}i(Error("Invalid response Content-Type: "+t+", from URL: "+e))}else i(Error(s.statusText+" ("+s.status+")"))},s.onerror=function(){r.Log.error("JsonService.getJson: network error"),i(Error("Network Error"))},t&&(r.Log.debug("JsonService.getJson: token passed, setting Authorization header"),s.setRequestHeader("Authorization","Bearer "+t)),s.send()}))},e.prototype.postForm=function(e,t){var n=this;if(!e)throw r.Log.error("JsonService.postForm: No url passed"),new Error("url");return r.Log.debug("JsonService.postForm, url: ",e),new Promise((function(o,i){var s=new n._XMLHttpRequest;s.open("POST",e);var a=n._contentTypes;s.onload=function(){if(r.Log.debug("JsonService.postForm: HTTP response received, status",s.status),200!==s.status){if(400===s.status&&(n=s.getResponseHeader("Content-Type"))&&a.find((function(e){if(n.startsWith(e))return!0})))try{var t=JSON.parse(s.responseText);if(t&&t.error)return r.Log.error("JsonService.postForm: Error from server: ",t.error),void i(new Error(t.error))}catch(o){return r.Log.error("JsonService.postForm: Error parsing JSON response",o.message),void i(o)}i(Error(s.statusText+" ("+s.status+")"))}else{var n;if((n=s.getResponseHeader("Content-Type"))&&a.find((function(e){if(n.startsWith(e))return!0})))try{return void o(JSON.parse(s.responseText))}catch(o){return r.Log.error("JsonService.postForm: Error parsing JSON response",o.message),void i(o)}i(Error("Invalid response Content-Type: "+n+", from URL: "+e))}},s.onerror=function(){r.Log.error("JsonService.postForm: network error"),i(Error("Network Error"))};var u="";for(var c in t){var l=t[c];l&&(u.length>0&&(u+="&"),u+=encodeURIComponent(c),u+="=",u+=encodeURIComponent(l))}s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),s.send(u)}))},e}()},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.State=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=function(e){return e&&e.esModule?e:{default:e}}(n(54));t.State=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.id,r=t.data,o=t.created,s=t.request_type;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._id=n||(0,i.default)(),this._data=r,this._created="number"==typeof o&&o>0?o:parseInt(Date.now()/1e3),this._request_type=s}return e.prototype.toStorageString=function(){return o.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})},e.fromStorageString=function(t){return o.Log.debug("State.fromStorageString"),new e(JSON.parse(t))},e.clearStaleState=function(t,n){var r=Date.now()/1e3-n;return t.getAllKeys().then((function(n){o.Log.debug("State.clearStaleState: got keys",n);for(var i=[],s=function(s){var a=n[s];u=t.get(a).then((function(n){var i=!1;if(n)try{var s=e.fromStorageString(n);o.Log.debug("State.clearStaleState: got item from key: ",a,s.created),s.created<=r&&(i=!0)}catch(e){o.Log.error("State.clearStaleState: Error parsing state for key",a,e.message),i=!0}else o.Log.debug("State.clearStaleState: no item in storage for key: ",a),i=!0;if(i)return o.Log.debug("State.clearStaleState: removed item for key: ",a),t.remove(a)})),i.push(u)},a=0;a<n.length;a++){var u;s(a)}return o.Log.debug("State.clearStaleState: waiting on promise count:",i.length),Promise.all(i)}))},r(e,[{key:"id",get:function(){return this._id}},{key:"data",get:function(){return this._data}},{key:"created",get:function(){return this._created}},{key:"request_type",get:function(){return this._requesttype}}]),e}()},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(23),o=n(7),i=n(11),s=n(8),a=n(15),u=n(71),c=n(33),l=n(77),p=n(1)("iterator"),f=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,g,v,){u(n,t,h);var y,m,S,b=function(e){if(!f&&e in T)return T[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},w=t+" Iterator",k="values"==g,E=!1,T=e.prototype,L=T[p]||T["@@iterator"]||g&&T[g],R=L||b(g),x=g?k?b("entries"):R:void 0,O="Array"==t&&T.entries||L;if(O&&(S=l(O.call(new e)))!==Object.prototype&&S.next&&(c(S,w,!0),r||"function"==typeof S[p]||s(S,p,d)),k&&L&&"values"!==L.name&&(E=!0,R=function(){return L.call(this)}),r&&!||!f&&!E&&T[p]||s(T,p,R),a[t]=R,a[w]=d,g)if(y={values:k?R:b("values"),keys:v?R:b("keys"),entries:x},)for(m in y)m in T||i(T,m,y[m]);else o(o.P+o.F(f||E),t,y);return y}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(2).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(1)("unscopables"),o=Array.prototype;null==o[r]&&n(8)(o,r,{}),e.exports=function(e){o[r][e]=!0}},function(e,t,n){var r,o,i,s=n(13),a=n(45),u=n(42),c=n(25),l=n(2),p=l.process,f=l.setImmediate,d=l.clearImmediate,h=l.MessageChannel,g=l.Dispatch,v=0,={},y=function(){var e=+this;if(.hasOwnProperty(e)){var t=[e];delete [e],t()}},m=function(e){y.call(e.data)};f&&d||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return [++v]=function(){a("function"==typeof e?e:Function(e),t)},r(v),v},d=function(e){delete [e]},"process"==n(10)(p)?r=function(e){p.nextTick(s(y,e,1))}:g&&g.now?r=function(e){g.now(s(y,e,1))}:h?(i=(o=new h).port2,o.port1.onmessage=m,r=s(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","")},l.addEventListener("message",m,!1)):r="onreadystatechange"in c("script")?function(e){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(s(y,e,1),0)}),e.exports={set:f,clear:d}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(14);e.exports.f=function(e){return new function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)}(e)}},function(e,t,n){var r=n(13),o=n(30),i=n(34),s=n(31),a=n(105);e.exports=function(e,t){var n=1==e,u=2==e,c=3==e,l=4==e,p=6==e,f=5==e||p,d=t||a;return function(t,a,h){for(var g,v,=i(t),y=o(),m=r(a,h,3),S=s(y.length),b=0,w=n?d(t,S):u?d(t,0):void 0;S>b;b++)if((f||b in y)&&(v=m(g=y[b],b,_),e))if(n)w[b]=v;else if(v)switch(e){case 3:return!0;case 5:return g;case 6:return b;case 2:w.push(g)}else if(l)return!1;return p?-1:c||l?l:w}}},function(e,t,n){var r=n(10);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.OidcClient=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=n(35),s=n(51),a=n(52),u=n(125),c=n(126),l=n(127),p=n(53),f=n(38);t.OidcClient=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t instanceof i.OidcClientSettings?this._settings=t:this._settings=new i.OidcClientSettings(t)}return e.prototype.createSigninRequest=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.response_type,r=t.scope,i=t.redirect_uri,s=t.data,u=t.state,c=t.prompt,l=t.display,p=t.max_age,f=t.ui_locales,d=t.id_token_hint,h=t.login_hint,g=t.acrvalues,v=t.resource,=t.request,y=t.request_uri,m=t.response_mode,S=t.extraQueryParams,b=t.extraTokenParams,w=t.request_type,k=t.skipUserInfo,E=arguments[1];o.Log.debug("OidcClient.createSigninRequest");var T=this._settings.client_id;n=n||this._settings.response_type,r=r||this._settings.scope,i=i||this._settings.redirect_uri,c=c||this._settings.prompt,l=l||this._settings.display,p=p||this._settings.max_age,f=f||this._settings.ui_locales,g=g||this._settings.acr_values,v=v||this._settings.resource,m=m||this._settings.response_mode,S=S||this._settings.extraQueryParams,b=b||this._settings.extraTokenParams;var L=this._settings.authority;return a.SigninRequest.isCode(n)&&"code"!==n?Promise.reject(new Error("OpenID Connect hybrid flow is not supported")):this._metadataService.getAuthorizationEndpoint().then((function(t){o.Log.debug("OidcClient.createSigninRequest: Received authorization endpoint",t);var R=new a.SigninRequest({url:t,client_id:T,redirect_uri:i,response_type:n,scope:r,data:s||u,authority:L,prompt:c,display:l,max_age:p,ui_locales:f,id_token_hint:d,login_hint:h,acrvalues:g,resource:v,request:,request_uri:y,extraQueryParams:S,extraTokenParams:b,request_type:w,response_mode:m,client_secret:e._settings.client_secret,skipUserInfo:k}),x=R.state;return(E=E||e._stateStore).set(x.id,x.toStorageString()).then((function(){return R}))}))},e.prototype.readSigninResponseState=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o.Log.debug("OidcClient.readSigninResponseState");var r="query"===this._settings.response_mode||!this._settings.response_mode&&a.SigninRequest.isCode(this._settings.response_type)?"?":"#",i=new u.SigninResponse(e,r);return i.state?(t=t||this._stateStore,(n?t.remove.bind(t):t.get.bind(t))(i.state).then((function(e){if(!e)throw o.Log.error("OidcClient.readSigninResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:p.SigninState.fromStorageString(e),response:i}}))):(o.Log.error("OidcClient.readSigninResponseState: No state in response"),Promise.reject(new Error("No state in response")))},e.prototype.processSigninResponse=function(e,t){var n=this;return o.Log.debug("OidcClient.processSigninResponse"),this.readSigninResponseState(e,t,!0).then((function(e){var t=e.state,r=e.response;return o.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),n._validator.validateSigninResponse(t,r)}))},e.prototype.createSignoutRequest=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.id_token_hint,r=t.data,i=t.state,s=t.post_logout_redirect_uri,a=t.extraQueryParams,u=t.request_type,l=arguments[1];return o.Log.debug("OidcClient.createSignoutRequest"),s=s||this._settings.post_logout_redirect_uri,a=a||this._settings.extraQueryParams,this._metadataService.getEndSessionEndpoint().then((function(t){if(!t)throw o.Log.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");o.Log.debug("OidcClient.createSignoutRequest: Received end session endpoint",t);var p=new c.SignoutRequest({url:t,id_token_hint:n,post_logout_redirect_uri:s,data:r||i,extraQueryParams:a,request_type:u}),f=p.state;return f&&(o.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(l=l||e._stateStore).set(f.id,f.toStorageString())),p}))},e.prototype.readSignoutResponseState=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o.Log.debug("OidcClient.readSignoutResponseState");var r=new l.SignoutResponse(e);if(!r.state)return o.Log.debug("OidcClient.readSignoutResponseState: No state in response"),r.error?(o.Log.warn("OidcClient.readSignoutResponseState: Response was error: ",r.error),Promise.reject(new s.ErrorResponse(r))):Promise.resolve({undefined:void 0,response:r});var i=r.state;return t=t||this._stateStore,(n?t.remove.bind(t):t.get.bind(t))(i).then((function(e){if(!e)throw o.Log.error("OidcClient.readSignoutResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:f.State.fromStorageString(e),response:r}}))},e.prototype.processSignoutResponse=function(e,t){var n=this;return o.Log.debug("OidcClient.processSignoutResponse"),this.readSignoutResponseState(e,t,!0).then((function(e){var t=e.state,r=e.response;return t?(o.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),n._validator.validateSignoutResponse(t,r)):(o.Log.debug("OidcClient.processSignoutResponse: No state from storage; skipping validating response"),r)}))},e.prototype.clearStaleState=function(e){return o.Log.debug("OidcClient.clearStaleState"),e=e||this._stateStore,f.State.clearStaleState(e,this.settings.staleStateAge)},r(e,[{key:"_stateStore",get:function(){return this.settings.stateStore}},{key:"_validator",get:function(){return this.settings.validator}},{key:"_metadataService",get:function(){return this.settings.metadataService}},{key:"settings",get:function(){return this._settings}},{key:"metadataService",get:function(){return this._metadataService}}]),e}()},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.TokenClient=void 0;var r=n(37),o=n(9),i=n(0);t.TokenClient=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.JsonService,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.MetadataService;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw i.Log.error("TokenClient.ctor: No settings passed"),new Error("settings");this._settings=t,this._jsonService=new n,this._metadataService=new s(this._settings)}return e.prototype.exchangeCode=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(t=Object.assign({},t)).grant_type=t.grant_type||"authorization_code",t.client_id=t.client_id||this._settings.client_id,t.redirect_uri=t.redirect_uri||this._settings.redirect_uri,t.code?t.redirect_uri?t.code_verifier?t.client_id?this._metadataService.getTokenEndpoint(!1).then((function(n){return i.Log.debug("TokenClient.exchangeCode: Received token endpoint"),e._jsonService.postForm(n,t).then((function(e){return i.Log.debug("TokenClient.exchangeCode: response received"),e}))})):(i.Log.error("TokenClient.exchangeCode: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(i.Log.error("TokenClient.exchangeCode: No code_verifier passed"),Promise.reject(new Error("A code_verifier is required"))):(i.Log.error("TokenClient.exchangeCode: No redirect_uri passed"),Promise.reject(new Error("A redirect_uri is required"))):(i.Log.error("TokenClient.exchangeCode: No code passed"),Promise.reject(new Error("A code is required")))},e.prototype.exchangeRefreshToken=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(t=Object.assign({},t)).grant_type=t.grant_type||"refresh_token",t.client_id=t.client_id||this._settings.client_id,t.client_secret=t.client_secret||this._settings.client_secret,t.refresh_token?t.client_id?this._metadataService.getTokenEndpoint(!1).then((function(n){return i.Log.debug("TokenClient.exchangeRefreshToken: Received token endpoint"),e._jsonService.postForm(n,t).then((function(e){return i.Log.debug("TokenClient.exchangeRefreshToken: response received"),e}))})):(i.Log.error("TokenClient.exchangeRefreshToken: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(i.Log.error("TokenClient.exchangeRefreshToken: No refresh_token passed"),Promise.reject(new Error("A refresh_token is required")))},e}()},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.ErrorResponse=void 0;var r=n(0);t.ErrorResponse=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=n.error,i=n.error_description,s=n.error_uri,a=n.state,u=n.session_state;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),!o)throw r.Log.error("No error passed to ErrorResponse"),new Error("error");var c=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=_typeof(t)&&"function"!=typeof t?e:t}(this,e.call(this,i||o));return c.name="ErrorResponse",c.error=o,c.error_description=i,c.error_uri=s,c.state=a,c.session_state=u,c}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+_typeof(t));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.proto=t)}(t,e),t}(Error)},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.SigninRequest=void 0;var r=n(0),o=n(16),i=n(53);t.SigninRequest=function(){function e(t){var n=t.url,s=t.client_id,a=t.redirect_uri,u=t.response_type,c=t.scope,l=t.authority,p=t.data,f=t.prompt,d=t.display,h=t.max_age,g=t.ui_locales,v=t.id_tokenhint,=t.login_hint,y=t.acr_values,m=t.resource,S=t.response_mode,b=t.request,w=t.request_uri,k=t.extraQueryParams,E=t.request_type,T=t.client_secret,L=t.extraTokenParams,R=t.skipUserInfo;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!n)throw r.Log.error("SigninRequest.ctor: No url passed"),new Error("url");if(!s)throw r.Log.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!a)throw r.Log.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!u)throw r.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!c)throw r.Log.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!l)throw r.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");var x=e.isOidc(u),O=e.isCode(u);S||(S=e.isCode(u)?"query":null),this.state=new i.SigninState({nonce:x,data:p,client_id:s,authority:l,redirect_uri:a,code_verifier:O,request_type:E,response_mode:S,client_secret:T,scope:c,extraTokenParams:L,skipUserInfo:R}),n=o.UrlUtility.addQueryParam(n,"client_id",s),n=o.UrlUtility.addQueryParam(n,"redirect_uri",a),n=o.UrlUtility.addQueryParam(n,"response_type",u),n=o.UrlUtility.addQueryParam(n,"scope",c),n=o.UrlUtility.addQueryParam(n,"state",this.state.id),x&&(n=o.UrlUtility.addQueryParam(n,"nonce",this.state.nonce)),O&&(n=o.UrlUtility.addQueryParam(n,"code_challenge",this.state.code_challenge),n=o.UrlUtility.addQueryParam(n,"code_challenge_method","S256"));var I={prompt:f,display:d,max_age:h,ui_locales:g,id_token_hint:v,loginhint:,acr_values:y,resource:m,request:b,request_uri:w,response_mode:S};for(var P in I)I[P]&&(n=o.UrlUtility.addQueryParam(n,P,I[P]));for(var C in k)n=o.UrlUtility.addQueryParam(n,C,k[C]);this.url=n}return e.isOidc=function(e){return!!e.split(/\s+/g).filter((function(e){return"id_token"===e}))[0]},e.isOAuth=function(e){return!!e.split(/\s+/g).filter((function(e){return"token"===e}))[0]},e.isCode=function(e){return!!e.split(/\s+/g).filter((function(e){return"code"===e}))[0]},e}()},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.SigninState=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=n(38),s=n(20),a=function(e){return e&&e.esModule?e:{default:e}}(n(54));t.SigninState=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.nonce,o=n.authority,i=n.client_id,u=n.redirect_uri,c=n.code_verifier,l=n.response_mode,p=n.client_secret,f=n.scope,d=n.extraTokenParams,h=n.skipUserInfo;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var g=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=_typeof(t)&&"function"!=typeof t?e:t}(this,e.call(this,arguments[0]));if(!0===r?g._nonce=(0,a.default)():r&&(g._nonce=r),!0===c?g._code_verifier=(0,a.default)()+(0,a.default)()+(0,a.default)():c&&(g._code_verifier=c),g.code_verifier){var v=s.JoseUtil.hashString(g.code_verifier,"SHA256");g._code_challenge=s.JoseUtil.hexToBase64Url(v)}return g._redirect_uri=u,g._authority=o,g._client_id=i,g._response_mode=l,g._client_secret=p,g._scope=f,g._extraTokenParams=d,g._skipUserInfo=h,g}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+_typeof(t));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.proto=t)}(t,e),t.prototype.toStorageString=function(){return o.Log.debug("SigninState.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,nonce:this.nonce,code_verifier:this.code_verifier,redirect_uri:this.redirect_uri,authority:this.authority,client_id:this.client_id,response_mode:this.response_mode,client_secret:this.client_secret,scope:this.scope,extraTokenParams:this.extraTokenParams,skipUserInfo:this.skipUserInfo})},t.fromStorageString=function(e){return o.Log.debug("SigninState.fromStorageString"),new t(JSON.parse(e))},r(t,[{key:"nonce",get:function(){return this._nonce}},{key:"authority",get:function(){return this._authority}},{key:"client_id",get:function(){return this._client_id}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"code_verifier",get:function(){return this._code_verifier}},{key:"code_challenge",get:function(){return this._code_challenge}},{key:"response_mode",get:function(){return this._response_mode}},{key:"client_secret",get:function(){return this._client_secret}},{key:"scope",get:function(){return this._scope}},{key:"extraTokenParams",get:function(){return this._extraTokenParams}},{key:"skipUserInfo",get:function(){return this._skipUserInfo}}]),t}(i.State)},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.default=function(){return(0,r.default)().replace(/-/g,"")};var r=function(e){return e&&e.esModule?e:{default:e}}(n(122));e.exports=t.default},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.User=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0);t.User=function(){function e(t){var n=t.id_token,r=t.session_state,o=t.access_token,i=t.refresh_token,s=t.token_type,a=t.scope,u=t.profile,c=t.expires_at,l=t.state;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id_token=n,this.session_state=r,this.access_token=o,this.refresh_token=i,this.token_type=s,this.scope=a,this.profile=u,this.expires_at=c,this.state=l}return e.prototype.toStorageString=function(){return o.Log.debug("User.toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})},e.fromStorageString=function(t){return o.Log.debug("User.fromStorageString"),new e(JSON.parse(t))},r(e,[{key:"expires_in",get:function(){if(this.expires_at){var e=parseInt(Date.now()/1e3);return this.expires_at-e}},set:function(e){var t=parseInt(e);if("number"==typeof t&&t>0){var n=parseInt(Date.now()/1e3);this.expires_at=n+t}}},{key:"expired",get:function(){var e=this.expires_in;if(void 0!==e)return e<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}}]),e}()},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.AccessTokenEvents=void 0;var r=n(0),o=n(137);t.AccessTokenEvents=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.accessTokenExpiringNotificationTime,r=void 0===n?60:n,i=t.accessTokenExpiringTimer,s=void 0===i?new o.Timer("Access token expiring"):i,a=t.accessTokenExpiredTimer,u=void 0===a?new o.Timer("Access token expired"):a;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._accessTokenExpiringNotificationTime=r,this._accessTokenExpiring=s,this._accessTokenExpired=u}return e.prototype.load=function(e){if(e.access_token&&void 0!==e.expires_in){var t=e.expires_in;if(r.Log.debug("AccessTokenEvents.load: access token present, remaining duration:",t),t>0){var n=t-this._accessTokenExpiringNotificationTime;n<=0&&(n=1),r.Log.debug("AccessTokenEvents.load: registering expiring timer in:",n),this._accessTokenExpiring.init(n)}else r.Log.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel();var o=t+1;r.Log.debug("AccessTokenEvents.load: registering expired timer in:",o),this._accessTokenExpired.init(o)}else this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},e.prototype.unload=function(){r.Log.debug("AccessTokenEvents.unload: canceling existing access token timers"),this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},e.prototype.addAccessTokenExpiring=function(e){this._accessTokenExpiring.addHandler(e)},e.prototype.removeAccessTokenExpiring=function(e){this._accessTokenExpiring.removeHandler(e)},e.prototype.addAccessTokenExpired=function(e){this._accessTokenExpired.addHandler(e)},e.prototype.removeAccessTokenExpired=function(e){this._accessTokenExpired.removeHandler(e)},e}()},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.Event=void 0;var r=n(0);t.Event=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t,this._callbacks=[]}return e.prototype.addHandler=function(e){this._callbacks.push(e)},e.prototype.removeHandler=function(e){var t=this._callbacks.findIndex((function(t){return t===e}));t>=0&&this._callbacks.splice(t,1)},e.prototype.raise=function(){r.Log.debug("Event: Raising event: "+this._name);for(var e=0;e<this._callbacks.length;e++){var t;(t=this._callbacks)[e].apply(t,arguments)}},e}()},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.SessionMonitor=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=n(59),s=n(4);t.SessionMonitor=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.CheckSessionIFrame,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.Global.timer;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw o.Log.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=t,this._CheckSessionIFrameCtor=r,this._timer=a,this._userManager.events.addUserLoaded(this._start.bind(this)),this._userManager.events.addUserUnloaded(this._stop.bind(this)),this._userManager.getUser().then((function(e){e?n._start(e):n._settings.monitorAnonymousSession&&n._userManager.querySessionStatus().then((function(e){var t={session_state:e.session_state};e.sub&&e.sid&&(t.profile={sub:e.sub,sid:e.sid}),n._start(t)})).catch((function(e){o.Log.error("SessionMonitor ctor: error from querySessionStatus:",e.message)}))})).catch((function(e){o.Log.error("SessionMonitor ctor: error from getUser:",e.message)}))}return e.prototype._start=function(e){var t=this,n=e.session_state;n&&(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,o.Log.debug("SessionMonitor._start: session_state:",n,", sub:",this._sub)):(this._sub=void 0,this._sid=void 0,o.Log.debug("SessionMonitor._start: session_state:",n,", anonymous user")),this._checkSessionIFrame?this._checkSessionIFrame.start(n):this._metadataService.getCheckSessionIframe().then((function(e){if(e){o.Log.debug("SessionMonitor._start: Initializing check session iframe");var r=t._client_id,i=t._checkSessionInterval,s=t._stopCheckSessionOnError;t._checkSessionIFrame=new t._CheckSessionIFrameCtor(t._callback.bind(t),r,e,i,s),t._checkSessionIFrame.load().then((function(){t._checkSessionIFrame.start(n)}))}else o.Log.warn("SessionMonitor._start: No check session iframe found in the metadata")})).catch((function(e){o.Log.error("SessionMonitor._start: Error from getCheckSessionIframe:",e.message)})))},e.prototype._stop=function(){var e=this;if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&(o.Log.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop()),this._settings.monitorAnonymousSession)var t=this._timer.setInterval((function(){e._timer.clearInterval(t),e._userManager.querySessionStatus().then((function(t){var n={session_state:t.session_state};t.sub&&t.sid&&(n.profile={sub:t.sub,sid:t.sid}),e._start(n)})).catch((function(e){o.Log.error("SessionMonitor: error from querySessionStatus:",e.message)}))}),1e3)},e.prototype._callback=function(){var e=this;this._userManager.querySessionStatus().then((function(t){var n=!0;t?t.sub===e._sub?(n=!1,e._checkSessionIFrame.start(t.session_state),t.sid===e._sid?o.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",t.session_state):(o.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",t.session_state),e._userManager.events._raiseUserSessionChanged())):o.Log.debug("SessionMonitor._callback: Different subject signed into OP:",t.sub):o.Log.debug("SessionMonitor._callback: Subject no longer signed into OP"),n&&(e._sub?(o.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),e._userManager.events._raiseUserSignedOut()):(o.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed in event"),e._userManager.events._raiseUserSignedIn()))})).catch((function(t){e._sub&&(o.Log.debug("SessionMonitor._callback: Error calling queryCurrentSigninSession; raising signed out event",t.message),e._userManager.events._raiseUserSignedOut())}))},r(e,[{key:"_settings",get:function(){return this._userManager.settings}},{key:"_metadataService",get:function(){return this._userManager.metadataService}},{key:"_client_id",get:function(){return this._settings.client_id}},{key:"_checkSessionInterval",get:function(){return this._settings.checkSessionInterval}},{key:"_stopCheckSessionOnError",get:function(){return this._settings.stopCheckSessionOnError}}]),e}()},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.CheckSessionIFrame=void 0;var r=n(0);t.CheckSessionIFrame=function(){function e(t,n,r,o){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._callback=t,this._client_id=n,this._url=r,this._interval=o||2e3,this._stopOnError=i;var s=r.indexOf("/",r.indexOf("//")+2);this._frame_origin=r.substr(0,s),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.style.width=0,this._frame.style.height=0,this._frame.src=r}return e.prototype.load=function(){var e=this;return new Promise((function(t){e._frame.onload=function(){t()},window.document.body.appendChild(e._frame),e._boundMessageEvent=e._message.bind(e),window.addEventListener("message",e._boundMessageEvent,!1)}))},e.prototype._message=function(e){e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(r.Log.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(r.Log.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):r.Log.debug("CheckSessionIFrame: "+e.data+" message from check session op iframe"))},e.prototype.start=function(e){var t=this;if(this._session_state!==e){r.Log.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=e;var n=function(){t._frame.contentWindow.postMessage(t._client_id+" "+t._session_state,t._frame_origin)};n(),this._timer=window.setInterval(n,this._interval)}},e.prototype.stop=function(){this._session_state=null,this._timer&&(r.Log.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)},e}()},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.TokenRevocationClient=void 0;var r=n(0),o=n(9),i=n(4);t.TokenRevocationClient=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.Global.XMLHttpRequest,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.MetadataService;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw r.Log.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=t,this._XMLHttpRequestCtor=n,this._metadataService=new s(this._settings)}return e.prototype.revoke=function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"access_token";if(!e)throw r.Log.error("TokenRevocationClient.revoke: No token provided"),new Error("No token provided.");if("access_token"!==o&&"refresh_token"!=o)throw r.Log.error("TokenRevocationClient.revoke: Invalid token type"),new Error("Invalid token type.");return this._metadataService.getRevocationEndpoint().then((function(i){if(i){r.Log.debug("TokenRevocationClient.revoke: Revoking "+o);var s=n._settings.client_id,a=n._settings.client_secret;return n._revoke(i,s,a,e,o)}if(t)throw r.Log.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported")}))},e.prototype._revoke=function(e,t,n,o,i){var s=this;return new Promise((function(a,u){var c=new s._XMLHttpRequestCtor;c.open("POST",e),c.onload=function(){r.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",c.status),200===c.status?a():u(Error(c.statusText+" ("+c.status+")"))},c.onerror=function(){r.Log.debug("TokenRevocationClient.revoke: Network Error."),u("Network Error")};var l="client_id="+encodeURIComponent(t);n&&(l+="&client_secret="+encodeURIComponent(n)),l+="&token_type_hint="+encodeURIComponent(i),l+="&token="+encodeURIComponent(o),c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),c.send(l)}))},e}()},function(e,t,n){Object.defineProperty(t,"esModule",{value:!0}),t.CordovaPopupWindow=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0);t.CordovaPopupWindow=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._promise=new Promise((function(e,t){n._resolve=e,n._reject=t})),this.features=t.popupWindowFeatures||"location=no,toolbar=no,zoom=no",this.target=t.popupWindowTarget||"_blank",this.redirect_uri=t.startUrl,o.Log.debug("CordovaPopupWindow.ctor: redirect_uri: "+this.redirect_uri)}return e.prototype._isInAppBrowserInstalled=function(e){return["cordova-plugin-inappbrowser","cordova-plugin-inappbrowser.inappbrowser","org.apache.cordova.inappbrowser"].some((function(t){return e.hasOwnProperty(t)}))},e.prototype.navigate=function(e){if(e&&e.url){if(!window.cordova)return this._error("cordova is undefined");var t=window.cordova.require("cordova/plugin_list").metadata;if(!1===this._isInAppBrowserInstalled(t))return this._error("InAppBrowser plugin not found");this._popup=cordova.InAppBrowser.open(e.url,this.target,this.features),this._popup?(o.Log.debug("CordovaPopupWindow.navigate: popup successfully created"),this._exitCallbackEvent=this._exitCallback.bind(this),this._loadStartCallbackEvent=this._loadStartCallback.bind(this),this._popup.addEventListener("exit",this._exitCallbackEvent,!1),this._popup.addEventListener("loadstart",this._loadStartCallbackEvent,!1)):this._error("Error opening popup window")}else this._error("No url provided");return this.promise},e.prototype._loadStartCallback=function(e){0===e.url.indexOf(this.redirect_uri)&&this._success({url:e.url})},e.prototype._exitCallback=function(e){this._error(e)},e.prototype._success=function(e){this._cleanup(),o.Log.debug("CordovaPopupWindow: Successful response from cordova popup window"),this._resolve(e)},e.prototype._error=function(e){this._cleanup(),o.Log.error(e),this._reject(new Error(e))},e.prototype.close=function(){this._cleanup()},e.prototype._cleanup=function(){this._popup&&(o.Log.debug("CordovaPopupWindow: cleaning up popup"),this._popup.removeEventListener("exit",this._exitCallbackEvent,!1),this._popup.removeEventListener("loadstart",this._loadStartCallbackEvent,!1),this._popup.close()),this._popup=null},r(e,[{key:"promise",get:function(){return this._promise}}]),e}()},function(e,t,n){n(63),e.exports=n(113)},function(e,t,n){n(64),n(95),n(98),n(103),n(107),n(110),n(112)},function(e,t,n){n(65),n(69),n(78),n(81),e.exports=n(3).Promise},function(e,t,n){var r=n(21),o={};o[n(1)("toStringTag")]="z",o+""!="[object z]"&&n(11)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},function(e,t,n){e.exports=!n(12)&&!n(18)((function(){return 7!=Object.defineProperty(n(25)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(6);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=n(22)("native-function-to-string",Function.toString)},function(e,t,n){var r=n(70)(!0);n(40)(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},function(e,t,n){var r=n(26),o=n(27);e.exports=function(e){return function(t,n){var i,s,a=String(o(t)),u=r(n),c=a.length;return u<0||u>=c?e?"":void 0:(i=a.charCodeAt(u))<55296||i>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?e?a.charAt(u):i:e?a.slice(u,u+2):s-56320+(i-55296<<10)+65536}}},function(e,t,n){var r=n(72),o=n(39),i=n(33),s={};n(8)(s,n(1)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(s,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var r=n(5),o=n(73),i=n(41),s=n(32)("IE_PROTO"),a=function(){},u=function(){var e,t=n(25)("iframe"),r=i.length;for(t.style.display="none",n(42).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write(" Githubissues.

  • Githubissues is a development platform for aggregating issues.