PageSourceSearch

https://www.goswim.tv/_next/static/chunks/6337-22eff9bbf02d3f3a.js

js goswim.tv collected 2026-10-02 06:26:13 UTC 23,839 bytes, 3 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6337],{56337:function(e,t,i){let n;i.d(t,{V:function(){return e$}});var o,r,s,a=i(42773);/*! js-cookie v3.0.5 | MIT */ function d(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)e[n]=i[n]}return e}var c=function e(t,i){function n(e,n,o){if("undefined"!=typeof document){"number"==typeof(o=d({},i,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var r="";for(var s in o)o[s]&&(r+="; "+s,!0!==o[s]&&(r+="="+o[s].split(";")[0]));return document.cookie=e+"="+t.write(n,e)+r}}return Object.create({set:n,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var i=document.cookie?document.cookie.split("; "):[],n={},o=0;o<i.length;o++){var r=i[o].split("="),s=r.slice(1).join("=");try{var a=decodeURIComponent(r[0]);if(n[a]=t.read(s,a),e===a)break}catch(d){}}return e?n[e]:n}},remove:function(e,t){n(e,"",d({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,d({},this.attributes,t))},withConverter:function(t){return e(d({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});class l{constructor(e={}){let{path:t,domain:i,expires:n,sameSite:o,secure:r}=e;if(this.domain=i,this.path=t||"/",this.expires=Object.prototype.hasOwnProperty.call(e,"expires")?n:365,this.secure=!Object.prototype.hasOwnProperty.call(e,"secure")||r,Object.prototype.hasOwnProperty.call(e,"sameSite")){if(!o||!["strict","lax","none"].includes(o))throw Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if("none"===o&&!this.secure)throw Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=o}}async setItem(e,t){c.set(e,t,this.getData())}async getItem(e){let t=c.get(e);return t??null}async removeItem(e){c.remove(e,this.getData())}async clear(){let e=c.get(),t=Object.keys(e).map(e=>this.removeItem(e));await Promise.all(t)}getData(){return{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure,...this.sameSite&&{sameSite:this.sameSite}}}}var u=i(31573),h=i(62482),g=i(35967);let y=()=>
1{if("undefined"!=typeof window&&"function"==typeof window.atob)return window.atob;if("function"==typeof atob)return atob;throw new g._({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})},f={convert:e=>y()(e)},I=(e,t=g._)=>(i,n,o)=>{let{message:r,recoverySuggestion:s}=e[n];if(!i)throw new t({name:n,message:o?`${r} ${o}`:r,recoverySuggestion:s})};(o=r||(r={})).AuthTokenConfigException="AuthTokenConfigException",o.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",o.AuthUserPoolException="AuthUserPoolException",o.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",o.OAuthNotConfigureException="OAuthNotConfigureException";let m={[r.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[r.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[r.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[r.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[r.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}},p=I(m);function w(e){p(!!e&&!!e.userPoolId&&!!e.userPoolClientId,r.AuthUserPoolException)}function k(e){let t=!!e?.identityPoolId;p(t,r.InvalidIdentityPoolIdException)}function v(e){let t=e.split(".");if(3!==t.length)throw Error("Invalid token");try{let i=t[1],n=i.replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(f.convert(n).split("").map(e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")),r=JSON.parse(o);return{toString:()=>e,payload:r}}catch(s){throw Error("Invalid token payload")}}var C=i(17099),S=i(89300);let T=async e=>{if(!e||e.statusCode<300)return;let t=await A(e),i=(e=>{let[t]=e.toString().split(/[,:]+/);return t.includes("#")?t.split("#")[1]:t})(e.headers["x-amzn-errortype"]??t.code??t.__type??"UnknownError"),n=t.message??t.Message??"Unknown error",o=Error(n);return Object.assign(o,{name:i,$metadata:(0,S.B)(e)})},A=async e=>{if(!e.body)throw Error("Missing response payload");let t=await e.body.json();return Object.assign(t,{$metadata:(0,S.B)(e)})};var K=i(84982);class P extends g._{constructor(e){super(e),this.constructor=P,Object.setPrototypeOf(this,P.prototype)}}function E(e){if(!e||"Error"===e.name||e instanceof TypeError)throw new P({name:K.Z.Unknown,message:"An unknown error has occurred.",underlyingError:e})}var x=i(38481),b=i(49992),D=i(39265),V=i(80182),O=i(64756);let _=e=>!["HEAD","GET","DELETE"].includes(e.toUpperCase()),U=async({url:e,method:t,headers:i,body:n},{abortSignal:o,cache:r,withCrossDomainCredentials:s})=>{let a;try{a=await fetch(e,{method:t,headers:i,body:_(t)?n:void 0,signal:o,cache:r,credentials:s?"include":"same-origin"})}catch(d){if(d instanceof TypeError)throw Error("Network error");throw d}let c={};a.headers?.forEach((e,t)=>{c[t.toLowerCase()]=e});let l={statusCode:a.status,headers:c,body:null},u=Object.assign(a.body??{},{text:(0,O.p)(()=>a.text()),blob:(0,O.p)(()=>a.blob()),json:(0,O.p)(()=>a.json())});return{...l,body:u}},R=(0,V.V)(U,[D.n,b.d]);var z=i(87836),M=i(28991),F=i(96743),$=i(51847);let j="cognito-idp",N=({region:e})=>{let t=a.d.getConfig().Auth?.Cognito,i=t?.userPoolEndpoint,n=new F.a(`https://${j}.${e}.${(0,x.b)(e)}`);return{url:i?new F.a(i):n}},L=()=>(e,t)=>async function(t){return t.headers["cache-control"]="no-store",e(t)},G=(0,V.V)(R,[L]),B={service:j,endpointResolver:N,retryDecider:(0,z.j)(T),computeDelay:M.k,userAgentValue:(0,$.Zm)(),cache:"no-store"},W=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${e}`}),J=({url:e},t,i)=>({headers:t,url:e,body:i,method:"POST"}),H=e=>(t,i)=>{let n=W(e),o=JSON.stringify(t);return J(i,n,o)},Z=()=>async e=>{if(e.statusCode>=300){let t=await T(e);throw E(t),new P({name:t.name,message:t.message})}{let i=await A(e);return i}},Q=()=>async e=>{if(e.statusCode>=300){let t=await T(e);throw E(t),new P({name:t.name,message:t.message})}},X=(0,C.z)(G,H("InitiateAuth"),Z(),B);function q(e){if(!e||!e.includes(":"))throw new P({name:"InvalidIdentityPoolIdException",message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."});return e.split(":")[0]}(0,C.z)(G,H("RevokeToken"),Z(),B),(0,C.z)(G,H("SignUp"),Z(),B),(0,C.z)(G,H("ConfirmSignUp"),Z(),B),(0,C.z)(G,H("ForgotPassword"),Z(),B),(0,C.z)(G,H("ConfirmForgotPassword"),Z(),B),(0,C.z)(G,H("RespondToAuthChallenge"),Z(),B),(0,C.z)(G,H("ResendConfirmationCode"),Z(),B),(0,C.z)(G,H("VerifySoftwareToken"),Z(),B),(0,C.z)(G,H("AssociateSoftwareToken"),Z(),B),(0,C.z)(G,H("SetUserMFAPreference"),Z(),B),(0,C.z)(G,H("GetUser"),Z(),B),(0,C.z)(G,H("ChangePassword"),Z(),B),(0,C.z)(G,H("ConfirmDevice"),Z(),B),(0,C.z)(G,H("ForgetDevice"),Q(),B),(0,C.z)(G,H("DeleteUser"),Q(),B),(0,C.z)(G,H("GetUserAttributeVerificationCode"),Z(),B),(0,C.z)(G,H("GlobalSignOut"),Z(),B),(0,C.z)(G,H("UpdateUserAttributes"),Z(),B),(0,C.z)(G,H("VerifyUserAttribute"),Z(),B),(0,C.z)(G,H("UpdateDeviceStatus"),Z(),B),(0,C.z)(G,H("ListDevices"),Z(),B),(0,C.z)(G,H("DeleteUserAttributes"),Z(),B);let Y="UserUnAuthenticatedException";new P({name:"InvalidRedirectException",message:"signInRedirect or signOutRedirect had an invali
1d format or was not found.",recoverySuggestion:"Please make sure the signIn/Out redirect in your oauth config is valid."}),new P({name:"InvalidOriginException",message:"redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin",recoverySuggestion:"Please call signInWithRedirect from the same origin."});let ee=new P({name:"TokenRefreshException",message:`Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow. 
2	Please change your oauth configuration to use 'code grant' flow.`,recoverySuggestion:`Please logout and change your Amplify configuration to use "code grant" flow. 
3	E.g { responseType: 'code' }`}),et=new P({name:Y,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function ei(e){return e?.accessToken||e?.idToken}let en=async({tokens:e,authConfig:t,username:i})=>{w(t?.Cognito);let n=function(e){let t=e?.split("_")[0];if(!e||0>e.indexOf("_")||!t||"string"!=typeof t)throw new P({name:"InvalidUserPoolId",message:"Invalid user pool id provided."});return t}(t.Cognito.userPoolId);!function(e){if(ei(e)&&!e?.refreshToken)throw ee;if(!(ei(e)&&e?.refreshToken))throw et}(e);let o=e.refreshToken,r={REFRESH_TOKEN:o};e.deviceMetadata?.deviceKey&&(r.DEVICE_KEY=e.deviceMetadata.deviceKey);let s=function({username:e,userPoolId:t,userPoolClientId:i}){if("undefined"==typeof window)return;let n=window.AmazonCognitoAdvancedSecurityData;if(void 0===n)return;let o=n.getData(e,t,i);return o?{EncodedData:o}:{}}({username:i,userPoolId:t.Cognito.userPoolId,userPoolClientId:t.Cognito.userPoolClientId}),{AuthenticationResult:a}=await X({region:n},{ClientId:t?.Cognito?.userPoolClientId,AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:r,UserContextData:s}),d=v(a?.AccessToken??""),c=a?.IdToken?v(a.IdToken):void 0,{iat:l}=d.payload;if(!l)throw new P({name:"iatNotFoundException",message:"iat not found in access token"});let u=1e3*l-new Date().getTime();return{accessToken:d,idToken:c,clockDrift:u,refreshToken:o,username:i}},eo=async(...e)=>n||(n=new Promise((t,i)=>{en(...e).then(e=>{t(e)}).catch(e=>{i(e)}).finally(()=>{n=void 0})})),er={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetails:"signInDetails"};(s||(s={})).InvalidAuthTokens="InvalidAuthTokens";let es={[s.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},ea=I(es);class ed{constructor(){this.name="CognitoIdentityServiceProvider"}getKeyValueStorage(){if(!this.keyValueStorage)throw new P({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(e){this.keyValueStorage=e}setAuthConfig(e){this.authConfig=e}async loadTokens(){try{let e=await this.getAuthKeys(),t=await this.getKeyValueStorage().getItem(e.accessToken);if(!t)throw new P({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});let i=v(t),n=await this.getKeyValueStorage().getItem(e.idToken),o=n?v(n):void 0,r=await this.getKeyValueStorage().getItem(e.refreshToken)??void 0,s=await this.getKeyValueStorage().getItem(e.clockDrift)??"0",a=Number.parseInt(s),d=await this.getKeyValueStorage().getItem(e.signInDetails),c={accessToken:i,idToken:o,refreshToken:r,deviceMetadata:await this.getDeviceMetadata()??void 0,clockDrift:a,username:await this.getLastAuthUser()};return d&&(c.signInDetails=JSON.parse(d)),c}catch(l){return null}}async storeTokens(e){ea(void 0!==e,s.InvalidAuthTokens),await this.clearTokens();let t=e.username;await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),t);let i=await this.getAuthKeys();await this.getKeyValueStorage().setItem(i.accessToken,e.accessToken.toString()),e.idToken&&await this.getKeyValueStorage().setItem(i.idToken,e.idToken.toString()),e.refreshToken&&await this.getKeyValueStorage().setItem(i.refreshToken,e.refreshToken),e.deviceMetadata&&(e.deviceMetadata.deviceKey&&await this.getKeyValueStorage().setItem(i.deviceKey,e.deviceMetadata.deviceKey),e.deviceMetadata.deviceGroupKey&&await this.getKeyValueStorage().setItem(i.deviceGroupKey,e.deviceMetadata.deviceGroupKey),await this.getKeyValueStorage().setItem(i.randomPasswordKey,e.deviceMetadata.randomPassword)),e.signInDetail
3s&&await this.getKeyValueStorage().setItem(i.signInDetails,JSON.stringify(e.signInDetails)),await this.getKeyValueStorage().setItem(i.clockDrift,`${e.clockDrift}`)}async clearTokens(){let e=await this.getAuthKeys();await Promise.all([this.getKeyValueStorage().removeItem(e.accessToken),this.getKeyValueStorage().removeItem(e.idToken),this.getKeyValueStorage().removeItem(e.clockDrift),this.getKeyValueStorage().removeItem(e.refreshToken),this.getKeyValueStorage().removeItem(e.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey())])}async getDeviceMetadata(e){let t=await this.getAuthKeys(e),i=await this.getKeyValueStorage().getItem(t.deviceKey),n=await this.getKeyValueStorage().getItem(t.deviceGroupKey),o=await this.getKeyValueStorage().getItem(t.randomPasswordKey);return o?{deviceKey:i??void 0,deviceGroupKey:n??void 0,randomPassword:o}:null}async clearDeviceMetadata(e){let t=await this.getAuthKeys(e);await Promise.all([this.getKeyValueStorage().removeItem(t.deviceKey),this.getKeyValueStorage().removeItem(t.deviceGroupKey),this.getKeyValueStorage().removeItem(t.randomPasswordKey)])}async getAuthKeys(e){w(this.authConfig?.Cognito);let t=e??await this.getLastAuthUser();return ec(this.name,`${this.authConfig.Cognito.userPoolClientId}.${t}`)}getLastAuthUserKey(){w(this.authConfig?.Cognito);let e=this.authConfig.Cognito.userPoolClientId;return`${this.name}.${e}.LastAuthUser`}async getLastAuthUser(){let e=await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())??"username";return e}}let ec=(e,t)=>el(er)(`${e}`,t);function el(e){let t=Object.values({...e});return(e,i)=>t.reduce((t,n)=>({...t,[n]:`${e}.${i}.${n}`}),{})}var eu=i(60305),eh=i(35573);class eg{constructor(){this.waitForInflightOAuth=async()=>{}}setAuthConfig(e){this.authConfig=e}setTokenRefresher(e){this.tokenRefresher=e}setAuthTokenStore(e){this.tokenStore=e}setWaitForInflightOAuth(e){this.waitForInflightOAuth=e}getTokenStore(){if(!this.tokenStore)throw new P({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}getTokenRefresher(){if(!this.tokenRefresher)throw new P({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}async getTokens(e){let t;try{w(this.authConfig?.Cognito)}catch(i){return null}await this.waitForInflightOAuth(),t=await this.getTokenStore().loadTokens();let n=await this.getTokenStore().getLastAuthUser();if(null===t)return null;let o=!!t?.idToken&&(0,eh.p)({expiresAt:(t.idToken?.payload?.exp??0)*1e3,clockDrift:t.clockDrift??0}),r=(0,eh.p)({expiresAt:(t.accessToken?.payload?.exp??0)*1e3,clockDrift:t.clockDrift??0});return(e?.forceRefresh||o||r)&&null===(t=await this.refreshTokens({tokens:t,username:n}))?null:{accessToken:t?.accessToken,idToken:t?.idToken,signInDetails:t?.signInDetails}}async refreshTokens({tokens:e,username:t}){try{let i=await this.getTokenRefresher()({tokens:e,authConfig:this.authConfig,username:t});return await this.setTokens({tokens:i}),eu.Xb.dispatch("auth",{event:"tokenRefresh"},"Auth",eu.SQ),i}catch(n){return this.handleErrors(n)}}handleErrors(e){if(E(e),"Network error"!==e.message&&this.clearTokens(),eu.Xb.dispatch("auth",{event:"tokenRefresh_failure",data:{error:e}},"Auth",eu.SQ),e.name.startsWith("NotAuthorizedException"))return null;throw e}async setTokens({tokens:e}){return this.getTokenStore().storeTokens(e)}async clearTokens(){return this.getTokenStore().clearTokens()}getDeviceMetadata(e){return this.getTokenStore().getDeviceMetadata(e)}clearDeviceMetadata(e){return this.getTokenStore().clearDeviceMetadata(e)}}let ey=new class{constructor(){this.authTokenStore=new ed,this.authTokenStore.setKeyValueStorage(u.Fm),this.tokenOrchestrator=new eg,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(eo)}getTokens({forceRefresh:e}={forceRefresh:!1}){return this.tokenOrchestrator.getTokens({forceRefresh:e})}setKeyValueStorage(e){this.authTokenStore.setKeyValueStorage(e)}setWaitForInflightOAuth(e){this.tokenOrchestrator.setWaitForInflightOAuth(e)}setAuthConfig(e){this.authTokenStore.setAuthConfig(e),this.tokenOrchestrator.setAuthConfig(e)}},{tokenOrchestrator:ef}=ey;var eI=i(16344);let em={identityId:"identityId"},ep=new eI.k("DefaultIdentityIdStore"),ew=(e,t)=>el(em)(`com.amplify.${e}`,t);i(40500),i(56361);var ek=i(57977);let ev=({region:e})=>({url:new F.a(`https://cognito-identity.${e}.${(0,x.b)(e)}`)}),eC=()=>e=>async function(t){return t.headers["cache-control"]="no-store",e(t)},eS=(0,V.V)(R,[eC]),eT={service:"cognito-identity",endpointResolver:ev,retryDecider:(0,z.j)(T),computeDelay:M.k,userAgentValue:(0,$.Zm)(),cache:"no-store"};(0,ek.QW)(()=>{eT.userAgentValue=(0,$.Zm)()});let eA=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${e}`}),eK=({url:e},t,i)=>({headers:t,url:e,body:i,method:"POST"}),eP=(e,t)=>{let i=eA("GetCredentialsForIdentity"),n=JSON.stringify(e);return eK(t,i,n)},eE=async e=>{if(e.statusCode>=300){let t=await T(e);throw t}{let i=await A(e);return{IdentityId:i.IdentityId,Credentials:ex(i.Credentials),$metadata:(0,S.B)(e)}}},ex=({AccessKeyId:e,SecretKey:t,SessionToken:i,Expiration:n}={})=>({AccessKeyId:e,SecretKey:t,SessionToken:i,Expiration:n&&new Date(1e3*n)}),eb=(0,C.z)(eS,eP,eE,eT),eD=(e,t)=>{let i=eA("GetId"),n=JSON.stringify(e);return eK(t,i,n)},eV=async e=>{if(e.statusCode>=300){let t=await T(e);throw t}{let i=await A(e);return{IdentityId:i.IdentityId,$metadata:(0,S.B)(e)}}},eO=(0,C.z)(eS,eD,eV,eT);function e_(e){let t=v(e).payload.iss,i={};if(!t)throw new P({name:"InvalidIdTokenException",message:"Invalid Idtoken."});let n=t.replace(/(^\w+:|^)\/\//,"");return i[n]=e,i}let eU=new eI.k("CognitoIdentityIdProvider");async function eR({tokens:e,authConfig:t,identityIdStore:i}){i.setAuthConfig({Cognito:t});let n=await i.loadIdentityId();if(e){if(n&&"primary"===n.type)return n.id;{let o=e.idToken?e_(e.idToken.toString()):{},r=await ez(o,t);n&&n.id===r&&eU.debug(`The guest identity ${n.id} has become the primary identity.`),n={id:r,type:"primary"}}}else{if(n&&"guest"===n.type)return n.id;n={id:await ez({},t),type:"guest"}}return i.storeIdentityId(n),n.id}async function ez(e,t){let i=t?.identityPoolId,n=q(i),o=(await eO({regi
3on:n},{IdentityPoolId:i,Logins:e})).IdentityId;if(!o)throw new P({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return o}let eM=new eI.k("CognitoCredentialsProvider"),eF=new class{constructor(e){this._nextCredentialsRefresh=0,this._identityIdStore=e}async clearCredentialsAndIdentityId(){eM.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){eM.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(e){let t=e.authenticated,{tokens:i}=e,{authConfig:n}=e;try{k(n?.Cognito)}catch{return}if(!t&&!n.Cognito.allowGuestAccess)return;let{forceRefresh:o}=e,r=this.hasTokenChanged(i),s=await eR({tokens:i,authConfig:n.Cognito,identityIdStore:this._identityIdStore});return((o||r)&&this.clearCredentials(),t)?(!function(e){if(!e||!e.idToken)throw new P({name:Y,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}(i),this.credsForOIDCTokens(n.Cognito,i,s)):this.getGuestCredentials(s,n.Cognito)}async getGuestCredentials(e,t){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&!1===this._credentialsAndIdentityId.isAuthenticatedCreds)return eM.info("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();let i=q(t.identityPoolId),n=await eb({region:i},{IdentityId:e});if(n.Credentials&&n.Credentials.AccessKeyId&&n.Credentials.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+3e6;let o={credentials:{accessKeyId:n.Credentials.AccessKeyId,secretAccessKey:n.Credentials.SecretKey,sessionToken:n.Credentials.SessionToken,expiration:n.Credentials.Expiration},identityId:e},r=n.IdentityId;return r&&(o.identityId=r,this._identityIdStore.storeIdentityId({id:r,type:"guest"})),this._credentialsAndIdentityId={...o,isAuthenticatedCreds:!1},o}throw new P({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}async credsForOIDCTokens(e,t,i){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&!0===this._credentialsAndIdentityId.isAuthenticatedCreds)return eM.debug("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();let n=t.idToken?e_(t.idToken.toString()):{},o=q(e.identityPoolId),r=await eb({region:o},{IdentityId:i,Logins:n});if(r.Credentials&&r.Credentials.AccessKeyId&&r.Credentials.SecretKey){let s={credentials:{accessKeyId:r.Credentials.AccessKeyId,secretAccessKey:r.Credentials.SecretKey,sessionToken:r.Credentials.SessionToken,expiration:r.Credentials.Expiration},identityId:i};this._credentialsAndIdentityId={...s,isAuthenticatedCreds:!0,associatedIdToken:t.idToken?.toString()},this._nextCredentialsRefresh=new Date().getTime()+3e6;let a=r.IdentityId;return a&&(s.identityId=a,this._identityIdStore.storeIdentityId({id:a,type:"primary"})),s}throw new P({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}isPastTTL(){return void 0===this._nextCredentialsRefresh||this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(e){return!!e&&!!this._credentialsAndIdentityId?.associatedIdToken&&e.idToken?.toString()!==this._credentialsAndIdentityId.associatedIdToken}}(new class{setAuthConfig(e){k(e.Cognito),this.authConfig=e,this._authKeys=ew("Cognito",e.Cognito.identityPoolId)}constructor(e){this._authKeys={},this.keyValueStorage=e}async loadIdentityId(){k(this.authConfig?.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{let e=await this.keyValueStorage.getItem(this._authKeys.identityId);if(e)return{id:e,type:"guest"};return null}}catch(t){return ep.log("Error getting stored IdentityId.",t),null}}async storeIdentityId(e){k(this.authConfig?.Cognito),"guest"===e.type?(this.keyValueStorage.setItem(this._authKeys.identityId,e.id),this._primaryIdentityId=void 0):(this._primaryIdentityId=e.id,this.keyValueStorage.removeItem(this._authKeys.identityId))}async clearIdentityId(){this._primaryIdentityId=void 0,await this.keyValueStorage.removeItem(this._authKeys.identityId)}}(u.Fm)),e$={configure(e,t){let i;if(!(i=Object.keys(e).some(e=>e.startsWith("aws_"))?(0,h.h)(e):e).Auth||t?.Auth){a.d.configure(i,t);return}if(!a.d.libraryOptions.Auth){ey.setAuthConfig(i.Auth),ey.setKeyValueStorage(t?.ssr?new l({sameSite:"lax"}):u.Fm),a.d.configure(i,{...t,Auth:{tokenProvider:ey,credentialsProvider:eF}
3});return}if(t){void 0!==t.ssr&&ey.setKeyValueStorage(t.ssr?new l({sameSite:"lax"}):u.Fm),a.d.configure(i,{Auth:a.d.libraryOptions.Auth,...t});return}a.d.configure(i)},getConfig:()=>a.d.getConfig()}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.