PageSourceSearch

https://app.marketingevolution.com/assets/aws-amplify-6dlz1eh8.js

js marketingevolution.com collected 2026-10-02 02:21:26 UTC 155,528 bytes, 16 lines download raw bytes

1const ms="Logging",Al="x-amz-user-agent",ys="NoHubcallbackProvidedException";var B;(function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE",e.NONE="NONE"})(B||(B={}));const wn={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class k{constructor(t,n=B.WARN){this.name=t,this.level=n,this._pluggables=[]}_padding(t){return t<10?"0"+t:""+t}_ts(){const t=new Date;return[this._padding(t.getMinutes()),this._padding(t.getSeconds())].join(":")+"."+t.getMilliseconds()}configure(t){return t?(this._config=t,this._config):this._config}_log(t,...n){let o=this.level;k.LOG_LEVEL&&(o=k.LOG_LEVEL),typeof window<"u"&&window.LOG_LEVEL&&(o=window.LOG_LEVEL);const r=wn[o];if(!(wn[t]>=r))return;let i=console.log.bind(console);t===B.ERROR&&console.error&&(i=console.error.bind(console)),t===B.WARN&&console.warn&&(i=console.warn.bind(console)),k.BIND_ALL_LOG_LEVELS&&(t===B.INFO&&console.info&&(i=console.info.bind(console)),t===B.DEBUG&&console.debug&&(i=console.debug.bind(console)));const a=`[${t}] ${this._ts()} ${this.name}`;let c="";if(n.length===1&&typeof n[0]=="string")c=`${a} - ${n[0]}`,i(c);else if(n.length===1)c=`${a} ${n[0]}`,i(a,n[0]);else if(typeof n[0]=="string"){let u=n.slice(1);u.length===1&&(u=u[0]),c=`${a} - ${n[0]} ${u}`,i(`${a} - ${n[0]}`,u)}else c=`${a} ${n}`,i(a,n);for(const u of this._pluggables){const d={message:c,timestamp:Date.now()};u.pushLogs([d])}}log(...t){this._log(B.INFO,...t)}info(...t){this._log(B.INFO,...t)}warn(...t){this._log(B.WARN,...t)}error(...t){this._log(B.ERROR,...t)}debug(...t){this._log(B.DEBUG,...t)}verbose(...t){this._log(B.VERBOSE,...t)}addPluggable(t){t&&t.getCategoryName()===ms&&(this._pluggables.push(t),t.configure(this._config))}listPluggables(){return this._pluggables}}k.LOG_LEVEL=null;k.BIND_ALL_LOG_LEVELS=!1;class U extends Error{constructor({message:t,name:n,recoverySuggestion:o,underlyingError:r,metadata:s}){if(super(t),this.name=n,this.underlyingError=r,this.recoverySuggestion=o,s){const{extendedRequestId:i,httpStatusCode:a,requestId:c}=s;this.metadata={extendedRequestId:i,httpStatusCode:a,requestId:c}}this.constructor=U,Object.setPrototypeOf(this,U.prototype)}}var he;(function(e){e.NoEndpointId="NoEndpointId",e.PlatformNotSupported="PlatformNotSupported",e.Unknown="Unknown",e.NetworkError="NetworkError"})(he||(he={}));const jt=(e,t=U)=>(n,o,r)=>{const{message:s,recoverySuggestion:i}=e[o];if(!n)throw new t({name:o,message:r?`${s} ${r}`:s,recoverySuggestion:i})},fe=typeof Symbol<"u"?Symbol("amplify_default"):"@@amplify_default",De=new k("Hub");class Ss{constructor(t){this.listeners=new Map,this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=t}_remove(t,n){const o=this.listeners.get(t);if(!o){De.warn(`No listeners for ${t}`);return}this.listeners.set(t,[...o.filter(({callback:r})=>r!==n)])}dispatch(t,n,o,r){typeof t=="string"&&this.protectedChannels.indexOf(t)>-1&&(r===fe||De.warn(`WARNING: ${t} is protected and dispatching on it can have unintended consequences`));const s={channel:t,payload:{...n},source:o,patternInfo:[]};try{this._toListeners(s)}catch(i){De.error(i)}}listen(t,n,o="noname"){let r;if(typeof n!="function")throw new U({name:ys,message:"No callback supplied to Hub"});r=n;let s=this.listeners.get(t);return s||(s=[],this.listeners.set(t,s)),s.push({name:o,callback:r}),()=>{this._remove(t,r)}}_toListeners(t){const{channel:n,payload:o}=t,r=this.listeners.get(n);r&&r.forEach(s=>{De.debug(`Dispatching to ${n} with `,o);try{s.callback(t)}catch(i){De.error(i)}})}}const Pe=new Ss("__default__"),Is=()=>{if(typeof window=="object"&&typeof window.crypto=="object")return window.crypto;if(typeof crypto=="object")return crypto;throw new U({name:"MissingPolyfill",message:"Cannot resolve the `crypto` function from the environment."})},ws=()=>{if(typeof window<"u"&&typeof window.btoa=="function")return window.btoa;if(typeof btoa=="function")return btoa;throw new U({name:"Base64EncoderError",message:"Cannot resolve the `btoa` function from the environment."})},vs=()=>
1{if(typeof window<"u"&&typeof window.atob=="function")return window.atob;if(typeof atob=="function")return atob;throw new U({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})},Gt={convert(e,t){let n=e;return t?.urlSafe&&(n=n.replace(/-/g,"+").replace(/_/g,"/")),vs()(n)}};var Z;(function(e){e.AuthTokenConfigException="AuthTokenConfigException",e.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",e.AuthUserPoolException="AuthUserPoolException",e.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",e.OAuthNotConfigureException="OAuthNotConfigureException"})(Z||(Z={}));const Cs={[Z.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[Z.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[Z.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[Z.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[Z.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}},zt=jt(Cs);function w(e){let t=!0;e?t=!!e.userPoolId&&!!e.userPoolClientId:t=!1,zt(t,Z.AuthUserPoolException)}function Fo(e){const t=!!e?.loginWith?.oauth?.domain&&!!e?.loginWith?.oauth?.redirectSignOut&&!!e?.loginWith?.oauth?.redirectSignIn&&!!e?.loginWith?.oauth?.responseType;zt(t,Z.OAuthNotConfigureException)}function at(e){const t=!!e?.identityPoolId;zt(t,Z.InvalidIdentityPoolIdException)}function pe(e){const t=e.split(".");if(t.length!==3)throw new Error("Invalid token");try{const o=t[1].replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(Gt.convert(o).split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")),s=JSON.parse(r);return{toString:()=>e,payload:s}}catch{throw new Error("Invalid token payload")}}const As=e=>e&&e["nonRetryable"],et=new k("retryUtil");async function Ps(e,t,n,o){if(typeof e!="function")throw Error("functionToRetry must be a function");return new Promise(async(r,s)=>{let i=0,a=!1,c=()=>{},u;for(;!a;){i++,et.debug(`${e.name} attempt #${i} with this vars: ${JSON.stringify(t)}`);try{r(await e(...t));return}catch(d){if(u=d,et.debug(`error on ${e.name}`,d),As(d)){et.debug(`${e.name} non retryable error`,d),s(d);return}const l=n(i,t,d);if(et.debug(`${e.name} retrying in ${l} ms`),l===!1||a){s(d);return}else await new Promise(h=>{c=h,setTimeout(c,l)})}}s(u)})}const ko=e=>{const t=Reflect.ownKeys(e);for(const n of t){const o=e[n];(o&&typeof o=="object"||typeof o=="function")&&ko(o)}return Object.freeze(e)},Ts=new k("parseAWSExports"),Rs={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},_s=(e={})=>{if(!Object.prototype.hasOwnProperty.call(e,"aws_project_region"))throw new U({name:"InvalidParameterException",message:"Invalid config parameter.",recoverySuggestion:"Ensure passing the config object imported from  `amplifyconfiguration.json`."});const{aws_appsync_apiKey:t,aws_appsync_authenticationType:n,aws_appsync_graphqlEndpoint:o,aws_appsync_region:r,aws_bots_config:s,aws_cognito_identity_pool_id:i,aws_cognito_sign_up_verification_method:a,aws_cognito_mfa_configuration:c,aws_cognito_mfa_types:u,aws_cognito_password_protection_settings:d,aws_cognito_verification_mechanisms:l,aws_cognito_signup_attributes:h,aws_cognito_social_providers:f,aws_cognito_username_attributes:g,aws_mandatory_sign_in:E,aws_mobile_analytics_app_id:S,aws_mobile_analytics_app_region:I,aws_user_files_s3_bucket:H,aws_user_files_s3_bucket_region:ue,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:fn,aws_user_pools_id:Ce,aws_user_pools_web_client_id:cs,geo:pn,oauth:Tt,predictions:Ae,aws_cloud_logic_custom:gn,Notifications:us,modelIntrospection:En}=e,N={};S&&(N.Analytics={Pinpoint:{appId:S,region:I}});const{InAppMessaging:Rt,Push:_t}=us??{};if(Rt?.AWSPinpoint||_t?.AWSPinpoint){if(Rt?.AWSPinpoint){const{appId:R,region:de}=Rt.AWSPinpoint;N.Notifications={InAppMessaging:{Pinpoint:{appId:R,region:de}}}}if(_t?.AWSPinpoint){const{appId:R,region:de}=_t.AWSPinpoint;N.Notifications={...N.Notifications,PushNotification:{Pinpoint:{appId:R,region:de}}}}}if(Array.isArray(s)&&(N.Interactions={LexV1:Object.fromEntries(s.map(R=>[R.name,R]))}),o){const R=Rs[n];R||Ts.debug(`Invalid authentication type ${n}. Falling back to IAM.`),N.API={GraphQL:{endpoint:o,apiKey:t,region:r,defaultAuthMode:R??"iam"}},En&&(N.API.GraphQL.modelIntrospection=En)}const ds=c?{status:c&&c.toLowerCase(),totpEnabled:u?.includes("TOTP")??!1,smsEnabled:u?.includes("SMS")??!1}
1:void 0,ls=d?{minLength:d.passwordPolicyMinLength,requireLowercase:d.passwordPolicyCharacters?.includes("REQUIRES_LOWERCASE")??!1,requireUppercase:d.passwordPolicyCharacters?.includes("REQUIRES_UPPERCASE")??!1,requireNumbers:d.passwordPolicyCharacters?.includes("REQUIRES_NUMBERS")??!1,requireSpecialCharacters:d.passwordPolicyCharacters?.includes("REQUIRES_SYMBOLS")??!1}:void 0,hs=Array.from(new Set([...l??[],...h??[]])).reduce((R,de)=>({...R,[de.toLowerCase()]:{required:!0}}),{}),mn=g?.includes("EMAIL")??!1,yn=g?.includes("PHONE_NUMBER")??!1;(i||Ce)&&(N.Auth={Cognito:{identityPoolId:i,allowGuestAccess:E!=="enable",signUpVerificationMethod:a,userAttributes:hs,userPoolClientId:cs,userPoolId:Ce,mfa:ds,passwordFormat:ls,loginWith:{username:!(mn||yn),email:mn,phone:yn}}});const fs=Tt?Object.keys(Tt).length>0:!1,ps=f?f.length>0:!1;if(N.Auth&&fs&&(N.Auth.Cognito.loginWith={...N.Auth.Cognito.loginWith,oauth:{...xs(Tt),...ps&&{providers:bs(f)}}}),H&&(N.Storage={S3:{bucket:H,region:ue,dangerouslyConnectToHttpEndpointForTesting:fn}}),pn){const{amazon_location_service:R}=pn;N.Geo={LocationService:{maps:R.maps,geofenceCollections:R.geofenceCollections,searchIndices:R.search_indices,region:R.region}}}if(gn&&(N.API={...N.API,REST:gn.reduce((R,de)=>{const{name:gs,endpoint:Es,region:Sn,service:In}=de;return{...R,[gs]:{endpoint:Es,...In?{service:In}:void 0,...Sn?{region:Sn}:void 0}}},{})}),Ae){const{VoiceId:R}=Ae?.convert?.speechGenerator?.defaults??{};N.Predictions=R?{...Ae,convert:{...Ae.convert,speechGenerator:{...Ae.convert.speechGenerator,defaults:{voiceId:R}}}}:Ae}return N},vn=e=>e?.split(",")??[],xs=({domain:e,scope:t,redirectSignIn:n,redirectSignOut:o,responseType:r})=>({domain:e,scopes:t,redirectSignIn:vn(n),redirectSignOut:vn(o),responseType:r}),bs=e=>e.map(t=>{const n=t.toLowerCase();return n.charAt(0).toUpperCase()+n.slice(1)}),Ns=Symbol("oauth-listener"),O=[];for(let e=0;e<256;++e)O.push((e+256).toString(16).slice(1));function Os(e,t=0){return(O[e[t+0]]+O[e[t+1]]+O[e[t+2]]+O[e[t+3]]+"-"+O[e[t+4]]+O[e[t+5]]+"-"+O[e[t+6]]+O[e[t+7]]+"-"+O[e[t+8]]+O[e[t+9]]+"-"+O[e[t+10]]+O[e[t+11]]+O[e[t+12]]+O[e[t+13]]+O[e[t+14]]+O[e[t+15]]).toLowerCase()}let xt;const Ds=new Uint8Array(16);function Ms(){if(!xt){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");xt=crypto.getRandomValues.bind(crypto)}return xt(Ds)}const Us=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Cn={randomUUID:Us};function Fs(e,t,n){if(Cn.randomUUID&&!t&&!e)return Cn.randomUUID();e=e||{};const o=e.random??e.rng?.()??Ms();if(o.length<16)throw new Error("Random bytes length must be >= 16");if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,t){if(n=n||0,n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let r=0;r<16;++r)t[n+r]=o[r];return t}return Os(o)}function ks(e){const{version:t}=e;return t?t.startsWith("1"):!1}function Ls(e){if(!e)return;const{bucket_name:t,aws_region:n,buckets:o}=e;return{S3:{bucket:t,region:n,buckets:o&&Ys(o)}}}function Ks(e){if(!e)return;const{user_pool_id:t,user_pool_client_id:n,identity_pool_id:o,password_policy:r,mfa_configuration:s,mfa_methods:i,unauthenticated_identities_enabled:a,oauth:c,username_attributes:u,standard_required_attributes:d,groups:l,passwordless:h}=e,f={Cognito:{userPoolId:t,userPoolClientId:n,groups:l}};return o&&(f.Cognito={...f.Cognito,identityPoolId:o}),r&&(f.Cognito.passwordFormat={requireLowercase:r.require_lowercase,requireNumbers:r.require_numbers,requireUppercase:r.require_uppercase,requireSpecialCharacters:r.require_symbols,minLength:r.min_length??6}),s&&(f.Cognito.mfa={status:zs(s),smsEnabled:i?.includes("SMS"),totpEnabled:i?.includes("TOTP")}),a&&(f.Cognito.allowGuestAccess=a),c&&(f.Cognito.loginWith={oauth:{domain:c.domain,redirectSignIn:c.redirect_sign_in_uri,redirectSignOut:c.redirect_sign_out_uri,responseType:c.response_type==="token"?"token":"code",scopes:c.scopes,providers:Gs(c.identity_providers)}}),u&&(f.Cognito.loginWith={...f.Cognito.loginWith,email:u.includes("email"),phone:u.includes("phone_number"),username:u.includes("username")}),d&&(f.Cognito.userAttributes=d.reduce((g,E)=>({...g,[E]:{required:!0}}),{})),h&&(f.Cognito.passwordless={emailOtpEnabled:h.email_otp_enabled,smsOtpEnabled:h.sms_otp_enabled,webAuthn:h.web_authn?{relyingPartyId:h.web_authn.relying_party_id,userVerification:h.web_authn.user_verification}:void 0,preferredChallenge:h.preferred_challenge}),f}function Bs(e){if(!e?.amazon_pinpoint)return;const{amazon_pinpoint:t}=e;return{Pinpoint:{appId:t.app_id,region:t.aws_region}}}function Ws(e){if(!e)return;const{aws_region:t,geofence_collections:n,maps:o,search_indices:r}=e;return{LocationService:{region:t,searchIndices:r,geofenceCollections:n,maps:o}}}function Hs(e){if(!e)return;const{aws_region:t,default_authorization_type:n,url:o,api_key:r,model_introspection:s}=e;return{GraphQL:{endpoint:o,defaultAuthMode:Lo(n),region:t,apiKey:r,modelIntrospection:s}}}function Vs(e){if(!e?.events)return;const{url:t,aws_region:n,api_key:o,default_authorization_type:r}=e.events;return{Events:{endpoint:t,defaultAuthMode:Lo(r),region:n,apiKey:o}}}function qs(e){if(!e)return;const{aws_region:t,channels:n,amazon_pinpoint_app_id:o}=e,r=n.includes("IN_APP_MESSAGING"),s=n.includes("APNS")||n.includes("FCM");if(!(r||s))return;const i={};return r&&(i.InAppMessaging={Pinpoint:{appId:o,region:t}}),s&&(i.PushNotification={Pinpoint:{appId:o,region:t}}),i}function $s(e){const t={};if(e.storage&&(t.Storage=Ls(e.storage)),e.auth&&(t.Auth=Ks(e.auth)),e.analytics&&(t.Analytics=Bs(e.analytics)),e.geo&&(t.Geo=Ws(e.geo)),e.data&&(t.API=Hs(e.data)),e.custom){const n=Vs(e.custom);
1n&&"Events"in n&&(t.API={...t.API,...n})}return e.notifications&&(t.Notifications=qs(e.notifications)),t}const js={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"};function Lo(e){return js[e]}const An={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"};function Gs(e=[]){return e.reduce((t,n)=>(An[n]!==void 0&&t.push(An[n]),t),[])}function zs(e){return e==="OPTIONAL"?"optional":e==="REQUIRED"?"on":"off"}function Ys(e){const t={};return e.forEach(({name:n,bucket_name:o,aws_region:r,paths:s})=>{if(n in t)throw new Error(`Duplicate friendly name found: ${n}. Name must be unique.`);const i=s?Object.entries(s).reduce((a,[c,u])=>(u!==void 0&&(a[c]=u),a),{}):void 0;t[n]={bucketName:o,region:r,paths:i}}),t}const Ko=e=>Object.keys(e).some(t=>t.startsWith("aws_"))?_s(e):ks(e)?$s(e):e;var Mt=function(e,t){return Mt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])},Mt(e,t)};function qe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Mt(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var lt=function(){return lt=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},lt.apply(this,arguments)};function Bo(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Wo(e,t,n,o){var r=arguments.length,s=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s}function Ho(e,t){return function(n,o){t(n,o,e)}}function Js(e,t,n,o,r,s){function i(I){if(I!==void 0&&typeof I!="function")throw new TypeError("Function expected");return I}for(var a=o.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!t&&e?o.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),l,h=!1,f=n.length-1;f>=0;f--){var g={};for(var E in o)g[E]=E==="access"?{}:o[E];for(var E in o.access)g.access[E]=o.access[E];g.addInitializer=function(I){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(I||null))};var S=(0,n[f])(a==="accessor"?{get:d.get,set:d.set}:d[c],g);if(a==="accessor"){if(S===void 0)continue;if(S===null||typeof S!="object")throw new TypeError("Object expected");(l=i(S.get))&&(d.get=l),(l=i(S.set))&&(d.set=l),(l=i(S.init))&&r.unshift(l)}else(l=i(S))&&(a==="field"?r.unshift(l):d[c]=l)}u&&Object.defineProperty(u,o.name,d),h=!0}function Xs(e,t,n){for(var o=arguments.length>2,r=0;r<t.length;r++)n=o?t[r].call(e,n):t[r].call(e);return o?n:void 0}function Qs(e){return typeof e=="symbol"?e:"".concat(e)}function Zs(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function Vo(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function gt(e,t,n,o){function r(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function a(d){try{u(o.next(d))}catch(l){i(l)}}function c(d){try{u(o.throw(d))}catch(l){i(l)}}function u(d){d.done?s(d.value):r(d.value).then(a,c)}u((o=o.apply(e,t||[])).next())})}function $e(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o,r,s,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(u){return function(d){return c([u,d])}}function c(u){if(o)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(n=0)),n;)try{if(o=1,r&&(s=u[0]&2?r.return:u[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,u[1])).done)return s;switch(r=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,r=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],r=0}finally{o=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Et=Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);
1(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]});function qo(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Et(t,e,n)}function ge(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Te(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,s=[],i;try{for(;(t===void 0||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}function $o(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Te(arguments[t]));return e}function jo(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var o=Array(e),r=0,t=0;t<n;t++)for(var s=arguments[t],i=0,a=s.length;i<a;i++,r++)o[r]=s[i];return o}function Be(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,s;o<r;o++)(s||!(o in t))&&(s||(s=Array.prototype.slice.call(t,0,o)),s[o]=t[o]);return e.concat(s||Array.prototype.slice.call(t))}function se(e){return this instanceof se?(this.v=e,this):new se(e)}function Yt(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=n.apply(e,t||[]),r,s=[];return r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r;function i(h){o[h]&&(r[h]=function(f){return new Promise(function(g,E){s.push([h,f,g,E])>1||a(h,f)})})}function a(h,f){try{c(o[h](f))}catch(g){l(s[0][3],g)}}function c(h){h.value instanceof se?Promise.resolve(h.value.v).then(u,d):l(s[0][2],h)}function u(h){a("next",h)}function d(h){a("throw",h)}function l(h,f){h(f),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Go(e){var t,n;return t={},o("next"),o("throw",function(r){throw r}),o("return"),t[Symbol.iterator]=function(){return this},t;function o(r,s){t[r]=e[r]?function(i){return(n=!n)?{value:se(e[r](i)),done:!1}:s?s(i):i}:s}}function Jt(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof ge=="function"?ge(e):e[Symbol.iterator](),n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n);function o(s){n[s]=e[s]&&function(i){return new Promise(function(a,c){i=e[s](i),r(a,c,i.done,i.value)})}}function r(s,i,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},i)}}function zo(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var ei=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t};function Yo(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Et(t,e,n);return ei(t,e),t}function Jo(e){return e&&e.__esModule?e:{default:e}}function Xo(e,t,n,o){if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?o:n==="a"?o.call(e):o?o.value:t.get(e)}function Qo(e,t,n,o,r){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n}function Zo(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function er(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");o=t[Symbol.asyncDispose]}if(o===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");o=t[Symbol.dispose]}if(typeof o!="function")throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:o,async:n})}else n&&e.stack.push({async:!0});return t}var ti=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var o=new Error(n);return o.name="SuppressedError",o.error=e,o.suppressed=t,o};function tr(e){function t(o){e.error=e.hasError?new ti(o,e.error,"An error was suppressed during disposal."):o,e.hasError=!0}function n(){for(;e.stack.length;){var o=e.stack.pop();try{var r=o.dispose&&o.dispose.call(o.value);if(o.async)return Promise.resolve(r).then(n,function(s){return t(s),n()})}catch(s){t(s)}}if(e.hasError)throw e.error}return n()}const ni={__extends:qe,__assign:lt,__rest:Bo,__decorate:Wo,__param:Ho,__metadata:Vo,__awaiter:gt,__generator:$e,__createBinding:Et,__exportStar:qo,__values:ge,__read:Te,__spread:$o,__spreadArrays:jo,__spreadArray:Be,__await:se,__asyncGenerator:Yt,__asyncDelegator:Go,__asyncValues:Jt,__makeTemplateOb
1ject:zo,__importStar:Yo,__importDefault:Jo,__classPrivateFieldGet:Xo,__classPrivateFieldSet:Qo,__classPrivateFieldIn:Zo,__addDisposableResource:er,__disposeResources:tr},Pl=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:er,get __assign(){return lt},__asyncDelegator:Go,__asyncGenerator:Yt,__asyncValues:Jt,__await:se,__awaiter:gt,__classPrivateFieldGet:Xo,__classPrivateFieldIn:Zo,__classPrivateFieldSet:Qo,__createBinding:Et,__decorate:Wo,__disposeResources:tr,__esDecorate:Js,__exportStar:qo,__extends:qe,__generator:$e,__importDefault:Jo,__importStar:Yo,__makeTemplateObject:zo,__metadata:Vo,__param:Ho,__propKey:Qs,__read:Te,__rest:Bo,__runInitializers:Xs,__setFunctionName:Zs,__spread:$o,__spreadArray:Be,__spreadArrays:jo,__values:ge,default:ni},Symbol.toStringTag,{value:"Module"}));var V=64,oi=32,ri=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),si=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],ii=Math.pow(2,53)-1,ct=(function(){function e(){this.state=Int32Array.from(si),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(t){if(this.finished)throw new Error("Attempted to update an already finished hash.");var n=0,o=t.byteLength;if(this.bytesHashed+=o,this.bytesHashed*8>ii)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;o>0;)this.buffer[this.bufferLength++]=t[n++],o--,this.bufferLength===V&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var t=this.bytesHashed*8,n=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),o=this.bufferLength;if(n.setUint8(this.bufferLength++,128),o%V>=V-8){for(var r=this.bufferLength;r<V;r++)n.setUint8(r,0);this.hashBuffer(),this.bufferLength=0}for(var r=this.bufferLength;r<V-8;r++)n.setUint8(r,0);n.setUint32(V-8,Math.floor(t/4294967296),!0),n.setUint32(V-4,t),this.hashBuffer(),this.finished=!0}for(var s=new Uint8Array(oi),r=0;r<8;r++)s[r*4]=this.state[r]>>>24&255,s[r*4+1]=this.state[r]>>>16&255,s[r*4+2]=this.state[r]>>>8&255,s[r*4+3]=this.state[r]>>>0&255;return s},e.prototype.hashBuffer=function(){for(var t=this,n=t.buffer,o=t.state,r=o[0],s=o[1],i=o[2],a=o[3],c=o[4],u=o[5],d=o[6],l=o[7],h=0;h<V;h++){if(h<16)this.temp[h]=(n[h*4]&255)<<24|(n[h*4+1]&255)<<16|(n[h*4+2]&255)<<8|n[h*4+3]&255;else{var f=this.temp[h-2],g=(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10;f=this.temp[h-15];var E=(f>>>7|f<<25)^(f>>>18|f<<14)^f>>>3;this.temp[h]=(g+this.temp[h-7]|0)+(E+this.temp[h-16]|0)}var S=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&u^~c&d)|0)+(l+(ri[h]+this.temp[h]|0)|0)|0,I=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&s^r&i^s&i)|0;l=d,d=u,u=c,c=a+S|0,a=i,i=s,s=r,r=S+I|0}o[0]+=r,o[1]+=s,o[2]+=i,o[3]+=a,o[4]+=c,o[5]+=u,o[6]+=d,o[7]+=l},e})();const ai=e=>new TextEncoder().encode(e);var ci=typeof Buffer<"u"&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:ai;function nr(e){return e instanceof Uint8Array?e:typeof e=="string"?ci(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function ui(e){return typeof e=="string"?e.length===0:e.byteLength===0}var We=(function(){function e(t){this.secret=t,this.hash=new ct,this.reset()}return e.prototype.update=function(t){if(!(ui(t)||this.error))try{this.hash.update(nr(t))}catch(n){this.error=n}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return gt(this,void 0,void 0,function(){return $e(this,function(t){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new ct,this.secret){this.outer=new ct;var t=di(this.secret),n=new Uint8Array(V);n.set(t);for(var o=0;o<V;o++)t[o]^=54,n[o]^=92;this.hash.update(t),this.outer.update(n);for(var o=0;o<t.byteLength;o++)t[o]=0}},e})();function di(e){var t=nr(e);
1if(t.byteLength>V){var n=new ct;n.update(t),t=n.digest()}var o=new Uint8Array(V);return o.set(t),o}const or={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),or[e]=t}function li(e){let t="";for(let n=0;n<e.byteLength;n++)t+=or[e[n]];return t}var x;(function(e){e.WebUnknown="0",e.React="1",e.NextJs="2",e.Angular="3",e.VueJs="4",e.Nuxt="5",e.Svelte="6",e.ServerSideUnknown="100",e.ReactSSR="101",e.NextJsSSR="102",e.AngularSSR="103",e.VueJsSSR="104",e.NuxtSSR="105",e.SvelteSSR="106",e.ReactNative="201",e.Expo="202"})(x||(x={}));var Ut;(function(e){e.AI="ai",e.API="api",e.Auth="auth",e.Analytics="analytics",e.DataStore="datastore",e.Geo="geo",e.InAppMessaging="inappmessaging",e.Interactions="interactions",e.Predictions="predictions",e.PubSub="pubsub",e.PushNotification="pushnotification",e.Storage="storage"})(Ut||(Ut={}));var Pn;(function(e){e.CreateConversation="1",e.GetConversation="2",e.ListConversations="3",e.DeleteConversation="4",e.SendMessage="5",e.ListMessages="6",e.OnMessage="7",e.Generation="8",e.UpdateConversation="9"})(Pn||(Pn={}));var Tn;(function(e){e.Record="1",e.IdentifyUser="2"})(Tn||(Tn={}));var Rn;(function(e){e.GraphQl="1",e.Get="2",e.Post="3",e.Put="4",e.Patch="5",e.Del="6",e.Head="7"})(Rn||(Rn={}));var P;(function(e){e.SignUp="1",e.ConfirmSignUp="2",e.ResendSignUpCode="3",e.SignIn="4",e.FetchMFAPreference="6",e.UpdateMFAPreference="7",e.SetUpTOTP="10",e.VerifyTOTPSetup="11",e.ConfirmSignIn="12",e.DeleteUserAttributes="15",e.DeleteUser="16",e.UpdateUserAttributes="17",e.FetchUserAttributes="18",e.ConfirmUserAttribute="22",e.SignOut="26",e.UpdatePassword="27",e.ResetPassword="28",e.ConfirmResetPassword="29",e.FederatedSignIn="30",e.RememberDevice="32",e.ForgetDevice="33",e.FetchDevices="34",e.SendUserAttributeVerificationCode="35",e.SignInWithRedirect="36",e.StartWebAuthnRegistration="37",e.CompleteWebAuthnRegistration="38",e.ListWebAuthnCredentials="39",e.DeleteWebAuthnCredential="40"})(P||(P={}));var _n;(function(e){e.Subscribe="1",e.GraphQl="2"})(_n||(_n={}));var xn;(function(e){e.SearchByText="0",e.SearchByCoordinates="1",e.SearchForSuggestions="2",e.SearchByPlaceId="3",e.SaveGeofences="4",e.GetGeofence="5",e.ListGeofences="6",e.DeleteGeofences="7"})(xn||(xn={}));var bn;(function(e){e.SyncMessages="1",e.IdentifyUser="2",e.NotifyMessageInteraction="3"})(bn||(bn={}));var Nn;(function(e){e.None="0"})(Nn||(Nn={}));var On;(function(e){e.Convert="1",e.Identify="2",e.Interpret="3"})(On||(On={}));var Dn;(function(e){e.Subscribe="1"})(Dn||(Dn={}));var Mn;(function(e){e.InitializePushNotifications="1",e.IdentifyUser="2"})(Mn||(Mn={}));var Un;(function(e){e.UploadData="1",e.DownloadData="2",e.List="3",e.Copy="4",e.Remove="5",e.GetProperties="6",e.GetUrl="7",e.GetDataAccess="8",e.ListCallerAccessGrants="9"})(Un||(Un={}));const hi="6.16.2",mt=()=>typeof global<"u",_e=()=>typeof window<"u",rr=()=>typeof document<"u",Xt=()=>typeof process<"u",He=(e,t)=>!!Object.keys(e).find(n=>n.startsWith(t));var Fn={};function fi(){const e=o=>o.startsWith("_react")||o.startsWith("__react"),t=o=>Object.keys(o).find(e),n=()=>Array.from(document.querySelectorAll("[id]"));return rr()&&n().some(t)}function pi(){return Xt()&&typeof Fn<"u"&&!!Object.keys(Fn).find(e=>e.includes("react"))}function gi(){return _e()&&He(window,"__VUE")}function Ei(){return mt()&&He(global,"__VUE")}var kn={};function mi(){return _e()&&He(window,"__SVELTE")}function yi(){return Xt()&&typeof kn<"u"&&!!Object.keys(kn).find(e=>e.includes("svelte"))}function Si(){return _e()&&window.next&&typeof window.next=="object"}function Ii(){return mt()&&(He(global,"__next")||He(global,"__NEXT"))}function wi(){return _e()&&(window.__NUXT__!==void 0||window.$nuxt!==void 0)}function vi(){return mt()&&typeof global.__NUXT_PATHS__<"u"}var Ln={};function Ci(){const e=!!(rr()&&document.querySelector("[ng-version]")),t=!!(_e()&&typeof window.ng<"u");return e||t}function Ai(){return Xt()&&typeof Ln=="object"&&Ln.npm_lifecycle_script?.startsWith("ng ")||!1}function Pi(){return typeof navigator<"u"&&typeof navigator.product<"u"&&navigator.product==="ReactNative"}function Ti(){return mt()&&typeof global.expo<"u"}function Ri(){return _e()}const _i=[{platform:x.Expo,detectionMethod:Ti},{platform:x.ReactNative,detectionMethod:Pi},{platform:x.NextJs,detectionMethod:Si},{platform:x.Nuxt,detectionMethod:wi},{platform:x.Angular,detectionMethod:Ci},{platform:x.React,detectionMethod:fi},{platform:x.VueJs,detectionMethod:gi},{platform:x.Svelte,detectionMethod:mi},{platform:x.WebUnknown,detectionMethod:Ri},{platform:x.NextJsSSR,detectionMethod:Ii},{platform:x.NuxtSSR,detectionMethod:vi},{platform:x.ReactSSR,detectionMethod:pi},{platform:x.VueJsSSR,detectionMethod:Ei},{platform:x.AngularSSR,detectionMethod:Ai},{platform:x.SvelteSSR,detectionMethod:yi}];function xi(){return _i.find(e=>e.detectionMethod())?.platform||x.ServerSideUnknown}let Le;const bt=[];let Ft=!1;const bi=10,Ni=10,Oi=1e3,sr=()=>{if(!Le){if(Le=xi(),Ft)for(;bt.length;)bt.pop()?.();
1else bt.forEach(e=>{e()});Kn(x.ServerSideUnknown,bi),Kn(x.WebUnknown,Ni)}return Le};function Di(){Le=void 0}function Kn(e,t){Le===e&&!Ft&&setTimeout(()=>{Di(),Ft=!0,setTimeout(sr,Oi)},t)}const Mi={},Ui=(e,t)=>Mi[e]?.[t]?.additionalDetails,Fi="aws-amplify",ki=e=>e.replace(/\+.*/,""),Li=({category:e,action:t}={})=>{const n=[[Fi,ki(hi)]];if(e&&n.push([e,t]),n.push(["framework",sr()]),e&&t){const o=Ui(e,t);o&&o.forEach(r=>{n.push(r)})}return n},yt=e=>Li(e).map(([o,r])=>o&&r?`${o}/${r}`:o).join(" ");function D(e){return typeof e=="function"}function Ki(e){var t=function(o){Error.call(o),o.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Nt=Ki(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
2`+n.map(function(o,r){return r+1+") "+o.toString()}).join(`
3  `):"",this.name="UnsubscriptionError",this.errors=n}});function Bn(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Qt=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,o,r,s;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var a=ge(i),c=a.next();!c.done;c=a.next()){var u=c.value;u.remove(this)}}catch(E){t={error:E}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}else i.remove(this);var d=this.initialTeardown;if(D(d))try{d()}catch(E){s=E instanceof Nt?E.errors:[E]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var h=ge(l),f=h.next();!f.done;f=h.next()){var g=f.value;try{Wn(g)}catch(E){s=s??[],E instanceof Nt?s=Be(Be([],Te(s)),Te(E.errors)):s.push(E)}}}catch(E){o={error:E}}finally{try{f&&!f.done&&(r=h.return)&&r.call(h)}finally{if(o)throw o.error}}}if(s)throw new Nt(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Wn(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&Bn(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&Bn(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})();Qt.EMPTY;function ir(e){return e instanceof Qt||e&&"closed"in e&&D(e.remove)&&D(e.add)&&D(e.unsubscribe)}function Wn(e){D(e)?e():e.unsubscribe()}var Bi={Promise:void 0},Wi={setTimeout:function(e,t){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];return setTimeout.apply(void 0,Be([e,t],Te(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function ar(e){Wi.setTimeout(function(){throw e})}function Hn(){}function Hi(e){e()}var Zt=(function(e){qe(t,e);function t(n){var o=e.call(this)||this;return o.isStopped=!1,n?(o.destination=n,ir(n)&&n.add(o)):o.destination=$i,o}return t.create=function(n,o,r){return new kt(n,o,r)},t.prototype.next=function(n){this.isStopped||this._next(n)},t.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Qt),Vi=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(o){tt(o)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}
vendor: 4,339 bytes, line 3
3catch(o){tt(o)}else tt(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){tt(n)}},e})(),kt=(function(e){qe(t,e);function t(n,o,r){var s=e.call(this)||this,i;return D(n)||!n?i={next:n??void 0,error:o??void 0,complete:r??void 0}:i=n,s.destination=new Vi(i),s}return t})(Zt);function tt(e){ar(e)}function qi(e){throw e}var $i={closed:!0,next:Hn,error:qi,complete:Hn},en=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function ji(e){return e}function Gi(e){return e.length===0?ji:e.length===1?e[0]:function(n){return e.reduce(function(o,r){return r(o)},n)}}var te=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,o){var r=this,s=Yi(t)?t:new kt(t,n,o);return Hi(function(){var i=r,a=i.operator,c=i.source;s.add(a?a.call(s,c):c?r._subscribe(s):r._trySubscribe(s))}),s},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var o=this;return n=Vn(n),new n(function(r,s){var i=new kt({next:function(a){try{t(a)}catch(c){s(c),i.unsubscribe()}},error:s,complete:r});o.subscribe(i)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[en]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Gi(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=Vn(t),new t(function(o,r){var s;n.subscribe(function(i){return s=i},function(i){return r(i)},function(){return o(s)})})},e.create=function(t){return new e(t)},e})();function Vn(e){var t;return(t=e??Bi.Promise)!==null&&t!==void 0?t:Promise}function zi(e){return e&&D(e.next)&&D(e.error)&&D(e.complete)}function Yi(e){return e&&e instanceof Zt||zi(e)&&ir(e)}function Ji(e){return D(e?.lift)}function je(e){return function(t){if(Ji(t))return t.lift(function(n){try{return e(n,this)}catch(o){this.error(o)}});throw new TypeError("Unable to lift unknown Observable type")}}function St(e,t,n,o,r){return new Xi(e,t,n,o,r)}var Xi=(function(e){qe(t,e);function t(n,o,r,s,i,a){var c=e.call(this,n)||this;return c.onFinalize=i,c.shouldUnsubscribe=a,c._next=o?function(u){try{o(u)}catch(d){n.error(d)}}:e.prototype._next,c._error=s?function(u){try{s(u)}catch(d){n.error(d)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=r?function(){try{r()}catch(u){n.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,c}return t.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var o=this.closed;e.prototype.unsubscribe.call(this),!o&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},t})(Zt),cr=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function ur(e){return D(e?.then)}function dr(e){return D(e[en])}function lr(e){return Symbol.asyncIterator&&D(e?.[Symbol.asyncIterator])}function hr(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Qi(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var fr=Qi();function pr(e){return D(e?.[fr])}function gr(e){return Yt(this,arguments,function(){var n,o,r,s;return $e(this,function(i){switch(i.label){case 0:n=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,se(n.read())];case 3:return o=i.sent(),r=o.value,s=o.done,s?[4,se(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,se(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Er(e){return D(e?.getReader)}function It(e){if(e instanceof te)return e;if(e!=null){if(dr(e))return Zi(e);if(cr(e))return ea(e);if(ur(e))return ta(e);if(lr(e))return mr(e);if(pr(e))return na(e);if(Er(e))return oa(e)}throw hr(e)}function Zi(e){return new te(function(t){var n=e[en]();if(D(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ea(e){return new te(function(t){for(var n=0;n<e.length&&!t.closed;
3n++)t.next(e[n]);t.complete()})}function ta(e){return new te(function(t){e.then(function(n){t.closed||(t.next(n),t.complete())},function(n){return t.error(n)}).then(null,ar)})}function na(e){return new te(function(t){var n,o;try{for(var r=ge(e),s=r.next();!s.done;s=r.next()){var i=s.value;if(t.next(i),t.closed)return}}catch(a){n={error:a}}finally{try{s&&!s.done&&(o=r.return)&&o.call(r)}finally{if(n)throw n.error}}t.complete()})}function mr(e){return new te(function(t){ra(e,t).catch(function(n){return t.error(n)})})}function oa(e){return mr(gr(e))}function ra(e,t){var n,o,r,s;return gt(this,void 0,void 0,function(){var i,a;return $e(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=Jt(e),c.label=1;case 1:return[4,n.next()];case 2:if(o=c.sent(),!!o.done)return[3,4];if(i=o.value,t.next(i),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),r={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),o&&!o.done&&(s=n.return)?[4,s.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(r)throw r.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function le(e,t,n,o,r){o===void 0&&(o=0),r===void 0&&(r=!1);var s=t.schedule(function(){n(),r?e.add(this.schedule(null,o)):this.unsubscribe()},o);if(e.add(s),!r)return s}function yr(e,t){return t===void 0&&(t=0),je(function(n,o){n.subscribe(St(o,function(r){return le(o,e,function(){return o.next(r)},t)},function(){return le(o,e,function(){return o.complete()},t)},function(r){return le(o,e,function(){return o.error(r)},t)}))})}function Sr(e,t){return t===void 0&&(t=0),je(function(n,o){o.add(e.schedule(function(){return n.subscribe(o)},t))})}function sa(e,t){return It(e).pipe(Sr(t),yr(t))}function ia(e,t){return It(e).pipe(Sr(t),yr(t))}function aa(e,t){return new te(function(n){var o=0;return t.schedule(function(){o===e.length?n.complete():(n.next(e[o++]),n.closed||this.schedule())})})}function ca(e,t){return new te(function(n){var o;return le(n,t,function(){o=e[fr](),le(n,t,function(){var r,s,i;try{r=o.next(),s=r.value,i=r.done}catch(a){n.error(a);return}i?n.complete():n.next(s)},0,!0)}),function(){return D(o?.return)&&o.return()}})}function Ir(e,t){if(!e)throw new Error("Iterable cannot be null");return new te(function(n){le(n,t,function(){var o=e[Symbol.asyncIterator]();le(n,t,function(){o.next().then(function(r){r.done?n.complete():n.next(r.value)})},0,!0)})})}function ua(e,t){return Ir(gr(e),t)}function da(e,t){if(e!=null){if(dr(e))return sa(e,t);if(cr(e))return aa(e,t);if(ur(e))return ia(e,t);if(lr(e))return Ir(e,t);if(pr(e))return ca(e,t);if(Er(e))return ua(e,t)}throw hr(e)}function la(e,t){return t?da(e,t):It(e)}function Tl(e,t){return je(function(n,o){var r=0;n.subscribe(St(o,function(s){o.next(e.call(t,s,r++))}))})}function Rl(e,t){return je(function(n,o){var r=0;n.subscribe(St(o,function(s){return e.call(t,s,r++)&&o.next(s)}))})}function ha(e){return je(function(t,n){var o=null,r=!1,s;o=t.subscribe(St(n,void 0,void 0,function(i){s=It(e(i,ha(e)(t))),o?(o.unsubscribe(),o=null,s.subscribe(n)):r=!0})),r&&(o.unsubscribe(),o=null,s.subscribe(n))})}const fa=()=>{if(typeof self>"u")return!1;const e=self;return typeof e.WorkerGlobalScope<"u"&&self instanceof e.WorkerGlobalScope};class Ke{networkMonitor(t){const n=fa()?self:typeof window<"u"&&window;return n?new te(o=>{o.next({online:n.navigator.onLine});const r=()=>{o.next({online:!0})},s=()=>{o.next({online:!1})};return n.addEventListener("online",r),n.addEventListener("offline",s),Ke._observers.push(o),()=>{n.removeEventListener("online",r),n.removeEventListener("offline",s),Ke._observers=Ke._observers.filter(i=>i!==o)}}):la([{online:!0}])}static _observerOverride(t){for(const n of this._observers){if(n.closed){this._observers=this._observers.filter(o=>o!==n);continue}n?.next&&n.next(t)}}}Ke._observers=[];const wr=()=>typeof window<"u"&&typeof window.document<"u",qn=new k("Auth");class pa{configure(t,n){this.authConfig=t,this.authOptions=n,t&&t.Cognito?.userPoolEndpoint&&qn.warn($n("Amazon Cognito User Pool")),t&&t.Cognito?.identityPoolEndpoint&&qn.warn($n("Amazon Cognito Identity Pool"))}async fetchAuthSession(t={}){let n,o;const r=await this.getTokens(t);return r?(o=r.accessToken?.payload?.sub,n=await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,tokens:r,authenticated:!0,forceRefresh:t.forceRefresh})):n=await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,authenticated:!1,forceRefresh:t.forceRefresh}),{tokens:r,credentials:n?.credentials,identityId:n?.identityId,userSub:o}}async clearCredentials(){await this.authOptions?.credentialsProvider?.clearCredentialsAndIdentityId()}async getTokens(t){return await this.authOptions?.tokenProvider?.getTokens(t)??void 0}}const $n=e=>`You are using a custom Amazon ${e} endpoint, ensure the endpoint is correct.`;class ga{constructor(){this.oAuthListener=void 0,this.isConfigured=!1,this.resourcesConfig={},this.libraryOptions={},this.Auth=new pa}configure(t,n){const o=Ko(t);this.resourcesConfig=o,n&&(this.libraryOptions=n),this.resourcesConfig=ko(this.resourcesConfig),this.Auth.configure(this.resourcesConfig.Auth,this.libraryOptions.Auth),(this.resourcesConfig.Analytics?.Pinpoint||this.resourcesConfig.Notifications?.InAppMessaging?.Pinpoint||this.resourcesConfig.Notifications?.PushNotification?.Pinpoint)&&console.warn("AWS will end support for Amazon Pinpoint on October 30, 2026. The guidance is to use AWS End User Messaging for push notifications and 
3SMS, Amazon Simple Email Service for sending emails, Amazon Connect for campaigns, journeys, endpoints, and engagement analytics. Pinpoint recommends Amazon Kinesis for event collection and mobile analytics."),Pe.dispatch("core",{event:"configure",data:this.resourcesConfig},"Configure",fe),this.notifyOAuthListener(),this.isConfigured=!0}getConfig(){return this.isConfigured||console.warn("Amplify has not been configured. Please call Amplify.configure() before using this service."),this.resourcesConfig}[Ns](t){this.resourcesConfig.Auth?.Cognito.loginWith?.oauth?t(this.resourcesConfig.Auth?.Cognito):this.oAuthListener=t}notifyOAuthListener(){!this.resourcesConfig.Auth?.Cognito.loginWith?.oauth||!this.oAuthListener||(this.oAuthListener(this.resourcesConfig.Auth?.Cognito),this.oAuthListener=void 0)}}const A=new ga,vr=(e,t)=>e.Auth.fetchAuthSession(t),Ea=e=>vr(A,e);function Cr(){return A.Auth.clearCredentials()}const wt=e=>{const{headers:t,statusCode:n}=e;return{...ma(e)?e.$metadata:{},httpStatusCode:n,requestId:t["x-amzn-requestid"]??t["x-amzn-request-id"]??t["x-amz-request-id"],extendedRequestId:t["x-amz-id-2"],cfId:t["x-amz-cf-id"]}},ma=e=>typeof e?.$metadata=="object",Ge=async e=>{if(!e||e.statusCode<300)return;const t=await vt(e),o=(i=>{const[a]=i.toString().split(/[,:]+/);return a.includes("#")?a.split("#")[1]:a})(e.headers["x-amzn-errortype"]??t.code??t.__type??"UnknownError"),r=t.message??t.Message??"Unknown error",s=new Error(r);return Object.assign(s,{name:o,$metadata:wt(e)})},vt=async e=>{if(!e.body)throw new Error("Missing response payload");const t=await e.body.json();return Object.assign(t,{$metadata:wt(e)})},K=(e,t,n,o)=>async(r,s)=>{const i={...o,...r},a=await i.endpointResolver(i,s),c=await t(s,a),u=await e(c,{...i});return n(u)},Ar=300*1e3;function Pr(e=Ar){return o=>{const r=2**o*100+100*Math.random();return r>e?!1:r}}const Tr=3,jn="amz-sdk-invocation-id",ya="amz-sdk-request",Gn=300*1e3,Rr=e=>{const n=Pr(Gn)(e);return n===!1?Gn:n},Sa=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],Ia=e=>!!e&&Sa.includes(e),_r=e=>async(t,n)=>{const o=n??await e(t)??void 0,r=o?.code||o?.name,s=t?.statusCode;return{retryable:Aa(n)||Ca(s,r)||Ia(r)||Pa(s,r)}},wa=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],va=["TimeoutError","RequestTimeout","RequestTimeoutException"],Ca=(e,t)=>e===429||!!t&&wa.includes(t),Aa=e=>[he.NetworkError,"ERR_NETWORK"].includes(e?.name),Pa=(e,t)=>!!e&&[500,502,503,504].includes(e)||!!t&&va.includes(t),xr="cognito-identity",br={service:xr,retryDecider:_r(Ge),computeDelay:Rr,cache:"no-store"},Ta=({maxAttempts:e=Tr,retryDecider:t,computeDelay:n,abortSignal:o})=>{if(e<1)throw new Error("maxAttempts must be greater than 0");return(r,s)=>async function(a){let c,u=s.attemptsCount??0,d;const l=()=>{if(d)return zn(d,u),d;throw zn(c,u),c};for(;!o?.aborted&&u<e;){try{d=await r(a),c=void 0}catch(g){c=g,d=void 0}u=(s.attemptsCount??0)>u?s.attemptsCount??0:u+1,s.attemptsCount=u;const{isCredentialsExpiredError:h,retryable:f}=await t(d,c,s);if(f){if(s.isCredentialsExpired=!!h,!o?.aborted&&u<e){const g=n(u);await Ra(g,o)}continue}else return l()}if(o?.aborted)throw new Error("Request aborted.");return l()}},Ra=(e,t)=>{if(t?.aborted)return Promise.resolve();let n,o;const r=new Promise(s=>{o=s,n=setTimeout(s,e)});return t?.addEventListener("abort",function s(i){clearTimeout(n),t?.removeEventListener("abort",s),o()}),r},zn=(e,t)=>{Object.prototype.toString.call(e)==="[object Object]"&&(e.$metadata={...e.$metadata??{},attempts:t})},_a=Fs,xa=()=>e=>async function(n){return n.headers[jn]||(n.headers[jn]=_a()),e(n)},ba=({maxAttempts:e=Tr})=>(t,n)=>async function(r){const s=n.attemptsCount??0;return r.headers[ya]=`attempt=${s+1}; max=${e}`,t(r)},Na=({userAgentHeader:e="x-amz-user-agent",userAgentValue:t=""})=>n=>async function(r){if(t.trim().length===0)return await n(r);{const s=e.toLowerCase();return r.headers[s]=r.headers[s]?`${r.headers[s]} ${t}`:t,await n(r)}},tn=(e,t)=>(n,o)=>{const r={};let s=i=>e(i,o);for(let i=t.length-1;i>=0;i--){const a=t[i];s=a(o)(s,r)}return s(n)},Ot=e=>{let t;return()=>(t||(t=e()),t)},Oa=e=>!["HEAD","GET"].includes(e.toUpperCase()),Da=async({url:e,method:t,headers:n,body:o}
3,{abortSignal:r,cache:s,withCrossDomainCredentials:i})=>{let a;try{a=await fetch(e,{method:t,headers:n,body:Oa(t)?o:void 0,signal:r,cache:s,credentials:i?"include":"same-origin"})}catch(l){throw l instanceof TypeError?new U({name:he.NetworkError,message:"A network error has occurred.",underlyingError:l}):l}const c={};a.headers?.forEach((l,h)=>{c[h.toLowerCase()]=l});const u={statusCode:a.status,headers:c,body:null},d=Object.assign(a.body??{},{text:Ot(()=>a.text()),blob:Ot(()=>a.blob()),json:Ot(()=>a.json())});return{...u,body:d}},Nr=tn(Da,[Na,xa,Ta,ba]),Ma=()=>e=>async function(n){return n.headers["cache-control"]="no-store",e(n)},Or=tn(Nr,[Ma]),Dr=e=>(t,n)=>{const o=Ua(e),r=JSON.stringify(t);return Fa(n,o,r)},Ua=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${e}`}),Fa=({url:e},t,n)=>({headers:t,url:e,body:n,method:"POST"}),Yn=e=>K(Or,Dr("GetCredentialsForIdentity"),ka,{...br,...e,userAgentValue:yt()}),ka=async e=>{if(e.statusCode>=300)throw await Ge(e);const t=await vt(e);return{IdentityId:t.IdentityId,Credentials:La(t.Credentials),$metadata:wt(e)}},La=({Expiration:e,...t}={})=>({...t,Expiration:e&&new Date(e*1e3)}),Ka=e=>K(Or,Dr("GetId"),Ba,{...br,...e,userAgentValue:yt()}),Ba=async e=>{if(e.statusCode>=300)throw await Ge(e);return{IdentityId:(await vt(e)).IdentityId,$metadata:wt(e)}},Mr={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},Wa={partitions:[Mr,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},Ur=e=>{const{partitions:t}=Wa;for(const{regions:n,outputs:o,regionRegex:r}of t){const s=new RegExp(r);if(n.includes(e)||s.test(e))return o.dnsSuffix}return Mr.outputs.dnsSuffix},ze=URL,_l=URLSearchParams,Ha=({region:e})=>({url:new ze(`https://${xr}.${e}.${Ur(e)}`)});class Ue extends U{constructor(){super({name:he.PlatformNotSupported,message:"Function not supported on current platform"})}}class Fr{constructor(t){this.storage=t}async setItem(t,n){if(!this.storage)throw new Ue;this.storage.setItem(t,n)}async getItem(t){if(!this.storage)throw new Ue;return this.storage.getItem(t)}async removeItem(t){if(!this.storage)throw new Ue;this.storage.removeItem(t)}async clear(){if(!this.storage)throw new Ue;this.storage.clear()}}class kr{constructor(){this.storage=new Map}get length(){return this.storage.size}key(t){return t>this.length-1?null:Array.from(this.storage.keys())[t]}setItem(t,n){this.storage.set(t,n)}getItem(t){return this.storage.get(t)??null}removeItem(t){this.storage.delete(t)}clear(){this.storage.clear()}}const Lr=new k("CoreStorageUtils"),Va=()=>{try{if(typeof window<"u"&&window.localStorage)return window.localStorage}catch{Lr.info("localStorage not found. InMemoryStorage is used as a fallback.")}return new kr},Kr=()=>{try{if(typeof window<"u"&&window.sessionStorage)return window.sessionStorage.getItem("test"),window.sessionStorage;throw new Error("sessionStorage is not defined")}catch{return Lr.info("sessionStorage not found. InMemoryStorage is used as a fallback."),new kr}};class qa extends Fr{constructor(){super(Va())}}class $a extends Fr{constructor(){super(Kr())}}class ja{constructor(t){this._storage=t}get storage(){if(!this._storage)throw new Ue;return this._storage}setItem(t,n){this.storage.setItem(t,n)}getItem(t){return this.storage.getItem(t)}removeItem(t){this.storage.removeItem(t)}clear(){this.storage.clear()}}class Ga extends ja{constructor(){super(Kr())}}function nt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var za={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)}};function Lt(e,t){function n(r,s,i){if(!(typeof document>"u")){i=nt({},t,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decode
3URIComponent).replace(/[()]/g,escape);var a="";for(var c in i)i[c]&&(a+="; "+c,i[c]!==!0&&(a+="="+i[c].split(";")[0]));return document.cookie=r+"="+e.write(s,r)+a}}function o(r){if(!(typeof document>"u"||arguments.length&&!r)){for(var s=document.cookie?document.cookie.split("; "):[],i={},a=0;a<s.length;a++){var c=s[a].split("="),u=c.slice(1).join("=");try{var d=decodeURIComponent(c[0]);if(i[d]=e.read(u,d),r===d)break}catch{}}return r?i[r]:i}}return Object.create({set:n,get:o,remove:function(r,s){n(r,"",nt({},s,{expires:-1}))},withAttributes:function(r){return Lt(this.converter,nt({},this.attributes,r))},withConverter:function(r){return Lt(nt({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var ot=Lt(za,{path:"/"});class Ya{constructor(t={}){const{path:n,domain:o,expires:r,sameSite:s,secure:i}=t;if(this.domain=o,this.path=n||"/",this.expires=Object.prototype.hasOwnProperty.call(t,"expires")?r:365,this.secure=Object.prototype.hasOwnProperty.call(t,"secure")?i:!0,Object.prototype.hasOwnProperty.call(t,"sameSite")){if(!s||!["strict","lax","none"].includes(s))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if(s==="none"&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=s}}async setItem(t,n){ot.set(t,n,this.getData())}async getItem(t){return ot.get(t)??null}async removeItem(t){ot.remove(t,this.getData())}async clear(){const t=ot.get(),n=Object.keys(t).map(o=>this.removeItem(o));await Promise.all(n)}getData(){return{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure,...this.sameSite&&{sameSite:this.sameSite}}}}const Ye=new qa;new $a;const oe=new Ga,Br=e=>Object.keys(e).map(t=>t.toLowerCase()).sort().join(";"),Ja="X-Amz-Date",Xa="X-Amz-Security-Token",Qa="authorization",Za="host",ec=Ja.toLowerCase(),tc=Xa.toLowerCase(),Wr="aws4_request",Hr="AWS4-HMAC-SHA256",nc="AWS4",oc="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",Vr="UNSIGNED-PAYLOAD",rc=(e,t,n)=>`${e}/${t}/${n}/${Wr}`,sc=e=>{const t=e.toISOString().replace(/[:-]|\.\d{3}/g,"");return{longDate:t,shortDate:t.slice(0,8)}},ic=({credentials:e,signingDate:t=new Date,signingRegion:n,signingService:o,uriEscapePath:r=!0})=>{const{accessKeyId:s,secretAccessKey:i,sessionToken:a}=e,{longDate:c,shortDate:u}=sc(t),d=rc(u,n,o);return{accessKeyId:s,credentialScope:d,longDate:c,secretAccessKey:i,sessionToken:a,shortDate:u,signingRegion:n,signingService:o,uriEscapePath:r}},Fe=(e,t)=>{const n=new We(e??void 0);return n.update(t),n.digestSync()},Kt=(e,t)=>{const n=Fe(e,t);return li(n)},ac=e=>Object.entries(e).map(([t,n])=>({key:t.toLowerCase(),value:n?.trim().replace(/\s+/g," ")??""})).sort((t,n)=>t.key<n.key?-1:1).map(t=>`${t.key}:${t.value}
4`).join(""),cc=e=>Array.from(e).sort(([t,n],[o,r])=>t===o?n<r?-1:1:t<o?-1:1).map(([t,n])=>`${Jn(t)}=${Jn(n)}`).join("&"),Jn=e=>encodeURIComponent(e).replace(/[!'()*]/g,uc),uc=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`,dc=(e,t=!0)=>e?t?encodeURIComponent(e).replace(/%2F/g,"/"):e:"/",lc=e=>e==null?oc:hc(e)?Kt(null,e):Vr,hc=e=>e!==Vr&&(typeof e=="string"||ArrayBuffer.isView(e)||fc(e)),fc=e=>typeof ArrayBuffer=="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]",pc=({body:e,headers:t,method:n,url:o},r=!0)=>[n,dc(o.pathname,r),cc(o.searchParams),ac(t),Br(t),lc(e)].join(`
5`),gc=(e,t,n,o)=>{const r=`${nc}${e}`,s=Fe(r,t),i=Fe(s,n),a=Fe(i,o);return Fe(a,Wr)},Ec=(e,t,n)=>[Hr,e,t,n].join(`
6`),mc=(e,{credentialScope:t,longDate:n,secretAccessKey:o,shortDate:r,signingRegion:s,signingService:i,uriEscapePath:a})=>{const c=pc(e,a),u=Kt(null,c),d=Ec(n,t,u);return Kt(gc(o,r,s,i),d)},yc=(e,t)=>{const n=ic(t),{accessKeyId:o,credentialScope:r,longDate:s,sessionToken:i}=n,a={...e.headers};a[Za]=e.url.host,a[ec]=s,i&&(a[tc]=i);const c={...e,headers:a},u=mc(c,n),d=`Credential=${o}/${r}`,l=`SignedHeaders=${Br(a)}`,h=`Signature=${u}`;return a[Qa]=`${Hr} ${d}, ${l}, ${h}`,c},qr=e=>new Date(Date.now()+e),Sc=300*1e3,Ic=(e,t)=>Math.abs(qr(t).getTime()-e)>=Sc,wc=(e,t)=>Ic(e,t)?e-Date.now():t,xl=({credentials:e,region:t,service:n,uriEscapePath:o=!0})=>{let r;return(s,i)=>
6async function(c){r=r??0;const u={credentials:typeof e=="function"?await e({forceRefresh:!!i?.isCredentialsExpired}):e,signingDate:qr(r),signingRegion:t,signingService:n,uriEscapePath:o},d=await yc(c,u),l=await s(d),h=vc(l);return h&&(r=wc(Date.parse(h),r)),l}},vc=({headers:e}={})=>e?.date??e?.Date??e?.["x-amz-date"];class bl extends Error{constructor(){super(...arguments),this.nonRetryable=!0}}const Nl=(e,t,n=Ar,o)=>Ps(e,t,Pr(n)),Cc=e=>{let t;return async(...n)=>t||(t=new Promise((o,r)=>{e(...n).then(s=>{o(s)}).catch(s=>{r(s)}).finally(()=>{t=void 0})}),t)};function Xn({expiresAt:e,clockDrift:t,tolerance:n=5e3}){return Date.now()+t+n>e}const Ac=async()=>{const{userAgentData:e}=navigator;if(!e)return navigator.userAgent;const{platform:t="",platformVersion:n="",model:o="",architecture:r="",fullVersionList:s=[]}=await e.getHighEntropyValues(["platform","platformVersion","architecture","model","fullVersionList"]),i=s.map(c=>`${c.brand}/${c.version}`).join(";");return[t,n,r,o,t,i].filter(c=>c).join(" ")||navigator.userAgent};class Bt extends U{get response(){return this._response?Pc(this._response):void 0}constructor(t){super(t),this.constructor=Bt,Object.setPrototypeOf(this,Bt.prototype),t.response&&(this._response=t.response)}}const Pc=e=>({...e,headers:{...e.headers}});function Tc(e){return Array.from(e,t=>String.fromCodePoint(t)).join("")}const Ve={convert(e,t={urlSafe:!1,skipPadding:!1}){const n=typeof e=="string"?e:Tc(e);let o=ws()(n);return t.urlSafe&&(o=o.replace(/\+/g,"-").replace(/\//g,"_")),t.skipPadding&&(o=o.replace(/=/g,"")),o}};function Rc(){return Is().getRandomValues(new Uint32Array(1))[0]}function _c(e){const{words:t}=e,{sigBytes:n}=e,o=[];for(let r=0;r<n;r++){const s=t[r>>>2]>>>24-r%4*8&255;o.push((s>>>4).toString(16)),o.push((s&15).toString(16))}return o.join("")}class nn{constructor(t,n){this.words=[];let o=t;o=this.words=o||[],n!==void 0?this.sigBytes=n:this.sigBytes=o.length*4}random(t){const n=[];for(let o=0;o<t;o+=4)n.push(Rc());return new nn(n,t)}toString(){return _c(this)}}var y;(function(e){e.EmptySignInUsername="EmptySignInUsername",e.EmptySignInPassword="EmptySignInPassword",e.CustomAuthSignInPassword="CustomAuthSignInPassword",e.EmptySignUpUsername="EmptySignUpUsername",e.EmptySignUpPassword="EmptySignUpPassword",e.EmptyConfirmSignUpUsername="EmptyConfirmSignUpUsername",e.EmptyConfirmSignUpCode="EmptyConfirmSignUpCode",e.EmptyResendSignUpCodeUsername="EmptyresendSignUpCodeUsername",e.EmptyChallengeResponse="EmptyChallengeResponse",e.EmptyConfirmResetPasswordUsername="EmptyConfirmResetPasswordUsername",e.EmptyConfirmResetPasswordNewPassword="EmptyConfirmResetPasswordNewPassword",e.EmptyConfirmResetPasswordConfirmationCode="EmptyConfirmResetPasswordConfirmationCode",e.EmptyResetPasswordUsername="EmptyResetPasswordUsername",e.EmptyVerifyTOTPSetupCode="EmptyVerifyTOTPSetupCode",e.EmptyConfirmUserAttributeCode="EmptyConfirmUserAttributeCode",e.IncorrectMFAMethod="IncorrectMFAMethod",e.EmptyUpdatePassword="EmptyUpdatePassword",e.InvalidPreferredChallenge="InvalidPreferredChallenge"})(y||(y={}));const xc={[y.EmptyChallengeResponse]:{message:"challengeResponse is required to confirmSignIn"},[y.EmptyConfirmResetPasswordUsername]:{message:"username is required to confirmResetPassword"},[y.EmptyConfirmSignUpCode]:{message:"code is required to confirmSignUp"},[y.EmptyConfirmSignUpUsername]:{message:"username is required to confirmSignUp"},[y.EmptyConfirmResetPasswordConfirmationCode]:{message:"confirmationCode is required to confirmResetPassword"},[y.EmptyConfirmResetPasswordNewPassword]:{message:"newPassword is required to confirmResetPassword"},[y.EmptyResendSignUpCodeUsername]:{message:"username is required to confirmSignUp"},[y.EmptyResetPasswordUsername]:{message:"username is required to resetPassword"},[y.EmptySignInPassword]:{message:"password is required to signIn"},[y.EmptySignInUsername]:{message:"username is required to signIn"},[y.EmptySignUpPassword]:{message:"password is required to signUp"},[y.EmptySignUpUsername]:{message:"username is required to signUp"},[y.CustomAuthSignInPassword]:{message:"A password is not needed when signing in with CUSTOM_WITHOUT_SRP",recoverySuggestion:"Do not include a password in your signIn call."},[y.IncorrectMFAMethod]:{message:"Incorrect MFA method was chosen. It should be either SMS, TOTP, or EMAIL",recoverySuggestion:"Try to pass SMS, TOTP, or EMAIL as the challengeResponse"},[y.EmptyVerifyTOTPSetupCode]:{message:"code is required to verifyTotpSetup"},[y.EmptyUpdatePassword]:{message:"oldPassword and newPassword are required to changePassword"}
6,[y.EmptyConfirmUserAttributeCode]:{message:"confirmation code is required to confirmUserAttribute"},[y.InvalidPreferredChallenge]:{message:"The preferred challenge is not enabled in your backend configuration",recoverySuggestion:"Ensure the authentication method is enabled in your Amplify backend configuration"}};var Qn;(function(e){e.DEFAULT_MSG="Authentication Error",e.EMPTY_EMAIL="Email cannot be empty",e.EMPTY_PHONE="Phone number cannot be empty",e.EMPTY_USERNAME="Username cannot be empty",e.INVALID_USERNAME="The username should either be a string or one of the sign in types",e.EMPTY_PASSWORD="Password cannot be empty",e.EMPTY_CODE="Confirmation code cannot be empty",e.SIGN_UP_ERROR="Error creating account",e.NO_MFA="No valid MFA method provided",e.INVALID_MFA="Invalid MFA type",e.EMPTY_CHALLENGE="Challenge response cannot be empty",e.NO_USER_SESSION="Failed to get the session because the user is empty",e.NETWORK_ERROR="Network Error",e.DEVICE_CONFIG="Device tracking has not been configured in this User Pool",e.AUTOSIGNIN_ERROR="Please use your credentials to sign in",e.OAUTH_ERROR="Couldn't finish OAuth flow, check your User Pool HostedUI settings"})(Qn||(Qn={}));var ae;(function(e){e.SignInException="SignInException",e.OAuthSignInError="OAuthSignInException"})(ae||(ae={}));class m extends U{constructor(t){super(t),this.constructor=m,Object.setPrototypeOf(this,m.prototype)}}function b(e,t){const{message:n,recoverySuggestion:o}=xc[t];if(!e)throw new m({name:t,message:n,recoverySuggestion:o})}function v(e){const t=e?.split("_")[0];if(!e||e.indexOf("_")<0||!t||typeof t!="string")throw new m({name:"InvalidUserPoolId",message:"Invalid user pool id provided."});return t}function Wt(e){if(!e||!e.includes(":"))throw new m({name:"InvalidIdentityPoolIdException",message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."});return e.split(":")[0]}function bc(e){const t={};return e?.forEach(n=>{n.Name&&(t[n.Name]=n.Value)}),t}var Zn;(function(e){e.ConcurrentModificationException="ConcurrentModificationException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException"})(Zn||(Zn={}));var eo;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.InvalidPasswordException="InvalidPasswordException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(eo||(eo={}));var to;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidPasswordException="InvalidPasswordException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UsernameExistsException="UsernameExistsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(to||(to={}));var no;(function(e){e.CodeMismatchException="CodeMismatchException",e.ExpiredCodeException="ExpiredCodeException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidPasswordException="InvalidPasswordException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyFailedAttemptsException="TooManyFailedAttemptsException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(no||(no={}));var oo;(function(e){e.AliasExistsException="AliasExistsException",e.CodeMismatchException="CodeMismatchException",e.ExpiredCodeException="ExpiredCodeException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyFailedAttemptsException="TooManyFailedAttemptsException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotFoundException="UserNotFoundException"})(oo||(oo={}));var ro;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(ro||(ro={}));var so;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(so||(so={}));var io;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(io||(io={}));var ao;(function(e){e.CodeDeliveryFailureException="CodeDeliveryFailureException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidEmailRoleAccessPol
6icyException="InvalidEmailRoleAccessPolicyException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotFoundException="UserNotFoundException"})(ao||(ao={}));var co;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(co||(co={}));var uo;(function(e){e.ExternalServiceException="ExternalServiceException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceConflictException="ResourceConflictException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException"})(uo||(uo={}));var lo;(function(e){e.ExternalServiceException="ExternalServiceException",e.InternalErrorException="InternalErrorException",e.InvalidIdentityPoolConfigurationException="InvalidIdentityPoolConfigurationException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceConflictException="ResourceConflictException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException"})(lo||(lo={}));var ho;(function(e){e.CodeDeliveryFailureException="CodeDeliveryFailureException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(ho||(ho={}));var fo;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException"})(fo||(fo={}));var ht;(function(e){e.PasswordResetRequiredException="PasswordResetRequiredException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(ht||(ht={}));var po;(function(e){e.CodeDeliveryFailureException="CodeDeliveryFailureException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidEmailRoleAccessPol
6icyException="InvalidEmailRoleAccessPolicyException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotFoundException="UserNotFoundException"})(po||(po={}));var go;(function(e){e.AliasExistsException="AliasExistsException",e.CodeMismatchException="CodeMismatchException",e.ExpiredCodeException="ExpiredCodeException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidPasswordException="InvalidPasswordException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.MFAMethodNotFoundException="MFAMethodNotFoundException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(go||(go={}));var Eo;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(Eo||(Eo={}));var mo;(function(e){e.CodeDeliveryFailureException="CodeDeliveryFailureException",e.InternalErrorException="InternalErrorException",e.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidPasswordException="InvalidPasswordException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UsernameExistsException="UsernameExistsException"})(mo||(mo={}));var yo;(function(e){e.AliasExistsException="AliasExistsException",e.CodeDeliveryFailureException="CodeDeliveryFailureException",e.CodeMismatchException="CodeMismatchException",e.ExpiredCodeException="ExpiredCodeException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(yo||(yo={}));var So;(function(e){e.CodeMismatchException="CodeMismatchException",e.EnableSoftw
6areTokenMFAException="EnableSoftwareTokenMFAException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(So||(So={}));var Io;(function(e){e.AliasExistsException="AliasExistsException",e.CodeMismatchException="CodeMismatchException",e.ExpiredCodeException="ExpiredCodeException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(Io||(Io={}));var wo;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(wo||(wo={}));var vo;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(vo||(vo={}));const Ct="UserUnAuthenticatedException",Nc="UserAlreadyAuthenticatedException",Oc="DeviceMetadataNotFoundException",Dc="InvalidRedirectException",Mc="InvalidAppSchemeException",Uc="InvalidPreferredRedirectUrlException",Fc=new m({name:Dc,message:"signInRedirect or signOutRedirect had an invalid format or was not found.",recoverySuggestion:"Please make sure the signIn/Out redirect in your oauth config is valid."});new m({name:Mc,message:"A valid non-http app scheme was not found in the config.",recoverySuggestion:"Please make sure a valid custom app scheme is present in the config."});const kc=new m({name:Uc,message:"The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.",recoverySuggestion:"Please make sure a matching preferredRedirectUrl is provided."}),Lc="InvalidOriginException",Kc=new m({name:Lc,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."}),Bc="OAuthSignOutException",Wc="TokenRefreshException",Hc="UnexpectedSignInInterruptionException";function At(e){if(!e||!e.accessToken)throw new m({name:Ct,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}function Vc(e){if(!e||!e.idToken)throw new m({name:Ct,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}
6const qc=new m({name:Wc,message:`Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow. 
7	Please change your oauth configuration to use 'code grant' flow.`,recoverySuggestion:`Please logout and change your Amplify configuration to use "code grant" flow. 
8	E.g { responseType: 'code' }`}),$c=new m({name:Ct,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function $r(e){if(zc(e))throw qc;if(!Gc(e))throw $c}function jr(e){if(!e||!e.deviceKey||!e.deviceGroupKey||!e.randomPassword)throw new m({name:Oc,message:"Either deviceKey, deviceGroupKey or secretPassword were not found during the sign-in process.",recoverySuggestion:"Make sure to not clear storage after calling the signIn API."})}const jc={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function Gr(e){return e?.accessToken||e?.idToken}function Gc(e){return Gr(e)&&e?.refreshToken}function zc(e){return Gr(e)&&!e?.refreshToken}const Yc=async e=>{const t=e.getConfig().Auth?.Cognito;w(t);const n=await e.Auth.getTokens({forceRefresh:!1});At(n);const{"cognito:username":o,sub:r}=n.idToken?.payload??{},s={username:o,userId:r},i=Jc(n);return i&&(s.signInDetails=i),s};function Jc(e){return e?.signInDetails}const zr=async()=>Yc(A),T=(e,t)=>
8yt({category:Ut.Auth,action:e,...t}),$=e=>(t,n)=>{const o=Xc(e),r=JSON.stringify(t);return Qc(n,o,r)},Xc=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${e}`}),Qc=({url:e},t,n)=>({headers:t,url:e,body:n,method:"POST"});function Y(e){if(!e||e.name==="Error"||e instanceof TypeError)throw new m({name:he.Unknown,message:"An unknown error has occurred.",underlyingError:e})}const j=()=>async e=>{if(e.statusCode>=300){const t=await Ge(e);throw Y(t),new m({name:t.name,message:t.message,metadata:t.$metadata})}return vt(e)},Zc=()=>(e,t)=>async function(o){return o.headers["cache-control"]="no-store",e(o)},G=tn(Nr,[Zc]),Yr="cognito-idp",z={service:Yr,retryDecider:_r(Ge),computeDelay:Rr,get userAgentValue(){return yt()},cache:"no-store"},Je=e=>K(G,$("InitiateAuth"),j(),{...z,...e}),W=e=>K(G,$("RespondToAuthChallenge"),j(),{...z,...e}),eu=e=>K(G,$("VerifySoftwareToken"),j(),{...z,...e}),tu=e=>K(G,$("AssociateSoftwareToken"),j(),{...z,...e}),nu=({region:e})=>({url:new ze(`https://${Yr}.${e}.${Ur(e)}`)}),C=({endpointOverride:e})=>t=>e?{url:new ze(e)}:nu(t),ou=e=>K(G,$("GetTokensFromRefreshToken"),j(),{...z,...e}),ru=async({tokens:e,authConfig:t,username:n,clientMetadata:o})=>{w(t?.Cognito);const{userPoolId:r,userPoolClientId:s,userPoolEndpoint:i}=t.Cognito,a=v(r);$r(e);const c=ou({endpointResolver:C({endpointOverride:i})}),{AuthenticationResult:u}=await c({region:a},{ClientId:s,RefreshToken:e.refreshToken,DeviceKey:e.deviceMetadata?.deviceKey,ClientMetadata:o}),d=pe(u?.AccessToken??""),l=u?.IdToken?pe(u.IdToken):void 0,{iat:h}=d.payload;if(!h)throw new m({name:"iatNotFoundException",message:"iat not found in access token"});const f=h*1e3-new Date().getTime();return{accessToken:d,idToken:l,clockDrift:f,refreshToken:u?.RefreshToken??e.refreshToken,username:n}},su=Cc(ru),iu={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetails:"signInDetails",oauthMetadata:"oauthMetadata"};var ft;(function(e){e.InvalidAuthTokens="InvalidAuthTokens"})(ft||(ft={}));const au={[ft.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},cu=jt(au),Co="CognitoIdentityServiceProvider";class uu{getKeyValueStorage(){if(!this.keyValueStorage)throw new m({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(t){this.keyValueStorage=t}setAuthConfig(t){this.authConfig=t}async loadTokens(){try{const t=await this.getAuthKeys(),n=await this.getKeyValueStorage().getItem(t.accessToken);if(!n)throw new m({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});const o=pe(n),r=await this.getKeyValueStorage().getItem(t.idToken),s=r?pe(r):void 0,i=await this.getKeyValueStorage().getItem(t.refreshToken)??void 0,a=await this.getKeyValueStorage().getItem(t.clockDrift)??"0",c=Number.parseInt(a),u=await this.getKeyValueStorage().getItem(t.signInDetails),d={accessToken:o,idToken:s,refreshToken:i,deviceMetadata:await this.getDeviceMetadata()??void 0,clockDrift:c,username:await this.getLastAuthUser()};return u&&(d.signInDetails=JSON.parse(u)),d}catch{return null}}
8async storeTokens(t){cu(t!==void 0,ft.InvalidAuthTokens);const n=t.username;await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),n);const o=await this.getAuthKeys();await this.getKeyValueStorage().setItem(o.accessToken,t.accessToken.toString()),t.idToken?await this.getKeyValueStorage().setItem(o.idToken,t.idToken.toString()):await this.getKeyValueStorage().removeItem(o.idToken),t.refreshToken?await this.getKeyValueStorage().setItem(o.refreshToken,t.refreshToken):await this.getKeyValueStorage().removeItem(o.refreshToken),t.deviceMetadata&&(t.deviceMetadata.deviceKey&&await this.getKeyValueStorage().setItem(o.deviceKey,t.deviceMetadata.deviceKey),t.deviceMetadata.deviceGroupKey&&await this.getKeyValueStorage().setItem(o.deviceGroupKey,t.deviceMetadata.deviceGroupKey),await this.getKeyValueStorage().setItem(o.randomPasswordKey,t.deviceMetadata.randomPassword)),t.signInDetails?await this.getKeyValueStorage().setItem(o.signInDetails,JSON.stringify(t.signInDetails)):await this.getKeyValueStorage().removeItem(o.signInDetails),await this.getKeyValueStorage().setItem(o.clockDrift,`${t.clockDrift}`)}async clearTokens(){const t=await this.getAuthKeys();await Promise.all([this.getKeyValueStorage().removeItem(t.accessToken),this.getKeyValueStorage().removeItem(t.idToken),this.getKeyValueStorage().removeItem(t.clockDrift),this.getKeyValueStorage().removeItem(t.refreshToken),this.getKeyValueStorage().removeItem(t.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),this.getKeyValueStorage().removeItem(t.oauthMetadata)])}async getDeviceMetadata(t){const n=await this.getAuthKeys(t),o=await this.getKeyValueStorage().getItem(n.deviceKey),r=await this.getKeyValueStorage().getItem(n.deviceGroupKey),s=await this.getKeyValueStorage().getItem(n.randomPasswordKey);return s&&r&&o?{deviceKey:o,deviceGroupKey:r,randomPassword:s}:null}async clearDeviceMetadata(t){const n=await this.getAuthKeys(t);await Promise.all([this.getKeyValueStorage().removeItem(n.deviceKey),this.getKeyValueStorage().removeItem(n.deviceGroupKey),this.getKeyValueStorage().removeItem(n.randomPasswordKey)])}async getAuthKeys(t){w(this.authConfig?.Cognito);const n=t??await this.getLastAuthUser();return du(Co,`${this.authConfig.Cognito.userPoolClientId}.${n}`)}getLastAuthUserKey(){w(this.authConfig?.Cognito);const t=this.authConfig.Cognito.userPoolClientId;return`${Co}.${t}.LastAuthUser`}async getLastAuthUser(){return await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())??"username"}async setOAuthMetadata(t){const{oauthMetadata:n}=await this.getAuthKeys();await this.getKeyValueStorage().setItem(n,JSON.stringify(t))}async getOAuthMetadata(){const{oauthMetadata:t}=await this.getAuthKeys(),n=await this.getKeyValueStorage().getItem(t);return n&&JSON.parse(n)}}const du=(e,t)=>on(iu)(`${e}`,t);function on(e){const t=Object.values({...e});return(n,o)=>t.reduce((r,s)=>({...r,[s]:`${n}.${o}.${s}`}),{})}const Ao="amplify-signin-with-hostedUI",X="CognitoIdentityServiceProvider";class Jr{constructor(t){this.keyValueStorage=t}async clearOAuthInflightData(){w(this.cognitoConfig);const t=Q(X,this.cognitoConfig.userPoolClientId);await Promise.all([this.keyValueStorage.removeItem(t.inflightOAuth),this.keyValueStorage.removeItem(t.oauthPKCE),this.keyValueStorage.removeItem(t.oauthState)])}async clearOAuthData(){w(this.cognitoConfig);const t=Q(X,this.cognitoConfig.userPoolClientId);return await this.clearOAuthInflightData(),await this.keyValueStorage.removeItem(Ao),this.keyValueStorage.removeItem(t.oauthSignIn)}loadOAuthState(){w(this.cognitoConfig);const t=Q(X,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(t.oauthState)}storeOAuthState(t){w(this.cognitoConfig);const n=Q(X,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(n.oauthState,t)}loadPKCE(){w(this.cognitoConfig);const t=Q(X,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(t.oauthPKCE)}storePKCE(t){w(this.cognitoConfig);const n=Q(X,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(n.oauthPKCE,t)}setAuthConfig(t){this.cognitoConfig=t}async loadOAuthInFlight(){w(this.cognitoConfig);const t=Q(X,this.cognitoConfig.userPoolClientId);return await this.keyValueStorage.getItem(t.inflightOAuth)==="true"}async storeOAuthInFlight(t){w(this.cognitoConfig);const n=Q(X,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(n.inflightOAuth,`${t}`)}async loadOAuthSignIn(){w(this.cognitoConfig);const t=Q(X,this.cognitoConfig.userPoolClientId),n=await this.keyValueStorage.getItem(Ao),[o,r]=(await this.keyValueStorage.getItem(t.oauthSignIn))?.split(",")??[];return{isOAuthSignIn:o==="true"||n==="true",preferPrivateSession:r==="true"}}async storeOAuthSignIn(t,n=!1){w(this.cognitoConfig);const o=Q(X,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(o.oauthSignIn,`${t},${n}`)}}const Q=(e,t)=>on(jc)(e,t),Po=new Jr(Ye);class lu{constructor(){this.waitForInflightOAuth=wr()?async()=>
8{if(await Po.loadOAuthInFlight())return this.inflightPromise?this.inflightPromise:(this.inflightPromise=new Promise((t,n)=>{}),this.inflightPromise)}:async()=>{}}setAuthConfig(t){Po.setAuthConfig(t.Cognito),this.authConfig=t}setTokenRefresher(t){this.tokenRefresher=t}setAuthTokenStore(t){this.tokenStore=t}getTokenStore(){if(!this.tokenStore)throw new m({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}getTokenRefresher(){if(!this.tokenRefresher)throw new m({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}setClientMetadataProvider(t){this.clientMetadataProvider=t}async getTokens(t){let n;try{w(this.authConfig?.Cognito)}catch{return null}await this.waitForInflightOAuth(),this.inflightPromise=void 0,n=await this.getTokenStore().loadTokens();const o=await this.getTokenStore().getLastAuthUser();if(n===null)return null;const r=!!n?.idToken&&Xn({expiresAt:(n.idToken?.payload?.exp??0)*1e3,clockDrift:n.clockDrift??0}),s=Xn({expiresAt:(n.accessToken?.payload?.exp??0)*1e3,clockDrift:n.clockDrift??0});return(t?.forceRefresh||r||s)&&(n=await this.refreshTokens({tokens:n,username:o,clientMetadata:t?.clientMetadata??await this.clientMetadataProvider?.()}),n===null)?null:{accessToken:n?.accessToken,idToken:n?.idToken,signInDetails:n?.signInDetails}}async refreshTokens({tokens:t,username:n,clientMetadata:o}){try{const{signInDetails:r}=t,s=await this.getTokenRefresher()({tokens:t,authConfig:this.authConfig,username:n,clientMetadata:o});
8return s.signInDetails=r,await this.setTokens({tokens:s}),Pe.dispatch("auth",{event:"tokenRefresh"},"Auth",fe),s}catch(r){return this.handleErrors(r)}}handleErrors(t){if(Y(t),this.isAuthenticationError(t)&&this.clearTokens(),Pe.dispatch("auth",{event:"tokenRefresh_failure",data:{error:t}},"Auth",fe),t.name.startsWith("NotAuthorizedException"))return null;throw t}isAuthenticationError(t){return["NotAuthorizedException","TokenRevokedException","UserNotFoundException","PasswordResetRequiredException","UserNotConfirmedException","RefreshTokenReuseException"].some(o=>t?.name?.startsWith?.(o))}async setTokens({tokens:t}){return this.getTokenStore().storeTokens(t)}async clearTokens(){return this.getTokenStore().clearTokens()}getDeviceMetadata(t){return this.getTokenStore().getDeviceMetadata(t)}clearDeviceMetadata(t){return this.getTokenStore().clearDeviceMetadata(t)}setOAuthMetadata(t){return this.getTokenStore().setOAuthMetadata(t)}getOAuthMetadata(){return this.getTokenStore().getOAuthMetadata()}}class hu{constructor(){this.authTokenStore=new uu,this.authTokenStore.setKeyValueStorage(Ye),this.tokenOrchestrator=new lu,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(su)}getTokens(t={}){return this.tokenOrchestrator.getTokens(t)}setKeyValueStorage(t){this.authTokenStore.setKeyValueStorage(t)}
8setClientMetadataProvider(t){this.tokenOrchestrator.setClientMetadataProvider(t)}setAuthConfig(t){this.authTokenStore.setAuthConfig(t),this.tokenOrchestrator.setAuthConfig(t)}}const ke=new hu,{tokenOrchestrator:L}=ke;async function me(e){if(e.AccessToken){const t=pe(e.AccessToken),n=(t.payload.iat||0)*1e3,o=new Date().getTime(),r=n>0?n-o:0;let s,i,a;e.RefreshToken&&(i=e.RefreshToken),e.IdToken&&(s=pe(e.IdToken)),e?.NewDeviceMetadata&&(a=e.NewDeviceMetadata);const c={accessToken:t,idToken:s,refreshToken:i,clockDrift:r,deviceMetadata:a,username:e.username};e?.signInDetails&&(c.signInDetails=e.signInDetails),await L.setTokens({tokens:c})}else throw new U({message:"Invalid tokens",name:"InvalidTokens",recoverySuggestion:"Check Cognito UserPool settings"})}const fu="Unable to get user session following successful sign-in.",ye=async()=>{try{Pe.dispatch("auth",{event:"signedIn",data:await zr()},"Auth",fe)}catch(e){throw e.name===Ct?new m({name:Hc,message:fu,recoverySuggestion:"This most likely is due to auth tokens not being persisted. If you are using cookie store, please ensure cookies can be correctly set from your server."}):e}};function Xr(){return{active:!1}}const pu=(e,t)=>{switch(t.type){case"SET_USERNAME":return{...e,username:t.value};case"SET_SESSION":return{...e,session:t.value};case"START":return{...e,active:!0};case"RESET":return Xr();default:return e}},gu=e=>{let t=e(Xr(),{type:"RESET"});return{getState:()=>t,dispatch:n=>{t=e(t,n)}}},Qr=gu(pu),Eu=180*1e3,rt="CognitoSignInState",re={username:`${rt}.username`,challengeName:`${rt}.challengeName`,signInSession:`${rt}.signInSession`,expiry:`${rt}.expiry`},mu=(e,t)=>{switch(t.type){case"SET_SIGN_IN_SESSION":return st({signInSession:t.value}),{...e,signInSession:t.value};case"SET_SIGN_IN_STATE":return st(t.value),{...t.value};case"SET_CHALLENGE_NAME":return st({challengeName:t.value}),{...e,challengeName:t.value};case"SET_USERNAME":return st({username:t.value}),{...e,username:t.value};case"SET_INITIAL_STATE":return Su();case"RESET_STATE":return Zr(),rn();default:return e}},yu=e=>{const t=Number(e),n=Date.now();return t<=n},J=()=>{ee.dispatch({type:"RESET_STATE"})},Zr=()=>{for(const e of Object.values(re))oe.removeItem(e)},rn=()=>({username:void 0,challengeName:void 0,signInSession:void 0}),Su=()=>{const e=oe.getItem(re.expiry);if(!e||yu(e))return Zr(),rn();const t=oe.getItem(re.username)??void 0,n=oe.getItem(re.challengeName)??void 0,o=oe.getItem(re.signInSession)??void 0;return{username:t,challengeName:n,signInSession:o}},Iu=e=>{let t=e(rn(),{type:"SET_INITIAL_STATE"});return{getState:()=>t,dispatch:n=>{t=e(t,n)}}},ee=Iu(mu);function Se(e){ee.dispatch({type:"SET_SIGN_IN_STATE",value:e})}const st=({challengeName:e,signInSession:t,username:n})=>{n&&oe.setItem(re.username,n),e&&oe.setItem(re.challengeName,e),t&&(oe.setItem(re.signInSession,t),oe.setItem(re.expiry,String(Date.now()+Eu)))},To="Passkeys may not be supported on this device. Ensure your application is running in a secure context (HTTPS) and Web Authentication API is supported.";class ie extends U{constructor(t){super(t),this.constructor=ie,Object.setPrototypeOf(this,ie.prototype)}}var _;(function(e){e.PasskeyNotSupported="PasskeyNotSupported",e.PasskeyAlreadyExists="PasskeyAlreadyExists",e.InvalidPasskeyRegistrationOptions="InvalidPasskeyRegistrationOptions",e.InvalidPasskeyAuthenticationOptions="InvalidPasskeyAuthenticationOptions",e.RelyingPartyMismatch="RelyingPartyMismatch",e.PasskeyRegistrationFailed="PasskeyRegistrationFailed",e.PasskeyRetrievalFailed="PasskeyRetrievalFailed",e.PasskeyRegistrationCanceled="PasskeyRegistrationCanceled",e.PasskeyAuthenticationCanceled="PasskeyAuthenticationCanceled",e.PasskeyOperationAborted="PasskeyOperationAborted"})(_||(_={}));const Dt="User may have canceled the ceremony or another interruption has occurred. Check underlying error for details.",Ro="Ensure your user pool is configured to support the WEB_AUTHN as an authentication factor.",pt={[_.PasskeyNotSupported]:{message:"Passkeys may not be supported on this device.",recoverySuggestion:To},[_.InvalidPasskeyRegistrationOptions]:{message:"Invalid passkey registration options.",recoverySuggestion:Ro},[_.InvalidPasskeyAuthenticationOptions]:{message:"Invalid passkey authentication options.",recoverySuggestion:Ro},[_.PasskeyRegistrationFailed]:{message:"Device failed to create passkey.",recoverySuggestion:To},[_.PasskeyRetrievalFailed]:{message:"Device failed to retrieve passkey.",recoverySuggestion:"Passkeys may not be available on this device. Try an alternative authentication factor like PASSWORD, EMAIL_OTP, or SMS_OTP."},[_.PasskeyAlreadyExists]:{message:"Passkey already exists in authenticator.",recoverySuggestion:"Proceed with existing passkey or try again after deleting the credential."},[_.PasskeyRegistrationCanceled]:{message:"Passkey registration ceremony has been canceled.",recoverySuggestion:Dt},[_.PasskeyAuthenticationCanceled]:{message:"Passkey authentication ceremony has been canceled.",recoverySuggestion:Dt},[_.PasskeyOperationAborted]:{message:"Passkey operation has been aborted.",recoverySuggestion:Dt},[_.RelyingPartyMismatch]:{message:"Relying party does not match current domain.",recoverySuggestion:"Ensure relying party identifier matches current domain."}},sn=jt(pt,ie),wu=e=>{if(e instanceof Error){if(e.name==="AbortError"){const{message:t,recoverySuggestion:n}=pt[_.PasskeyOperationAborted];return new ie({name:_.PasskeyOperationAborted,message:t,recoverySuggestion:n,underlyingError:e})}if(e.name==="SecurityError"){const{message:t,recoverySuggestion:n}=pt[_.RelyingPartyMismatch];return new ie({name:_.RelyingPartyMismatch,message:t,recoverySuggestion:n,underlyingError:e})}}return new ie({name:he.Unknown,message:"An unknown error has occurred.",underlyingError:e})},vu=e=>{if(e instanceof ie)return e;if(e instanceof Error&&e.name==="NotAllowedError"){const{message:t,recoverySuggestion:n}=pt[_.PasskeyAuthenticationCanceled];return new ie({name:_.PasskeyAuthenticationCanceled,message:t,recoverySuggestion:n,underlyingError:e})}return wu(e)},Cu=()=>wr()&&window.isSecureContext&&"credentials"in navigator&&typeof window.PublicKeyCredential=="function",Me=e=>Ve.convert(new Uint8Array(e),{urlSafe:!0,skipPadding:!0}),_o=e=>Uint8Array.from(Gt.convert(e,{urlSafe:!0}),t=>t.charCodeAt(0)).buffer,Au=e=>{const t=_o(e.challenge),n=(e.allowCredentials||[]).map(o=>({...o,id:_o(o.id)}));return{...e,challenge:t,allowCredentials:n}},Pu=e=>{const t={clientDataJSON:Me(e.response.clientDataJSON),authenticatorData:Me(e.response.authenticatorData),signature:Me(e.response.signature)};e.response.userHandle&&(t.userHandle=Me(e.response.userHandle));const n={id:e.id,rawId:Me(e.rawId),type:e.type,clientExtensionResults:e.getClientExtensionResults(),response:t};return e.authenticatorAttachment&&(n.authenticatorAttachment=e.authenticatorAttachment),n};function Tu(e){sn(e&&e instanceof PublicKeyCredential&&e.response instanceof AuthenticatorAssertionResponse,_.PasskeyRetrievalFailed)}const Ru=async e=>{try{const t=Cu();sn(t,_.PasskeyNotSupported);const n=Au(e),o=await navigator.credentials.get({publicKey:n});return Tu(o),Pu(o)}catch(t){throw vu(t)}},_u=e=>K(G,$("ConfirmDevice"),j(),{...z,...e}),ut={convert(e){return new TextEncoder().encode(e)}};function p(e,t){e!=null&&this.fromString(e,t)}function M(){return new p(null,null)}let ce;const xu=0xdeadbeefcafe,xo=(xu&16777215)===15715070;function bu(e,t,n,o,r,s){for(;--s>=0;){const i=t*this[e++]+n[o]+r;r=Math.floor(i/67108864),n[o++]=i&67108863}return r}function Nu(e,t,n,o,r,s){const i=t&32767,a=t>>15;for(;--s>=0;){let c=this[e]&32767;const u=this[e++]>>15,d=a*c+u*i;c=i*c+((d&32767)<<15)+n[o]+(r&1073741823),r=(c>>>30)+(d>>>15)+a*u+(r>>>30),n[o++]=c&1073741823}return r}function Ou(e,t,n,o,r,s){const i=t&16383,a=t>>14;for(;--s>=0;){let c=this[e]&16383;const u=this[e++]>>14,d=a*c+u*i;c=i*c+((d&16383)<<14)+n[o]+r,r=(c>>28)+(d>>14)+a*u,n[o++]=c&268435455}return r}const bo=typeof navigator<"u";
8bo&&xo&&navigator.appName==="Microsoft Internet Explorer"?(p.prototype.am=Nu,ce=30):bo&&xo&&navigator.appName!=="Netscape"?(p.prototype.am=bu,ce=26):(p.prototype.am=Ou,ce=28);p.prototype.DB=ce;p.prototype.DM=(1<<ce)-1;p.prototype.DV=1<<ce;const an=52;p.prototype.FV=Math.pow(2,an);p.prototype.F1=an-ce;p.prototype.F2=2*ce-an;const Du="0123456789abcdefghijklmnopqrstuvwxyz",Pt=[];let xe,q;xe=48;for(q=0;q<=9;++q)Pt[xe++]=q;xe=97;for(q=10;q<36;++q)Pt[xe++]=q;xe=65;for(q=10;q<36;++q)Pt[xe++]=q;function No(e){return Du.charAt(e)}function Mu(e,t){const n=Pt[e.charCodeAt(t)];return n??-1}function Uu(e){for(let t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function Fu(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}function cn(e){const t=M();return t.fromInt(e),t}function ku(e,t){let n;if(t===16)n=4;else if(t===8)n=3;else if(t===2)n=1;else if(t===32)n=5;else if(t===4)n=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");this.t=0,this.s=0;let o=e.length,r=!1,s=0;for(;--o>=0;){const i=Mu(e,o);if(i<0){e.charAt(o)==="-"&&(r=!0);continue}r=!1,s===0?this[this.t++]=i:s+n>this.DB?(this[this.t-1]|=(i&(1<<this.DB-s)-1)<<s,this[this.t++]=i>>this.DB-s):this[this.t-1]|=i<<s,s+=n,s>=this.DB&&(s-=this.DB)}this.clamp(),r&&p.ZERO.subTo(this,this)}function Lu(){const e=this.s&this.DM;for(;this.t>0&&this[this.t-1]==e;)--this.t}function Ku(e){if(this.s<0)return"-"+this.negate().toString(e);let t;if(e==16)t=4;else if(e===8)t=3;else if(e===2)t=1;else if(e===32)t=5;else if(e===4)t=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");const n=(1<<t)-1;let o,r=!1,s="",i=this.t,a=this.DB-i*this.DB%t;if(i-- >0)for(a<this.DB&&(o=this[i]>>a)>0&&(r=!0,s=No(o));i>=0;)a<t?(o=(this[i]&(1<<a)-1)<<t-a,o|=this[--i]>>(a+=this.DB-t)):(o=this[i]>>(a-=t)&n,a<=0&&(a+=this.DB,--i)),o>0&&(r=!0),r&&(s+=No(o));return r?s:"0"}function Bu(){const e=M();return p.ZERO.subTo(this,e),e}function Wu(){return this.s<0?this.negate():this}function Hu(e){let t=this.s-e.s;if(t!=0)return t;let n=this.t;if(t=n-e.t,t!=0)return this.s<0?-t:t;for(;--n>=0;)if((t=this[n]-e[n])!=0)return t;return 0}function un(e){let t=1,n;return(n=e>>>16)!==0&&(e=n,t+=16),(n=e>>8)!==0&&(e=n,t+=8),(n=e>>4)!==0&&(e=n,t+=4),(n=e>>2)!==0&&(e=n,t+=2),(n=e>>1)!==0&&(e=n,t+=1),t}function Vu(){return this.t<=0?0:this.DB*(this.t-1)+un(this[this.t-1]^this.s&this.DM)}function qu(e,t){let n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s}function $u(e,t){for(let n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s}function ju(e,t){const n=e%this.DB,o=this.DB-n,r=(1<<o)-1,s=Math.floor(e/this.DB);let i=this.s<<n&this.DM,a;for(a=this.t-1;a>=0;--a)t[a+s+1]=this[a]>>o|i,i=(this[a]&r)<<n;for(a=s-1;a>=0;--a)t[a]=0;t[s]=i,t.t=this.t+s+1,t.s=this.s,t.clamp()}function Gu(e,t){t.s=this.s;const n=Math.floor(e/this.DB);if(n>=this.t){t.t=0;return}const o=e%this.DB,r=this.DB-o,s=(1<<o)-1;t[0]=this[n]>>o;for(let i=n+1;i<this.t;++i)t[i-n-1]|=(this[i]&s)<<r,t[i-n]=this[i]>>o;o>0&&(t[this.t-n-1]|=(this.s&s)<<r),t.t=this.t-n,t.clamp()}function zu(e,t){let n=0,o=0;const r=Math.min(e.t,this.t);for(;n<r;)o+=this[n]-e[n],t[n++]=o&this.DM,o>>=this.DB;if(e.t<this.t){for(o-=e.s;n<this.t;)o+=this[n],t[n++]=o&this.DM,o>>=this.DB;o+=this.s}else{for(o+=this.s;n<e.t;)o-=e[n],t[n++]=o&this.DM,o>>=this.DB;o-=e.s}t.s=o<0?-1:0,o<-1?t[n++]=this.DV+o:o>0&&(t[n++]=o),t.t=n,t.clamp()}function Yu(e,t){const n=this.abs(),o=e.abs();let r=n.t;for(t.t=r+o.t;--r>=0;)t[r]=0;for(r=0;r<o.t;++r)t[r+n.t]=n.am(0,o[r],t,r,0,n.t);t.s=0,t.clamp(),this.s!==e.s&&p.ZERO.subTo(t,t)}function Ju(e){const t=this.abs();let n=e.t=2*t.t;for(;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){const o=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,o,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()}function Xu(e,t,n){const o=e.abs();if(o.t<=0)return;const r=this.abs();if(r.t<o.t){t?.fromInt(0),n!=null&&this.copyTo(n);return}n===null&&(n=M());const s=M(),i=this.s,a=e.s,c=this.DB-un(o[o.t-1]);c>0?(o.lShiftTo(c,s),r.lShiftTo(c,n)):(o.copyTo(s),r.copyTo(n));const u=s.t,d=s[u-1];if(d===0)return;const l=d*(1<<this.F1)+(u>1?s[u-2]>>this.F2:0),h=this.FV/l,f=(1<<this.F1)/l,g=1<<this.F2;let E=n.t,S=E-u;const I=t===null?M():t;for(s.dlShiftTo(S,I),n.compareTo(I)>
8=0&&(n[n.t++]=1,n.subTo(I,n)),p.ONE.dlShiftTo(u,I),I.subTo(s,s);s.t<u;)s[s.t++]=0;for(;--S>=0;){let H=n[--E]===d?this.DM:Math.floor(n[E]*h+(n[E-1]+g)*f);if((n[E]+=s.am(0,H,n,S,0,u))<H)for(s.dlShiftTo(S,I),n.subTo(I,n);n[E]<--H;)n.subTo(I,n)}t!==null&&(n.drShiftTo(u,t),i!==a&&p.ZERO.subTo(t,t)),n.t=u,n.clamp(),c>0&&n.rShiftTo(c,n),i<0&&p.ZERO.subTo(n,n)}function Qu(e){const t=M();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(p.ZERO)>0&&e.subTo(t,t),t}function Zu(){if(this.t<1)return 0;const e=this[0];if((e&1)===0)return 0;let t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function ed(e){return this.compareTo(e)===0}function td(e,t){let n=0,o=0;const r=Math.min(e.t,this.t);for(;n<r;)o+=this[n]+e[n],t[n++]=o&this.DM,o>>=this.DB;if(e.t<this.t){for(o+=e.s;n<this.t;)o+=this[n],t[n++]=o&this.DM,o>>=this.DB;o+=this.s}else{for(o+=this.s;n<e.t;)o+=e[n],t[n++]=o&this.DM,o>>=this.DB;o+=e.s}t.s=o<0?-1:0,o>0?t[n++]=o:o<-1&&(t[n++]=this.DV+o),t.t=n,t.clamp()}function nd(e){const t=M();return this.addTo(e,t),t}function od(e){const t=M();return this.subTo(e,t),t}function rd(e){const t=M();return this.multiplyTo(e,t),t}function sd(e){const t=M();return this.divRemTo(e,t,null),t}function be(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function id(e){const t=M();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(p.ZERO)>0&&this.m.subTo(t,t),t}function ad(e){const t=M();return e.copyTo(t),this.reduce(t),t}function cd(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(let t=0;t<this.m.t;++t){let n=e[t]&32767;const o=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(n=t+this.m.t,e[n]+=this.m.am(0,o,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function ud(e,t){e.squareTo(t),this.reduce(t)}function dd(e,t,n){e.multiplyTo(t,n),this.reduce(n)}be.prototype.convert=id;be.prototype.revert=ad;be.prototype.reduce=cd;be.prototype.mulTo=dd;be.prototype.sqrTo=ud;function ld(e,t,n){let o=e.bitLength(),r,s=cn(1);const i=new be(t);if(o<=0)return s;o<18?r=1:o<48?r=3:o<144?r=4:o<768?r=5:r=6;const a=[];let c=3;const u=r-1,d=(1<<r)-1;if(a[1]=i.convert(this),r>1){const I=M();for(i.sqrTo(a[1],I);c<=d;)a[c]=M(),i.mulTo(I,a[c-2],a[c]),c+=2}let l=e.t-1,h,f=!0,g=M(),E;for(o=un(e[l])-1;l>=0;){for(o>=u?h=e[l]>>o-u&d:(h=(e[l]&(1<<o+1)-1)<<u-o,l>0&&(h|=e[l-1]>>this.DB+o-u)),c=r;(h&1)===0;)h>>=1,--c;if((o-=c)<0&&(o+=this.DB,--l),f)a[h].copyTo(s),f=!1;else{for(;c>1;)i.sqrTo(s,g),i.sqrTo(g,s),c-=2;c>0?i.sqrTo(s,g):(E=s,s=g,g=E),i.mulTo(g,a[h],s)}for(;l>=0&&(e[l]&1<<o)===0;)i.sqrTo(s,g),E=s,s=g,g=E,--o<0&&(o=this.DB-1,--l)}const S=i.revert(s);return n(null,S),S}p.prototype.copyTo=Uu;p.prototype.fromInt=Fu;p.prototype.fromString=ku;p.prototype.clamp=Lu;p.prototype.dlShiftTo=qu;p.prototype.drShiftTo=$u;p.prototype.lShiftTo=ju;p.prototype.rShiftTo=Gu;p.prototype.subTo=zu;p.prototype.multiplyTo=Yu;p.prototype.squareTo=Ju;p.prototype.divRemTo=Xu;p.prototype.invDigit=Zu;p.prototype.addTo=td;p.prototype.toString=Ku;p.prototype.negate=Bu;p.prototype.abs=Wu;p.prototype.compareTo=Hu;p.prototype.bitLength=Vu;p.prototype.mod=Qu;p.prototype.equals=ed;p.prototype.add=nd;p.prototype.subtract=od;p.prototype.multiply=rd;p.prototype.divide=sd;p.prototype.modPow=ld;p.ZERO=cn(0);p.ONE=cn(1);const hd=async({a:e,g:t,k:n,x:o,B:r,N:s,U:i})=>new Promise((a,c)=>{t.modPow(o,s,(u,d)=>{if(u){c(u);return}r.subtract(n.multiply(d)).modPow(e.add(i.multiply(o)),s,(l,h)=>{if(l){c(l);return}a(h.mod(s))})})}),fd="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",es={},Ht={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),es[e]=t,Ht[t]=e}const Re=e=>{if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2){const o=e.slice(n,n+2).toLowerCase();if(o in Ht)t[n/2]=Ht[o];else throw new Error(`Cannot decode unrecognized sequence ${o} as hexadecimal`)}return t},dn=e=>{let t="";for(let n=0;n<e.byteLength;n++)t+=es[e[n]];return t},Vt=e=>{const t=new We;t.update(e);const n=t.digestSync(),o=dn(n);return new Array(64-o.length).join("0")+o},dt=e=>Vt(Re(e)),pd=/^[89a-f]/i,ne=e=>{if(!(e instanceof p))throw new Error("Not a BigInteger");const t=e.compareTo(p.ZERO)<0;let n=e.abs().toString(16);if(n=n.length%2!==0?`0${n}`:n,n=pd.test(n)?`00${n}`:n,t){const o=n.split("").map(s=>{const i=~parseInt(s,16)&15;return"0123456789ABCDEF".charAt(i)}).join("");n=new p(o,16).add(p.ONE).toString(16),n.toUpperCase().startsWith("FF8")&&(n=n.substring(2))}return n},gd=({A:e,B:t})=>{const n=new p(dt(ne(e)+ne(t)),16);if(n.equals(p.ZERO))throw new Error("U cannot be zero.");return n},Ed=(e,t,n)=>{const o=new We(t);o.update(e);const r=o.digestSync(),s=new We(r);return s.update(n),s.digestSync().slice(0,16)},ln=e=>{const t=new nn().random(e).toString();return Re(t)},md=()=>Ve.convert(ln(40));class yd{constructor({userPoolName:t,a:n,g:o,A:r,N:s}){this.encoder=ut,this.userPoolName=t,this.a=n,this.g=o,this.A=r,this.N=s,this.k=new p(dt(`${ne(s)}${ne(o)}`),16)}
8getRandomPassword(){if(!this.randomPassword)throw new m({name:"EmptyBigIntegerRandomPassword",message:"random password is empty"});return this.randomPassword}getSaltToHashDevices(){if(!this.saltToHashDevices)throw new m({name:"EmptyBigIntegersaltToHashDevices",message:"saltToHashDevices is empty"});return this.saltToHashDevices}getVerifierDevices(){if(!this.verifierDevices)throw new m({name:"EmptyBigIntegerVerifierDevices",message:"verifyDevices is empty"});return this.verifierDevices}async generateHashDevice(t,n){this.randomPassword=md();const o=`${t}${n}:${this.randomPassword}`,r=Vt(o),s=dn(ln(16));return this.saltToHashDevices=ne(new p(s,16)),new Promise((i,a)=>{this.g.modPow(new p(dt(this.saltToHashDevices+r),16),this.N,(c,u)=>{if(c){a(c);return}this.verifierDevices=ne(u),i()})})}async getPasswordAuthenticationKey({username:t,password:n,serverBValue:o,salt:r}){if(o.mod(this.N).equals(p.ZERO))throw new Error("B cannot be zero.");const s=gd({A:this.A,B:o}),i=`${this.userPoolName}${t}:${n}`,a=Vt(i),c=new p(dt(ne(r)+a),16),u=await hd({a:this.a,g:this.g,k:this.k,x:c,B:o,N:this.N,U:s}),d=this.encoder.convert("Caldera Derived Key"),l=this.encoder.convert("�"),h=new Uint8Array(d.byteLength+l.byteLength);return h.set(d,0),h.set(l,d.byteLength),Ed(Re(ne(u)),Re(ne(s)),h)}}const Sd=async({a:e,g:t,N:n})=>new Promise((o,r)=>{t.modPow(e,n,(s,i)=>{if(s){r(s);return}if(i.mod(n).equals(p.ZERO)){r(new Error("Illegal parameter. A mod N cannot be 0."));return}o(i)})}),Xe=async e=>{const t=new p(fd,16),n=new p("2",16),o=Id(),r=await Sd({a:o,g:n,N:t});return new yd({userPoolName:e,a:o,g:n,A:r,N:t})},Id=()=>{const e=dn(ln(128));return new p(e,16)};async function Ie({userPoolId:e,userPoolEndpoint:t,newDeviceMetadata:n,accessToken:o}){if(!n)return;const r=e.split("_")[1]||"",s=await Xe(r),i=n?.DeviceKey,a=n?.DeviceGroupKey;try{await s.generateHashDevice(a??"",i??"")}catch{return}const c={Salt:Ve.convert(Re(s.getSaltToHashDevices())),PasswordVerifier:Ve.convert(Re(s.getVerifierDevices()))},u=s.getRandomPassword();try{return await _u({endpointResolver:C({endpointOverride:t})})({region:v(e)},{AccessToken:o,DeviceName:await Ac(),DeviceKey:n?.DeviceKey,DeviceSecretVerifierConfig:c}),{deviceKey:i,deviceGroupKey:a,randomPassword:u}}catch{return}}async function wd(e){const t=A.getConfig().Auth?.Cognito;w(t);const{username:n,signInSession:o,signInDetails:r,challengeName:s}=ee.getState();if(s!=="WEB_AUTHN"||!n)throw new m({name:ae.SignInException,message:"Unable to proceed due to invalid sign in state."});const{CREDENTIAL_REQUEST_OPTIONS:i}=e;sn(!!i,_.InvalidPasskeyAuthenticationOptions);const a=await Ru(JSON.parse(i)),c=W({endpointResolver:C({endpointOverride:t.userPoolEndpoint})}),{ChallengeName:u,ChallengeParameters:d,AuthenticationResult:l,Session:h}=await c({region:v(t.userPoolId),userAgentValue:T(P.ConfirmSignIn)},{ChallengeName:"WEB_AUTHN",ChallengeResponses:{USERNAME:n,CREDENTIAL:JSON.stringify(a)},ClientId:t.userPoolClientId,Session:o});if(Se({signInSession:h,username:n,challengeName:u,signInDetails:r}),l)return await me({...l,username:n,NewDeviceMetadata:await Ie({userPoolId:t.userPoolId,userPoolEndpoint:t.userPoolEndpoint,newDeviceMetadata:l.NewDeviceMetadata,accessToken:l.AccessToken}),signInDetails:r}),ee.dispatch({type:"RESET_STATE"}),await ye(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};if(u==="WEB_AUTHN")throw new m({name:ae.SignInException,message:"Sequential WEB_AUTHN challenges returned from underlying service cannot be handled."});return{challengeName:u,challengeParameters:d}}function F({username:e,userPoolId:t,userPoolClientId:n}){if(typeof window>"u")return;const o=window.AmazonCognitoAdvancedSecurityData;if(typeof o>"u")return;const r=o.getData(e,t,n);return r?{EncodedData:r}:{}}const vd=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Cd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ts=()=>{const e=new Date,t=Cd[e.getUTCDay()],n=vd[e.getUTCMonth()],o=e.getUTCDate();let r=e.getUTCHours();r<10&&(r=`0${r}`);let s=e.getUTCMinutes();s<10&&(s=`0${s}`);let i=e.getUTCSeconds();i<10&&(i=`0${i}`);const a=e.getUTCFullYear();return`${t} ${n} ${o} ${r}:${s}:${i} UTC ${a}`},ns=({userPoolName:e,username:t,challengeParameters:n,dateNow:o,hkdf:r})=>{const s=ut.convert(e),i=ut.convert(t),a=Ad(n.SECRET_BLOCK),c=ut.convert(o),u=new Uint8Array(s.byteLength+i.byteLength+a.byteLength+c.byteLength);u.set(s,0),u.set(i,s.byteLength),u.set(a,s.byteLength+i.byteLength),u.set(c,s.byteLength+i.byteLength+a.byteLength);const d=new We(r);d.update(u);const l=d.digestSync();return Ve.convert(l)},Ad=e=>{const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),o=Gt.convert(n),r=new 
8Uint8Array(o.length);for(let s=0;s<o.length;++s)r[s]=o.charCodeAt(s);return r};async function Qe({username:e,config:t,clientMetadata:n,session:o,tokenOrchestrator:r}){const{userPoolId:s,userPoolEndpoint:i}=t,a=t.userPoolClientId,c=await r?.getDeviceMetadata(e);jr(c);const u=await Xe(c.deviceGroupKey),d={USERNAME:e,SRP_A:u.A.toString(16),DEVICE_KEY:c.deviceKey},l={ChallengeName:"DEVICE_SRP_AUTH",ClientId:a,ChallengeResponses:d,ClientMetadata:n,Session:o},h=W({endpointResolver:C({endpointOverride:i})}),{ChallengeParameters:f,Session:g}=await h({region:v(s)},l);return Pd(e,f,n,g,u,t,r)}async function Pd(e,t,n,o,r,{userPoolId:s,userPoolClientId:i,userPoolEndpoint:a},c){const u=await c?.getDeviceMetadata(e);jr(u);const d=new p(t?.SRP_B,16),l=new p(t?.SALT,16),{deviceKey:h}=u,{deviceGroupKey:f}=u,g=await r.getPasswordAuthenticationKey({username:u.deviceKey,password:u.randomPassword,serverBValue:d,salt:l}),E=ts(),S={USERNAME:t?.USERNAME??e,PASSWORD_CLAIM_SECRET_BLOCK:t?.SECRET_BLOCK,TIMESTAMP:E,PASSWORD_CLAIM_SIGNATURE:ns({username:h,userPoolName:f,challengeParameters:t,dateNow:E,hkdf:g}),DEVICE_KEY:h},I=F({username:e,userPoolId:s,userPoolClientId:i}),H={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:i,ChallengeResponses:S,Session:o,ClientMetadata:n,UserContextData:I};return W({endpointResolver:C({endpointOverride:a})})({region:v(s)},H)}async function hn(e,t,n,o,r,s,i){const{userPoolId:a,userPoolClientId:c,userPoolEndpoint:u}=s,d=a?.split("_")[1]||"",l=new p(t?.SRP_B,16),h=new p(t?.SALT,16),f=t?.USER_ID_FOR_SRP;if(!f)throw new m({name:"EmptyUserIdForSRPException",message:"USER_ID_FOR_SRP was not found in challengeParameters"});const g=await r.getPasswordAuthenticationKey({username:f,password:e,serverBValue:l,salt:h}),E=ts(),S={USERNAME:f,PASSWORD_CLAIM_SECRET_BLOCK:t?.SECRET_BLOCK,TIMESTAMP:E,PASSWORD_CLAIM_SIGNATURE:ns({username:f,userPoolName:d,challengeParameters:t,dateNow:E,hkdf:g})},I=await i.getDeviceMetadata(f);I&&I.deviceKey&&(S.DEVICE_KEY=I.deviceKey);const H=F({username:f,userPoolId:a,userPoolClientId:c}),ue={ChallengeName:"PASSWORD_VERIFIER",ChallengeResponses:S,ClientMetadata:n,Session:o,ClientId:c,UserContextData:H},Ce=await W({endpointResolver:C({endpointOverride:u})})({region:v(a)},ue);return Ce.ChallengeName==="DEVICE_SRP_AUTH"?Qe({username:f,config:s,clientMetadata:n,session:Ce.Session,tokenOrchestrator:i}):Ce}async function Ne(e,t,n,o){try{return await e(...t)}catch(r){if(r instanceof m&&r.name==="ResourceNotFoundException"&&r.message.includes("Device does not exist."))return await o.clearDeviceMetadata(n),e(...t);throw r}}function we(e){const{dispatch:t}=ee;t({type:"SET_USERNAME",value:e})}async function os({username:e,password:t,clientMetadata:n,config:o,tokenOrchestrator:r,authFlow:s,preferredChallenge:i}){const{userPoolId:a,userPoolClientId:c,userPoolEndpoint:u}=o,d=a?.split("_")[1]||"",l=await Xe(d),h={USERNAME:e,SRP_A:l.A.toString(16)};s==="USER_AUTH"&&i&&(h.PREFERRED_CHALLENGE=i);const f=F({username:e,userPoolId:a,userPoolClientId:c}),g={AuthFlow:s,AuthParameters:h,ClientMetadata:n,ClientId:c,UserContextData:f},S=await Je({endpointResolver:C({endpointOverride:u})})({region:v(a),userAgentValue:T(P.SignIn)},g),{ChallengeParameters:I,Session:H}=S,ue=I?.USERNAME??e;return we(ue),S.ChallengeName==="PASSWORD_VERIFIER"?Ne(hn,[t,I,n,H,l,o,r],ue,r):S}async function Td({username:e,session:t,selectedChallenge:n,config:o,clientMetadata:r}){return W({endpointResolver:C({endpointOverride:o.userPoolEndpoint})})({region:v(o.userPoolId),userAgentValue:T(P.ConfirmSignIn)},{ChallengeName:"SELECT_CHALLENGE",ChallengeResponses:{USERNAME:e,ANSWER:n},ClientId:o.userPoolClientId,Session:t,ClientMetadata:r})}async function Rd(e,t,n,o,r){const{userPoolId:s,userPoolClientId:i,userPoolEndpoint:a}=o,c={ANSWER:"PASSWORD",USERNAME:e,PASSWORD:t},u=F({username:e,userPoolId:s,userPoolClientId:i}),l=await W({endpointResolver:C({endpointOverride:a})})({region:v(s),userAgentValue:T(P.ConfirmSignIn)},{ChallengeName:"SELECT_CHALLENGE",ChallengeResponses:c,ClientId:i,ClientMetadata:n,Session:r,UserContextData:u}),h=l.ChallengeParameters?.USERNAME??e;return we(h),l}async function _d(e,t,n,o,r,s){const{userPoolId:i,userPoolClientId:a,userPoolEndpoint:c}=o,u=i.split("_")[1]||"",d=await Xe(u),l={ANSWER:"PASSWORD_SRP",USERNAME:e,SRP_A:d.A.toString(16)},h=F({username:e,userPoolId:i,userPoolClientId:a}),g=await W({endpointResolver:C({endpointOverride:c})})({region:v(i),userAgentValue:T(P.ConfirmSignIn)},{ChallengeName:"SELECT_CHALLENGE",ChallengeResponses:l,ClientId:a,ClientMetadata:n,Session:r,UserContextData:h}
8),E=g.ChallengeParameters?.USERNAME??e;return we(E),g.ChallengeName==="PASSWORD_VERIFIER"?Ne(hn,[t,g.ChallengeParameters,n,g.Session,d,o,s],E,s):g}const qt="userAttributes.";function xd(e){return"isSignedIn"in e&&"nextStep"in e}async function bd({challengeResponse:e,clientMetadata:t,session:n,username:o,config:r,tokenOrchestrator:s}){const{userPoolId:i,userPoolClientId:a,userPoolEndpoint:c}=r,u={USERNAME:o,ANSWER:e},d=await s?.getDeviceMetadata(o);d&&d.deviceKey&&(u.DEVICE_KEY=d.deviceKey);const l=F({username:o,userPoolId:i,userPoolClientId:a}),h={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:u,Session:n,ClientMetadata:t,ClientId:a,UserContextData:l},g=await W({endpointResolver:C({endpointOverride:c})})({region:v(i),userAgentValue:T(P.ConfirmSignIn)},h);return g.ChallengeName==="DEVICE_SRP_AUTH"?Qe({username:o,config:r,clientMetadata:t,session:g.Session,tokenOrchestrator:s}):g}async function Nd({challengeResponse:e,username:t,clientMetadata:n,session:o,deviceName:r,config:s}){const{userPoolId:i,userPoolClientId:a,userPoolEndpoint:c}=s;if(e==="EMAIL")return{ChallengeName:"MFA_SETUP",Session:o,ChallengeParameters:{MFAS_CAN_SETUP:'["EMAIL_OTP"]'},$metadata:{}};if(e==="TOTP")return{ChallengeName:"MFA_SETUP",Session:o,ChallengeParameters:{MFAS_CAN_SETUP:'["SOFTWARE_TOKEN_MFA"]'},$metadata:{}};const u={USERNAME:t};if(/^\d+$/.test(e)){const h=eu({endpointResolver:C({endpointOverride:c})}),{Session:f}=await h({region:v(i),userAgentValue:T(P.ConfirmSignIn)},{UserCode:e,Session:o,FriendlyDeviceName:r});ee.dispatch({type:"SET_SIGN_IN_SESSION",value:f});const g={ChallengeName:"MFA_SETUP",ChallengeResponses:u,Session:f,ClientMetadata:n,ClientId:a};return W({endpointResolver:C({endpointOverride:c})})({region:v(i),userAgentValue:T(P.ConfirmSignIn)},g)}if(e.includes("@")){u.EMAIL=e;const h={ChallengeName:"MFA_SETUP",ChallengeResponses:u,Session:o,ClientMetadata:n,ClientId:a};return W({endpointResolver:C({endpointOverride:c})})({region:v(i),userAgentValue:T(P.ConfirmSignIn)},h)}throw new m({name:ae.SignInException,message:`Cannot proceed with MFA setup using challengeResponse: ${e}`,recoverySuggestion:'Try passing "EMAIL", "TOTP", a valid email, or OTP code as the challengeResponse.'})}async function Od({challengeResponse:e,username:t,clientMetadata:n,session:o,config:r}){const{userPoolId:s,userPoolClientId:i,userPoolEndpoint:a}=r;b(e==="TOTP"||e==="SMS"||e==="EMAIL",y.IncorrectMFAMethod);const c={USERNAME:t,ANSWER:Hd(e)},u=F({username:t,userPoolId:s,userPoolClientId:i}),d={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:c,Session:o,ClientMetadata:n,ClientId:i,UserContextData:u};return W({endpointResolver:C({endpointOverride:a})})({region:v(s),userAgentValue:T(P.ConfirmSignIn)},d)}async function Dd({challengeResponse:e,clientMetadata:t,session:n,username:o,requiredAttributes:r,config:s}){const{userPoolId:i,userPoolClientId:a,userPoolEndpoint:c}=s,u={...Bd(r),NEW_PASSWORD:e,USERNAME:o},d=F({username:o,userPoolId:i,userPoolClientId:a}),l={ChallengeName:"NEW_PASSWORD_REQUIRED",ChallengeResponses:u,ClientMetadata:t,Session:n,ClientId:a,UserContextData:d};return W({endpointResolver:C({endpointOverride:c})})({region:v(i),userAgentValue:T(P.ConfirmSignIn)},l)}async function Md(e,t,n,o,r){const{userPoolClientId:s,userPoolId:i,userPoolEndpoint:a}=o,c={USERNAME:e,PASSWORD:t},u=await r.getDeviceMetadata(e);u&&u.deviceKey&&(c.DEVICE_KEY=u.deviceKey);const d=F({username:e,userPoolId:i,userPoolClientId:s}),l={AuthFlow:"USER_PASSWORD_AUTH",AuthParameters:c,ClientMetadata:n,ClientId:s,UserContextData:d},f=await Je({endpointResolver:C({endpointOverride:a})})({region:v(i),userAgentValue:T(P.SignIn)},l),g=f.ChallengeParameters?.USERNAME??f.ChallengeParameters?.USER_ID_FOR_SRP??e;return we(g),f.ChallengeName==="DEVICE_SRP_AUTH"?Qe({username:g,config:o,clientMetadata:n,session:f.Session,tokenOrchestrator:r}):f}async function Ud(e,t,n,o,r){return os({username:e,password:t,clientMetadata:n,config:o,tokenOrchestrator:r,authFlow:"USER_SRP_AUTH"})}async function Fd(e,t,n,o){const{userPoolClientId:r,userPoolId:s,userPoolEndpoint:i}=n,a={USERNAME:e},c=await o.getDeviceMetadata(e);c&&c.deviceKey&&(a.DEVICE_KEY=c.deviceKey);const u=F({username:e,userPoolId:s,userPoolClientId:r}),d={AuthFlow:"CUSTOM_AUTH",AuthParameters:a,ClientMetadata:t,ClientId:r,UserContextData:u},h=await Je({endpointResolver:C({endpointOverride:i})})({region:v(s),userAgentValue:T(P.SignIn)}
8,d),f=h.ChallengeParameters?.USERNAME??e;return we(f),h.ChallengeName==="DEVICE_SRP_AUTH"?Qe({username:f,config:n,clientMetadata:t,session:h.Session,tokenOrchestrator:o}):h}async function kd(e,t,n,o,r){w(o);const{userPoolId:s,userPoolClientId:i,userPoolEndpoint:a}=o,c=s?.split("_")[1]||"",u=await Xe(c),d={USERNAME:e,SRP_A:u.A.toString(16),CHALLENGE_NAME:"SRP_A"},l=F({username:e,userPoolId:s,userPoolClientId:i}),h={AuthFlow:"CUSTOM_AUTH",AuthParameters:d,ClientMetadata:n,ClientId:i,UserContextData:l},f=Je({endpointResolver:C({endpointOverride:a})}),{ChallengeParameters:g,Session:E}=await f({region:v(s),userAgentValue:T(P.SignIn)},h),S=g?.USERNAME??e;return we(S),Ne(hn,[t,g,n,E,u,o,r],S,r)}async function ve(e){const{challengeName:t,challengeParameters:n,availableChallenges:o}=e,r=A.getConfig().Auth?.Cognito;switch(w(r),t){case"CUSTOM_CHALLENGE":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_CUSTOM_CHALLENGE",additionalInfo:n}};case"MFA_SETUP":{const{signInSession:s,username:i}=ee.getState(),a=Oo(Do(n.MFAS_CAN_SETUP))||[],c=qd(a),u=c.includes("TOTP"),d=c.includes("EMAIL");if(u&&d)return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION",allowedMFATypes:c}};if(d)return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_EMAIL_SETUP"}};if(u){const l=tu({endpointResolver:C({endpointOverride:r.userPoolEndpoint})}),{Session:h,SecretCode:f}=await l({region:v(r.userPoolId)},{Session:s});return ee.dispatch({type:"SET_SIGN_IN_SESSION",value:h}),{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_TOTP_SETUP",totpSetupDetails:Ld(f,i)}}}throw new m({name:ae.SignInException,message:`Cannot initiate MFA setup from available types: ${a}`})}case"NEW_PASSWORD_REQUIRED":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED",missingAttributes:Kd(n.requiredAttributes)}};case"SELECT_MFA_TYPE":return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_MFA_SELECTION",allowedMFATypes:Oo(Do(n.MFAS_CAN_CHOOSE))}};case"SMS_OTP":case"SMS_MFA":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_SMS_CODE",codeDeliveryDetails:{deliveryMedium:n.CODE_DELIVERY_DELIVERY_MEDIUM,destination:n.CODE_DELIVERY_DESTINATION}}};case"SOFTWARE_TOKEN_MFA":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_TOTP_CODE"}};case"EMAIL_OTP":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_EMAIL_CODE",codeDeliveryDetails:{deliveryMedium:n.CODE_DELIVERY_DELIVERY_MEDIUM,destination:n.CODE_DELIVERY_DESTINATION}}};case"WEB_AUTHN":{const s=await wd(n);return xd(s)?s:ve(s)}case"PASSWORD":case"PASSWORD_SRP":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_PASSWORD"}};case"SELECT_CHALLENGE":return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_FIRST_FACTOR_SELECTION",availableChallenges:o}}}throw new m({name:ae.SignInException,message:`An error occurred during the sign in process. ${t} challengeName returned by the underlying service was not addressed.`})}function Ld(e,t){return{sharedSecret:e,getSetupUri:(n,o)=>{const r=`otpauth://totp/${n}:${o??t}?secret=${e}&issuer=${n}`;return new ze(r)}}}function Oe(e){if(e===ht.PasswordResetRequiredException)return{isSignedIn:!1,nextStep:{signInStep:"RESET_PASSWORD"}};if(e===ht.UserNotConfirmedException)return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_UP"}}}function Kd(e){return e?JSON.parse(e).map(n=>n.includes(qt)?n.replace(qt,""):n):[]}function Bd(e){if(!e)return{};const t={};return Object.entries(e).forEach(([n,o])=>{o&&(t[`${qt}${n}`]=o)}),t}async function Wd(e,t,n,o,r,s,i,a){const c=a?.userAttributes,u=a?.friendlyDeviceName;switch(t){case"WEB_AUTHN":case"SELECT_CHALLENGE":return o==="PASSWORD_SRP"||o==="PASSWORD"?{ChallengeName:o,Session:n,$metadata:{}}:Td({username:e,session:n,selectedChallenge:o,config:r,clientMetadata:i});case"SELECT_MFA_TYPE":return Od({challengeResponse:o,clientMetadata:i,session:n,username:e,config:r});case"MFA_SETUP":return Nd({challengeResponse:o,clientMetadata:i,session:n,username:e,deviceName:u,config:r});case"NEW_PASSWORD_REQUIRED":return Dd({challengeResponse:o,clientMetadata:i,session:n,username:e,requiredAttributes:c,config:r});case"CUSTOM_CHALLENGE":return Ne(bd,[{challengeResponse:o,clientMetadata:i,session:n,username:e,config:r,tokenOrchestrator:s}],e,s);case"SMS_MFA":case"SOFTWARE_TOKEN_MFA":case"SMS_OTP":case"EMAIL_OTP":return jd({challengeName:t,challengeResponse:o,clientMetadata:i,session:n,username:e,config:r,tokenOrchestrator:s});case"PASSWORD":return Rd(e,o,i,r,n);case"PASSWORD_SRP":return _d(e,o,i,r,n,s)}
8throw new m({name:ae.SignInException,message:`An error occurred during the sign in process.
9		${t} challengeName returned by the underlying service was not addressed.`})}function Hd(e){let t="SMS_MFA";return e==="TOTP"&&(t="SOFTWARE_TOKEN_MFA"),e==="EMAIL"&&(t="EMAIL_OTP"),t}function Vd(e){if(e==="SMS_MFA")return"SMS";if(e==="SOFTWARE_TOKEN_MFA")return"TOTP";if(e==="EMAIL_OTP")return"EMAIL"}function Oo(e){if(e)return e.map(Vd).filter(Boolean)}function Do(e){return e?JSON.parse(e):[]}function qd(e){return e.filter(t=>t==="EMAIL"||t==="TOTP")}async function $d(){let e;try{e=await zr()}catch{}if(e&&e.userId&&e.username)throw new m({name:Nc,message:"There is already a signed in user.",recoverySuggestion:"Call signOut before calling signIn again."})}function Ze(e){return ee.getState().username??e}async function jd({challengeName:e,challengeResponse:t,clientMetadata:n,session:o,username:r,config:s,tokenOrchestrator:i}){const{userPoolId:a,userPoolClientId:c,userPoolEndpoint:u}=s,d={USERNAME:r};e==="EMAIL_OTP"&&(d.EMAIL_OTP_CODE=t),e==="SMS_MFA"&&(d.SMS_MFA_CODE=t),e==="SMS_OTP"&&(d.SMS_OTP_CODE=t),e==="SOFTWARE_TOKEN_MFA"&&(d.SOFTWARE_TOKEN_MFA_CODE=t);const l=await i?.getDeviceMetadata(r);l&&l.deviceKey&&(d.DEVICE_KEY=l.deviceKey);const h=F({username:r,userPoolId:a,userPoolClientId:c}),f={ChallengeName:e,ChallengeResponses:d,Session:o,ClientMetadata:n,ClientId:c,UserContextData:h},E=await W({endpointResolver:C({endpointOverride:u})})({region:v(a),userAgentValue:T(P.ConfirmSignIn)},f);return E.ChallengeName==="DEVICE_SRP_AUTH"?Qe({username:r,config:s,clientMetadata:n,session:E.Session,tokenOrchestrator:i}):E}async function Gd(e){const t=A.getConfig().Auth?.Cognito;w(t);const{username:n,password:o,options:r}=e,s={loginId:n,authFlowType:"CUSTOM_WITHOUT_SRP"},i=r?.clientMetadata;b(!!n,y.EmptySignInUsername),b(!o,y.CustomAuthSignInPassword);try{const{ChallengeName:a,ChallengeParameters:c,AuthenticationResult:u,Session:d}=await Ne(Fd,[n,i,t,L],n,L),l=Ze(n);return Se({signInSession:d,username:l,challengeName:a,signInDetails:s}),u?(await me({username:l,...u,NewDeviceMetadata:await Ie({userPoolId:t.userPoolId,userPoolEndpoint:t.userPoolEndpoint,newDeviceMetadata:u.NewDeviceMetadata,accessToken:u.AccessToken}),signInDetails:s}),J(),await ye(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):ve({challengeName:a,challengeParameters:c})}catch(a){J(),Y(a);const c=Oe(a.name);if(c)return c;throw a}}async function zd(e){const{username:t,password:n,options:o}=e,r={loginId:t,authFlowType:"CUSTOM_WITH_SRP"},s=A.getConfig().Auth?.Cognito;w(s);const i=o?.clientMetadata;b(!!t,y.EmptySignInUsername),b(!!n,y.EmptySignInPassword);try{const{ChallengeName:a,ChallengeParameters:c,AuthenticationResult:u,Session:d}=await kd(t,n,i,s,L),l=Ze(t);return Se({signInSession:d,username:l,challengeName:a,signInDetails:r}),u?(await me({username:l,...u,NewDeviceMetadata:await Ie({userPoolId:s.userPoolId,userPoolEndpoint:s.userPoolEndpoint,newDeviceMetadata:u.NewDeviceMetadata,accessToken:u.AccessToken}),signInDetails:r}),J(),await ye(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):ve({challengeName:a,challengeParameters:c})}catch(a){J(),Y(a);const c=Oe(a.name);if(c)return c;throw a}}function Ee(e=!0){Qr.dispatch({type:"RESET"})}async function Mo(e){const{username:t,password:n}=e,o=A.getConfig().Auth?.Cognito,r={loginId:t,authFlowType:"USER_SRP_AUTH"};w(o);const s=e.options?.clientMetadata;b(!!t,y.EmptySignInUsername),b(!!n,y.EmptySignInPassword);try{const{ChallengeName:i,ChallengeParameters:a,AuthenticationResult:c,Session:u}=await Ud(t,n,s,o,L),d=Ze(t);return Se({signInSession:u,username:d,challengeName:i,signInDetails:r}),c?(await me({username:d,...c,NewDeviceMetadata:await Ie({userPoolId:o.userPoolId,userPoolEndpoint:o.userPoolEndpoint,newDeviceMetadata:c.NewDeviceMetadata,accessToken:c.AccessToken}),signInDetails:r}),J(),await ye(),Ee(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):ve({challengeName:i,challengeParameters:a})}catch(i){J(),Ee(),Y(i);const a=Oe(i.name);if(a)return a;throw i}}async function Yd(e){const{username:t,password:n,options:o}=e,r=A.getConfig().Auth?.Cognito,s={loginId:t,authFlowType:"USER_PASSWORD_AUTH"};w(r);const i=o?.clientMetadata;b(!!t,y.EmptySignInUsername),b(!!n,y.EmptySignInPassword);try{const{ChallengeName:a,ChallengeParameters:c,AuthenticationResult:u,Session:d}=await Ne(Md,[t,n,i,r,L],t,L),l=Ze(t);return Se({signInSession:d,username:l,challengeName:a,signInDetail
9s:s}),u?(await me({...u,username:l,NewDeviceMetadata:await Ie({userPoolId:r.userPoolId,userPoolEndpoint:r.userPoolEndpoint,newDeviceMetadata:u.NewDeviceMetadata,accessToken:u.AccessToken}),signInDetails:s}),J(),await ye(),Ee(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):ve({challengeName:a,challengeParameters:c})}catch(a){J(),Ee(),Y(a);const c=Oe(a.name);if(c)return c;throw a}}async function Jd({username:e,clientMetadata:t,config:n,tokenOrchestrator:o,preferredChallenge:r,password:s,session:i}){const{userPoolId:a,userPoolClientId:c,userPoolEndpoint:u}=n,d=F({username:e,userPoolId:a,userPoolClientId:c}),l={USERNAME:e};if(r){if(n.passwordless&&(r==="EMAIL_OTP"&&!n.passwordless.emailOtpEnabled||r==="SMS_OTP"&&!n.passwordless.smsOtpEnabled||r==="WEB_AUTHN"&&!n.passwordless.webAuthn)&&b(!1,y.InvalidPreferredChallenge),r==="PASSWORD_SRP")return b(!!s,y.EmptySignInPassword),os({username:e,password:s,clientMetadata:t,config:n,tokenOrchestrator:o,authFlow:"USER_AUTH",preferredChallenge:r});r==="PASSWORD"&&(b(!!s,y.EmptySignInPassword),l.PASSWORD=s),l.PREFERRED_CHALLENGE=r}const h={AuthFlow:"USER_AUTH",AuthParameters:l,ClientMetadata:t,ClientId:c,UserContextData:d};i&&(h.Session=i);const g=await Je({endpointResolver:C({endpointOverride:u})})({region:v(a),userAgentValue:T(P.SignIn)},h);return we(e),g}async function Xd(e){const{username:t,password:n,options:o}=e,r=A.getConfig().Auth?.Cognito,s={loginId:t,authFlowType:"USER_AUTH"};w(r);const i=o?.clientMetadata,a=o?.preferredChallenge??r?.passwordless?.preferredChallenge;b(!!t,y.EmptySignInUsername);try{const c={username:t,config:r,tokenOrchestrator:L,clientMetadata:i,preferredChallenge:a,password:n},u=Qr.getState();u.active&&u.username===t&&(c.session=u.session);const d=await Jd(c),l=Ze(t);return Se({signInSession:d.Session,username:l,challengeName:d.ChallengeName,signInDetails:s}),d.AuthenticationResult?(await me({username:l,...d.AuthenticationResult,NewDeviceMetadata:await Ie({userPoolId:r.userPoolId,userPoolEndpoint:r.userPoolEndpoint,newDeviceMetadata:d.AuthenticationResult.NewDeviceMetadata,accessToken:d.AuthenticationResult.AccessToken}),signInDetails:s}),J(),await ye(),Ee(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):ve({challengeName:d.ChallengeName,challengeParameters:d.ChallengeParameters,availableChallenges:"AvailableChallenges"in d?d.AvailableChallenges:void 0})}catch(c){J(),Ee(),Y(c);const u=Oe(c.name);if(u)return u;throw c}}async function Ol(e){Ee(!1);const t=e.options?.authFlowType;switch(await $d(),t){case"USER_SRP_AUTH":return Mo(e);case"USER_PASSWORD_AUTH":return Yd(e);case"CUSTOM_WITHOUT_SRP":return Gd(e);case"CUSTOM_WITH_SRP":return zd(e);case"USER_AUTH":return Xd(e);default:return Mo(e)}}const Qd=e=>K(G,$("ForgotPassword"),j(),{...z,...e});async function Dl(e){const{username:t}=e;b(!!t,y.EmptyResetPasswordUsername);const n=A.getConfig().Auth?.Cognito;w(n);const{userPoolClientId:o,userPoolId:r,userPoolEndpoint:s}=n,i=e.options?.clientMetadata,a=F({username:t,userPoolId:r,userPoolClientId:o}),d=(await Qd({endpointResolver:C({endpointOverride:s})})({region:v(r),userAgentValue:T(P.ResetPassword)},{Username:t,ClientMetadata:i,ClientId:o,UserContextData:a})).CodeDeliveryDetails;return{isPasswordReset:!1,nextStep:{resetPasswordStep:"CONFIRM_RESET_PASSWORD_WITH_CODE",codeDeliveryDetails:{deliveryMedium:d?.DeliveryMedium,destination:d?.Destination,attributeName:d?.AttributeName}}}}const Zd=e=>K(G,$("ConfirmForgotPassword"),j(),{...z,...e});async function Ml(e){const t=A.getConfig().Auth?.Cognito;w(t);const{userPoolClientId:n,userPoolId:o,userPoolEndpoint:r}=t,{username:s,newPassword:i}=e;b(!!s,y.EmptyConfirmResetPasswordUsername),b(!!i,y.EmptyConfirmResetPasswordNewPassword);const a=e.confirmationCode;b(!!a,y.EmptyConfirmResetPasswordConfirmationCode);const c=e.options?.clientMetadata,u=F({username:s,userPoolId:o,userPoolClientId:n});await Zd({endpointResolver:C({endpointOverride:r})})({region:v(t.userPoolId),userAgentValue:T(P.ConfirmResetPassword)},{Username:s,ConfirmationCode:a,Password:i,ClientMetadata:c,ClientId:t.userPoolClientId,UserContextData:u})}async function Ul(e){const{challengeResponse:t,options:n}
9=e,{username:o,challengeName:r,signInSession:s,signInDetails:i}=ee.getState(),a=A.getConfig().Auth?.Cognito;w(a);const c=n?.clientMetadata;if(b(!!t,y.EmptyChallengeResponse),!o||!r||!s)throw new m({name:ae.SignInException,message:`
10			An error occurred during the sign in process.
11
12			This most likely occurred due to:
13			1. signIn was not called before confirmSignIn.
14			2. signIn threw an exception.
15			3. page was refreshed during the sign in flow and session has expired.
16			`,recoverySuggestion:"Make sure a successful call to signIn is made before calling confirmSignInand that the session has not expired."});try{const{Session:u,ChallengeName:d,AuthenticationResult:l,ChallengeParameters:h}=await Wd(o,r,s,t,a,L,c,n);return Se({signInSession:u,username:o,challengeName:d,signInDetails:i}),l?(await me({username:o,...l,NewDeviceMetadata:await Ie({userPoolId:a.userPoolId,userPoolEndpoint:a.userPoolEndpoint,newDeviceMetadata:l.NewDeviceMetadata,accessToken:l.AccessToken}),signInDetails:i}),J(),await ye(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):ve({challengeName:d,challengeParameters:h})}catch(u){Y(u);const d=Oe(u.name);if(d)return d;throw u}}const el=e=>K(G,$("GetUser"),j(),{...z,...e}),tl=e=>K(G,$("ChangePassword"),j(),{...z,...e});async function Fl(e){const t=A.getConfig().Auth?.Cognito;w(t);const{userPoolEndpoint:n,userPoolId:o}=t,{oldPassword:r,newPassword:s}=e;b(!!r,y.EmptyUpdatePassword),b(!!s,y.EmptyUpdatePassword);const{tokens:i}=await Ea({forceRefresh:!1});At(i),await tl({endpointResolver:C({endpointOverride:n})})({region:v(o),userAgentValue:T(P.UpdatePassword)},{AccessToken:i.accessToken.toString(),PreviousPassword:r,ProposedPassword:s})}function nl(e,t){if(t){const n=e?.find(o=>o===t);if(!n)throw kc;return n}else{const n=e?.find(ol)??e?.find(rl),o=e?.find(il)??e?.find(sl);if(n)return n;throw o?Kc:Fc}}const ol=e=>e.startsWith(String(window.location.origin+(window.location.pathname||"/"))),rl=e=>e.includes(String(window.location.hostname)),sl=e=>e.startsWith("http://"),il=e=>e.startsWith("https://"),al=async e=>{window?.location&&(window.location.href=e.replace("http://","https://"))},cl=async e=>{const t=e.getConfig().Auth?.Cognito;w(t);const{userPoolEndpoint:n,userPoolId:o}=t,{tokens:r}=await vr(e,{forceRefresh:!1});At(r);const s=el({endpointResolver:C({endpointOverride:n})}),{UserAttributes:i}=await s({region:v(o),userAgentValue:T(P.FetchUserAttributes)},{AccessToken:r.accessToken.toString()});return bc(i)},kl=()=>cl(A),ul=async e=>{await e.clearOAuthData(),L.clearTokens(),await Cr(),Pe.dispatch("auth",{event:"signedOut"},"Auth",fe)},dl=async(e,t=!1,n)=>{Fo(e);const{loginWith:o,userPoolClientId:r}=e,{domain:s,redirectSignOut:i}=o.oauth,a=nl(i,n),c=`https://${s}/logout?${Object.entries({client_id:r,logout_uri:encodeURIComponent(a)}).map(([u,d])=>`${u}=${d}`).join("&")}`;return al(c)},ll=async(e,t,n,o)=>{const{isOAuthSignIn:r}=await t.loadOAuthSignIn(),s=await n.getOAuthMetadata();if(await ul(t),r||s?.oauthSignIn)return dl(e,!1,o)},hl=e=>K(G,$("RevokeToken"),j(),{...z,...e}),fl=e=>K(G,$("GlobalSignOut"),j(),{...z,...e}),rs=new k("Auth");async function Ll(e){const t=A.getConfig().Auth?.Cognito;w(t),e?.global?await gl(t):await pl(t);let n;try{Fo(t),n=!0}catch{n=!1}if(n){const o=new Jr(Ye);o.setAuthConfig(t);const{type:r}=await ll(t,o,L,e?.oauth?.redirectUrl)??{};if(r==="error")throw new m({name:Bc,message:"An error occurred when attempting to log out from OAuth provider."})}else L.clearTokens(),await Cr(),Pe.dispatch("auth",{event:"signedOut"},"Auth",fe)}async function pl(e){try{const{userPoolEndpoint:t,userPoolId:n,userPoolClientId:o}=e,r=await L.getTokenStore().loadTokens();$r(r),El(r.accessToken)&&await hl({endpointResolver:C({endpointOverride:t})})({region:v(n),userAgentValue:T(P.SignOut)},{ClientId:o,Token:r.refreshToken})}catch{rs.debug("Client signOut error caught but will proceed with token removal")}}async function gl(e){try{const{userPoolEndpoint:t,userPoolId:n}=e,o=await L.getTokenStore().loadTokens();At(o),await fl({endpointResolver:C({endpointOverride:t})})({region:v(n),userAgentValue:T(P.SignOut)}
16,{AccessToken:o.accessToken.toString()})}catch{rs.debug("Global signOut error caught but will proceed with token removal")}}const El=e=>!!e?.payload?.origin_jti,ml={identityId:"identityId"},yl=new k("DefaultIdentityIdStore");class ss{setAuthConfig(t){at(t.Cognito),this.authConfig=t,this._authKeys=Sl("Cognito",t.Cognito.identityPoolId)}constructor(t){this._authKeys={},this._hasGuestIdentityId=!1,this.keyValueStorage=t}async loadIdentityId(){at(this.authConfig?.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{const t=await this.keyValueStorage.getItem(this._authKeys.identityId);return t?(this._hasGuestIdentityId=!0,{id:t,type:"guest"}):null}}catch(t){return yl.log("Error getting stored IdentityId.",t),null}}async storeIdentityId(t){at(this.authConfig?.Cognito),t.type==="guest"?(this.keyValueStorage.setItem(this._authKeys.identityId,t.id),this._primaryIdentityId=void 0,this._hasGuestIdentityId=!0):(this._primaryIdentityId=t.id,this._hasGuestIdentityId&&(this.keyValueStorage.removeItem(this._authKeys.identityId),this._hasGuestIdentityId=!1))}async clearIdentityId(){this._primaryIdentityId=void 0,await this.keyValueStorage.removeItem(this._authKeys.identityId)}}const Sl=(e,t)=>on(ml)(`com.amplify.${e}`,t),$t=({endpointOverride:e})=>t=>e?{url:new ze(e)}:Ha(t);function is(e){const t=pe(e).payload.iss,n={};if(!t)throw new m({name:"InvalidIdTokenException",message:"Invalid Idtoken."});const o=t.replace(/(^\w+:|^)\/\//,"");return n[o]=e,n}async function Il({tokens:e,authConfig:t,identityIdStore:n}){n.setAuthConfig({Cognito:t});const o=await n.loadIdentityId();if(o)return o.id;const r=e?.idToken?is(e.idToken.toString()):{},s=await wl(r,t);return n.storeIdentityId({id:s,type:e?"primary":"guest"}),s}async function wl(e,t){const n=t?.identityPoolId,o=Wt(n),r=Ka({endpointResolver:$t({endpointOverride:t.identityPoolEndpoint})});let s;try{s=(await r({region:o},{IdentityPoolId:n,Logins:e})).IdentityId}catch(i){throw Y(i),new m(i)}if(!s)throw new m({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return s}const it=new k("CognitoCredentialsProvider"),Uo=3e3*1e3;class as{constructor(t){this._nextCredentialsRefresh=0,this._identityIdStore=t}async clearCredentialsAndIdentityId(){it.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){it.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(t){const n=t.authenticated,{tokens:o}=t,{authConfig:r}=t;try{at(r?.Cognito)}catch{return}if(!n&&!r.Cognito.allowGuestAccess)return;const{forceRefresh:s}=t,i=this.hasTokenChanged(o),a=await Il({tokens:o,authConfig:r.Cognito,identityIdStore:this._identityIdStore});return(s||i)&&this.clearCredentials(),n?(Vc(o),this.credsForOIDCTokens(r.Cognito,o,a)):this.getGuestCredentials(a,r.Cognito)}async getGuestCredentials(t,n){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!1)return it.info("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const o=Wt(n.identityPoolId),r=Yn({endpointResolver:$t({endpointOverride:n.identityPoolEndpoint})});let s;try{s=await r({region:o},{IdentityId:t})}catch(i){throw Y(i),new m(i)}if(s?.Credentials?.AccessKeyId&&s?.Credentials?.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+Uo;const i={credentials:{accessKeyId:s.Credentials.AccessKeyId,secretAccessKey:s.Credentials.SecretKey,sessionToken:s.Credentials.SessionToken,expiration:s.Credentials.Expiration},identityId:t};return s.IdentityId&&(i.identityId=s.IdentityId,this._identityIdStore.storeIdentityId({id:s.IdentityId,type:"guest"})),this._credentialsAndIdentityId={...i,isAuthenticatedCreds:!1},i}else throw new m({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}async credsForOIDCTokens(t,n,o){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!0)return it.debug("returning stored credentials as they neither past TTL n
16or expired."),this._credentialsAndIdentityId;this.clearCredentials();const r=n.idToken?is(n.idToken.toString()):{},s=Wt(t.identityPoolId),i=Yn({endpointResolver:$t({endpointOverride:t.identityPoolEndpoint})});let a;try{a=await i({region:s},{IdentityId:o,Logins:r})}catch(c){throw Y(c),new m(c)}if(a?.Credentials?.AccessKeyId&&a?.Credentials?.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+Uo;const c={credentials:{accessKeyId:a.Credentials.AccessKeyId,secretAccessKey:a.Credentials.SecretKey,sessionToken:a.Credentials.SessionToken,expiration:a.Credentials.Expiration},identityId:o};return a.IdentityId&&(c.identityId=a.IdentityId,this._identityIdStore.storeIdentityId({id:a.IdentityId,type:"primary"})),this._credentialsAndIdentityId={...c,isAuthenticatedCreds:!0,associatedIdToken:n.idToken?.toString()},c}else throw new m({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}isPastTTL(){return this._nextCredentialsRefresh===void 0?!0:this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(t){return!!t&&!!this._credentialsAndIdentityId?.associatedIdToken&&t.idToken?.toString()!==this._credentialsAndIdentityId.associatedIdToken}}const vl=new as(new ss(Ye)),Kl={configure(e,t){const n=Ko(e),o=new Ya({sameSite:"lax"}),r=t?.ssr?o:Ye,s=t?.ssr?new as(new ss(o)):vl;if(!n.Auth){A.configure(n,t);return}if(t?.Auth){A.configure(n,t);return}if(!A.libraryOptions.Auth){ke.setAuthConfig(n.Auth),ke.setKeyValueStorage(r),A.configure(n,{...t,Auth:{tokenProvider:ke,credentialsProvider:s}});return}if(t){const i=A.libraryOptions.Auth;t.ssr!==void 0&&(ke.setKeyValueStorage(r),i.credentialsProvider=s),A.configure(n,{Auth:i,...t});return}A.configure(n)},getConfig(){return A.getConfig()}};export{Bt as A,Fl as B,k as C,kl as D,Ll as E,Ul as F,Ml as G,Pe as H,Dl as I,Ol as J,m as K,qe as L,gt as M,bl as N,te as O,$e as P,Be as Q,Ke as R,Te as S,Pl as T,Al as U,Kl as V,lt as _,ze as a,_l as b,tn as c,A as d,Rl as e,Da as f,_r as g,Ea as h,yc as i,Rr as j,_a as k,As as l,Tl as m,Ve as n,Nl as o,Ge as p,fe as q,Ta as r,xl as s,yt as t,Na as u,U as v,ha as w,Rn as x,Ut as y,zr as z};

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.