(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-02eb7692"],{"00ef":function(e,t,n){"use strict";var r,i;function o(e){var t=["provider"];return e&&!!t.find((function(t){return e.hasOwnProperty(t)}))}function s(e){var t=["customProvider"];return e&&!!t.find((function(t){return e.hasOwnProperty(t)}))}function a(e){var t=["customState"];return e&&!!t.find((function(t){return e.hasOwnProperty(t)}))}function u(e){return void 0!==e.redirectSignIn}function c(e){return!!e.username}n.r(t),n.d(t,"Auth",(function(){return tt})),n.d(t,"CognitoUser",(function(){return be["e"]})),n.d(t,"CookieStorage",(function(){return be["i"]})),n.d(t,"CognitoHostedUIIdentityProvider",(function(){return r})),n.d(t,"appendToCognitoUserAgent",(function(){return be["j"]})),n.d(t,"AuthErrorStrings",(function(){return me})),function(e){e["Cognito"]="COGNITO",e["Google"]="Google",e["Facebook"]="Facebook",e["Amazon"]="LoginWithAmazon",e["Apple"]="SignInWithApple"}(r||(r={})),function(e){e["NoConfig"]="noConfig",e["MissingAuthConfig"]="missingAuthConfig",e["EmptyUsername"]="emptyUsername",e["InvalidUsername"]="invalidUsername",e["EmptyPassword"]="emptyPassword",e["EmptyCode"]="emptyCode",e["SignUpError"]="signUpError",e["NoMFA"]="noMFA",e["InvalidMFA"]="invalidMFA",e["EmptyChallengeResponse"]="emptyChallengeResponse",e["NoUserSession"]="noUserSession",e["Default"]="default"}(i||(i={}));var l=n("36de"),d=function(){return d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return s},h=function(){for(var e=[],t=0;t-1){var i=r===p;i||g.warn("WARNING: "+e+" is protected and dispatching on it can have unintended consequences")}var o={channel:e,payload:d({},t),source:n,patternInfo:[]};try{this._toListeners(o)}catch(s){g.error(s)}},e.prototype.listen=function(e,t,n){var r,i=this;if(void 0===n&&(n="noname"),y(t))g.warn("WARNING onHubCapsule is Deprecated. Please pass in a callback."),r=t.onHubCapsule.bind(t);else{if("function"!==typeof t)throw new Error("No callback supplied to Hub");r=t}if(e instanceof RegExp)this.patterns.push({pattern:e,callback:r});else{var o=this.listeners[e];o||(o=[],this.listeners[e]=o),o.push({name:n,callback:r})}return function(){i.remove(e,r)}},e.prototype._toListeners=function(e){var t=e.channel,n=e.payload,r=this.listeners[t];if(r&&r.forEach((function(r){g.debug("Dispatching to "+t+" with ",n);try{r.callback(e)}catch(i){g.error(i)}})),this.patterns.length>0){if(!n.message)return void g.warn("Cannot perform pattern matching without a message key");var i=n.message;this.patterns.forEach((function(t){var n=i.match(t.pattern);if(n){var r=f(n),o=r.slice(1),s=d(d({},e),{patternInfo:o});try{t.callback(s)}catch(a){g.error(a)}}}))}},e}(),b=new m("__default__"),v={},w=function(){function e(){}return e.setItem=function(e,t){return v[e]=t,v[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(v,e)?v[e]:void 0},e.removeItem=function(e){return delete v[e]},e.clear=function(){return v={},v},e}(),_=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.amplify.test-ls",1),this.storageWindow.removeItem("aws.amplify.test-ls")}catch(e){this.storageWindow=w}}return e.prototype.getStorage=function(){return this.storageWindow},e}(),I=n("1f3a"),P=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),S=function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r["throw"](e))}catch(t){o(t)}}function u(e){e.done?n(e.value):i(e.value).then(s,a)}u((r=r.apply(e,t||[])).next())}))},A=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return u([e,t])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!(i=i.length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return s},C=function(){for(var e=[],t=0;te)&&i}}var F=function(e,t,n){return void 0===n&&(n=x),T(e,t,E(n))},M=function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r["throw"](e))}catch(t){o(t)}}function u(e){e.done?n(e.value):i(e.value).then(s,a)}u((r=r.apply(e,t||[])).next())}))},N=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return u([e,t])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!(i=i.length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1](new Date).getTime()?(oe.debug("token not expired"),this._setCredentialsFromFederation({provider:t,token:r,user:n,identity_id:i,expires_at:o})):s._refreshHandlers[t]&&"function"===typeof s._refreshHandlers[t]?(oe.debug("getting refreshed jwt token from federation provider"),this._providerRefreshWithRetry({refreshHandler:s._refreshHandlers[t],provider:t,user:n})):(oe.debug("no refresh handler for provider:",t),this.clear(),Promise.reject("no refresh handler for provider"))},e.prototype._providerRefreshWithRetry=function(e){var t=this,n=e.refreshHandler,r=e.provider,i=e.user,o=1e4;return F(n,[],o).then((function(e){return oe.debug("refresh federated token sucessfully",e),t._setCredentialsFromFederation({provider:r,token:e.token,user:i,identity_id:e.identity_id,expires_at:e.expires_at})})).catch((function(e){var n="string"===typeof e&&0===e.toLowerCase().lastIndexOf("network error",e.length);return n||t.clear(),oe.debug("refresh federated token failed",e),Promise.reject("refreshing federation token failed: "+e)}))},e.prototype._isExpired=function(e){if(!e)return oe.debug("no credentials for expiration check"),!0;oe.debug("are these credentials expired?",e);var t=Date.now(),n=e.expiration;return n.getTime()<=t},e.prototype._isPastTTL=function(){return this._nextCredentialsRefresh<=Date.now()},e.prototype._setCredentialsForGuest=function(){return re(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a,u,c,l=this;return ie(this,(function(d){switch(d.label){case 0:if(oe.debug("setting credentials for guest"),e=this._config,t=e.identityPoolId,n=e.region,r=e.mandatorySignIn,r)return[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")];if(!t)return oe.debug("No Cognito Identity pool provided for unauthenticated access"),[2,Promise.reject("No Cognito Identity pool provided for unauthenticated access")];if(!n)return oe.debug("region is not configured for getting the credentials"),[2,Promise.reject("region is not configured for getting the credentials")];i=void 0,d.label=1;case 1:return d.trys.push([1,3,,4]),[4,this._storageSync];case 2:return d.sent(),i=this._storage.getItem("CognitoIdentityId-"+t),this._identityId=i,[3,4];case 3:return o=d.sent(),oe.debug("Failed to get the cached identityId",o),[3,4];case 4:return s=new ee["a"]({region:n,customUserAgent:Q()}),a=void 0,i?(u={identityId:i,client:s},a=Object(Z["a"])(u)()):(c=function(){return re(l,void 0,void 0,(function(){var e,n,r;return ie(this,(function(i){switch(i.label){case 0:return[4,s.send(new te["a"]({IdentityPoolId:t}))];case 1:return e=i.sent().IdentityId,this._identityId=e,n={client:s,identityId:e},r=Object(Z["a"])(n),[2,r()]}}))}))},a=c().catch((function(e){return re(l,void 0,void 0,(function(){return ie(this,(function(t){throw e}))}))}))),[2,this._loadCredentials(a,"guest",!1,null).then((function(e){return e})).catch((function(e){return re(l,void 0,void 0,(function(){var n,r=this;return ie(this,(function(o){return"ResourceNotFoundException"===e.name&&e.message==="Identity '"+i+"' not found."?(oe.debug("Failed to load guest credentials"),this._storage.removeItem("CognitoIdentityId-"+t),n=function(){return re(r,void 0,void 0,(function(){var e,n,r;return ie(this,(function(i){switch(i.label){case 0:return[4,s.send(new te["a"]({IdentityPoolId:t}))];case 1:return e=i.sent().IdentityId,this._identityId=e,n={client:s,identityId:e},r=Object(Z["a"])(n),[2,r()]}}))}))},a=n().catch((function(e){return re(r,void 0,void 0,(function(){return ie(this,(function(t){throw e}))}))})),[2,this._loadCredentials(a,"guest",!1,null)]):[2,e]}))}))}))]}}))}))},e.prototype._setCredentialsFromFederation=function(e){var t=e.provider,n=e.token,r=e.identity_id,i={google:"accounts.google.com",facebook:"graph.facebook.com",amazon:"www.amazon.com",developer:"cognito-identity.amazonaws.com"},o=i[t]||t;if(!o)return Promise.reject("You must specify a federated provider");var s={};s[o]=n;var a=this._config,u=a.identityPoolId,c=a.region;if(!u)return oe.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!c)return oe.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var l=new ee["a"]({region:c,customUserAgent:Q()}),d=void 0;if(r){var f={identityId:r,logins:s,client:l};d=Object(Z["a"])(f)()}else{f={logins:s,identityPoolId:u,client:l};d=Object($["a"])(f)()}return this._loadCredentials(d,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){var t=this;oe.debug("set credentials from session");var n=e.getIdToken().getJwtToken(),r=this._config,i=r.region,o=r.userPoolId,s=r.identityPoolId;if(!s)return oe.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!i)return oe.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var a="cognito-idp."+i+".amazonaws.com/"+o,u={};u[a]=n;var c=new ee["a"]({region:i,customUserAgent:Q()}),l=function(){return re(t,void 0,void 0,(function(){var e,t,n;return ie(this,(function(r){switch(r.label){case 0:return[4,c.send(new te["a"]({IdentityPoolId:s,Logins:u}))];case 1:return e=r.sent().IdentityId,this._identityId=e,t={client:c,logins:u,identityId:e},n=Object(Z["a"])(t),[2,n()]}}))}))},d=l().catch((function(e){return re(t,void 0,void 0,(function(){return ie(this,(function(t){throw e}))}))}));return this._loadCredentials(d,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,n,r){var i=this,o=this,s=this._config.identityPoolId;return new Promise((function(a,u){e.then((function(e){return re(i,void 0,void 0,(function(){var i,u,c,l,d,f;return ie(this,(function(h){switch(h.label){case 0:if(oe.debug("Load credentials successfully",e),this._identityId&&!e.identityId&&(e["identityId"]=this._identityId),o._credentials=e,o._credentials.authenticated=n,o._credentials_source=t,o._nextCredentialsRefresh=(new Date).getTime()+se,"federated"===t){i=Object.assign({id:this._credentials.identityId},r.user),u=r.provider,c=r.token,l=r.expires_at,d=r.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:u,token:c,user:i,expires_at:l,identity_id:d}))}catch(g){oe.debug("Failed to put federated info into auth storage",g)}}if("guest"!==t)return[3,4];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,this._storageSync];case 2:return h.sent(),this._storage.setItem("CognitoIdentityId-"+s,e.identityId),[3,4];case 3:return f=h.sent(),oe.debug("Failed to cache identityId",f),[3,4];case 4:return a(o._credentials),[2]}}))}))})).catch((function(t){if(t)return oe.debug("Failed to load credentials",e),oe.debug("Error loading credentials",t),void u(t)}))}))},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(oe.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return re(this,void 0,void 0,(function(){return ie(this,(function(e){return this._credentials=null,this._credentials_source=null,oe.debug("removing aws-amplify-federatedInfo from storage"),this._storage.removeItem("aws-amplify-federatedInfo"),[2]}))}))},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}(),ue=new ae(null);X["a"].register(ue);var ce=new l["a"]("Parser"),le=function(e){var t,n={};if(e["aws_mobile_analytics_app_id"]){var r={AWSPinpoint:{appId:e["aws_mobile_analytics_app_id"],region:e["aws_mobile_analytics_app_region"]}};n.Analytics=r}return(e["aws_cognito_identity_pool_id"]||e["aws_user_pools_id"])&&(n.Auth={userPoolId:e["aws_user_pools_id"],userPoolWebClientId:e["aws_user_pools_web_client_id"],region:e["aws_cognito_region"],identityPoolId:e["aws_cognito_identity_pool_id"],identityPoolRegion:e["aws_cognito_region"],mandatorySignIn:"enable"===e["aws_mandatory_sign_in"]}),t=e["aws_user_files_s3_bucket"]?{AWSS3:{bucket:e["aws_user_files_s3_bucket"],region:e["aws_user_files_s3_bucket_region"],dangerouslyConnectToHttpEndpointForTesting:e["aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing"]}}:e?e.Storage||e:{},n.Analytics=Object.assign({},n.Analytics,e.Analytics),n.Auth=Object.assign({},n.Auth,e.Auth),n.Storage=Object.assign({},t),ce.debug("parse config",e,"to amplifyconfig",n),n},de=function(){function e(){}return e.parseMobilehubConfig=le,e}(),fe=n("f4e3"),he=Object(I["b"])().isBrowser,ge=function(){function e(e){void 0===e&&(e={}),this.cookies=new fe["a"],this.store=he?window.localStorage:Object.create(null),this.cookies=e.req?new fe["a"](e.req.headers.cookie):new fe["a"],Object.assign(this.store,this.cookies.getAll())}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.entries(this.store).length},enumerable:!0,configurable:!0}),e.prototype.clear=function(){var e=this;Array.from(new Array(this.length)).map((function(t,n){return e.key(n)})).forEach((function(t){return e.removeItem(t)}))},e.prototype.getItem=function(e){return this.getLocalItem(e)},e.prototype.getLocalItem=function(e){return Object.prototype.hasOwnProperty.call(this.store,e)?this.store[e]:null},e.prototype.getUniversalItem=function(e){return this.cookies.get(e)},e.prototype.key=function(e){return Object.keys(this.store)[e]},e.prototype.removeItem=function(e){this.removeLocalItem(e),this.removeUniversalItem(e)},e.prototype.removeLocalItem=function(e){delete this.store[e]},e.prototype.removeUniversalItem=function(e){this.cookies.remove(e,{path:"/"})},e.prototype.setItem=function(e,t){this.setLocalItem(e,t);var n=e.split(".").pop();switch(n){case"LastAuthUser":case"accessToken":case"idToken":this.setUniversalItem(e,t)}},e.prototype.setLocalItem=function(e,t){this.store[e]=t},e.prototype.setUniversalItem=function(e,t){this.cookies.set(e,t,{path:"/",sameSite:!0,secure:"localhost"!==window.location.hostname})},e}();function pe(e){return e.split("").map((function(e){return e.charCodeAt(0).toString(16).padStart(2,"0")})).join("")}function ye(e){return e.match(/.{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join("")}var me,be=n("4c44"),ve=n("0b16"),we="_self",_e=function(e){var t=window.open(e,we);return t?Promise.resolve(t):Promise.reject()},Ie=function(e){window.sessionStorage.setItem("oauth_state",e)},Pe=function(){var e=window.sessionStorage.getItem("oauth_state");return window.sessionStorage.removeItem("oauth_state"),e},Se=function(e){window.sessionStorage.setItem("ouath_pkce_key",e)},Ae=function(){var e=window.sessionStorage.getItem("ouath_pkce_key");return window.sessionStorage.removeItem("ouath_pkce_key"),e},ke=n("94f8"),Ce=n.n(ke),Ue=n("1132"),Oe=n.n(Ue),je=function(){return je=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return s},Fe="undefined"!==typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Me=function(e,t,n){b.dispatch("auth",{event:e,data:t,message:n},"Auth",Fe)},Ne=new l["a"]("OAuth"),Re=function(){function e(e){var t=e.config,n=e.cognitoClientId,r=e.scopes,i=void 0===r?[]:r;if(this._urlOpener=t.urlOpener||_e,this._config=t,this._cognitoClientId=n,!this.isValidScopes(i))throw Error("scopes must be a String Array");this._scopes=i}return e.prototype.isValidScopes=function(e){return Array.isArray(e)&&e.every((function(e){return"string"===typeof e}))},e.prototype.oauthSignIn=function(e,t,n,i,o,s){void 0===e&&(e="code"),void 0===o&&(o=r.Cognito);var a=this._generateState(32),u=s?a+"-"+pe(s):a;Ie(u);var c=this._generateRandom(128);Se(c);var l=this._generateChallenge(c),d="S256",f=this._scopes.join(" "),h=Object.entries(je(je({redirect_uri:n,response_type:e,client_id:i,identity_provider:o,scope:f,state:u},"code"===e?{code_challenge:l}:{}),"code"===e?{code_challenge_method:d}:{})).map((function(e){var t=Ee(e,2),n=t[0],r=t[1];return encodeURIComponent(n)+"="+encodeURIComponent(r)})).join("&"),g="https://"+t+"/oauth2/authorize?"+h;Ne.debug("Redirecting to "+g),this._urlOpener(g,n)},e.prototype._handleCodeFlow=function(e){return Te(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,l,d,f,h;return xe(this,(function(g){switch(g.label){case 0:return t=(Object(ve["parse"])(e).query||"").split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n,r=Ee(t,2),i=r[0],o=r[1];return je(je({},e),(n={},n[i]=o,n))}),{code:void 0}).code,t&&Object(ve["parse"])(e).pathname===Object(ve["parse"])(this._config.redirectSignIn).pathname?(n="https://"+this._config.domain+"/oauth2/token",Me("codeFlow",{},"Retrieving tokens from "+n),r=u(this._config)?this._cognitoClientId:this._config.clientID,i=u(this._config)?this._config.redirectSignIn:this._config.redirectUri,o=Ae(),s=je({grant_type:"authorization_code",code:t,client_id:r,redirect_uri:i},o?{code_verifier:o}:{}),Ne.debug("Calling token endpoint: "+n+" with",s),a=Object.entries(s).map((function(e){var t=Ee(e,2),n=t[0],r=t[1];return encodeURIComponent(n)+"="+encodeURIComponent(r)})).join("&"),[4,fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:a})]):[2];case 1:return[4,g.sent().json()];case 2:if(c=g.sent(),l=c.access_token,d=c.refresh_token,f=c.id_token,h=c.error,h)throw new Error(h);return[2,{accessToken:l,refreshToken:d,idToken:f}]}}))}))},e.prototype._handleImplicitFlow=function(e){return Te(this,void 0,void 0,(function(){var t,n,r;return xe(this,(function(i){return t=(Object(ve["parse"])(e).hash||"#").substr(1).split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n,r=Ee(t,2),i=r[0],o=r[1];return je(je({},e),(n={},n[i]=o,n))}),{id_token:void 0,access_token:void 0}),n=t.id_token,r=t.access_token,Me("implicitFlow",{},"Got tokens from "+e),Ne.debug("Retrieving implicit tokens from "+e+" with"),[2,{accessToken:r,idToken:n,refreshToken:null}]}))}))},e.prototype.handleAuthResponse=function(e){return Te(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return xe(this,(function(u){switch(u.label){case 0:if(u.trys.push([0,5,,6]),t=e?je(je({},(Object(ve["parse"])(e).hash||"#").substr(1).split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n=Ee(t,2),r=n[0],i=n[1];return e[r]=i,e}),{})),(Object(ve["parse"])(e).query||"").split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n=Ee(t,2),r=n[0],i=n[1];return e[r]=i,e}),{})):{},n=t.error,r=t.error_description,n)throw new Error(r);return i=this._validateState(t),Ne.debug("Starting "+this._config.responseType+" flow with "+e),"code"!==this._config.responseType?[3,2]:(o=[{}],[4,this._handleCodeFlow(e)]);case 1:return[2,je.apply(void 0,[je.apply(void 0,o.concat([u.sent()])),{state:i}])];case 2:return s=[{}],[4,this._handleImplicitFlow(e)];case 3:return[2,je.apply(void 0,[je.apply(void 0,s.concat([u.sent()])),{state:i}])];case 4:return[3,6];case 5:throw a=u.sent(),Ne.error("Error handling auth response.",a),a;case 6:return[2]}}))}))},e.prototype._validateState=function(e){if(e){var t=Pe(),n=e.state;if(t&&t!==n)throw new Error("Invalid state in OAuth flow");return n}},e.prototype.signOut=function(){return Te(this,void 0,void 0,(function(){var e,t,n;return xe(this,(function(r){return e="https://"+this._config.domain+"/logout?",t=u(this._config)?this._cognitoClientId:this._config.oauth.clientID,n=u(this._config)?this._config.redirectSignOut:this._config.returnTo,e+=Object.entries({client_id:t,logout_uri:encodeURIComponent(n)}).map((function(e){var t=Ee(e,2),n=t[0],r=t[1];return n+"="+r})).join("&"),Me("oAuthSignOut",{oAuth:"signOut"},"Signing out from "+e),Ne.debug("Signing out from "+e),[2,this._urlOpener(e)]}))}))},e.prototype._generateState=function(e){for(var t="",n=e,r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";n>0;--n)t+=r[Math.round(Math.random()*(r.length-1))];return t},e.prototype._generateChallenge=function(e){return this._base64URL(Ce()(e))},e.prototype._base64URL=function(e){return e.toString(Oe.a).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},e.prototype._generateRandom=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=new Uint8Array(e);if("undefined"!==typeof window&&window.crypto)window.crypto.getRandomValues(n);else for(var r=0;r0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return s},Je=new l["a"]("AuthClass"),Qe="aws.cognito.signin.user.admin",Xe=1e4,Ze="undefined"!==typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",$e=function(e,t,n){b.dispatch("auth",{event:e,data:t,message:n},"Auth",Ze)},et=function(){function e(e){var t=this;this.userPool=null,this.user=null,this.oAuthFlowInProgress=!1,this.Credentials=ue,this.wrapRefreshSessionCallback=function(e){var t=function(t,n){return n?$e("tokenRefresh",void 0,"New token retrieved"):$e("tokenRefresh_failure",t,"Failed to retrieve new token"),e(t,n)};return t},this.configure(e),this.currentCredentials=this.currentCredentials.bind(this),this.currentUserCredentials=this.currentUserCredentials.bind(this),b.listen("auth",(function(e){var n=e.payload,r=n.event;switch(r){case"signIn":t._storage.setItem("amplify-signin-with-hostedUI","false");break;case"signOut":t._storage.removeItem("amplify-signin-with-hostedUI");break;case"cognitoHostedUI":t._storage.setItem("amplify-signin-with-hostedUI","true");break}}))}return e.prototype.getModuleName=function(){return"Auth"},e.prototype.configure=function(e){var t=this;if(!e)return this._config||{};Je.debug("configure Auth");var n=Object.assign({},this._config,de.parseMobilehubConfig(e).Auth,e);this._config=n;var r=this._config,i=r.userPoolId,o=r.userPoolWebClientId,s=r.cookieStorage,a=r.oauth,c=r.region,l=r.identityPoolId,d=r.mandatorySignIn,f=r.refreshHandlers,h=r.identityPoolRegion,g=r.clientMetadata,p=r.endpoint;if(this._config.storage){if(!this._isValidAuthStorage(this._config.storage))throw Je.error("The storage in the Auth config is not valid!"),new Error("Empty storage object");this._storage=this._config.storage}else this._storage=s?new be["i"](s):e.ssr?new ge:(new _).getStorage();if(this._storageSync=Promise.resolve(),"function"===typeof this._storage["sync"]&&(this._storageSync=this._storage["sync"]()),i){var y={UserPoolId:i,ClientId:o,endpoint:p};y.Storage=this._storage,this.userPool=new be["g"](y,this.wrapRefreshSessionCallback)}this.Credentials.configure({mandatorySignIn:d,region:h||c,userPoolId:i,identityPoolId:l,refreshHandlers:f,storage:this._storage});var m=a?u(this._config.oauth)?a:a.awsCognito:void 0;if(m){var b=Object.assign({cognitoClientId:o,UserPoolId:i,domain:m["domain"],scopes:m["scope"],redirectSignIn:m["redirectSignIn"],redirectSignOut:m["redirectSignOut"],responseType:m["responseType"],Storage:this._storage,urlOpener:m["urlOpener"],clientMetadata:g},m["options"]);this._oAuthHandler=new De({scopes:b.scopes,config:b,cognitoClientId:b.cognitoClientId});var v={};Le((function(e){var n=e.url;v[n]||(v[n]=!0,t._handleAuthResponse(n))}))}return $e("configured",null,"The Auth category has been configured successfully"),this._config},e.prototype.signUp=function(e){for(var t=this,n=[],r=1;ro?1*r:0})),!0},s=function(e,t){var n=Object.assign({},e);return t&&("string"===typeof t?delete n[t]:t.forEach((function(e){delete n[e]}))),n},a=function(e,t){void 0===t&&(t="application/octet-stream");var n=e.toLowerCase(),i=r.filter((function(e){return n.endsWith("."+e.ext)}));return i.length>0?i[0].type:t},u=function(e){var t=e.toLowerCase();return!!t.startsWith("text/")||("application/json"===t||"application/xml"===t||"application/sh"===t)},c=function(){for(var e="",t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=32;n>0;n-=1)e+=t[Math.floor(Math.random()*t.length)];return e},l=function(e){if(e.isResolved)return e;var t=!0,n=!1,r=!1,i=e.then((function(e){return r=!0,t=!1,e}),(function(e){throw n=!0,t=!1,e}));return i.isFullfilled=function(){return r},i.isPending=function(){return t},i.isRejected=function(){return n},i},d=function(){if("undefined"===typeof self)return!1;var e=self;return"undefined"!==typeof e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope},f=function(){var t="undefined"!==typeof window&&"undefined"!==typeof window.document,n="undefined"!==typeof e&&null!=e.versions&&null!=e.versions.node;return{isBrowser:t,isNode:n}},h=function(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=[]),!p(e))return e;var r={};for(var i in e)if(e.hasOwnProperty(i)){var o=t.includes(i)?i:i[0].toLowerCase()+i.slice(1);r[o]=n.includes(i)?e[i]:h(e[i],t,n)}return r},g=function(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=[]),!p(e))return e;var r={};for(var i in e)if(e.hasOwnProperty(i)){var o=t.includes(i)?i:i[0].toUpperCase()+i.slice(1);r[o]=n.includes(i)?e[i]:g(e[i],t,n)}return r},p=function(e){return e instanceof Object&&!(e instanceof Array)&&!(e instanceof Function)&&!(e instanceof Number)&&!(e instanceof String)&&!(e instanceof Boolean)},y=function(){function e(){}return e.isEmpty=i,e.sortByField=o,e.objectLessAttributes=s,e.filenameToContentType=a,e.isTextFile=u,e.generateRandomString=c,e.makeQuerablePromise=l,e.isWebWorker=d,e.browserOrNode=f,e.transferKeyToLowerCase=h,e.transferKeyToUpperCase=g,e.isStrictObject=p,e}()}).call(this,n("4362"))},"7d03":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n("36de"),i=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{while((void 0===t||t-- >0)&&!(r=o.next()).done)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return s},o=new r["a"]("Amplify"),s=function(){function e(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Logger=r["a"],this.ServiceWorker=null}return e.prototype.register=function(e){o.debug("component registered in amplify",e),this._components.push(e),"function"===typeof e.getModuleName?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):o.debug("no getModuleName method for component",e),e.configure(this._config)},e.prototype.configure=function(e){var t=this;return e?(this._config=Object.assign(this._config,e),o.debug("amplify config",this._config),Object.entries(this._modules).forEach((function(e){var n=i(e,2),r=(n[0],n[1]);Object.keys(r).forEach((function(e){t._modules[e]&&(r[e]=t._modules[e])}))})),this._components.map((function(e){e.configure(t._config)})),this._config):this._config},e.prototype.addPluggable=function(e){e&&e["getCategory"]&&"function"===typeof e["getCategory"]&&this._components.map((function(t){t["addPluggable"]&&"function"===typeof t["addPluggable"]&&t.addPluggable(e)}))},e}(),a=new s}}]);