@remit/web-client-dist 0.0.186 → 0.0.188
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{ComposeBody-4tlkMti8.js → ComposeBody-BtsVC2Nm.js} +1 -1
- package/assets/{ConfirmDialog-C2Z2FXGy.js → ConfirmDialog-Dhdaw-CV.js} +1 -1
- package/assets/{ErrorState-B3ZkPO4q.js → ErrorState-CWg8ckWQ.js} +1 -1
- package/assets/{OnboardingWizard-C8lNGBwH.js → OnboardingWizard-BkYr7DQu.js} +1 -1
- package/assets/{account-form-helpers-D3j1j_mx.js → account-form-helpers-Bh_DtClJ.js} +1 -1
- package/assets/{accounts-2Psoeq13.js → accounts-B7zI2caP.js} +1 -1
- package/assets/{advanced-u1bJcWgy.js → advanced-BG0z84LJ.js} +1 -1
- package/assets/{appearance-N8MKy-4d.js → appearance-CMcsFswi.js} +1 -1
- package/assets/{avatar-B0aQGScJ.js → avatar-BhqJp4QS.js} +1 -1
- package/assets/{browser-ponyfill-DHOWeyHw.js → browser-ponyfill-CJ5rYtwO.js} +1 -1
- package/assets/{circle-check-BKTsp0by.js → circle-check-D-i-OTL9.js} +1 -1
- package/assets/{download-DheM4u2B.js → download-DqfleSqM.js} +1 -1
- package/assets/{filters-fTvJjzw2.js → filters-CUiHcPSX.js} +1 -1
- package/assets/{flagged-Dz6s_8ns.js → flagged-BQE8ngVG.js} +1 -1
- package/assets/{folders-DNmbv735.js → folders-Cc9RqpfY.js} +1 -1
- package/assets/{index-C6Klfbms.js → index-B0lra0SE.js} +6 -6
- package/assets/{index-Bs5XAxW4.js → index-BKjXiP3s.js} +1 -1
- package/assets/{index-DllQMXH0.css → index-CptAZLJ2.css} +1 -1
- package/assets/index-DuJVCSPo.js +1 -0
- package/assets/{kbd-BuwiTaTJ.js → kbd-tzYIpn0Y.js} +1 -1
- package/assets/{labels-CLeRnhvG.js → labels-SrbbdmRw.js} +1 -1
- package/assets/mail-CXe7Cs9r.js +118 -0
- package/assets/{move-mailbox-picker-bt343XBT.js → move-mailbox-picker-CJH8gfL0.js} +1 -1
- package/assets/{move-targets-YuM1j7MQ.js → move-targets-ggm3HCkB.js} +1 -1
- package/assets/{onboarding-BB4MeGUs.js → onboarding-D9DuvOKE.js} +1 -1
- package/assets/{rotate-ccw-QA_uOKxx.js → rotate-ccw-DiD4c5lE.js} +1 -1
- package/assets/{search-C10qA-E6.js → search-wRtu_xM7.js} +1 -1
- package/assets/{senders-C099fqMU.js → senders-DtqZAJV5.js} +1 -1
- package/assets/settings-BGTNY-zQ.js +1 -0
- package/assets/{settings-screen-t-f0aAYQ.js → settings-screen-4SMHzLiQ.js} +1 -1
- package/assets/{suggested-vips-BSmTKJ57.js → suggested-vips-BKMEAUye.js} +1 -1
- package/assets/{useDebouncedValue-DlVwfubF.js → useDebouncedValue-CiVEARCW.js} +1 -1
- package/assets/{useLabels-C3v_58dL.js → useLabels-Cl7BOWu8.js} +1 -1
- package/assets/useRulePreview-BFYppl90.js +1 -0
- package/assets/{useSignature-CkShVDs1.js → useSignature-kZ8hmUFh.js} +1 -1
- package/index.html +2 -2
- package/package.json +1 -1
- package/assets/index-ObGYHrA7.js +0 -1
- package/assets/mail-BAulNO3X.js +0 -118
- package/assets/settings-llSZSjha.js +0 -1
- package/assets/useRulePreview-DFJqE3jL.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mail-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mail-CXe7Cs9r.js","assets/search-wRtu_xM7.js","assets/avatar-BhqJp4QS.js","assets/kbd-tzYIpn0Y.js","assets/account-form-helpers-Bh_DtClJ.js","assets/useSignature-kZ8hmUFh.js","assets/useDebouncedValue-CiVEARCW.js","assets/useRulePreview-BFYppl90.js","assets/ErrorState-CWg8ckWQ.js","assets/format-B6Elex-n.js","assets/move-targets-ggm3HCkB.js","assets/move-mailbox-picker-CJH8gfL0.js","assets/rotate-ccw-DiD4c5lE.js","assets/circle-check-D-i-OTL9.js","assets/ConfirmDialog-Dhdaw-CV.js","assets/useLabels-Cl7BOWu8.js","assets/onboarding-D9DuvOKE.js","assets/OnboardingWizard-BkYr7DQu.js","assets/index-BKjXiP3s.js","assets/flagged-BQE8ngVG.js","assets/accounts-B7zI2caP.js","assets/settings-screen-4SMHzLiQ.js","assets/download-DqfleSqM.js","assets/advanced-BG0z84LJ.js","assets/appearance-CMcsFswi.js","assets/filters-CUiHcPSX.js","assets/folders-Cc9RqpfY.js","assets/labels-SrbbdmRw.js","assets/senders-DtqZAJV5.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function S6(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var Ug=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ga(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var H1={exports:{}},wf={};var WN;function Mq(){if(WN)return wf;WN=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,s,o){var a=null;if(o!==void 0&&(a=""+o),s.key!==void 0&&(a=""+s.key),"key"in s){o={};for(var u in s)u!=="key"&&(o[u]=s[u])}else o=s;return s=o.ref,{$$typeof:t,type:r,key:a,ref:s!==void 0?s:null,props:o}}return wf.Fragment=e,wf.jsx=n,wf.jsxs=n,wf}var VN;function Pq(){return VN||(VN=1,H1.exports=Mq()),H1.exports}var I=Pq();const kq="Logging",Dq="x-amz-user-agent",Lq="NoHubcallbackProvidedException";var ss;(function(t){t.DEBUG="DEBUG",t.ERROR="ERROR",t.INFO="INFO",t.WARN="WARN",t.VERBOSE="VERBOSE",t.NONE="NONE"})(ss||(ss={}));const GN={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class or{constructor(e,n=ss.WARN){this.name=e,this.level=n,this._pluggables=[]}_padding(e){return e<10?"0"+e:""+e}_ts(){const e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()}configure(e){return e?(this._config=e,this._config):this._config}_log(e,...n){let r=this.level;or.LOG_LEVEL&&(r=or.LOG_LEVEL),typeof window<"u"&&window.LOG_LEVEL&&(r=window.LOG_LEVEL);const s=GN[r];if(!(GN[e]>=s))return;let a=console.log.bind(console);e===ss.ERROR&&console.error&&(a=console.error.bind(console)),e===ss.WARN&&console.warn&&(a=console.warn.bind(console)),or.BIND_ALL_LOG_LEVELS&&(e===ss.INFO&&console.info&&(a=console.info.bind(console)),e===ss.DEBUG&&console.debug&&(a=console.debug.bind(console)));const u=`[${e}] ${this._ts()} ${this.name}`;let c="";if(n.length===1&&typeof n[0]=="string")c=`${u} - ${n[0]}`,a(c);else if(n.length===1)c=`${u} ${n[0]}`,a(u,n[0]);else if(typeof n[0]=="string"){let f=n.slice(1);f.length===1&&(f=f[0]),c=`${u} - ${n[0]} ${f}`,a(`${u} - ${n[0]}`,f)}else c=`${u} ${n}`,a(u,n);for(const f of this._pluggables){const h={message:c,timestamp:Date.now()};f.pushLogs([h])}}log(...e){this._log(ss.INFO,...e)}info(...e){this._log(ss.INFO,...e)}warn(...e){this._log(ss.WARN,...e)}error(...e){this._log(ss.ERROR,...e)}debug(...e){this._log(ss.DEBUG,...e)}verbose(...e){this._log(ss.VERBOSE,...e)}addPluggable(e){e&&e.getCategoryName()===kq&&(this._pluggables.push(e),e.configure(this._config))}listPluggables(){return this._pluggables}}or.LOG_LEVEL=null;or.BIND_ALL_LOG_LEVELS=!1;class $r extends Error{constructor({message:e,name:n,recoverySuggestion:r,underlyingError:s,metadata:o}){if(super(e),this.name=n,this.underlyingError=s,this.recoverySuggestion=r,o){const{extendedRequestId:a,httpStatusCode:u,requestId:c}=o;this.metadata={extendedRequestId:a,httpStatusCode:u,requestId:c}}this.constructor=$r,Object.setPrototypeOf(this,$r.prototype)}}var Da;(function(t){t.NoEndpointId="NoEndpointId",t.PlatformNotSupported="PlatformNotSupported",t.Unknown="Unknown",t.NetworkError="NetworkError"})(Da||(Da={}));const _y=(t,e=$r)=>(n,r,s)=>{const{message:o,recoverySuggestion:a}=t[r];if(!n)throw new e({name:r,message:s?`${o} ${s}`:o,recoverySuggestion:a})},Ao=typeof Symbol<"u"?Symbol("amplify_default"):"@@amplify_default",xf=new or("Hub");class E6{constructor(e){this.listeners=new Map,this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}_remove(e,n){const r=this.listeners.get(e);if(!r){xf.warn(`No listeners for ${e}`);return}this.listeners.set(e,[...r.filter(({callback:s})=>s!==n)])}dispatch(e,n,r,s){typeof e=="string"&&this.protectedChannels.indexOf(e)>-1&&(s===Ao||xf.warn(`WARNING: ${e} is protected and dispatching on it can have unintended consequences`));const o={channel:e,payload:{...n},source:r,patternInfo:[]};try{this._toListeners(o)}catch(a){xf.error(a)}}listen(e,n,r="noname"){let s;if(typeof n!="function")throw new $r({name:Lq,message:"No callback supplied to Hub"});s=n;let o=this.listeners.get(e);return o||(o=[],this.listeners.set(e,o)),o.push({name:r,callback:s}),()=>{this._remove(e,s)}}_toListeners(e){const{channel:n,payload:r}=e,s=this.listeners.get(n);s&&s.forEach(o=>{xf.debug(`Dispatching to ${n} with `,r);try{o.callback(e)}catch(a){xf.error(a)}})}}const To=new E6("__default__"),Sv=new E6("internal-hub"),jA=()=>{if(typeof window=="object"&&typeof window.crypto=="object")return window.crypto;if(typeof crypto=="object")return crypto;throw new $r({name:"MissingPolyfill",message:"Cannot resolve the `crypto` function from the environment."})},Uq=()=>{if(typeof window<"u"&&typeof window.btoa=="function")return window.btoa;if(typeof btoa=="function")return btoa;throw new $r({name:"Base64EncoderError",message:"Cannot resolve the `btoa` function from the environment."})},Fq=()=>{if(typeof window<"u"&&typeof window.atob=="function")return window.atob;if(typeof atob=="function")return atob;throw new $r({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})},BA={convert(t,e){let n=t;return e?.urlSafe&&(n=n.replace(/-/g,"+").replace(/_/g,"/")),Fq()(n)}};var Co;(function(t){t.AuthTokenConfigException="AuthTokenConfigException",t.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",t.AuthUserPoolException="AuthUserPoolException",t.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",t.OAuthNotConfigureException="OAuthNotConfigureException"})(Co||(Co={}));const zq={[Co.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[Co.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[Co.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[Co.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[Co.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}},$A=_y(zq);function lt(t){let e=!0;t?e=!!t.userPoolId&&!!t.userPoolClientId:e=!1,$A(e,Co.AuthUserPoolException)}function Ay(t){const e=!!t?.loginWith?.oauth?.domain&&!!t?.loginWith?.oauth?.redirectSignOut&&!!t?.loginWith?.oauth?.redirectSignIn&&!!t?.loginWith?.oauth?.responseType;$A(e,Co.OAuthNotConfigureException)}function Wm(t){const e=!!t?.identityPoolId;$A(e,Co.InvalidIdentityPoolIdException)}function vi(t){const e=t.split(".");if(e.length!==3)throw new Error("Invalid token");try{const r=e[1].replace(/-/g,"+").replace(/_/g,"/"),s=decodeURIComponent(BA.convert(r).split("").map(a=>`%${`00${a.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")),o=JSON.parse(s);return{toString:()=>t,payload:o}}catch{throw new Error("Invalid token payload")}}const C6=t=>{const e=Reflect.ownKeys(t);for(const n of e){const r=t[n];(r&&typeof r=="object"||typeof r=="function")&&C6(r)}return Object.freeze(t)},jq=new or("parseAWSExports"),Bq={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},$q=(t={})=>{if(!Object.prototype.hasOwnProperty.call(t,"aws_project_region"))throw new $r({name:"InvalidParameterException",message:"Invalid config parameter.",recoverySuggestion:"Ensure passing the config object imported from `amplifyconfiguration.json`."});const{aws_appsync_apiKey:e,aws_appsync_authenticationType:n,aws_appsync_graphqlEndpoint:r,aws_appsync_region:s,aws_bots_config:o,aws_cognito_identity_pool_id:a,aws_cognito_sign_up_verification_method:u,aws_cognito_mfa_configuration:c,aws_cognito_mfa_types:f,aws_cognito_password_protection_settings:h,aws_cognito_verification_mechanisms:g,aws_cognito_signup_attributes:m,aws_cognito_social_providers:y,aws_cognito_username_attributes:S,aws_mandatory_sign_in:E,aws_mobile_analytics_app_id:C,aws_mobile_analytics_app_region:w,aws_user_files_s3_bucket:T,aws_user_files_s3_bucket_region:x,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:R,aws_user_pools_id:M,aws_user_pools_web_client_id:N,geo:O,oauth:k,predictions:F,aws_cloud_logic_custom:H,Notifications:D,modelIntrospection:z}=t,q={};C&&(q.Analytics={Pinpoint:{appId:C,region:w}});const{InAppMessaging:K,Push:ee}=D??{};if(K?.AWSPinpoint||ee?.AWSPinpoint){if(K?.AWSPinpoint){const{appId:J,region:oe}=K.AWSPinpoint;q.Notifications={InAppMessaging:{Pinpoint:{appId:J,region:oe}}}}if(ee?.AWSPinpoint){const{appId:J,region:oe}=ee.AWSPinpoint;q.Notifications={...q.Notifications,PushNotification:{Pinpoint:{appId:J,region:oe}}}}}if(Array.isArray(o)&&(q.Interactions={LexV1:Object.fromEntries(o.map(J=>[J.name,J]))}),r){const J=Bq[n];J||jq.debug(`Invalid authentication type ${n}. Falling back to IAM.`),q.API={GraphQL:{endpoint:r,apiKey:e,region:s,defaultAuthMode:J??"iam"}},z&&(q.API.GraphQL.modelIntrospection=z)}const $=c?{status:c&&c.toLowerCase(),totpEnabled:f?.includes("TOTP")??!1,smsEnabled:f?.includes("SMS")??!1}:void 0,te=h?{minLength:h.passwordPolicyMinLength,requireLowercase:h.passwordPolicyCharacters?.includes("REQUIRES_LOWERCASE")??!1,requireUppercase:h.passwordPolicyCharacters?.includes("REQUIRES_UPPERCASE")??!1,requireNumbers:h.passwordPolicyCharacters?.includes("REQUIRES_NUMBERS")??!1,requireSpecialCharacters:h.passwordPolicyCharacters?.includes("REQUIRES_SYMBOLS")??!1}:void 0,ae=Array.from(new Set([...g??[],...m??[]])).reduce((J,oe)=>({...J,[oe.toLowerCase()]:{required:!0}}),{}),xe=S?.includes("EMAIL")??!1,L=S?.includes("PHONE_NUMBER")??!1;(a||M)&&(q.Auth={Cognito:{identityPoolId:a,allowGuestAccess:E!=="enable",signUpVerificationMethod:u,userAttributes:ae,userPoolClientId:N,userPoolId:M,mfa:$,passwordFormat:te,loginWith:{username:!(xe||L),email:xe,phone:L}}});const G=k?Object.keys(k).length>0:!1,Y=y?y.length>0:!1;if(q.Auth&&G&&(q.Auth.Cognito.loginWith={...q.Auth.Cognito.loginWith,oauth:{...Hq(k),...Y&&{providers:qq(y)}}}),T&&(q.Storage={S3:{bucket:T,region:x,dangerouslyConnectToHttpEndpointForTesting:R}}),O){const{amazon_location_service:J}=O;q.Geo={LocationService:{maps:J.maps,geofenceCollections:J.geofenceCollections,searchIndices:J.search_indices,region:J.region}}}if(H&&(q.API={...q.API,REST:H.reduce((J,oe)=>{const{name:he,endpoint:ce,region:ve,service:_e}=oe;return{...J,[he]:{endpoint:ce,..._e?{service:_e}:void 0,...ve?{region:ve}:void 0}}},{})}),F){const{VoiceId:J}=F?.convert?.speechGenerator?.defaults??{};q.Predictions=J?{...F,convert:{...F.convert,speechGenerator:{...F.convert.speechGenerator,defaults:{voiceId:J}}}}:F}return q},KN=t=>t?.split(",")??[],Hq=({domain:t,scope:e,redirectSignIn:n,redirectSignOut:r,responseType:s})=>({domain:t,scopes:e,redirectSignIn:KN(n),redirectSignOut:KN(r),responseType:s}),qq=t=>t.map(e=>{const n=e.toLowerCase();return n.charAt(0).toUpperCase()+n.slice(1)}),w6=Symbol("oauth-listener"),tr=[];for(let t=0;t<256;++t)tr.push((t+256).toString(16).slice(1));function Wq(t,e=0){return(tr[t[e+0]]+tr[t[e+1]]+tr[t[e+2]]+tr[t[e+3]]+"-"+tr[t[e+4]]+tr[t[e+5]]+"-"+tr[t[e+6]]+tr[t[e+7]]+"-"+tr[t[e+8]]+tr[t[e+9]]+"-"+tr[t[e+10]]+tr[t[e+11]]+tr[t[e+12]]+tr[t[e+13]]+tr[t[e+14]]+tr[t[e+15]]).toLowerCase()}let q1;const Vq=new Uint8Array(16);function Gq(){if(!q1){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");q1=crypto.getRandomValues.bind(crypto)}return q1(Vq)}const Kq=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),YN={randomUUID:Kq};function Yq(t,e,n){if(YN.randomUUID&&!e&&!t)return YN.randomUUID();t=t||{};const r=t.random??t.rng?.()??Gq();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(n=n||0,n<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let s=0;s<16;++s)e[n+s]=r[s];return e}return Wq(r)}function Zq(t){const{version:e}=t;return e?e.startsWith("1"):!1}function Xq(t){if(!t)return;const{bucket_name:e,aws_region:n,buckets:r}=t;return{S3:{bucket:e,region:n,buckets:r&&lW(r)}}}function Qq(t){if(!t)return;const{user_pool_id:e,user_pool_client_id:n,identity_pool_id:r,password_policy:s,mfa_configuration:o,mfa_methods:a,unauthenticated_identities_enabled:u,oauth:c,username_attributes:f,standard_required_attributes:h,groups:g,passwordless:m}=t,y={Cognito:{userPoolId:e,userPoolClientId:n,groups:g}};return r&&(y.Cognito={...y.Cognito,identityPoolId:r}),s&&(y.Cognito.passwordFormat={requireLowercase:s.require_lowercase,requireNumbers:s.require_numbers,requireUppercase:s.require_uppercase,requireSpecialCharacters:s.require_symbols,minLength:s.min_length??6}),o&&(y.Cognito.mfa={status:aW(o),smsEnabled:a?.includes("SMS"),totpEnabled:a?.includes("TOTP")}),u&&(y.Cognito.allowGuestAccess=u),c&&(y.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:iW(c.identity_providers)}}),f&&(y.Cognito.loginWith={...y.Cognito.loginWith,email:f.includes("email"),phone:f.includes("phone_number"),username:f.includes("username")}),h&&(y.Cognito.userAttributes=h.reduce((S,E)=>({...S,[E]:{required:!0}}),{})),m&&(y.Cognito.passwordless={emailOtpEnabled:m.email_otp_enabled,smsOtpEnabled:m.sms_otp_enabled,webAuthn:m.web_authn?{relyingPartyId:m.web_authn.relying_party_id,userVerification:m.web_authn.user_verification}:void 0,preferredChallenge:m.preferred_challenge}),y}function Jq(t){if(!t?.amazon_pinpoint)return;const{amazon_pinpoint:e}=t;return{Pinpoint:{appId:e.app_id,region:e.aws_region}}}function eW(t){if(!t)return;const{aws_region:e,geofence_collections:n,maps:r,search_indices:s}=t;return{LocationService:{region:e,searchIndices:s,geofenceCollections:n,maps:r}}}function tW(t){if(!t)return;const{aws_region:e,default_authorization_type:n,url:r,api_key:s,model_introspection:o}=t;return{GraphQL:{endpoint:r,defaultAuthMode:x6(n),region:e,apiKey:s,modelIntrospection:o}}}function nW(t){if(!t?.events)return;const{url:e,aws_region:n,api_key:r,default_authorization_type:s}=t.events;return{Events:{endpoint:e,defaultAuthMode:x6(s),region:n,apiKey:r}}}function rW(t){if(!t)return;const{aws_region:e,channels:n,amazon_pinpoint_app_id:r}=t,s=n.includes("IN_APP_MESSAGING"),o=n.includes("APNS")||n.includes("FCM");if(!(s||o))return;const a={};return s&&(a.InAppMessaging={Pinpoint:{appId:r,region:e}}),o&&(a.PushNotification={Pinpoint:{appId:r,region:e}}),a}function sW(t){const e={};if(t.storage&&(e.Storage=Xq(t.storage)),t.auth&&(e.Auth=Qq(t.auth)),t.analytics&&(e.Analytics=Jq(t.analytics)),t.geo&&(e.Geo=eW(t.geo)),t.data&&(e.API=tW(t.data)),t.custom){const n=nW(t.custom);n&&"Events"in n&&(e.API={...e.API,...n})}return t.notifications&&(e.Notifications=rW(t.notifications)),e}const oW={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"};function x6(t){return oW[t]}const ZN={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"};function iW(t=[]){return t.reduce((e,n)=>(ZN[n]!==void 0&&e.push(ZN[n]),e),[])}function aW(t){return t==="OPTIONAL"?"optional":t==="REQUIRED"?"on":"off"}function lW(t){const e={};return t.forEach(({name:n,bucket_name:r,aws_region:s,paths:o})=>{if(n in e)throw new Error(`Duplicate friendly name found: ${n}. Name must be unique.`);const a=o?Object.entries(o).reduce((u,[c,f])=>(f!==void 0&&(u[c]=f),u),{}):void 0;e[n]={bucketName:r,region:s,paths:a}}),e}const _6=t=>Object.keys(t).some(e=>e.startsWith("aws_"))?$q(t):Zq(t)?sW(t):t;var XN=function(){return XN=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},XN.apply(this,arguments)};function yRe(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function uW(t,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(h){try{f(r.next(h))}catch(g){a(g)}}function c(h){try{f(r.throw(h))}catch(g){a(g)}}function f(h){h.done?o(h.value):s(h.value).then(u,c)}f((r=r.apply(t,e||[])).next())})}function cW(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,s,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(f){return function(h){return c([f,h])}}function c(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(n=0)),n;)try{if(r=1,s&&(o=f[0]&2?s.return:f[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,f[1])).done)return o;switch(s=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,s=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){n.label=f[1];break}if(f[0]===6&&n.label<o[1]){n.label=o[1],o=f;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(f);break}o[2]&&n.ops.pop(),n.trys.pop();continue}f=e.call(t,n)}catch(h){f=[6,h],s=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function bRe(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,o;r<s;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var As=64,dW=32,fW=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]),hW=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],pW=Math.pow(2,53)-1,Vm=(function(){function t(){this.state=Int32Array.from(hW),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return t.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var n=0,r=e.byteLength;if(this.bytesHashed+=r,this.bytesHashed*8>pW)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;r>0;)this.buffer[this.bufferLength++]=e[n++],r--,this.bufferLength===As&&(this.hashBuffer(),this.bufferLength=0)},t.prototype.digest=function(){if(!this.finished){var e=this.bytesHashed*8,n=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),r=this.bufferLength;if(n.setUint8(this.bufferLength++,128),r%As>=As-8){for(var s=this.bufferLength;s<As;s++)n.setUint8(s,0);this.hashBuffer(),this.bufferLength=0}for(var s=this.bufferLength;s<As-8;s++)n.setUint8(s,0);n.setUint32(As-8,Math.floor(e/4294967296),!0),n.setUint32(As-4,e),this.hashBuffer(),this.finished=!0}for(var o=new Uint8Array(dW),s=0;s<8;s++)o[s*4]=this.state[s]>>>24&255,o[s*4+1]=this.state[s]>>>16&255,o[s*4+2]=this.state[s]>>>8&255,o[s*4+3]=this.state[s]>>>0&255;return o},t.prototype.hashBuffer=function(){for(var e=this,n=e.buffer,r=e.state,s=r[0],o=r[1],a=r[2],u=r[3],c=r[4],f=r[5],h=r[6],g=r[7],m=0;m<As;m++){if(m<16)this.temp[m]=(n[m*4]&255)<<24|(n[m*4+1]&255)<<16|(n[m*4+2]&255)<<8|n[m*4+3]&255;else{var y=this.temp[m-2],S=(y>>>17|y<<15)^(y>>>19|y<<13)^y>>>10;y=this.temp[m-15];var E=(y>>>7|y<<25)^(y>>>18|y<<14)^y>>>3;this.temp[m]=(S+this.temp[m-7]|0)+(E+this.temp[m-16]|0)}var C=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&f^~c&h)|0)+(g+(fW[m]+this.temp[m]|0)|0)|0,w=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&o^s&a^o&a)|0;g=h,h=f,f=c,c=u+C|0,u=a,a=o,o=s,s=C+w|0}r[0]+=s,r[1]+=o,r[2]+=a,r[3]+=u,r[4]+=c,r[5]+=f,r[6]+=h,r[7]+=g},t})();const gW=t=>new TextEncoder().encode(t);var mW=typeof Buffer<"u"&&Buffer.from?function(t){return Buffer.from(t,"utf8")}:gW;function A6(t){return t instanceof Uint8Array?t:typeof t=="string"?mW(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}function vW(t){return typeof t=="string"?t.length===0:t.byteLength===0}var $l=(function(){function t(e){this.secret=e,this.hash=new Vm,this.reset()}return t.prototype.update=function(e){if(!(vW(e)||this.error))try{this.hash.update(A6(e))}catch(n){this.error=n}},t.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()},t.prototype.digest=function(){return uW(this,void 0,void 0,function(){return cW(this,function(e){return[2,this.digestSync()]})})},t.prototype.reset=function(){if(this.hash=new Vm,this.secret){this.outer=new Vm;var e=yW(this.secret),n=new Uint8Array(As);n.set(e);for(var r=0;r<As;r++)e[r]^=54,n[r]^=92;this.hash.update(e),this.outer.update(n);for(var r=0;r<e.byteLength;r++)e[r]=0}},t})();function yW(t){var e=A6(t);if(e.byteLength>As){var n=new Vm;n.update(e),e=n.digest()}var r=new Uint8Array(As);return r.set(e),r}for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`)}var _n;(function(t){t.WebUnknown="0",t.React="1",t.NextJs="2",t.Angular="3",t.VueJs="4",t.Nuxt="5",t.Svelte="6",t.ServerSideUnknown="100",t.ReactSSR="101",t.NextJsSSR="102",t.AngularSSR="103",t.VueJsSSR="104",t.NuxtSSR="105",t.SvelteSSR="106",t.ReactNative="201",t.Expo="202"})(_n||(_n={}));var Os;(function(t){t.AI="ai",t.API="api",t.Auth="auth",t.Analytics="analytics",t.DataStore="datastore",t.Geo="geo",t.InAppMessaging="inappmessaging",t.Interactions="interactions",t.Predictions="predictions",t.PubSub="pubsub",t.PushNotification="pushnotification",t.Storage="storage"})(Os||(Os={}));var ai;(function(t){t.CreateConversation="1",t.GetConversation="2",t.ListConversations="3",t.DeleteConversation="4",t.SendMessage="5",t.ListMessages="6",t.OnMessage="7",t.Generation="8",t.UpdateConversation="9"})(ai||(ai={}));var QN;(function(t){t.Record="1",t.IdentifyUser="2"})(QN||(QN={}));var JN;(function(t){t.GraphQl="1",t.Get="2",t.Post="3",t.Put="4",t.Patch="5",t.Del="6",t.Head="7"})(JN||(JN={}));var Ke;(function(t){t.SignUp="1",t.ConfirmSignUp="2",t.ResendSignUpCode="3",t.SignIn="4",t.FetchMFAPreference="6",t.UpdateMFAPreference="7",t.SetUpTOTP="10",t.VerifyTOTPSetup="11",t.ConfirmSignIn="12",t.DeleteUserAttributes="15",t.DeleteUser="16",t.UpdateUserAttributes="17",t.FetchUserAttributes="18",t.ConfirmUserAttribute="22",t.SignOut="26",t.UpdatePassword="27",t.ResetPassword="28",t.ConfirmResetPassword="29",t.FederatedSignIn="30",t.RememberDevice="32",t.ForgetDevice="33",t.FetchDevices="34",t.SendUserAttributeVerificationCode="35",t.SignInWithRedirect="36",t.StartWebAuthnRegistration="37",t.CompleteWebAuthnRegistration="38",t.ListWebAuthnCredentials="39",t.DeleteWebAuthnCredential="40"})(Ke||(Ke={}));var eM;(function(t){t.Subscribe="1",t.GraphQl="2"})(eM||(eM={}));var uh;(function(t){t.SearchByText="0",t.SearchByCoordinates="1",t.SearchForSuggestions="2",t.SearchByPlaceId="3",t.SaveGeofences="4",t.GetGeofence="5",t.ListGeofences="6",t.DeleteGeofences="7"})(uh||(uh={}));var Lx;(function(t){t.SyncMessages="1",t.IdentifyUser="2",t.NotifyMessageInteraction="3"})(Lx||(Lx={}));var tM;(function(t){t.None="0"})(tM||(tM={}));var nM;(function(t){t.Convert="1",t.Identify="2",t.Interpret="3"})(nM||(nM={}));var rM;(function(t){t.Subscribe="1"})(rM||(rM={}));var sM;(function(t){t.InitializePushNotifications="1",t.IdentifyUser="2"})(sM||(sM={}));var Ws;(function(t){t.UploadData="1",t.DownloadData="2",t.List="3",t.Copy="4",t.Remove="5",t.GetProperties="6",t.GetUrl="7",t.GetDataAccess="8",t.ListCallerAccessGrants="9"})(Ws||(Ws={}));const bW="6.18.0",Ty=()=>typeof global<"u",ad=()=>typeof window<"u",T6=()=>typeof document<"u",HA=()=>typeof process<"u",wh=(t,e)=>!!Object.keys(t).find(n=>n.startsWith(e));var oM={};function SW(){const t=r=>r.startsWith("_react")||r.startsWith("__react"),e=r=>Object.keys(r).find(t),n=()=>Array.from(document.querySelectorAll("[id]"));return T6()&&n().some(e)}function EW(){return HA()&&typeof oM<"u"&&!!Object.keys(oM).find(t=>t.includes("react"))}function CW(){return ad()&&wh(window,"__VUE")}function wW(){return Ty()&&wh(global,"__VUE")}var iM={};function xW(){return ad()&&wh(window,"__SVELTE")}function _W(){return HA()&&typeof iM<"u"&&!!Object.keys(iM).find(t=>t.includes("svelte"))}function AW(){return ad()&&window.next&&typeof window.next=="object"}function TW(){return Ty()&&(wh(global,"__next")||wh(global,"__NEXT"))}function RW(){return ad()&&(window.__NUXT__!==void 0||window.$nuxt!==void 0)}function IW(){return Ty()&&typeof global.__NUXT_PATHS__<"u"}var aM={};function OW(){const t=!!(T6()&&document.querySelector("[ng-version]")),e=!!(ad()&&typeof window.ng<"u");return t||e}function NW(){return HA()&&typeof aM=="object"&&aM.npm_lifecycle_script?.startsWith("ng ")||!1}function MW(){return typeof navigator<"u"&&typeof navigator.product<"u"&&navigator.product==="ReactNative"}function PW(){return Ty()&&typeof global.expo<"u"}function kW(){return ad()}const DW=[{platform:_n.Expo,detectionMethod:PW},{platform:_n.ReactNative,detectionMethod:MW},{platform:_n.NextJs,detectionMethod:AW},{platform:_n.Nuxt,detectionMethod:RW},{platform:_n.Angular,detectionMethod:OW},{platform:_n.React,detectionMethod:SW},{platform:_n.VueJs,detectionMethod:CW},{platform:_n.Svelte,detectionMethod:xW},{platform:_n.WebUnknown,detectionMethod:kW},{platform:_n.NextJsSSR,detectionMethod:TW},{platform:_n.NuxtSSR,detectionMethod:IW},{platform:_n.ReactSSR,detectionMethod:EW},{platform:_n.VueJsSSR,detectionMethod:wW},{platform:_n.AngularSSR,detectionMethod:NW},{platform:_n.SvelteSSR,detectionMethod:_W}];function LW(){return DW.find(t=>t.detectionMethod())?.platform||_n.ServerSideUnknown}let ch;const W1=[];let Ux=!1;const UW=10,FW=10,zW=1e3,R6=()=>{if(!ch){if(ch=LW(),Ux)for(;W1.length;)W1.pop()?.();else W1.forEach(t=>{t()});lM(_n.ServerSideUnknown,UW),lM(_n.WebUnknown,FW)}return ch};function jW(){ch=void 0}function lM(t,e){ch===t&&!Ux&&setTimeout(()=>{jW(),Ux=!0,setTimeout(R6,zW)},e)}const ga={},ti=t=>{ga[t.category]=t.apis.reduce((r,s)=>({...r,[s]:{refCount:r[s]?.refCount?r[s].refCount+1:1,additionalDetails:t.additionalDetails}}),ga[t.category]??{});let e=!1;return()=>{e||(e=!0,t.apis.forEach(r=>{const s=ga[t.category][r].refCount;s>1?ga[t.category][r].refCount=s-1:(delete ga[t.category][r],Object.keys(ga[t.category]).length||delete ga[t.category])}))}},BW=(t,e)=>ga[t]?.[e]?.additionalDetails,$W="aws-amplify",HW=t=>t.replace(/\+.*/,""),qW=({category:t,action:e}={})=>{const n=[[$W,HW(bW)]];if(t&&n.push([t,e]),n.push(["framework",R6()]),t&&e){const r=BW(t,e);r&&r.forEach(s=>{n.push(s)})}return n},Ry=t=>qW(t).map(([r,s])=>r&&s?`${r}/${s}`:r).join(" "),Iy=()=>typeof window<"u"&&typeof window.document<"u",uM=new or("Auth");class WW{configure(e,n){this.authConfig=e,this.authOptions=n,e&&e.Cognito?.userPoolEndpoint&&uM.warn(cM("Amazon Cognito User Pool")),e&&e.Cognito?.identityPoolEndpoint&&uM.warn(cM("Amazon Cognito Identity Pool"))}async fetchAuthSession(e={}){let n,r;const s=await this.getTokens(e);return s?(r=s.accessToken?.payload?.sub,n=await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,tokens:s,authenticated:!0,forceRefresh:e.forceRefresh})):n=await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,authenticated:!1,forceRefresh:e.forceRefresh}),{tokens:s,credentials:n?.credentials,identityId:n?.identityId,userSub:r}}async clearCredentials(){await this.authOptions?.credentialsProvider?.clearCredentialsAndIdentityId()}async getTokens(e){return await this.authOptions?.tokenProvider?.getTokens(e)??void 0}}const cM=t=>`You are using a custom Amazon ${t} endpoint, ensure the endpoint is correct.`;class VW{constructor(){this.oAuthListener=void 0,this.isConfigured=!1,this.resourcesConfig={},this.libraryOptions={},this.Auth=new WW}configure(e,n){const r=_6(e);this.resourcesConfig=r,n&&(this.libraryOptions=n),this.resourcesConfig=C6(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 SMS, 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."),To.dispatch("core",{event:"configure",data:this.resourcesConfig},"Configure",Ao),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}[w6](e){this.resourcesConfig.Auth?.Cognito.loginWith?.oauth?e(this.resourcesConfig.Auth?.Cognito):this.oAuthListener=e}notifyOAuthListener(){!this.resourcesConfig.Auth?.Cognito.loginWith?.oauth||!this.oAuthListener||(this.oAuthListener(this.resourcesConfig.Auth?.Cognito),this.oAuthListener=void 0)}}const Ht=new VW,I6=(t,e)=>t.Auth.fetchAuthSession(e),Oy=t=>I6(Ht,t);function O6(){return Ht.Auth.clearCredentials()}const Ny=t=>{const{headers:e,statusCode:n}=t;return{...GW(t)?t.$metadata:{},httpStatusCode:n,requestId:e["x-amzn-requestid"]??e["x-amzn-request-id"]??e["x-amz-request-id"],extendedRequestId:e["x-amz-id-2"],cfId:e["x-amz-cf-id"]}},GW=t=>typeof t?.$metadata=="object",ld=async t=>{if(!t||t.statusCode<300)return;const e=await ep(t),r=(a=>{const[u]=a.toString().split(/[,:]+/);return u.includes("#")?u.split("#")[1]:u})(t.headers["x-amzn-errortype"]??e.code??e.__type??"UnknownError"),s=e.message??e.Message??"Unknown error",o=new Error(s);return Object.assign(o,{name:r,$metadata:Ny(t)})},ep=async t=>{if(!t.body)throw new Error("Missing response payload");const e=await t.body.json();return Object.assign(e,{$metadata:Ny(t)})},In=(t,e,n,r)=>async(s,o)=>{const a={...r,...s},u=await a.endpointResolver(a,o),c=await e(o,u),f=await t(c,{...a});return n(f)},KW=300*1e3;function YW(t=KW){return r=>{const s=2**r*100+100*Math.random();return s>t?!1:s}}const N6=3,dM="amz-sdk-invocation-id",ZW="amz-sdk-request",fM=300*1e3,M6=t=>{const n=YW(fM)(t);return n===!1?fM:n},XW=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],QW=t=>!!t&&XW.includes(t),P6=t=>async(e,n)=>{const r=n??await t(e)??void 0,s=r?.code||r?.name,o=e?.statusCode;return{retryable:nV(n)||tV(o,s)||QW(s)||rV(o,s)}},JW=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],eV=["TimeoutError","RequestTimeout","RequestTimeoutException"],tV=(t,e)=>t===429||!!e&&JW.includes(e),nV=t=>[Da.NetworkError,"ERR_NETWORK"].includes(t?.name),rV=(t,e)=>!!t&&[500,502,503,504].includes(t)||!!e&&eV.includes(e),k6="cognito-identity",D6={service:k6,retryDecider:P6(ld),computeDelay:M6,cache:"no-store"},sV=({maxAttempts:t=N6,retryDecider:e,computeDelay:n,abortSignal:r})=>{if(t<1)throw new Error("maxAttempts must be greater than 0");return(s,o)=>async function(u){let c,f=o.attemptsCount??0,h;const g=()=>{if(h)return hM(h,f),h;throw hM(c,f),c};for(;!r?.aborted&&f<t;){try{h=await s(u),c=void 0}catch(S){c=S,h=void 0}f=(o.attemptsCount??0)>f?o.attemptsCount??0:f+1,o.attemptsCount=f;const{isCredentialsExpiredError:m,retryable:y}=await e(h,c,o);if(y){if(o.isCredentialsExpired=!!m,!r?.aborted&&f<t){const S=n(f);await oV(S,r)}continue}else return g()}if(r?.aborted)throw new Error("Request aborted.");return g()}},oV=(t,e)=>{if(e?.aborted)return Promise.resolve();let n,r;const s=new Promise(o=>{r=o,n=setTimeout(o,t)});return e?.addEventListener("abort",function o(a){clearTimeout(n),e?.removeEventListener("abort",o),r()}),s},hM=(t,e)=>{Object.prototype.toString.call(t)==="[object Object]"&&(t.$metadata={...t.$metadata??{},attempts:e})},iV=Yq,aV=()=>t=>async function(n){return n.headers[dM]||(n.headers[dM]=iV()),t(n)},lV=({maxAttempts:t=N6})=>(e,n)=>async function(s){const o=n.attemptsCount??0;return s.headers[ZW]=`attempt=${o+1}; max=${t}`,e(s)},uV=({userAgentHeader:t="x-amz-user-agent",userAgentValue:e=""})=>n=>async function(s){if(e.trim().length===0)return await n(s);{const o=t.toLowerCase();return s.headers[o]=s.headers[o]?`${s.headers[o]} ${e}`:e,await n(s)}},qA=(t,e)=>(n,r)=>{const s={};let o=a=>t(a,r);for(let a=e.length-1;a>=0;a--){const u=e[a];o=u(r)(o,s)}return o(n)},V1=t=>{let e;return()=>(e||(e=t()),e)},cV=t=>!["HEAD","GET"].includes(t.toUpperCase()),dV=async({url:t,method:e,headers:n,body:r},{abortSignal:s,cache:o,withCrossDomainCredentials:a})=>{let u;try{u=await fetch(t,{method:e,headers:n,body:cV(e)?r:void 0,signal:s,cache:o,credentials:a?"include":"same-origin"})}catch(g){throw g instanceof TypeError?new $r({name:Da.NetworkError,message:"A network error has occurred.",underlyingError:g}):g}const c={};u.headers?.forEach((g,m)=>{c[m.toLowerCase()]=g});const f={statusCode:u.status,headers:c,body:null},h=Object.assign(u.body??{},{text:V1(()=>u.text()),blob:V1(()=>u.blob()),json:V1(()=>u.json())});return{...f,body:h}},L6=qA(dV,[uV,aV,sV,lV]),fV=()=>t=>async function(n){return n.headers["cache-control"]="no-store",t(n)},U6=qA(L6,[fV]),F6=t=>(e,n)=>{const r=hV(t),s=JSON.stringify(e);return pV(n,r,s)},hV=t=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${t}`}),pV=({url:t},e,n)=>({headers:e,url:t,body:n,method:"POST"}),pM=t=>In(U6,F6("GetCredentialsForIdentity"),gV,{...D6,...t,userAgentValue:Ry()}),gV=async t=>{if(t.statusCode>=300)throw await ld(t);const e=await ep(t);return{IdentityId:e.IdentityId,Credentials:mV(e.Credentials),$metadata:Ny(t)}},mV=({Expiration:t,...e}={})=>({...e,Expiration:t&&new Date(t*1e3)}),vV=t=>In(U6,F6("GetId"),yV,{...D6,...t,userAgentValue:Ry()}),yV=async t=>{if(t.statusCode>=300)throw await ld(t);return{IdentityId:(await ep(t)).IdentityId,$metadata:Ny(t)}},z6={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},bV={partitions:[z6,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},j6=t=>{const{partitions:e}=bV;for(const{regions:n,outputs:r,regionRegex:s}of e){const o=new RegExp(s);if(n.includes(t)||o.test(t))return r.dnsSuffix}return z6.outputs.dnsSuffix},Ka=URL,SV=({region:t})=>({url:new Ka(`https://${k6}.${t}.${j6(t)}`)});class Kf extends $r{constructor(){super({name:Da.PlatformNotSupported,message:"Function not supported on current platform"})}}class B6{constructor(e){this.storage=e}async setItem(e,n){if(!this.storage)throw new Kf;this.storage.setItem(e,n)}async getItem(e){if(!this.storage)throw new Kf;return this.storage.getItem(e)}async removeItem(e){if(!this.storage)throw new Kf;this.storage.removeItem(e)}async clear(){if(!this.storage)throw new Kf;this.storage.clear()}}class $6{constructor(){this.storage=new Map}get length(){return this.storage.size}key(e){return e>this.length-1?null:Array.from(this.storage.keys())[e]}setItem(e,n){this.storage.set(e,n)}getItem(e){return this.storage.get(e)??null}removeItem(e){this.storage.delete(e)}clear(){this.storage.clear()}}const H6=new or("CoreStorageUtils"),EV=()=>{try{if(typeof window<"u"&&window.localStorage)return window.localStorage}catch{H6.info("localStorage not found. InMemoryStorage is used as a fallback.")}return new $6},q6=()=>{try{if(typeof window<"u"&&window.sessionStorage)return window.sessionStorage.getItem("test"),window.sessionStorage;throw new Error("sessionStorage is not defined")}catch{return H6.info("sessionStorage not found. InMemoryStorage is used as a fallback."),new $6}};class CV extends B6{constructor(){super(EV())}}class wV extends B6{constructor(){super(q6())}}class xV{constructor(e){this._storage=e}get storage(){if(!this._storage)throw new Kf;return this._storage}setItem(e,n){this.storage.setItem(e,n)}getItem(e){return this.storage.getItem(e)}removeItem(e){this.storage.removeItem(e)}clear(){this.storage.clear()}}class _V extends xV{constructor(){super(q6())}}function Fg(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)r!=="__proto__"&&(t[r]=n[r])}return t}var AV={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Fx(t,e){function n(s,o,a){if(!(typeof document>"u")){a=Fg({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),s=encodeURIComponent(s).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var u="";for(var c in a)a[c]&&(u+="; "+c,a[c]!==!0&&(u+="="+a[c].split(";")[0]));return document.cookie=s+"="+t.write(o,s)+u}}function r(s){if(!(typeof document>"u"||arguments.length&&!s)){for(var o=document.cookie?document.cookie.split("; "):[],a={},u=0;u<o.length;u++){var c=o[u].split("="),f=c.slice(1).join("=");try{var h=decodeURIComponent(c[0]);if(h in a||(a[h]=t.read(f,h)),s===h)break}catch{}}return s?a[s]:a}}return Object.create({set:n,get:r,remove:function(s,o){n(s,"",Fg({},o,{expires:-1}))},withAttributes:function(s){return Fx(this.converter,Fg({},this.attributes,s))},withConverter:function(s){return Fx(Fg({},this.converter,s),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var zg=Fx(AV,{path:"/"});class TV{constructor(e={}){const{path:n,domain:r,expires:s,sameSite:o,secure:a}=e;if(this.domain=r,this.path=n||"/",this.expires=Object.prototype.hasOwnProperty.call(e,"expires")?s:365,this.secure=Object.prototype.hasOwnProperty.call(e,"secure")?a:!0,Object.prototype.hasOwnProperty.call(e,"sameSite")){if(!o||!["strict","lax","none"].includes(o))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if(o==="none"&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=o}}async setItem(e,n){zg.set(e,n,this.getData())}async getItem(e){return zg.get(e)??null}async removeItem(e){zg.remove(e,this.getData())}async clear(){const e=zg.get(),n=Object.keys(e).map(r=>this.removeItem(r));await Promise.all(n)}getData(){return{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure,...this.sameSite&&{sameSite:this.sameSite}}}}const tp=new CV;new wV;const fi=new _V,RV=new or("I18n");let IV=class{constructor(){this._options=null,this._lang=null,this._dict={}}setDefaultLanguage(){!this._lang&&typeof window<"u"&&window&&window.navigator&&(this._lang=window.navigator.language),RV.debug(this._lang)}setLanguage(e){this._lang=e}get(e,n=void 0){if(this.setDefaultLanguage(),!this._lang)return typeof n<"u"?n:e;const r=this._lang;let s=this.getByLanguage(e,r);return s||(r.indexOf("-")>0&&(s=this.getByLanguage(e,r.split("-")[0])),s)?s:typeof n<"u"?n:e}getByLanguage(e,n,r=null){if(!n)return r;const s=this._dict[n];return s?s[e]:r}putVocabulariesForLanguage(e,n){let r=this._dict[e];r||(r=this._dict[e]={}),this._dict[e]={...r,...n}}putVocabularies(e){Object.keys(e).forEach(n=>{this.putVocabulariesForLanguage(n,e[n])})}};var _l;(function(t){t.NotConfigured="NotConfigured"})(_l||(_l={}));const OV={[_l.NotConfigured]:{message:"i18n is not configured."}},jg=_y(OV),gM=new or("I18n");let Bg={language:null},Bs=null,W6=class Cl{static configure(e){return gM.debug("configure I18n"),e&&(Bg=Object.assign({},Bg,e.I18n||e),Cl.createInstance()),Bg}static getModuleName(){return"I18n"}static createInstance(){gM.debug("create I18n instance"),!Bs&&(Bs=new IV)}static setLanguage(e){Cl.checkConfig(),jg(!!Bs,_l.NotConfigured),Bs.setLanguage(e)}static get(e,n){return Cl.checkConfig(),jg(!!Bs,_l.NotConfigured),Bs.get(e,n)}static putVocabulariesForLanguage(e,n){Cl.checkConfig(),jg(!!Bs,_l.NotConfigured),Bs.putVocabulariesForLanguage(e,n)}static putVocabularies(e){Cl.checkConfig(),jg(!!Bs,_l.NotConfigured),Bs.putVocabularies(e)}static checkConfig(){return Bs||Cl.createInstance(),!0}};W6.createInstance();const NV=t=>{const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=[],r=new Uint8Array(t);jA().getRandomValues(r);for(const s of r)n.push(e[s%e.length]);return n.join("")};function MV(t){return(t.match(/.{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("")}function PV(t){return t.split("").map(e=>e.charCodeAt(0).toString(16).padStart(2,"0")).join("")}const kV=t=>{let e;return async(...n)=>e||(e=new Promise((r,s)=>{t(...n).then(o=>{r(o)}).catch(o=>{s(o)}).finally(()=>{e=void 0})}),e)};function mM({expiresAt:t,clockDrift:e,tolerance:n=5e3}){return Date.now()+e+n>t}const DV=async()=>{const{userAgentData:t}=navigator;if(!t)return navigator.userAgent;const{platform:e="",platformVersion:n="",model:r="",architecture:s="",fullVersionList:o=[]}=await t.getHighEntropyValues(["platform","platformVersion","architecture","model","fullVersionList"]),a=o.map(c=>`${c.brand}/${c.version}`).join(";");return[e,n,s,r,e,a].filter(c=>c).join(" ")||navigator.userAgent};function LV(t){return Array.from(t,e=>String.fromCodePoint(e)).join("")}const Bc={convert(t,e={urlSafe:!1,skipPadding:!1}){const n=typeof t=="string"?t:LV(t);let r=Uq()(n);return e.urlSafe&&(r=r.replace(/\+/g,"-").replace(/\//g,"_")),e.skipPadding&&(r=r.replace(/=/g,"")),r}};function UV(){return jA().getRandomValues(new Uint32Array(1))[0]}function FV(t){const{words:e}=t,{sigBytes:n}=t,r=[];for(let s=0;s<n;s++){const o=e[s>>>2]>>>24-s%4*8&255;r.push((o>>>4).toString(16)),r.push((o&15).toString(16))}return r.join("")}class WA{constructor(e,n){this.words=[];let r=e;r=this.words=r||[],n!==void 0?this.sigBytes=n:this.sigBytes=r.length*4}random(e){const n=[];for(let r=0;r<e;r+=4)n.push(UV());return new WA(n,e)}toString(){return FV(this)}}var Ge;(function(t){t.EmptySignInUsername="EmptySignInUsername",t.EmptySignInPassword="EmptySignInPassword",t.CustomAuthSignInPassword="CustomAuthSignInPassword",t.EmptySignUpUsername="EmptySignUpUsername",t.EmptySignUpPassword="EmptySignUpPassword",t.EmptyConfirmSignUpUsername="EmptyConfirmSignUpUsername",t.EmptyConfirmSignUpCode="EmptyConfirmSignUpCode",t.EmptyResendSignUpCodeUsername="EmptyresendSignUpCodeUsername",t.EmptyChallengeResponse="EmptyChallengeResponse",t.EmptyConfirmResetPasswordUsername="EmptyConfirmResetPasswordUsername",t.EmptyConfirmResetPasswordNewPassword="EmptyConfirmResetPasswordNewPassword",t.EmptyConfirmResetPasswordConfirmationCode="EmptyConfirmResetPasswordConfirmationCode",t.EmptyResetPasswordUsername="EmptyResetPasswordUsername",t.EmptyVerifyTOTPSetupCode="EmptyVerifyTOTPSetupCode",t.EmptyConfirmUserAttributeCode="EmptyConfirmUserAttributeCode",t.IncorrectMFAMethod="IncorrectMFAMethod",t.EmptyUpdatePassword="EmptyUpdatePassword",t.InvalidPreferredChallenge="InvalidPreferredChallenge"})(Ge||(Ge={}));const V6={[Ge.EmptyChallengeResponse]:{message:"challengeResponse is required to confirmSignIn"},[Ge.EmptyConfirmResetPasswordUsername]:{message:"username is required to confirmResetPassword"},[Ge.EmptyConfirmSignUpCode]:{message:"code is required to confirmSignUp"},[Ge.EmptyConfirmSignUpUsername]:{message:"username is required to confirmSignUp"},[Ge.EmptyConfirmResetPasswordConfirmationCode]:{message:"confirmationCode is required to confirmResetPassword"},[Ge.EmptyConfirmResetPasswordNewPassword]:{message:"newPassword is required to confirmResetPassword"},[Ge.EmptyResendSignUpCodeUsername]:{message:"username is required to confirmSignUp"},[Ge.EmptyResetPasswordUsername]:{message:"username is required to resetPassword"},[Ge.EmptySignInPassword]:{message:"password is required to signIn"},[Ge.EmptySignInUsername]:{message:"username is required to signIn"},[Ge.EmptySignUpPassword]:{message:"password is required to signUp"},[Ge.EmptySignUpUsername]:{message:"username is required to signUp"},[Ge.CustomAuthSignInPassword]:{message:"A password is not needed when signing in with CUSTOM_WITHOUT_SRP",recoverySuggestion:"Do not include a password in your signIn call."},[Ge.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"},[Ge.EmptyVerifyTOTPSetupCode]:{message:"code is required to verifyTotpSetup"},[Ge.EmptyUpdatePassword]:{message:"oldPassword and newPassword are required to changePassword"},[Ge.EmptyConfirmUserAttributeCode]:{message:"confirmation code is required to confirmUserAttribute"},[Ge.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 $n;(function(t){t.DEFAULT_MSG="Authentication Error",t.EMPTY_EMAIL="Email cannot be empty",t.EMPTY_PHONE="Phone number cannot be empty",t.EMPTY_USERNAME="Username cannot be empty",t.INVALID_USERNAME="The username should either be a string or one of the sign in types",t.EMPTY_PASSWORD="Password cannot be empty",t.EMPTY_CODE="Confirmation code cannot be empty",t.SIGN_UP_ERROR="Error creating account",t.NO_MFA="No valid MFA method provided",t.INVALID_MFA="Invalid MFA type",t.EMPTY_CHALLENGE="Challenge response cannot be empty",t.NO_USER_SESSION="Failed to get the session because the user is empty",t.NETWORK_ERROR="Network Error",t.DEVICE_CONFIG="Device tracking has not been configured in this User Pool",t.AUTOSIGNIN_ERROR="Please use your credentials to sign in",t.OAUTH_ERROR="Couldn't finish OAuth flow, check your User Pool HostedUI settings"})($n||($n={}));var Ro;(function(t){t.SignInException="SignInException",t.OAuthSignInError="OAuthSignInException"})(Ro||(Ro={}));class Ue extends $r{constructor(e){super(e),this.constructor=Ue,Object.setPrototypeOf(this,Ue.prototype)}}function fn(t,e){const{message:n,recoverySuggestion:r}=V6[e];if(!t)throw new Ue({name:e,message:n,recoverySuggestion:r})}function bt(t){const e=t?.split("_")[0];if(!t||t.indexOf("_")<0||!e||typeof e!="string")throw new Ue({name:"InvalidUserPoolId",message:"Invalid user pool id provided."});return e}function zx(t){if(!t||!t.includes(":"))throw new Ue({name:"InvalidIdentityPoolIdException",message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."});return t.split(":")[0]}function vM(t){return Object.entries(t).map(([e,n])=>({Name:e,Value:n}))}function zV(t){const e={};return t?.forEach(n=>{n.Name&&(e[n.Name]=n.Value)}),e}var yM;(function(t){t.ConcurrentModificationException="ConcurrentModificationException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceNotFoundException="ResourceNotFoundException",t.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException"})(yM||(yM={}));var bM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.InvalidPasswordException="InvalidPasswordException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(bM||(bM={}));var SM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidPasswordException="InvalidPasswordException",t.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UsernameExistsException="UsernameExistsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(SM||(SM={}));var EM;(function(t){t.CodeMismatchException="CodeMismatchException",t.ExpiredCodeException="ExpiredCodeException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidPasswordException="InvalidPasswordException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyFailedAttemptsException="TooManyFailedAttemptsException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(EM||(EM={}));var CM;(function(t){t.AliasExistsException="AliasExistsException",t.CodeMismatchException="CodeMismatchException",t.ExpiredCodeException="ExpiredCodeException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyFailedAttemptsException="TooManyFailedAttemptsException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotFoundException="UserNotFoundException"})(CM||(CM={}));var wM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(wM||(wM={}));var xM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(xM||(xM={}));var _M;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(_M||(_M={}));var AM;(function(t){t.CodeDeliveryFailureException="CodeDeliveryFailureException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",t.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotFoundException="UserNotFoundException"})(AM||(AM={}));var TM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(TM||(TM={}));var RM;(function(t){t.ExternalServiceException="ExternalServiceException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceConflictException="ResourceConflictException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException"})(RM||(RM={}));var IM;(function(t){t.ExternalServiceException="ExternalServiceException",t.InternalErrorException="InternalErrorException",t.InvalidIdentityPoolConfigurationException="InvalidIdentityPoolConfigurationException",t.InvalidParameterException="InvalidParameterException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceConflictException="ResourceConflictException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException"})(IM||(IM={}));var OM;(function(t){t.CodeDeliveryFailureException="CodeDeliveryFailureException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",t.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(OM||(OM={}));var NM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException"})(NM||(NM={}));var Ev;(function(t){t.PasswordResetRequiredException="PasswordResetRequiredException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",t.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",t.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(Ev||(Ev={}));var MM;(function(t){t.CodeDeliveryFailureException="CodeDeliveryFailureException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",t.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotFoundException="UserNotFoundException"})(MM||(MM={}));var PM;(function(t){t.AliasExistsException="AliasExistsException",t.CodeMismatchException="CodeMismatchException",t.ExpiredCodeException="ExpiredCodeException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidPasswordException="InvalidPasswordException",t.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",t.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",t.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",t.MFAMethodNotFoundException="MFAMethodNotFoundException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(PM||(PM={}));var kM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(kM||(kM={}));var jx;(function(t){t.CodeDeliveryFailureException="CodeDeliveryFailureException",t.InternalErrorException="InternalErrorException",t.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidPasswordException="InvalidPasswordException",t.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",t.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UsernameExistsException="UsernameExistsException"})(jx||(jx={}));var DM;(function(t){t.AliasExistsException="AliasExistsException",t.CodeDeliveryFailureException="CodeDeliveryFailureException",t.CodeMismatchException="CodeMismatchException",t.ExpiredCodeException="ExpiredCodeException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",t.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(DM||(DM={}));var LM;(function(t){t.CodeMismatchException="CodeMismatchException",t.EnableSoftwareTokenMFAException="EnableSoftwareTokenMFAException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(LM||(LM={}));var UM;(function(t){t.AliasExistsException="AliasExistsException",t.CodeMismatchException="CodeMismatchException",t.ExpiredCodeException="ExpiredCodeException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(UM||(UM={}));var FM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(FM||(FM={}));var zM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(zM||(zM={}));const My="UserUnAuthenticatedException",jV="UserAlreadyAuthenticatedException",BV="DeviceMetadataNotFoundException",G6="AutoSignInException",$V="InvalidRedirectException",HV="InvalidAppSchemeException",qV="InvalidPreferredRedirectUrlException",WV=new Ue({name:$V,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 Ue({name:HV,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."});new Ue({name:qV,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."});const VV="InvalidOriginException",GV=new Ue({name:VV,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."}),KV="OAuthSignOutException",YV="TokenRefreshException",ZV="UnexpectedSignInInterruptionException";function ud(t){if(!t||!t.accessToken)throw new Ue({name:My,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}function XV(t){if(!t||!t.idToken)throw new Ue({name:My,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}const QV=new Ue({name:YV,message:`Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow.
|
|
3
3
|
Please change your oauth configuration to use 'code grant' flow.`,recoverySuggestion:`Please logout and change your Amplify configuration to use "code grant" flow.
|
|
4
4
|
E.g { responseType: 'code' }`}),JV=new Ue({name:My,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function K6(t){if(nG(t))throw QV;if(!tG(t))throw JV}function Y6(t){if(!t||!t.deviceKey||!t.deviceGroupKey||!t.randomPassword)throw new Ue({name:BV,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 eG={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function Z6(t){return t?.accessToken||t?.idToken}function tG(t){return Z6(t)&&t?.refreshToken}function nG(t){return Z6(t)&&!t?.refreshToken}const rG=async t=>{const e=t.getConfig().Auth?.Cognito;lt(e);const n=await t.Auth.getTokens({forceRefresh:!1});ud(n);const{"cognito:username":r,sub:s}=n.idToken?.payload??{},o={username:r,userId:s},a=sG(n);return a&&(o.signInDetails=a),o};function sG(t){return t?.signInDetails}const Py=async()=>rG(Ht),Mt=(t,e)=>Ry({category:Os.Auth,action:t,...e}),Wn=t=>(e,n)=>{const r=oG(t),s=JSON.stringify(e);return iG(n,r,s)},oG=t=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${t}`}),iG=({url:t},e,n)=>({headers:e,url:t,body:n,method:"POST"});function Ns(t){if(!t||t.name==="Error"||t instanceof TypeError)throw new Ue({name:Da.Unknown,message:"An unknown error has occurred.",underlyingError:t})}const ar=()=>async t=>{if(t.statusCode>=300){const e=await ld(t);throw Ns(e),new Ue({name:e.name,message:e.message,metadata:e.$metadata})}return ep(t)},aG=()=>(t,e)=>async function(r){return r.headers={...r.headers,"cache-control":"no-store",...await Ht.libraryOptions?.Auth?.headers?.()},t(r)},Vn=qA(L6,[aG]),X6="cognito-idp",Gn={service:X6,retryDecider:P6(ld),computeDelay:M6,get userAgentValue(){return Ry()},cache:"no-store"},np=t=>In(Vn,Wn("InitiateAuth"),ar(),{...Gn,...t}),ls=t=>In(Vn,Wn("RespondToAuthChallenge"),ar(),{...Gn,...t}),lG=t=>In(Vn,Wn("VerifySoftwareToken"),ar(),{...Gn,...t}),uG=t=>In(Vn,Wn("AssociateSoftwareToken"),ar(),{...Gn,...t}),cG=({region:t})=>({url:new Ka(`https://${X6}.${t}.${j6(t)}`)}),St=({endpointOverride:t})=>e=>t?{url:new Ka(t)}:cG(e),dG=t=>In(Vn,Wn("GetTokensFromRefreshToken"),ar(),{...Gn,...t}),fG=async({tokens:t,authConfig:e,username:n,clientMetadata:r})=>{lt(e?.Cognito);const{userPoolId:s,userPoolClientId:o,userPoolEndpoint:a}=e.Cognito,u=bt(s);K6(t);const c=dG({endpointResolver:St({endpointOverride:a})}),{AuthenticationResult:f}=await c({region:u},{ClientId:o,RefreshToken:t.refreshToken,DeviceKey:t.deviceMetadata?.deviceKey,ClientMetadata:r}),h=vi(f?.AccessToken??""),g=f?.IdToken?vi(f.IdToken):void 0,{iat:m}=h.payload;if(!m)throw new Ue({name:"iatNotFoundException",message:"iat not found in access token"});const y=m*1e3-new Date().getTime();return{accessToken:h,idToken:g,clockDrift:y,refreshToken:f?.RefreshToken??t.refreshToken,username:n}},hG=kV(fG),pG={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetails:"signInDetails",oauthMetadata:"oauthMetadata"};var Cv;(function(t){t.InvalidAuthTokens="InvalidAuthTokens"})(Cv||(Cv={}));const gG={[Cv.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},mG=_y(gG),jM="CognitoIdentityServiceProvider";class vG{getKeyValueStorage(){if(!this.keyValueStorage)throw new Ue({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(e){this.keyValueStorage=e}setAuthConfig(e){this.authConfig=e}async loadTokens(){try{const e=await this.getAuthKeys(),n=await this.getKeyValueStorage().getItem(e.accessToken);if(!n)throw new Ue({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});const r=vi(n),s=await this.getKeyValueStorage().getItem(e.idToken),o=s?vi(s):void 0,a=await this.getKeyValueStorage().getItem(e.refreshToken)??void 0,u=await this.getKeyValueStorage().getItem(e.clockDrift)??"0",c=Number.parseInt(u),f=await this.getKeyValueStorage().getItem(e.signInDetails),h={accessToken:r,idToken:o,refreshToken:a,deviceMetadata:await this.getDeviceMetadata()??void 0,clockDrift:c,username:await this.getLastAuthUser()};return f&&(h.signInDetails=JSON.parse(f)),h}catch{return null}}async storeTokens(e){mG(e!==void 0,Cv.InvalidAuthTokens);const n=e.username;await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),n);const r=await this.getAuthKeys();await this.getKeyValueStorage().setItem(r.accessToken,e.accessToken.toString()),e.idToken?await this.getKeyValueStorage().setItem(r.idToken,e.idToken.toString()):await this.getKeyValueStorage().removeItem(r.idToken),e.refreshToken?await this.getKeyValueStorage().setItem(r.refreshToken,e.refreshToken):await this.getKeyValueStorage().removeItem(r.refreshToken),e.deviceMetadata&&(e.deviceMetadata.deviceKey&&await this.getKeyValueStorage().setItem(r.deviceKey,e.deviceMetadata.deviceKey),e.deviceMetadata.deviceGroupKey&&await this.getKeyValueStorage().setItem(r.deviceGroupKey,e.deviceMetadata.deviceGroupKey),await this.getKeyValueStorage().setItem(r.randomPasswordKey,e.deviceMetadata.randomPassword)),e.signInDetails?await this.getKeyValueStorage().setItem(r.signInDetails,JSON.stringify(e.signInDetails)):await this.getKeyValueStorage().removeItem(r.signInDetails),await this.getKeyValueStorage().setItem(r.clockDrift,`${e.clockDrift}`)}async clearTokens(){const e=await this.getAuthKeys();await Promise.all([this.getKeyValueStorage().removeItem(e.accessToken),this.getKeyValueStorage().removeItem(e.idToken),this.getKeyValueStorage().removeItem(e.clockDrift),this.getKeyValueStorage().removeItem(e.refreshToken),this.getKeyValueStorage().removeItem(e.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),this.getKeyValueStorage().removeItem(e.oauthMetadata)])}async getDeviceMetadata(e){const n=await this.getAuthKeys(e),r=await this.getKeyValueStorage().getItem(n.deviceKey),s=await this.getKeyValueStorage().getItem(n.deviceGroupKey),o=await this.getKeyValueStorage().getItem(n.randomPasswordKey);return o&&s&&r?{deviceKey:r,deviceGroupKey:s,randomPassword:o}:null}async clearDeviceMetadata(e){const n=await this.getAuthKeys(e);await Promise.all([this.getKeyValueStorage().removeItem(n.deviceKey),this.getKeyValueStorage().removeItem(n.deviceGroupKey),this.getKeyValueStorage().removeItem(n.randomPasswordKey)])}async getAuthKeys(e){lt(this.authConfig?.Cognito);const n=e??await this.getLastAuthUser();return yG(jM,`${this.authConfig.Cognito.userPoolClientId}.${n}`)}getLastAuthUserKey(){lt(this.authConfig?.Cognito);const e=this.authConfig.Cognito.userPoolClientId;return`${jM}.${e}.LastAuthUser`}async getLastAuthUser(){return await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())??"username"}async setOAuthMetadata(e){const{oauthMetadata:n}=await this.getAuthKeys();await this.getKeyValueStorage().setItem(n,JSON.stringify(e))}async getOAuthMetadata(){const{oauthMetadata:e}=await this.getAuthKeys(),n=await this.getKeyValueStorage().getItem(e);return n&&JSON.parse(n)}}const yG=(t,e)=>VA(pG)(`${t}`,e);function VA(t){const e=Object.values({...t});return(n,r)=>e.reduce((s,o)=>({...s,[o]:`${n}.${r}.${o}`}),{})}const BM="amplify-signin-with-hostedUI",po="CognitoIdentityServiceProvider";class Q6{constructor(e){this.keyValueStorage=e}async clearOAuthInflightData(){lt(this.cognitoConfig);const e=go(po,this.cognitoConfig.userPoolClientId);await Promise.all([this.keyValueStorage.removeItem(e.inflightOAuth),this.keyValueStorage.removeItem(e.oauthPKCE),this.keyValueStorage.removeItem(e.oauthState)])}async clearOAuthData(){lt(this.cognitoConfig);const e=go(po,this.cognitoConfig.userPoolClientId);return await this.clearOAuthInflightData(),await this.keyValueStorage.removeItem(BM),this.keyValueStorage.removeItem(e.oauthSignIn)}loadOAuthState(){lt(this.cognitoConfig);const e=go(po,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(e.oauthState)}storeOAuthState(e){lt(this.cognitoConfig);const n=go(po,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(n.oauthState,e)}loadPKCE(){lt(this.cognitoConfig);const e=go(po,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(e.oauthPKCE)}storePKCE(e){lt(this.cognitoConfig);const n=go(po,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(n.oauthPKCE,e)}setAuthConfig(e){this.cognitoConfig=e}async loadOAuthInFlight(){lt(this.cognitoConfig);const e=go(po,this.cognitoConfig.userPoolClientId);return await this.keyValueStorage.getItem(e.inflightOAuth)==="true"}async storeOAuthInFlight(e){lt(this.cognitoConfig);const n=go(po,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(n.inflightOAuth,`${e}`)}async loadOAuthSignIn(){lt(this.cognitoConfig);const e=go(po,this.cognitoConfig.userPoolClientId),n=await this.keyValueStorage.getItem(BM),[r,s]=(await this.keyValueStorage.getItem(e.oauthSignIn))?.split(",")??[];return{isOAuthSignIn:r==="true"||n==="true",preferPrivateSession:s==="true"}}async storeOAuthSignIn(e,n=!1){lt(this.cognitoConfig);const r=go(po,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(r.oauthSignIn,`${e},${n}`)}}const go=(t,e)=>VA(eG)(t,e),Fr=new Q6(tp),Bx=[],bG=t=>{Bx.push(t)},J6=()=>{for(;Bx.length;)Bx.pop()?.()};class SG{constructor(){this.waitForInflightOAuth=Iy()?async()=>{if(await Fr.loadOAuthInFlight())return this.inflightPromise?this.inflightPromise:(this.inflightPromise=new Promise((e,n)=>{bG(e)}),this.inflightPromise)}:async()=>{}}setAuthConfig(e){Fr.setAuthConfig(e.Cognito),this.authConfig=e}setTokenRefresher(e){this.tokenRefresher=e}setAuthTokenStore(e){this.tokenStore=e}getTokenStore(){if(!this.tokenStore)throw new Ue({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}getTokenRefresher(){if(!this.tokenRefresher)throw new Ue({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}setClientMetadataProvider(e){this.clientMetadataProvider=e}async getTokens(e){let n;try{lt(this.authConfig?.Cognito)}catch{return null}await this.waitForInflightOAuth(),this.inflightPromise=void 0,n=await this.getTokenStore().loadTokens();const r=await this.getTokenStore().getLastAuthUser();if(n===null)return null;const s=!!n?.idToken&&mM({expiresAt:(n.idToken?.payload?.exp??0)*1e3,clockDrift:n.clockDrift??0}),o=mM({expiresAt:(n.accessToken?.payload?.exp??0)*1e3,clockDrift:n.clockDrift??0});return(e?.forceRefresh||s||o)&&(n=await this.refreshTokens({tokens:n,username:r,clientMetadata:e?.clientMetadata??await this.clientMetadataProvider?.()}),n===null)?null:{accessToken:n?.accessToken,idToken:n?.idToken,signInDetails:n?.signInDetails}}async refreshTokens({tokens:e,username:n,clientMetadata:r}){try{const{signInDetails:s}=e,o=await this.getTokenRefresher()({tokens:e,authConfig:this.authConfig,username:n,clientMetadata:r});return o.signInDetails=s,await this.setTokens({tokens:o}),To.dispatch("auth",{event:"tokenRefresh"},"Auth",Ao),o}catch(s){return this.handleErrors(s)}}handleErrors(e){if(Ns(e),this.isAuthenticationError(e)&&this.clearTokens(),To.dispatch("auth",{event:"tokenRefresh_failure",data:{error:e}},"Auth",Ao),e.name.startsWith("NotAuthorizedException"))return null;throw e}isAuthenticationError(e){return["NotAuthorizedException","TokenRevokedException","UserNotFoundException","PasswordResetRequiredException","UserNotConfirmedException","RefreshTokenReuseException"].some(r=>e?.name?.startsWith?.(r))}async setTokens({tokens:e}){return this.getTokenStore().storeTokens(e)}async clearTokens(){return this.getTokenStore().clearTokens()}getDeviceMetadata(e){return this.getTokenStore().getDeviceMetadata(e)}clearDeviceMetadata(e){return this.getTokenStore().clearDeviceMetadata(e)}setOAuthMetadata(e){return this.getTokenStore().setOAuthMetadata(e)}getOAuthMetadata(){return this.getTokenStore().getOAuthMetadata()}}class EG{constructor(){this.authTokenStore=new vG,this.authTokenStore.setKeyValueStorage(tp),this.tokenOrchestrator=new SG,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(hG)}getTokens(e={}){return this.tokenOrchestrator.getTokens(e)}setKeyValueStorage(e){this.authTokenStore.setKeyValueStorage(e)}setClientMetadataProvider(e){this.tokenOrchestrator.setClientMetadataProvider(e)}setAuthConfig(e){this.authTokenStore.setAuthConfig(e),this.tokenOrchestrator.setAuthConfig(e)}}const Gm=new EG,{tokenOrchestrator:Hr}=Gm;async function Ti(t){if(t.AccessToken){const e=vi(t.AccessToken),n=(e.payload.iat||0)*1e3,r=new Date().getTime(),s=n>0?n-r:0;let o,a,u;t.RefreshToken&&(a=t.RefreshToken),t.IdToken&&(o=vi(t.IdToken)),t?.NewDeviceMetadata&&(u=t.NewDeviceMetadata);const c={accessToken:e,idToken:o,refreshToken:a,clockDrift:s,deviceMetadata:u,username:t.username};t?.signInDetails&&(c.signInDetails=t.signInDetails),await Hr.setTokens({tokens:c})}else throw new $r({message:"Invalid tokens",name:"InvalidTokens",recoverySuggestion:"Check Cognito UserPool settings"})}const CG="Unable to get user session following successful sign-in.",Ya=async()=>{try{To.dispatch("auth",{event:"signedIn",data:await Py()},"Auth",Ao)}catch(t){throw t.name===My?new Ue({name:ZV,message:CG,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."}):t}};function e8(){return{active:!1}}const wG=(t,e)=>{switch(e.type){case"SET_USERNAME":return{...t,username:e.value};case"SET_SESSION":return{...t,session:e.value};case"START":return{...t,active:!0};case"RESET":return e8();default:return t}},xG=t=>{let e=t(e8(),{type:"RESET"});return{getState:()=>e,dispatch:n=>{e=t(e,n)}}},Ta=xG(wG),_G=180*1e3,$g="CognitoSignInState",hi={username:`${$g}.username`,challengeName:`${$g}.challengeName`,signInSession:`${$g}.signInSession`,expiry:`${$g}.expiry`},AG=(t,e)=>{switch(e.type){case"SET_SIGN_IN_SESSION":return Hg({signInSession:e.value}),{...t,signInSession:e.value};case"SET_SIGN_IN_STATE":return Hg(e.value),{...e.value};case"SET_CHALLENGE_NAME":return Hg({challengeName:e.value}),{...t,challengeName:e.value};case"SET_USERNAME":return Hg({username:e.value}),{...t,username:e.value};case"SET_INITIAL_STATE":return RG();case"RESET_STATE":return t8(),GA();default:return t}},TG=t=>{const e=Number(t),n=Date.now();return e<=n},Js=()=>{Io.dispatch({type:"RESET_STATE"})},t8=()=>{for(const t of Object.values(hi))fi.removeItem(t)},GA=()=>({username:void 0,challengeName:void 0,signInSession:void 0}),RG=()=>{const t=fi.getItem(hi.expiry);if(!t||TG(t))return t8(),GA();const e=fi.getItem(hi.username)??void 0,n=fi.getItem(hi.challengeName)??void 0,r=fi.getItem(hi.signInSession)??void 0;return{username:e,challengeName:n,signInSession:r}},IG=t=>{let e=t(GA(),{type:"SET_INITIAL_STATE"});return{getState:()=>e,dispatch:n=>{e=t(e,n)}}},Io=IG(AG);function ru(t){Io.dispatch({type:"SET_SIGN_IN_STATE",value:t})}const Hg=({challengeName:t,signInSession:e,username:n})=>{n&&fi.setItem(hi.username,n),t&&fi.setItem(hi.challengeName,t),e&&(fi.setItem(hi.signInSession,e),fi.setItem(hi.expiry,String(Date.now()+_G)))},$M="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 Is extends $r{constructor(e){super(e),this.constructor=Is,Object.setPrototypeOf(this,Is.prototype)}}var Bt;(function(t){t.PasskeyNotSupported="PasskeyNotSupported",t.PasskeyAlreadyExists="PasskeyAlreadyExists",t.InvalidPasskeyRegistrationOptions="InvalidPasskeyRegistrationOptions",t.InvalidPasskeyAuthenticationOptions="InvalidPasskeyAuthenticationOptions",t.RelyingPartyMismatch="RelyingPartyMismatch",t.PasskeyRegistrationFailed="PasskeyRegistrationFailed",t.PasskeyRetrievalFailed="PasskeyRetrievalFailed",t.PasskeyRegistrationCanceled="PasskeyRegistrationCanceled",t.PasskeyAuthenticationCanceled="PasskeyAuthenticationCanceled",t.PasskeyOperationAborted="PasskeyOperationAborted"})(Bt||(Bt={}));const G1="User may have canceled the ceremony or another interruption has occurred. Check underlying error for details.",HM="Ensure your user pool is configured to support the WEB_AUTHN as an authentication factor.",$c={[Bt.PasskeyNotSupported]:{message:"Passkeys may not be supported on this device.",recoverySuggestion:$M},[Bt.InvalidPasskeyRegistrationOptions]:{message:"Invalid passkey registration options.",recoverySuggestion:HM},[Bt.InvalidPasskeyAuthenticationOptions]:{message:"Invalid passkey authentication options.",recoverySuggestion:HM},[Bt.PasskeyRegistrationFailed]:{message:"Device failed to create passkey.",recoverySuggestion:$M},[Bt.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."},[Bt.PasskeyAlreadyExists]:{message:"Passkey already exists in authenticator.",recoverySuggestion:"Proceed with existing passkey or try again after deleting the credential."},[Bt.PasskeyRegistrationCanceled]:{message:"Passkey registration ceremony has been canceled.",recoverySuggestion:G1},[Bt.PasskeyAuthenticationCanceled]:{message:"Passkey authentication ceremony has been canceled.",recoverySuggestion:G1},[Bt.PasskeyOperationAborted]:{message:"Passkey operation has been aborted.",recoverySuggestion:G1},[Bt.RelyingPartyMismatch]:{message:"Relying party does not match current domain.",recoverySuggestion:"Ensure relying party identifier matches current domain."}},cd=_y($c,Is),n8=t=>{if(t instanceof Error){if(t.name==="AbortError"){const{message:e,recoverySuggestion:n}=$c[Bt.PasskeyOperationAborted];return new Is({name:Bt.PasskeyOperationAborted,message:e,recoverySuggestion:n,underlyingError:t})}if(t.name==="SecurityError"){const{message:e,recoverySuggestion:n}=$c[Bt.RelyingPartyMismatch];return new Is({name:Bt.RelyingPartyMismatch,message:e,recoverySuggestion:n,underlyingError:t})}}return new Is({name:Da.Unknown,message:"An unknown error has occurred.",underlyingError:t})},OG=t=>{if(t instanceof Is)return t;if(t instanceof Error&&t.name==="NotAllowedError"){const{message:e,recoverySuggestion:n}=$c[Bt.PasskeyAuthenticationCanceled];return new Is({name:Bt.PasskeyAuthenticationCanceled,message:e,recoverySuggestion:n,underlyingError:t})}return n8(t)},r8=()=>Iy()&&window.isSecureContext&&"credentials"in navigator&&typeof window.PublicKeyCredential=="function",wo=t=>Bc.convert(new Uint8Array(t),{urlSafe:!0,skipPadding:!0}),dh=t=>Uint8Array.from(BA.convert(t,{urlSafe:!0}),e=>e.charCodeAt(0)).buffer,NG=t=>{const e=dh(t.user.id),n=dh(t.challenge),r=(t.excludeCredentials||[]).map(s=>({...s,id:dh(s.id)}));return{...t,excludeCredentials:r,challenge:n,user:{...t.user,id:e}}},MG=t=>{const e={clientDataJSON:wo(t.response.clientDataJSON),attestationObject:wo(t.response.attestationObject),transports:t.response.getTransports(),publicKeyAlgorithm:t.response.getPublicKeyAlgorithm(),authenticatorData:wo(t.response.getAuthenticatorData())},n=t.response.getPublicKey();n&&(e.publicKey=wo(n));const r={type:t.type,id:t.id,rawId:wo(t.rawId),clientExtensionResults:t.getClientExtensionResults(),response:e};return t.authenticatorAttachment&&(r.authenticatorAttachment=t.authenticatorAttachment),r},PG=t=>{const e=dh(t.challenge),n=(t.allowCredentials||[]).map(r=>({...r,id:dh(r.id)}));return{...t,challenge:e,allowCredentials:n}},kG=t=>{const e={clientDataJSON:wo(t.response.clientDataJSON),authenticatorData:wo(t.response.authenticatorData),signature:wo(t.response.signature)};t.response.userHandle&&(e.userHandle=wo(t.response.userHandle));const n={id:t.id,rawId:wo(t.rawId),type:t.type,clientExtensionResults:t.getClientExtensionResults(),response:e};return t.authenticatorAttachment&&(n.authenticatorAttachment=t.authenticatorAttachment),n};function DG(t){cd([!!t,!!t?.challenge,!!t?.user,!!t?.rp,!!t?.pubKeyCredParams].every(Boolean),Bt.InvalidPasskeyRegistrationOptions)}function LG(t){cd(t&&t instanceof PublicKeyCredential&&t.response instanceof AuthenticatorAttestationResponse,Bt.PasskeyRegistrationFailed)}function UG(t){cd(t&&t instanceof PublicKeyCredential&&t.response instanceof AuthenticatorAssertionResponse,Bt.PasskeyRetrievalFailed)}const FG=async t=>{try{const e=r8();cd(e,Bt.PasskeyNotSupported);const n=PG(t),r=await navigator.credentials.get({publicKey:n});return UG(r),kG(r)}catch(e){throw OG(e)}},zG=t=>In(Vn,Wn("ConfirmDevice"),ar(),{...Gn,...t}),Km={convert(t){return new TextEncoder().encode(t)}};function Ie(t,e){t!=null&&this.fromString(t,e)}function _r(){return new Ie(null,null)}let Oa;const jG=0xdeadbeefcafe,qM=(jG&16777215)===15715070;function BG(t,e,n,r,s,o){for(;--o>=0;){const a=e*this[t++]+n[r]+s;s=Math.floor(a/67108864),n[r++]=a&67108863}return s}function $G(t,e,n,r,s,o){const a=e&32767,u=e>>15;for(;--o>=0;){let c=this[t]&32767;const f=this[t++]>>15,h=u*c+f*a;c=a*c+((h&32767)<<15)+n[r]+(s&1073741823),s=(c>>>30)+(h>>>15)+u*f+(s>>>30),n[r++]=c&1073741823}return s}function HG(t,e,n,r,s,o){const a=e&16383,u=e>>14;for(;--o>=0;){let c=this[t]&16383;const f=this[t++]>>14,h=u*c+f*a;c=a*c+((h&16383)<<14)+n[r]+s,s=(c>>28)+(h>>14)+u*f,n[r++]=c&268435455}return s}const WM=typeof navigator<"u";WM&&qM&&navigator.appName==="Microsoft Internet Explorer"?(Ie.prototype.am=$G,Oa=30):WM&&qM&&navigator.appName!=="Netscape"?(Ie.prototype.am=BG,Oa=26):(Ie.prototype.am=HG,Oa=28);Ie.prototype.DB=Oa;Ie.prototype.DM=(1<<Oa)-1;Ie.prototype.DV=1<<Oa;const KA=52;Ie.prototype.FV=Math.pow(2,KA);Ie.prototype.F1=KA-Oa;Ie.prototype.F2=2*Oa-KA;const qG="0123456789abcdefghijklmnopqrstuvwxyz",ky=[];let dd,Ts;dd=48;for(Ts=0;Ts<=9;++Ts)ky[dd++]=Ts;dd=97;for(Ts=10;Ts<36;++Ts)ky[dd++]=Ts;dd=65;for(Ts=10;Ts<36;++Ts)ky[dd++]=Ts;function VM(t){return qG.charAt(t)}function WG(t,e){const n=ky[t.charCodeAt(e)];return n??-1}function VG(t){for(let e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function GG(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function YA(t){const e=_r();return e.fromInt(t),e}function KG(t,e){let n;if(e===16)n=4;else if(e===8)n=3;else if(e===2)n=1;else if(e===32)n=5;else if(e===4)n=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");this.t=0,this.s=0;let r=t.length,s=!1,o=0;for(;--r>=0;){const a=WG(t,r);if(a<0){t.charAt(r)==="-"&&(s=!0);continue}s=!1,o===0?this[this.t++]=a:o+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,o+=n,o>=this.DB&&(o-=this.DB)}this.clamp(),s&&Ie.ZERO.subTo(this,this)}function YG(){const t=this.s&this.DM;for(;this.t>0&&this[this.t-1]==t;)--this.t}function ZG(t){if(this.s<0)return"-"+this.negate().toString(t);let e;if(t==16)e=4;else if(t===8)e=3;else if(t===2)e=1;else if(t===32)e=5;else if(t===4)e=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");const n=(1<<e)-1;let r,s=!1,o="",a=this.t,u=this.DB-a*this.DB%e;if(a-- >0)for(u<this.DB&&(r=this[a]>>u)>0&&(s=!0,o=VM(r));a>=0;)u<e?(r=(this[a]&(1<<u)-1)<<e-u,r|=this[--a]>>(u+=this.DB-e)):(r=this[a]>>(u-=e)&n,u<=0&&(u+=this.DB,--a)),r>0&&(s=!0),s&&(o+=VM(r));return s?o:"0"}function XG(){const t=_r();return Ie.ZERO.subTo(this,t),t}function QG(){return this.s<0?this.negate():this}function JG(t){let e=this.s-t.s;if(e!=0)return e;let n=this.t;if(e=n-t.t,e!=0)return this.s<0?-e:e;for(;--n>=0;)if((e=this[n]-t[n])!=0)return e;return 0}function ZA(t){let e=1,n;return(n=t>>>16)!==0&&(t=n,e+=16),(n=t>>8)!==0&&(t=n,e+=8),(n=t>>4)!==0&&(t=n,e+=4),(n=t>>2)!==0&&(t=n,e+=2),(n=t>>1)!==0&&(t=n,e+=1),e}function eK(){return this.t<=0?0:this.DB*(this.t-1)+ZA(this[this.t-1]^this.s&this.DM)}function tK(t,e){let n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s}function nK(t,e){for(let n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s}function rK(t,e){const n=t%this.DB,r=this.DB-n,s=(1<<r)-1,o=Math.floor(t/this.DB);let a=this.s<<n&this.DM,u;for(u=this.t-1;u>=0;--u)e[u+o+1]=this[u]>>r|a,a=(this[u]&s)<<n;for(u=o-1;u>=0;--u)e[u]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()}function sK(t,e){e.s=this.s;const n=Math.floor(t/this.DB);if(n>=this.t){e.t=0;return}const r=t%this.DB,s=this.DB-r,o=(1<<r)-1;e[0]=this[n]>>r;for(let a=n+1;a<this.t;++a)e[a-n-1]|=(this[a]&o)<<s,e[a-n]=this[a]>>r;r>0&&(e[this.t-n-1]|=(this.s&o)<<s),e.t=this.t-n,e.clamp()}function oK(t,e){let n=0,r=0;const s=Math.min(t.t,this.t);for(;n<s;)r+=this[n]-t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r-=t[n],e[n++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()}function iK(t,e){const n=this.abs(),r=t.abs();let s=n.t;for(e.t=s+r.t;--s>=0;)e[s]=0;for(s=0;s<r.t;++s)e[s+n.t]=n.am(0,r[s],e,s,0,n.t);e.s=0,e.clamp(),this.s!==t.s&&Ie.ZERO.subTo(e,e)}function aK(t){const e=this.abs();let n=t.t=2*e.t;for(;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){const r=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,r,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()}function lK(t,e,n){const r=t.abs();if(r.t<=0)return;const s=this.abs();if(s.t<r.t){e?.fromInt(0),n!=null&&this.copyTo(n);return}n===null&&(n=_r());const o=_r(),a=this.s,u=t.s,c=this.DB-ZA(r[r.t-1]);c>0?(r.lShiftTo(c,o),s.lShiftTo(c,n)):(r.copyTo(o),s.copyTo(n));const f=o.t,h=o[f-1];if(h===0)return;const g=h*(1<<this.F1)+(f>1?o[f-2]>>this.F2:0),m=this.FV/g,y=(1<<this.F1)/g,S=1<<this.F2;let E=n.t,C=E-f;const w=e===null?_r():e;for(o.dlShiftTo(C,w),n.compareTo(w)>=0&&(n[n.t++]=1,n.subTo(w,n)),Ie.ONE.dlShiftTo(f,w),w.subTo(o,o);o.t<f;)o[o.t++]=0;for(;--C>=0;){let T=n[--E]===h?this.DM:Math.floor(n[E]*m+(n[E-1]+S)*y);if((n[E]+=o.am(0,T,n,C,0,f))<T)for(o.dlShiftTo(C,w),n.subTo(w,n);n[E]<--T;)n.subTo(w,n)}e!==null&&(n.drShiftTo(f,e),a!==u&&Ie.ZERO.subTo(e,e)),n.t=f,n.clamp(),c>0&&n.rShiftTo(c,n),a<0&&Ie.ZERO.subTo(n,n)}function uK(t){const e=_r();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(Ie.ZERO)>0&&t.subTo(e,e),e}function cK(){if(this.t<1)return 0;const t=this[0];if((t&1)===0)return 0;let e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function dK(t){return this.compareTo(t)===0}function fK(t,e){let n=0,r=0;const s=Math.min(t.t,this.t);for(;n<s;)r+=this[n]+t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r+=t[n],e[n++]=r&this.DM,r>>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e[n++]=r:r<-1&&(e[n++]=this.DV+r),e.t=n,e.clamp()}function hK(t){const e=_r();return this.addTo(t,e),e}function pK(t){const e=_r();return this.subTo(t,e),e}function gK(t){const e=_r();return this.multiplyTo(t,e),e}function mK(t){const e=_r();return this.divRemTo(t,e,null),e}function fd(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function vK(t){const e=_r();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(Ie.ZERO)>0&&this.m.subTo(e,e),e}function yK(t){const e=_r();return t.copyTo(e),this.reduce(e),e}function bK(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(let e=0;e<this.m.t;++e){let n=t[e]&32767;const r=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t[n]+=this.m.am(0,r,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function SK(t,e){t.squareTo(e),this.reduce(e)}function EK(t,e,n){t.multiplyTo(e,n),this.reduce(n)}fd.prototype.convert=vK;fd.prototype.revert=yK;fd.prototype.reduce=bK;fd.prototype.mulTo=EK;fd.prototype.sqrTo=SK;function CK(t,e,n){let r=t.bitLength(),s,o=YA(1);const a=new fd(e);if(r<=0)return o;r<18?s=1:r<48?s=3:r<144?s=4:r<768?s=5:s=6;const u=[];let c=3;const f=s-1,h=(1<<s)-1;if(u[1]=a.convert(this),s>1){const w=_r();for(a.sqrTo(u[1],w);c<=h;)u[c]=_r(),a.mulTo(w,u[c-2],u[c]),c+=2}let g=t.t-1,m,y=!0,S=_r(),E;for(r=ZA(t[g])-1;g>=0;){for(r>=f?m=t[g]>>r-f&h:(m=(t[g]&(1<<r+1)-1)<<f-r,g>0&&(m|=t[g-1]>>this.DB+r-f)),c=s;(m&1)===0;)m>>=1,--c;if((r-=c)<0&&(r+=this.DB,--g),y)u[m].copyTo(o),y=!1;else{for(;c>1;)a.sqrTo(o,S),a.sqrTo(S,o),c-=2;c>0?a.sqrTo(o,S):(E=o,o=S,S=E),a.mulTo(S,u[m],o)}for(;g>=0&&(t[g]&1<<r)===0;)a.sqrTo(o,S),E=o,o=S,S=E,--r<0&&(r=this.DB-1,--g)}const C=a.revert(o);return n(null,C),C}Ie.prototype.copyTo=VG;Ie.prototype.fromInt=GG;Ie.prototype.fromString=KG;Ie.prototype.clamp=YG;Ie.prototype.dlShiftTo=tK;Ie.prototype.drShiftTo=nK;Ie.prototype.lShiftTo=rK;Ie.prototype.rShiftTo=sK;Ie.prototype.subTo=oK;Ie.prototype.multiplyTo=iK;Ie.prototype.squareTo=aK;Ie.prototype.divRemTo=lK;Ie.prototype.invDigit=cK;Ie.prototype.addTo=fK;Ie.prototype.toString=ZG;Ie.prototype.negate=XG;Ie.prototype.abs=QG;Ie.prototype.compareTo=JG;Ie.prototype.bitLength=eK;Ie.prototype.mod=uK;Ie.prototype.equals=dK;Ie.prototype.add=hK;Ie.prototype.subtract=pK;Ie.prototype.multiply=gK;Ie.prototype.divide=mK;Ie.prototype.modPow=CK;Ie.ZERO=YA(0);Ie.ONE=YA(1);const wK=async({a:t,g:e,k:n,x:r,B:s,N:o,U:a})=>new Promise((u,c)=>{e.modPow(r,o,(f,h)=>{if(f){c(f);return}s.subtract(n.multiply(h)).modPow(t.add(a.multiply(r)),o,(g,m)=>{if(g){c(g);return}u(m.mod(o))})})}),xK="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",s8={},$x={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),s8[t]=e,$x[e]=t}const Hc=t=>{if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2){const r=t.slice(n,n+2).toLowerCase();if(r in $x)e[n/2]=$x[r];else throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`)}return e},XA=t=>{let e="";for(let n=0;n<t.byteLength;n++)e+=s8[t[n]];return e},Hx=t=>{const e=new $l;e.update(t);const n=e.digestSync(),r=XA(n);return new Array(64-r.length).join("0")+r},Ym=t=>Hx(Hc(t)),_K=/^[89a-f]/i,li=t=>{if(!(t instanceof Ie))throw new Error("Not a BigInteger");const e=t.compareTo(Ie.ZERO)<0;let n=t.abs().toString(16);if(n=n.length%2!==0?`0${n}`:n,n=_K.test(n)?`00${n}`:n,e){const r=n.split("").map(o=>{const a=~parseInt(o,16)&15;return"0123456789ABCDEF".charAt(a)}).join("");n=new Ie(r,16).add(Ie.ONE).toString(16),n.toUpperCase().startsWith("FF8")&&(n=n.substring(2))}return n},AK=({A:t,B:e})=>{const n=new Ie(Ym(li(t)+li(e)),16);if(n.equals(Ie.ZERO))throw new Error("U cannot be zero.");return n},TK=(t,e,n)=>{const r=new $l(e);r.update(t);const s=r.digestSync(),o=new $l(s);return o.update(n),o.digestSync().slice(0,16)},QA=t=>{const e=new WA().random(t).toString();return Hc(e)},RK=()=>Bc.convert(QA(40));class IK{constructor({userPoolName:e,a:n,g:r,A:s,N:o}){this.encoder=Km,this.userPoolName=e,this.a=n,this.g=r,this.A=s,this.N=o,this.k=new Ie(Ym(`${li(o)}${li(r)}`),16)}getRandomPassword(){if(!this.randomPassword)throw new Ue({name:"EmptyBigIntegerRandomPassword",message:"random password is empty"});return this.randomPassword}getSaltToHashDevices(){if(!this.saltToHashDevices)throw new Ue({name:"EmptyBigIntegersaltToHashDevices",message:"saltToHashDevices is empty"});return this.saltToHashDevices}getVerifierDevices(){if(!this.verifierDevices)throw new Ue({name:"EmptyBigIntegerVerifierDevices",message:"verifyDevices is empty"});return this.verifierDevices}async generateHashDevice(e,n){this.randomPassword=RK();const r=`${e}${n}:${this.randomPassword}`,s=Hx(r),o=XA(QA(16));return this.saltToHashDevices=li(new Ie(o,16)),new Promise((a,u)=>{this.g.modPow(new Ie(Ym(this.saltToHashDevices+s),16),this.N,(c,f)=>{if(c){u(c);return}this.verifierDevices=li(f),a()})})}async getPasswordAuthenticationKey({username:e,password:n,serverBValue:r,salt:s}){if(r.mod(this.N).equals(Ie.ZERO))throw new Error("B cannot be zero.");const o=AK({A:this.A,B:r}),a=`${this.userPoolName}${e}:${n}`,u=Hx(a),c=new Ie(Ym(li(s)+u),16),f=await wK({a:this.a,g:this.g,k:this.k,x:c,B:r,N:this.N,U:o}),h=this.encoder.convert("Caldera Derived Key"),g=this.encoder.convert(""),m=new Uint8Array(h.byteLength+g.byteLength);return m.set(h,0),m.set(g,h.byteLength),TK(Hc(li(f)),Hc(li(o)),m)}}const OK=async({a:t,g:e,N:n})=>new Promise((r,s)=>{e.modPow(t,n,(o,a)=>{if(o){s(o);return}if(a.mod(n).equals(Ie.ZERO)){s(new Error("Illegal parameter. A mod N cannot be 0."));return}r(a)})}),rp=async t=>{const e=new Ie(xK,16),n=new Ie("2",16),r=NK(),s=await OK({a:r,g:n,N:e});return new IK({userPoolName:t,a:r,g:n,A:s,N:e})},NK=()=>{const t=XA(QA(128));return new Ie(t,16)};async function su({userPoolId:t,userPoolEndpoint:e,newDeviceMetadata:n,accessToken:r}){if(!n)return;const s=t.split("_")[1]||"",o=await rp(s),a=n?.DeviceKey,u=n?.DeviceGroupKey;try{await o.generateHashDevice(u??"",a??"")}catch{return}const c={Salt:Bc.convert(Hc(o.getSaltToHashDevices())),PasswordVerifier:Bc.convert(Hc(o.getVerifierDevices()))},f=o.getRandomPassword();try{return await zG({endpointResolver:St({endpointOverride:e})})({region:bt(t)},{AccessToken:r,DeviceName:await DV(),DeviceKey:n?.DeviceKey,DeviceSecretVerifierConfig:c}),{deviceKey:a,deviceGroupKey:u,randomPassword:f}}catch{return}}async function MK(t){const e=Ht.getConfig().Auth?.Cognito;lt(e);const{username:n,signInSession:r,signInDetails:s,challengeName:o}=Io.getState();if(o!=="WEB_AUTHN"||!n)throw new Ue({name:Ro.SignInException,message:"Unable to proceed due to invalid sign in state."});const{CREDENTIAL_REQUEST_OPTIONS:a}=t;cd(!!a,Bt.InvalidPasskeyAuthenticationOptions);const u=await FG(JSON.parse(a)),c=ls({endpointResolver:St({endpointOverride:e.userPoolEndpoint})}),{ChallengeName:f,ChallengeParameters:h,AuthenticationResult:g,Session:m}=await c({region:bt(e.userPoolId),userAgentValue:Mt(Ke.ConfirmSignIn)},{ChallengeName:"WEB_AUTHN",ChallengeResponses:{USERNAME:n,CREDENTIAL:JSON.stringify(u)},ClientId:e.userPoolClientId,Session:r});if(ru({signInSession:m,username:n,challengeName:f,signInDetails:s}),g)return await Ti({...g,username:n,NewDeviceMetadata:await su({userPoolId:e.userPoolId,userPoolEndpoint:e.userPoolEndpoint,newDeviceMetadata:g.NewDeviceMetadata,accessToken:g.AccessToken}),signInDetails:s}),Io.dispatch({type:"RESET_STATE"}),await Ya(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};if(f==="WEB_AUTHN")throw new Ue({name:Ro.SignInException,message:"Sequential WEB_AUTHN challenges returned from underlying service cannot be handled."});return{challengeName:f,challengeParameters:h}}function Kn({username:t,userPoolId:e,userPoolClientId:n}){if(typeof window>"u")return;const r=window.AmazonCognitoAdvancedSecurityData;if(typeof r>"u")return;const s=r.getData(t,e,n);return s?{EncodedData:s}:{}}const PK=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],kK=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],o8=()=>{const t=new Date,e=kK[t.getUTCDay()],n=PK[t.getUTCMonth()],r=t.getUTCDate();let s=t.getUTCHours();s<10&&(s=`0${s}`);let o=t.getUTCMinutes();o<10&&(o=`0${o}`);let a=t.getUTCSeconds();a<10&&(a=`0${a}`);const u=t.getUTCFullYear();return`${e} ${n} ${r} ${s}:${o}:${a} UTC ${u}`},i8=({userPoolName:t,username:e,challengeParameters:n,dateNow:r,hkdf:s})=>{const o=Km.convert(t),a=Km.convert(e),u=DK(n.SECRET_BLOCK),c=Km.convert(r),f=new Uint8Array(o.byteLength+a.byteLength+u.byteLength+c.byteLength);f.set(o,0),f.set(a,o.byteLength),f.set(u,o.byteLength+a.byteLength),f.set(c,o.byteLength+a.byteLength+u.byteLength);const h=new $l(s);h.update(f);const g=h.digestSync();return Bc.convert(g)},DK=t=>{const e="=".repeat((4-t.length%4)%4),n=(t+e).replace(/-/g,"+").replace(/_/g,"/"),r=BA.convert(n),s=new Uint8Array(r.length);for(let o=0;o<r.length;++o)s[o]=r.charCodeAt(o);return s};async function sp({username:t,config:e,clientMetadata:n,session:r,tokenOrchestrator:s}){const{userPoolId:o,userPoolEndpoint:a}=e,u=e.userPoolClientId,c=await s?.getDeviceMetadata(t);Y6(c);const f=await rp(c.deviceGroupKey),h={USERNAME:t,SRP_A:f.A.toString(16),DEVICE_KEY:c.deviceKey},g={ChallengeName:"DEVICE_SRP_AUTH",ClientId:u,ChallengeResponses:h,ClientMetadata:n,Session:r},m=ls({endpointResolver:St({endpointOverride:a})}),{ChallengeParameters:y,Session:S}=await m({region:bt(o)},g);return LK(t,y,n,S,f,e,s)}async function LK(t,e,n,r,s,{userPoolId:o,userPoolClientId:a,userPoolEndpoint:u},c){const f=await c?.getDeviceMetadata(t);Y6(f);const h=new Ie(e?.SRP_B,16),g=new Ie(e?.SALT,16),{deviceKey:m}=f,{deviceGroupKey:y}=f,S=await s.getPasswordAuthenticationKey({username:f.deviceKey,password:f.randomPassword,serverBValue:h,salt:g}),E=o8(),C={USERNAME:e?.USERNAME??t,PASSWORD_CLAIM_SECRET_BLOCK:e?.SECRET_BLOCK,TIMESTAMP:E,PASSWORD_CLAIM_SIGNATURE:i8({username:m,userPoolName:y,challengeParameters:e,dateNow:E,hkdf:S}),DEVICE_KEY:m},w=Kn({username:t,userPoolId:o,userPoolClientId:a}),T={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:a,ChallengeResponses:C,Session:r,ClientMetadata:n,UserContextData:w};return ls({endpointResolver:St({endpointOverride:u})})({region:bt(o)},T)}async function JA(t,e,n,r,s,o,a){const{userPoolId:u,userPoolClientId:c,userPoolEndpoint:f}=o,h=u?.split("_")[1]||"",g=new Ie(e?.SRP_B,16),m=new Ie(e?.SALT,16),y=e?.USER_ID_FOR_SRP;if(!y)throw new Ue({name:"EmptyUserIdForSRPException",message:"USER_ID_FOR_SRP was not found in challengeParameters"});const S=await s.getPasswordAuthenticationKey({username:y,password:t,serverBValue:g,salt:m}),E=o8(),C={USERNAME:y,PASSWORD_CLAIM_SECRET_BLOCK:e?.SECRET_BLOCK,TIMESTAMP:E,PASSWORD_CLAIM_SIGNATURE:i8({username:y,userPoolName:h,challengeParameters:e,dateNow:E,hkdf:S})},w=await a.getDeviceMetadata(y);w&&w.deviceKey&&(C.DEVICE_KEY=w.deviceKey);const T=Kn({username:y,userPoolId:u,userPoolClientId:c}),x={ChallengeName:"PASSWORD_VERIFIER",ChallengeResponses:C,ClientMetadata:n,Session:r,ClientId:c,UserContextData:T},M=await ls({endpointResolver:St({endpointOverride:f})})({region:bt(u)},x);return M.ChallengeName==="DEVICE_SRP_AUTH"?sp({username:y,config:o,clientMetadata:n,session:M.Session,tokenOrchestrator:a}):M}async function hd(t,e,n,r){try{return await t(...e)}catch(s){if(s instanceof Ue&&s.name==="ResourceNotFoundException"&&s.message.includes("Device does not exist."))return await r.clearDeviceMetadata(n),t(...e);throw s}}function ou(t){const{dispatch:e}=Io;e({type:"SET_USERNAME",value:t})}async function a8({username:t,password:e,clientMetadata:n,config:r,tokenOrchestrator:s,authFlow:o,preferredChallenge:a}){const{userPoolId:u,userPoolClientId:c,userPoolEndpoint:f}=r,h=u?.split("_")[1]||"",g=await rp(h),m={USERNAME:t,SRP_A:g.A.toString(16)};o==="USER_AUTH"&&a&&(m.PREFERRED_CHALLENGE=a);const y=Kn({username:t,userPoolId:u,userPoolClientId:c}),S={AuthFlow:o,AuthParameters:m,ClientMetadata:n,ClientId:c,UserContextData:y},C=await np({endpointResolver:St({endpointOverride:f})})({region:bt(u),userAgentValue:Mt(Ke.SignIn)},S),{ChallengeParameters:w,Session:T}=C,x=w?.USERNAME??t;return ou(x),C.ChallengeName==="PASSWORD_VERIFIER"?hd(JA,[e,w,n,T,g,r,s],x,s):C}async function UK({username:t,session:e,selectedChallenge:n,config:r,clientMetadata:s}){return ls({endpointResolver:St({endpointOverride:r.userPoolEndpoint})})({region:bt(r.userPoolId),userAgentValue:Mt(Ke.ConfirmSignIn)},{ChallengeName:"SELECT_CHALLENGE",ChallengeResponses:{USERNAME:t,ANSWER:n},ClientId:r.userPoolClientId,Session:e,ClientMetadata:s})}async function FK(t,e,n,r,s){const{userPoolId:o,userPoolClientId:a,userPoolEndpoint:u}=r,c={ANSWER:"PASSWORD",USERNAME:t,PASSWORD:e},f=Kn({username:t,userPoolId:o,userPoolClientId:a}),g=await ls({endpointResolver:St({endpointOverride:u})})({region:bt(o),userAgentValue:Mt(Ke.ConfirmSignIn)},{ChallengeName:"SELECT_CHALLENGE",ChallengeResponses:c,ClientId:a,ClientMetadata:n,Session:s,UserContextData:f}),m=g.ChallengeParameters?.USERNAME??t;return ou(m),g}async function zK(t,e,n,r,s,o){const{userPoolId:a,userPoolClientId:u,userPoolEndpoint:c}=r,f=a.split("_")[1]||"",h=await rp(f),g={ANSWER:"PASSWORD_SRP",USERNAME:t,SRP_A:h.A.toString(16)},m=Kn({username:t,userPoolId:a,userPoolClientId:u}),S=await ls({endpointResolver:St({endpointOverride:c})})({region:bt(a),userAgentValue:Mt(Ke.ConfirmSignIn)},{ChallengeName:"SELECT_CHALLENGE",ChallengeResponses:g,ClientId:u,ClientMetadata:n,Session:s,UserContextData:m}),E=S.ChallengeParameters?.USERNAME??t;return ou(E),S.ChallengeName==="PASSWORD_VERIFIER"?hd(JA,[e,S.ChallengeParameters,n,S.Session,h,r,o],E,o):S}const qx="userAttributes.";function jK(t){return"isSignedIn"in t&&"nextStep"in t}async function BK({challengeResponse:t,clientMetadata:e,session:n,username:r,config:s,tokenOrchestrator:o}){const{userPoolId:a,userPoolClientId:u,userPoolEndpoint:c}=s,f={USERNAME:r,ANSWER:t},h=await o?.getDeviceMetadata(r);h&&h.deviceKey&&(f.DEVICE_KEY=h.deviceKey);const g=Kn({username:r,userPoolId:a,userPoolClientId:u}),m={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:f,Session:n,ClientMetadata:e,ClientId:u,UserContextData:g},S=await ls({endpointResolver:St({endpointOverride:c})})({region:bt(a),userAgentValue:Mt(Ke.ConfirmSignIn)},m);return S.ChallengeName==="DEVICE_SRP_AUTH"?sp({username:r,config:s,clientMetadata:e,session:S.Session,tokenOrchestrator:o}):S}async function $K({challengeResponse:t,username:e,clientMetadata:n,session:r,deviceName:s,config:o}){const{userPoolId:a,userPoolClientId:u,userPoolEndpoint:c}=o;if(t==="EMAIL")return{ChallengeName:"MFA_SETUP",Session:r,ChallengeParameters:{MFAS_CAN_SETUP:'["EMAIL_OTP"]'},$metadata:{}};if(t==="TOTP")return{ChallengeName:"MFA_SETUP",Session:r,ChallengeParameters:{MFAS_CAN_SETUP:'["SOFTWARE_TOKEN_MFA"]'},$metadata:{}};const f={USERNAME:e};if(/^\d+$/.test(t)){const m=lG({endpointResolver:St({endpointOverride:c})}),{Session:y}=await m({region:bt(a),userAgentValue:Mt(Ke.ConfirmSignIn)},{UserCode:t,Session:r,FriendlyDeviceName:s});Io.dispatch({type:"SET_SIGN_IN_SESSION",value:y});const S={ChallengeName:"MFA_SETUP",ChallengeResponses:f,Session:y,ClientMetadata:n,ClientId:u};return ls({endpointResolver:St({endpointOverride:c})})({region:bt(a),userAgentValue:Mt(Ke.ConfirmSignIn)},S)}if(t.includes("@")){f.EMAIL=t;const m={ChallengeName:"MFA_SETUP",ChallengeResponses:f,Session:r,ClientMetadata:n,ClientId:u};return ls({endpointResolver:St({endpointOverride:c})})({region:bt(a),userAgentValue:Mt(Ke.ConfirmSignIn)},m)}throw new Ue({name:Ro.SignInException,message:`Cannot proceed with MFA setup using challengeResponse: ${t}`,recoverySuggestion:'Try passing "EMAIL", "TOTP", a valid email, or OTP code as the challengeResponse.'})}async function HK({challengeResponse:t,username:e,clientMetadata:n,session:r,config:s}){const{userPoolId:o,userPoolClientId:a,userPoolEndpoint:u}=s;fn(t==="TOTP"||t==="SMS"||t==="EMAIL",Ge.IncorrectMFAMethod);const c={USERNAME:e,ANSWER:JK(t)},f=Kn({username:e,userPoolId:o,userPoolClientId:a}),h={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:c,Session:r,ClientMetadata:n,ClientId:a,UserContextData:f};return ls({endpointResolver:St({endpointOverride:u})})({region:bt(o),userAgentValue:Mt(Ke.ConfirmSignIn)},h)}async function qK({challengeResponse:t,clientMetadata:e,session:n,username:r,requiredAttributes:s,config:o}){const{userPoolId:a,userPoolClientId:u,userPoolEndpoint:c}=o,f={...XK(s),NEW_PASSWORD:t,USERNAME:r},h=Kn({username:r,userPoolId:a,userPoolClientId:u}),g={ChallengeName:"NEW_PASSWORD_REQUIRED",ChallengeResponses:f,ClientMetadata:e,Session:n,ClientId:u,UserContextData:h};return ls({endpointResolver:St({endpointOverride:c})})({region:bt(a),userAgentValue:Mt(Ke.ConfirmSignIn)},g)}async function WK(t,e,n,r,s){const{userPoolClientId:o,userPoolId:a,userPoolEndpoint:u}=r,c={USERNAME:t,PASSWORD:e},f=await s.getDeviceMetadata(t);f&&f.deviceKey&&(c.DEVICE_KEY=f.deviceKey);const h=Kn({username:t,userPoolId:a,userPoolClientId:o}),g={AuthFlow:"USER_PASSWORD_AUTH",AuthParameters:c,ClientMetadata:n,ClientId:o,UserContextData:h},y=await np({endpointResolver:St({endpointOverride:u})})({region:bt(a),userAgentValue:Mt(Ke.SignIn)},g),S=y.ChallengeParameters?.USERNAME??y.ChallengeParameters?.USER_ID_FOR_SRP??t;return ou(S),y.ChallengeName==="DEVICE_SRP_AUTH"?sp({username:S,config:r,clientMetadata:n,session:y.Session,tokenOrchestrator:s}):y}async function VK(t,e,n,r,s){return a8({username:t,password:e,clientMetadata:n,config:r,tokenOrchestrator:s,authFlow:"USER_SRP_AUTH"})}async function GK(t,e,n,r){const{userPoolClientId:s,userPoolId:o,userPoolEndpoint:a}=n,u={USERNAME:t},c=await r.getDeviceMetadata(t);c&&c.deviceKey&&(u.DEVICE_KEY=c.deviceKey);const f=Kn({username:t,userPoolId:o,userPoolClientId:s}),h={AuthFlow:"CUSTOM_AUTH",AuthParameters:u,ClientMetadata:e,ClientId:s,UserContextData:f},m=await np({endpointResolver:St({endpointOverride:a})})({region:bt(o),userAgentValue:Mt(Ke.SignIn)},h),y=m.ChallengeParameters?.USERNAME??t;return ou(y),m.ChallengeName==="DEVICE_SRP_AUTH"?sp({username:y,config:n,clientMetadata:e,session:m.Session,tokenOrchestrator:r}):m}async function KK(t,e,n,r,s){lt(r);const{userPoolId:o,userPoolClientId:a,userPoolEndpoint:u}=r,c=o?.split("_")[1]||"",f=await rp(c),h={USERNAME:t,SRP_A:f.A.toString(16),CHALLENGE_NAME:"SRP_A"},g=Kn({username:t,userPoolId:o,userPoolClientId:a}),m={AuthFlow:"CUSTOM_AUTH",AuthParameters:h,ClientMetadata:n,ClientId:a,UserContextData:g},y=np({endpointResolver:St({endpointOverride:u})}),{ChallengeParameters:S,Session:E}=await y({region:bt(o),userAgentValue:Mt(Ke.SignIn)},m),C=S?.USERNAME??t;return ou(C),hd(JA,[e,S,n,E,f,r,s],C,s)}async function iu(t){const{challengeName:e,challengeParameters:n,availableChallenges:r}=t,s=Ht.getConfig().Auth?.Cognito;switch(lt(s),e){case"CUSTOM_CHALLENGE":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_CUSTOM_CHALLENGE",additionalInfo:n}};case"MFA_SETUP":{const{signInSession:o,username:a}=Io.getState(),u=GM(KM(n.MFAS_CAN_SETUP))||[],c=tY(u),f=c.includes("TOTP"),h=c.includes("EMAIL");if(f&&h)return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION",allowedMFATypes:c}};if(h)return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_EMAIL_SETUP"}};if(f){const g=uG({endpointResolver:St({endpointOverride:s.userPoolEndpoint})}),{Session:m,SecretCode:y}=await g({region:bt(s.userPoolId)},{Session:o});return Io.dispatch({type:"SET_SIGN_IN_SESSION",value:m}),{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_TOTP_SETUP",totpSetupDetails:YK(y,a)}}}throw new Ue({name:Ro.SignInException,message:`Cannot initiate MFA setup from available types: ${u}`})}case"NEW_PASSWORD_REQUIRED":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED",missingAttributes:ZK(n.requiredAttributes)}};case"SELECT_MFA_TYPE":return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_MFA_SELECTION",allowedMFATypes:GM(KM(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 o=await MK(n);return jK(o)?o:iu(o)}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:r}}}throw new Ue({name:Ro.SignInException,message:`An error occurred during the sign in process. ${e} challengeName returned by the underlying service was not addressed.`})}function YK(t,e){return{sharedSecret:t,getSetupUri:(n,r)=>{const s=`otpauth://totp/${n}:${r??e}?secret=${t}&issuer=${n}`;return new Ka(s)}}}function pd(t){if(t===Ev.PasswordResetRequiredException)return{isSignedIn:!1,nextStep:{signInStep:"RESET_PASSWORD"}};if(t===Ev.UserNotConfirmedException)return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_UP"}}}function ZK(t){return t?JSON.parse(t).map(n=>n.includes(qx)?n.replace(qx,""):n):[]}function XK(t){if(!t)return{};const e={};return Object.entries(t).forEach(([n,r])=>{r&&(e[`${qx}${n}`]=r)}),e}async function QK(t,e,n,r,s,o,a,u){const c=u?.userAttributes,f=u?.friendlyDeviceName;switch(e){case"WEB_AUTHN":case"SELECT_CHALLENGE":return r==="PASSWORD_SRP"||r==="PASSWORD"?{ChallengeName:r,Session:n,$metadata:{}}:UK({username:t,session:n,selectedChallenge:r,config:s,clientMetadata:a});case"SELECT_MFA_TYPE":return HK({challengeResponse:r,clientMetadata:a,session:n,username:t,config:s});case"MFA_SETUP":return $K({challengeResponse:r,clientMetadata:a,session:n,username:t,deviceName:f,config:s});case"NEW_PASSWORD_REQUIRED":return qK({challengeResponse:r,clientMetadata:a,session:n,username:t,requiredAttributes:c,config:s});case"CUSTOM_CHALLENGE":return hd(BK,[{challengeResponse:r,clientMetadata:a,session:n,username:t,config:s,tokenOrchestrator:o}],t,o);case"SMS_MFA":case"SOFTWARE_TOKEN_MFA":case"SMS_OTP":case"EMAIL_OTP":return nY({challengeName:e,challengeResponse:r,clientMetadata:a,session:n,username:t,config:s,tokenOrchestrator:o});case"PASSWORD":return FK(t,r,a,s,n);case"PASSWORD_SRP":return zK(t,r,a,s,n,o)}throw new Ue({name:Ro.SignInException,message:`An error occurred during the sign in process.
|
|
@@ -145,7 +145,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
145
145
|
.ptr__loader {
|
|
146
146
|
margin: 0 auto;
|
|
147
147
|
text-align: center;
|
|
148
|
-
}`;O9(cte);var MRe=function(t){var e=t.isPullable,n=e===void 0?!0:e,r=t.canFetchMore,s=r===void 0?!1:r,o=t.onRefresh,a=t.onFetchMore,u=t.refreshingContent,c=u===void 0?j.createElement(lte,null):u,f=t.pullingContent,h=f===void 0?j.createElement(ute,null):f,g=t.children,m=t.pullDownThreshold,y=m===void 0?67:m,S=t.fetchMoreThreshold,E=S===void 0?100:S,C=t.maxPullDownDistance,w=C===void 0?95:C,T=t.resistance,x=T===void 0?1:T,R=t.backgroundColor,M=t.className,N=M===void 0?"":M,O=_.useRef(null),k=_.useRef(null),F=_.useRef(null),H=_.useRef(null),D=!1,z=!1,q=!1,K=0,ee=0;_.useEffect(function(){if(!(!n||!k||!k.current)){var G=k.current;return G.addEventListener("touchstart",fe,{passive:!0}),G.addEventListener("mousedown",fe),G.addEventListener("touchmove",ae,{passive:!1}),G.addEventListener("mousemove",ae),window.addEventListener("scroll",xe),G.addEventListener("touchend",L),G.addEventListener("mouseup",L),document.body.addEventListener("mouseleave",L),function(){G.removeEventListener("touchstart",fe),G.removeEventListener("mousedown",fe),G.removeEventListener("touchmove",ae),G.removeEventListener("mousemove",ae),window.removeEventListener("scroll",xe),G.removeEventListener("touchend",L),G.removeEventListener("mouseup",L),document.body.removeEventListener("mouseleave",L)}}},[g,n,o,y,w,s,E]),_.useEffect(function(){var G;if(!((G=O)===null||G===void 0)&&G.current){var Y=O.current.classList.contains("ptr--fetch-more-treshold-breached");Y||s&&$()<E&&a&&(O.current.classList.add("ptr--fetch-more-treshold-breached"),z=!0,a().then(te).catch(te))}},[s,g]);var $=function(){if(!k||!k.current)return-1;var G=window.scrollY,Y=k.current.scrollHeight;return Y-G-window.innerHeight},te=function(){requestAnimationFrame(function(){k.current&&(k.current.style.overflowX="hidden",k.current.style.overflowY="auto",k.current.style.transform="unset"),F.current&&(F.current.style.opacity="0"),O.current&&(O.current.classList.remove("ptr--pull-down-treshold-breached"),O.current.classList.remove("ptr--dragging"),O.current.classList.remove("ptr--fetch-more-treshold-breached")),D&&(D=!1),z&&(z=!1)})},fe=function(G){q=!1,G instanceof MouseEvent&&(K=G.pageY),window.TouchEvent&&G instanceof TouchEvent&&(K=G.touches[0].pageY),ee=K,!(G.type==="touchstart"&&I9(G.target,Th.UP))&&(k.current.getBoundingClientRect().top<0||(q=!0))},ae=function(G){if(q){if(window.TouchEvent&&G instanceof TouchEvent?ee=G.touches[0].pageY:ee=G.pageY,O.current.classList.add("ptr--dragging"),ee<K){q=!1;return}G.cancelable&&G.preventDefault();var Y=Math.min((ee-K)/x,w);Y>=y&&(q=!0,D=!0,O.current.classList.remove("ptr--dragging"),O.current.classList.add("ptr--pull-down-treshold-breached")),!(Y>=w)&&(F.current.style.opacity=(Y/65).toString(),k.current.style.overflow="visible",k.current.style.transform="translate(0px, "+Y+"px)",F.current.style.visibility="visible")}},xe=function(G){z||s&&$()<E&&a&&(z=!0,O.current.classList.add("ptr--fetch-more-treshold-breached"),a().then(te).catch(te))},L=function(){if(q=!1,K=0,ee=0,!D){F.current&&(F.current.style.visibility="hidden"),te();return}k.current&&(k.current.style.overflow="visible",k.current.style.transform="translate(0px, "+y+"px)"),o().then(te).catch(te)};return j.createElement("div",{className:"ptr "+N,style:{backgroundColor:R},ref:O},j.createElement("div",{className:"ptr__pull-down",ref:F},j.createElement("div",{className:"ptr__loader ptr__pull-down--loading"},c),j.createElement("div",{className:"ptr__pull-down--pull-more"},h)),j.createElement("div",{className:"ptr__children",ref:k},g,j.createElement("div",{className:"ptr__fetch-more",ref:H},j.createElement("div",{className:"ptr__loader ptr__fetch-more--loading"},c))))};const dte={preparing:"Getting the new version ready",restarting:"Restarting Remit",reconnecting:"Waiting for Remit to answer again"};function n3(t){return dte[t]}function fte(t){return t<90?"This usually takes about a minute.":t<240?"Longer than usual. Remit is still trying to reach the server.":"Still no answer. Remit keeps trying."}function PRe(t,e=Date.now()){const n=Math.floor((e-t)/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function kRe(t){return new Date(t).toLocaleDateString(void 0,{dateStyle:"medium"})}function hte({children:t,show:e,label:n="Update available"}){return I.jsxs("span",{className:"relative inline-flex",children:[t,e&&I.jsxs(I.Fragment,{children:[I.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-accent-2"}),I.jsx("span",{className:"sr-only",children:n})]})]})}const r3=["preparing","restarting","reconnecting"],pte='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function N9(t){_.useEffect(()=>{const e=t.current;if(!e)return;const n=()=>Array.from(e.querySelectorAll(pte));(n()[0]??e).focus();const r=s=>{if(s.key!=="Tab")return;const o=n();if(o.length===0){s.preventDefault(),e.focus();return}const a=o[0],u=o[o.length-1],c=document.activeElement;if(s.shiftKey&&(c===a||!e.contains(c))){s.preventDefault(),u.focus();return}!s.shiftKey&&(c===u||!e.contains(c))&&(s.preventDefault(),a.focus())};return window.addEventListener("keydown",r,!0),()=>window.removeEventListener("keydown",r,!0)},[t])}const M9="fixed inset-0 z-50 flex flex-col items-center justify-center gap-6 bg-canvas p-6 text-center outline-none";function gte({target:t,phase:e,elapsedSeconds:n}){const r=_.useRef(null);N9(r);const s=r3.indexOf(e);return I.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"self-update-progress-title",tabIndex:-1,className:M9,children:[I.jsxs("div",{className:"max-w-md space-y-2",children:[I.jsxs("h1",{id:"self-update-progress-title",className:"text-lg font-semibold text-fg",children:["Installing Remit ",t]}),I.jsx("p",{className:"text-sm text-fg-muted",children:"Remit is restarting, so this page has no server to talk to for a moment. Leave this open — it reconnects on its own."})]}),I.jsx("ol",{className:"w-full max-w-sm space-y-2 text-left",children:r3.map((o,a)=>{const u=a<s,c=a===s;return I.jsxs("li",{className:yt("flex items-center gap-3 rounded-sm border px-row-inset py-2 text-sm",c?"border-line-strong bg-surface text-fg":"border-line bg-surface-sunken text-fg-subtle"),children:[u?I.jsx(uQ,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}):c?I.jsx(Jx,{className:"size-4 shrink-0 animate-spin text-accent-2","aria-hidden":!0}):I.jsx("span",{className:"size-4 shrink-0 rounded-full border border-line-strong"}),n3(o)]},o)})}),I.jsxs("p",{"aria-live":"polite",className:"max-w-md text-xs text-fg-subtle",children:[I.jsx("span",{className:"sr-only",children:`${n3(e)}. `}),fte(n)]})]})}function mte({attemptedVersion:t,previousVersion:e,elapsedSeconds:n,logsCommand:r,onRetryConnection:s}){const o=_.useRef(null);N9(o);const a=Math.max(1,Math.round(n/60));return I.jsxs("div",{ref:o,role:"alertdialog","aria-modal":"true","aria-labelledby":"self-update-unreachable-title",tabIndex:-1,className:M9,children:[I.jsx(iT,{className:"size-12 shrink-0 text-danger","aria-hidden":!0}),I.jsxs("div",{className:"max-w-lg space-y-3",children:[I.jsx("h1",{id:"self-update-unreachable-title",className:"text-lg font-semibold text-fg",children:"Remit has not answered since the restart"}),I.jsxs("p",{className:"text-sm text-fg-muted",children:["Installing ",t," started ",a," minute",a===1?"":"s"," ago and the server has been silent since. Your mail is safe at your provider — it was never part of the update."]}),I.jsxs("p",{className:"text-sm text-fg-muted",children:["Remit rolls back to ",e," on its own when the new version fails to start, but this page cannot confirm that from here. Check the server directly:"]}),I.jsx("code",{className:"block rounded-xs bg-surface-sunken px-3 py-2 text-left text-xs text-fg-muted",children:r})]}),I.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:I.jsx(as,{size:"sm",onClick:s,children:"Try connecting again"})})]})}const vte=()=>I.jsxs("div",{className:"hidden h-full w-[17%] min-w-40 max-w-64 shrink-0 flex-col gap-1 border-r border-line p-3 md:flex",children:[I.jsx("div",{className:"mb-3 h-6 w-24 rounded bg-surface-sunken"}),Array.from({length:6}).map((t,e)=>I.jsxs("div",{className:"flex items-center gap-2 py-1.5",children:[I.jsx("div",{className:"size-5 shrink-0 rounded bg-surface-sunken"}),I.jsx("div",{className:"h-3.5 flex-1 rounded bg-surface-sunken"})]},e))]}),yte=()=>I.jsx("div",{className:"min-w-0 flex-1",children:Array.from({length:8}).map((t,e)=>I.jsxs("div",{className:"flex items-start gap-3 border-b border-line py-2 pl-5 pr-4",children:[I.jsx("div",{className:"mt-0.5 size-7 shrink-0 rounded-full bg-surface-sunken"}),I.jsxs("div",{className:"flex-1 space-y-1.5",children:[I.jsxs("div",{className:"flex justify-between gap-2",children:[I.jsx("div",{className:"h-3.5 w-28 rounded bg-surface-sunken"}),I.jsx("div",{className:"h-3 w-12 rounded bg-surface-sunken"})]}),I.jsx("div",{className:"h-3.5 w-48 rounded bg-surface-sunken"}),I.jsx("div",{className:"h-3 w-full rounded bg-surface-sunken"})]})]},e))}),hT=()=>I.jsxs("div",{className:"flex h-dvh animate-pulse bg-canvas","aria-hidden":"true",children:[I.jsx(vte,{}),I.jsx(yte,{})]}),pT="4717719f778e86daaa31977867d2d6d96855d77f",bte="2026-07-27T10:56:35.595Z",Ste=pT.slice(0,7),Ete=/^[0-9a-f]{40}$/.test(pT),Cte=Ete?`https://github.com/remit-mail/reader/commit/${pT}`:void 0,wte="https://github.com/remit-mail/reader/issues/new";class i_ extends Error{constructor(e,n,r){super(e),this.status=n,this.body=r,this.name="ApiError"}status;body}const au=t=>{if(t instanceof i_)return t.status;if(t&&typeof t=="object"){const e=t;if(typeof e.status=="number")return e.status;if(typeof e.statusCode=="number")return e.statusCode}},P9=t=>au(t)!==void 0,$y=t=>{const e=au(t);return e!==void 0&&e>=500&&e<=599},Hy=t=>!!(typeof DOMException<"u"&&t instanceof DOMException&&t.name==="AbortError"||t&&typeof t=="object"&&"name"in t&&t.name==="AbortError"),xte=()=>typeof navigator<"u"&&navigator.onLine===!1,k9=t=>Hy(t)||P9(t)?!1:t instanceof sT?!0:xte(),_te=t=>!P9(t)&&!Hy(t)&&!k9(t),D9=t=>$y(t)||_te(t),Ate=t=>t?.softError===!0,L9=(t,e)=>$y(t)?!0:Hy(t)||k9(t)?!1:D9(t)?!0:!Ate(e),Tte=t=>$y(t),a_=new Set;let U9=null,F9=null;const Rte=t=>{F9=t},Ite=t=>t instanceof Error?t:new Error(z9(t)),z9=t=>t instanceof Error?t.message||t.name:typeof t=="string"?t:t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:"An unexpected server error occurred.",Ote=()=>typeof globalThis.crypto<"u"&&typeof globalThis.crypto.randomUUID=="function"?globalThis.crypto.randomUUID():`fatal-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,ql=(t,e)=>{const n={error:t,message:z9(t),correlationId:Ote(),at:Date.now(),recoverable:e?.recoverable??Tte(t),stack:t instanceof Error?t.stack:void 0,componentStack:e?.componentStack};U9=n,Lte(`Fatal: ${n.message} [${n.correlationId}]`),F9?.recordError(Ite(t),{fatal:"true",correlationId:n.correlationId});for(const r of a_)r(n);return n},Nte=t=>(a_.add(t),()=>{a_.delete(t)}),Mte=()=>U9,Pte=20,tv=[],kte=new Set(["ResizeObserver loop limit exceeded","ResizeObserver loop completed with undelivered notifications"]);function Dte(t){return typeof t!="string"?!1:kte.has(t.replace(/\.\s*$/,""))}function nv(t){tv.push(t),tv.length>Pte&&tv.shift()}function Lte(t){nv(t)}function Ute(t){return t.map(e=>{if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}).join(" ")}function Fte(){const t=console.error.bind(console);console.error=(...e)=>{nv(Ute(e)),t(...e)},window.addEventListener("error",e=>{Dte(e.message)||(nv(`Uncaught ${e.error instanceof Error?`${e.error.name}: ${e.error.message}`:String(e.message)} (${e.filename}:${e.lineno})`),ql(e.error??e.message))}),window.addEventListener("unhandledrejection",e=>{const n=e.reason,r=n instanceof Error?`${n.name}: ${n.message}`:String(n);nv(`Unhandled rejection: ${r}`),ql(n)})}function zte(){return tv.slice()}const jte=8,yc=[];function Bte(t){const e=t.split(/[?#]/)[0],n=yc[yc.length-1];n&&n.path===e||(yc.push({path:e,timestamp:new Date().toISOString()}),yc.length>jte&&yc.shift())}function $te(){return yc.slice()}const vS=7500,s3=`
|
|
148
|
+
}`;O9(cte);var MRe=function(t){var e=t.isPullable,n=e===void 0?!0:e,r=t.canFetchMore,s=r===void 0?!1:r,o=t.onRefresh,a=t.onFetchMore,u=t.refreshingContent,c=u===void 0?j.createElement(lte,null):u,f=t.pullingContent,h=f===void 0?j.createElement(ute,null):f,g=t.children,m=t.pullDownThreshold,y=m===void 0?67:m,S=t.fetchMoreThreshold,E=S===void 0?100:S,C=t.maxPullDownDistance,w=C===void 0?95:C,T=t.resistance,x=T===void 0?1:T,R=t.backgroundColor,M=t.className,N=M===void 0?"":M,O=_.useRef(null),k=_.useRef(null),F=_.useRef(null),H=_.useRef(null),D=!1,z=!1,q=!1,K=0,ee=0;_.useEffect(function(){if(!(!n||!k||!k.current)){var G=k.current;return G.addEventListener("touchstart",fe,{passive:!0}),G.addEventListener("mousedown",fe),G.addEventListener("touchmove",ae,{passive:!1}),G.addEventListener("mousemove",ae),window.addEventListener("scroll",xe),G.addEventListener("touchend",L),G.addEventListener("mouseup",L),document.body.addEventListener("mouseleave",L),function(){G.removeEventListener("touchstart",fe),G.removeEventListener("mousedown",fe),G.removeEventListener("touchmove",ae),G.removeEventListener("mousemove",ae),window.removeEventListener("scroll",xe),G.removeEventListener("touchend",L),G.removeEventListener("mouseup",L),document.body.removeEventListener("mouseleave",L)}}},[g,n,o,y,w,s,E]),_.useEffect(function(){var G;if(!((G=O)===null||G===void 0)&&G.current){var Y=O.current.classList.contains("ptr--fetch-more-treshold-breached");Y||s&&$()<E&&a&&(O.current.classList.add("ptr--fetch-more-treshold-breached"),z=!0,a().then(te).catch(te))}},[s,g]);var $=function(){if(!k||!k.current)return-1;var G=window.scrollY,Y=k.current.scrollHeight;return Y-G-window.innerHeight},te=function(){requestAnimationFrame(function(){k.current&&(k.current.style.overflowX="hidden",k.current.style.overflowY="auto",k.current.style.transform="unset"),F.current&&(F.current.style.opacity="0"),O.current&&(O.current.classList.remove("ptr--pull-down-treshold-breached"),O.current.classList.remove("ptr--dragging"),O.current.classList.remove("ptr--fetch-more-treshold-breached")),D&&(D=!1),z&&(z=!1)})},fe=function(G){q=!1,G instanceof MouseEvent&&(K=G.pageY),window.TouchEvent&&G instanceof TouchEvent&&(K=G.touches[0].pageY),ee=K,!(G.type==="touchstart"&&I9(G.target,Th.UP))&&(k.current.getBoundingClientRect().top<0||(q=!0))},ae=function(G){if(q){if(window.TouchEvent&&G instanceof TouchEvent?ee=G.touches[0].pageY:ee=G.pageY,O.current.classList.add("ptr--dragging"),ee<K){q=!1;return}G.cancelable&&G.preventDefault();var Y=Math.min((ee-K)/x,w);Y>=y&&(q=!0,D=!0,O.current.classList.remove("ptr--dragging"),O.current.classList.add("ptr--pull-down-treshold-breached")),!(Y>=w)&&(F.current.style.opacity=(Y/65).toString(),k.current.style.overflow="visible",k.current.style.transform="translate(0px, "+Y+"px)",F.current.style.visibility="visible")}},xe=function(G){z||s&&$()<E&&a&&(z=!0,O.current.classList.add("ptr--fetch-more-treshold-breached"),a().then(te).catch(te))},L=function(){if(q=!1,K=0,ee=0,!D){F.current&&(F.current.style.visibility="hidden"),te();return}k.current&&(k.current.style.overflow="visible",k.current.style.transform="translate(0px, "+y+"px)"),o().then(te).catch(te)};return j.createElement("div",{className:"ptr "+N,style:{backgroundColor:R},ref:O},j.createElement("div",{className:"ptr__pull-down",ref:F},j.createElement("div",{className:"ptr__loader ptr__pull-down--loading"},c),j.createElement("div",{className:"ptr__pull-down--pull-more"},h)),j.createElement("div",{className:"ptr__children",ref:k},g,j.createElement("div",{className:"ptr__fetch-more",ref:H},j.createElement("div",{className:"ptr__loader ptr__fetch-more--loading"},c))))};const dte={preparing:"Getting the new version ready",restarting:"Restarting Remit",reconnecting:"Waiting for Remit to answer again"};function n3(t){return dte[t]}function fte(t){return t<90?"This usually takes about a minute.":t<240?"Longer than usual. Remit is still trying to reach the server.":"Still no answer. Remit keeps trying."}function PRe(t,e=Date.now()){const n=Math.floor((e-t)/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function kRe(t){return new Date(t).toLocaleDateString(void 0,{dateStyle:"medium"})}function hte({children:t,show:e,label:n="Update available"}){return I.jsxs("span",{className:"relative inline-flex",children:[t,e&&I.jsxs(I.Fragment,{children:[I.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-accent-2"}),I.jsx("span",{className:"sr-only",children:n})]})]})}const r3=["preparing","restarting","reconnecting"],pte='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function N9(t){_.useEffect(()=>{const e=t.current;if(!e)return;const n=()=>Array.from(e.querySelectorAll(pte));(n()[0]??e).focus();const r=s=>{if(s.key!=="Tab")return;const o=n();if(o.length===0){s.preventDefault(),e.focus();return}const a=o[0],u=o[o.length-1],c=document.activeElement;if(s.shiftKey&&(c===a||!e.contains(c))){s.preventDefault(),u.focus();return}!s.shiftKey&&(c===u||!e.contains(c))&&(s.preventDefault(),a.focus())};return window.addEventListener("keydown",r,!0),()=>window.removeEventListener("keydown",r,!0)},[t])}const M9="fixed inset-0 z-50 flex flex-col items-center justify-center gap-6 bg-canvas p-6 text-center outline-none";function gte({target:t,phase:e,elapsedSeconds:n}){const r=_.useRef(null);N9(r);const s=r3.indexOf(e);return I.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"self-update-progress-title",tabIndex:-1,className:M9,children:[I.jsxs("div",{className:"max-w-md space-y-2",children:[I.jsxs("h1",{id:"self-update-progress-title",className:"text-lg font-semibold text-fg",children:["Installing Remit ",t]}),I.jsx("p",{className:"text-sm text-fg-muted",children:"Remit is restarting, so this page has no server to talk to for a moment. Leave this open — it reconnects on its own."})]}),I.jsx("ol",{className:"w-full max-w-sm space-y-2 text-left",children:r3.map((o,a)=>{const u=a<s,c=a===s;return I.jsxs("li",{className:yt("flex items-center gap-3 rounded-sm border px-row-inset py-2 text-sm",c?"border-line-strong bg-surface text-fg":"border-line bg-surface-sunken text-fg-subtle"),children:[u?I.jsx(uQ,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}):c?I.jsx(Jx,{className:"size-4 shrink-0 animate-spin text-accent-2","aria-hidden":!0}):I.jsx("span",{className:"size-4 shrink-0 rounded-full border border-line-strong"}),n3(o)]},o)})}),I.jsxs("p",{"aria-live":"polite",className:"max-w-md text-xs text-fg-subtle",children:[I.jsx("span",{className:"sr-only",children:`${n3(e)}. `}),fte(n)]})]})}function mte({attemptedVersion:t,previousVersion:e,elapsedSeconds:n,logsCommand:r,onRetryConnection:s}){const o=_.useRef(null);N9(o);const a=Math.max(1,Math.round(n/60));return I.jsxs("div",{ref:o,role:"alertdialog","aria-modal":"true","aria-labelledby":"self-update-unreachable-title",tabIndex:-1,className:M9,children:[I.jsx(iT,{className:"size-12 shrink-0 text-danger","aria-hidden":!0}),I.jsxs("div",{className:"max-w-lg space-y-3",children:[I.jsx("h1",{id:"self-update-unreachable-title",className:"text-lg font-semibold text-fg",children:"Remit has not answered since the restart"}),I.jsxs("p",{className:"text-sm text-fg-muted",children:["Installing ",t," started ",a," minute",a===1?"":"s"," ago and the server has been silent since. Your mail is safe at your provider — it was never part of the update."]}),I.jsxs("p",{className:"text-sm text-fg-muted",children:["Remit rolls back to ",e," on its own when the new version fails to start, but this page cannot confirm that from here. Check the server directly:"]}),I.jsx("code",{className:"block rounded-xs bg-surface-sunken px-3 py-2 text-left text-xs text-fg-muted",children:r})]}),I.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:I.jsx(as,{size:"sm",onClick:s,children:"Try connecting again"})})]})}const vte=()=>I.jsxs("div",{className:"hidden h-full w-[17%] min-w-40 max-w-64 shrink-0 flex-col gap-1 border-r border-line p-3 md:flex",children:[I.jsx("div",{className:"mb-3 h-6 w-24 rounded bg-surface-sunken"}),Array.from({length:6}).map((t,e)=>I.jsxs("div",{className:"flex items-center gap-2 py-1.5",children:[I.jsx("div",{className:"size-5 shrink-0 rounded bg-surface-sunken"}),I.jsx("div",{className:"h-3.5 flex-1 rounded bg-surface-sunken"})]},e))]}),yte=()=>I.jsx("div",{className:"min-w-0 flex-1",children:Array.from({length:8}).map((t,e)=>I.jsxs("div",{className:"flex items-start gap-3 border-b border-line py-2 pl-5 pr-4",children:[I.jsx("div",{className:"mt-0.5 size-7 shrink-0 rounded-full bg-surface-sunken"}),I.jsxs("div",{className:"flex-1 space-y-1.5",children:[I.jsxs("div",{className:"flex justify-between gap-2",children:[I.jsx("div",{className:"h-3.5 w-28 rounded bg-surface-sunken"}),I.jsx("div",{className:"h-3 w-12 rounded bg-surface-sunken"})]}),I.jsx("div",{className:"h-3.5 w-48 rounded bg-surface-sunken"}),I.jsx("div",{className:"h-3 w-full rounded bg-surface-sunken"})]})]},e))}),hT=()=>I.jsxs("div",{className:"flex h-dvh animate-pulse bg-canvas","aria-hidden":"true",children:[I.jsx(vte,{}),I.jsx(yte,{})]}),pT="23cd60a86147e82579a1f29926c078ebea5f14ad",bte="2026-07-27T11:33:52.454Z",Ste=pT.slice(0,7),Ete=/^[0-9a-f]{40}$/.test(pT),Cte=Ete?`https://github.com/remit-mail/reader/commit/${pT}`:void 0,wte="https://github.com/remit-mail/reader/issues/new";class i_ extends Error{constructor(e,n,r){super(e),this.status=n,this.body=r,this.name="ApiError"}status;body}const au=t=>{if(t instanceof i_)return t.status;if(t&&typeof t=="object"){const e=t;if(typeof e.status=="number")return e.status;if(typeof e.statusCode=="number")return e.statusCode}},P9=t=>au(t)!==void 0,$y=t=>{const e=au(t);return e!==void 0&&e>=500&&e<=599},Hy=t=>!!(typeof DOMException<"u"&&t instanceof DOMException&&t.name==="AbortError"||t&&typeof t=="object"&&"name"in t&&t.name==="AbortError"),xte=()=>typeof navigator<"u"&&navigator.onLine===!1,k9=t=>Hy(t)||P9(t)?!1:t instanceof sT?!0:xte(),_te=t=>!P9(t)&&!Hy(t)&&!k9(t),D9=t=>$y(t)||_te(t),Ate=t=>t?.softError===!0,L9=(t,e)=>$y(t)?!0:Hy(t)||k9(t)?!1:D9(t)?!0:!Ate(e),Tte=t=>$y(t),a_=new Set;let U9=null,F9=null;const Rte=t=>{F9=t},Ite=t=>t instanceof Error?t:new Error(z9(t)),z9=t=>t instanceof Error?t.message||t.name:typeof t=="string"?t:t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:"An unexpected server error occurred.",Ote=()=>typeof globalThis.crypto<"u"&&typeof globalThis.crypto.randomUUID=="function"?globalThis.crypto.randomUUID():`fatal-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,ql=(t,e)=>{const n={error:t,message:z9(t),correlationId:Ote(),at:Date.now(),recoverable:e?.recoverable??Tte(t),stack:t instanceof Error?t.stack:void 0,componentStack:e?.componentStack};U9=n,Lte(`Fatal: ${n.message} [${n.correlationId}]`),F9?.recordError(Ite(t),{fatal:"true",correlationId:n.correlationId});for(const r of a_)r(n);return n},Nte=t=>(a_.add(t),()=>{a_.delete(t)}),Mte=()=>U9,Pte=20,tv=[],kte=new Set(["ResizeObserver loop limit exceeded","ResizeObserver loop completed with undelivered notifications"]);function Dte(t){return typeof t!="string"?!1:kte.has(t.replace(/\.\s*$/,""))}function nv(t){tv.push(t),tv.length>Pte&&tv.shift()}function Lte(t){nv(t)}function Ute(t){return t.map(e=>{if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}).join(" ")}function Fte(){const t=console.error.bind(console);console.error=(...e)=>{nv(Ute(e)),t(...e)},window.addEventListener("error",e=>{Dte(e.message)||(nv(`Uncaught ${e.error instanceof Error?`${e.error.name}: ${e.error.message}`:String(e.message)} (${e.filename}:${e.lineno})`),ql(e.error??e.message))}),window.addEventListener("unhandledrejection",e=>{const n=e.reason,r=n instanceof Error?`${n.name}: ${n.message}`:String(n);nv(`Unhandled rejection: ${r}`),ql(n)})}function zte(){return tv.slice()}const jte=8,yc=[];function Bte(t){const e=t.split(/[?#]/)[0],n=yc[yc.length-1];n&&n.path===e||(yc.push({path:e,timestamp:new Date().toISOString()}),yc.length>jte&&yc.shift())}function $te(){return yc.slice()}const vS=7500,s3=`
|
|
149
149
|
… (truncated — the copy action on this screen has the full report)`;function o3(t){return{appShortSha:Ste,appCommitUrl:Cte,appBuildTime:bte,userAgent:navigator.userAgent,viewport:`${window.innerWidth}×${window.innerHeight}`,timestamp:new Date().toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,href:window.location.href,recentErrors:zte(),requests:jX(),routes:$te(),failingRequest:BX(),errorMessage:t?.errorMessage,stack:t?.stack,componentStack:t?.componentStack,quarantine:t?.quarantine,title:t?.title}}function yS(t){return["```",t,"```"].join(`
|
|
150
150
|
`)}function j9(t){const e=/T(\d{2}:\d{2}:\d{2})/.exec(t);return e?e[1]:t}function Hte(t){return`- **Version**: ${t.appCommitUrl?`[\`${t.appShortSha}\`](${t.appCommitUrl})`:`\`${t.appShortSha}\``} built ${t.appBuildTime}`}function qte(t){const e=t.status===0?"no response (transport failure)":`${t.status}`;return["## Failing request",`- **Endpoint**: \`${t.path}\``,`- **Method**: ${t.method}`,`- **Status**: ${e}`,`- **Correlation id**: ${t.correlationId??"(none)"}`,""]}function Wte(t){return t.length===0?["## Recent API requests","(none)",""]:["## Recent API requests","| Time | Method | Path | Status | Duration | Correlation |","| --- | --- | --- | --- | --- | --- |",...t.map(n=>{const r=n.status===0?"ERR":`${n.status}`;return`| ${j9(n.timestamp)} | ${n.method} | \`${n.path}\` | ${r} | ${n.durationMs}ms | ${n.correlationId??""} |`}),""]}function Vte(t){return t.length===0?["## Navigation trail","(none)",""]:["## Navigation trail",...t.map(n=>`- ${j9(n.timestamp)} \`${n.path}\``),""]}function B9(t,e){const n=t.recentErrors.length>0?t.recentErrors.map(o=>` - ${o}`).join(`
|
|
151
151
|
`):" (none)",r=["## Environment",Hte(t),`- **Browser**: ${t.userAgent}`,`- **Viewport**: ${t.viewport}`,`- **Time**: ${t.timestamp} (${t.timezone})`,"","## URL",t.href,""];if(t.errorMessage&&r.push("## Error",t.errorMessage,""),t.failingRequest&&r.push(...qte(t.failingRequest)),t.quarantine){const o=e?.quarantineStructure??t.quarantine.structure;r.push(t.quarantine.head,"",yS(o),"",t.quarantine.disclaimer,"")}const s=e?.stack??t.stack;return s&&r.push("## Stacktrace",yS(s),""),t.componentStack&&r.push("## Component stack",yS(t.componentStack),""),r.push(...Wte(t.requests)),r.push(...Vte(t.routes)),r.push("## Recent console errors",n,"","## Steps to reproduce","1. ","","## Expected behaviour","","## Actual behaviour",""),r.join(`
|
|
@@ -213,7 +213,7 @@ Make sure your charset is UTF-8`);o=(o>>>8&255)*192+(o&255),r.put(o,13)}},Bw=n,B
|
|
|
213
213
|
The chosen QR Code version cannot contain this amount of data.
|
|
214
214
|
Minimum version required to store current data is: `+D+`.
|
|
215
215
|
`);const z=x(O,k,H),q=t.getSymbolSize(O),K=new r(q);return y(K,O),S(K),E(K,O),w(K,k,0),O>=7&&C(K,O),T(K,z),isNaN(F)&&(F=a.getBestMask(K,w.bind(null,K,k))),a.applyMask(F,K),w(K,k,F),{modules:K,version:O,errorCorrectionLevel:k,maskPattern:F,segments:H}}return ww.create=function(O,k){if(typeof O>"u"||O==="")throw new Error("No input text");let F=e.M,H,D;return typeof k<"u"&&(F=e.from(k.errorCorrectionLevel,e.M),H=f.from(k.version),D=a.from(k.maskPattern),k.toSJISFunc&&t.setToSJISFunction(k.toSJISFunc)),M(O,H,F,D)},ww}var Hw={},qw={},JL;function b7(){return JL||(JL=1,(function(t){function e(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(o){return[o,o]}))),r.length===6&&r.push("F","F");const s=parseInt(r.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+r.slice(0,6).join("")}}t.getOptions=function(r){r||(r={}),r.color||(r.color={});const s=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,o=r.width&&r.width>=21?r.width:void 0,a=r.scale||4;return{width:o,scale:o?4:a,margin:s,color:{dark:e(r.color.dark||"#000000ff"),light:e(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},t.getScale=function(r,s){return s.width&&s.width>=r+s.margin*2?s.width/(r+s.margin*2):s.scale},t.getImageWidth=function(r,s){const o=t.getScale(r,s);return Math.floor((r+s.margin*2)*o)},t.qrToImageData=function(r,s,o){const a=s.modules.size,u=s.modules.data,c=t.getScale(a,o),f=Math.floor((a+o.margin*2)*c),h=o.margin*c,g=[o.color.light,o.color.dark];for(let m=0;m<f;m++)for(let y=0;y<f;y++){let S=(m*f+y)*4,E=o.color.light;if(m>=h&&y>=h&&m<f-h&&y<f-h){const C=Math.floor((m-h)/c),w=Math.floor((y-h)/c);E=g[u[C*a+w]?1:0]}r[S++]=E.r,r[S++]=E.g,r[S++]=E.b,r[S]=E.a}}})(qw)),qw}var eU;function Vde(){return eU||(eU=1,(function(t){const e=b7();function n(s,o,a){s.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=a,o.width=a,o.style.height=a+"px",o.style.width=a+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(o,a,u){let c=u,f=a;typeof c>"u"&&(!a||!a.getContext)&&(c=a,a=void 0),a||(f=r()),c=e.getOptions(c);const h=e.getImageWidth(o.modules.size,c),g=f.getContext("2d"),m=g.createImageData(h,h);return e.qrToImageData(m.data,o,c),n(g,f,h),g.putImageData(m,0,0),f},t.renderToDataURL=function(o,a,u){let c=u;typeof c>"u"&&(!a||!a.getContext)&&(c=a,a=void 0),c||(c={});const f=t.render(o,a,c),h=c.type||"image/png",g=c.rendererOpts||{};return f.toDataURL(h,g.quality)}})(Hw)),Hw}var Ww={},tU;function Gde(){if(tU)return Ww;tU=1;const t=b7();function e(s,o){const a=s.a/255,u=o+'="'+s.hex+'"';return a<1?u+" "+o+'-opacity="'+a.toFixed(2).slice(1)+'"':u}function n(s,o,a){let u=s+o;return typeof a<"u"&&(u+=" "+a),u}function r(s,o,a){let u="",c=0,f=!1,h=0;for(let g=0;g<s.length;g++){const m=Math.floor(g%o),y=Math.floor(g/o);!m&&!f&&(f=!0),s[g]?(h++,g>0&&m>0&&s[g-1]||(u+=f?n("M",m+a,.5+y+a):n("m",c,0),c=0,f=!1),m+1<o&&s[g+1]||(u+=n("h",h),h=0)):c++}return u}return Ww.render=function(o,a,u){const c=t.getOptions(a),f=o.modules.size,h=o.modules.data,g=f+c.margin*2,m=c.color.light.a?"<path "+e(c.color.light,"fill")+' d="M0 0h'+g+"v"+g+'H0z"/>':"",y="<path "+e(c.color.dark,"stroke")+' d="'+r(h,f,c.margin)+'"/>',S='viewBox="0 0 '+g+" "+g+'"',C='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+S+' shape-rendering="crispEdges">'+m+y+`</svg>
|
|
216
|
-
`;return typeof u=="function"&&u(null,C),C},Ww}var nU;function Kde(){if(nU)return ac;nU=1;const t=Tde(),e=Wde(),n=Vde(),r=Gde();function s(o,a,u,c,f){const h=[].slice.call(arguments,1),g=h.length,m=typeof h[g-1]=="function";if(!m&&!t())throw new Error("Callback required as last argument");if(m){if(g<2)throw new Error("Too few arguments provided");g===2?(f=u,u=a,a=c=void 0):g===3&&(a.getContext&&typeof f>"u"?(f=c,c=void 0):(f=c,c=u,u=a,a=void 0))}else{if(g<1)throw new Error("Too few arguments provided");return g===1?(u=a,a=c=void 0):g===2&&!a.getContext&&(c=u,u=a,a=void 0),new Promise(function(y,S){try{const E=e.create(u,c);y(o(E,a,c))}catch(E){S(E)}})}try{const y=e.create(u,c);f(null,o(y,a,c))}catch(y){f(y)}}return ac.create=e.create,ac.toCanvas=s.bind(null,n.render),ac.toDataURL=s.bind(null,n.renderToDataURL),ac.toString=s.bind(null,function(o,a,u){return r.render(o,u)}),ac}var Yde=Kde();const Zde=Ga(Yde),Xde=t=>t==="signIn"||t==="signUp",cR=t=>!!t&&(t==="EMAIL_OTP"||t==="SMS_MFA"),{getConfirmText:Qde,getConfirmingText:Jde,getBackToSignInText:efe,getResendCodeText:tfe}=Ln,gb=()=>{const{isPending:t,toSignIn:e,challengeName:n,resendCode:r,selectedAuthMethod:s,availableAuthMethods:o}=Et(c=>[c.isPending,c.toSignIn,c.challengeName,c.resendCode,c.selectedAuthMethod,c.availableAuthMethods]),a=!!s&&s!=="PASSWORD"||!!o?.some(c=>c!=="PASSWORD"),u=cR(n)&&a&&r;return j.createElement(ze,{direction:"column"},j.createElement(en,{isDisabled:t,type:"submit",variation:"primary",isLoading:t,loadingText:Jde()},Qde()),u&&j.createElement(en,{onClick:r,type:"button"},tfe()),j.createElement(en,{onClick:e,type:"button",variation:"link",size:"small"},efe()))},nfe=new or("SetupTotp-logger"),{getSetupTotpText:rfe,getCopiedText:sfe,getLoadingText:ofe}=Ln,ja=({className:t,variation:e})=>{const{totpSecretCode:n,isPending:r,username:s,QRFields:o}=Et(R=>[R.isPending,R.totpSecretCode,R.username]),{handleChange:a,handleSubmit:u}=fs(),{components:{SetupTotp:{Header:c=ja.Header,Footer:f=ja.Footer}}}=ds(),[h,g]=_.useState(!0),[m,y]=_.useState(),[S,E]=_.useState("COPY"),{totpIssuer:C="AWSCognito",totpUsername:w=s}=o??{},T=_.useCallback(async()=>{try{const R=Yse(C,w,n),M=await Zde.toDataURL(R);y(M)}catch(R){nfe.error(R)}finally{g(!1)}},[C,w,n]);_.useEffect(()=>{m||T()},[T,m]);const x=()=>{navigator.clipboard.writeText(n),E(sfe())};return _.createElement(qr,{className:t,variation:e},_.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-setup-totp":"",method:"post",onChange:a,onSubmit:u},_.createElement(ze,{as:"fieldset",direction:"column",isDisabled:r},_.createElement(c,null),_.createElement(ze,{direction:"column"},h?_.createElement("p",null,ofe(),"…"):_.createElement("img",{"data-amplify-qrcode":!0,src:m,alt:"qr code",width:"228",height:"228"}),_.createElement(ze,{"data-amplify-copy":!0},_.createElement("div",null,n),_.createElement(ze,{"data-amplify-copy-svg":!0,onClick:x},_.createElement("div",{"data-amplify-copy-tooltip":!0},S),_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z"})))),_.createElement(Po,null),_.createElement(Vr,null)),_.createElement(gb,null),_.createElement(f,null))))};ja.Header=function(){return _.createElement(Ar,{level:3},rfe())};ja.Footer=function(){return null};const{getSubmitText:ife,getSubmittingText:afe}=Ln,mb=t=>{const{cancelButtonSendType:e,cancelButtonText:n,submitButtonText:r}=t,{isPending:s,resendCode:o,skipVerification:a,toSignIn:u}=Et(g=>[g.isPending]),c=()=>{switch(e){case"SKIP":a();break;case"RESEND":o();break;case"SIGN_IN":u();break;default:return}},f=s?j.createElement(j.Fragment,null,afe(),"…"):j.createElement(j.Fragment,null,ife()),h=r??f;return j.createElement(ze,{direction:"column"},j.createElement(en,{variation:"primary",isDisabled:s,type:"submit"},h),j.createElement(ze,{direction:"column",alignItems:"center"},j.createElement(en,{onClick:c,type:"button",variation:"link",size:"small"},n)))},lfe=()=>j.createElement("svg",{"aria-label":"Apple icon",className:"amplify-icon federated-sign-in-icon",fill:"#000",preserveAspectRatio:"xMidYMid",stroke:"#000",strokeWidth:"0",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},j.createElement("path",{d:"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z"})),ufe=()=>j.createElement("svg",{"aria-label":"Google icon",className:"amplify-icon federated-sign-in-icon",viewBox:"0 0 256 262",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},j.createElement("path",{d:"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027",fill:"#4285F4"}),j.createElement("path",{d:"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1",fill:"#34A853"}),j.createElement("path",{d:"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782",fill:"#FBBC05"}),j.createElement("path",{d:"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251",fill:"#EB4335"})),cfe=()=>j.createElement(JF,{className:"federated-sign-in-icon",ariaLabel:"Facebook icon",viewBox:{minX:0,minY:0,width:279,height:538},pathData:"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z",fill:"#1877F2"}),dfe=()=>j.createElement("svg",{"aria-label":"Amazon icon",className:"amplify-icon federated-sign-in-icon",viewBox:"0 0 243 264",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},j.createElement("path",{d:"M230.826 208.039C227.468 203.683 208.551 205.982 200.056 206.998C197.471 207.321 197.076 205.042 199.407 203.405C214.475 192.665 239.201 195.766 242.082 199.364C244.966 202.982 241.337 228.071 227.173 240.049C225.001 241.888 222.93 240.904 223.898 238.468C227.077 230.431 234.205 212.419 230.826 208.039ZM123.769 264C71.0234 264 39.0764 241.955 14.7853 217.542C9.97339 212.706 3.71799 206.296 0.311513 200.691C-1.09773 198.372 2.59096 195.022 5.04421 196.844C35.239 219.268 79.1012 239.538 122.53 239.538C151.82 239.538 188.046 227.47 217.669 214.868C222.147 212.966 222.147 219.18 221.512 221.061C221.183 222.032 206.515 236.221 186.247 247.047C167.304 257.166 143.397 264 123.769 264Z",fill:"#F2541B"}),j.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M142.943 111.185C142.943 124.756 143.268 136.054 136.406 148.123C130.856 157.913 122.027 163.95 112.222 163.95C98.8288 163.95 90.9806 153.772 90.9806 138.693C90.9806 109.036 117.677 103.647 142.943 103.647V111.185ZM178.166 196.081C175.858 198.15 171.635 198.22 169.914 196.894C157.974 187.684 149.89 173.688 149.89 173.688C130.706 193.156 117.127 199 92.2879 199C62.8772 199 40 180.905 40 144.729C40 116.461 55.3552 97.2408 77.2563 87.823C96.2094 79.5256 122.684 78.0173 142.943 75.7517C142.943 75.7517 144.633 53.933 138.699 45.9806C134.098 39.8163 126.272 36.9329 119.089 36.9329C106.127 36.8829 93.61 43.9051 91.1262 57.4188C90.4136 61.2829 87.5533 64.5261 84.54 64.206L51.0823 60.5922C48.5156 60.2951 45.0381 57.6639 45.8636 53.3081C53.644 12.3684 90.7373 0 123.989 0C140.983 0 163.21 4.51651 176.608 17.3349C193.597 33.1648 191.969 54.2755 191.969 77.2722V131.51C191.969 147.835 198.768 154.987 205.151 163.775C207.376 166.953 207.886 170.714 205.04 173.032C197.902 178.999 178.166 196.081 178.166 196.081Z",fill:"#F2541B"})),sm=t=>{const{icon:e,provider:n,text:r}=t,{toFederatedSignIn:s}=Et(),o=u=>{u.preventDefault(),s({provider:n})};let a;return e==="facebook"?a=j.createElement(cfe,null):e==="google"?a=j.createElement(ufe,null):e==="amazon"?a=j.createElement(dfe,null):e==="apple"&&(a=j.createElement(lfe,null)),j.createElement(en,{onClick:o,className:"federated-sign-in-button",gap:"1rem"},a,j.createElement(Rs,{as:"span"},r))},{getSignInWithFederationText:om,getOrText:ffe}=Ln;function S7(){const{route:t,socialProviders:e}=Et(({route:n,socialProviders:r})=>[n,r]);return e.length===0?null:j.createElement(ze,{direction:"column",padding:"0 0 1rem 0",className:"federated-sign-in-container"},e.map(n=>{switch(n){case"amazon":return j.createElement(sm,{icon:"amazon",key:n,provider:Tc.Amazon,text:om(t,n)});case"apple":return j.createElement(sm,{icon:"apple",key:n,provider:Tc.Apple,text:om(t,n)});case"facebook":return j.createElement(sm,{icon:"facebook",key:n,provider:Tc.Facebook,text:om(t,n)});case"google":return j.createElement(sm,{icon:"google",key:n,provider:Tc.Google,text:om(t,n)});default:console.error(`Authenticator does not support ${n}. Please open an issue: https://github.com/aws-amplify/amplify-ui/issues/choose`)}}),j.createElement(tR,{size:"small",label:ffe()}))}const{getSignInText:im,getSigningInText:hfe,getForgotPasswordText:pfe,getSignInWithEmailText:gfe,getSignInWithSmsText:mfe,getSignInWithPasskeyText:vfe,getOtherSignInOptionsText:yfe,getEnterUsernameFirstText:bfe}=Ln;function Ci(){const{isPending:t,availableAuthMethods:e,preferredChallenge:n,toShowAuthMethods:r}=Et(w=>[w.isPending,w.availableAuthMethods,w.preferredChallenge,w.toShowAuthMethods]),{handleChange:s,handleSubmit:o}=fs(),[a,u]=j.useState(""),{components:{SignIn:{Header:c=Ci.Header,Footer:f=Ci.Footer}}}=ds(),g=e&&e.length>1&&n,m=a.trim().length>0,y=j.useCallback(w=>{const{name:T,value:x}=w.target;T==="username"&&typeof x=="string"&&u(x),s(w)},[s]),S=()=>{if(!n)return im();switch(n){case"EMAIL_OTP":return gfe();case"SMS_OTP":return mfe();case"WEB_AUTHN":return vfe();default:return im()}},E=w=>{w.preventDefault(),o(w)},C=w=>{w.preventDefault(),r()};return j.createElement(qe,null,j.createElement(c,null),j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-signin":"",method:"post",onSubmit:g?E:o,onChange:y},j.createElement(S7,null),j.createElement(ze,{direction:"column"},j.createElement(ze,{as:"fieldset",direction:"column",isDisabled:t},j.createElement(hb,null,j.createElement("legend",null,im())),j.createElement(Po,null)),j.createElement(Vr,null),j.createElement(en,{isDisabled:t,type:"submit",variation:"primary",isLoading:t,loadingText:hfe()},g?S():im()),g&&j.createElement(en,{onClick:C,size:"small",variation:"link",isDisabled:t||!m,title:m?void 0:bfe()},yfe()),j.createElement(f,null))))}const Sfe=()=>{const{toForgotPassword:t}=Et(e=>[e.toForgotPassword]);return j.createElement(qe,{"data-amplify-footer":""},j.createElement(en,{onClick:t,size:"small",variation:"link"},pfe()))};Ci.Footer=Sfe;Ci.Header=function(){return null};const{getCreateAccountText:rU,getCreatingAccountText:Efe,getCreateAccountWithEmailText:Cfe,getCreateAccountWithPasswordText:wfe,getCreateAccountWithSmsText:xfe,getOrText:_fe}=Ln;function Qs(){const{hasValidationErrors:t,isPending:e,availableAuthMethods:n,preferredChallenge:r,selectedAuthMethod:s}=Et(x=>[x.hasValidationErrors,x.isPending,x.availableAuthMethods,x.preferredChallenge,x.selectedAuthMethod]),{handleChange:o,handleBlur:a,handleSubmit:u}=fs(),{components:{SignUp:{Header:c=Qs.Header,FormFields:f=Qs.FormFields,Footer:h=Qs.Footer}}}=ds(),g=n?.filter(x=>x!=="WEB_AUTHN"),m=g&&g.length>1,y=r&&r!=="WEB_AUTHN"?r:"PASSWORD",S=g?.filter(x=>x!==y)??[],C=(s??y)!=="PASSWORD",w=x=>{switch(x){case"EMAIL_OTP":return Cfe();case"SMS_OTP":return xfe();case"PASSWORD":return m?wfe():rU();default:return rU()}},T=x=>R=>{R.preventDefault();const M=R.target.closest("form");if(M){if(!M.__authMethod){const N=document.createElement("input");N.name="__authMethod",M.appendChild(N)}M.__authMethod.type="hidden",M.__authMethod.value=x,M.requestSubmit()}};return j.createElement(qe,null,j.createElement(c,null),j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-signup":"",method:"post",onChange:o,onSubmit:u,onBlur:a},j.createElement(S7,null),j.createElement(ze,{as:"fieldset",direction:"column",isDisabled:e},j.createElement(ze,{direction:"column"},j.createElement(f,{includePassword:!C}),j.createElement(Vr,null)),j.createElement(en,{isDisabled:(!m||S.length==0)&&t||e,isFullWidth:!0,type:"submit",variation:"primary",isLoading:e,loadingText:Efe(),onClick:T(y)},w(y)),m&&S.length>0&&j.createElement(j.Fragment,null,j.createElement(ze,{justifyContent:"center",padding:"medium 0"},_fe()),S.map(x=>j.createElement(en,{key:x,isDisabled:e,isFullWidth:!0,type:"button",variation:"primary",onClick:T(x)},w(x)))),j.createElement(h,null))))}Qs.Header=function(){return null};Qs.FormFields=function(){return j.createElement(Po,null)};Qs.Footer=function(){return null};const{getSignInTabText:Afe,getSignUpTabText:Tfe}=Ln,Rfe=({className:t,hideSignUp:e,variation:n})=>{const{route:r,toSignIn:s,toSignUp:o}=Et(a=>[a.route,a.toSignIn,a.toSignUp]);return j.createElement(qr,{className:t,variation:n},e?j.createElement(qe,{"data-amplify-router-content":""},r==="signIn"&&j.createElement(Ci,null)):j.createElement(wl.Container,{value:r,isLazy:!0,onValueChange:a=>{a!==r&&(a==="signIn"?s():o())}},j.createElement(wl.List,{spacing:"equal",indicatorPosition:"top"},j.createElement(wl.Item,{value:"signIn"},Afe()),j.createElement(wl.Item,{value:"signUp"},Tfe())),j.createElement(wl.Panel,{value:"signIn","data-amplify-router-content":""},j.createElement(Ci,null)),j.createElement(wl.Panel,{value:"signUp","data-amplify-router-content":""},j.createElement(Qs,null))))},{getAccountRecoveryInfoText:Ife,getSkipText:Ofe}=Ln,Gl=({className:t,variation:e})=>{const{isPending:n}=Et(u=>[u.isPending]),{handleChange:r,handleSubmit:s}=fs(),{components:{ConfirmVerifyUser:{Header:o=Gl.Header,Footer:a=Gl.Footer}}}=ds();return j.createElement(qr,{className:t,variation:e},j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmverifyuser":"",method:"post",onChange:r,onSubmit:s},j.createElement(ze,{as:"fieldset",direction:"column",isDisabled:n},j.createElement(o,null),j.createElement(ze,{direction:"column"},j.createElement(Po,null)),j.createElement(Vr,null),j.createElement(mb,{cancelButtonText:Ofe(),cancelButtonSendType:"SKIP"}),j.createElement(a,null))))};Gl.Header=function(){return j.createElement(Ar,{level:3},Ife())};Gl.Footer=function(){return null};const{getSkipText:Nfe,getVerifyText:Mfe,getVerifyContactText:Pfe,getAccountRecoveryInfoText:kfe}=Ln,Dfe=t=>Object.entries(t).map(([e,n],r)=>{const s=nb[e].label;return j.createElement(rR,{name:"unverifiedAttr",value:e,key:e,defaultChecked:r===0},ye(s),":"," ",Gse(s,n))}),Kl=({className:t,variation:e})=>{const{components:{VerifyUser:{Header:n=Kl.Header,Footer:r=Kl.Footer}}}=ds(),{isPending:s,unverifiedUserAttributes:o}=Et(({isPending:h,unverifiedUserAttributes:g})=>[h,g]),{handleChange:a,handleSubmit:u}=fs(),c=s?j.createElement(j.Fragment,null,"Verifying…"):j.createElement(j.Fragment,null,Mfe()),f=j.createElement(sR,{legend:Pfe(),name:"verify_context",isDisabled:s,legendHidden:!0},Dfe(o));return j.createElement(qr,{className:t,variation:e},j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-verifyuser":"",method:"post",onChange:a,onSubmit:u},j.createElement(ze,{as:"fieldset",direction:"column",isDisabled:s},j.createElement(n,null),f,j.createElement(Vr,null),j.createElement(mb,{cancelButtonText:Nfe(),cancelButtonSendType:"SKIP",submitButtonText:c}),j.createElement(r,null))))};Kl.Header=function(){return j.createElement(Ar,{level:3},kfe())};Kl.Footer=function(){return null};const{getChallengeText:Lfe,getDeliveryMessageText:Ufe,getDeliveryMethodText:Ffe}=Ln,Yl=({className:t,variation:e})=>{const{isPending:n,challengeName:r,codeDeliveryDetails:s}=Et(h=>[h.isPending,h.challengeName,h.codeDeliveryDetails]),{handleChange:o,handleSubmit:a}=fs(),{components:{ConfirmSignIn:{Header:u=Yl.Header,Footer:c=Yl.Footer}}}=ds(),f=cR(r)&&s;return j.createElement(qr,{className:t,variation:e},j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmsignin":"",method:"post",onChange:o,onSubmit:a},j.createElement(ze,{as:"fieldset",direction:"column",isDisabled:n},j.createElement(u,null),j.createElement(ze,{direction:"column"},f&&j.createElement(Rs,{className:"amplify-authenticator__subtitle"},Ufe(s)),j.createElement(Po,null),j.createElement(Vr,null)),j.createElement(gb,null),j.createElement(c,null))))};function zfe(){const{challengeName:t,codeDeliveryDetails:e}=Et(({challengeName:r,codeDeliveryDetails:s})=>[r,s]),n=cR(t)&&e;return j.createElement(j.Fragment,null,j.createElement(Ar,{level:3},Lfe(t)),n&&j.createElement(Ar,{level:5},Ffe(e)))}Yl.Header=zfe;Yl.Footer=function(){return null};const{getResendCodeText:jfe,getResetYourPasswordText:Bfe}=Ln,Zl=({className:t,variation:e})=>{const{isPending:n}=Et(c=>[c.isPending]),{handleBlur:r,handleChange:s,handleSubmit:o}=fs(),{components:{ConfirmResetPassword:{Header:a=Zl.Header,Footer:u=Zl.Footer}}}=ds();return j.createElement(qr,{className:t,variation:e},j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmresetpassword":"",method:"post",onSubmit:o,onChange:s,onBlur:r},j.createElement(ze,{as:"fieldset",direction:"column",isDisabled:n},j.createElement(a,null),j.createElement(ze,{direction:"column"},j.createElement(Po,null)),j.createElement(Vr,null),j.createElement(mb,{cancelButtonSendType:"RESEND",cancelButtonText:jfe()}),j.createElement(u,null))))};Zl.Header=function(){const e=Bfe();return j.createElement(Ar,{level:3},e)};Zl.Footer=function(){return null};const{getBackToSignInText:$fe,getSendingText:Hfe,getSendCodeText:qfe,getResetYourPasswordText:Wfe}=Ln,Ba=({className:t,variation:e})=>{const{isPending:n}=Et(u=>[u.isPending]),{handleChange:r,handleSubmit:s}=fs(),{components:{ForgotPassword:{Header:o=Ba.Header,Footer:a=Ba.Footer}}}=ds();return j.createElement(qr,{className:t,variation:e},j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-forgotpassword":"",method:"post",onChange:r,onSubmit:s},j.createElement(ze,{as:"fieldset",direction:"column",isDisabled:n},j.createElement(o,null),j.createElement(ze,{direction:"column"},j.createElement(Po,null)),j.createElement(Vr,null),j.createElement(mb,{cancelButtonText:$fe(),cancelButtonSendType:"SIGN_IN",submitButtonText:n?j.createElement(j.Fragment,null,Hfe(),"…"):j.createElement(j.Fragment,null,qfe())}),j.createElement(a,null))))};Ba.Header=function(){return j.createElement(Ar,{level:3},Wfe())};Ba.Footer=function(){return null};const{getMfaTypeLabelByValue:Vfe,getSelectMfaTypeByChallengeName:Gfe,getSelectMfaTypeText:Kfe}=Ln,$a=({className:t,variation:e})=>{const{isPending:n,allowedMfaTypes:r=[]}=Et(c=>[c.isPending,c.allowedMfaTypes]),{handleChange:s,handleSubmit:o}=fs(),{components:{SelectMfaType:{Header:a=$a.Header,Footer:u=$a.Footer}}}=ds();return _.createElement(qr,{className:t,variation:e},_.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-select-mfa-type":"",method:"post",onChange:s,onSubmit:o},_.createElement(ze,{as:"fieldset",direction:"column",isDisabled:n},_.createElement(a,null),_.createElement(ze,{direction:"column"},_.createElement(sR,{name:"mfa_type",legend:Kfe(),legendHidden:!0,isDisabled:n,isRequired:!0},r.map((c,f)=>_.createElement(rR,{name:"mfa_type",key:c,value:c,defaultChecked:f===0},Vfe(c)))),_.createElement(Vr,null)),_.createElement(gb,null),_.createElement(u,null))))};$a.Header=function(){const{challengeName:e}=Et(n=>[n.challengeName]);return _.createElement(Ar,{level:3},Gfe(e))};$a.Footer=function(){return null};const{getSetupEmailText:Yfe}=Ln,Ha=({className:t,variation:e})=>{const{isPending:n}=Et(u=>[u.isPending]),{handleChange:r,handleSubmit:s}=fs(),{components:{SetupEmail:{Header:o=Ha.Header,Footer:a=Ha.Footer}}}=ds();return _.createElement(qr,{className:t,variation:e},_.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-setup-email":"",method:"post",onChange:r,onSubmit:s},_.createElement(ze,{as:"fieldset",direction:"column",isDisabled:n},_.createElement(o,null),_.createElement(ze,{direction:"column"},_.createElement(Po,null),_.createElement(Vr,null)),_.createElement(gb,null),_.createElement(a,null))))};Ha.Header=function(){return _.createElement(Ar,{level:3},Yfe())};Ha.Footer=function(){return null};const{getSignInWithPasswordText:C_,getSignInWithEmailText:Zfe,getSignInWithSmsText:Xfe,getSignInWithPasskeyText:Qfe,getSigningInText:Jfe,getBackToSignInText:ehe,getOrText:the,getUsernameLabelByLoginMechanism:nhe}=Ln,rhe=t=>{switch(t){case"EMAIL_OTP":return Zfe();case"SMS_OTP":return Xfe();case"WEB_AUTHN":return Qfe();case"PASSWORD":return C_();default:return C_()}},she=({className:t,variation:e})=>{const{isPending:n,username:r,availableAuthMethods:s,toSignIn:o,selectAuthMethod:a,loginMechanism:u}=Et(E=>[E.isPending,E.username,E.availableAuthMethods,E.toSignIn,E.selectAuthMethod,E.loginMechanism]),{handleChange:c,handleSubmit:f}=fs(),h=s??[],g=h.includes("PASSWORD"),m=h.filter(E=>E!=="PASSWORD"),y=E=>{a({method:E})},S=nhe(u);return j.createElement(qr,{className:t,variation:e},j.createElement("form",{"data-amplify-form":!0,"data-amplify-authenticator-signinselect":!0,method:"post",onSubmit:f,onChange:c},j.createElement(ze,{direction:"column"},j.createElement(fp,{label:S,name:"username",value:r,isReadOnly:!0,isDisabled:!0}),g&&j.createElement(j.Fragment,null,j.createElement(nR,{label:"Password",name:"password",autoComplete:"current-password",isDisabled:n}),j.createElement(en,{isDisabled:n,type:"submit",variation:"primary",isFullWidth:!0,isLoading:n,loadingText:Jfe()},C_())),g&&m.length>0&&j.createElement(tR,{label:the()}),m.length>0&&j.createElement(ze,{direction:"column",gap:"0.5rem"},m.map(E=>j.createElement(en,{key:E,variation:"primary",isFullWidth:!0,isDisabled:n,onClick:()=>y(E)},rhe(E)))),j.createElement(Vr,null),j.createElement(en,{onClick:o,size:"small",variation:"link",isDisabled:n},ehe()))))},ohe=t=>{const{className:e,...n}=t;return _.createElement(qe,{as:"span",width:"1em",height:"1em",className:$e(ue.Icon,e),...n},_.createElement("svg",{width:"54",height:"54",viewBox:"0 0 54 54",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M22.9333 38.9333L41.7333 20.1333L38 16.4L22.9333 31.4667L15.3333 23.8667L11.6 27.6L22.9333 38.9333ZM26.6667 53.3333C22.9778 53.3333 19.5111 52.6333 16.2667 51.2333C13.0222 49.8333 10.2 47.9333 7.8 45.5333C5.4 43.1333 3.5 40.3111 2.1 37.0667C0.7 33.8222 0 30.3556 0 26.6667C0 22.9778 0.7 19.5111 2.1 16.2667C3.5 13.0222 5.4 10.2 7.8 7.8C10.2 5.4 13.0222 3.5 16.2667 2.1C19.5111 0.7 22.9778 0 26.6667 0C30.3556 0 33.8222 0.7 37.0667 2.1C40.3111 3.5 43.1333 5.4 45.5333 7.8C47.9333 10.2 49.8333 13.0222 51.2333 16.2667C52.6333 19.5111 53.3333 22.9778 53.3333 26.6667C53.3333 30.3556 52.6333 33.8222 51.2333 37.0667C49.8333 40.3111 47.9333 43.1333 45.5333 45.5333C43.1333 47.9333 40.3111 49.8333 37.0667 51.2333C33.8222 52.6333 30.3556 53.3333 26.6667 53.3333Z",fill:"currentColor"})))},ihe=t=>{const{className:e,...n}=t;return _.createElement(qe,{as:"span",width:"1em",height:"1em",className:$e(ue.Icon,e),...n},_.createElement("svg",{width:"195",height:"128",viewBox:"0 0 195 128",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("circle",{cx:"60",cy:"36",r:"31",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M60 69C84.4313 69 105.396 83.8504 114.357 105.021C116.774 110.729 115.382 116.168 111.798 120.23C108.191 124.319 102.358 127 96 127H24C17.6416 127 11.8094 124.319 8.20215 120.23C4.61836 116.168 3.22626 110.729 5.64258 105.021C14.6036 83.8504 35.5687 69 60 69Z",stroke:"#00404D",strokeWidth:"2"}),_.createElement("circle",{cx:"122",cy:"26",r:"25",fill:"#E9F9FC",stroke:"#00404D",strokeWidth:"2"}),_.createElement("mask",{id:"path-4-inside-1_4178_10171",fill:"white"},_.createElement("path",{d:"M121.951 13.927C124.887 13.927 127.658 14.5348 130.262 15.7503C132.866 16.9658 135.04 18.7222 136.786 21.0197C136.98 21.2601 137.042 21.4738 136.973 21.6608C136.903 21.8478 136.786 22.0081 136.619 22.1417C136.453 22.2753 136.259 22.3354 136.038 22.322C135.816 22.3086 135.622 22.1951 135.456 21.9814C133.932 19.8977 131.972 18.3015 129.576 17.1928C127.18 16.0842 124.638 15.5299 121.951 15.5299C119.264 15.5299 116.743 16.0842 114.388 17.1928C112.034 18.3015 110.081 19.8977 108.529 21.9814C108.363 22.2218 108.169 22.3554 107.947 22.3821C107.726 22.4088 107.532 22.3554 107.366 22.2218C107.172 22.0883 107.054 21.9213 107.012 21.7209C106.971 21.5206 107.033 21.3135 107.199 21.0998C108.917 18.8291 111.071 17.066 113.661 15.8104C116.251 14.5548 119.015 13.927 121.951 13.927ZM121.951 17.6937C125.691 17.6937 128.904 18.8959 131.591 21.3002C134.279 23.7045 135.622 26.6831 135.622 30.2361C135.622 31.5719 135.13 32.6872 134.147 33.5821C133.164 34.477 131.965 34.9245 130.553 34.9245C129.14 34.9245 127.928 34.477 126.917 33.5821C125.906 32.6872 125.4 31.5719 125.4 30.2361C125.4 29.3546 125.061 28.6132 124.382 28.0122C123.703 27.4111 122.893 27.1106 121.951 27.1106C121.009 27.1106 120.199 27.4111 119.52 28.0122C118.841 28.6132 118.502 29.3546 118.502 30.2361C118.502 32.8274 119.299 34.9913 120.891 36.7277C122.484 38.4642 124.541 39.6797 127.062 40.3742C127.311 40.4544 127.478 40.588 127.561 40.775C127.644 40.962 127.658 41.1623 127.602 41.376C127.547 41.563 127.436 41.7233 127.27 41.8569C127.104 41.9905 126.896 42.0305 126.647 41.9771C123.766 41.2825 121.411 39.9001 119.582 37.8297C117.754 35.7593 116.84 33.2281 116.84 30.2361C116.84 28.9004 117.339 27.7784 118.336 26.8701C119.333 25.9618 120.538 25.5077 121.951 25.5077C123.364 25.5077 124.569 25.9618 125.566 26.8701C126.563 27.7784 127.062 28.9004 127.062 30.2361C127.062 31.1177 127.408 31.859 128.101 32.4601C128.794 33.0612 129.611 33.3617 130.553 33.3617C131.495 33.3617 132.298 33.0612 132.963 32.4601C133.628 31.859 133.96 31.1177 133.96 30.2361C133.96 27.1373 132.783 24.5326 130.428 22.4222C128.073 20.3117 125.261 19.2565 121.993 19.2565C118.724 19.2565 115.912 20.3117 113.557 22.4222C111.202 24.5326 110.025 27.1239 110.025 30.1961C110.025 30.8372 110.087 31.6386 110.212 32.6004C110.337 33.5621 110.635 34.6841 111.106 35.9664C111.189 36.2068 111.182 36.4205 111.085 36.6075C110.988 36.7945 110.828 36.9281 110.607 37.0082C110.385 37.0884 110.171 37.0817 109.963 36.9882C109.755 36.8947 109.61 36.7411 109.526 36.5274C109.111 35.4855 108.813 34.4503 108.633 33.4218C108.453 32.3933 108.363 31.3314 108.363 30.2361C108.363 26.6831 109.7 23.7045 112.373 21.3002C115.046 18.8959 118.239 17.6937 121.951 17.6937ZM121.951 10C123.724 10 125.455 10.207 127.145 10.6211C128.835 11.0352 130.47 11.6296 132.049 12.4043C132.298 12.5379 132.443 12.6982 132.485 12.8852C132.526 13.0722 132.506 13.2592 132.423 13.4462C132.339 13.6332 132.201 13.7801 132.007 13.8869C131.813 13.9938 131.578 13.9804 131.301 13.8469C129.832 13.1256 128.316 12.5713 126.75 12.1839C125.185 11.7965 123.585 11.6029 121.951 11.6029C120.344 11.6029 118.765 11.7832 117.214 12.1438C115.663 12.5045 114.18 13.0722 112.768 13.8469C112.546 13.9804 112.324 14.0138 112.103 13.947C111.881 13.8803 111.715 13.74 111.604 13.5263C111.493 13.3126 111.466 13.1189 111.521 12.9453C111.576 12.7716 111.715 12.618 111.937 12.4844C113.488 11.683 115.109 11.0686 116.798 10.6411C118.488 10.2137 120.206 10 121.951 10ZM121.951 21.5807C124.527 21.5807 126.744 22.4155 128.6 24.0852C130.456 25.7548 131.384 27.8051 131.384 30.2361C131.384 30.4766 131.308 30.6702 131.155 30.8172C131.003 30.9641 130.802 31.0376 130.553 31.0376C130.331 31.0376 130.137 30.9641 129.971 30.8172C129.805 30.6702 129.722 30.4766 129.722 30.2361C129.722 28.2326 128.953 26.5562 127.415 25.2072C125.878 23.8581 124.056 23.1835 121.951 23.1835C119.846 23.1835 118.038 23.8581 116.528 25.2072C115.018 26.5562 114.264 28.2326 114.264 30.2361C114.264 32.4 114.651 34.2366 115.427 35.746C116.203 37.2553 117.339 38.7714 118.834 40.2941C119.001 40.4544 119.084 40.6414 119.084 40.8551C119.084 41.0688 119.001 41.2558 118.834 41.4161C118.668 41.5764 118.474 41.6565 118.253 41.6565C118.031 41.6565 117.837 41.5764 117.671 41.4161C116.037 39.7598 114.783 38.0701 113.91 36.347C113.038 34.624 112.601 32.587 112.601 30.2361C112.601 27.8051 113.516 25.7548 115.344 24.0852C117.172 22.4155 119.375 21.5807 121.951 21.5807ZM121.909 29.4347C122.159 29.4347 122.36 29.5148 122.512 29.6751C122.664 29.8354 122.741 30.0224 122.741 30.2361C122.741 32.2397 123.488 33.8826 124.984 35.1649C126.48 36.4472 128.226 37.0884 130.22 37.0884C130.386 37.0884 130.622 37.075 130.927 37.0483C131.231 37.0216 131.55 36.9815 131.882 36.9281C132.132 36.8747 132.346 36.9081 132.526 37.0283C132.706 37.1485 132.824 37.3288 132.88 37.5692C132.935 37.7829 132.893 37.9699 132.755 38.1302C132.616 38.2905 132.436 38.3974 132.215 38.4508C131.716 38.5844 131.28 38.6578 130.906 38.6712C130.532 38.6846 130.303 38.6912 130.22 38.6912C127.755 38.6912 125.615 37.8898 123.8 36.2869C121.986 34.6841 121.078 32.6671 121.078 30.2361C121.078 30.0224 121.155 29.8354 121.307 29.6751C121.459 29.5148 121.66 29.4347 121.909 29.4347Z"})),_.createElement("path",{d:"M121.951 13.927C124.887 13.927 127.658 14.5348 130.262 15.7503C132.866 16.9658 135.04 18.7222 136.786 21.0197C136.98 21.2601 137.042 21.4738 136.973 21.6608C136.903 21.8478 136.786 22.0081 136.619 22.1417C136.453 22.2753 136.259 22.3354 136.038 22.322C135.816 22.3086 135.622 22.1951 135.456 21.9814C133.932 19.8977 131.972 18.3015 129.576 17.1928C127.18 16.0842 124.638 15.5299 121.951 15.5299C119.264 15.5299 116.743 16.0842 114.388 17.1928C112.034 18.3015 110.081 19.8977 108.529 21.9814C108.363 22.2218 108.169 22.3554 107.947 22.3821C107.726 22.4088 107.532 22.3554 107.366 22.2218C107.172 22.0883 107.054 21.9213 107.012 21.7209C106.971 21.5206 107.033 21.3135 107.199 21.0998C108.917 18.8291 111.071 17.066 113.661 15.8104C116.251 14.5548 119.015 13.927 121.951 13.927ZM121.951 17.6937C125.691 17.6937 128.904 18.8959 131.591 21.3002C134.279 23.7045 135.622 26.6831 135.622 30.2361C135.622 31.5719 135.13 32.6872 134.147 33.5821C133.164 34.477 131.965 34.9245 130.553 34.9245C129.14 34.9245 127.928 34.477 126.917 33.5821C125.906 32.6872 125.4 31.5719 125.4 30.2361C125.4 29.3546 125.061 28.6132 124.382 28.0122C123.703 27.4111 122.893 27.1106 121.951 27.1106C121.009 27.1106 120.199 27.4111 119.52 28.0122C118.841 28.6132 118.502 29.3546 118.502 30.2361C118.502 32.8274 119.299 34.9913 120.891 36.7277C122.484 38.4642 124.541 39.6797 127.062 40.3742C127.311 40.4544 127.478 40.588 127.561 40.775C127.644 40.962 127.658 41.1623 127.602 41.376C127.547 41.563 127.436 41.7233 127.27 41.8569C127.104 41.9905 126.896 42.0305 126.647 41.9771C123.766 41.2825 121.411 39.9001 119.582 37.8297C117.754 35.7593 116.84 33.2281 116.84 30.2361C116.84 28.9004 117.339 27.7784 118.336 26.8701C119.333 25.9618 120.538 25.5077 121.951 25.5077C123.364 25.5077 124.569 25.9618 125.566 26.8701C126.563 27.7784 127.062 28.9004 127.062 30.2361C127.062 31.1177 127.408 31.859 128.101 32.4601C128.794 33.0612 129.611 33.3617 130.553 33.3617C131.495 33.3617 132.298 33.0612 132.963 32.4601C133.628 31.859 133.96 31.1177 133.96 30.2361C133.96 27.1373 132.783 24.5326 130.428 22.4222C128.073 20.3117 125.261 19.2565 121.993 19.2565C118.724 19.2565 115.912 20.3117 113.557 22.4222C111.202 24.5326 110.025 27.1239 110.025 30.1961C110.025 30.8372 110.087 31.6386 110.212 32.6004C110.337 33.5621 110.635 34.6841 111.106 35.9664C111.189 36.2068 111.182 36.4205 111.085 36.6075C110.988 36.7945 110.828 36.9281 110.607 37.0082C110.385 37.0884 110.171 37.0817 109.963 36.9882C109.755 36.8947 109.61 36.7411 109.526 36.5274C109.111 35.4855 108.813 34.4503 108.633 33.4218C108.453 32.3933 108.363 31.3314 108.363 30.2361C108.363 26.6831 109.7 23.7045 112.373 21.3002C115.046 18.8959 118.239 17.6937 121.951 17.6937ZM121.951 10C123.724 10 125.455 10.207 127.145 10.6211C128.835 11.0352 130.47 11.6296 132.049 12.4043C132.298 12.5379 132.443 12.6982 132.485 12.8852C132.526 13.0722 132.506 13.2592 132.423 13.4462C132.339 13.6332 132.201 13.7801 132.007 13.8869C131.813 13.9938 131.578 13.9804 131.301 13.8469C129.832 13.1256 128.316 12.5713 126.75 12.1839C125.185 11.7965 123.585 11.6029 121.951 11.6029C120.344 11.6029 118.765 11.7832 117.214 12.1438C115.663 12.5045 114.18 13.0722 112.768 13.8469C112.546 13.9804 112.324 14.0138 112.103 13.947C111.881 13.8803 111.715 13.74 111.604 13.5263C111.493 13.3126 111.466 13.1189 111.521 12.9453C111.576 12.7716 111.715 12.618 111.937 12.4844C113.488 11.683 115.109 11.0686 116.798 10.6411C118.488 10.2137 120.206 10 121.951 10ZM121.951 21.5807C124.527 21.5807 126.744 22.4155 128.6 24.0852C130.456 25.7548 131.384 27.8051 131.384 30.2361C131.384 30.4766 131.308 30.6702 131.155 30.8172C131.003 30.9641 130.802 31.0376 130.553 31.0376C130.331 31.0376 130.137 30.9641 129.971 30.8172C129.805 30.6702 129.722 30.4766 129.722 30.2361C129.722 28.2326 128.953 26.5562 127.415 25.2072C125.878 23.8581 124.056 23.1835 121.951 23.1835C119.846 23.1835 118.038 23.8581 116.528 25.2072C115.018 26.5562 114.264 28.2326 114.264 30.2361C114.264 32.4 114.651 34.2366 115.427 35.746C116.203 37.2553 117.339 38.7714 118.834 40.2941C119.001 40.4544 119.084 40.6414 119.084 40.8551C119.084 41.0688 119.001 41.2558 118.834 41.4161C118.668 41.5764 118.474 41.6565 118.253 41.6565C118.031 41.6565 117.837 41.5764 117.671 41.4161C116.037 39.7598 114.783 38.0701 113.91 36.347C113.038 34.624 112.601 32.587 112.601 30.2361C112.601 27.8051 113.516 25.7548 115.344 24.0852C117.172 22.4155 119.375 21.5807 121.951 21.5807ZM121.909 29.4347C122.159 29.4347 122.36 29.5148 122.512 29.6751C122.664 29.8354 122.741 30.0224 122.741 30.2361C122.741 32.2397 123.488 33.8826 124.984 35.1649C126.48 36.4472 128.226 37.0884 130.22 37.0884C130.386 37.0884 130.622 37.075 130.927 37.0483C131.231 37.0216 131.55 36.9815 131.882 36.9281C132.132 36.8747 132.346 36.9081 132.526 37.0283C132.706 37.1485 132.824 37.3288 132.88 37.5692C132.935 37.7829 132.893 37.9699 132.755 38.1302C132.616 38.2905 132.436 38.3974 132.215 38.4508C131.716 38.5844 131.28 38.6578 130.906 38.6712C130.532 38.6846 130.303 38.6912 130.22 38.6912C127.755 38.6912 125.615 37.8898 123.8 36.2869C121.986 34.6841 121.078 32.6671 121.078 30.2361C121.078 30.0224 121.155 29.8354 121.307 29.6751C121.459 29.5148 121.66 29.4347 121.909 29.4347Z",fill:"#00404D",stroke:"#00404D",strokeWidth:"4",mask:"url(#path-4-inside-1_4178_10171)"}),_.createElement("circle",{cx:"167.5",cy:"49.5",r:"19.5",fill:"#E9F9FC",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M167.89 43.65L161.26 54.18H167.89",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M167.5 60.42C173.316 60.42 178.03 55.7056 178.03 49.89V48.72",stroke:"#00404D",strokeWidth:"2"}),_.createElement("circle",{cx:"173.74",cy:"43.26",r:"1",fill:"#00404D",stroke:"#00404D",strokeWidth:"1.12"}),_.createElement("circle",{cx:"160.48",cy:"43.26",r:"1",fill:"#00404D",stroke:"#00404D",strokeWidth:"1.12"}),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M104 112C116.129 112 126.457 104.288 130.347 93.5H147.5L155.5 101.5L168 89L180.5 101.5L193 89L180.5 76.5H130.984C127.705 64.6779 116.866 56 104 56C88.536 56 76 68.536 76 84C76 99.464 88.536 112 104 112ZM104 98C111.732 98 118 91.732 118 84C118 76.268 111.732 70 104 70C96.268 70 90 76.268 90 84C90 91.732 96.268 98 104 98Z",fill:"#BCECF5"}),_.createElement("path",{d:"M130.347 93.5V92.5H129.645L129.407 93.1608L130.347 93.5ZM147.5 93.5L148.207 92.7929L147.914 92.5H147.5V93.5ZM155.5 101.5L154.793 102.207L155.5 102.914L156.207 102.207L155.5 101.5ZM168 89L168.707 88.2929L168 87.5858L167.293 88.2929L168 89ZM180.5 101.5L179.793 102.207L180.5 102.914L181.207 102.207L180.5 101.5ZM193 89L193.707 89.7071L194.414 89L193.707 88.2929L193 89ZM180.5 76.5L181.207 75.7929L180.914 75.5H180.5V76.5ZM130.984 76.5L130.021 76.7673L130.224 77.5H130.984V76.5ZM129.407 93.1608C125.655 103.565 115.694 111 104 111V113C116.564 113 127.259 105.011 131.288 93.8392L129.407 93.1608ZM147.5 92.5H130.347V94.5H147.5V92.5ZM156.207 100.793L148.207 92.7929L146.793 94.2071L154.793 102.207L156.207 100.793ZM167.293 88.2929L154.793 100.793L156.207 102.207L168.707 89.7071L167.293 88.2929ZM181.207 100.793L168.707 88.2929L167.293 89.7071L179.793 102.207L181.207 100.793ZM192.293 88.2929L179.793 100.793L181.207 102.207L193.707 89.7071L192.293 88.2929ZM179.793 77.2071L192.293 89.7071L193.707 88.2929L181.207 75.7929L179.793 77.2071ZM130.984 77.5H180.5V75.5H130.984V77.5ZM104 57C116.405 57 126.859 65.3669 130.021 76.7673L131.948 76.2327C128.552 63.9889 117.327 55 104 55V57ZM77 84C77 69.0883 89.0883 57 104 57V55C87.9837 55 75 67.9837 75 84H77ZM104 111C89.0883 111 77 98.9117 77 84H75C75 100.016 87.9837 113 104 113V111ZM117 84C117 91.1797 111.18 97 104 97V99C112.284 99 119 92.2843 119 84H117ZM104 71C111.18 71 117 76.8203 117 84H119C119 75.7157 112.284 69 104 69V71ZM91 84C91 76.8203 96.8203 71 104 71V69C95.7157 69 89 75.7157 89 84H91ZM104 97C96.8203 97 91 91.1797 91 84H89C89 92.2843 95.7157 99 104 99V97Z",fill:"#00404D"}),_.createElement("path",{d:"M138.5 57V66",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M139 104V124",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M134 61.5L143 61.5",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M129 114L149 114",stroke:"#00404D",strokeWidth:"2"})))},{getPasskeyPromptHeadingText:ahe,getPasskeyPromptDescriptionText:lhe,getCreatePasskeyText:uhe,getRegisteringText:che,getContinueWithoutPasskeyText:dhe,getPasskeyCreatedSuccessText:fhe,getPasskeyRegisteredText:hhe,getPasskeyRegistrationFailedText:phe,getPasskeyLabelText:ghe,getExistingPasskeysText:mhe,getSetupAnotherPasskeyText:vhe,getContinueText:yhe}=Ln;function bhe({className:t,variation:e}){const[n,r]=j.useState(!1),[s,o]=j.useState(null),[a,u]=j.useState(!1),[c,f]=j.useState([]),{submitForm:h,isPending:g}=Et(w=>[w.submitForm,w.isPending]),m=j.useCallback(async()=>{try{const w=await kT();f(w.credentials||[])}catch{}},[]);j.useEffect(()=>{n&&m()},[n,m]);const y=j.useCallback(()=>{h({type:"SKIP"})},[h]),S=j.useCallback(()=>{h({type:"SUBMIT"})},[h]),E=j.useCallback(async()=>{try{o(null),u(!0),await pse(),r(!0)}catch(w){const T=w,x=T.name??"",R=T.message??"";if(x==="PasskeyRegistrationCanceled"||x==="NotAllowedError"||R.includes("canceled")||R.includes("cancelled")||R.includes("ceremony has been canceled")||R.includes("not allowed")){y();return}o(phe())}finally{u(!1)}},[y]);if(n)return j.createElement(qr,{className:t,variation:e},j.createElement(ze,{direction:"column",padding:"large","data-amplify-authenticator-passkeyprompt":""},j.createElement(ze,{direction:"column",gap:"xs"},j.createElement(ohe,{className:"amplify-authenticator__passkey-success-icon"}),j.createElement(Ar,{level:4},fhe()),j.createElement(Rs,null,hhe())),c.length>0&&j.createElement(qe,{marginTop:"large"},j.createElement(Ar,{level:5},mhe()),j.createElement(ze,{direction:"column",gap:"xs",marginTop:"xs"},c.map((w,T)=>j.createElement(qe,{key:w.credentialId,className:"amplify-authenticator__passkey-credential-item"},j.createElement(Rs,{fontSize:"small"},w.friendlyCredentialName??`${ghe()} ${T+1}`))))),j.createElement(ze,{direction:"column",gap:"medium",marginTop:"large"},j.createElement(en,{onClick:()=>{r(!1),E()},variation:"link"},vhe()),j.createElement(en,{onClick:()=>S(),variation:"primary",isFullWidth:!0},yhe()))));const C=g||a;return j.createElement(qr,{className:t,variation:e},j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-passkeyprompt":""},j.createElement(ze,{direction:"column",gap:"medium"},j.createElement(Ar,{level:4},ahe()),j.createElement(Rs,null,lhe()),j.createElement(ze,{justifyContent:"center"},j.createElement(ihe,{className:"amplify-authenticator__passkey-icon"})),j.createElement(ze,{direction:"column",gap:"medium"},j.createElement(en,{onClick:()=>{E()},variation:"primary",isDisabled:C,isLoading:a,loadingText:che()},uhe()),j.createElement(en,{onClick:y,variation:"link",isDisabled:C},dhe()),s&&j.createElement(Rs,{className:"amplify-authenticator__passkey-error"},s),j.createElement(Vr,null)))))}function sU(){return null}const She=t=>{switch(t){case"authenticated":case"idle":case"setup":case"transition":return sU;case"confirmSignUp":return Vl;case"confirmSignIn":return Yl;case"selectMfaType":return $a;case"setupEmail":return Ha;case"setupTotp":return ja;case"signIn":case"signUp":return Rfe;case"signInSelectAuthFactor":return she;case"passkeyPrompt":return bhe;case"forceNewPassword":return Xs;case"forgotPassword":return Ba;case"confirmResetPassword":return Zl;case"verifyUser":return Kl;case"confirmVerifyUser":return Gl;default:return console.warn(`Unhandled Authenticator route - please open an issue: ${t}`),sU}};function Ehe({className:t,hideSignUp:e,variation:n}){const{route:r}=Et(({route:o})=>[o]),s=_.useMemo(()=>She(r),[r]);return j.createElement(s,{className:t,hideSignUp:Xde(r)?e:void 0,variation:n})}const Che={Header:()=>null,SignIn:{Header:Ci.Header,Footer:Ci.Footer},SignUp:{Header:Qs.Header,FormFields:Qs.FormFields,Footer:Qs.Footer},ConfirmSignUp:{Header:Vl.Header,Footer:Vl.Footer},SelectMfaType:{Header:$a.Header,Footer:$a.Footer},SetupEmail:{Header:Ha.Header,Footer:Ha.Footer},SetupTotp:{Header:ja.Header,Footer:ja.Footer},ConfirmResetPassword:{Header:Zl.Header,Footer:Zl.Footer},ConfirmSignIn:{Header:Yl.Header,Footer:Yl.Footer},VerifyUser:{Header:Kl.Header,Footer:Kl.Footer},ConfirmVerifyUser:{Header:Gl.Header,Footer:Gl.Footer},ForceNewPassword:{Header:Xs.Header,Footer:Xs.Footer,FormFields:Xs.FormFields},ForgotPassword:{Header:Ba.Header,Footer:Ba.Footer},Footer:()=>null};function whe({children:t,className:e,components:n,formFields:r,hideSignUp:s,initialState:o,loginMechanisms:a,passwordSettings:u,passwordless:c,signUpAttributes:f,services:h,socialProviders:g,variation:m}){vde({message:"The `passwordSettings` prop has been deprecated and will be removed in a future major version of Amplify UI.",shouldWarn:!1});const{route:y,signOut:S,user:E}=Et(({route:T,signOut:x,user:R})=>[T,x,R]);Kue({initialState:o,loginMechanisms:a,passwordSettings:u,passwordless:c,services:h,signUpAttributes:f,socialProviders:g,formFields:r});const C=_.useMemo(()=>({components:{...Che,...n}}),[n]);return y==="authenticated"||y==="signOut"?t?_.createElement(_.Fragment,null,Si(t)?t({signOut:S,user:E}):t):null:_.createElement(p7.Provider,{value:C},_.createElement(Ehe,{className:e,hideSignUp:s,variation:m}))}function ko(t){return Zue({componentName:"Authenticator",packageName:"react",version:mde}),_.createElement(ZF,null,_.createElement(whe,{...t}))}ko.Provider=ZF;ko.ForgotPassword=Ba;ko.SetupTotp=ja;ko.SignIn=Ci;ko.SignUp=Qs;ko.ForceNewPassword=Xs;ko.SelectMfaType=$a;ko.SetupEmail=Ha;const E7=({cssText:t,...e})=>t===void 0||/<\/style/i.test(t)?null:_.createElement("style",{...e,dangerouslySetInnerHTML:{__html:t}});E7.displayName="Style";const C7=({theme:t,...e})=>{if(!t)return null;const{name:n,cssText:r}=t;return _.createElement(E7,{...e,cssText:r,id:`amplify-theme-${n}`})};C7.displayName="ThemeStyle";function xhe({children:t,colorMode:e,direction:n="ltr",nonce:r,theme:s}){const o=_.useMemo(()=>({theme:lb(s),colorMode:e}),[s,e]);return _.createElement(XF.Provider,{value:o},_.createElement(Gce,{dir:n},_.createElement("div",{"data-amplify-theme":o.theme.name,"data-amplify-color-mode":e,dir:n},t),s?_.createElement(C7,{theme:o.theme,nonce:r}):null))}const _he=({configured:t,authStatus:e})=>e==="authenticated",Ahe=t=>t?t.signInDetails?.loginId??t.username??null:null,The=({children:t,fallback:e=null})=>{const{authStatus:n,signOut:r,user:s}=Et(o=>[o.authStatus,o.signOut,o.user]);return _he({configured:!0,authStatus:n})?I.jsx(I.Fragment,{children:t({email:Ahe(s),signOut:()=>r()})}):I.jsx(I.Fragment,{children:e})},Rhe=({children:t,fallback:e=null})=>Ly()?I.jsx(The,{fallback:e,children:t}):I.jsx(I.Fragment,{children:e}),oU='system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',Oi=t=>`var(${t})`,cn=Oi("--accent"),Ihe=Oi("--accent-hover"),iU=Oi("--accent-soft"),Uf=Oi("--accent-fg"),aU=Oi("--surface"),lc=Oi("--fg"),Ohe=Oi("--surface-sunken"),am=Oi("--fg-muted"),Ff=Oi("--line"),Nhe=lb({name:"remit",tokens:{colors:{brand:{primary:{10:{value:iU},20:{value:iU},40:{value:cn},60:{value:cn},80:{value:cn},90:{value:cn},100:{value:cn}}},background:{primary:{value:aU},secondary:{value:Ohe}},font:{primary:{value:lc},secondary:{value:am},tertiary:{value:am},interactive:{value:cn},inverse:{value:Uf},hover:{value:cn},focus:{value:cn},active:{value:cn}},border:{primary:{value:Ff},secondary:{value:Ff},focus:{value:cn}}},fonts:{default:{variable:{value:oU},static:{value:oU}}},radii:{small:{value:"3px"},medium:{value:"5px"},large:{value:"7px"}},components:{authenticator:{router:{borderColor:{value:Ff},borderWidth:{value:"1px"},boxShadow:{value:"0 10px 30px -10px rgb(15 23 42 / 0.18), 0 4px 12px -6px rgb(15 23 42 / 0.1)"},backgroundColor:{value:aU}},form:{padding:{value:"1.75rem"}},orContainer:{color:{value:am}}},button:{color:{value:lc},primary:{backgroundColor:{value:cn},color:{value:Uf},_hover:{backgroundColor:{value:Ihe},color:{value:Uf}},_focus:{backgroundColor:{value:cn},color:{value:Uf}},_active:{backgroundColor:{value:cn},color:{value:Uf}}},link:{color:{value:cn},_hover:{color:{value:cn},backgroundColor:{value:"transparent"}},_focus:{color:{value:cn},backgroundColor:{value:"transparent"}},_active:{color:{value:cn},backgroundColor:{value:"transparent"}}}},fieldcontrol:{color:{value:lc},borderColor:{value:Ff},_focus:{borderColor:{value:cn},boxShadow:{value:`0 0 0 2px ${cn}`}}},field:{label:{color:{value:lc}}},tabs:{borderColor:{value:Ff},item:{color:{value:am},backgroundColor:{value:"transparent"},_active:{color:{value:cn},borderColor:{value:cn},backgroundColor:{value:"transparent"}},_hover:{color:{value:cn}},_focus:{color:{value:cn}}}},heading:{color:{value:lc}},text:{color:{value:lc}}}}}),Mhe={signIn:{username:{placeholder:"Enter your username"},password:{placeholder:"Enter your password"}},signUp:{username:{placeholder:"Enter your username"},password:{placeholder:"Enter your password"},confirm_password:{placeholder:"Confirm your password"}}},Phe=()=>I.jsx(r_,{tone:"warning",className:"fixed top-0 left-0 right-0 z-50 h-7 sm:h-10 overflow-hidden border-x-0 border-t-0",children:I.jsxs("span",{className:"flex items-center gap-2",children:[I.jsx("strong",{className:"font-semibold shrink-0",children:"Local dev"}),I.jsx("span",{className:"truncate hidden sm:inline",children:"— Cognito not configured. Set VITE_COGNITO_USER_POOL_ID and VITE_COGNITO_CLIENT_ID in .env.local to enable sign-in."}),I.jsx("span",{className:"truncate sm:hidden",children:"— no Cognito; signed out"})]})}),khe=()=>I.jsx(A9,{note:q9({betterAuthEnabled:!1,cognitoConfigured:Ly()})}),Dhe=({children:t})=>{const{authStatus:e}=Et(n=>[n.authStatus]);return e==="authenticated"?I.jsx(I.Fragment,{children:t}):e==="configuring"?I.jsx(hT,{}):I.jsx(xhe,{theme:Nhe,children:I.jsxs(_9,{children:[I.jsx(T9,{}),I.jsx(ko,{hideSignUp:!1,formFields:Mhe,components:{Footer:khe}})]})})},Lhe=({children:t})=>Ly()?I.jsx(ko.Provider,{children:I.jsx(Dhe,{children:t})}):I.jsxs("div",{className:"pt-7 sm:pt-10 [&_#main-content]:h-[calc(100dvh-1.75rem)] sm:[&_#main-content]:h-[calc(100dvh-2.5rem)]",children:[I.jsx(Phe,{}),t]}),w7=60;let Uc=null;const x7=()=>Math.floor(Date.now()/1e3),Uhe=t=>t!==null&&t.expiresAt-w7>x7(),Fhe=async()=>{const e=(await Oy()).tokens?.idToken;return e?(Uc={value:e.toString(),expiresAt:e.payload.exp??x7()+w7},Uc.value):(Uc=null,null)},zhe=async()=>Ly()?Uhe(Uc)?Uc.value:Fhe():null,jhe=()=>{Uc=null},Lv={configure:A8,getToken:zhe,resetToken:jhe,Shell:Lhe,Account:Rhe},Bhe=({children:t})=>Uy()?I.jsx(Iv.Shell,{children:t}):I.jsx(Lv.Shell,{children:t}),$he=t=>Uy()?I.jsx(Iv.Account,{...t}):I.jsx(Lv.Account,{...t}),Hhe={configure:A8,getToken:()=>Uy()?Iv.getToken():Lv.getToken(),resetToken:()=>{Iv.resetToken(),Lv.resetToken()},Shell:Bhe,Account:$he};var bd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},qhe=class extends bd{#e;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},dR=new qhe,Whe={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Vhe=class{#e=Whe;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},Tl=new Vhe;function Ghe(t){setTimeout(t,0)}var Khe=typeof window>"u"||"Deno"in globalThis;function Er(){}function Yhe(t,e){return typeof t=="function"?t(e):t}function w_(t){return typeof t=="number"&&t>=0&&t!==1/0}function _7(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Ma(t,e){return typeof t=="function"?t(e):t}function is(t,e){return typeof t=="function"?t(e):t}function lU(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==fR(a,e.options))return!1}else if(!Mh(e.queryKey,a))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||s&&s!==e.state.fetchStatus||o&&!o(e))}function uU(t,e){const{exact:n,status:r,predicate:s,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(Xl(e.options.mutationKey)!==Xl(o))return!1}else if(!Mh(e.options.mutationKey,o))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function fR(t,e){return(e?.queryKeyHashFn||Xl)(t)}function Xl(t){return JSON.stringify(t,(e,n)=>x_(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Mh(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Mh(t[n],e[n])):!1}var Zhe=Object.prototype.hasOwnProperty;function A7(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=cU(t)&&cU(e);if(!r&&!(x_(t)&&x_(e)))return e;const o=(r?t:Object.keys(t)).length,a=r?e:Object.keys(e),u=a.length,c=r?new Array(u):{};let f=0;for(let h=0;h<u;h++){const g=r?h:a[h],m=t[g],y=e[g];if(m===y){c[g]=m,(r?h<o:Zhe.call(t,g))&&f++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){c[g]=y;continue}const S=A7(m,y,n+1);c[g]=S,S===m&&f++}return o===u&&f===o?t:c}function Uv(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function cU(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function x_(t){if(!dU(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!dU(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function dU(t){return Object.prototype.toString.call(t)==="[object Object]"}function Xhe(t){return new Promise(e=>{Tl.setTimeout(e,t)})}function __(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?A7(t,e):e}function LRe(t){return t}function Qhe(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function Jhe(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var hR=Symbol();function T7(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===hR?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function pR(t,e){return typeof t=="function"?t(...e):!!t}function epe(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??=e(),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}var Ph=(()=>{let t=()=>Khe;return{isServer(){return t()},setIsServer(e){t=e}}})();function A_(){let t,e;const n=new Promise((s,o)=>{t=s,e=o});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var tpe=Ghe;function npe(){let t=[],e=0,n=u=>{u()},r=u=>{u()},s=tpe;const o=u=>{e?t.push(u):s(()=>{n(u)})},a=()=>{const u=t;t=[],u.length&&s(()=>{r(()=>{u.forEach(c=>{n(c)})})})};return{batch:u=>{let c;e++;try{c=u()}finally{e--,e||a()}return c},batchCalls:u=>(...c)=>{o(()=>{u(...c)})},schedule:o,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{s=u}}}var Dn=npe(),rpe=class extends bd{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#e}},Fv=new rpe;function spe(t){return Math.min(1e3*2**t,3e4)}function R7(t){return(t??"online")==="online"?Fv.isOnline():!0}var T_=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function I7(t){let e=!1,n=0,r;const s=A_(),o=()=>s.status!=="pending",a=E=>{if(!o()){const C=new T_(E);m(C),t.onCancel?.(C)}},u=()=>{e=!0},c=()=>{e=!1},f=()=>dR.isFocused()&&(t.networkMode==="always"||Fv.isOnline())&&t.canRun(),h=()=>R7(t.networkMode)&&t.canRun(),g=E=>{o()||(r?.(),s.resolve(E))},m=E=>{o()||(r?.(),s.reject(E))},y=()=>new Promise(E=>{r=C=>{(o()||f())&&E(C)},t.onPause?.()}).then(()=>{r=void 0,o()||t.onContinue?.()}),S=()=>{if(o())return;let E;const C=n===0?t.initialPromise:void 0;try{E=C??t.fn()}catch(w){E=Promise.reject(w)}Promise.resolve(E).then(g).catch(w=>{if(o())return;const T=t.retry??(Ph.isServer()?0:3),x=t.retryDelay??spe,R=typeof x=="function"?x(n,w):x,M=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,w);if(e||!M){m(w);return}n++,t.onFail?.(n,w),Xhe(R).then(()=>f()?void 0:y()).then(()=>{e?m(w):S()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:c,canStart:h,start:()=>(h()?S():y().then(S),s)}}var O7=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),w_(this.gcTime)&&(this.#e=Tl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ph.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Tl.clearTimeout(this.#e),this.#e=void 0)}};function ope(t){return{onFetch:(e,n)=>{const r=e.options,s=e.fetchOptions?.meta?.fetchMore?.direction,o=e.state.data?.pages||[],a=e.state.data?.pageParams||[];let u={pages:[],pageParams:[]},c=0;const f=async()=>{let h=!1;const g=S=>{epe(S,()=>e.signal,()=>h=!0)},m=T7(e.options,e.fetchOptions),y=async(S,E,C)=>{if(h)return Promise.reject(e.signal.reason);if(E==null&&S.pages.length)return Promise.resolve(S);const T=(()=>{const N={client:e.client,queryKey:e.queryKey,pageParam:E,direction:C?"backward":"forward",meta:e.options.meta};return g(N),N})(),x=await m(T),{maxPages:R}=e.options,M=C?Jhe:Qhe;return{pages:M(S.pages,x,R),pageParams:M(S.pageParams,E,R)}};if(s&&o.length){const S=s==="backward",E=S?N7:R_,C={pages:o,pageParams:a},w=E(r,C);u=await y(C,w,S)}else{const S=t??o.length;do{const E=c===0?a[0]??r.initialPageParam:R_(r,u);if(c>0&&E==null)break;u=await y(u,E),c++}while(c<S)}return u};e.options.persister?e.fetchFn=()=>e.options.persister?.(f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=f}}}function R_(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function N7(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}function URe(t,e){return e?R_(t,e)!=null:!1}function FRe(t,e){return!e||!t.getPreviousPageParam?!1:N7(t,e)!=null}var ipe=class extends O7{#e;#t;#n;#r;#o;#s;#a;#i;constructor(t){super(),this.#i=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#o=t.client,this.#r=this.#o.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=hU(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#s?.promise}setOptions(t){if(this.options={...this.#a,...t},t?._type&&(this.#e=t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=hU(this.options);e.data!==void 0&&(this.setState(fU(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(t,e){const n=__(this.state.data,t,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t){this.#l({type:"setState",state:t})}cancel(t){const e=this.#s?.promise;return this.#s?.cancel(t),e?e.then(Er).catch(Er):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>is(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hR||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ma(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!_7(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#s&&(this.#i||this.#c()?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},s=()=>{const c=T7(this.options,e),h=(()=>{const g={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(g),g})();return this.#i=!1,this.options.persister?this.options.persister(c,h,this):c(h)},a=(()=>{const c={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:s};return r(c),c})();(this.#e==="infinite"?ope(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:"fetch",meta:a.fetchOptions?.meta}),this.#s=I7({initialPromise:e?.initialPromise,fn:a.fetchFn,onCancel:c=>{c instanceof T_&&c.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(c,f)=>{this.#l({type:"failed",failureCount:c,error:f})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const c=await this.#s.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#r.config.onSuccess?.(c,this),this.#r.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof T_){if(c.silent)return this.#s.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#l({type:"error",error:c}),this.#r.config.onError?.(c,this),this.#r.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#l(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...M7(n.data,this.options),fetchMeta:t.meta??null};case"success":const r={...n,...fU(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=t.manual?r:void 0,r;case"error":const s=t.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),Dn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:t})})}};function M7(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:R7(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function fU(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function hU(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ape=class extends bd{constructor(t,e){super(),this.options=e,this.#e=t,this.#i=null,this.#a=A_(),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#n=void 0;#r=void 0;#o;#s;#a;#i;#c;#l;#p;#d;#f;#u;#g=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),pU(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return I_(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return I_(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#E(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof is(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#t.setOptions(this.options),e._defaulted&&!Uv(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&gU(this.#t,n,this.options,e)&&this.#h(),this.updateResult(),r&&(this.#t!==n||is(this.options.enabled,this.#t)!==is(e.enabled,this.#t)||Ma(this.options.staleTime,this.#t)!==Ma(e.staleTime,this.#t))&&this.#m();const s=this.#v();r&&(this.#t!==n||is(this.options.enabled,this.#t)!==is(e.enabled,this.#t)||s!==this.#u)&&this.#y(s)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),n=this.createResult(e,t);return upe(this,n)&&(this.#r=n,this.#s=this.options,this.#o=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(t,e){return new Proxy(t,{get:(n,r)=>(this.trackProp(r),e?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(t){this.#g.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),n=this.#e.getQueryCache().build(this.#e,e);return n.fetch().then(()=>this.createResult(n,e))}fetch(t){return this.#h({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(t){this.#C();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Er)),e}#m(){this.#S();const t=Ma(this.options.staleTime,this.#t);if(Ph.isServer()||this.#r.isStale||!w_(t))return;const n=_7(this.#r.dataUpdatedAt,t)+1;this.#d=Tl.setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(t){this.#E(),this.#u=t,!(Ph.isServer()||is(this.options.enabled,this.#t)===!1||!w_(this.#u)||this.#u===0)&&(this.#f=Tl.setInterval(()=>{(this.options.refetchIntervalInBackground||dR.isFocused())&&this.#h()},this.#u))}#b(){this.#m(),this.#y(this.#v())}#S(){this.#d!==void 0&&(Tl.clearTimeout(this.#d),this.#d=void 0)}#E(){this.#f!==void 0&&(Tl.clearInterval(this.#f),this.#f=void 0)}createResult(t,e){const n=this.#t,r=this.options,s=this.#r,o=this.#o,a=this.#s,c=t!==n?t.state:this.#n,{state:f}=t;let h={...f},g=!1,m;if(e._optimisticResults){const k=this.hasListeners(),F=!k&&pU(t,e),H=k&&gU(t,n,e,r);(F||H)&&(h={...h,...M7(f.data,t.options)}),e._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:y,errorUpdatedAt:S,status:E}=h;m=h.data;let C=!1;if(e.placeholderData!==void 0&&m===void 0&&E==="pending"){let k;s?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(k=s.data,C=!0):k=typeof e.placeholderData=="function"?e.placeholderData(this.#p?.state.data,this.#p):e.placeholderData,k!==void 0&&(E="success",m=__(s?.data,k,e),g=!0)}if(e.select&&m!==void 0&&!C)if(s&&m===o?.data&&e.select===this.#c)m=this.#l;else try{this.#c=e.select,m=e.select(m),m=__(s?.data,m,e),this.#l=m,this.#i=null}catch(k){this.#i=k}this.#i&&(y=this.#i,m=this.#l,S=Date.now(),E="error");const w=h.fetchStatus==="fetching",T=E==="pending",x=E==="error",R=T&&w,M=m!==void 0,O={status:E,fetchStatus:h.fetchStatus,isPending:T,isSuccess:E==="success",isError:x,isInitialLoading:R,isLoading:R,data:m,dataUpdatedAt:h.dataUpdatedAt,error:y,errorUpdatedAt:S,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!T,isLoadingError:x&&!M,isPaused:h.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:x&&M,isStale:gR(t,e),refetch:this.refetch,promise:this.#a,isEnabled:is(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const k=O.data!==void 0,F=O.status==="error"&&!k,H=q=>{F?q.reject(O.error):k&&q.resolve(O.data)},D=()=>{const q=this.#a=O.promise=A_();H(q)},z=this.#a;switch(z.status){case"pending":t.queryHash===n.queryHash&&H(z);break;case"fulfilled":(F||O.data!==z.value)&&D();break;case"rejected":(!F||O.error!==z.reason)&&D();break}}return O}updateResult(){const t=this.#r,e=this.createResult(this.#t,this.options);if(this.#o=this.#t.state,this.#s=this.options,this.#o.data!==void 0&&(this.#p=this.#t),Uv(e,t))return;this.#r=e;const n=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!this.#g.size)return!0;const o=new Set(s??this.#g);return this.options.throwOnError&&o.add("error"),Object.keys(this.#r).some(a=>{const u=a;return this.#r[u]!==t[u]&&o.has(u)})};this.#w({listeners:n()})}#C(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#n=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(t){Dn.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function lpe(t,e){return is(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&is(e.retryOnMount,t)===!1)}function pU(t,e){return lpe(t,e)||t.state.data!==void 0&&I_(t,e,e.refetchOnMount)}function I_(t,e,n){if(is(e.enabled,t)!==!1&&Ma(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&gR(t,e)}return!1}function gU(t,e,n,r){return(t!==e||is(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&gR(t,n)}function gR(t,e){return is(e.enabled,t)!==!1&&t.isStaleByTime(Ma(e.staleTime,t))}function upe(t,e){return!Uv(t.getCurrentResult(),e)}var cpe=class extends O7{#e;#t;#n;#r;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#t=[],this.state=t.state||P7(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#o({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=I7({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,a)=>{this.#o({type:"failed",failureCount:o,error:a})},onPause:()=>{this.#o({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",s=!this.#r.canStart();try{if(r)e();else{this.#o({type:"pending",variables:t,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,n);const a=await this.options.onMutate?.(t,n);a!==this.state.context&&this.#o({type:"pending",context:a,variables:t,isPaused:s})}const o=await this.#r.start();return await this.#n.config.onSuccess?.(o,t,this.state.context,this,n),await this.options.onSuccess?.(o,t,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,t,this.state.context,n),this.#o({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,t,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(o,t,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,o,t,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#o({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#o(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Dn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function P7(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var k7=class extends bd{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(t,e,n){const r=new cpe({client:t,mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:n});return this.add(r),r}add(t){this.#e.add(t);const e=lm(t);if(typeof e=="string"){const n=this.#t.get(e);n?n.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=lm(t);if(typeof e=="string"){const n=this.#t.get(e);if(n)if(n.length>1){const r=n.indexOf(t);r!==-1&&n.splice(r,1)}else n[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=lm(t);if(typeof e=="string"){const r=this.#t.get(e)?.find(s=>s.state.status==="pending");return!r||r===t}else return!0}runNext(t){const e=lm(t);return typeof e=="string"?this.#t.get(e)?.find(r=>r!==t&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Dn.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(n=>uU(e,n))}findAll(t={}){return this.getAll().filter(e=>uU(t,e))}notify(t){Dn.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return Dn.batch(()=>Promise.all(t.map(e=>e.continue().catch(Er))))}};function lm(t){return t.options.scope?.id}var dpe=class extends bd{#e;#t=void 0;#n;#r;constructor(e,n){super(),this.#e=e,this.setOptions(n),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const n=this.options;this.options=this.#e.defaultMutationOptions(e),Uv(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Xl(n.mutationKey)!==Xl(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#o(),this.#s(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#o(),this.#s()}mutate(e,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#o(){const e=this.#n?.state??P7();this.#t={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#s(e){Dn.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#r.onSuccess?.(e.data,n,r,s)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(e.data,null,n,r,s)}catch(o){Promise.reject(o)}}else if(e?.type==="error"){try{this.#r.onError?.(e.error,n,r,s)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(void 0,e.error,n,r,s)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#t)})})}},D7=class extends bd{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,n){const r=e.queryKey,s=e.queryHash??fR(r,e);let o=this.get(s);return o||(o=new ipe({client:t,queryKey:r,queryHash:s,options:t.defaultQueryOptions(e),state:n,defaultOptions:t.getQueryDefaults(r)}),this.add(o)),o}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Dn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(n=>lU(e,n))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(n=>lU(t,n)):e}notify(t){Dn.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){Dn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Dn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fpe=class{#e;#t;#n;#r;#o;#s;#a;#i;constructor(t={}){this.#e=t.queryCache||new D7,this.#t=t.mutationCache||new k7,this.#n=t.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#a=dR.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Fv.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#a?.(),this.#a=void 0,this.#i?.(),this.#i=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=this.#e.build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Ma(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),o=this.#e.get(r.queryHash)?.state.data,a=Yhe(e,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Dn.batch(()=>this.#e.findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;Dn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=this.#e;return Dn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Dn.batch(()=>this.#e.findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Er).catch(Er)}invalidateQueries(t,e={}){return Dn.batch(()=>(this.#e.findAll(t).forEach(n=>{n.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Dn.batch(()=>this.#e.findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Er)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Er)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=this.#e.build(this,e);return n.isStaleByTime(Ma(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Er).catch(Er)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Er).catch(Er)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Fv.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#r.set(Xl(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#r.values()],n={};return e.forEach(r=>{Mh(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){this.#o.set(Xl(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#o.values()],n={};return e.forEach(r=>{Mh(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=fR(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===hR&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},L7=_.createContext(void 0),vb=t=>{const e=_.useContext(L7);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},hpe=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),I.jsx(L7.Provider,{value:t,children:e})),U7=_.createContext(!1),ppe=()=>_.useContext(U7);U7.Provider;function gpe(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var mpe=_.createContext(gpe()),vpe=()=>_.useContext(mpe),ype=(t,e,n)=>{const r=n?.state.error&&typeof t.throwOnError=="function"?pR(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},bpe=t=>{_.useEffect(()=>{t.clearReset()},[t])},Spe=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||pR(n,[t.error,r])),Epe=t=>{if(t.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Cpe=(t,e)=>t.isLoading&&t.isFetching&&!e,wpe=(t,e)=>t?.suspense&&e.isPending,mU=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function xpe(t,e,n){const r=ppe(),s=vpe(),o=vb(),a=o.defaultQueryOptions(t);o.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const u=o.getQueryCache().get(a.queryHash),c=t.subscribed!==!1;a._optimisticResults=r?"isRestoring":c?"optimistic":void 0,Epe(a),ype(a,s,u),bpe(s);const f=!o.getQueryCache().get(a.queryHash),[h]=_.useState(()=>new e(o,a)),g=h.getOptimisticResult(a),m=!r&&c;if(_.useSyncExternalStore(_.useCallback(y=>{const S=m?h.subscribe(Dn.batchCalls(y)):Er;return h.updateResult(),S},[h,m]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),_.useEffect(()=>{h.setOptions(a)},[a,h]),wpe(a,g))throw mU(a,h,s);if(Spe({result:g,errorResetBoundary:s,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw g.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(a,g),a.experimental_prefetchInRender&&!Ph.isServer()&&Cpe(g,r)&&(f?mU(a,h,s):u?.promise)?.catch(Er).finally(()=>{h.updateResult()}),a.notifyOnChangeProps?g:h.trackResult(g)}function F7(t,e){return xpe(t,ape)}function _pe(t,e){const n=vb(),[r]=_.useState(()=>new dpe(n,t));_.useEffect(()=>{r.setOptions(t)},[r,t]);const s=_.useSyncExternalStore(_.useCallback(a=>r.subscribe(Dn.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=_.useCallback((a,u)=>{r.mutate(a,u).catch(Er)},[r]);if(s.error&&pR(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}const Ape="modulepreload",Tpe=function(t){return"/"+t},vU={},Un=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let c=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),u=a?.nonce||a?.getAttribute("nonce");s=c(n.map(f=>{if(f=Tpe(f),f in vU)return;vU[f]=!0;const h=f.endsWith(".css"),g=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Ape,h||(m.as="script"),m.crossOrigin="",m.href=f,u&&m.setAttribute("nonce",u),document.head.appendChild(m),h)return new Promise((y,S)=>{m.addEventListener("load",y),m.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return s.then(a=>{for(const u of a||[])u.status==="rejected"&&o(u.reason);return e().catch(o)})};var yU=_.use,Rc=typeof window<"u"?_.useLayoutEffect:_.useEffect;function Vw(t){const e=_.useRef({value:t,prev:null}),n=e.current.value;return t!==n&&(e.current={value:t,prev:n}),e.current.prev}function Rpe(t,e,n={},r={}){_.useEffect(()=>{if(!t.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([o])=>{e(o)},n);return s.observe(t.current),()=>{s.disconnect()}},[e,n,r.disabled,t])}function Ipe(t){const e=_.useRef(null);return _.useImperativeHandle(t,()=>e.current,[]),e}const z7=!1;function kh(t){return t[t.length-1]}function Ope(t){return typeof t=="function"}function Rl(t,e){return Ope(t)?t(e):t}const j7=Object.prototype.hasOwnProperty,bU=Object.prototype.propertyIsEnumerable;function B7(t){for(const e in t)if(j7.call(t,e))return!0;return!1}const Npe=()=>Object.create(null),El=(t,e)=>Il(t,e,Npe);function Il(t,e,n=()=>({}),r=0){if(t===e)return t;if(r>500)return e;const s=e,o=CU(t)&&CU(s);if(!o&&!(zv(t)&&zv(s)))return s;const a=o?t:SU(t);if(!a)return s;const u=o?s:SU(s);if(!u)return s;const c=a.length,f=u.length,h=o?new Array(f):n();let g=0;for(let m=0;m<f;m++){const y=o?m:u[m],S=t[y],E=s[y];if(S===E){h[y]=S,(o?m<c:j7.call(t,y))&&g++;continue}if(S===null||E===null||typeof S!="object"||typeof E!="object"){h[y]=E;continue}const C=Il(S,E,n,r+1);h[y]=C,C===S&&g++}return c===f&&g===c?t:h}function SU(t){const e=Object.getOwnPropertyNames(t);for(const s of e)if(!bU.call(t,s))return!1;const n=Object.getOwnPropertySymbols(t);if(n.length===0)return e;const r=e;for(const s of n){if(!bU.call(t,s))return!1;r.push(s)}return r}function zv(t){if(!EU(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const n=e.prototype;return!(!EU(n)||!n.hasOwnProperty("isPrototypeOf"))}function EU(t){return Object.prototype.toString.call(t)==="[object Object]"}function CU(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ll(t,e,n){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0,s=t.length;r<s;r++)if(!Ll(t[r],e[r],n))return!1;return!0}if(zv(t)&&zv(e)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const a in e)if((!r||e[a]!==void 0)&&!Ll(t[a],e[a],n))return!1;return!0}let s=0;if(!r)s=Object.keys(t).length;else for(const a in t)t[a]!==void 0&&s++;let o=0;for(const a in e)if((!r||e[a]!==void 0)&&(o++,o>s||!Ll(t[a],e[a],n)))return!1;return s===o}return!1}function Vc(t){let e,n;const r=new Promise((s,o)=>{e=s,n=o});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,e(s),t?.(s)},r.reject=s=>{r.status="rejected",n(s)},r}function Mpe(t){return typeof t?.message!="string"?!1:t.message.startsWith("Failed to fetch dynamically imported module")||t.message.startsWith("error loading dynamically imported module")||t.message.startsWith("Importing a module script failed")}function Dh(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}const Ppe=/[\x00-\x1f\x7f"<>`{}]/g;function kpe(t){return t.replace(Ppe,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function wU(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return kpe(e)}const Dpe=["http:","https:","mailto:","tel:"];function jv(t,e){if(!t)return!1;try{const n=new URL(t);return!e.has(n.protocol)}catch{return!1}}function zf(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};const e=/%25|%5C/gi;let n=0,r="",s;for(;(s=e.exec(t))!==null;)r+=wU(t.slice(n,s.index))+s[0],n=e.lastIndex;r=r+wU(n?t.slice(n):t);let o=!1;return r.startsWith("//")&&(o=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:o}}function Lpe(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}function Upe(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function mi(){throw new Error("Invariant failed")}function Lh(t){const e=new Map;let n,r;const s=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,n=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const a=e.get(o);if(a)return s(a),a.value},set(o,a){if(e.size>=t&&n){const c=n;e.delete(c.key),c.next&&(n=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const u=e.get(o);if(u)u.value=a,s(u);else{const c={key:o,value:a,prev:r};r&&(r.next=c),r=c,n||(n=c),e.set(o,c)}},clear(){e.clear(),n=void 0,r=void 0}}}const Ra=4,$7=5;function Fpe(t){const e=t.indexOf("{");if(e===-1)return null;const n=t.indexOf("}",e);return n===-1||e+1>=t.length?null:[e,n]}function H7(t,e,n=new Uint16Array(6)){const r=t.indexOf("/",e),s=r===-1?t.length:r,o=t.substring(e,s);if(!o||!o.includes("$"))return n[0]=0,n[1]=e,n[2]=e,n[3]=s,n[4]=s,n[5]=s,n;if(o==="$"){const u=t.length;return n[0]=2,n[1]=e,n[2]=e,n[3]=u,n[4]=u,n[5]=u,n}if(o.charCodeAt(0)===36)return n[0]=1,n[1]=e,n[2]=e+1,n[3]=s,n[4]=s,n[5]=s,n;const a=Fpe(o);if(a){const[u,c]=a,f=o.charCodeAt(u+1);if(f===45){if(u+2<o.length&&o.charCodeAt(u+2)===36){const h=u+3,g=c;if(h<g)return n[0]=3,n[1]=e+u,n[2]=e+h,n[3]=e+g,n[4]=e+c+1,n[5]=s,n}}else if(f===36){const h=u+1,g=u+2;return g===c?(n[0]=2,n[1]=e+u,n[2]=e+h,n[3]=e+g,n[4]=e+c+1,n[5]=t.length,n):(n[0]=1,n[1]=e+u,n[2]=e+g,n[3]=e+c,n[4]=e+c+1,n[5]=s,n)}}return n[0]=0,n[1]=e,n[2]=e,n[3]=s,n[4]=s,n[5]=s,n}function yb(t,e,n,r,s,o,a){a?.(n);let u=r;{const c=n.fullPath??n.from,f=c.length,h=n.options?.caseSensitive??t,g=n.options?.params?.parse??n.options?.parseParams;for(;u<f;){const y=H7(c,u,e);let S;const E=u,C=y[5];switch(u=C+1,o++,y[0]){case 0:{const w=c.substring(y[2],y[3]);if(h){const T=s.static?.get(w);if(T)S=T;else{s.static??=new Map;const x=Ol(n.fullPath??n.from);x.parent=s,x.depth=o,S=x,s.static.set(w,x)}}else{const T=w.toLowerCase(),x=s.staticInsensitive?.get(T);if(x)S=x;else{s.staticInsensitive??=new Map;const R=Ol(n.fullPath??n.from);R.parent=s,R.depth=o,S=R,s.staticInsensitive.set(T,R)}}break}case 1:{const w=c.substring(E,y[1]),T=c.substring(y[4],C),x=h&&!!(w||T),R=w?x?w:w.toLowerCase():void 0,M=T?x?T:T.toLowerCase():void 0,N=!g&&s.dynamic?.find(O=>!O.parse&&O.caseSensitive===x&&O.prefix===R&&O.suffix===M);if(N)S=N;else{const O=Kw(1,n.fullPath??n.from,x,R,M);S=O,O.depth=o,O.parent=s,s.dynamic??=[],s.dynamic.push(O)}break}case 3:{const w=c.substring(E,y[1]),T=c.substring(y[4],C),x=h&&!!(w||T),R=w?x?w:w.toLowerCase():void 0,M=T?x?T:T.toLowerCase():void 0,N=!g&&s.optional?.find(O=>!O.parse&&O.caseSensitive===x&&O.prefix===R&&O.suffix===M);if(N)S=N;else{const O=Kw(3,n.fullPath??n.from,x,R,M);S=O,O.parent=s,O.depth=o,s.optional??=[],s.optional.push(O)}break}case 2:{const w=c.substring(E,y[1]),T=c.substring(y[4],C),x=h&&!!(w||T),R=w?x?w:w.toLowerCase():void 0,M=T?x?T:T.toLowerCase():void 0,N=Kw(2,n.fullPath??n.from,x,R,M);S=N,N.parent=s,N.depth=o,s.wildcard??=[],s.wildcard.push(N)}}s=S}if(g&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const y=Ol(n.fullPath??n.from);y.kind=$7,y.parent=s,o++,y.depth=o,s.pathless??=[],s.pathless.push(y),s=y}const m=(n.path||!n.children)&&!n.isRoot;if(m&&c.endsWith("/")){const y=Ol(n.fullPath??n.from);y.kind=Ra,y.parent=s,o++,y.depth=o,s.index=y,s=y}s.parse=g??null,s.priority=n.options?.params?.priority??0,m&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const c of n.children)yb(t,e,c,u,s,o,a)}function Gw(t,e){if(t.parse&&!e.parse)return-1;if(!t.parse&&e.parse)return 1;if(t.parse&&e.parse&&(t.priority||e.priority))return e.priority-t.priority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}function ba(t){if(t.pathless)for(const e of t.pathless)ba(e);if(t.static)for(const e of t.static.values())ba(e);if(t.staticInsensitive)for(const e of t.staticInsensitive.values())ba(e);if(t.dynamic?.length){t.dynamic.sort(Gw);for(const e of t.dynamic)ba(e)}if(t.optional?.length){t.optional.sort(Gw);for(const e of t.optional)ba(e)}if(t.wildcard?.length){t.wildcard.sort(Gw);for(const e of t.wildcard)ba(e)}}function Ol(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0}}function Kw(t,e,n,r,s){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:s}}function zpe(t,e){const n=Ol("/"),r=new Uint16Array(6);for(const s of t)yb(!1,r,s,1,n,0);ba(n),e.masksTree=n,e.flatCache=Lh(1e3)}function jpe(t,e){t||="/";const n=e.flatCache.get(t);if(n)return n;const r=mR(t,e.masksTree);return e.flatCache.set(t,r),r}function Bpe(t,e,n,r,s){t||="/",r||="/";const o=e?`case\0${t}`:t;let a=s.singleCache.get(o);return a||(a=Ol("/"),yb(e,new Uint16Array(6),{from:t},1,a,0),s.singleCache.set(o,a)),mR(r,a,n)}function $pe(t,e,n=!1){const r=n?t:`nofuzz\0${t}`,s=e.matchCache.get(r);if(s!==void 0)return s;t||="/";let o;try{o=mR(t,e.segmentTree,n)}catch(a){if(a instanceof URIError)o=null;else throw a}return o&&(o.branch=W7(o.route)),e.matchCache.set(r,o),o}function Hpe(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function qpe(t,e=!1,n){const r=Ol(t.fullPath),s=new Uint16Array(6),o={},a={};let u=0;return yb(e,s,t,1,r,0,c=>{if(n?.(c,u),c.id in o&&mi(),o[c.id]=c,u!==0&&c.path){const f=Hpe(c.fullPath);(!a[f]||c.fullPath.endsWith("/"))&&(a[f]=c)}u++}),ba(r),{processedTree:{segmentTree:r,singleCache:Lh(1e3),matchCache:Lh(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:a}}function mR(t,e,n=!1){const r=t.split("/"),s=Vpe(t,r,e,n);if(!s)return null;const[o]=q7(t,r,s);return{route:s.node.route,rawParams:o}}function q7(t,e,n){const r=Wpe(n.node);let s=null;const o=Object.create(null);let a=n.extract?.part??0,u=n.extract?.node??0,c=n.extract?.path??0,f=n.extract?.segment??0;for(;u<r.length;a++,u++,c++,f++){const h=r[u];if(h.kind===Ra)break;if(h.kind===$7){f--,a--,c--;continue}const g=e[a],m=c;if(g&&(c+=g.length),h.kind===1){s??=n.node.fullPath.split("/");const y=s[f],S=h.prefix?.length??0;if(y.charCodeAt(S)===123){const E=h.suffix?.length??0,C=y.substring(S+2,y.length-E-1),w=g.substring(S,g.length-E);o[C]=decodeURIComponent(w)}else{const E=y.substring(1);o[E]=decodeURIComponent(g)}}else if(h.kind===3){if(n.skipped&1<<u){a--,c=m-1;continue}s??=n.node.fullPath.split("/");const y=s[f],S=h.prefix?.length??0,E=h.suffix?.length??0,C=y.substring(S+3,y.length-E-1),w=h.suffix||h.prefix?g.substring(S,g.length-E):g;w&&(o[C]=decodeURIComponent(w))}else if(h.kind===2){const y=h,S=t.substring(m+(y.prefix?.length??0),t.length-(y.suffix?.length??0)),E=decodeURIComponent(S);o["*"]=E,o._splat=E;break}}return n.rawParams&&Object.assign(o,n.rawParams),[o,{part:a,node:u,path:c,segment:f}]}function W7(t){const e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}function Wpe(t){const e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}function Vpe(t,e,n,r){if(t==="/"&&n.index)return{node:n.index,skipped:0};const s=!kh(e),o=s&&t!=="/",a=e.length-(s?1:0),u=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let c=null,f=null;for(;u.length;){const h=u.pop(),{node:g,index:m,skipped:y,depth:S,statics:E,dynamics:C,optionals:w}=h;let{extract:T,rawParams:x}=h;if(g.kind===2&&g.route&&!cm(f,h))continue;if(g.parse){if(!xU(t,e,h))continue;x=h.rawParams,T=h.extract}r&&g.route&&g.kind!==Ra&&cm(c,h)&&(c=h);const R=m===a;if(R&&(g.route&&(!o||g.kind===Ra||g.kind===2)&&cm(f,h)&&(f=h),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const M=R?void 0:e[m];let N;if(R&&g.index){const O={node:g.index,index:m,skipped:y,depth:S+1,statics:E,dynamics:C,optionals:w,extract:T,rawParams:x};let k=!0;if(g.index.parse&&(xU(t,e,O)||(k=!1)),k){if(!C&&!w&&!y&&Gpe(E,a))return O;cm(f,O)&&(f=O)}}if(g.wildcard)for(let O=g.wildcard.length-1;O>=0;O--){const k=g.wildcard[O],{prefix:F,suffix:H}=k;if(!(F&&(R||!(k.caseSensitive?M:N??=M.toLowerCase()).startsWith(F)))){if(H){if(R)continue;const D=e.slice(m).join("/").slice(-H.length);if((k.caseSensitive?D:D.toLowerCase())!==H)continue}u.push({node:k,index:a,skipped:y,depth:S+1,statics:E,dynamics:C,optionals:w,extract:T,rawParams:x})}}if(g.optional){const O=y|1<<S,k=S+1;for(let F=g.optional.length-1;F>=0;F--){const H=g.optional[F];u.push({node:H,index:m,skipped:O,depth:k,statics:E,dynamics:C,optionals:w,extract:T,rawParams:x})}if(!R)for(let F=g.optional.length-1;F>=0;F--){const H=g.optional[F],{prefix:D,suffix:z}=H;if(D||z){const q=H.caseSensitive?M:N??=M.toLowerCase();if(D&&!q.startsWith(D)||z&&!q.endsWith(z))continue}u.push({node:H,index:m+1,skipped:y,depth:k,statics:E,dynamics:C,optionals:w+um(a,m),extract:T,rawParams:x})}}if(!R&&g.dynamic&&M)for(let O=g.dynamic.length-1;O>=0;O--){const k=g.dynamic[O],{prefix:F,suffix:H}=k;if(F||H){const D=k.caseSensitive?M:N??=M.toLowerCase();if(F&&!D.startsWith(F)||H&&!D.endsWith(H))continue}u.push({node:k,index:m+1,skipped:y,depth:S+1,statics:E,dynamics:C+um(a,m),optionals:w,extract:T,rawParams:x})}if(!R&&g.staticInsensitive){const O=g.staticInsensitive.get(N??=M.toLowerCase());O&&u.push({node:O,index:m+1,skipped:y,depth:S+1,statics:E+um(a,m),dynamics:C,optionals:w,extract:T,rawParams:x})}if(!R&&g.static){const O=g.static.get(M);O&&u.push({node:O,index:m+1,skipped:y,depth:S+1,statics:E+um(a,m),dynamics:C,optionals:w,extract:T,rawParams:x})}if(g.pathless){const O=S+1;for(let k=g.pathless.length-1;k>=0;k--){const F=g.pathless[k];u.push({node:F,index:m,skipped:y,depth:O,statics:E,dynamics:C,optionals:w,extract:T,rawParams:x})}}}if(f)return f;if(r&&c){let h=c.index;for(let m=0;m<c.index;m++)h+=e[m].length;const g=h===t.length?"/":t.slice(h);return c.rawParams??=Object.create(null),c.rawParams["**"]=decodeURIComponent(g),c}return null}function um(t,e){return 2**(t-e-1)}function Gpe(t,e){return t===2**(e-1)-1}function xU(t,e,n){let r,s;try{[r,s]=q7(t,e,n)}catch{return null}if(n.rawParams=r,n.extract=s,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function cm(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===Ra)>(t.node.kind===Ra)||e.node.kind===Ra==(t.node.kind===Ra)&&e.depth>t.depth))):!0}function lv(t){return vR(t.filter(e=>e!==void 0).join("/"))}function vR(t){return t.replace(/\/{2,}/g,"/")}function V7(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function pi(t){const e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}function G7(t){return pi(V7(t))}function Bv(t,e){return t?.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}function Kpe(t,e,n){return Bv(t,n)===Bv(e,n)}function Ype({base:t,to:e,trailingSlash:n="never",cache:r}){const s=e.startsWith("/"),o=!s&&e===".";let a;if(r){a=s?e:o?t:t+"\0"+e;const f=r.get(a);if(f)return f}let u;if(o)u=t.split("/");else if(s)u=e.split("/");else{for(u=t.split("/");u.length>1&&kh(u)==="";)u.pop();const f=e.split("/");for(let h=0,g=f.length;h<g;h++){const m=f[h];m===""?h?h===g-1&&u.push(m):u=[m]:m===".."?u.pop():m==="."||u.push(m)}}u.length>1&&(kh(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));const c=vR(u.join("/"))||"/";return a&&r&&r.set(a,c),c}function Zpe(t){const e=new Map(t.map(s=>[encodeURIComponent(s),s])),n=Array.from(e.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return s=>s.replace(r,o=>e.get(o)??o)}function Yw(t,e,n){const r=e[t];return typeof r!="string"?r:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>AU(s,n)).join("/"):AU(r,n)}function _U({path:t,params:e,decoder:n,...r}){let s=!1;const o=Object.create(null);if(!t||t==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:s};if(!t.includes("$"))return{interpolatedPath:t,usedParams:o,isMissingParams:s};const a=t.length;let u=0,c,f="";for(;u<a;){const h=u;c=H7(t,h,c);const g=c[5];if(u=g+1,h===g)continue;const m=c[0];if(m===0){f+="/"+t.substring(h,g);continue}if(m===2){const y=e._splat;o._splat=y,o["*"]=y;const S=t.substring(h,c[1]),E=t.substring(c[4],g);if(!y){s=!0,(S||E)&&(f+="/"+S+E);continue}const C=Yw("_splat",e,n);f+="/"+S+C+E;continue}if(m===1){const y=t.substring(c[2],c[3]);!s&&!(y in e)&&(s=!0),o[y]=e[y];const S=t.substring(h,c[1]),E=t.substring(c[4],g),C=Yw(y,e,n)??"undefined";f+="/"+S+C+E;continue}if(m===3){const y=t.substring(c[2],c[3]),S=e[y];if(S==null)continue;o[y]=S;const E=t.substring(h,c[1]),C=t.substring(c[4],g),w=Yw(y,e,n)??"";f+="/"+E+w+C;continue}}return t.endsWith("/")&&(f+="/"),{usedParams:o,interpolatedPath:f||"/",isMissingParams:s}}function AU(t,e){const n=encodeURIComponent(t);return e?.(n)??n}function hr(t){return t?.isNotFound===!0}function Xpe(){try{return sessionStorage}catch{return}}const Qpe="tsr-scroll-restoration-v1_3",K7=Xpe();function Jpe(){try{return JSON.parse(K7?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}function ege(){try{K7?.setItem(Qpe,JSON.stringify(Sc))}catch{}}const Sc=Jpe(),TU="data-scroll-restoration-id",tge=t=>t.state.__TSR_key||t.href;function nge(t){const e=t.getAttribute(TU);if(e)return`[${TU}="${e}"]`;let n="",r=t,s;for(;s=r.parentNode;){let o=1,a=r;for(;a=a.previousElementSibling;)o++;const u=`${r.localName}:nth-child(${o})`;n=n?`${u} > ${n}`:u,r=s}return n}let dm=!1;const uv="window";function O_(t){try{return typeof t=="function"?t():document.querySelector(t)}catch{}}function RU(t){const e=new Set;for(const n of t){if(n===uv)continue;const r=O_(n);r&&e.add(r)}return e}function rge(t,e){const n=t.options.scrollRestoration,r=t._scroll;n&&(r.restoring=!0);const s=t.options.getScrollRestorationKey||tge,o=new Set,a=u=>{const c=Sc[u]||={};for(const f of o)f===document?c[uv]={scrollX,scrollY}:f.isConnected&&(c[nge(f)]={scrollX:f.scrollLeft,scrollY:f.scrollTop})};n&&!r.restoration&&(r.restoration=!0,dm=!1,history.scrollRestoration="manual",document.addEventListener("scroll",u=>{dm||o.add(u.target)},!0),t.subscribe("onBeforeLoad",u=>{u.fromLocation&&a(s(u.fromLocation)),o.clear()}),addEventListener("pagehide",()=>{a(s(t.stores.resolvedLocation.get()??t.stores.location.get())),ege()})),!r.reset&&(r.reset=!0,t.subscribe("onRendered",u=>{const c=t.options.scrollRestorationBehavior,f=t.options.scrollToTopSelectors,h=r.next,g=r.hash;let m;if(o.clear(),r.next=!0,r.hash=!1,typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return;const y=s(u.toLocation),S=u.fromLocation&&s(u.fromLocation);if(r.restoring&&S&&S!==y){const E=Sc[S];if(E){let C=Sc[y];for(const w in E){if(w===uv){if(h)continue}else{const T=O_(w);if(!T||h&&f&&(m??=RU(f),m.has(T)))continue}C||(C=Sc[y]={}),C[w]??=E[w]}}}dm=!0;try{const E=u.toLocation.hash,C=u.toLocation.state.__hashScrollIntoViewOptions??!0;let w=!1;if(h){!E&&f&&(m??=RU(f));const T=E&&C&&g,x=r.restoring?Sc[y]:void 0;if(x)for(const R in x){const{scrollX:M,scrollY:N}=x[R];if(R===uv){if(T)continue;scrollTo({top:N,left:M,behavior:c}),w=!0}else{const O=O_(R);O&&(O.scrollLeft=M,O.scrollTop=N,m?.delete(O))}}if(!E){const R={top:0,left:0,behavior:c};if(w||scrollTo(R),m)for(const M of m)M.scrollTo(R)}}!w&&E&&C&&document.getElementById(E)?.scrollIntoView(C)}finally{dm=!1}}))}function sge(t,e=String){const n=new URLSearchParams;for(const r in t){const s=t[r];s!==void 0&&n.set(r,e(s))}return n.toString()}function Zw(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function oge(t){const e=new URLSearchParams(t),n=Object.create(null);for(const[r,s]of e.entries()){const o=n[r];o==null?n[r]=Zw(s):Array.isArray(o)?o.push(Zw(s)):n[r]=[o,Zw(s)]}return n}const ige=lge(JSON.parse),age=uge(JSON.stringify,JSON.parse);function lge(t){return e=>{e[0]==="?"&&(e=e.substring(1));const n=oge(e);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=t(s)}catch{}}return n}}function uge(t,e){const n=typeof e=="function";function r(s){if(typeof s=="object"&&s!==null)try{return t(s)}catch{}else if(n&&typeof s=="string")try{return e(s),t(s)}catch{}return s}return s=>{const o=sge(s,r);return o?`?${o}`:""}}const Ul="__root__";function Y7(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);const n=new Response(null,{status:t.statusCode,headers:e});if(n.options=t,t.throw)throw n;return n}function zr(t){return t instanceof Response&&!!t.options}function cge(t){return{input:({url:e})=>{for(const n of t)e=N_(n,e);return e},output:({url:e})=>{for(let n=t.length-1;n>=0;n--)e=Z7(t[n],e);return e}}}function dge(t){const e=G7(t.basepath),n=`/${e}`,r=t.caseSensitive?n:n.toLowerCase(),s=`${r}/`;return{input:({url:o})=>{const a=t.caseSensitive?o.pathname:o.pathname.toLowerCase();return a===r?o.pathname="/":a.startsWith(s)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=lv(["/",e,o.pathname]),o)}}function N_(t,e){const n=t?.input?.({url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}function Z7(t,e){const n=t?.output?.({url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}function fge(t,e){const{createMutableStore:n,createReadonlyStore:r,batch:s,init:o}=e,a=new Map,u=new Map,c=new Map,f=n(t.status),h=n(t.loadedAt),g=n(t.isLoading),m=n(t.isTransitioning),y=n(t.location),S=n(t.resolvedLocation),E=n(t.statusCode),C=n(t.redirect),w=n([]),T=n([]),x=n([]),R=r(()=>Xw(a,w.get())),M=r(()=>Xw(u,T.get())),N=r(()=>Xw(c,x.get())),O=r(()=>w.get()[0]),k=r(()=>w.get().some(te=>a.get(te)?.get().status==="pending")),F=r(()=>({locationHref:y.get().href,resolvedLocationHref:S.get()?.href,status:f.get()})),H=r(()=>({status:f.get(),loadedAt:h.get(),isLoading:g.get(),isTransitioning:m.get(),matches:R.get(),location:y.get(),resolvedLocation:S.get(),statusCode:E.get(),redirect:C.get()})),D=Lh(64);function z(te){let fe=D.get(te);return fe||(fe=r(()=>{const ae=w.get();for(const xe of ae){const L=a.get(xe);if(L&&L.routeId===te)return L.get()}}),D.set(te,fe)),fe}const q={status:f,loadedAt:h,isLoading:g,isTransitioning:m,location:y,resolvedLocation:S,statusCode:E,redirect:C,matchesId:w,pendingIds:T,cachedIds:x,matches:R,pendingMatches:M,cachedMatches:N,firstId:O,hasPending:k,matchRouteDeps:F,matchStores:a,pendingMatchStores:u,cachedMatchStores:c,__store:H,getRouteMatchStore:z,setMatches:K,setPending:ee,setCached:$};K(t.matches),o?.(q);function K(te){Qw(te,a,w,n,s)}function ee(te){Qw(te,u,T,n,s)}function $(te){Qw(te,c,x,n,s)}return q}function Xw(t,e){const n=[];for(const r of e){const s=t.get(r);s&&n.push(s.get())}return n}function Qw(t,e,n,r,s){const o=t.map(u=>u.id),a=new Set(o);s(()=>{for(const u of e.keys())a.has(u)||e.delete(u);for(const u of t){const c=e.get(u.id);if(!c){const f=r(u);f.routeId=u.routeId,e.set(u.id,f);continue}c.routeId=u.routeId,c.get()!==u&&c.set(u)}Upe(n.get(),o)||n.set(o)})}const M_=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},hge=t=>t.stores.matchesId.get().some(e=>t.stores.matchStores.get(e)?.get()._forcePending),bb=(t,e)=>!!(t.preload&&!t.router.stores.matchStores.has(e)),Fl=(t,e,n=!0)=>{const r={...t.router.options.context??{}},s=n?e:e-1;for(let o=0;o<=s;o++){const a=t.matches[o];if(!a)continue;const u=t.router.getMatch(a.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},IU=(t,e)=>{if(!t.matches.length)return;const n=e.routeId,r=t.matches.findIndex(a=>a.routeId===t.router.routeTree.id),s=r>=0?r:0;let o=n?t.matches.findIndex(a=>a.routeId===n):t.firstBadMatchIndex??t.matches.length-1;o<0&&(o=s);for(let a=o;a>=0;a--){const u=t.matches[a];if(t.router.looseRoutesById[u.routeId].options.notFoundComponent)return a}return n?o:s},Ia=(t,e,n)=>{if(!(!zr(n)&&!hr(n)))throw zr(n)&&n.redirectHandled&&!n.options.reloadDocument||(e&&(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.loaderPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loaderPromise=void 0,e._nonReactive.error=n,t.updateMatch(e.id,r=>({...r,status:zr(n)?"redirected":hr(n)?"notFound":r.status==="pending"?"success":r.status,context:Fl(t,e.index),isFetching:!1,error:n})),hr(n)&&!n.routeId&&(n.routeId=e.routeId),e._nonReactive.loadPromise?.resolve()),zr(n)&&(t.rendered=!0,n.options._fromLocation=t.location,n.redirectHandled=!0,n=t.router.resolveRedirect(n))),n},X7=(t,e)=>{const n=t.router.getMatch(e);return!!(!n||n._nonReactive.dehydrated)},OU=(t,e,n)=>{const r=Fl(t,n);t.updateMatch(e,s=>({...s,context:r}))},jf=(t,e,n)=>{const{id:r,routeId:s}=t.matches[e],o=t.router.looseRoutesById[s];if(n instanceof Promise)throw n;t.firstBadMatchIndex??=e,Ia(t,t.router.getMatch(r),n);try{o.options.onError?.(n)}catch(a){n=a,Ia(t,t.router.getMatch(r),n)}t.updateMatch(r,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!t.preload&&!zr(n)&&!hr(n)&&(t.serialError??=n)},Q7=(t,e,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??t.router.options.defaultPendingMs;if(t.onReady&&!bb(t,e)&&(n.options.loader||n.options.beforeLoad||ez(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??t.router.options?.defaultPendingComponent)){const o=setTimeout(()=>{M_(t)},s);r._nonReactive.pendingTimeout=o}},pge=(t,e,n)=>{const r=t.router.getMatch(e);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Q7(t,e,n,r);const s=()=>{const o=t.router.getMatch(e);o.preload&&(o.status==="redirected"||o.status==="notFound")&&Ia(t,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},gge=(t,e,n,r)=>{const s=t.router.getMatch(e);let o=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Vc(()=>{o?.resolve(),o=void 0});const{paramsError:a,searchError:u}=s;a&&jf(t,n,a),u&&jf(t,n,u),Q7(t,e,r,s);const c=new AbortController;let f=!1;const h=()=>{f||(f=!0,t.updateMatch(e,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:c})))},g=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,t.updateMatch(e,R=>({...R,isFetching:!1}))};if(!r.options.beforeLoad){t.router.batch(()=>{h(),g()});return}s._nonReactive.beforeLoadPromise=Vc();const m={...Fl(t,n,!1),...s.__routeContext},{search:y,params:S,cause:E}=s,C=bb(t,e),w={search:y,abortController:c,params:S,preload:C,context:m,location:t.location,navigate:R=>t.router.navigate({...R,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:C?"preload":E,matches:t.matches,routeId:r.id,...t.router.options.additionalContext},T=R=>{if(R===void 0){t.router.batch(()=>{h(),g()});return}(zr(R)||hr(R))&&(h(),jf(t,n,R)),t.router.batch(()=>{h(),t.updateMatch(e,M=>({...M,__beforeLoadContext:R})),g()})};let x;try{if(x=r.options.beforeLoad(w),Dh(x))return h(),x.catch(R=>{jf(t,n,R)}).then(T)}catch(R){h(),jf(t,n,R)}T(x)},mge=(t,e)=>{const{id:n,routeId:r}=t.matches[e],s=t.router.looseRoutesById[r],o=()=>u(),a=()=>gge(t,n,e,s),u=()=>{if(X7(t,n))return;const c=pge(t,n,s);return Dh(c)?c.then(a):a()};return o()},vge=(t,e,n)=>{const r=t.router.getMatch(e);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:t.router.options.ssr,matches:t.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(s),n.options.scripts?.(s),n.options.headers?.(s)]).then(([o,a,u])=>({meta:o?.meta,links:o?.links,headScripts:o?.scripts,headers:u,scripts:a,styles:o?.styles}))},J7=(t,e,n,r,s)=>{const o=e[r-1],{params:a,loaderDeps:u,abortController:c,cause:f}=t.router.getMatch(n),h=Fl(t,r),g=bb(t,n);return{params:a,deps:u,preload:!!g,parentMatchPromise:o,abortController:c,context:h,location:t.location,navigate:m=>t.router.navigate({...m,_fromLocation:t.location}),cause:g?"preload":f,route:s,...t.router.options.additionalContext}},NU=async(t,e,n,r,s)=>{try{const o=t.router.getMatch(n);try{(!(z7??t.router.isServer)||o.ssr===!0)&&Uh(s);const a=s.options.loader,u=typeof a=="function"?a:a?.handler,c=u?.(J7(t,e,n,r,s)),f=!!u&&Dh(c);if((f||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||o._nonReactive.minPendingPromise)&&t.updateMatch(n,g=>({...g,isFetching:"loader"})),u){const g=f?await c:c;Ia(t,t.router.getMatch(n),g),g!==void 0&&t.updateMatch(n,m=>({...m,loaderData:g}))}s._lazyPromise&&await s._lazyPromise;const h=o._nonReactive.minPendingPromise;h&&await h,s._componentsPromise&&await s._componentsPromise,t.updateMatch(n,g=>({...g,error:void 0,context:Fl(t,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let u=a;if(u?.name==="AbortError"){if(o.abortController.signal.aborted){o._nonReactive.loaderPromise?.resolve(),o._nonReactive.loaderPromise=void 0;return}t.updateMatch(n,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:Fl(t,r)}));return}const c=o._nonReactive.minPendingPromise;c&&await c,hr(a)&&await s.options.notFoundComponent?.preload?.(),Ia(t,t.router.getMatch(n),a);try{s.options.onError?.(a)}catch(f){u=f,Ia(t,t.router.getMatch(n),f)}!zr(u)&&!hr(u)&&await Uh(s,["errorComponent"]),t.updateMatch(n,f=>({...f,error:u,context:Fl(t,r),status:"error",isFetching:!1}))}}catch(o){const a=t.router.getMatch(n);a&&(a._nonReactive.loaderPromise=void 0),Ia(t,a,o)}},yge=async(t,e,n)=>{async function r(y,S,E,C,w){const T=Date.now()-S.updatedAt,x=y?w.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:w.options.staleTime??t.router.options.defaultStaleTime??0,R=w.options.shouldReload,M=typeof R=="function"?R(J7(t,e,s,n,w)):R,{status:N,invalid:O}=C,k=T>=x&&(!!t.forceStaleReload||C.cause==="enter"||E!==void 0&&E!==C.id);a=N==="success"&&(O||(M??k)),y&&w.options.preload===!1||(a&&!t.sync&&h?(u=!0,(async()=>{try{await NU(t,e,s,n,w);const F=t.router.getMatch(s);F._nonReactive.loaderPromise?.resolve(),F._nonReactive.loadPromise?.resolve(),F._nonReactive.loaderPromise=void 0,F._nonReactive.loadPromise=void 0}catch(F){zr(F)&&await t.router.navigate(F.options)}})()):N!=="success"||a?await NU(t,e,s,n,w):OU(t,s,n))}const{id:s,routeId:o}=t.matches[n];let a=!1,u=!1;const c=t.router.looseRoutesById[o],f=c.options.loader,h=((typeof f=="function"?void 0:f?.staleReloadMode)??t.router.options.defaultStaleReloadMode)!=="blocking";if(X7(t,s)){if(!t.router.getMatch(s))return t.matches[n];OU(t,s,n)}else{const y=t.router.getMatch(s),S=t.router.stores.matchesId.get()[n],E=(S&&t.router.stores.matchStores.get(S)||null)?.routeId===o?S:t.router.stores.matches.get().find(w=>w.routeId===o)?.id,C=bb(t,s);if(y._nonReactive.loaderPromise){if(y.status==="success"&&!t.sync&&!y.preload&&h)return y;await y._nonReactive.loaderPromise;const w=t.router.getMatch(s),T=w._nonReactive.error||w.error;T&&Ia(t,w,T),w.status==="pending"&&await r(C,y,E,w,c)}else{const w=C&&!t.router.stores.matchStores.has(s),T=t.router.getMatch(s);T._nonReactive.loaderPromise=Vc(),w!==T.preload&&t.updateMatch(s,x=>({...x,preload:w})),await r(C,y,E,T,c)}}const g=t.router.getMatch(s);u||(g._nonReactive.loaderPromise?.resolve(),g._nonReactive.loadPromise?.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,u||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const m=u?g.isFetching:!1;return m!==g.isFetching||g.invalid!==!1?(t.updateMatch(s,y=>({...y,isFetching:m,invalid:!1})),t.router.getMatch(s)):g};async function MU(t){const e=t,n=[];hge(e.router)&&M_(e);let r;for(let m=0;m<e.matches.length;m++){try{const y=mge(e,m);Dh(y)&&await y}catch(y){if(zr(y))throw y;if(hr(y))r=y;else if(!e.preload)throw y;break}if(e.serialError||e.firstBadMatchIndex!=null)break}const s=e.firstBadMatchIndex??e.matches.length,o=r&&!e.preload?IU(e,r):void 0,a=r&&e.preload?0:o!==void 0?Math.min(o+1,s):s;let u,c;for(let m=0;m<a;m++)n.push(yge(e,n,m));try{await Promise.all(n)}catch{const m=await Promise.allSettled(n);for(const y of m){if(y.status!=="rejected")continue;const S=y.reason;if(zr(S))throw S;hr(S)?u??=S:c??=S}if(c!==void 0)throw c}const f=u??(r&&!e.preload?r:void 0);let h=e.firstBadMatchIndex!==void 0?e.firstBadMatchIndex:e.matches.length-1;if(!f&&r&&e.preload)return e.matches;if(f){const m=IU(e,f);m===void 0&&mi();const y=e.matches[m],S=e.router.looseRoutesById[y.routeId],E=e.router.options?.defaultNotFoundComponent;!S.options.notFoundComponent&&E&&(S.options.notFoundComponent=E),f.routeId=y.routeId;const C=y.routeId===e.router.routeTree.id;e.updateMatch(y.id,w=>({...w,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),h=m,await Uh(S,["notFoundComponent"])}else if(!e.preload){const m=e.matches[0];m.globalNotFound||e.router.getMatch(m.id)?.globalNotFound&&e.updateMatch(m.id,y=>({...y,globalNotFound:!1,error:void 0}))}if(e.serialError&&e.firstBadMatchIndex!==void 0){const m=e.router.looseRoutesById[e.matches[e.firstBadMatchIndex].routeId];await Uh(m,["errorComponent"])}for(let m=0;m<=h;m++){const{id:y,routeId:S}=e.matches[m],E=e.router.looseRoutesById[S];try{const C=vge(e,y,E);if(C){const w=await C;e.updateMatch(y,T=>({...T,...w}))}}catch(C){console.error(`Error executing head for route ${S}:`,C)}}const g=M_(e);if(Dh(g)&&await g,f)throw f;if(e.serialError&&!e.preload&&!e.onReady)throw e.serialError;return e.matches}function PU(t,e){const n=e.map(r=>t.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Uh(t,e=cv){!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(r=>{const{id:s,...o}=r.options;Object.assign(t.options,o),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0);const n=()=>t._componentsLoaded?void 0:e===cv?(()=>{if(t._componentsPromise===void 0){const r=PU(t,cv);r?t._componentsPromise=r.then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0}):t._componentsLoaded=!0}return t._componentsPromise})():PU(t,e);return t._lazyPromise?t._lazyPromise.then(n):n()}function ez(t){for(const e of cv)if(t.options[e]?.preload)return!0;return!1}const cv=["component","errorComponent","pendingComponent","notFoundComponent"];var Pa="__TSR_index",kU="popstate",DU="beforeunload";function bge(t){let e=t.getLocation();const n=new Set,r=a=>{e=t.getLocation(),n.forEach(u=>u({location:e,action:a}))},s=a=>{t.notifyOnIndexChange??!0?r(a):e=t.getLocation()},o=async({task:a,navigateOpts:u,...c})=>{if(u?.ignoreBlocker??!1){a();return}const f=t.getBlockers?.()??[],h=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&f.length&&h)for(const g of f){const m=$v(c.path,c.state);if(await g.blockerFn({currentLocation:e,nextLocation:m,action:c.type})){t.onBlocked?.();return}}a()};return{get location(){return e},get length(){return t.getLength()},subscribers:n,subscribe:a=>(n.add(a),()=>{n.delete(a)}),push:(a,u,c)=>{const f=e.state[Pa];u=LU(f+1,u),o({task:()=>{t.pushState(a,u),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:a,state:u})},replace:(a,u,c)=>{const f=e.state[Pa];u=LU(f,u),o({task:()=>{t.replaceState(a,u),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:a,state:u})},go:(a,u)=>{o({task:()=>{t.go(a),s({type:"GO",index:a})},navigateOpts:u,type:"GO"})},back:a=>{o({task:()=>{t.back(a?.ignoreBlocker??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{o({task:()=>{t.forward(a?.ignoreBlocker??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>e.state[Pa]!==0,createHref:a=>t.createHref(a),block:a=>{if(!t.setBlockers)return()=>{};const u=t.getBlockers?.()??[];return t.setBlockers([...u,a]),()=>{const c=t.getBlockers?.()??[];t.setBlockers?.(c.filter(f=>f!==a))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:r}}function LU(t,e){e||(e={});const n=yR();return{...e,key:n,__TSR_key:n,[Pa]:t}}function Sge(t){const e=typeof document<"u"?window:void 0,n=e.history.pushState,r=e.history.replaceState;let s=[];const o=()=>s,a=k=>s=k,u=(k=>k),c=(()=>$v(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){const k=yR();e.history.replaceState({[Pa]:0,key:k,__TSR_key:k},"")}let f=c(),h,g=!1,m=!1,y=!1,S=!1;const E=()=>f;let C,w;const T=()=>{C&&(O._ignoreSubscribers=!0,(C.isPush?e.history.pushState:e.history.replaceState)(C.state,"",C.href),O._ignoreSubscribers=!1,C=void 0,w=void 0,h=void 0)},x=(k,F,H)=>{const D=u(F);w||(h=f),f=$v(F,H),C={href:D,state:H,isPush:C?.isPush||k==="push"},w||(w=Promise.resolve().then(()=>T()))},R=k=>{f=c(),O.notify({type:k})},M=async()=>{if(m){m=!1;return}const k=c(),F=k.state[Pa]-f.state[Pa],H=F===1,D=F===-1,z=!H&&!D||g;g=!1;const q=z?"GO":D?"BACK":"FORWARD",K=z?{type:"GO",index:F}:{type:D?"BACK":"FORWARD"};if(y)y=!1;else{const ee=o();if(typeof document<"u"&&ee.length){for(const $ of ee)if(await $.blockerFn({currentLocation:f,nextLocation:k,action:q})){m=!0,e.history.go(1),O.notify(K);return}}}f=c(),O.notify(K)},N=k=>{if(S){S=!1;return}let F=!1;const H=o();if(typeof document<"u"&&H.length)for(const D of H){const z=D.enableBeforeUnload??!0;if(z===!0){F=!0;break}if(typeof z=="function"&&z()===!0){F=!0;break}}if(F)return k.preventDefault(),k.returnValue=""},O=bge({getLocation:E,getLength:()=>e.history.length,pushState:(k,F)=>x("push",k,F),replaceState:(k,F)=>x("replace",k,F),back:k=>(k&&(y=!0),S=!0,e.history.back()),forward:k=>{k&&(y=!0),S=!0,e.history.forward()},go:k=>{g=!0,e.history.go(k)},createHref:k=>u(k),flush:T,destroy:()=>{e.history.pushState=n,e.history.replaceState=r,e.removeEventListener(DU,N,{capture:!0}),e.removeEventListener(kU,M)},onBlocked:()=>{h&&f!==h&&(f=h)},getBlockers:o,setBlockers:a,notifyOnIndexChange:!1});return e.addEventListener(DU,N,{capture:!0}),e.addEventListener(kU,M),e.history.pushState=function(...k){const F=n.apply(e.history,k);return O._ignoreSubscribers||R("PUSH"),F},e.history.replaceState=function(...k){const F=r.apply(e.history,k);return O._ignoreSubscribers||R("REPLACE"),F},O}function Ege(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}function $v(t,e){const n=Ege(t),r=n.indexOf("#"),s=n.indexOf("?"),o=yR();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:e||{[Pa]:0,key:o,__TSR_key:o}}}function yR(){return(Math.random()+1).toString(36).substring(7)}function Fc(t,e){const n=e,r=t;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Cge=class{constructor(t,e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=n=>n(),this.update=n=>{const r=this.options,s=this.basepath??r?.basepath??"/",o=this.basepath===void 0,a=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Zpe(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Sge()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let h;this.resolvePathCache=Lh(1e3),h=this.buildRouteTree(),this.setRoutes(h)}if(!this.stores&&this.latestLocation){const h=this.getStoreConfig(this);this.batch=h.batch,this.stores=fge(xge(this.latestLocation),h),rge(this)}let u=!1;const c=this.options.basepath??"/",f=this.options.rewrite;if(o||s!==c||a!==f){this.basepath=c;const h=[],g=G7(c);g&&g!=="/"&&h.push(dge({basepath:c})),f&&h.push(f),this.rewrite=h.length===0?void 0:h.length===1?h[0]:cge(h),this.history&&this.updateLatestLocation(),u=!0}u&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=qpe(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&zpe(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:c,search:f,hash:h,href:g,state:m})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const w=this.options.parseSearch(f),T=this.options.stringifySearch(w);return{href:c+T+h,publicHref:c+T+h,pathname:zf(c).path,external:!1,searchStr:T,search:El(r?.search,w),hash:zf(h.slice(1)).path,state:Il(r?.state,m)}}const y=new URL(g,this.origin),S=N_(this.rewrite,y),E=this.options.parseSearch(S.search),C=this.options.stringifySearch(E);return S.search=C,{href:S.href.replace(S.origin,""),publicHref:g,pathname:zf(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:C,search:El(r?.search,E),hash:zf(S.hash.slice(1)).path,state:Il(r?.state,m)}},o=s(n),{__tempLocation:a,__tempKey:u}=o.state;if(a&&(!u||u===this.tempLocationKey)){const c=s(a);return c.state.key=o.state.key,c.state.__TSR_key=o.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:o}}return o},this.resolvePathWithBase=(n,r)=>Ype({base:n,to:r.includes("//")?vR(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},s):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>_ge({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{if(this.stores.pendingMatchStores.has(n))return;const r=this.stores.matchStores.get(n)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(o={})=>{const a=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutesLightweight(a);o.from;const c=o.unsafeRelative==="path"?a.pathname:o.from??u.fullPath,f=o.to?`${o.to}`:void 0,h=u.search,g=Object.assign(Object.create(null),u.params),m=f?.charCodeAt(0)===47?"/":this.resolvePathWithBase(c,"."),y=f?this.resolvePathWithBase(m,f):m,S=o.params===!1||o.params===null?Object.create(null):(o.params??!0)===!0?g:Object.assign(g,Rl(o.params,g)),E=this.routesByPath[pi(y)];let C;if(E)C=this.getRouteBranch(E);else if(y.includes("$"))C=[];else{const D=this.getMatchedRoutes(y);C=D.matchedRoutes,this.options.notFoundRoute&&(!D.foundRoute||D.foundRoute.path!=="/"&&D.routeParams["**"])&&(C=[...C,this.options.notFoundRoute])}if(C.length&&B7(S))for(const D of C){const z=D.options.params?.stringify??D.options.stringifyParams;if(z)try{Object.assign(S,z(S))}catch{}}const w=n.leaveParams?y:zf(_U({path:y,params:S,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let T=h;if(n._includeValidateSearch&&this.options.search?.strict){const D={};C.forEach(z=>{if(z.options.validateSearch)try{Object.assign(D,dv(z.options.validateSearch,{...D,...T}))}catch{}}),T=D}T=Age({search:T,dest:o,destRoutes:C,_includeValidateSearch:n._includeValidateSearch}),T=El(h,T);const x=this.options.stringifySearch(T),R=o.hash===!0?a.hash:o.hash?Rl(o.hash,a.hash):void 0,M=R?`#${R}`:"";let N=o.state===!0?a.state:o.state?Rl(o.state,a.state):{};N=Il(a.state,N);const O=`${w}${x}${M}`;let k,F,H=!1;if(this.rewrite){const D=new URL(O,this.origin),z=Z7(this.rewrite,D);k=D.href.replace(D.origin,""),z.origin!==this.origin?(F=z.href,H=!0):F=z.pathname+z.search+z.hash}else k=Lpe(O),F=k;return{publicHref:F,href:k,pathname:w,search:T,searchStr:x,state:N,hash:R??"",external:H,unmaskOnReload:o.unmaskOnReload}},s=(o={},a)=>{const u=r(o);let c=a?r(a):void 0;if(!c){const f=Object.create(null);if(this.options.routeMasks){const h=jpe(u.pathname,this.processedTree);if(h){Object.assign(f,h.rawParams);const{from:g,params:m,...y}=h.route,S=m===!1||m===null?Object.create(null):(m??!0)===!0?f:Object.assign(f,Rl(m,f));a={from:n.from,...y,params:S},c=r(a)}}}return c&&(u.maskedLocation=c),u};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{let o;const a=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(g=>{s.state[g]=this.latestLocation.state[g]});const h=Ll(s.state,this.latestLocation.state);return f.forEach(g=>{delete s.state[g]}),h},u=pi(this.latestLocation.href)===pi(s.href);let c=this.commitLocationPromise;if(this.commitLocationPromise=Vc(()=>{c?.resolve(),c=void 0}),u&&a())this.load();else{let{maskedLocation:f,hashScrollIntoView:h,...g}=s;f&&(g={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...g,search:g.searchStr,state:{...g.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(g.unmaskOnReload??this.options.unmaskOnReload??!1)&&(g.state.__tempKey=this.tempLocationKey)),g.state.__hashScrollIntoViewOptions=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,o=s.replace?"REPLACE":"PUSH",this.history[o==="REPLACE"?"replace":"push"](g.publicHref,g.state,{ignoreBlocker:r})}return this._scroll.next=s.resetScroll??!0,this.history.subscribers.size||this.load(o?{action:{type:o}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:o,ignoreBlocker:a,href:u,...c}={})=>{if(u){const g=this.history.location.state.__TSR_index,m=$v(u,{__TSR_index:n?g:g+1}),y=new URL(m.pathname,this.origin);c.to=N_(this.rewrite,y).pathname,c.search=this.options.parseSearch(m.search),c.hash=m.hash.slice(1)}const f=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const h=this.commitLocation({...f,viewTransition:o,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),h},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:o,...a})=>{let u=!1;if(s)try{new URL(`${s}`),u=!0}catch{}if(u&&!r&&(r=!0),r){if(n!==void 0||!s){const f=this.buildLocation({to:n,...a});s=s??f.publicHref,o=o??f.publicHref}const c=!u&&o?o:s;if(jv(c,this.protocolAllowlist))return;if(!a.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const h of f)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(c):window.location.href=c;return}return this.buildAndCommitLocation({...a,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(s=>!n.some(o=>o.id===s.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{const r=n?.action?.type;let s,o,a;const u=this.stores.resolvedLocation.get()??this.stores.location.get();for(a=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad(),r&&(this._scroll.hash=r==="PUSH"||r==="REPLACE");const h=this.latestLocation,g=Fc(h,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...g}),this.emit({type:"onBeforeLoad",...g}),await MU({router:this,sync:n?.sync,forceStaleReload:u.href===h.href,matches:this.stores.pendingMatches.get(),location:h,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let m=null,y=null,S=null,E=null;this.batch(()=>{const C=this.stores.pendingMatches.get(),w=C.length,T=this.stores.matches.get();m=w?T.filter(M=>!this.stores.pendingMatchStores.has(M.id)):null;const x=new Set;for(const M of this.stores.pendingMatchStores.values())M.routeId&&x.add(M.routeId);const R=new Set;for(const M of this.stores.matchStores.values())M.routeId&&R.add(M.routeId);y=w?T.filter(M=>!x.has(M.routeId)):null,S=w?C.filter(M=>!R.has(M.routeId)):null,E=w?C.filter(M=>R.has(M.routeId)):T,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),w&&(this.stores.setMatches(C),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...m.filter(M=>M.status!=="error"&&M.status!=="notFound"&&M.status!=="redirected")]),this.clearExpiredCache())});for(const[C,w]of[[y,"onLeave"],[S,"onEnter"],[E,"onStay"]])if(C)for(const T of C)this.looseRoutesById[T.routeId].options[w]?.(T)})})}})}catch(h){zr(h)?(s=h,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):hr(h)&&(o=h);const g=s?s.status:o?404:this.stores.matches.get().some(m=>m.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(g),this.stores.redirect.set(s)})}this.latestLoadPromise===a&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=a,await a;this.latestLoadPromise&&a!==this.latestLoadPromise;)await this.latestLoadPromise;let c;this.hasNotFoundMatch()?c=404:this.stores.matches.get().some(f=>f.status==="error")&&(c=500),c!==void 0&&this.stores.statusCode.set(c)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,a=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(Fc(o,a)):r.types;if(u===!1){n();return}s={update:n,types:u}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const s=this.stores.pendingMatchStores.get(n);if(s){s.set(r);return}const o=this.stores.matchStores.get(n);if(o){o.set(r);return}const a=this.stores.cachedMatchStores.get(n);if(a){const u=r(a.get());u.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(c=>c.filter(f=>f!==n)):a.set(u)}})},this.getMatch=n=>this.stores.cachedMatchStores.get(n)?.get()??this.stores.pendingMatchStores.get(n)?.get()??this.stores.matchStores.get(n)?.get(),this.invalidate=n=>{const r=s=>n?.filter?.(s)??!0?{...s,invalid:!0,...n?.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),o=this.getParsedLocationHref(s);n.options.href=o,n.headers.set("Location",o)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const o=s.pathname+s.search+s.hash;n.options.href=o,n.headers.set("Location",o)}}catch{}if(n.options.href&&!n.options._builtLocation&&jv(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(s=>!r(s))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=s=>{const o=this.looseRoutesById[s.routeId];if(!o.options.loader)return!0;const a=(s.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:n-s.updatedAt>=a};this.clearCache({filter:r})},this.loadRouteChunk=Uh,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const o=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),a=new Set([...o,...this.stores.cachedIds.get()]),u=s.filter(c=>!a.has(c.id));if(u.length){const c=this.stores.cachedMatches.get();this.stores.setCached([...c,...u])}try{return s=await MU({router:this,matches:s,location:r,preload:!0,updateMatch:(c,f)=>{o.has(c)?s=s.map(h=>h.id===c?f(h):h):this.updateMatch(c,f)}}),s}catch(c){if(zr(c))return c.options.reloadDocument?void 0:await this.preloadRoute({...c.options,_fromLocation:r});hr(c)||console.error(c);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},o=this.buildLocation(s);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const a=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),u=Bpe(o.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,a.pathname,this.processedTree);return!u||n.params&&!Ll(u.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Ll(a.search,o.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=e,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??age,parseSearch:t.parseSearch??ige,protocolAllowlist:t.protocolAllowlist??Dpe}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:t,routesByPath:e,processedTree:n}){this.routesById=t,this.routesByPath=e,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(t){let e=this.routeBranchCache.get(t);return e||(e=W7(t),this.routeBranchCache.set(t,e)),e}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,e){const n=this.getMatchedRoutes(t.pathname),{foundRoute:r,routeParams:s}=n;let{matchedRoutes:o}=n,a=!1;(r?r.path!=="/"&&s["**"]:pi(t.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:a=!0);const u=a?Rge(this.options.notFoundMode,o):void 0,c=new Array(o.length),f=new Map;for(const h of this.stores.matchStores.values())h.routeId&&f.set(h.routeId,h.get());for(let h=0;h<o.length;h++){const g=o[h],m=c[h-1];let y,S,E;{const z=m?.search??t.search,q=m?._strictSearch??void 0;try{const K=dv(g.options.validateSearch,{...z})??void 0;y={...z,...K},S={...q,...K},E=void 0}catch(K){let ee=K;if(K instanceof Hv||(ee=new Hv(K.message,{cause:K})),e?.throwOnError)throw ee;y=z,S={},E=ee}}const C=g.options.loaderDeps?.({search:y})??"",w=C?JSON.stringify(C):"",{interpolatedPath:T,usedParams:x}=_U({path:g.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),R=g.id+T+w,M=this.getMatch(R),N=f.get(g.id),O=M?._strictParams??x;let k;if(!M)try{UU(g,O)}catch(z){if(hr(z)||zr(z)?k=z:k=new wge(z.message,{cause:z}),e?.throwOnError)throw k}Object.assign(s,O);const F=N?"stay":"enter";let H;if(M)H={...M,cause:F,params:N?.params??s,_strictParams:O,search:El(N?N.search:M.search,y),_strictSearch:S};else{const z=g.options.loader||g.options.beforeLoad||g.lazyFn||ez(g)?"pending":"success";H={id:R,ssr:g.options.ssr,index:h,routeId:g.id,params:N?.params??s,_strictParams:O,pathname:T,updatedAt:Date.now(),search:N?El(N.search,y):y,_strictSearch:S,searchError:void 0,status:z,isFetching:!1,error:void 0,paramsError:k,__routeContext:void 0,_nonReactive:{loadPromise:Vc()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:N?Il(N.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:g.options.staticData||{},fullPath:g.fullPath}}e?.preload||(H.globalNotFound=u===g.id),H.searchError=E;const D=this.getParentContext(m);H.context={...D,...H.__routeContext,...H.__beforeLoadContext},c[h]=H}for(let h=0;h<c.length;h++){const g=c[h],m=this.looseRoutesById[g.routeId],y=this.getMatch(g.id),S=f.get(g.routeId);if(g.params=S?El(S.params,s):s,!y){const E=c[h-1],C=this.getParentContext(E);if(m.options.context){const w={deps:g.loaderDeps,params:g.params,context:C??{},location:t,navigate:T=>this.navigate({...T,_fromLocation:t}),buildLocation:this.buildLocation,cause:g.cause,abortController:g.abortController,preload:!!g.preload,matches:c,routeId:m.id};g.__routeContext=m.options.context(w)??void 0}g.context={...C,...g.__routeContext,...g.__beforeLoadContext}}}return c}matchRoutesLightweight(t){const e=kh(this.stores.matchesId.get()),n=this.lightweightCache.get(t);if(n&&n[0]===e)return n[1];const{matchedRoutes:r,routeParams:s}=this.getMatchedRoutes(t.pathname),o=kh(r),a={...t.search};for(const g of r)try{Object.assign(a,dv(g.options.validateSearch,a))}catch{}const u=e&&this.stores.matchStores.get(e)?.get(),c=u&&u.routeId===o.id&&u.pathname===t.pathname;let f;if(c)f=u.params;else{const g=Object.assign(Object.create(null),s);for(const m of r)try{UU(m,g)}catch{}f=g}const h={matchedRoutes:r,fullPath:o.fullPath,search:a,params:f};return this.lightweightCache.set(t,[e,h]),h}},Hv=class extends Error{},wge=class extends Error{};function xge(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],statusCode:200}}function dv(t,e){if(t==null)return{};if("~standard"in t){const n=t["~standard"].validate(e);if(n instanceof Promise)throw new Hv("Async validation not supported");if(n.issues)throw new Hv(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}function _ge({pathname:t,routesById:e,processedTree:n}){const r=Object.create(null),s=pi(t);let o;const a=$pe(s,n,!0);return a&&(o=a.route,Object.assign(r,a.rawParams)),{matchedRoutes:a?.branch||[e.__root__],routeParams:r,foundRoute:o}}function Age({search:t,dest:e,destRoutes:n,_includeValidateSearch:r}){return Tge(n)(t,e,r??!1)}function Tge(t){let e,n;const r=[];for(const o of t){const a=o.options;if("search"in a)a.search?.middlewares&&r.push(...a.search.middlewares);else if(a.preSearchFilters||a.postSearchFilters){const c=({search:f,next:h})=>{const g=h(a.preSearchFilters?a.preSearchFilters.reduce((m,y)=>y(m),f):f);return a.postSearchFilters?a.postSearchFilters.reduce((m,y)=>y(m),g):g};r.push(c)}const u=a.validateSearch;if(u){const c=({search:f,next:h,meta:g})=>{const m=h(f);if(n)try{const y=dv(u,m);if(g&&y)for(const S in y)S in m||(g.defaulted||=new Map).set(S,y[S]);return{...m,...y}}catch{}return m};r.push(c)}}const s=(o,a,u)=>{if(o>=r.length){if(!e.search)return{};if(e.search===!0)return a;const f=Rl(e.search,a);return u&&(u.explicit=f),f}const c=(f,h)=>{if(h){const g=u||{};return{search:s(o+1,f,g),meta:g}}return s(o+1,f,u)};return r[o]({search:a,next:c,meta:u})};return function(a,u,c){return e=u,n=c,s(0,a)}}function Rge(t,e){if(t!=="root")for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.children)return r.id}return Ul}function UU(t,e){const n=t.options.params?.parse??t.options.parseParams;if(n){const r=n(e);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(e,r)}}const Ige="Error preloading route! ☝️";var tz=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=e=>{this.originalIndex=e.originalIndex;const n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=Ul:this.parentRoute||mi();let s=r?Ul:n?.path;s&&s!=="/"&&(s=V7(s));const o=n?.id||s;let a=r?Ul:lv([this.parentRoute.id==="__root__"?"":this.parentRoute.id,o]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=lv(["/",a]));const u=a==="__root__"?"/":lv([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=u,this._to=pi(u)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Y7({from:this.fullPath,...e}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},Oge=class extends tz{constructor(t){super(t)}};function bR(t){const e=t.errorComponent??SR;return I.jsx(Nge,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:n,reset:r})=>n?_.createElement(e,{error:n,reset:r}):t.children})}var Nge=class extends _.Component{constructor(...t){super(...t),this.state={error:null}}static getDerivedStateFromProps(t,e){const n=t.getResetKey();return e.error&&e.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidCatch(t,e){this.props.onCatch&&this.props.onCatch(t,e)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function SR({error:t}){const[e,n]=_.useState(!1);return I.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[I.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[I.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),I.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:e?"Hide Error":"Show Error"})]}),I.jsx("div",{style:{height:".25rem"}}),e?I.jsx("div",{children:I.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?I.jsx("code",{children:t.message}):null})}):null]})}function Mge({children:t,fallback:e=null}){return nz()?I.jsx(j.Fragment,{children:t}):I.jsx(j.Fragment,{children:e})}function nz(){return j.useSyncExternalStore(Pge,()=>!0,()=>!1)}function Pge(){return()=>{}}var rz=_.createContext(null);function hs(t){return _.useContext(rz)}var Sb=_.createContext(void 0),kge=_.createContext(void 0),sn=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(sn||{});function Dge({update:t,notify:e,unwatched:n}){return{link:r,unlink:s,propagate:o,checkDirty:a,shallowPropagate:u};function r(f,h,g){const m=h.depsTail;if(m!==void 0&&m.dep===f)return;const y=m!==void 0?m.nextDep:h.deps;if(y!==void 0&&y.dep===f){y.version=g,h.depsTail=y;return}const S=f.subsTail;if(S!==void 0&&S.version===g&&S.sub===h)return;const E=h.depsTail=f.subsTail={version:g,dep:f,sub:h,prevDep:m,nextDep:y,prevSub:S,nextSub:void 0};y!==void 0&&(y.prevDep=E),m!==void 0?m.nextDep=E:h.deps=E,S!==void 0?S.nextSub=E:f.subs=E}function s(f,h=f.sub){const g=f.dep,m=f.prevDep,y=f.nextDep,S=f.nextSub,E=f.prevSub;return y!==void 0?y.prevDep=m:h.depsTail=m,m!==void 0?m.nextDep=y:h.deps=y,S!==void 0?S.prevSub=E:g.subsTail=E,E!==void 0?E.nextSub=S:(g.subs=S)===void 0&&n(g),y}function o(f){let h=f.nextSub,g;e:do{const m=f.sub;let y=m.flags;if(y&60?y&12?y&4?!(y&48)&&c(f,m)?(m.flags=y|40,y&=1):y=0:m.flags=y&-9|32:y=0:m.flags=y|32,y&2&&e(m),y&1){const S=m.subs;if(S!==void 0){const E=(f=S).nextSub;E!==void 0&&(g={value:h,prev:g},h=E);continue}}if((f=h)!==void 0){h=f.nextSub;continue}for(;g!==void 0;)if(f=g.value,g=g.prev,f!==void 0){h=f.nextSub;continue e}break}while(!0)}function a(f,h){let g,m=0,y=!1;e:do{const S=f.dep,E=S.flags;if(h.flags&16)y=!0;else if((E&17)===17){if(t(S)){const C=S.subs;C.nextSub!==void 0&&u(C),y=!0}}else if((E&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(g={value:f,prev:g}),f=S.deps,h=S,++m;continue}if(!y){const C=f.nextDep;if(C!==void 0){f=C;continue}}for(;m--;){const C=h.subs,w=C.nextSub!==void 0;if(w?(f=g.value,g=g.prev):f=C,y){if(t(h)){w&&u(C),h=f.sub;continue}y=!1}else h.flags&=-33;h=f.sub;const T=f.nextDep;if(T!==void 0){f=T;continue e}}return y}while(!0)}function u(f){do{const h=f.sub,g=h.flags;(g&48)===32&&(h.flags=g|16,(g&6)===2&&e(h))}while((f=f.nextSub)!==void 0)}function c(f,h){let g=h.depsTail;for(;g!==void 0;){if(g===f)return!0;g=g.prevDep}return!1}}function Lge(t,e,n){const r=typeof t=="object",s=r?t:void 0;return{next:(r?t.next:t)?.bind(s),error:(r?t.error:e)?.bind(s),complete:(r?t.complete:n)?.bind(s)}}const P_=[];let fv=0;const{link:FU,unlink:Uge,propagate:Fge,checkDirty:sz,shallowPropagate:zU}=Dge({update(t){return t._update()},notify(t){P_[k_++]=t,t.flags&=~sn.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=sn.Mutable|sn.Dirty,qv(t))}});let fm=0,k_=0,Eo,D_=0;function oz(t){try{++D_,t()}finally{--D_||iz()}}function qv(t){const e=t.depsTail;let n=e!==void 0?e.nextDep:t.deps;for(;n!==void 0;)n=Uge(n,t)}function iz(){if(!(D_>0)){for(;fm<k_;){const t=P_[fm];P_[fm++]=void 0,t.notify()}fm=0,k_=0}}function jU(t,e){const n=typeof t=="function",r=t,s={_snapshot:n?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?sn.None:sn.Mutable,get(){return Eo!==void 0&&FU(s,Eo,fv),s._snapshot},subscribe(o){const a=Lge(o),u={current:!1},c=zge(()=>{s.get(),u.current?a.next?.(s._snapshot):u.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(o){const a=Eo,u=e?.compare??Object.is;if(n)Eo=s,++fv,s.depsTail=void 0;else if(o===void 0)return!1;n&&(s.flags=sn.Mutable|sn.RecursedCheck);try{const c=s._snapshot,f=typeof o=="function"?o(c):o===void 0&&n?r(c):o;return c===void 0||!u(c,f)?(s._snapshot=f,!0):!1}finally{Eo=a,n&&(s.flags&=~sn.RecursedCheck),qv(s)}}};return n?(s.flags=sn.Mutable|sn.Dirty,s.get=function(){const o=s.flags;if(o&sn.Dirty||o&sn.Pending&&sz(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&zU(a)}}else o&sn.Pending&&(s.flags=o&~sn.Pending);return Eo!==void 0&&FU(s,Eo,fv),s._snapshot}):s.set=function(o){if(s._update(o)){const a=s.subs;a!==void 0&&(Fge(a),zU(a),iz())}},s}function zge(t){const e=()=>{const r=Eo;Eo=n,++fv,n.depsTail=void 0,n.flags=sn.Watching|sn.RecursedCheck;try{return t()}finally{Eo=r,n.flags&=~sn.RecursedCheck,qv(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:sn.Watching|sn.RecursedCheck,notify(){const r=this.flags;r&sn.Dirty||r&sn.Pending&&sz(this.deps,this)?e():this.flags=sn.Watching},stop(){this.flags=sn.None,this.depsTail=void 0,qv(this)}};return e(),n}function jge(t,e){return t===e}function Wr(t,e,n=jge){const r=_.useCallback(a=>{if(!t)return()=>{};const{unsubscribe:u}=t.subscribe(a);return u},[t]),s=_.useCallback(()=>t?.get(),[t]);return AT.useSyncExternalStoreWithSelector(r,s,s,e,n)}var Jw={get(){},subscribe(){return{unsubscribe(){}}}};function Bge(t,e){const n=_.useRef();return r=>{const s=t?.select?t.select(r):r;return t?.structuralSharing??e.options.defaultStructuralSharing?n.current=Il(n.current,s):s}}function fu(t){const e=hs(),n=_.useContext(t.from?kge:Sb),r=t.from?e.stores.getRouteMatchStore(t.from):e.stores.matchStores.get(n),s=Bge(t,e),o=Wr(r??Jw,a=>a?s(a):Jw);if(o!==Jw)return o;(t.shouldThrow??!0)&&mi()}function az(t){return fu({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}function lz(t){const{select:e,...n}=t;return fu({...n,select:r=>e?e(r.loaderDeps):r.loaderDeps})}function uz(t){return fu({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:e=>{const n=t.strict===!1?e.params:e._strictParams;return t.select?t.select(n):n}})}function cz(t){return fu({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}function ER(t){const e=hs();return _.useCallback(n=>e.navigate({...n,from:n.from??t?.from}),[t?.from,e])}function jRe(t){const e=hs(),n=ER(),r=_.useRef(null);return Rc(()=>{r.current!==t&&(n(t),r.current=t)},[e,t,n]),null}function dz(t){return fu({...t,select:e=>t.select?t.select(e.context):e.context})}function $ge(t,e){const n=hs(),r=Ipe(e),{activeProps:s,inactiveProps:o,activeOptions:a,to:u,preload:c,preloadDelay:f,preloadIntentProximity:h,hashScrollIntoView:g,replace:m,startTransition:y,resetScroll:S,viewTransition:E,children:C,target:w,disabled:T,style:x,className:R,onClick:M,onBlur:N,onFocus:O,onMouseEnter:k,onMouseLeave:F,onTouchStart:H,ignoreBlocker:D,params:z,search:q,hash:K,state:ee,mask:$,reloadDocument:te,unsafeRelative:fe,from:ae,_fromLocation:xe,...L}=t,G=nz(),Y=_.useMemo(()=>t,[n,t.from,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),J=Wr(n.stores.location,gt=>gt,(gt,yn)=>gt.href===yn.href),oe=_.useMemo(()=>{const gt={_fromLocation:J,...Y};return n.buildLocation(gt)},[n,J,Y]),he=oe.maskedLocation?oe.maskedLocation.publicHref:oe.publicHref,ce=oe.maskedLocation?oe.maskedLocation.external:oe.external,ve=_.useMemo(()=>Kge(he,ce,n.history,T),[T,ce,he,n.history]),_e=_.useMemo(()=>{if(ve?.external)return jv(ve.href,n.protocolAllowlist)?void 0:ve.href;if(!Yge(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),jv(u,n.protocolAllowlist)?void 0:u}catch{}},[u,ve,n.protocolAllowlist]),Xe=_.useMemo(()=>{if(_e)return!1;if(a?.exact){if(!Kpe(J.pathname,oe.pathname,n.basepath))return!1}else{const gt=Bv(J.pathname,n.basepath),yn=Bv(oe.pathname,n.basepath);if(!(gt.startsWith(yn)&&(gt.length===yn.length||gt[yn.length]==="/")))return!1}return(a?.includeSearch??!0)&&!Ll(J.search,oe.search,{partial:!a?.exact,ignoreUndefined:!a?.explicitUndefined})?!1:a?.includeHash?G&&J.hash===oe.hash:!0},[a?.exact,a?.explicitUndefined,a?.includeHash,a?.includeSearch,J,_e,G,oe.hash,oe.pathname,oe.search,n.basepath]),Ee=Xe?Rl(s,{})??Hge:ex,pt=Xe?ex:Rl(o,{})??ex,Ce=[R,Ee.className,pt.className].filter(Boolean).join(" "),je=(x||Ee.style||pt.style)&&{...x,...Ee.style,...pt.style},[Be,He]=_.useState(!1),gr=_.useRef(!1),Ct=t.reloadDocument||_e?!1:c??n.options.defaultPreload,Gr=f??n.options.defaultPreloadDelay??0,Yn=_.useCallback(()=>{n.preloadRoute({...Y,_builtLocation:oe}).catch(gt=>{console.warn(gt),console.warn(Ige)})},[n,Y,oe]);Rpe(r,_.useCallback(gt=>{gt?.isIntersecting&&Yn()},[Yn]),Gge,{disabled:!!T||Ct!=="viewport"}),_.useEffect(()=>{gr.current||!T&&Ct==="render"&&(Yn(),gr.current=!0)},[T,Yn,Ct]);const Tr=gt=>{const yn=gt.currentTarget.getAttribute("target"),Ir=w!==void 0?w:yn;if(!T&&!Zge(gt)&&!gt.defaultPrevented&&(!Ir||Ir==="_self")&>.button===0){gt.preventDefault(),j8.flushSync(()=>{He(!0)});const ro=n.subscribe("onResolved",()=>{ro(),He(!1)});n.navigate({...Y,replace:m,resetScroll:S,hashScrollIntoView:g,startTransition:y,viewTransition:E,ignoreBlocker:D})}};if(_e)return{...L,ref:r,href:_e,...C&&{children:C},...w&&{target:w},...T&&{disabled:T},...x&&{style:x},...R&&{className:R},...M&&{onClick:M},...N&&{onBlur:N},...O&&{onFocus:O},...k&&{onMouseEnter:k},...F&&{onMouseLeave:F},...H&&{onTouchStart:H}};const no=gt=>{if(T||Ct!=="intent")return;if(!Gr){Yn();return}const yn=gt.currentTarget;if(Bf.has(yn))return;const Ir=setTimeout(()=>{Bf.delete(yn),Yn()},Gr);Bf.set(yn,Ir)},Rr=gt=>{T||Ct!=="intent"||Yn()},Gt=gt=>{if(T||!Ct||!Gr)return;const yn=gt.currentTarget,Ir=Bf.get(yn);Ir&&(clearTimeout(Ir),Bf.delete(yn))};return{...L,...Ee,...pt,href:ve?.href,ref:r,onClick:uc([M,Tr]),onBlur:uc([N,Gt]),onFocus:uc([O,no]),onMouseEnter:uc([k,no]),onMouseLeave:uc([F,Gt]),onTouchStart:uc([H,Rr]),disabled:!!T,target:w,...je&&{style:je},...Ce&&{className:Ce},...T&&qge,...Xe&&Wge,...G&&Be&&Vge}}var ex={},Hge={className:"active"},qge={role:"link","aria-disabled":!0},Wge={"data-status":"active","aria-current":"page"},Vge={"data-transitioning":"transitioning"},Bf=new WeakMap,Gge={rootMargin:"100px"},uc=t=>e=>{for(const n of t)if(n){if(e.defaultPrevented)return;n(e)}};function Kge(t,e,n,r){if(!r)return e?{href:t,external:!0}:{href:n.createHref(t)||"/",external:!1}}function Yge(t){if(typeof t!="string")return!1;const e=t.charCodeAt(0);return e===47?t.charCodeAt(1)!==47:e===46}var fz=_.forwardRef((t,e)=>{const{_asChild:n,...r}=t,{type:s,...o}=$ge(r,e),a=typeof r.children=="function"?r.children({isActive:o["data-status"]==="active"}):r.children;if(!n){const{disabled:u,...c}=o;return _.createElement("a",c,a)}return _.createElement(n,o,a)});function Zge(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}var Xge=class extends tz{constructor(e){super(e),this.useMatch=n=>fu({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>dz({...n,from:this.id}),this.useSearch=n=>cz({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>uz({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>lz({...n,from:this.id}),this.useLoaderData=n=>az({...n,from:this.id}),this.useNavigate=()=>ER({from:this.fullPath}),this.Link=j.forwardRef((n,r)=>I.jsx(fz,{ref:r,from:this.fullPath,...n}))}};function Qge(t){return new Xge(t)}function Jge(){return t=>tme(t)}var eme=class extends Oge{constructor(t){super(t),this.useMatch=e=>fu({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>dz({...e,from:this.id}),this.useSearch=e=>cz({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>uz({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>lz({...e,from:this.id}),this.useLoaderData=e=>az({...e,from:this.id}),this.useNavigate=()=>ER({from:this.fullPath}),this.Link=j.forwardRef((e,n)=>I.jsx(fz,{ref:n,from:this.fullPath,...e}))}};function tme(t){return new eme(t)}function lr(t){return new nme(t,{silent:!0}).createRoute}var nme=class{constructor(t,e){this.path=t,this.createRoute=n=>{const r=Qge(n);return r.isRoot=!1,r},this.silent=e?.silent}};function qn(t,e){let n,r,s,o;const a=()=>(n||(n=t().then(c=>{n=void 0,r=c[e??"default"]}).catch(c=>{if(s=c,Mpe(s)&&s instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const f=`tanstack_router_reload:${s.message}`;sessionStorage.getItem(f)||(sessionStorage.setItem(f,"1"),o=!0)}})),n),u=function(f){if(o)throw window.location.reload(),new Promise(()=>{});if(s)throw s;if(!r)if(yU)yU(a());else throw a();return _.createElement(r,f)};return u.preload=a,u}function rme(t){const e=hs(),n=`not-found-${Wr(e.stores.location,r=>r.pathname)}-${Wr(e.stores.status,r=>r)}`;return I.jsx(bR,{getResetKey:()=>n,onCatch:(r,s)=>{if(hr(r))t.onCatch?.(r,s);else throw r},errorComponent:({error:r})=>{if(hr(r))return t.fallback?.(r);throw r},children:t.children})}function sme(){return I.jsx("p",{children:"Not Found"})}function Ec(t){return I.jsx(I.Fragment,{children:t.children})}function hz(t,e,n){return e.options.notFoundComponent?I.jsx(e.options.notFoundComponent,{...n}):t.options.defaultNotFoundComponent?I.jsx(t.options.defaultNotFoundComponent,{...n}):I.jsx(sme,{})}function ome(t){return null}function ime(){return ome(hs()),null}var ame=(t,e)=>t.routeId===e.routeId&&t._displayPending===e._displayPending,lme=(t,e)=>t[0]===e[0]&&t[1]===e[1],pz=_.memo(function({matchId:e}){const n=hs(),r=n.stores.matchStores.get(e);r||mi();const s=Wr(n.stores.loadedAt,a=>a),o=Wr(r,a=>a,ame);return I.jsx(ume,{router:n,matchId:e,resetKey:s,matchState:_.useMemo(()=>{const a=o.routeId,u=n.routesById[a].parentRoute?.id;return{routeId:a,ssr:o.ssr,_displayPending:o._displayPending,parentRouteId:u}},[o._displayPending,o.routeId,o.ssr,n.routesById])})});function ume({router:t,matchId:e,resetKey:n,matchState:r}){const s=t.routesById[r.routeId],o=s.options.pendingComponent??t.options.defaultPendingComponent,a=o?I.jsx(o,{}):null,u=s.options.errorComponent??t.options.defaultErrorComponent,c=s.options.onCatch??t.options.defaultOnCatch,f=s.isRoot?s.options.notFoundComponent??t.options.notFoundRoute?.options.component:s.options.notFoundComponent,h=r.ssr===!1||r.ssr==="data-only",g=(!s.isRoot||s.options.wrapInSuspense||h)&&(s.options.wrapInSuspense??o??(s.options.errorComponent?.preload||h))?_.Suspense:Ec,m=u?bR:Ec,y=f?rme:Ec;return I.jsxs(s.isRoot?s.options.shellComponent??Ec:Ec,{children:[I.jsx(Sb.Provider,{value:e,children:I.jsx(g,{fallback:a,children:I.jsx(m,{getResetKey:()=>n,errorComponent:u||SR,onCatch:(S,E)=>{if(hr(S))throw S.routeId??=r.routeId,S;c?.(S,E)},children:I.jsx(y,{fallback:S=>{if(S.routeId??=r.routeId,!f||S.routeId&&S.routeId!==r.routeId||!S.routeId&&!s.isRoot)throw S;return _.createElement(f,S)},children:h||r._displayPending?I.jsx(Mge,{fallback:a,children:I.jsx(BU,{matchId:e})}):I.jsx(BU,{matchId:e})})})})}),r.parentRouteId===Ul?I.jsxs(I.Fragment,{children:[I.jsx(cme,{}),t.options.scrollRestoration&&z7?I.jsx(ime,{}):null]}):null]})}function cme(){const t=hs(),e=_.useRef();return Rc(()=>{const n=t.stores.resolvedLocation.get(),r=e.current;n&&(!r||r.href!==n.href)&&t.emit({type:"onRendered",...Fc(t.stores.location.get(),r??n)}),e.current=n},[Wr(t.stores.resolvedLocation,n=>n?.state.__TSR_key),t]),null}var BU=_.memo(function({matchId:e}){const n=hs(),r=(h,g)=>n.getMatch(h.id)?._nonReactive[g]??h._nonReactive[g],s=n.stores.matchStores.get(e);s||mi();const o=Wr(s,h=>h),a=o.routeId,u=n.routesById[a],c=_.useMemo(()=>{const h=(n.routesById[a].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:a,loaderDeps:o.loaderDeps,params:o._strictParams,search:o._strictSearch});return h?JSON.stringify(h):void 0},[a,o.loaderDeps,o._strictParams,o._strictSearch,n.options.defaultRemountDeps,n.routesById]),f=_.useMemo(()=>{const h=u.options.component??n.options.defaultComponent;return h?I.jsx(h,{},c):I.jsx(gz,{})},[c,u.options.component,n.options.defaultComponent]);if(o._displayPending)throw r(o,"displayPendingPromise");if(o._forcePending)throw r(o,"minPendingPromise");if(o.status==="pending"){const h=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(h){const g=n.getMatch(o.id);if(g&&!g._nonReactive.minPendingPromise){const m=Vc();g._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),g._nonReactive.minPendingPromise=void 0},h)}}throw r(o,"loadPromise")}if(o.status==="notFound")return hr(o.error)||mi(),hz(n,u,o.error);if(o.status==="redirected")throw zr(o.error)||mi(),r(o,"loadPromise");if(o.status==="error")throw o.error;return f}),gz=_.memo(function(){const e=hs(),n=_.useContext(Sb);let r,s=!1,o;{const f=n?e.stores.matchStores.get(n):void 0;[r,s]=Wr(f,h=>[h?.routeId,h?.globalNotFound??!1],lme),o=Wr(e.stores.matchesId,h=>h[h.findIndex(g=>g===n)+1])}const a=r?e.routesById[r]:void 0,u=e.options.defaultPendingComponent?I.jsx(e.options.defaultPendingComponent,{}):null;if(s)return a||mi(),hz(e,a,void 0);if(!o)return null;const c=I.jsx(pz,{matchId:o});return r===Ul?I.jsx(_.Suspense,{fallback:u,children:c}):c});function dme(){const t=hs(),e=_.useRef({router:t,mounted:!1}),[n,r]=_.useState(!1),s=Wr(t.stores.isLoading,g=>g),o=Wr(t.stores.hasPending,g=>g),a=Vw(s),u=s||n||o,c=Vw(u),f=s||o,h=Vw(f);return t.startTransition=g=>{r(!0),_.startTransition(()=>{g(),r(!1)})},_.useEffect(()=>{const g=t.history.subscribe(t.load),m=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return pi(t.latestLocation.publicHref)!==pi(m.publicHref)&&t.commitLocation({...m,replace:!0}),()=>{g()}},[t,t.history]),Rc(()=>{if(typeof window<"u"&&t.ssr||e.current.router===t&&e.current.mounted)return;e.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(m){console.error(m)}})()},[t]),Rc(()=>{a&&!s&&t.emit({type:"onLoad",...Fc(t.stores.location.get(),t.stores.resolvedLocation.get())})},[a,t,s]),Rc(()=>{h&&!f&&t.emit({type:"onBeforeRouteMount",...Fc(t.stores.location.get(),t.stores.resolvedLocation.get())})},[f,h,t]),Rc(()=>{if(c&&!u){const g=Fc(t.stores.location.get(),t.stores.resolvedLocation.get());t.emit({type:"onResolved",...g}),oz(()=>{t.stores.status.set("idle"),t.stores.resolvedLocation.set(t.stores.location.get())})}},[u,c,t]),null}function fme(){const t=hs(),e=t.routesById[Ul].options.pendingComponent??t.options.defaultPendingComponent,n=e?I.jsx(e,{}):null,r=I.jsxs(typeof document<"u"&&t.ssr?Ec:_.Suspense,{fallback:n,children:[I.jsx(dme,{}),I.jsx(hme,{})]});return t.options.InnerWrap?I.jsx(t.options.InnerWrap,{children:r}):r}function hme(){const t=hs(),e=Wr(t.stores.firstId,s=>s),n=Wr(t.stores.loadedAt,s=>s),r=e?I.jsx(pz,{matchId:e}):null;return I.jsx(Sb.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?r:I.jsx(bR,{getResetKey:()=>n,errorComponent:SR,onCatch:void 0,children:r})})}var pme=t=>({createMutableStore:jU,createReadonlyStore:jU,batch:oz}),gme=t=>new mme(t),mme=class extends Cge{constructor(t){super(t,pme)}};function vme({router:t,children:e,...n}){B7(n)&&t.update({...t.options,...n,context:{...t.options.context,...n.context}});const r=I.jsx(rz.Provider,{value:t,children:e});return t.options.Wrap?I.jsx(t.options.Wrap,{children:r}):r}function yme({router:t,...e}){return I.jsx(vme,{router:t,...e,children:I.jsx(fme,{})})}var tx={exports:{}},$f={},nx={exports:{}},rx={};var $U;function bme(){return $U||($U=1,(function(t){function e($,te){var fe=$.length;$.push(te);e:for(;0<fe;){var ae=fe-1>>>1,xe=$[ae];if(0<s(xe,te))$[ae]=te,$[fe]=xe,fe=ae;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var te=$[0],fe=$.pop();if(fe!==te){$[0]=fe;e:for(var ae=0,xe=$.length,L=xe>>>1;ae<L;){var G=2*(ae+1)-1,Y=$[G],J=G+1,oe=$[J];if(0>s(Y,fe))J<xe&&0>s(oe,Y)?($[ae]=oe,$[J]=fe,ae=J):($[ae]=Y,$[G]=fe,ae=G);else if(J<xe&&0>s(oe,fe))$[ae]=oe,$[J]=fe,ae=J;else break e}}return te}function s($,te){var fe=$.sortIndex-te.sortIndex;return fe!==0?fe:$.id-te.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var c=[],f=[],h=1,g=null,m=3,y=!1,S=!1,E=!1,C=!1,w=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function R($){for(var te=n(f);te!==null;){if(te.callback===null)r(f);else if(te.startTime<=$)r(f),te.sortIndex=te.expirationTime,e(c,te);else break;te=n(f)}}function M($){if(E=!1,R($),!S)if(n(c)!==null)S=!0,N||(N=!0,z());else{var te=n(f);te!==null&&ee(M,te.startTime-$)}}var N=!1,O=-1,k=5,F=-1;function H(){return C?!0:!(t.unstable_now()-F<k)}function D(){if(C=!1,N){var $=t.unstable_now();F=$;var te=!0;try{e:{S=!1,E&&(E=!1,T(O),O=-1),y=!0;var fe=m;try{t:{for(R($),g=n(c);g!==null&&!(g.expirationTime>$&&H());){var ae=g.callback;if(typeof ae=="function"){g.callback=null,m=g.priorityLevel;var xe=ae(g.expirationTime<=$);if($=t.unstable_now(),typeof xe=="function"){g.callback=xe,R($),te=!0;break t}g===n(c)&&r(c),R($)}else r(c);g=n(c)}if(g!==null)te=!0;else{var L=n(f);L!==null&&ee(M,L.startTime-$),te=!1}}break e}finally{g=null,m=fe,y=!1}te=void 0}}finally{te?z():N=!1}}}var z;if(typeof x=="function")z=function(){x(D)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,K=q.port2;q.port1.onmessage=D,z=function(){K.postMessage(null)}}else z=function(){w(D,0)};function ee($,te){O=w(function(){$(t.unstable_now())},te)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_next=function($){switch(m){case 1:case 2:case 3:var te=3;break;default:te=m}var fe=m;m=te;try{return $()}finally{m=fe}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function($,te){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var fe=m;m=$;try{return te()}finally{m=fe}},t.unstable_scheduleCallback=function($,te,fe){var ae=t.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?ae+fe:ae):fe=ae,$){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=fe+xe,$={id:h++,callback:te,priorityLevel:$,startTime:fe,expirationTime:xe,sortIndex:-1},fe>ae?($.sortIndex=fe,e(f,$),n(c)===null&&$===n(f)&&(E?(T(O),O=-1):E=!0,ee(M,fe-ae))):($.sortIndex=xe,e(c,$),S||y||(S=!0,N||(N=!0,z()))),$},t.unstable_shouldYield=H,t.unstable_wrapCallback=function($){var te=m;return function(){var fe=m;m=te;try{return $.apply(this,arguments)}finally{m=fe}}}})(rx)),rx}var HU;function Sme(){return HU||(HU=1,nx.exports=bme()),nx.exports}var qU;function Eme(){if(qU)return $f;qU=1;var t=Sme(),e=ip(),n=z8();function r(i){var l="https://react.dev/errors/"+i;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){var l=i,d=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(d=l.return),i=l.return;while(i)}return l.tag===3?d:null}function a(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function u(i){if(i.tag===31){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function c(i){if(o(i)!==i)throw Error(r(188))}function f(i){var l=i.alternate;if(!l){if(l=o(i),l===null)throw Error(r(188));return l!==i?null:i}for(var d=i,p=l;;){var v=d.return;if(v===null)break;var b=v.alternate;if(b===null){if(p=v.return,p!==null){d=p;continue}break}if(v.child===b.child){for(b=v.child;b;){if(b===d)return c(v),i;if(b===p)return c(v),l;b=b.sibling}throw Error(r(188))}if(d.return!==p.return)d=v,p=b;else{for(var A=!1,P=v.child;P;){if(P===d){A=!0,d=v,p=b;break}if(P===p){A=!0,p=v,d=b;break}P=P.sibling}if(!A){for(P=b.child;P;){if(P===d){A=!0,d=b,p=v;break}if(P===p){A=!0,p=b,d=v;break}P=P.sibling}if(!A)throw Error(r(189))}}if(d.alternate!==p)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?i:l}function h(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i;for(i=i.child;i!==null;){if(l=h(i),l!==null)return l;i=i.sibling}return null}var g=Object.assign,m=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),x=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),D=Symbol.iterator;function z(i){return i===null||typeof i!="object"?null:(i=D&&i[D]||i["@@iterator"],typeof i=="function"?i:null)}var q=Symbol.for("react.client.reference");function K(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===q?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case E:return"Fragment";case w:return"Profiler";case C:return"StrictMode";case M:return"Suspense";case N:return"SuspenseList";case F:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case x:return i.displayName||"Context";case T:return(i._context.displayName||"Context")+".Consumer";case R:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case O:return l=i.displayName||null,l!==null?l:K(i.type)||"Memo";case k:l=i._payload,i=i._init;try{return K(i(l))}catch{}}return null}var ee=Array.isArray,$=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},ae=[],xe=-1;function L(i){return{current:i}}function G(i){0>xe||(i.current=ae[xe],ae[xe]=null,xe--)}function Y(i,l){xe++,ae[xe]=i.current,i.current=l}var J=L(null),oe=L(null),he=L(null),ce=L(null);function ve(i,l){switch(Y(he,l),Y(oe,i),Y(J,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?pN(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=pN(l),i=gN(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}G(J),Y(J,i)}function _e(){G(J),G(oe),G(he)}function Xe(i){i.memoizedState!==null&&Y(ce,i);var l=J.current,d=gN(l,i.type);l!==d&&(Y(oe,i),Y(J,d))}function Ee(i){oe.current===i&&(G(J),G(oe)),ce.current===i&&(G(ce),bf._currentValue=fe)}var pt,Ce;function je(i){if(pt===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);pt=l&&l[1]||"",Ce=-1<d.stack.indexOf(`
|
|
216
|
+
`;return typeof u=="function"&&u(null,C),C},Ww}var nU;function Kde(){if(nU)return ac;nU=1;const t=Tde(),e=Wde(),n=Vde(),r=Gde();function s(o,a,u,c,f){const h=[].slice.call(arguments,1),g=h.length,m=typeof h[g-1]=="function";if(!m&&!t())throw new Error("Callback required as last argument");if(m){if(g<2)throw new Error("Too few arguments provided");g===2?(f=u,u=a,a=c=void 0):g===3&&(a.getContext&&typeof f>"u"?(f=c,c=void 0):(f=c,c=u,u=a,a=void 0))}else{if(g<1)throw new Error("Too few arguments provided");return g===1?(u=a,a=c=void 0):g===2&&!a.getContext&&(c=u,u=a,a=void 0),new Promise(function(y,S){try{const E=e.create(u,c);y(o(E,a,c))}catch(E){S(E)}})}try{const y=e.create(u,c);f(null,o(y,a,c))}catch(y){f(y)}}return ac.create=e.create,ac.toCanvas=s.bind(null,n.render),ac.toDataURL=s.bind(null,n.renderToDataURL),ac.toString=s.bind(null,function(o,a,u){return r.render(o,u)}),ac}var Yde=Kde();const Zde=Ga(Yde),Xde=t=>t==="signIn"||t==="signUp",cR=t=>!!t&&(t==="EMAIL_OTP"||t==="SMS_MFA"),{getConfirmText:Qde,getConfirmingText:Jde,getBackToSignInText:efe,getResendCodeText:tfe}=Ln,gb=()=>{const{isPending:t,toSignIn:e,challengeName:n,resendCode:r,selectedAuthMethod:s,availableAuthMethods:o}=Et(c=>[c.isPending,c.toSignIn,c.challengeName,c.resendCode,c.selectedAuthMethod,c.availableAuthMethods]),a=!!s&&s!=="PASSWORD"||!!o?.some(c=>c!=="PASSWORD"),u=cR(n)&&a&&r;return j.createElement(ze,{direction:"column"},j.createElement(en,{isDisabled:t,type:"submit",variation:"primary",isLoading:t,loadingText:Jde()},Qde()),u&&j.createElement(en,{onClick:r,type:"button"},tfe()),j.createElement(en,{onClick:e,type:"button",variation:"link",size:"small"},efe()))},nfe=new or("SetupTotp-logger"),{getSetupTotpText:rfe,getCopiedText:sfe,getLoadingText:ofe}=Ln,ja=({className:t,variation:e})=>{const{totpSecretCode:n,isPending:r,username:s,QRFields:o}=Et(R=>[R.isPending,R.totpSecretCode,R.username]),{handleChange:a,handleSubmit:u}=fs(),{components:{SetupTotp:{Header:c=ja.Header,Footer:f=ja.Footer}}}=ds(),[h,g]=_.useState(!0),[m,y]=_.useState(),[S,E]=_.useState("COPY"),{totpIssuer:C="AWSCognito",totpUsername:w=s}=o??{},T=_.useCallback(async()=>{try{const R=Yse(C,w,n),M=await Zde.toDataURL(R);y(M)}catch(R){nfe.error(R)}finally{g(!1)}},[C,w,n]);_.useEffect(()=>{m||T()},[T,m]);const x=()=>{navigator.clipboard.writeText(n),E(sfe())};return _.createElement(qr,{className:t,variation:e},_.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-setup-totp":"",method:"post",onChange:a,onSubmit:u},_.createElement(ze,{as:"fieldset",direction:"column",isDisabled:r},_.createElement(c,null),_.createElement(ze,{direction:"column"},h?_.createElement("p",null,ofe(),"…"):_.createElement("img",{"data-amplify-qrcode":!0,src:m,alt:"qr code",width:"228",height:"228"}),_.createElement(ze,{"data-amplify-copy":!0},_.createElement("div",null,n),_.createElement(ze,{"data-amplify-copy-svg":!0,onClick:x},_.createElement("div",{"data-amplify-copy-tooltip":!0},S),_.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z"})))),_.createElement(Po,null),_.createElement(Vr,null)),_.createElement(gb,null),_.createElement(f,null))))};ja.Header=function(){return _.createElement(Ar,{level:3},rfe())};ja.Footer=function(){return null};const{getSubmitText:ife,getSubmittingText:afe}=Ln,mb=t=>{const{cancelButtonSendType:e,cancelButtonText:n,submitButtonText:r}=t,{isPending:s,resendCode:o,skipVerification:a,toSignIn:u}=Et(g=>[g.isPending]),c=()=>{switch(e){case"SKIP":a();break;case"RESEND":o();break;case"SIGN_IN":u();break;default:return}},f=s?j.createElement(j.Fragment,null,afe(),"…"):j.createElement(j.Fragment,null,ife()),h=r??f;return j.createElement(ze,{direction:"column"},j.createElement(en,{variation:"primary",isDisabled:s,type:"submit"},h),j.createElement(ze,{direction:"column",alignItems:"center"},j.createElement(en,{onClick:c,type:"button",variation:"link",size:"small"},n)))},lfe=()=>j.createElement("svg",{"aria-label":"Apple icon",className:"amplify-icon federated-sign-in-icon",fill:"#000",preserveAspectRatio:"xMidYMid",stroke:"#000",strokeWidth:"0",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},j.createElement("path",{d:"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z"})),ufe=()=>j.createElement("svg",{"aria-label":"Google icon",className:"amplify-icon federated-sign-in-icon",viewBox:"0 0 256 262",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},j.createElement("path",{d:"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027",fill:"#4285F4"}),j.createElement("path",{d:"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1",fill:"#34A853"}),j.createElement("path",{d:"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782",fill:"#FBBC05"}),j.createElement("path",{d:"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251",fill:"#EB4335"})),cfe=()=>j.createElement(JF,{className:"federated-sign-in-icon",ariaLabel:"Facebook icon",viewBox:{minX:0,minY:0,width:279,height:538},pathData:"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z",fill:"#1877F2"}),dfe=()=>j.createElement("svg",{"aria-label":"Amazon icon",className:"amplify-icon federated-sign-in-icon",viewBox:"0 0 243 264",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},j.createElement("path",{d:"M230.826 208.039C227.468 203.683 208.551 205.982 200.056 206.998C197.471 207.321 197.076 205.042 199.407 203.405C214.475 192.665 239.201 195.766 242.082 199.364C244.966 202.982 241.337 228.071 227.173 240.049C225.001 241.888 222.93 240.904 223.898 238.468C227.077 230.431 234.205 212.419 230.826 208.039ZM123.769 264C71.0234 264 39.0764 241.955 14.7853 217.542C9.97339 212.706 3.71799 206.296 0.311513 200.691C-1.09773 198.372 2.59096 195.022 5.04421 196.844C35.239 219.268 79.1012 239.538 122.53 239.538C151.82 239.538 188.046 227.47 217.669 214.868C222.147 212.966 222.147 219.18 221.512 221.061C221.183 222.032 206.515 236.221 186.247 247.047C167.304 257.166 143.397 264 123.769 264Z",fill:"#F2541B"}),j.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M142.943 111.185C142.943 124.756 143.268 136.054 136.406 148.123C130.856 157.913 122.027 163.95 112.222 163.95C98.8288 163.95 90.9806 153.772 90.9806 138.693C90.9806 109.036 117.677 103.647 142.943 103.647V111.185ZM178.166 196.081C175.858 198.15 171.635 198.22 169.914 196.894C157.974 187.684 149.89 173.688 149.89 173.688C130.706 193.156 117.127 199 92.2879 199C62.8772 199 40 180.905 40 144.729C40 116.461 55.3552 97.2408 77.2563 87.823C96.2094 79.5256 122.684 78.0173 142.943 75.7517C142.943 75.7517 144.633 53.933 138.699 45.9806C134.098 39.8163 126.272 36.9329 119.089 36.9329C106.127 36.8829 93.61 43.9051 91.1262 57.4188C90.4136 61.2829 87.5533 64.5261 84.54 64.206L51.0823 60.5922C48.5156 60.2951 45.0381 57.6639 45.8636 53.3081C53.644 12.3684 90.7373 0 123.989 0C140.983 0 163.21 4.51651 176.608 17.3349C193.597 33.1648 191.969 54.2755 191.969 77.2722V131.51C191.969 147.835 198.768 154.987 205.151 163.775C207.376 166.953 207.886 170.714 205.04 173.032C197.902 178.999 178.166 196.081 178.166 196.081Z",fill:"#F2541B"})),sm=t=>{const{icon:e,provider:n,text:r}=t,{toFederatedSignIn:s}=Et(),o=u=>{u.preventDefault(),s({provider:n})};let a;return e==="facebook"?a=j.createElement(cfe,null):e==="google"?a=j.createElement(ufe,null):e==="amazon"?a=j.createElement(dfe,null):e==="apple"&&(a=j.createElement(lfe,null)),j.createElement(en,{onClick:o,className:"federated-sign-in-button",gap:"1rem"},a,j.createElement(Rs,{as:"span"},r))},{getSignInWithFederationText:om,getOrText:ffe}=Ln;function S7(){const{route:t,socialProviders:e}=Et(({route:n,socialProviders:r})=>[n,r]);return e.length===0?null:j.createElement(ze,{direction:"column",padding:"0 0 1rem 0",className:"federated-sign-in-container"},e.map(n=>{switch(n){case"amazon":return j.createElement(sm,{icon:"amazon",key:n,provider:Tc.Amazon,text:om(t,n)});case"apple":return j.createElement(sm,{icon:"apple",key:n,provider:Tc.Apple,text:om(t,n)});case"facebook":return j.createElement(sm,{icon:"facebook",key:n,provider:Tc.Facebook,text:om(t,n)});case"google":return j.createElement(sm,{icon:"google",key:n,provider:Tc.Google,text:om(t,n)});default:console.error(`Authenticator does not support ${n}. Please open an issue: https://github.com/aws-amplify/amplify-ui/issues/choose`)}}),j.createElement(tR,{size:"small",label:ffe()}))}const{getSignInText:im,getSigningInText:hfe,getForgotPasswordText:pfe,getSignInWithEmailText:gfe,getSignInWithSmsText:mfe,getSignInWithPasskeyText:vfe,getOtherSignInOptionsText:yfe,getEnterUsernameFirstText:bfe}=Ln;function Ci(){const{isPending:t,availableAuthMethods:e,preferredChallenge:n,toShowAuthMethods:r}=Et(w=>[w.isPending,w.availableAuthMethods,w.preferredChallenge,w.toShowAuthMethods]),{handleChange:s,handleSubmit:o}=fs(),[a,u]=j.useState(""),{components:{SignIn:{Header:c=Ci.Header,Footer:f=Ci.Footer}}}=ds(),g=e&&e.length>1&&n,m=a.trim().length>0,y=j.useCallback(w=>{const{name:T,value:x}=w.target;T==="username"&&typeof x=="string"&&u(x),s(w)},[s]),S=()=>{if(!n)return im();switch(n){case"EMAIL_OTP":return gfe();case"SMS_OTP":return mfe();case"WEB_AUTHN":return vfe();default:return im()}},E=w=>{w.preventDefault(),o(w)},C=w=>{w.preventDefault(),r()};return j.createElement(qe,null,j.createElement(c,null),j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-signin":"",method:"post",onSubmit:g?E:o,onChange:y},j.createElement(S7,null),j.createElement(ze,{direction:"column"},j.createElement(ze,{as:"fieldset",direction:"column",isDisabled:t},j.createElement(hb,null,j.createElement("legend",null,im())),j.createElement(Po,null)),j.createElement(Vr,null),j.createElement(en,{isDisabled:t,type:"submit",variation:"primary",isLoading:t,loadingText:hfe()},g?S():im()),g&&j.createElement(en,{onClick:C,size:"small",variation:"link",isDisabled:t||!m,title:m?void 0:bfe()},yfe()),j.createElement(f,null))))}const Sfe=()=>{const{toForgotPassword:t}=Et(e=>[e.toForgotPassword]);return j.createElement(qe,{"data-amplify-footer":""},j.createElement(en,{onClick:t,size:"small",variation:"link"},pfe()))};Ci.Footer=Sfe;Ci.Header=function(){return null};const{getCreateAccountText:rU,getCreatingAccountText:Efe,getCreateAccountWithEmailText:Cfe,getCreateAccountWithPasswordText:wfe,getCreateAccountWithSmsText:xfe,getOrText:_fe}=Ln;function Qs(){const{hasValidationErrors:t,isPending:e,availableAuthMethods:n,preferredChallenge:r,selectedAuthMethod:s}=Et(x=>[x.hasValidationErrors,x.isPending,x.availableAuthMethods,x.preferredChallenge,x.selectedAuthMethod]),{handleChange:o,handleBlur:a,handleSubmit:u}=fs(),{components:{SignUp:{Header:c=Qs.Header,FormFields:f=Qs.FormFields,Footer:h=Qs.Footer}}}=ds(),g=n?.filter(x=>x!=="WEB_AUTHN"),m=g&&g.length>1,y=r&&r!=="WEB_AUTHN"?r:"PASSWORD",S=g?.filter(x=>x!==y)??[],C=(s??y)!=="PASSWORD",w=x=>{switch(x){case"EMAIL_OTP":return Cfe();case"SMS_OTP":return xfe();case"PASSWORD":return m?wfe():rU();default:return rU()}},T=x=>R=>{R.preventDefault();const M=R.target.closest("form");if(M){if(!M.__authMethod){const N=document.createElement("input");N.name="__authMethod",M.appendChild(N)}M.__authMethod.type="hidden",M.__authMethod.value=x,M.requestSubmit()}};return j.createElement(qe,null,j.createElement(c,null),j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-signup":"",method:"post",onChange:o,onSubmit:u,onBlur:a},j.createElement(S7,null),j.createElement(ze,{as:"fieldset",direction:"column",isDisabled:e},j.createElement(ze,{direction:"column"},j.createElement(f,{includePassword:!C}),j.createElement(Vr,null)),j.createElement(en,{isDisabled:(!m||S.length==0)&&t||e,isFullWidth:!0,type:"submit",variation:"primary",isLoading:e,loadingText:Efe(),onClick:T(y)},w(y)),m&&S.length>0&&j.createElement(j.Fragment,null,j.createElement(ze,{justifyContent:"center",padding:"medium 0"},_fe()),S.map(x=>j.createElement(en,{key:x,isDisabled:e,isFullWidth:!0,type:"button",variation:"primary",onClick:T(x)},w(x)))),j.createElement(h,null))))}Qs.Header=function(){return null};Qs.FormFields=function(){return j.createElement(Po,null)};Qs.Footer=function(){return null};const{getSignInTabText:Afe,getSignUpTabText:Tfe}=Ln,Rfe=({className:t,hideSignUp:e,variation:n})=>{const{route:r,toSignIn:s,toSignUp:o}=Et(a=>[a.route,a.toSignIn,a.toSignUp]);return j.createElement(qr,{className:t,variation:n},e?j.createElement(qe,{"data-amplify-router-content":""},r==="signIn"&&j.createElement(Ci,null)):j.createElement(wl.Container,{value:r,isLazy:!0,onValueChange:a=>{a!==r&&(a==="signIn"?s():o())}},j.createElement(wl.List,{spacing:"equal",indicatorPosition:"top"},j.createElement(wl.Item,{value:"signIn"},Afe()),j.createElement(wl.Item,{value:"signUp"},Tfe())),j.createElement(wl.Panel,{value:"signIn","data-amplify-router-content":""},j.createElement(Ci,null)),j.createElement(wl.Panel,{value:"signUp","data-amplify-router-content":""},j.createElement(Qs,null))))},{getAccountRecoveryInfoText:Ife,getSkipText:Ofe}=Ln,Gl=({className:t,variation:e})=>{const{isPending:n}=Et(u=>[u.isPending]),{handleChange:r,handleSubmit:s}=fs(),{components:{ConfirmVerifyUser:{Header:o=Gl.Header,Footer:a=Gl.Footer}}}=ds();return j.createElement(qr,{className:t,variation:e},j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmverifyuser":"",method:"post",onChange:r,onSubmit:s},j.createElement(ze,{as:"fieldset",direction:"column",isDisabled:n},j.createElement(o,null),j.createElement(ze,{direction:"column"},j.createElement(Po,null)),j.createElement(Vr,null),j.createElement(mb,{cancelButtonText:Ofe(),cancelButtonSendType:"SKIP"}),j.createElement(a,null))))};Gl.Header=function(){return j.createElement(Ar,{level:3},Ife())};Gl.Footer=function(){return null};const{getSkipText:Nfe,getVerifyText:Mfe,getVerifyContactText:Pfe,getAccountRecoveryInfoText:kfe}=Ln,Dfe=t=>Object.entries(t).map(([e,n],r)=>{const s=nb[e].label;return j.createElement(rR,{name:"unverifiedAttr",value:e,key:e,defaultChecked:r===0},ye(s),":"," ",Gse(s,n))}),Kl=({className:t,variation:e})=>{const{components:{VerifyUser:{Header:n=Kl.Header,Footer:r=Kl.Footer}}}=ds(),{isPending:s,unverifiedUserAttributes:o}=Et(({isPending:h,unverifiedUserAttributes:g})=>[h,g]),{handleChange:a,handleSubmit:u}=fs(),c=s?j.createElement(j.Fragment,null,"Verifying…"):j.createElement(j.Fragment,null,Mfe()),f=j.createElement(sR,{legend:Pfe(),name:"verify_context",isDisabled:s,legendHidden:!0},Dfe(o));return j.createElement(qr,{className:t,variation:e},j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-verifyuser":"",method:"post",onChange:a,onSubmit:u},j.createElement(ze,{as:"fieldset",direction:"column",isDisabled:s},j.createElement(n,null),f,j.createElement(Vr,null),j.createElement(mb,{cancelButtonText:Nfe(),cancelButtonSendType:"SKIP",submitButtonText:c}),j.createElement(r,null))))};Kl.Header=function(){return j.createElement(Ar,{level:3},kfe())};Kl.Footer=function(){return null};const{getChallengeText:Lfe,getDeliveryMessageText:Ufe,getDeliveryMethodText:Ffe}=Ln,Yl=({className:t,variation:e})=>{const{isPending:n,challengeName:r,codeDeliveryDetails:s}=Et(h=>[h.isPending,h.challengeName,h.codeDeliveryDetails]),{handleChange:o,handleSubmit:a}=fs(),{components:{ConfirmSignIn:{Header:u=Yl.Header,Footer:c=Yl.Footer}}}=ds(),f=cR(r)&&s;return j.createElement(qr,{className:t,variation:e},j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmsignin":"",method:"post",onChange:o,onSubmit:a},j.createElement(ze,{as:"fieldset",direction:"column",isDisabled:n},j.createElement(u,null),j.createElement(ze,{direction:"column"},f&&j.createElement(Rs,{className:"amplify-authenticator__subtitle"},Ufe(s)),j.createElement(Po,null),j.createElement(Vr,null)),j.createElement(gb,null),j.createElement(c,null))))};function zfe(){const{challengeName:t,codeDeliveryDetails:e}=Et(({challengeName:r,codeDeliveryDetails:s})=>[r,s]),n=cR(t)&&e;return j.createElement(j.Fragment,null,j.createElement(Ar,{level:3},Lfe(t)),n&&j.createElement(Ar,{level:5},Ffe(e)))}Yl.Header=zfe;Yl.Footer=function(){return null};const{getResendCodeText:jfe,getResetYourPasswordText:Bfe}=Ln,Zl=({className:t,variation:e})=>{const{isPending:n}=Et(c=>[c.isPending]),{handleBlur:r,handleChange:s,handleSubmit:o}=fs(),{components:{ConfirmResetPassword:{Header:a=Zl.Header,Footer:u=Zl.Footer}}}=ds();return j.createElement(qr,{className:t,variation:e},j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmresetpassword":"",method:"post",onSubmit:o,onChange:s,onBlur:r},j.createElement(ze,{as:"fieldset",direction:"column",isDisabled:n},j.createElement(a,null),j.createElement(ze,{direction:"column"},j.createElement(Po,null)),j.createElement(Vr,null),j.createElement(mb,{cancelButtonSendType:"RESEND",cancelButtonText:jfe()}),j.createElement(u,null))))};Zl.Header=function(){const e=Bfe();return j.createElement(Ar,{level:3},e)};Zl.Footer=function(){return null};const{getBackToSignInText:$fe,getSendingText:Hfe,getSendCodeText:qfe,getResetYourPasswordText:Wfe}=Ln,Ba=({className:t,variation:e})=>{const{isPending:n}=Et(u=>[u.isPending]),{handleChange:r,handleSubmit:s}=fs(),{components:{ForgotPassword:{Header:o=Ba.Header,Footer:a=Ba.Footer}}}=ds();return j.createElement(qr,{className:t,variation:e},j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-forgotpassword":"",method:"post",onChange:r,onSubmit:s},j.createElement(ze,{as:"fieldset",direction:"column",isDisabled:n},j.createElement(o,null),j.createElement(ze,{direction:"column"},j.createElement(Po,null)),j.createElement(Vr,null),j.createElement(mb,{cancelButtonText:$fe(),cancelButtonSendType:"SIGN_IN",submitButtonText:n?j.createElement(j.Fragment,null,Hfe(),"…"):j.createElement(j.Fragment,null,qfe())}),j.createElement(a,null))))};Ba.Header=function(){return j.createElement(Ar,{level:3},Wfe())};Ba.Footer=function(){return null};const{getMfaTypeLabelByValue:Vfe,getSelectMfaTypeByChallengeName:Gfe,getSelectMfaTypeText:Kfe}=Ln,$a=({className:t,variation:e})=>{const{isPending:n,allowedMfaTypes:r=[]}=Et(c=>[c.isPending,c.allowedMfaTypes]),{handleChange:s,handleSubmit:o}=fs(),{components:{SelectMfaType:{Header:a=$a.Header,Footer:u=$a.Footer}}}=ds();return _.createElement(qr,{className:t,variation:e},_.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-select-mfa-type":"",method:"post",onChange:s,onSubmit:o},_.createElement(ze,{as:"fieldset",direction:"column",isDisabled:n},_.createElement(a,null),_.createElement(ze,{direction:"column"},_.createElement(sR,{name:"mfa_type",legend:Kfe(),legendHidden:!0,isDisabled:n,isRequired:!0},r.map((c,f)=>_.createElement(rR,{name:"mfa_type",key:c,value:c,defaultChecked:f===0},Vfe(c)))),_.createElement(Vr,null)),_.createElement(gb,null),_.createElement(u,null))))};$a.Header=function(){const{challengeName:e}=Et(n=>[n.challengeName]);return _.createElement(Ar,{level:3},Gfe(e))};$a.Footer=function(){return null};const{getSetupEmailText:Yfe}=Ln,Ha=({className:t,variation:e})=>{const{isPending:n}=Et(u=>[u.isPending]),{handleChange:r,handleSubmit:s}=fs(),{components:{SetupEmail:{Header:o=Ha.Header,Footer:a=Ha.Footer}}}=ds();return _.createElement(qr,{className:t,variation:e},_.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-setup-email":"",method:"post",onChange:r,onSubmit:s},_.createElement(ze,{as:"fieldset",direction:"column",isDisabled:n},_.createElement(o,null),_.createElement(ze,{direction:"column"},_.createElement(Po,null),_.createElement(Vr,null)),_.createElement(gb,null),_.createElement(a,null))))};Ha.Header=function(){return _.createElement(Ar,{level:3},Yfe())};Ha.Footer=function(){return null};const{getSignInWithPasswordText:C_,getSignInWithEmailText:Zfe,getSignInWithSmsText:Xfe,getSignInWithPasskeyText:Qfe,getSigningInText:Jfe,getBackToSignInText:ehe,getOrText:the,getUsernameLabelByLoginMechanism:nhe}=Ln,rhe=t=>{switch(t){case"EMAIL_OTP":return Zfe();case"SMS_OTP":return Xfe();case"WEB_AUTHN":return Qfe();case"PASSWORD":return C_();default:return C_()}},she=({className:t,variation:e})=>{const{isPending:n,username:r,availableAuthMethods:s,toSignIn:o,selectAuthMethod:a,loginMechanism:u}=Et(E=>[E.isPending,E.username,E.availableAuthMethods,E.toSignIn,E.selectAuthMethod,E.loginMechanism]),{handleChange:c,handleSubmit:f}=fs(),h=s??[],g=h.includes("PASSWORD"),m=h.filter(E=>E!=="PASSWORD"),y=E=>{a({method:E})},S=nhe(u);return j.createElement(qr,{className:t,variation:e},j.createElement("form",{"data-amplify-form":!0,"data-amplify-authenticator-signinselect":!0,method:"post",onSubmit:f,onChange:c},j.createElement(ze,{direction:"column"},j.createElement(fp,{label:S,name:"username",value:r,isReadOnly:!0,isDisabled:!0}),g&&j.createElement(j.Fragment,null,j.createElement(nR,{label:"Password",name:"password",autoComplete:"current-password",isDisabled:n}),j.createElement(en,{isDisabled:n,type:"submit",variation:"primary",isFullWidth:!0,isLoading:n,loadingText:Jfe()},C_())),g&&m.length>0&&j.createElement(tR,{label:the()}),m.length>0&&j.createElement(ze,{direction:"column",gap:"0.5rem"},m.map(E=>j.createElement(en,{key:E,variation:"primary",isFullWidth:!0,isDisabled:n,onClick:()=>y(E)},rhe(E)))),j.createElement(Vr,null),j.createElement(en,{onClick:o,size:"small",variation:"link",isDisabled:n},ehe()))))},ohe=t=>{const{className:e,...n}=t;return _.createElement(qe,{as:"span",width:"1em",height:"1em",className:$e(ue.Icon,e),...n},_.createElement("svg",{width:"54",height:"54",viewBox:"0 0 54 54",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("path",{d:"M22.9333 38.9333L41.7333 20.1333L38 16.4L22.9333 31.4667L15.3333 23.8667L11.6 27.6L22.9333 38.9333ZM26.6667 53.3333C22.9778 53.3333 19.5111 52.6333 16.2667 51.2333C13.0222 49.8333 10.2 47.9333 7.8 45.5333C5.4 43.1333 3.5 40.3111 2.1 37.0667C0.7 33.8222 0 30.3556 0 26.6667C0 22.9778 0.7 19.5111 2.1 16.2667C3.5 13.0222 5.4 10.2 7.8 7.8C10.2 5.4 13.0222 3.5 16.2667 2.1C19.5111 0.7 22.9778 0 26.6667 0C30.3556 0 33.8222 0.7 37.0667 2.1C40.3111 3.5 43.1333 5.4 45.5333 7.8C47.9333 10.2 49.8333 13.0222 51.2333 16.2667C52.6333 19.5111 53.3333 22.9778 53.3333 26.6667C53.3333 30.3556 52.6333 33.8222 51.2333 37.0667C49.8333 40.3111 47.9333 43.1333 45.5333 45.5333C43.1333 47.9333 40.3111 49.8333 37.0667 51.2333C33.8222 52.6333 30.3556 53.3333 26.6667 53.3333Z",fill:"currentColor"})))},ihe=t=>{const{className:e,...n}=t;return _.createElement(qe,{as:"span",width:"1em",height:"1em",className:$e(ue.Icon,e),...n},_.createElement("svg",{width:"195",height:"128",viewBox:"0 0 195 128",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_.createElement("circle",{cx:"60",cy:"36",r:"31",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M60 69C84.4313 69 105.396 83.8504 114.357 105.021C116.774 110.729 115.382 116.168 111.798 120.23C108.191 124.319 102.358 127 96 127H24C17.6416 127 11.8094 124.319 8.20215 120.23C4.61836 116.168 3.22626 110.729 5.64258 105.021C14.6036 83.8504 35.5687 69 60 69Z",stroke:"#00404D",strokeWidth:"2"}),_.createElement("circle",{cx:"122",cy:"26",r:"25",fill:"#E9F9FC",stroke:"#00404D",strokeWidth:"2"}),_.createElement("mask",{id:"path-4-inside-1_4178_10171",fill:"white"},_.createElement("path",{d:"M121.951 13.927C124.887 13.927 127.658 14.5348 130.262 15.7503C132.866 16.9658 135.04 18.7222 136.786 21.0197C136.98 21.2601 137.042 21.4738 136.973 21.6608C136.903 21.8478 136.786 22.0081 136.619 22.1417C136.453 22.2753 136.259 22.3354 136.038 22.322C135.816 22.3086 135.622 22.1951 135.456 21.9814C133.932 19.8977 131.972 18.3015 129.576 17.1928C127.18 16.0842 124.638 15.5299 121.951 15.5299C119.264 15.5299 116.743 16.0842 114.388 17.1928C112.034 18.3015 110.081 19.8977 108.529 21.9814C108.363 22.2218 108.169 22.3554 107.947 22.3821C107.726 22.4088 107.532 22.3554 107.366 22.2218C107.172 22.0883 107.054 21.9213 107.012 21.7209C106.971 21.5206 107.033 21.3135 107.199 21.0998C108.917 18.8291 111.071 17.066 113.661 15.8104C116.251 14.5548 119.015 13.927 121.951 13.927ZM121.951 17.6937C125.691 17.6937 128.904 18.8959 131.591 21.3002C134.279 23.7045 135.622 26.6831 135.622 30.2361C135.622 31.5719 135.13 32.6872 134.147 33.5821C133.164 34.477 131.965 34.9245 130.553 34.9245C129.14 34.9245 127.928 34.477 126.917 33.5821C125.906 32.6872 125.4 31.5719 125.4 30.2361C125.4 29.3546 125.061 28.6132 124.382 28.0122C123.703 27.4111 122.893 27.1106 121.951 27.1106C121.009 27.1106 120.199 27.4111 119.52 28.0122C118.841 28.6132 118.502 29.3546 118.502 30.2361C118.502 32.8274 119.299 34.9913 120.891 36.7277C122.484 38.4642 124.541 39.6797 127.062 40.3742C127.311 40.4544 127.478 40.588 127.561 40.775C127.644 40.962 127.658 41.1623 127.602 41.376C127.547 41.563 127.436 41.7233 127.27 41.8569C127.104 41.9905 126.896 42.0305 126.647 41.9771C123.766 41.2825 121.411 39.9001 119.582 37.8297C117.754 35.7593 116.84 33.2281 116.84 30.2361C116.84 28.9004 117.339 27.7784 118.336 26.8701C119.333 25.9618 120.538 25.5077 121.951 25.5077C123.364 25.5077 124.569 25.9618 125.566 26.8701C126.563 27.7784 127.062 28.9004 127.062 30.2361C127.062 31.1177 127.408 31.859 128.101 32.4601C128.794 33.0612 129.611 33.3617 130.553 33.3617C131.495 33.3617 132.298 33.0612 132.963 32.4601C133.628 31.859 133.96 31.1177 133.96 30.2361C133.96 27.1373 132.783 24.5326 130.428 22.4222C128.073 20.3117 125.261 19.2565 121.993 19.2565C118.724 19.2565 115.912 20.3117 113.557 22.4222C111.202 24.5326 110.025 27.1239 110.025 30.1961C110.025 30.8372 110.087 31.6386 110.212 32.6004C110.337 33.5621 110.635 34.6841 111.106 35.9664C111.189 36.2068 111.182 36.4205 111.085 36.6075C110.988 36.7945 110.828 36.9281 110.607 37.0082C110.385 37.0884 110.171 37.0817 109.963 36.9882C109.755 36.8947 109.61 36.7411 109.526 36.5274C109.111 35.4855 108.813 34.4503 108.633 33.4218C108.453 32.3933 108.363 31.3314 108.363 30.2361C108.363 26.6831 109.7 23.7045 112.373 21.3002C115.046 18.8959 118.239 17.6937 121.951 17.6937ZM121.951 10C123.724 10 125.455 10.207 127.145 10.6211C128.835 11.0352 130.47 11.6296 132.049 12.4043C132.298 12.5379 132.443 12.6982 132.485 12.8852C132.526 13.0722 132.506 13.2592 132.423 13.4462C132.339 13.6332 132.201 13.7801 132.007 13.8869C131.813 13.9938 131.578 13.9804 131.301 13.8469C129.832 13.1256 128.316 12.5713 126.75 12.1839C125.185 11.7965 123.585 11.6029 121.951 11.6029C120.344 11.6029 118.765 11.7832 117.214 12.1438C115.663 12.5045 114.18 13.0722 112.768 13.8469C112.546 13.9804 112.324 14.0138 112.103 13.947C111.881 13.8803 111.715 13.74 111.604 13.5263C111.493 13.3126 111.466 13.1189 111.521 12.9453C111.576 12.7716 111.715 12.618 111.937 12.4844C113.488 11.683 115.109 11.0686 116.798 10.6411C118.488 10.2137 120.206 10 121.951 10ZM121.951 21.5807C124.527 21.5807 126.744 22.4155 128.6 24.0852C130.456 25.7548 131.384 27.8051 131.384 30.2361C131.384 30.4766 131.308 30.6702 131.155 30.8172C131.003 30.9641 130.802 31.0376 130.553 31.0376C130.331 31.0376 130.137 30.9641 129.971 30.8172C129.805 30.6702 129.722 30.4766 129.722 30.2361C129.722 28.2326 128.953 26.5562 127.415 25.2072C125.878 23.8581 124.056 23.1835 121.951 23.1835C119.846 23.1835 118.038 23.8581 116.528 25.2072C115.018 26.5562 114.264 28.2326 114.264 30.2361C114.264 32.4 114.651 34.2366 115.427 35.746C116.203 37.2553 117.339 38.7714 118.834 40.2941C119.001 40.4544 119.084 40.6414 119.084 40.8551C119.084 41.0688 119.001 41.2558 118.834 41.4161C118.668 41.5764 118.474 41.6565 118.253 41.6565C118.031 41.6565 117.837 41.5764 117.671 41.4161C116.037 39.7598 114.783 38.0701 113.91 36.347C113.038 34.624 112.601 32.587 112.601 30.2361C112.601 27.8051 113.516 25.7548 115.344 24.0852C117.172 22.4155 119.375 21.5807 121.951 21.5807ZM121.909 29.4347C122.159 29.4347 122.36 29.5148 122.512 29.6751C122.664 29.8354 122.741 30.0224 122.741 30.2361C122.741 32.2397 123.488 33.8826 124.984 35.1649C126.48 36.4472 128.226 37.0884 130.22 37.0884C130.386 37.0884 130.622 37.075 130.927 37.0483C131.231 37.0216 131.55 36.9815 131.882 36.9281C132.132 36.8747 132.346 36.9081 132.526 37.0283C132.706 37.1485 132.824 37.3288 132.88 37.5692C132.935 37.7829 132.893 37.9699 132.755 38.1302C132.616 38.2905 132.436 38.3974 132.215 38.4508C131.716 38.5844 131.28 38.6578 130.906 38.6712C130.532 38.6846 130.303 38.6912 130.22 38.6912C127.755 38.6912 125.615 37.8898 123.8 36.2869C121.986 34.6841 121.078 32.6671 121.078 30.2361C121.078 30.0224 121.155 29.8354 121.307 29.6751C121.459 29.5148 121.66 29.4347 121.909 29.4347Z"})),_.createElement("path",{d:"M121.951 13.927C124.887 13.927 127.658 14.5348 130.262 15.7503C132.866 16.9658 135.04 18.7222 136.786 21.0197C136.98 21.2601 137.042 21.4738 136.973 21.6608C136.903 21.8478 136.786 22.0081 136.619 22.1417C136.453 22.2753 136.259 22.3354 136.038 22.322C135.816 22.3086 135.622 22.1951 135.456 21.9814C133.932 19.8977 131.972 18.3015 129.576 17.1928C127.18 16.0842 124.638 15.5299 121.951 15.5299C119.264 15.5299 116.743 16.0842 114.388 17.1928C112.034 18.3015 110.081 19.8977 108.529 21.9814C108.363 22.2218 108.169 22.3554 107.947 22.3821C107.726 22.4088 107.532 22.3554 107.366 22.2218C107.172 22.0883 107.054 21.9213 107.012 21.7209C106.971 21.5206 107.033 21.3135 107.199 21.0998C108.917 18.8291 111.071 17.066 113.661 15.8104C116.251 14.5548 119.015 13.927 121.951 13.927ZM121.951 17.6937C125.691 17.6937 128.904 18.8959 131.591 21.3002C134.279 23.7045 135.622 26.6831 135.622 30.2361C135.622 31.5719 135.13 32.6872 134.147 33.5821C133.164 34.477 131.965 34.9245 130.553 34.9245C129.14 34.9245 127.928 34.477 126.917 33.5821C125.906 32.6872 125.4 31.5719 125.4 30.2361C125.4 29.3546 125.061 28.6132 124.382 28.0122C123.703 27.4111 122.893 27.1106 121.951 27.1106C121.009 27.1106 120.199 27.4111 119.52 28.0122C118.841 28.6132 118.502 29.3546 118.502 30.2361C118.502 32.8274 119.299 34.9913 120.891 36.7277C122.484 38.4642 124.541 39.6797 127.062 40.3742C127.311 40.4544 127.478 40.588 127.561 40.775C127.644 40.962 127.658 41.1623 127.602 41.376C127.547 41.563 127.436 41.7233 127.27 41.8569C127.104 41.9905 126.896 42.0305 126.647 41.9771C123.766 41.2825 121.411 39.9001 119.582 37.8297C117.754 35.7593 116.84 33.2281 116.84 30.2361C116.84 28.9004 117.339 27.7784 118.336 26.8701C119.333 25.9618 120.538 25.5077 121.951 25.5077C123.364 25.5077 124.569 25.9618 125.566 26.8701C126.563 27.7784 127.062 28.9004 127.062 30.2361C127.062 31.1177 127.408 31.859 128.101 32.4601C128.794 33.0612 129.611 33.3617 130.553 33.3617C131.495 33.3617 132.298 33.0612 132.963 32.4601C133.628 31.859 133.96 31.1177 133.96 30.2361C133.96 27.1373 132.783 24.5326 130.428 22.4222C128.073 20.3117 125.261 19.2565 121.993 19.2565C118.724 19.2565 115.912 20.3117 113.557 22.4222C111.202 24.5326 110.025 27.1239 110.025 30.1961C110.025 30.8372 110.087 31.6386 110.212 32.6004C110.337 33.5621 110.635 34.6841 111.106 35.9664C111.189 36.2068 111.182 36.4205 111.085 36.6075C110.988 36.7945 110.828 36.9281 110.607 37.0082C110.385 37.0884 110.171 37.0817 109.963 36.9882C109.755 36.8947 109.61 36.7411 109.526 36.5274C109.111 35.4855 108.813 34.4503 108.633 33.4218C108.453 32.3933 108.363 31.3314 108.363 30.2361C108.363 26.6831 109.7 23.7045 112.373 21.3002C115.046 18.8959 118.239 17.6937 121.951 17.6937ZM121.951 10C123.724 10 125.455 10.207 127.145 10.6211C128.835 11.0352 130.47 11.6296 132.049 12.4043C132.298 12.5379 132.443 12.6982 132.485 12.8852C132.526 13.0722 132.506 13.2592 132.423 13.4462C132.339 13.6332 132.201 13.7801 132.007 13.8869C131.813 13.9938 131.578 13.9804 131.301 13.8469C129.832 13.1256 128.316 12.5713 126.75 12.1839C125.185 11.7965 123.585 11.6029 121.951 11.6029C120.344 11.6029 118.765 11.7832 117.214 12.1438C115.663 12.5045 114.18 13.0722 112.768 13.8469C112.546 13.9804 112.324 14.0138 112.103 13.947C111.881 13.8803 111.715 13.74 111.604 13.5263C111.493 13.3126 111.466 13.1189 111.521 12.9453C111.576 12.7716 111.715 12.618 111.937 12.4844C113.488 11.683 115.109 11.0686 116.798 10.6411C118.488 10.2137 120.206 10 121.951 10ZM121.951 21.5807C124.527 21.5807 126.744 22.4155 128.6 24.0852C130.456 25.7548 131.384 27.8051 131.384 30.2361C131.384 30.4766 131.308 30.6702 131.155 30.8172C131.003 30.9641 130.802 31.0376 130.553 31.0376C130.331 31.0376 130.137 30.9641 129.971 30.8172C129.805 30.6702 129.722 30.4766 129.722 30.2361C129.722 28.2326 128.953 26.5562 127.415 25.2072C125.878 23.8581 124.056 23.1835 121.951 23.1835C119.846 23.1835 118.038 23.8581 116.528 25.2072C115.018 26.5562 114.264 28.2326 114.264 30.2361C114.264 32.4 114.651 34.2366 115.427 35.746C116.203 37.2553 117.339 38.7714 118.834 40.2941C119.001 40.4544 119.084 40.6414 119.084 40.8551C119.084 41.0688 119.001 41.2558 118.834 41.4161C118.668 41.5764 118.474 41.6565 118.253 41.6565C118.031 41.6565 117.837 41.5764 117.671 41.4161C116.037 39.7598 114.783 38.0701 113.91 36.347C113.038 34.624 112.601 32.587 112.601 30.2361C112.601 27.8051 113.516 25.7548 115.344 24.0852C117.172 22.4155 119.375 21.5807 121.951 21.5807ZM121.909 29.4347C122.159 29.4347 122.36 29.5148 122.512 29.6751C122.664 29.8354 122.741 30.0224 122.741 30.2361C122.741 32.2397 123.488 33.8826 124.984 35.1649C126.48 36.4472 128.226 37.0884 130.22 37.0884C130.386 37.0884 130.622 37.075 130.927 37.0483C131.231 37.0216 131.55 36.9815 131.882 36.9281C132.132 36.8747 132.346 36.9081 132.526 37.0283C132.706 37.1485 132.824 37.3288 132.88 37.5692C132.935 37.7829 132.893 37.9699 132.755 38.1302C132.616 38.2905 132.436 38.3974 132.215 38.4508C131.716 38.5844 131.28 38.6578 130.906 38.6712C130.532 38.6846 130.303 38.6912 130.22 38.6912C127.755 38.6912 125.615 37.8898 123.8 36.2869C121.986 34.6841 121.078 32.6671 121.078 30.2361C121.078 30.0224 121.155 29.8354 121.307 29.6751C121.459 29.5148 121.66 29.4347 121.909 29.4347Z",fill:"#00404D",stroke:"#00404D",strokeWidth:"4",mask:"url(#path-4-inside-1_4178_10171)"}),_.createElement("circle",{cx:"167.5",cy:"49.5",r:"19.5",fill:"#E9F9FC",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M167.89 43.65L161.26 54.18H167.89",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M167.5 60.42C173.316 60.42 178.03 55.7056 178.03 49.89V48.72",stroke:"#00404D",strokeWidth:"2"}),_.createElement("circle",{cx:"173.74",cy:"43.26",r:"1",fill:"#00404D",stroke:"#00404D",strokeWidth:"1.12"}),_.createElement("circle",{cx:"160.48",cy:"43.26",r:"1",fill:"#00404D",stroke:"#00404D",strokeWidth:"1.12"}),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M104 112C116.129 112 126.457 104.288 130.347 93.5H147.5L155.5 101.5L168 89L180.5 101.5L193 89L180.5 76.5H130.984C127.705 64.6779 116.866 56 104 56C88.536 56 76 68.536 76 84C76 99.464 88.536 112 104 112ZM104 98C111.732 98 118 91.732 118 84C118 76.268 111.732 70 104 70C96.268 70 90 76.268 90 84C90 91.732 96.268 98 104 98Z",fill:"#BCECF5"}),_.createElement("path",{d:"M130.347 93.5V92.5H129.645L129.407 93.1608L130.347 93.5ZM147.5 93.5L148.207 92.7929L147.914 92.5H147.5V93.5ZM155.5 101.5L154.793 102.207L155.5 102.914L156.207 102.207L155.5 101.5ZM168 89L168.707 88.2929L168 87.5858L167.293 88.2929L168 89ZM180.5 101.5L179.793 102.207L180.5 102.914L181.207 102.207L180.5 101.5ZM193 89L193.707 89.7071L194.414 89L193.707 88.2929L193 89ZM180.5 76.5L181.207 75.7929L180.914 75.5H180.5V76.5ZM130.984 76.5L130.021 76.7673L130.224 77.5H130.984V76.5ZM129.407 93.1608C125.655 103.565 115.694 111 104 111V113C116.564 113 127.259 105.011 131.288 93.8392L129.407 93.1608ZM147.5 92.5H130.347V94.5H147.5V92.5ZM156.207 100.793L148.207 92.7929L146.793 94.2071L154.793 102.207L156.207 100.793ZM167.293 88.2929L154.793 100.793L156.207 102.207L168.707 89.7071L167.293 88.2929ZM181.207 100.793L168.707 88.2929L167.293 89.7071L179.793 102.207L181.207 100.793ZM192.293 88.2929L179.793 100.793L181.207 102.207L193.707 89.7071L192.293 88.2929ZM179.793 77.2071L192.293 89.7071L193.707 88.2929L181.207 75.7929L179.793 77.2071ZM130.984 77.5H180.5V75.5H130.984V77.5ZM104 57C116.405 57 126.859 65.3669 130.021 76.7673L131.948 76.2327C128.552 63.9889 117.327 55 104 55V57ZM77 84C77 69.0883 89.0883 57 104 57V55C87.9837 55 75 67.9837 75 84H77ZM104 111C89.0883 111 77 98.9117 77 84H75C75 100.016 87.9837 113 104 113V111ZM117 84C117 91.1797 111.18 97 104 97V99C112.284 99 119 92.2843 119 84H117ZM104 71C111.18 71 117 76.8203 117 84H119C119 75.7157 112.284 69 104 69V71ZM91 84C91 76.8203 96.8203 71 104 71V69C95.7157 69 89 75.7157 89 84H91ZM104 97C96.8203 97 91 91.1797 91 84H89C89 92.2843 95.7157 99 104 99V97Z",fill:"#00404D"}),_.createElement("path",{d:"M138.5 57V66",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M139 104V124",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M134 61.5L143 61.5",stroke:"#00404D",strokeWidth:"2"}),_.createElement("path",{d:"M129 114L149 114",stroke:"#00404D",strokeWidth:"2"})))},{getPasskeyPromptHeadingText:ahe,getPasskeyPromptDescriptionText:lhe,getCreatePasskeyText:uhe,getRegisteringText:che,getContinueWithoutPasskeyText:dhe,getPasskeyCreatedSuccessText:fhe,getPasskeyRegisteredText:hhe,getPasskeyRegistrationFailedText:phe,getPasskeyLabelText:ghe,getExistingPasskeysText:mhe,getSetupAnotherPasskeyText:vhe,getContinueText:yhe}=Ln;function bhe({className:t,variation:e}){const[n,r]=j.useState(!1),[s,o]=j.useState(null),[a,u]=j.useState(!1),[c,f]=j.useState([]),{submitForm:h,isPending:g}=Et(w=>[w.submitForm,w.isPending]),m=j.useCallback(async()=>{try{const w=await kT();f(w.credentials||[])}catch{}},[]);j.useEffect(()=>{n&&m()},[n,m]);const y=j.useCallback(()=>{h({type:"SKIP"})},[h]),S=j.useCallback(()=>{h({type:"SUBMIT"})},[h]),E=j.useCallback(async()=>{try{o(null),u(!0),await pse(),r(!0)}catch(w){const T=w,x=T.name??"",R=T.message??"";if(x==="PasskeyRegistrationCanceled"||x==="NotAllowedError"||R.includes("canceled")||R.includes("cancelled")||R.includes("ceremony has been canceled")||R.includes("not allowed")){y();return}o(phe())}finally{u(!1)}},[y]);if(n)return j.createElement(qr,{className:t,variation:e},j.createElement(ze,{direction:"column",padding:"large","data-amplify-authenticator-passkeyprompt":""},j.createElement(ze,{direction:"column",gap:"xs"},j.createElement(ohe,{className:"amplify-authenticator__passkey-success-icon"}),j.createElement(Ar,{level:4},fhe()),j.createElement(Rs,null,hhe())),c.length>0&&j.createElement(qe,{marginTop:"large"},j.createElement(Ar,{level:5},mhe()),j.createElement(ze,{direction:"column",gap:"xs",marginTop:"xs"},c.map((w,T)=>j.createElement(qe,{key:w.credentialId,className:"amplify-authenticator__passkey-credential-item"},j.createElement(Rs,{fontSize:"small"},w.friendlyCredentialName??`${ghe()} ${T+1}`))))),j.createElement(ze,{direction:"column",gap:"medium",marginTop:"large"},j.createElement(en,{onClick:()=>{r(!1),E()},variation:"link"},vhe()),j.createElement(en,{onClick:()=>S(),variation:"primary",isFullWidth:!0},yhe()))));const C=g||a;return j.createElement(qr,{className:t,variation:e},j.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-passkeyprompt":""},j.createElement(ze,{direction:"column",gap:"medium"},j.createElement(Ar,{level:4},ahe()),j.createElement(Rs,null,lhe()),j.createElement(ze,{justifyContent:"center"},j.createElement(ihe,{className:"amplify-authenticator__passkey-icon"})),j.createElement(ze,{direction:"column",gap:"medium"},j.createElement(en,{onClick:()=>{E()},variation:"primary",isDisabled:C,isLoading:a,loadingText:che()},uhe()),j.createElement(en,{onClick:y,variation:"link",isDisabled:C},dhe()),s&&j.createElement(Rs,{className:"amplify-authenticator__passkey-error"},s),j.createElement(Vr,null)))))}function sU(){return null}const She=t=>{switch(t){case"authenticated":case"idle":case"setup":case"transition":return sU;case"confirmSignUp":return Vl;case"confirmSignIn":return Yl;case"selectMfaType":return $a;case"setupEmail":return Ha;case"setupTotp":return ja;case"signIn":case"signUp":return Rfe;case"signInSelectAuthFactor":return she;case"passkeyPrompt":return bhe;case"forceNewPassword":return Xs;case"forgotPassword":return Ba;case"confirmResetPassword":return Zl;case"verifyUser":return Kl;case"confirmVerifyUser":return Gl;default:return console.warn(`Unhandled Authenticator route - please open an issue: ${t}`),sU}};function Ehe({className:t,hideSignUp:e,variation:n}){const{route:r}=Et(({route:o})=>[o]),s=_.useMemo(()=>She(r),[r]);return j.createElement(s,{className:t,hideSignUp:Xde(r)?e:void 0,variation:n})}const Che={Header:()=>null,SignIn:{Header:Ci.Header,Footer:Ci.Footer},SignUp:{Header:Qs.Header,FormFields:Qs.FormFields,Footer:Qs.Footer},ConfirmSignUp:{Header:Vl.Header,Footer:Vl.Footer},SelectMfaType:{Header:$a.Header,Footer:$a.Footer},SetupEmail:{Header:Ha.Header,Footer:Ha.Footer},SetupTotp:{Header:ja.Header,Footer:ja.Footer},ConfirmResetPassword:{Header:Zl.Header,Footer:Zl.Footer},ConfirmSignIn:{Header:Yl.Header,Footer:Yl.Footer},VerifyUser:{Header:Kl.Header,Footer:Kl.Footer},ConfirmVerifyUser:{Header:Gl.Header,Footer:Gl.Footer},ForceNewPassword:{Header:Xs.Header,Footer:Xs.Footer,FormFields:Xs.FormFields},ForgotPassword:{Header:Ba.Header,Footer:Ba.Footer},Footer:()=>null};function whe({children:t,className:e,components:n,formFields:r,hideSignUp:s,initialState:o,loginMechanisms:a,passwordSettings:u,passwordless:c,signUpAttributes:f,services:h,socialProviders:g,variation:m}){vde({message:"The `passwordSettings` prop has been deprecated and will be removed in a future major version of Amplify UI.",shouldWarn:!1});const{route:y,signOut:S,user:E}=Et(({route:T,signOut:x,user:R})=>[T,x,R]);Kue({initialState:o,loginMechanisms:a,passwordSettings:u,passwordless:c,services:h,signUpAttributes:f,socialProviders:g,formFields:r});const C=_.useMemo(()=>({components:{...Che,...n}}),[n]);return y==="authenticated"||y==="signOut"?t?_.createElement(_.Fragment,null,Si(t)?t({signOut:S,user:E}):t):null:_.createElement(p7.Provider,{value:C},_.createElement(Ehe,{className:e,hideSignUp:s,variation:m}))}function ko(t){return Zue({componentName:"Authenticator",packageName:"react",version:mde}),_.createElement(ZF,null,_.createElement(whe,{...t}))}ko.Provider=ZF;ko.ForgotPassword=Ba;ko.SetupTotp=ja;ko.SignIn=Ci;ko.SignUp=Qs;ko.ForceNewPassword=Xs;ko.SelectMfaType=$a;ko.SetupEmail=Ha;const E7=({cssText:t,...e})=>t===void 0||/<\/style/i.test(t)?null:_.createElement("style",{...e,dangerouslySetInnerHTML:{__html:t}});E7.displayName="Style";const C7=({theme:t,...e})=>{if(!t)return null;const{name:n,cssText:r}=t;return _.createElement(E7,{...e,cssText:r,id:`amplify-theme-${n}`})};C7.displayName="ThemeStyle";function xhe({children:t,colorMode:e,direction:n="ltr",nonce:r,theme:s}){const o=_.useMemo(()=>({theme:lb(s),colorMode:e}),[s,e]);return _.createElement(XF.Provider,{value:o},_.createElement(Gce,{dir:n},_.createElement("div",{"data-amplify-theme":o.theme.name,"data-amplify-color-mode":e,dir:n},t),s?_.createElement(C7,{theme:o.theme,nonce:r}):null))}const _he=({configured:t,authStatus:e})=>e==="authenticated",Ahe=t=>t?t.signInDetails?.loginId??t.username??null:null,The=({children:t,fallback:e=null})=>{const{authStatus:n,signOut:r,user:s}=Et(o=>[o.authStatus,o.signOut,o.user]);return _he({configured:!0,authStatus:n})?I.jsx(I.Fragment,{children:t({email:Ahe(s),signOut:()=>r()})}):I.jsx(I.Fragment,{children:e})},Rhe=({children:t,fallback:e=null})=>Ly()?I.jsx(The,{fallback:e,children:t}):I.jsx(I.Fragment,{children:e}),oU='system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',Oi=t=>`var(${t})`,cn=Oi("--accent"),Ihe=Oi("--accent-hover"),iU=Oi("--accent-soft"),Uf=Oi("--accent-fg"),aU=Oi("--surface"),lc=Oi("--fg"),Ohe=Oi("--surface-sunken"),am=Oi("--fg-muted"),Ff=Oi("--line"),Nhe=lb({name:"remit",tokens:{colors:{brand:{primary:{10:{value:iU},20:{value:iU},40:{value:cn},60:{value:cn},80:{value:cn},90:{value:cn},100:{value:cn}}},background:{primary:{value:aU},secondary:{value:Ohe}},font:{primary:{value:lc},secondary:{value:am},tertiary:{value:am},interactive:{value:cn},inverse:{value:Uf},hover:{value:cn},focus:{value:cn},active:{value:cn}},border:{primary:{value:Ff},secondary:{value:Ff},focus:{value:cn}}},fonts:{default:{variable:{value:oU},static:{value:oU}}},radii:{small:{value:"3px"},medium:{value:"5px"},large:{value:"7px"}},components:{authenticator:{router:{borderColor:{value:Ff},borderWidth:{value:"1px"},boxShadow:{value:"0 10px 30px -10px rgb(15 23 42 / 0.18), 0 4px 12px -6px rgb(15 23 42 / 0.1)"},backgroundColor:{value:aU}},form:{padding:{value:"1.75rem"}},orContainer:{color:{value:am}}},button:{color:{value:lc},primary:{backgroundColor:{value:cn},color:{value:Uf},_hover:{backgroundColor:{value:Ihe},color:{value:Uf}},_focus:{backgroundColor:{value:cn},color:{value:Uf}},_active:{backgroundColor:{value:cn},color:{value:Uf}}},link:{color:{value:cn},_hover:{color:{value:cn},backgroundColor:{value:"transparent"}},_focus:{color:{value:cn},backgroundColor:{value:"transparent"}},_active:{color:{value:cn},backgroundColor:{value:"transparent"}}}},fieldcontrol:{color:{value:lc},borderColor:{value:Ff},_focus:{borderColor:{value:cn},boxShadow:{value:`0 0 0 2px ${cn}`}}},field:{label:{color:{value:lc}}},tabs:{borderColor:{value:Ff},item:{color:{value:am},backgroundColor:{value:"transparent"},_active:{color:{value:cn},borderColor:{value:cn},backgroundColor:{value:"transparent"}},_hover:{color:{value:cn}},_focus:{color:{value:cn}}}},heading:{color:{value:lc}},text:{color:{value:lc}}}}}),Mhe={signIn:{username:{placeholder:"Enter your username"},password:{placeholder:"Enter your password"}},signUp:{username:{placeholder:"Enter your username"},password:{placeholder:"Enter your password"},confirm_password:{placeholder:"Confirm your password"}}},Phe=()=>I.jsx(r_,{tone:"warning",className:"fixed top-0 left-0 right-0 z-50 h-7 sm:h-10 overflow-hidden border-x-0 border-t-0",children:I.jsxs("span",{className:"flex items-center gap-2",children:[I.jsx("strong",{className:"font-semibold shrink-0",children:"Local dev"}),I.jsx("span",{className:"truncate hidden sm:inline",children:"— Cognito not configured. Set VITE_COGNITO_USER_POOL_ID and VITE_COGNITO_CLIENT_ID in .env.local to enable sign-in."}),I.jsx("span",{className:"truncate sm:hidden",children:"— no Cognito; signed out"})]})}),khe=()=>I.jsx(A9,{note:q9({betterAuthEnabled:!1,cognitoConfigured:Ly()})}),Dhe=({children:t})=>{const{authStatus:e}=Et(n=>[n.authStatus]);return e==="authenticated"?I.jsx(I.Fragment,{children:t}):e==="configuring"?I.jsx(hT,{}):I.jsx(xhe,{theme:Nhe,children:I.jsxs(_9,{children:[I.jsx(T9,{}),I.jsx(ko,{hideSignUp:!1,formFields:Mhe,components:{Footer:khe}})]})})},Lhe=({children:t})=>Ly()?I.jsx(ko.Provider,{children:I.jsx(Dhe,{children:t})}):I.jsxs("div",{className:"pt-7 sm:pt-10 [&_#main-content]:h-[calc(100dvh-1.75rem)] sm:[&_#main-content]:h-[calc(100dvh-2.5rem)]",children:[I.jsx(Phe,{}),t]}),w7=60;let Uc=null;const x7=()=>Math.floor(Date.now()/1e3),Uhe=t=>t!==null&&t.expiresAt-w7>x7(),Fhe=async()=>{const e=(await Oy()).tokens?.idToken;return e?(Uc={value:e.toString(),expiresAt:e.payload.exp??x7()+w7},Uc.value):(Uc=null,null)},zhe=async()=>Ly()?Uhe(Uc)?Uc.value:Fhe():null,jhe=()=>{Uc=null},Lv={configure:A8,getToken:zhe,resetToken:jhe,Shell:Lhe,Account:Rhe},Bhe=({children:t})=>Uy()?I.jsx(Iv.Shell,{children:t}):I.jsx(Lv.Shell,{children:t}),$he=t=>Uy()?I.jsx(Iv.Account,{...t}):I.jsx(Lv.Account,{...t}),Hhe={configure:A8,getToken:()=>Uy()?Iv.getToken():Lv.getToken(),resetToken:()=>{Iv.resetToken(),Lv.resetToken()},Shell:Bhe,Account:$he};var bd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},qhe=class extends bd{#e;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},dR=new qhe,Whe={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Vhe=class{#e=Whe;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},Tl=new Vhe;function Ghe(t){setTimeout(t,0)}var Khe=typeof window>"u"||"Deno"in globalThis;function Er(){}function Yhe(t,e){return typeof t=="function"?t(e):t}function w_(t){return typeof t=="number"&&t>=0&&t!==1/0}function _7(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Ma(t,e){return typeof t=="function"?t(e):t}function is(t,e){return typeof t=="function"?t(e):t}function lU(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==fR(a,e.options))return!1}else if(!Mh(e.queryKey,a))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||s&&s!==e.state.fetchStatus||o&&!o(e))}function uU(t,e){const{exact:n,status:r,predicate:s,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(Xl(e.options.mutationKey)!==Xl(o))return!1}else if(!Mh(e.options.mutationKey,o))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function fR(t,e){return(e?.queryKeyHashFn||Xl)(t)}function Xl(t){return JSON.stringify(t,(e,n)=>x_(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Mh(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Mh(t[n],e[n])):!1}var Zhe=Object.prototype.hasOwnProperty;function A7(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=cU(t)&&cU(e);if(!r&&!(x_(t)&&x_(e)))return e;const o=(r?t:Object.keys(t)).length,a=r?e:Object.keys(e),u=a.length,c=r?new Array(u):{};let f=0;for(let h=0;h<u;h++){const g=r?h:a[h],m=t[g],y=e[g];if(m===y){c[g]=m,(r?h<o:Zhe.call(t,g))&&f++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){c[g]=y;continue}const S=A7(m,y,n+1);c[g]=S,S===m&&f++}return o===u&&f===o?t:c}function Uv(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function cU(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function x_(t){if(!dU(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!dU(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function dU(t){return Object.prototype.toString.call(t)==="[object Object]"}function Xhe(t){return new Promise(e=>{Tl.setTimeout(e,t)})}function __(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?A7(t,e):e}function Qhe(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function Jhe(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var hR=Symbol();function T7(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===hR?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function pR(t,e){return typeof t=="function"?t(...e):!!t}function epe(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??=e(),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}var Ph=(()=>{let t=()=>Khe;return{isServer(){return t()},setIsServer(e){t=e}}})();function A_(){let t,e;const n=new Promise((s,o)=>{t=s,e=o});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var tpe=Ghe;function npe(){let t=[],e=0,n=u=>{u()},r=u=>{u()},s=tpe;const o=u=>{e?t.push(u):s(()=>{n(u)})},a=()=>{const u=t;t=[],u.length&&s(()=>{r(()=>{u.forEach(c=>{n(c)})})})};return{batch:u=>{let c;e++;try{c=u()}finally{e--,e||a()}return c},batchCalls:u=>(...c)=>{o(()=>{u(...c)})},schedule:o,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{s=u}}}var Dn=npe(),rpe=class extends bd{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#e}},Fv=new rpe;function spe(t){return Math.min(1e3*2**t,3e4)}function R7(t){return(t??"online")==="online"?Fv.isOnline():!0}var T_=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function I7(t){let e=!1,n=0,r;const s=A_(),o=()=>s.status!=="pending",a=E=>{if(!o()){const C=new T_(E);m(C),t.onCancel?.(C)}},u=()=>{e=!0},c=()=>{e=!1},f=()=>dR.isFocused()&&(t.networkMode==="always"||Fv.isOnline())&&t.canRun(),h=()=>R7(t.networkMode)&&t.canRun(),g=E=>{o()||(r?.(),s.resolve(E))},m=E=>{o()||(r?.(),s.reject(E))},y=()=>new Promise(E=>{r=C=>{(o()||f())&&E(C)},t.onPause?.()}).then(()=>{r=void 0,o()||t.onContinue?.()}),S=()=>{if(o())return;let E;const C=n===0?t.initialPromise:void 0;try{E=C??t.fn()}catch(w){E=Promise.reject(w)}Promise.resolve(E).then(g).catch(w=>{if(o())return;const T=t.retry??(Ph.isServer()?0:3),x=t.retryDelay??spe,R=typeof x=="function"?x(n,w):x,M=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,w);if(e||!M){m(w);return}n++,t.onFail?.(n,w),Xhe(R).then(()=>f()?void 0:y()).then(()=>{e?m(w):S()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:c,canStart:h,start:()=>(h()?S():y().then(S),s)}}var O7=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),w_(this.gcTime)&&(this.#e=Tl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ph.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Tl.clearTimeout(this.#e),this.#e=void 0)}};function ope(t){return{onFetch:(e,n)=>{const r=e.options,s=e.fetchOptions?.meta?.fetchMore?.direction,o=e.state.data?.pages||[],a=e.state.data?.pageParams||[];let u={pages:[],pageParams:[]},c=0;const f=async()=>{let h=!1;const g=S=>{epe(S,()=>e.signal,()=>h=!0)},m=T7(e.options,e.fetchOptions),y=async(S,E,C)=>{if(h)return Promise.reject(e.signal.reason);if(E==null&&S.pages.length)return Promise.resolve(S);const T=(()=>{const N={client:e.client,queryKey:e.queryKey,pageParam:E,direction:C?"backward":"forward",meta:e.options.meta};return g(N),N})(),x=await m(T),{maxPages:R}=e.options,M=C?Jhe:Qhe;return{pages:M(S.pages,x,R),pageParams:M(S.pageParams,E,R)}};if(s&&o.length){const S=s==="backward",E=S?N7:R_,C={pages:o,pageParams:a},w=E(r,C);u=await y(C,w,S)}else{const S=t??o.length;do{const E=c===0?a[0]??r.initialPageParam:R_(r,u);if(c>0&&E==null)break;u=await y(u,E),c++}while(c<S)}return u};e.options.persister?e.fetchFn=()=>e.options.persister?.(f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=f}}}function R_(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function N7(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}function LRe(t,e){return e?R_(t,e)!=null:!1}function URe(t,e){return!e||!t.getPreviousPageParam?!1:N7(t,e)!=null}var ipe=class extends O7{#e;#t;#n;#r;#o;#s;#a;#i;constructor(t){super(),this.#i=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#o=t.client,this.#r=this.#o.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=hU(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#s?.promise}setOptions(t){if(this.options={...this.#a,...t},t?._type&&(this.#e=t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=hU(this.options);e.data!==void 0&&(this.setState(fU(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(t,e){const n=__(this.state.data,t,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t){this.#l({type:"setState",state:t})}cancel(t){const e=this.#s?.promise;return this.#s?.cancel(t),e?e.then(Er).catch(Er):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>is(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hR||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ma(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!_7(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#s&&(this.#i||this.#c()?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},s=()=>{const c=T7(this.options,e),h=(()=>{const g={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(g),g})();return this.#i=!1,this.options.persister?this.options.persister(c,h,this):c(h)},a=(()=>{const c={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:s};return r(c),c})();(this.#e==="infinite"?ope(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:"fetch",meta:a.fetchOptions?.meta}),this.#s=I7({initialPromise:e?.initialPromise,fn:a.fetchFn,onCancel:c=>{c instanceof T_&&c.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(c,f)=>{this.#l({type:"failed",failureCount:c,error:f})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const c=await this.#s.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#r.config.onSuccess?.(c,this),this.#r.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof T_){if(c.silent)return this.#s.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#l({type:"error",error:c}),this.#r.config.onError?.(c,this),this.#r.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#l(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...M7(n.data,this.options),fetchMeta:t.meta??null};case"success":const r={...n,...fU(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=t.manual?r:void 0,r;case"error":const s=t.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),Dn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:t})})}};function M7(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:R7(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function fU(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function hU(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ape=class extends bd{constructor(t,e){super(),this.options=e,this.#e=t,this.#i=null,this.#a=A_(),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#n=void 0;#r=void 0;#o;#s;#a;#i;#c;#l;#p;#d;#f;#u;#g=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),pU(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return I_(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return I_(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#E(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof is(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#t.setOptions(this.options),e._defaulted&&!Uv(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&gU(this.#t,n,this.options,e)&&this.#h(),this.updateResult(),r&&(this.#t!==n||is(this.options.enabled,this.#t)!==is(e.enabled,this.#t)||Ma(this.options.staleTime,this.#t)!==Ma(e.staleTime,this.#t))&&this.#m();const s=this.#v();r&&(this.#t!==n||is(this.options.enabled,this.#t)!==is(e.enabled,this.#t)||s!==this.#u)&&this.#y(s)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),n=this.createResult(e,t);return upe(this,n)&&(this.#r=n,this.#s=this.options,this.#o=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(t,e){return new Proxy(t,{get:(n,r)=>(this.trackProp(r),e?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(t){this.#g.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),n=this.#e.getQueryCache().build(this.#e,e);return n.fetch().then(()=>this.createResult(n,e))}fetch(t){return this.#h({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(t){this.#C();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Er)),e}#m(){this.#S();const t=Ma(this.options.staleTime,this.#t);if(Ph.isServer()||this.#r.isStale||!w_(t))return;const n=_7(this.#r.dataUpdatedAt,t)+1;this.#d=Tl.setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(t){this.#E(),this.#u=t,!(Ph.isServer()||is(this.options.enabled,this.#t)===!1||!w_(this.#u)||this.#u===0)&&(this.#f=Tl.setInterval(()=>{(this.options.refetchIntervalInBackground||dR.isFocused())&&this.#h()},this.#u))}#b(){this.#m(),this.#y(this.#v())}#S(){this.#d!==void 0&&(Tl.clearTimeout(this.#d),this.#d=void 0)}#E(){this.#f!==void 0&&(Tl.clearInterval(this.#f),this.#f=void 0)}createResult(t,e){const n=this.#t,r=this.options,s=this.#r,o=this.#o,a=this.#s,c=t!==n?t.state:this.#n,{state:f}=t;let h={...f},g=!1,m;if(e._optimisticResults){const k=this.hasListeners(),F=!k&&pU(t,e),H=k&&gU(t,n,e,r);(F||H)&&(h={...h,...M7(f.data,t.options)}),e._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:y,errorUpdatedAt:S,status:E}=h;m=h.data;let C=!1;if(e.placeholderData!==void 0&&m===void 0&&E==="pending"){let k;s?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(k=s.data,C=!0):k=typeof e.placeholderData=="function"?e.placeholderData(this.#p?.state.data,this.#p):e.placeholderData,k!==void 0&&(E="success",m=__(s?.data,k,e),g=!0)}if(e.select&&m!==void 0&&!C)if(s&&m===o?.data&&e.select===this.#c)m=this.#l;else try{this.#c=e.select,m=e.select(m),m=__(s?.data,m,e),this.#l=m,this.#i=null}catch(k){this.#i=k}this.#i&&(y=this.#i,m=this.#l,S=Date.now(),E="error");const w=h.fetchStatus==="fetching",T=E==="pending",x=E==="error",R=T&&w,M=m!==void 0,O={status:E,fetchStatus:h.fetchStatus,isPending:T,isSuccess:E==="success",isError:x,isInitialLoading:R,isLoading:R,data:m,dataUpdatedAt:h.dataUpdatedAt,error:y,errorUpdatedAt:S,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!T,isLoadingError:x&&!M,isPaused:h.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:x&&M,isStale:gR(t,e),refetch:this.refetch,promise:this.#a,isEnabled:is(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const k=O.data!==void 0,F=O.status==="error"&&!k,H=q=>{F?q.reject(O.error):k&&q.resolve(O.data)},D=()=>{const q=this.#a=O.promise=A_();H(q)},z=this.#a;switch(z.status){case"pending":t.queryHash===n.queryHash&&H(z);break;case"fulfilled":(F||O.data!==z.value)&&D();break;case"rejected":(!F||O.error!==z.reason)&&D();break}}return O}updateResult(){const t=this.#r,e=this.createResult(this.#t,this.options);if(this.#o=this.#t.state,this.#s=this.options,this.#o.data!==void 0&&(this.#p=this.#t),Uv(e,t))return;this.#r=e;const n=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!this.#g.size)return!0;const o=new Set(s??this.#g);return this.options.throwOnError&&o.add("error"),Object.keys(this.#r).some(a=>{const u=a;return this.#r[u]!==t[u]&&o.has(u)})};this.#w({listeners:n()})}#C(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#n=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(t){Dn.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function lpe(t,e){return is(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&is(e.retryOnMount,t)===!1)}function pU(t,e){return lpe(t,e)||t.state.data!==void 0&&I_(t,e,e.refetchOnMount)}function I_(t,e,n){if(is(e.enabled,t)!==!1&&Ma(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&gR(t,e)}return!1}function gU(t,e,n,r){return(t!==e||is(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&gR(t,n)}function gR(t,e){return is(e.enabled,t)!==!1&&t.isStaleByTime(Ma(e.staleTime,t))}function upe(t,e){return!Uv(t.getCurrentResult(),e)}var cpe=class extends O7{#e;#t;#n;#r;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#t=[],this.state=t.state||P7(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#o({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=I7({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,a)=>{this.#o({type:"failed",failureCount:o,error:a})},onPause:()=>{this.#o({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",s=!this.#r.canStart();try{if(r)e();else{this.#o({type:"pending",variables:t,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,n);const a=await this.options.onMutate?.(t,n);a!==this.state.context&&this.#o({type:"pending",context:a,variables:t,isPaused:s})}const o=await this.#r.start();return await this.#n.config.onSuccess?.(o,t,this.state.context,this,n),await this.options.onSuccess?.(o,t,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,t,this.state.context,n),this.#o({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,t,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(o,t,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,o,t,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#o({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#o(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Dn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function P7(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var k7=class extends bd{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(t,e,n){const r=new cpe({client:t,mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:n});return this.add(r),r}add(t){this.#e.add(t);const e=lm(t);if(typeof e=="string"){const n=this.#t.get(e);n?n.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=lm(t);if(typeof e=="string"){const n=this.#t.get(e);if(n)if(n.length>1){const r=n.indexOf(t);r!==-1&&n.splice(r,1)}else n[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=lm(t);if(typeof e=="string"){const r=this.#t.get(e)?.find(s=>s.state.status==="pending");return!r||r===t}else return!0}runNext(t){const e=lm(t);return typeof e=="string"?this.#t.get(e)?.find(r=>r!==t&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Dn.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(n=>uU(e,n))}findAll(t={}){return this.getAll().filter(e=>uU(t,e))}notify(t){Dn.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return Dn.batch(()=>Promise.all(t.map(e=>e.continue().catch(Er))))}};function lm(t){return t.options.scope?.id}var dpe=class extends bd{#e;#t=void 0;#n;#r;constructor(e,n){super(),this.#e=e,this.setOptions(n),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const n=this.options;this.options=this.#e.defaultMutationOptions(e),Uv(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Xl(n.mutationKey)!==Xl(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#o(),this.#s(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#o(),this.#s()}mutate(e,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#o(){const e=this.#n?.state??P7();this.#t={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#s(e){Dn.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#r.onSuccess?.(e.data,n,r,s)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(e.data,null,n,r,s)}catch(o){Promise.reject(o)}}else if(e?.type==="error"){try{this.#r.onError?.(e.error,n,r,s)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(void 0,e.error,n,r,s)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#t)})})}},D7=class extends bd{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,n){const r=e.queryKey,s=e.queryHash??fR(r,e);let o=this.get(s);return o||(o=new ipe({client:t,queryKey:r,queryHash:s,options:t.defaultQueryOptions(e),state:n,defaultOptions:t.getQueryDefaults(r)}),this.add(o)),o}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Dn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(n=>lU(e,n))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(n=>lU(t,n)):e}notify(t){Dn.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){Dn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Dn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fpe=class{#e;#t;#n;#r;#o;#s;#a;#i;constructor(t={}){this.#e=t.queryCache||new D7,this.#t=t.mutationCache||new k7,this.#n=t.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#a=dR.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Fv.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#a?.(),this.#a=void 0,this.#i?.(),this.#i=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=this.#e.build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Ma(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),o=this.#e.get(r.queryHash)?.state.data,a=Yhe(e,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Dn.batch(()=>this.#e.findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;Dn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=this.#e;return Dn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Dn.batch(()=>this.#e.findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Er).catch(Er)}invalidateQueries(t,e={}){return Dn.batch(()=>(this.#e.findAll(t).forEach(n=>{n.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Dn.batch(()=>this.#e.findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Er)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Er)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=this.#e.build(this,e);return n.isStaleByTime(Ma(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Er).catch(Er)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Er).catch(Er)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Fv.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#r.set(Xl(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#r.values()],n={};return e.forEach(r=>{Mh(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){this.#o.set(Xl(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#o.values()],n={};return e.forEach(r=>{Mh(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=fR(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===hR&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},L7=_.createContext(void 0),vb=t=>{const e=_.useContext(L7);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},hpe=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),I.jsx(L7.Provider,{value:t,children:e})),U7=_.createContext(!1),ppe=()=>_.useContext(U7);U7.Provider;function gpe(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var mpe=_.createContext(gpe()),vpe=()=>_.useContext(mpe),ype=(t,e,n)=>{const r=n?.state.error&&typeof t.throwOnError=="function"?pR(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},bpe=t=>{_.useEffect(()=>{t.clearReset()},[t])},Spe=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||pR(n,[t.error,r])),Epe=t=>{if(t.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Cpe=(t,e)=>t.isLoading&&t.isFetching&&!e,wpe=(t,e)=>t?.suspense&&e.isPending,mU=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function xpe(t,e,n){const r=ppe(),s=vpe(),o=vb(),a=o.defaultQueryOptions(t);o.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const u=o.getQueryCache().get(a.queryHash),c=t.subscribed!==!1;a._optimisticResults=r?"isRestoring":c?"optimistic":void 0,Epe(a),ype(a,s,u),bpe(s);const f=!o.getQueryCache().get(a.queryHash),[h]=_.useState(()=>new e(o,a)),g=h.getOptimisticResult(a),m=!r&&c;if(_.useSyncExternalStore(_.useCallback(y=>{const S=m?h.subscribe(Dn.batchCalls(y)):Er;return h.updateResult(),S},[h,m]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),_.useEffect(()=>{h.setOptions(a)},[a,h]),wpe(a,g))throw mU(a,h,s);if(Spe({result:g,errorResetBoundary:s,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw g.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(a,g),a.experimental_prefetchInRender&&!Ph.isServer()&&Cpe(g,r)&&(f?mU(a,h,s):u?.promise)?.catch(Er).finally(()=>{h.updateResult()}),a.notifyOnChangeProps?g:h.trackResult(g)}function F7(t,e){return xpe(t,ape)}function _pe(t,e){const n=vb(),[r]=_.useState(()=>new dpe(n,t));_.useEffect(()=>{r.setOptions(t)},[r,t]);const s=_.useSyncExternalStore(_.useCallback(a=>r.subscribe(Dn.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=_.useCallback((a,u)=>{r.mutate(a,u).catch(Er)},[r]);if(s.error&&pR(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}const Ape="modulepreload",Tpe=function(t){return"/"+t},vU={},Un=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let c=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),u=a?.nonce||a?.getAttribute("nonce");s=c(n.map(f=>{if(f=Tpe(f),f in vU)return;vU[f]=!0;const h=f.endsWith(".css"),g=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Ape,h||(m.as="script"),m.crossOrigin="",m.href=f,u&&m.setAttribute("nonce",u),document.head.appendChild(m),h)return new Promise((y,S)=>{m.addEventListener("load",y),m.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return s.then(a=>{for(const u of a||[])u.status==="rejected"&&o(u.reason);return e().catch(o)})};var yU=_.use,Rc=typeof window<"u"?_.useLayoutEffect:_.useEffect;function Vw(t){const e=_.useRef({value:t,prev:null}),n=e.current.value;return t!==n&&(e.current={value:t,prev:n}),e.current.prev}function Rpe(t,e,n={},r={}){_.useEffect(()=>{if(!t.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([o])=>{e(o)},n);return s.observe(t.current),()=>{s.disconnect()}},[e,n,r.disabled,t])}function Ipe(t){const e=_.useRef(null);return _.useImperativeHandle(t,()=>e.current,[]),e}const z7=!1;function kh(t){return t[t.length-1]}function Ope(t){return typeof t=="function"}function Rl(t,e){return Ope(t)?t(e):t}const j7=Object.prototype.hasOwnProperty,bU=Object.prototype.propertyIsEnumerable;function B7(t){for(const e in t)if(j7.call(t,e))return!0;return!1}const Npe=()=>Object.create(null),El=(t,e)=>Il(t,e,Npe);function Il(t,e,n=()=>({}),r=0){if(t===e)return t;if(r>500)return e;const s=e,o=CU(t)&&CU(s);if(!o&&!(zv(t)&&zv(s)))return s;const a=o?t:SU(t);if(!a)return s;const u=o?s:SU(s);if(!u)return s;const c=a.length,f=u.length,h=o?new Array(f):n();let g=0;for(let m=0;m<f;m++){const y=o?m:u[m],S=t[y],E=s[y];if(S===E){h[y]=S,(o?m<c:j7.call(t,y))&&g++;continue}if(S===null||E===null||typeof S!="object"||typeof E!="object"){h[y]=E;continue}const C=Il(S,E,n,r+1);h[y]=C,C===S&&g++}return c===f&&g===c?t:h}function SU(t){const e=Object.getOwnPropertyNames(t);for(const s of e)if(!bU.call(t,s))return!1;const n=Object.getOwnPropertySymbols(t);if(n.length===0)return e;const r=e;for(const s of n){if(!bU.call(t,s))return!1;r.push(s)}return r}function zv(t){if(!EU(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const n=e.prototype;return!(!EU(n)||!n.hasOwnProperty("isPrototypeOf"))}function EU(t){return Object.prototype.toString.call(t)==="[object Object]"}function CU(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ll(t,e,n){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0,s=t.length;r<s;r++)if(!Ll(t[r],e[r],n))return!1;return!0}if(zv(t)&&zv(e)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const a in e)if((!r||e[a]!==void 0)&&!Ll(t[a],e[a],n))return!1;return!0}let s=0;if(!r)s=Object.keys(t).length;else for(const a in t)t[a]!==void 0&&s++;let o=0;for(const a in e)if((!r||e[a]!==void 0)&&(o++,o>s||!Ll(t[a],e[a],n)))return!1;return s===o}return!1}function Vc(t){let e,n;const r=new Promise((s,o)=>{e=s,n=o});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,e(s),t?.(s)},r.reject=s=>{r.status="rejected",n(s)},r}function Mpe(t){return typeof t?.message!="string"?!1:t.message.startsWith("Failed to fetch dynamically imported module")||t.message.startsWith("error loading dynamically imported module")||t.message.startsWith("Importing a module script failed")}function Dh(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}const Ppe=/[\x00-\x1f\x7f"<>`{}]/g;function kpe(t){return t.replace(Ppe,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function wU(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return kpe(e)}const Dpe=["http:","https:","mailto:","tel:"];function jv(t,e){if(!t)return!1;try{const n=new URL(t);return!e.has(n.protocol)}catch{return!1}}function zf(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};const e=/%25|%5C/gi;let n=0,r="",s;for(;(s=e.exec(t))!==null;)r+=wU(t.slice(n,s.index))+s[0],n=e.lastIndex;r=r+wU(n?t.slice(n):t);let o=!1;return r.startsWith("//")&&(o=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:o}}function Lpe(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}function Upe(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function mi(){throw new Error("Invariant failed")}function Lh(t){const e=new Map;let n,r;const s=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,n=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const a=e.get(o);if(a)return s(a),a.value},set(o,a){if(e.size>=t&&n){const c=n;e.delete(c.key),c.next&&(n=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const u=e.get(o);if(u)u.value=a,s(u);else{const c={key:o,value:a,prev:r};r&&(r.next=c),r=c,n||(n=c),e.set(o,c)}},clear(){e.clear(),n=void 0,r=void 0}}}const Ra=4,$7=5;function Fpe(t){const e=t.indexOf("{");if(e===-1)return null;const n=t.indexOf("}",e);return n===-1||e+1>=t.length?null:[e,n]}function H7(t,e,n=new Uint16Array(6)){const r=t.indexOf("/",e),s=r===-1?t.length:r,o=t.substring(e,s);if(!o||!o.includes("$"))return n[0]=0,n[1]=e,n[2]=e,n[3]=s,n[4]=s,n[5]=s,n;if(o==="$"){const u=t.length;return n[0]=2,n[1]=e,n[2]=e,n[3]=u,n[4]=u,n[5]=u,n}if(o.charCodeAt(0)===36)return n[0]=1,n[1]=e,n[2]=e+1,n[3]=s,n[4]=s,n[5]=s,n;const a=Fpe(o);if(a){const[u,c]=a,f=o.charCodeAt(u+1);if(f===45){if(u+2<o.length&&o.charCodeAt(u+2)===36){const h=u+3,g=c;if(h<g)return n[0]=3,n[1]=e+u,n[2]=e+h,n[3]=e+g,n[4]=e+c+1,n[5]=s,n}}else if(f===36){const h=u+1,g=u+2;return g===c?(n[0]=2,n[1]=e+u,n[2]=e+h,n[3]=e+g,n[4]=e+c+1,n[5]=t.length,n):(n[0]=1,n[1]=e+u,n[2]=e+g,n[3]=e+c,n[4]=e+c+1,n[5]=s,n)}}return n[0]=0,n[1]=e,n[2]=e,n[3]=s,n[4]=s,n[5]=s,n}function yb(t,e,n,r,s,o,a){a?.(n);let u=r;{const c=n.fullPath??n.from,f=c.length,h=n.options?.caseSensitive??t,g=n.options?.params?.parse??n.options?.parseParams;for(;u<f;){const y=H7(c,u,e);let S;const E=u,C=y[5];switch(u=C+1,o++,y[0]){case 0:{const w=c.substring(y[2],y[3]);if(h){const T=s.static?.get(w);if(T)S=T;else{s.static??=new Map;const x=Ol(n.fullPath??n.from);x.parent=s,x.depth=o,S=x,s.static.set(w,x)}}else{const T=w.toLowerCase(),x=s.staticInsensitive?.get(T);if(x)S=x;else{s.staticInsensitive??=new Map;const R=Ol(n.fullPath??n.from);R.parent=s,R.depth=o,S=R,s.staticInsensitive.set(T,R)}}break}case 1:{const w=c.substring(E,y[1]),T=c.substring(y[4],C),x=h&&!!(w||T),R=w?x?w:w.toLowerCase():void 0,M=T?x?T:T.toLowerCase():void 0,N=!g&&s.dynamic?.find(O=>!O.parse&&O.caseSensitive===x&&O.prefix===R&&O.suffix===M);if(N)S=N;else{const O=Kw(1,n.fullPath??n.from,x,R,M);S=O,O.depth=o,O.parent=s,s.dynamic??=[],s.dynamic.push(O)}break}case 3:{const w=c.substring(E,y[1]),T=c.substring(y[4],C),x=h&&!!(w||T),R=w?x?w:w.toLowerCase():void 0,M=T?x?T:T.toLowerCase():void 0,N=!g&&s.optional?.find(O=>!O.parse&&O.caseSensitive===x&&O.prefix===R&&O.suffix===M);if(N)S=N;else{const O=Kw(3,n.fullPath??n.from,x,R,M);S=O,O.parent=s,O.depth=o,s.optional??=[],s.optional.push(O)}break}case 2:{const w=c.substring(E,y[1]),T=c.substring(y[4],C),x=h&&!!(w||T),R=w?x?w:w.toLowerCase():void 0,M=T?x?T:T.toLowerCase():void 0,N=Kw(2,n.fullPath??n.from,x,R,M);S=N,N.parent=s,N.depth=o,s.wildcard??=[],s.wildcard.push(N)}}s=S}if(g&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const y=Ol(n.fullPath??n.from);y.kind=$7,y.parent=s,o++,y.depth=o,s.pathless??=[],s.pathless.push(y),s=y}const m=(n.path||!n.children)&&!n.isRoot;if(m&&c.endsWith("/")){const y=Ol(n.fullPath??n.from);y.kind=Ra,y.parent=s,o++,y.depth=o,s.index=y,s=y}s.parse=g??null,s.priority=n.options?.params?.priority??0,m&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const c of n.children)yb(t,e,c,u,s,o,a)}function Gw(t,e){if(t.parse&&!e.parse)return-1;if(!t.parse&&e.parse)return 1;if(t.parse&&e.parse&&(t.priority||e.priority))return e.priority-t.priority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}function ba(t){if(t.pathless)for(const e of t.pathless)ba(e);if(t.static)for(const e of t.static.values())ba(e);if(t.staticInsensitive)for(const e of t.staticInsensitive.values())ba(e);if(t.dynamic?.length){t.dynamic.sort(Gw);for(const e of t.dynamic)ba(e)}if(t.optional?.length){t.optional.sort(Gw);for(const e of t.optional)ba(e)}if(t.wildcard?.length){t.wildcard.sort(Gw);for(const e of t.wildcard)ba(e)}}function Ol(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0}}function Kw(t,e,n,r,s){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:s}}function zpe(t,e){const n=Ol("/"),r=new Uint16Array(6);for(const s of t)yb(!1,r,s,1,n,0);ba(n),e.masksTree=n,e.flatCache=Lh(1e3)}function jpe(t,e){t||="/";const n=e.flatCache.get(t);if(n)return n;const r=mR(t,e.masksTree);return e.flatCache.set(t,r),r}function Bpe(t,e,n,r,s){t||="/",r||="/";const o=e?`case\0${t}`:t;let a=s.singleCache.get(o);return a||(a=Ol("/"),yb(e,new Uint16Array(6),{from:t},1,a,0),s.singleCache.set(o,a)),mR(r,a,n)}function $pe(t,e,n=!1){const r=n?t:`nofuzz\0${t}`,s=e.matchCache.get(r);if(s!==void 0)return s;t||="/";let o;try{o=mR(t,e.segmentTree,n)}catch(a){if(a instanceof URIError)o=null;else throw a}return o&&(o.branch=W7(o.route)),e.matchCache.set(r,o),o}function Hpe(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function qpe(t,e=!1,n){const r=Ol(t.fullPath),s=new Uint16Array(6),o={},a={};let u=0;return yb(e,s,t,1,r,0,c=>{if(n?.(c,u),c.id in o&&mi(),o[c.id]=c,u!==0&&c.path){const f=Hpe(c.fullPath);(!a[f]||c.fullPath.endsWith("/"))&&(a[f]=c)}u++}),ba(r),{processedTree:{segmentTree:r,singleCache:Lh(1e3),matchCache:Lh(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:a}}function mR(t,e,n=!1){const r=t.split("/"),s=Vpe(t,r,e,n);if(!s)return null;const[o]=q7(t,r,s);return{route:s.node.route,rawParams:o}}function q7(t,e,n){const r=Wpe(n.node);let s=null;const o=Object.create(null);let a=n.extract?.part??0,u=n.extract?.node??0,c=n.extract?.path??0,f=n.extract?.segment??0;for(;u<r.length;a++,u++,c++,f++){const h=r[u];if(h.kind===Ra)break;if(h.kind===$7){f--,a--,c--;continue}const g=e[a],m=c;if(g&&(c+=g.length),h.kind===1){s??=n.node.fullPath.split("/");const y=s[f],S=h.prefix?.length??0;if(y.charCodeAt(S)===123){const E=h.suffix?.length??0,C=y.substring(S+2,y.length-E-1),w=g.substring(S,g.length-E);o[C]=decodeURIComponent(w)}else{const E=y.substring(1);o[E]=decodeURIComponent(g)}}else if(h.kind===3){if(n.skipped&1<<u){a--,c=m-1;continue}s??=n.node.fullPath.split("/");const y=s[f],S=h.prefix?.length??0,E=h.suffix?.length??0,C=y.substring(S+3,y.length-E-1),w=h.suffix||h.prefix?g.substring(S,g.length-E):g;w&&(o[C]=decodeURIComponent(w))}else if(h.kind===2){const y=h,S=t.substring(m+(y.prefix?.length??0),t.length-(y.suffix?.length??0)),E=decodeURIComponent(S);o["*"]=E,o._splat=E;break}}return n.rawParams&&Object.assign(o,n.rawParams),[o,{part:a,node:u,path:c,segment:f}]}function W7(t){const e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}function Wpe(t){const e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}function Vpe(t,e,n,r){if(t==="/"&&n.index)return{node:n.index,skipped:0};const s=!kh(e),o=s&&t!=="/",a=e.length-(s?1:0),u=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let c=null,f=null;for(;u.length;){const h=u.pop(),{node:g,index:m,skipped:y,depth:S,statics:E,dynamics:C,optionals:w}=h;let{extract:T,rawParams:x}=h;if(g.kind===2&&g.route&&!cm(f,h))continue;if(g.parse){if(!xU(t,e,h))continue;x=h.rawParams,T=h.extract}r&&g.route&&g.kind!==Ra&&cm(c,h)&&(c=h);const R=m===a;if(R&&(g.route&&(!o||g.kind===Ra||g.kind===2)&&cm(f,h)&&(f=h),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const M=R?void 0:e[m];let N;if(R&&g.index){const O={node:g.index,index:m,skipped:y,depth:S+1,statics:E,dynamics:C,optionals:w,extract:T,rawParams:x};let k=!0;if(g.index.parse&&(xU(t,e,O)||(k=!1)),k){if(!C&&!w&&!y&&Gpe(E,a))return O;cm(f,O)&&(f=O)}}if(g.wildcard)for(let O=g.wildcard.length-1;O>=0;O--){const k=g.wildcard[O],{prefix:F,suffix:H}=k;if(!(F&&(R||!(k.caseSensitive?M:N??=M.toLowerCase()).startsWith(F)))){if(H){if(R)continue;const D=e.slice(m).join("/").slice(-H.length);if((k.caseSensitive?D:D.toLowerCase())!==H)continue}u.push({node:k,index:a,skipped:y,depth:S+1,statics:E,dynamics:C,optionals:w,extract:T,rawParams:x})}}if(g.optional){const O=y|1<<S,k=S+1;for(let F=g.optional.length-1;F>=0;F--){const H=g.optional[F];u.push({node:H,index:m,skipped:O,depth:k,statics:E,dynamics:C,optionals:w,extract:T,rawParams:x})}if(!R)for(let F=g.optional.length-1;F>=0;F--){const H=g.optional[F],{prefix:D,suffix:z}=H;if(D||z){const q=H.caseSensitive?M:N??=M.toLowerCase();if(D&&!q.startsWith(D)||z&&!q.endsWith(z))continue}u.push({node:H,index:m+1,skipped:y,depth:k,statics:E,dynamics:C,optionals:w+um(a,m),extract:T,rawParams:x})}}if(!R&&g.dynamic&&M)for(let O=g.dynamic.length-1;O>=0;O--){const k=g.dynamic[O],{prefix:F,suffix:H}=k;if(F||H){const D=k.caseSensitive?M:N??=M.toLowerCase();if(F&&!D.startsWith(F)||H&&!D.endsWith(H))continue}u.push({node:k,index:m+1,skipped:y,depth:S+1,statics:E,dynamics:C+um(a,m),optionals:w,extract:T,rawParams:x})}if(!R&&g.staticInsensitive){const O=g.staticInsensitive.get(N??=M.toLowerCase());O&&u.push({node:O,index:m+1,skipped:y,depth:S+1,statics:E+um(a,m),dynamics:C,optionals:w,extract:T,rawParams:x})}if(!R&&g.static){const O=g.static.get(M);O&&u.push({node:O,index:m+1,skipped:y,depth:S+1,statics:E+um(a,m),dynamics:C,optionals:w,extract:T,rawParams:x})}if(g.pathless){const O=S+1;for(let k=g.pathless.length-1;k>=0;k--){const F=g.pathless[k];u.push({node:F,index:m,skipped:y,depth:O,statics:E,dynamics:C,optionals:w,extract:T,rawParams:x})}}}if(f)return f;if(r&&c){let h=c.index;for(let m=0;m<c.index;m++)h+=e[m].length;const g=h===t.length?"/":t.slice(h);return c.rawParams??=Object.create(null),c.rawParams["**"]=decodeURIComponent(g),c}return null}function um(t,e){return 2**(t-e-1)}function Gpe(t,e){return t===2**(e-1)-1}function xU(t,e,n){let r,s;try{[r,s]=q7(t,e,n)}catch{return null}if(n.rawParams=r,n.extract=s,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function cm(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===Ra)>(t.node.kind===Ra)||e.node.kind===Ra==(t.node.kind===Ra)&&e.depth>t.depth))):!0}function lv(t){return vR(t.filter(e=>e!==void 0).join("/"))}function vR(t){return t.replace(/\/{2,}/g,"/")}function V7(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function pi(t){const e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}function G7(t){return pi(V7(t))}function Bv(t,e){return t?.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}function Kpe(t,e,n){return Bv(t,n)===Bv(e,n)}function Ype({base:t,to:e,trailingSlash:n="never",cache:r}){const s=e.startsWith("/"),o=!s&&e===".";let a;if(r){a=s?e:o?t:t+"\0"+e;const f=r.get(a);if(f)return f}let u;if(o)u=t.split("/");else if(s)u=e.split("/");else{for(u=t.split("/");u.length>1&&kh(u)==="";)u.pop();const f=e.split("/");for(let h=0,g=f.length;h<g;h++){const m=f[h];m===""?h?h===g-1&&u.push(m):u=[m]:m===".."?u.pop():m==="."||u.push(m)}}u.length>1&&(kh(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));const c=vR(u.join("/"))||"/";return a&&r&&r.set(a,c),c}function Zpe(t){const e=new Map(t.map(s=>[encodeURIComponent(s),s])),n=Array.from(e.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return s=>s.replace(r,o=>e.get(o)??o)}function Yw(t,e,n){const r=e[t];return typeof r!="string"?r:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>AU(s,n)).join("/"):AU(r,n)}function _U({path:t,params:e,decoder:n,...r}){let s=!1;const o=Object.create(null);if(!t||t==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:s};if(!t.includes("$"))return{interpolatedPath:t,usedParams:o,isMissingParams:s};const a=t.length;let u=0,c,f="";for(;u<a;){const h=u;c=H7(t,h,c);const g=c[5];if(u=g+1,h===g)continue;const m=c[0];if(m===0){f+="/"+t.substring(h,g);continue}if(m===2){const y=e._splat;o._splat=y,o["*"]=y;const S=t.substring(h,c[1]),E=t.substring(c[4],g);if(!y){s=!0,(S||E)&&(f+="/"+S+E);continue}const C=Yw("_splat",e,n);f+="/"+S+C+E;continue}if(m===1){const y=t.substring(c[2],c[3]);!s&&!(y in e)&&(s=!0),o[y]=e[y];const S=t.substring(h,c[1]),E=t.substring(c[4],g),C=Yw(y,e,n)??"undefined";f+="/"+S+C+E;continue}if(m===3){const y=t.substring(c[2],c[3]),S=e[y];if(S==null)continue;o[y]=S;const E=t.substring(h,c[1]),C=t.substring(c[4],g),w=Yw(y,e,n)??"";f+="/"+E+w+C;continue}}return t.endsWith("/")&&(f+="/"),{usedParams:o,interpolatedPath:f||"/",isMissingParams:s}}function AU(t,e){const n=encodeURIComponent(t);return e?.(n)??n}function hr(t){return t?.isNotFound===!0}function Xpe(){try{return sessionStorage}catch{return}}const Qpe="tsr-scroll-restoration-v1_3",K7=Xpe();function Jpe(){try{return JSON.parse(K7?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}function ege(){try{K7?.setItem(Qpe,JSON.stringify(Sc))}catch{}}const Sc=Jpe(),TU="data-scroll-restoration-id",tge=t=>t.state.__TSR_key||t.href;function nge(t){const e=t.getAttribute(TU);if(e)return`[${TU}="${e}"]`;let n="",r=t,s;for(;s=r.parentNode;){let o=1,a=r;for(;a=a.previousElementSibling;)o++;const u=`${r.localName}:nth-child(${o})`;n=n?`${u} > ${n}`:u,r=s}return n}let dm=!1;const uv="window";function O_(t){try{return typeof t=="function"?t():document.querySelector(t)}catch{}}function RU(t){const e=new Set;for(const n of t){if(n===uv)continue;const r=O_(n);r&&e.add(r)}return e}function rge(t,e){const n=t.options.scrollRestoration,r=t._scroll;n&&(r.restoring=!0);const s=t.options.getScrollRestorationKey||tge,o=new Set,a=u=>{const c=Sc[u]||={};for(const f of o)f===document?c[uv]={scrollX,scrollY}:f.isConnected&&(c[nge(f)]={scrollX:f.scrollLeft,scrollY:f.scrollTop})};n&&!r.restoration&&(r.restoration=!0,dm=!1,history.scrollRestoration="manual",document.addEventListener("scroll",u=>{dm||o.add(u.target)},!0),t.subscribe("onBeforeLoad",u=>{u.fromLocation&&a(s(u.fromLocation)),o.clear()}),addEventListener("pagehide",()=>{a(s(t.stores.resolvedLocation.get()??t.stores.location.get())),ege()})),!r.reset&&(r.reset=!0,t.subscribe("onRendered",u=>{const c=t.options.scrollRestorationBehavior,f=t.options.scrollToTopSelectors,h=r.next,g=r.hash;let m;if(o.clear(),r.next=!0,r.hash=!1,typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return;const y=s(u.toLocation),S=u.fromLocation&&s(u.fromLocation);if(r.restoring&&S&&S!==y){const E=Sc[S];if(E){let C=Sc[y];for(const w in E){if(w===uv){if(h)continue}else{const T=O_(w);if(!T||h&&f&&(m??=RU(f),m.has(T)))continue}C||(C=Sc[y]={}),C[w]??=E[w]}}}dm=!0;try{const E=u.toLocation.hash,C=u.toLocation.state.__hashScrollIntoViewOptions??!0;let w=!1;if(h){!E&&f&&(m??=RU(f));const T=E&&C&&g,x=r.restoring?Sc[y]:void 0;if(x)for(const R in x){const{scrollX:M,scrollY:N}=x[R];if(R===uv){if(T)continue;scrollTo({top:N,left:M,behavior:c}),w=!0}else{const O=O_(R);O&&(O.scrollLeft=M,O.scrollTop=N,m?.delete(O))}}if(!E){const R={top:0,left:0,behavior:c};if(w||scrollTo(R),m)for(const M of m)M.scrollTo(R)}}!w&&E&&C&&document.getElementById(E)?.scrollIntoView(C)}finally{dm=!1}}))}function sge(t,e=String){const n=new URLSearchParams;for(const r in t){const s=t[r];s!==void 0&&n.set(r,e(s))}return n.toString()}function Zw(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function oge(t){const e=new URLSearchParams(t),n=Object.create(null);for(const[r,s]of e.entries()){const o=n[r];o==null?n[r]=Zw(s):Array.isArray(o)?o.push(Zw(s)):n[r]=[o,Zw(s)]}return n}const ige=lge(JSON.parse),age=uge(JSON.stringify,JSON.parse);function lge(t){return e=>{e[0]==="?"&&(e=e.substring(1));const n=oge(e);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=t(s)}catch{}}return n}}function uge(t,e){const n=typeof e=="function";function r(s){if(typeof s=="object"&&s!==null)try{return t(s)}catch{}else if(n&&typeof s=="string")try{return e(s),t(s)}catch{}return s}return s=>{const o=sge(s,r);return o?`?${o}`:""}}const Ul="__root__";function Y7(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);const n=new Response(null,{status:t.statusCode,headers:e});if(n.options=t,t.throw)throw n;return n}function zr(t){return t instanceof Response&&!!t.options}function cge(t){return{input:({url:e})=>{for(const n of t)e=N_(n,e);return e},output:({url:e})=>{for(let n=t.length-1;n>=0;n--)e=Z7(t[n],e);return e}}}function dge(t){const e=G7(t.basepath),n=`/${e}`,r=t.caseSensitive?n:n.toLowerCase(),s=`${r}/`;return{input:({url:o})=>{const a=t.caseSensitive?o.pathname:o.pathname.toLowerCase();return a===r?o.pathname="/":a.startsWith(s)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=lv(["/",e,o.pathname]),o)}}function N_(t,e){const n=t?.input?.({url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}function Z7(t,e){const n=t?.output?.({url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}function fge(t,e){const{createMutableStore:n,createReadonlyStore:r,batch:s,init:o}=e,a=new Map,u=new Map,c=new Map,f=n(t.status),h=n(t.loadedAt),g=n(t.isLoading),m=n(t.isTransitioning),y=n(t.location),S=n(t.resolvedLocation),E=n(t.statusCode),C=n(t.redirect),w=n([]),T=n([]),x=n([]),R=r(()=>Xw(a,w.get())),M=r(()=>Xw(u,T.get())),N=r(()=>Xw(c,x.get())),O=r(()=>w.get()[0]),k=r(()=>w.get().some(te=>a.get(te)?.get().status==="pending")),F=r(()=>({locationHref:y.get().href,resolvedLocationHref:S.get()?.href,status:f.get()})),H=r(()=>({status:f.get(),loadedAt:h.get(),isLoading:g.get(),isTransitioning:m.get(),matches:R.get(),location:y.get(),resolvedLocation:S.get(),statusCode:E.get(),redirect:C.get()})),D=Lh(64);function z(te){let fe=D.get(te);return fe||(fe=r(()=>{const ae=w.get();for(const xe of ae){const L=a.get(xe);if(L&&L.routeId===te)return L.get()}}),D.set(te,fe)),fe}const q={status:f,loadedAt:h,isLoading:g,isTransitioning:m,location:y,resolvedLocation:S,statusCode:E,redirect:C,matchesId:w,pendingIds:T,cachedIds:x,matches:R,pendingMatches:M,cachedMatches:N,firstId:O,hasPending:k,matchRouteDeps:F,matchStores:a,pendingMatchStores:u,cachedMatchStores:c,__store:H,getRouteMatchStore:z,setMatches:K,setPending:ee,setCached:$};K(t.matches),o?.(q);function K(te){Qw(te,a,w,n,s)}function ee(te){Qw(te,u,T,n,s)}function $(te){Qw(te,c,x,n,s)}return q}function Xw(t,e){const n=[];for(const r of e){const s=t.get(r);s&&n.push(s.get())}return n}function Qw(t,e,n,r,s){const o=t.map(u=>u.id),a=new Set(o);s(()=>{for(const u of e.keys())a.has(u)||e.delete(u);for(const u of t){const c=e.get(u.id);if(!c){const f=r(u);f.routeId=u.routeId,e.set(u.id,f);continue}c.routeId=u.routeId,c.get()!==u&&c.set(u)}Upe(n.get(),o)||n.set(o)})}const M_=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},hge=t=>t.stores.matchesId.get().some(e=>t.stores.matchStores.get(e)?.get()._forcePending),bb=(t,e)=>!!(t.preload&&!t.router.stores.matchStores.has(e)),Fl=(t,e,n=!0)=>{const r={...t.router.options.context??{}},s=n?e:e-1;for(let o=0;o<=s;o++){const a=t.matches[o];if(!a)continue;const u=t.router.getMatch(a.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},IU=(t,e)=>{if(!t.matches.length)return;const n=e.routeId,r=t.matches.findIndex(a=>a.routeId===t.router.routeTree.id),s=r>=0?r:0;let o=n?t.matches.findIndex(a=>a.routeId===n):t.firstBadMatchIndex??t.matches.length-1;o<0&&(o=s);for(let a=o;a>=0;a--){const u=t.matches[a];if(t.router.looseRoutesById[u.routeId].options.notFoundComponent)return a}return n?o:s},Ia=(t,e,n)=>{if(!(!zr(n)&&!hr(n)))throw zr(n)&&n.redirectHandled&&!n.options.reloadDocument||(e&&(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.loaderPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loaderPromise=void 0,e._nonReactive.error=n,t.updateMatch(e.id,r=>({...r,status:zr(n)?"redirected":hr(n)?"notFound":r.status==="pending"?"success":r.status,context:Fl(t,e.index),isFetching:!1,error:n})),hr(n)&&!n.routeId&&(n.routeId=e.routeId),e._nonReactive.loadPromise?.resolve()),zr(n)&&(t.rendered=!0,n.options._fromLocation=t.location,n.redirectHandled=!0,n=t.router.resolveRedirect(n))),n},X7=(t,e)=>{const n=t.router.getMatch(e);return!!(!n||n._nonReactive.dehydrated)},OU=(t,e,n)=>{const r=Fl(t,n);t.updateMatch(e,s=>({...s,context:r}))},jf=(t,e,n)=>{const{id:r,routeId:s}=t.matches[e],o=t.router.looseRoutesById[s];if(n instanceof Promise)throw n;t.firstBadMatchIndex??=e,Ia(t,t.router.getMatch(r),n);try{o.options.onError?.(n)}catch(a){n=a,Ia(t,t.router.getMatch(r),n)}t.updateMatch(r,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!t.preload&&!zr(n)&&!hr(n)&&(t.serialError??=n)},Q7=(t,e,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??t.router.options.defaultPendingMs;if(t.onReady&&!bb(t,e)&&(n.options.loader||n.options.beforeLoad||ez(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??t.router.options?.defaultPendingComponent)){const o=setTimeout(()=>{M_(t)},s);r._nonReactive.pendingTimeout=o}},pge=(t,e,n)=>{const r=t.router.getMatch(e);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Q7(t,e,n,r);const s=()=>{const o=t.router.getMatch(e);o.preload&&(o.status==="redirected"||o.status==="notFound")&&Ia(t,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},gge=(t,e,n,r)=>{const s=t.router.getMatch(e);let o=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Vc(()=>{o?.resolve(),o=void 0});const{paramsError:a,searchError:u}=s;a&&jf(t,n,a),u&&jf(t,n,u),Q7(t,e,r,s);const c=new AbortController;let f=!1;const h=()=>{f||(f=!0,t.updateMatch(e,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:c})))},g=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,t.updateMatch(e,R=>({...R,isFetching:!1}))};if(!r.options.beforeLoad){t.router.batch(()=>{h(),g()});return}s._nonReactive.beforeLoadPromise=Vc();const m={...Fl(t,n,!1),...s.__routeContext},{search:y,params:S,cause:E}=s,C=bb(t,e),w={search:y,abortController:c,params:S,preload:C,context:m,location:t.location,navigate:R=>t.router.navigate({...R,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:C?"preload":E,matches:t.matches,routeId:r.id,...t.router.options.additionalContext},T=R=>{if(R===void 0){t.router.batch(()=>{h(),g()});return}(zr(R)||hr(R))&&(h(),jf(t,n,R)),t.router.batch(()=>{h(),t.updateMatch(e,M=>({...M,__beforeLoadContext:R})),g()})};let x;try{if(x=r.options.beforeLoad(w),Dh(x))return h(),x.catch(R=>{jf(t,n,R)}).then(T)}catch(R){h(),jf(t,n,R)}T(x)},mge=(t,e)=>{const{id:n,routeId:r}=t.matches[e],s=t.router.looseRoutesById[r],o=()=>u(),a=()=>gge(t,n,e,s),u=()=>{if(X7(t,n))return;const c=pge(t,n,s);return Dh(c)?c.then(a):a()};return o()},vge=(t,e,n)=>{const r=t.router.getMatch(e);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:t.router.options.ssr,matches:t.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(s),n.options.scripts?.(s),n.options.headers?.(s)]).then(([o,a,u])=>({meta:o?.meta,links:o?.links,headScripts:o?.scripts,headers:u,scripts:a,styles:o?.styles}))},J7=(t,e,n,r,s)=>{const o=e[r-1],{params:a,loaderDeps:u,abortController:c,cause:f}=t.router.getMatch(n),h=Fl(t,r),g=bb(t,n);return{params:a,deps:u,preload:!!g,parentMatchPromise:o,abortController:c,context:h,location:t.location,navigate:m=>t.router.navigate({...m,_fromLocation:t.location}),cause:g?"preload":f,route:s,...t.router.options.additionalContext}},NU=async(t,e,n,r,s)=>{try{const o=t.router.getMatch(n);try{(!(z7??t.router.isServer)||o.ssr===!0)&&Uh(s);const a=s.options.loader,u=typeof a=="function"?a:a?.handler,c=u?.(J7(t,e,n,r,s)),f=!!u&&Dh(c);if((f||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||o._nonReactive.minPendingPromise)&&t.updateMatch(n,g=>({...g,isFetching:"loader"})),u){const g=f?await c:c;Ia(t,t.router.getMatch(n),g),g!==void 0&&t.updateMatch(n,m=>({...m,loaderData:g}))}s._lazyPromise&&await s._lazyPromise;const h=o._nonReactive.minPendingPromise;h&&await h,s._componentsPromise&&await s._componentsPromise,t.updateMatch(n,g=>({...g,error:void 0,context:Fl(t,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let u=a;if(u?.name==="AbortError"){if(o.abortController.signal.aborted){o._nonReactive.loaderPromise?.resolve(),o._nonReactive.loaderPromise=void 0;return}t.updateMatch(n,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:Fl(t,r)}));return}const c=o._nonReactive.minPendingPromise;c&&await c,hr(a)&&await s.options.notFoundComponent?.preload?.(),Ia(t,t.router.getMatch(n),a);try{s.options.onError?.(a)}catch(f){u=f,Ia(t,t.router.getMatch(n),f)}!zr(u)&&!hr(u)&&await Uh(s,["errorComponent"]),t.updateMatch(n,f=>({...f,error:u,context:Fl(t,r),status:"error",isFetching:!1}))}}catch(o){const a=t.router.getMatch(n);a&&(a._nonReactive.loaderPromise=void 0),Ia(t,a,o)}},yge=async(t,e,n)=>{async function r(y,S,E,C,w){const T=Date.now()-S.updatedAt,x=y?w.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:w.options.staleTime??t.router.options.defaultStaleTime??0,R=w.options.shouldReload,M=typeof R=="function"?R(J7(t,e,s,n,w)):R,{status:N,invalid:O}=C,k=T>=x&&(!!t.forceStaleReload||C.cause==="enter"||E!==void 0&&E!==C.id);a=N==="success"&&(O||(M??k)),y&&w.options.preload===!1||(a&&!t.sync&&h?(u=!0,(async()=>{try{await NU(t,e,s,n,w);const F=t.router.getMatch(s);F._nonReactive.loaderPromise?.resolve(),F._nonReactive.loadPromise?.resolve(),F._nonReactive.loaderPromise=void 0,F._nonReactive.loadPromise=void 0}catch(F){zr(F)&&await t.router.navigate(F.options)}})()):N!=="success"||a?await NU(t,e,s,n,w):OU(t,s,n))}const{id:s,routeId:o}=t.matches[n];let a=!1,u=!1;const c=t.router.looseRoutesById[o],f=c.options.loader,h=((typeof f=="function"?void 0:f?.staleReloadMode)??t.router.options.defaultStaleReloadMode)!=="blocking";if(X7(t,s)){if(!t.router.getMatch(s))return t.matches[n];OU(t,s,n)}else{const y=t.router.getMatch(s),S=t.router.stores.matchesId.get()[n],E=(S&&t.router.stores.matchStores.get(S)||null)?.routeId===o?S:t.router.stores.matches.get().find(w=>w.routeId===o)?.id,C=bb(t,s);if(y._nonReactive.loaderPromise){if(y.status==="success"&&!t.sync&&!y.preload&&h)return y;await y._nonReactive.loaderPromise;const w=t.router.getMatch(s),T=w._nonReactive.error||w.error;T&&Ia(t,w,T),w.status==="pending"&&await r(C,y,E,w,c)}else{const w=C&&!t.router.stores.matchStores.has(s),T=t.router.getMatch(s);T._nonReactive.loaderPromise=Vc(),w!==T.preload&&t.updateMatch(s,x=>({...x,preload:w})),await r(C,y,E,T,c)}}const g=t.router.getMatch(s);u||(g._nonReactive.loaderPromise?.resolve(),g._nonReactive.loadPromise?.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,u||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const m=u?g.isFetching:!1;return m!==g.isFetching||g.invalid!==!1?(t.updateMatch(s,y=>({...y,isFetching:m,invalid:!1})),t.router.getMatch(s)):g};async function MU(t){const e=t,n=[];hge(e.router)&&M_(e);let r;for(let m=0;m<e.matches.length;m++){try{const y=mge(e,m);Dh(y)&&await y}catch(y){if(zr(y))throw y;if(hr(y))r=y;else if(!e.preload)throw y;break}if(e.serialError||e.firstBadMatchIndex!=null)break}const s=e.firstBadMatchIndex??e.matches.length,o=r&&!e.preload?IU(e,r):void 0,a=r&&e.preload?0:o!==void 0?Math.min(o+1,s):s;let u,c;for(let m=0;m<a;m++)n.push(yge(e,n,m));try{await Promise.all(n)}catch{const m=await Promise.allSettled(n);for(const y of m){if(y.status!=="rejected")continue;const S=y.reason;if(zr(S))throw S;hr(S)?u??=S:c??=S}if(c!==void 0)throw c}const f=u??(r&&!e.preload?r:void 0);let h=e.firstBadMatchIndex!==void 0?e.firstBadMatchIndex:e.matches.length-1;if(!f&&r&&e.preload)return e.matches;if(f){const m=IU(e,f);m===void 0&&mi();const y=e.matches[m],S=e.router.looseRoutesById[y.routeId],E=e.router.options?.defaultNotFoundComponent;!S.options.notFoundComponent&&E&&(S.options.notFoundComponent=E),f.routeId=y.routeId;const C=y.routeId===e.router.routeTree.id;e.updateMatch(y.id,w=>({...w,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),h=m,await Uh(S,["notFoundComponent"])}else if(!e.preload){const m=e.matches[0];m.globalNotFound||e.router.getMatch(m.id)?.globalNotFound&&e.updateMatch(m.id,y=>({...y,globalNotFound:!1,error:void 0}))}if(e.serialError&&e.firstBadMatchIndex!==void 0){const m=e.router.looseRoutesById[e.matches[e.firstBadMatchIndex].routeId];await Uh(m,["errorComponent"])}for(let m=0;m<=h;m++){const{id:y,routeId:S}=e.matches[m],E=e.router.looseRoutesById[S];try{const C=vge(e,y,E);if(C){const w=await C;e.updateMatch(y,T=>({...T,...w}))}}catch(C){console.error(`Error executing head for route ${S}:`,C)}}const g=M_(e);if(Dh(g)&&await g,f)throw f;if(e.serialError&&!e.preload&&!e.onReady)throw e.serialError;return e.matches}function PU(t,e){const n=e.map(r=>t.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Uh(t,e=cv){!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(r=>{const{id:s,...o}=r.options;Object.assign(t.options,o),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0);const n=()=>t._componentsLoaded?void 0:e===cv?(()=>{if(t._componentsPromise===void 0){const r=PU(t,cv);r?t._componentsPromise=r.then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0}):t._componentsLoaded=!0}return t._componentsPromise})():PU(t,e);return t._lazyPromise?t._lazyPromise.then(n):n()}function ez(t){for(const e of cv)if(t.options[e]?.preload)return!0;return!1}const cv=["component","errorComponent","pendingComponent","notFoundComponent"];var Pa="__TSR_index",kU="popstate",DU="beforeunload";function bge(t){let e=t.getLocation();const n=new Set,r=a=>{e=t.getLocation(),n.forEach(u=>u({location:e,action:a}))},s=a=>{t.notifyOnIndexChange??!0?r(a):e=t.getLocation()},o=async({task:a,navigateOpts:u,...c})=>{if(u?.ignoreBlocker??!1){a();return}const f=t.getBlockers?.()??[],h=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&f.length&&h)for(const g of f){const m=$v(c.path,c.state);if(await g.blockerFn({currentLocation:e,nextLocation:m,action:c.type})){t.onBlocked?.();return}}a()};return{get location(){return e},get length(){return t.getLength()},subscribers:n,subscribe:a=>(n.add(a),()=>{n.delete(a)}),push:(a,u,c)=>{const f=e.state[Pa];u=LU(f+1,u),o({task:()=>{t.pushState(a,u),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:a,state:u})},replace:(a,u,c)=>{const f=e.state[Pa];u=LU(f,u),o({task:()=>{t.replaceState(a,u),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:a,state:u})},go:(a,u)=>{o({task:()=>{t.go(a),s({type:"GO",index:a})},navigateOpts:u,type:"GO"})},back:a=>{o({task:()=>{t.back(a?.ignoreBlocker??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{o({task:()=>{t.forward(a?.ignoreBlocker??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>e.state[Pa]!==0,createHref:a=>t.createHref(a),block:a=>{if(!t.setBlockers)return()=>{};const u=t.getBlockers?.()??[];return t.setBlockers([...u,a]),()=>{const c=t.getBlockers?.()??[];t.setBlockers?.(c.filter(f=>f!==a))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:r}}function LU(t,e){e||(e={});const n=yR();return{...e,key:n,__TSR_key:n,[Pa]:t}}function Sge(t){const e=typeof document<"u"?window:void 0,n=e.history.pushState,r=e.history.replaceState;let s=[];const o=()=>s,a=k=>s=k,u=(k=>k),c=(()=>$v(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){const k=yR();e.history.replaceState({[Pa]:0,key:k,__TSR_key:k},"")}let f=c(),h,g=!1,m=!1,y=!1,S=!1;const E=()=>f;let C,w;const T=()=>{C&&(O._ignoreSubscribers=!0,(C.isPush?e.history.pushState:e.history.replaceState)(C.state,"",C.href),O._ignoreSubscribers=!1,C=void 0,w=void 0,h=void 0)},x=(k,F,H)=>{const D=u(F);w||(h=f),f=$v(F,H),C={href:D,state:H,isPush:C?.isPush||k==="push"},w||(w=Promise.resolve().then(()=>T()))},R=k=>{f=c(),O.notify({type:k})},M=async()=>{if(m){m=!1;return}const k=c(),F=k.state[Pa]-f.state[Pa],H=F===1,D=F===-1,z=!H&&!D||g;g=!1;const q=z?"GO":D?"BACK":"FORWARD",K=z?{type:"GO",index:F}:{type:D?"BACK":"FORWARD"};if(y)y=!1;else{const ee=o();if(typeof document<"u"&&ee.length){for(const $ of ee)if(await $.blockerFn({currentLocation:f,nextLocation:k,action:q})){m=!0,e.history.go(1),O.notify(K);return}}}f=c(),O.notify(K)},N=k=>{if(S){S=!1;return}let F=!1;const H=o();if(typeof document<"u"&&H.length)for(const D of H){const z=D.enableBeforeUnload??!0;if(z===!0){F=!0;break}if(typeof z=="function"&&z()===!0){F=!0;break}}if(F)return k.preventDefault(),k.returnValue=""},O=bge({getLocation:E,getLength:()=>e.history.length,pushState:(k,F)=>x("push",k,F),replaceState:(k,F)=>x("replace",k,F),back:k=>(k&&(y=!0),S=!0,e.history.back()),forward:k=>{k&&(y=!0),S=!0,e.history.forward()},go:k=>{g=!0,e.history.go(k)},createHref:k=>u(k),flush:T,destroy:()=>{e.history.pushState=n,e.history.replaceState=r,e.removeEventListener(DU,N,{capture:!0}),e.removeEventListener(kU,M)},onBlocked:()=>{h&&f!==h&&(f=h)},getBlockers:o,setBlockers:a,notifyOnIndexChange:!1});return e.addEventListener(DU,N,{capture:!0}),e.addEventListener(kU,M),e.history.pushState=function(...k){const F=n.apply(e.history,k);return O._ignoreSubscribers||R("PUSH"),F},e.history.replaceState=function(...k){const F=r.apply(e.history,k);return O._ignoreSubscribers||R("REPLACE"),F},O}function Ege(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}function $v(t,e){const n=Ege(t),r=n.indexOf("#"),s=n.indexOf("?"),o=yR();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:e||{[Pa]:0,key:o,__TSR_key:o}}}function yR(){return(Math.random()+1).toString(36).substring(7)}function Fc(t,e){const n=e,r=t;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Cge=class{constructor(t,e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=n=>n(),this.update=n=>{const r=this.options,s=this.basepath??r?.basepath??"/",o=this.basepath===void 0,a=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Zpe(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Sge()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let h;this.resolvePathCache=Lh(1e3),h=this.buildRouteTree(),this.setRoutes(h)}if(!this.stores&&this.latestLocation){const h=this.getStoreConfig(this);this.batch=h.batch,this.stores=fge(xge(this.latestLocation),h),rge(this)}let u=!1;const c=this.options.basepath??"/",f=this.options.rewrite;if(o||s!==c||a!==f){this.basepath=c;const h=[],g=G7(c);g&&g!=="/"&&h.push(dge({basepath:c})),f&&h.push(f),this.rewrite=h.length===0?void 0:h.length===1?h[0]:cge(h),this.history&&this.updateLatestLocation(),u=!0}u&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=qpe(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&zpe(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:c,search:f,hash:h,href:g,state:m})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const w=this.options.parseSearch(f),T=this.options.stringifySearch(w);return{href:c+T+h,publicHref:c+T+h,pathname:zf(c).path,external:!1,searchStr:T,search:El(r?.search,w),hash:zf(h.slice(1)).path,state:Il(r?.state,m)}}const y=new URL(g,this.origin),S=N_(this.rewrite,y),E=this.options.parseSearch(S.search),C=this.options.stringifySearch(E);return S.search=C,{href:S.href.replace(S.origin,""),publicHref:g,pathname:zf(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:C,search:El(r?.search,E),hash:zf(S.hash.slice(1)).path,state:Il(r?.state,m)}},o=s(n),{__tempLocation:a,__tempKey:u}=o.state;if(a&&(!u||u===this.tempLocationKey)){const c=s(a);return c.state.key=o.state.key,c.state.__TSR_key=o.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:o}}return o},this.resolvePathWithBase=(n,r)=>Ype({base:n,to:r.includes("//")?vR(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},s):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>_ge({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{if(this.stores.pendingMatchStores.has(n))return;const r=this.stores.matchStores.get(n)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(o={})=>{const a=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutesLightweight(a);o.from;const c=o.unsafeRelative==="path"?a.pathname:o.from??u.fullPath,f=o.to?`${o.to}`:void 0,h=u.search,g=Object.assign(Object.create(null),u.params),m=f?.charCodeAt(0)===47?"/":this.resolvePathWithBase(c,"."),y=f?this.resolvePathWithBase(m,f):m,S=o.params===!1||o.params===null?Object.create(null):(o.params??!0)===!0?g:Object.assign(g,Rl(o.params,g)),E=this.routesByPath[pi(y)];let C;if(E)C=this.getRouteBranch(E);else if(y.includes("$"))C=[];else{const D=this.getMatchedRoutes(y);C=D.matchedRoutes,this.options.notFoundRoute&&(!D.foundRoute||D.foundRoute.path!=="/"&&D.routeParams["**"])&&(C=[...C,this.options.notFoundRoute])}if(C.length&&B7(S))for(const D of C){const z=D.options.params?.stringify??D.options.stringifyParams;if(z)try{Object.assign(S,z(S))}catch{}}const w=n.leaveParams?y:zf(_U({path:y,params:S,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let T=h;if(n._includeValidateSearch&&this.options.search?.strict){const D={};C.forEach(z=>{if(z.options.validateSearch)try{Object.assign(D,dv(z.options.validateSearch,{...D,...T}))}catch{}}),T=D}T=Age({search:T,dest:o,destRoutes:C,_includeValidateSearch:n._includeValidateSearch}),T=El(h,T);const x=this.options.stringifySearch(T),R=o.hash===!0?a.hash:o.hash?Rl(o.hash,a.hash):void 0,M=R?`#${R}`:"";let N=o.state===!0?a.state:o.state?Rl(o.state,a.state):{};N=Il(a.state,N);const O=`${w}${x}${M}`;let k,F,H=!1;if(this.rewrite){const D=new URL(O,this.origin),z=Z7(this.rewrite,D);k=D.href.replace(D.origin,""),z.origin!==this.origin?(F=z.href,H=!0):F=z.pathname+z.search+z.hash}else k=Lpe(O),F=k;return{publicHref:F,href:k,pathname:w,search:T,searchStr:x,state:N,hash:R??"",external:H,unmaskOnReload:o.unmaskOnReload}},s=(o={},a)=>{const u=r(o);let c=a?r(a):void 0;if(!c){const f=Object.create(null);if(this.options.routeMasks){const h=jpe(u.pathname,this.processedTree);if(h){Object.assign(f,h.rawParams);const{from:g,params:m,...y}=h.route,S=m===!1||m===null?Object.create(null):(m??!0)===!0?f:Object.assign(f,Rl(m,f));a={from:n.from,...y,params:S},c=r(a)}}}return c&&(u.maskedLocation=c),u};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{let o;const a=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(g=>{s.state[g]=this.latestLocation.state[g]});const h=Ll(s.state,this.latestLocation.state);return f.forEach(g=>{delete s.state[g]}),h},u=pi(this.latestLocation.href)===pi(s.href);let c=this.commitLocationPromise;if(this.commitLocationPromise=Vc(()=>{c?.resolve(),c=void 0}),u&&a())this.load();else{let{maskedLocation:f,hashScrollIntoView:h,...g}=s;f&&(g={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...g,search:g.searchStr,state:{...g.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(g.unmaskOnReload??this.options.unmaskOnReload??!1)&&(g.state.__tempKey=this.tempLocationKey)),g.state.__hashScrollIntoViewOptions=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,o=s.replace?"REPLACE":"PUSH",this.history[o==="REPLACE"?"replace":"push"](g.publicHref,g.state,{ignoreBlocker:r})}return this._scroll.next=s.resetScroll??!0,this.history.subscribers.size||this.load(o?{action:{type:o}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:o,ignoreBlocker:a,href:u,...c}={})=>{if(u){const g=this.history.location.state.__TSR_index,m=$v(u,{__TSR_index:n?g:g+1}),y=new URL(m.pathname,this.origin);c.to=N_(this.rewrite,y).pathname,c.search=this.options.parseSearch(m.search),c.hash=m.hash.slice(1)}const f=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const h=this.commitLocation({...f,viewTransition:o,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),h},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:o,...a})=>{let u=!1;if(s)try{new URL(`${s}`),u=!0}catch{}if(u&&!r&&(r=!0),r){if(n!==void 0||!s){const f=this.buildLocation({to:n,...a});s=s??f.publicHref,o=o??f.publicHref}const c=!u&&o?o:s;if(jv(c,this.protocolAllowlist))return;if(!a.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const h of f)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(c):window.location.href=c;return}return this.buildAndCommitLocation({...a,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(s=>!n.some(o=>o.id===s.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{const r=n?.action?.type;let s,o,a;const u=this.stores.resolvedLocation.get()??this.stores.location.get();for(a=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad(),r&&(this._scroll.hash=r==="PUSH"||r==="REPLACE");const h=this.latestLocation,g=Fc(h,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...g}),this.emit({type:"onBeforeLoad",...g}),await MU({router:this,sync:n?.sync,forceStaleReload:u.href===h.href,matches:this.stores.pendingMatches.get(),location:h,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let m=null,y=null,S=null,E=null;this.batch(()=>{const C=this.stores.pendingMatches.get(),w=C.length,T=this.stores.matches.get();m=w?T.filter(M=>!this.stores.pendingMatchStores.has(M.id)):null;const x=new Set;for(const M of this.stores.pendingMatchStores.values())M.routeId&&x.add(M.routeId);const R=new Set;for(const M of this.stores.matchStores.values())M.routeId&&R.add(M.routeId);y=w?T.filter(M=>!x.has(M.routeId)):null,S=w?C.filter(M=>!R.has(M.routeId)):null,E=w?C.filter(M=>R.has(M.routeId)):T,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),w&&(this.stores.setMatches(C),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...m.filter(M=>M.status!=="error"&&M.status!=="notFound"&&M.status!=="redirected")]),this.clearExpiredCache())});for(const[C,w]of[[y,"onLeave"],[S,"onEnter"],[E,"onStay"]])if(C)for(const T of C)this.looseRoutesById[T.routeId].options[w]?.(T)})})}})}catch(h){zr(h)?(s=h,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):hr(h)&&(o=h);const g=s?s.status:o?404:this.stores.matches.get().some(m=>m.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(g),this.stores.redirect.set(s)})}this.latestLoadPromise===a&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=a,await a;this.latestLoadPromise&&a!==this.latestLoadPromise;)await this.latestLoadPromise;let c;this.hasNotFoundMatch()?c=404:this.stores.matches.get().some(f=>f.status==="error")&&(c=500),c!==void 0&&this.stores.statusCode.set(c)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,a=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(Fc(o,a)):r.types;if(u===!1){n();return}s={update:n,types:u}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const s=this.stores.pendingMatchStores.get(n);if(s){s.set(r);return}const o=this.stores.matchStores.get(n);if(o){o.set(r);return}const a=this.stores.cachedMatchStores.get(n);if(a){const u=r(a.get());u.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(c=>c.filter(f=>f!==n)):a.set(u)}})},this.getMatch=n=>this.stores.cachedMatchStores.get(n)?.get()??this.stores.pendingMatchStores.get(n)?.get()??this.stores.matchStores.get(n)?.get(),this.invalidate=n=>{const r=s=>n?.filter?.(s)??!0?{...s,invalid:!0,...n?.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),o=this.getParsedLocationHref(s);n.options.href=o,n.headers.set("Location",o)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const o=s.pathname+s.search+s.hash;n.options.href=o,n.headers.set("Location",o)}}catch{}if(n.options.href&&!n.options._builtLocation&&jv(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(s=>!r(s))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=s=>{const o=this.looseRoutesById[s.routeId];if(!o.options.loader)return!0;const a=(s.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:n-s.updatedAt>=a};this.clearCache({filter:r})},this.loadRouteChunk=Uh,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const o=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),a=new Set([...o,...this.stores.cachedIds.get()]),u=s.filter(c=>!a.has(c.id));if(u.length){const c=this.stores.cachedMatches.get();this.stores.setCached([...c,...u])}try{return s=await MU({router:this,matches:s,location:r,preload:!0,updateMatch:(c,f)=>{o.has(c)?s=s.map(h=>h.id===c?f(h):h):this.updateMatch(c,f)}}),s}catch(c){if(zr(c))return c.options.reloadDocument?void 0:await this.preloadRoute({...c.options,_fromLocation:r});hr(c)||console.error(c);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},o=this.buildLocation(s);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const a=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),u=Bpe(o.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,a.pathname,this.processedTree);return!u||n.params&&!Ll(u.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Ll(a.search,o.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=e,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??age,parseSearch:t.parseSearch??ige,protocolAllowlist:t.protocolAllowlist??Dpe}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:t,routesByPath:e,processedTree:n}){this.routesById=t,this.routesByPath=e,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(t){let e=this.routeBranchCache.get(t);return e||(e=W7(t),this.routeBranchCache.set(t,e)),e}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,e){const n=this.getMatchedRoutes(t.pathname),{foundRoute:r,routeParams:s}=n;let{matchedRoutes:o}=n,a=!1;(r?r.path!=="/"&&s["**"]:pi(t.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:a=!0);const u=a?Rge(this.options.notFoundMode,o):void 0,c=new Array(o.length),f=new Map;for(const h of this.stores.matchStores.values())h.routeId&&f.set(h.routeId,h.get());for(let h=0;h<o.length;h++){const g=o[h],m=c[h-1];let y,S,E;{const z=m?.search??t.search,q=m?._strictSearch??void 0;try{const K=dv(g.options.validateSearch,{...z})??void 0;y={...z,...K},S={...q,...K},E=void 0}catch(K){let ee=K;if(K instanceof Hv||(ee=new Hv(K.message,{cause:K})),e?.throwOnError)throw ee;y=z,S={},E=ee}}const C=g.options.loaderDeps?.({search:y})??"",w=C?JSON.stringify(C):"",{interpolatedPath:T,usedParams:x}=_U({path:g.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),R=g.id+T+w,M=this.getMatch(R),N=f.get(g.id),O=M?._strictParams??x;let k;if(!M)try{UU(g,O)}catch(z){if(hr(z)||zr(z)?k=z:k=new wge(z.message,{cause:z}),e?.throwOnError)throw k}Object.assign(s,O);const F=N?"stay":"enter";let H;if(M)H={...M,cause:F,params:N?.params??s,_strictParams:O,search:El(N?N.search:M.search,y),_strictSearch:S};else{const z=g.options.loader||g.options.beforeLoad||g.lazyFn||ez(g)?"pending":"success";H={id:R,ssr:g.options.ssr,index:h,routeId:g.id,params:N?.params??s,_strictParams:O,pathname:T,updatedAt:Date.now(),search:N?El(N.search,y):y,_strictSearch:S,searchError:void 0,status:z,isFetching:!1,error:void 0,paramsError:k,__routeContext:void 0,_nonReactive:{loadPromise:Vc()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:N?Il(N.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:g.options.staticData||{},fullPath:g.fullPath}}e?.preload||(H.globalNotFound=u===g.id),H.searchError=E;const D=this.getParentContext(m);H.context={...D,...H.__routeContext,...H.__beforeLoadContext},c[h]=H}for(let h=0;h<c.length;h++){const g=c[h],m=this.looseRoutesById[g.routeId],y=this.getMatch(g.id),S=f.get(g.routeId);if(g.params=S?El(S.params,s):s,!y){const E=c[h-1],C=this.getParentContext(E);if(m.options.context){const w={deps:g.loaderDeps,params:g.params,context:C??{},location:t,navigate:T=>this.navigate({...T,_fromLocation:t}),buildLocation:this.buildLocation,cause:g.cause,abortController:g.abortController,preload:!!g.preload,matches:c,routeId:m.id};g.__routeContext=m.options.context(w)??void 0}g.context={...C,...g.__routeContext,...g.__beforeLoadContext}}}return c}matchRoutesLightweight(t){const e=kh(this.stores.matchesId.get()),n=this.lightweightCache.get(t);if(n&&n[0]===e)return n[1];const{matchedRoutes:r,routeParams:s}=this.getMatchedRoutes(t.pathname),o=kh(r),a={...t.search};for(const g of r)try{Object.assign(a,dv(g.options.validateSearch,a))}catch{}const u=e&&this.stores.matchStores.get(e)?.get(),c=u&&u.routeId===o.id&&u.pathname===t.pathname;let f;if(c)f=u.params;else{const g=Object.assign(Object.create(null),s);for(const m of r)try{UU(m,g)}catch{}f=g}const h={matchedRoutes:r,fullPath:o.fullPath,search:a,params:f};return this.lightweightCache.set(t,[e,h]),h}},Hv=class extends Error{},wge=class extends Error{};function xge(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],statusCode:200}}function dv(t,e){if(t==null)return{};if("~standard"in t){const n=t["~standard"].validate(e);if(n instanceof Promise)throw new Hv("Async validation not supported");if(n.issues)throw new Hv(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}function _ge({pathname:t,routesById:e,processedTree:n}){const r=Object.create(null),s=pi(t);let o;const a=$pe(s,n,!0);return a&&(o=a.route,Object.assign(r,a.rawParams)),{matchedRoutes:a?.branch||[e.__root__],routeParams:r,foundRoute:o}}function Age({search:t,dest:e,destRoutes:n,_includeValidateSearch:r}){return Tge(n)(t,e,r??!1)}function Tge(t){let e,n;const r=[];for(const o of t){const a=o.options;if("search"in a)a.search?.middlewares&&r.push(...a.search.middlewares);else if(a.preSearchFilters||a.postSearchFilters){const c=({search:f,next:h})=>{const g=h(a.preSearchFilters?a.preSearchFilters.reduce((m,y)=>y(m),f):f);return a.postSearchFilters?a.postSearchFilters.reduce((m,y)=>y(m),g):g};r.push(c)}const u=a.validateSearch;if(u){const c=({search:f,next:h,meta:g})=>{const m=h(f);if(n)try{const y=dv(u,m);if(g&&y)for(const S in y)S in m||(g.defaulted||=new Map).set(S,y[S]);return{...m,...y}}catch{}return m};r.push(c)}}const s=(o,a,u)=>{if(o>=r.length){if(!e.search)return{};if(e.search===!0)return a;const f=Rl(e.search,a);return u&&(u.explicit=f),f}const c=(f,h)=>{if(h){const g=u||{};return{search:s(o+1,f,g),meta:g}}return s(o+1,f,u)};return r[o]({search:a,next:c,meta:u})};return function(a,u,c){return e=u,n=c,s(0,a)}}function Rge(t,e){if(t!=="root")for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.children)return r.id}return Ul}function UU(t,e){const n=t.options.params?.parse??t.options.parseParams;if(n){const r=n(e);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(e,r)}}const Ige="Error preloading route! ☝️";var tz=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=e=>{this.originalIndex=e.originalIndex;const n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=Ul:this.parentRoute||mi();let s=r?Ul:n?.path;s&&s!=="/"&&(s=V7(s));const o=n?.id||s;let a=r?Ul:lv([this.parentRoute.id==="__root__"?"":this.parentRoute.id,o]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=lv(["/",a]));const u=a==="__root__"?"/":lv([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=u,this._to=pi(u)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Y7({from:this.fullPath,...e}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},Oge=class extends tz{constructor(t){super(t)}};function bR(t){const e=t.errorComponent??SR;return I.jsx(Nge,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:n,reset:r})=>n?_.createElement(e,{error:n,reset:r}):t.children})}var Nge=class extends _.Component{constructor(...t){super(...t),this.state={error:null}}static getDerivedStateFromProps(t,e){const n=t.getResetKey();return e.error&&e.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidCatch(t,e){this.props.onCatch&&this.props.onCatch(t,e)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function SR({error:t}){const[e,n]=_.useState(!1);return I.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[I.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[I.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),I.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:e?"Hide Error":"Show Error"})]}),I.jsx("div",{style:{height:".25rem"}}),e?I.jsx("div",{children:I.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?I.jsx("code",{children:t.message}):null})}):null]})}function Mge({children:t,fallback:e=null}){return nz()?I.jsx(j.Fragment,{children:t}):I.jsx(j.Fragment,{children:e})}function nz(){return j.useSyncExternalStore(Pge,()=>!0,()=>!1)}function Pge(){return()=>{}}var rz=_.createContext(null);function hs(t){return _.useContext(rz)}var Sb=_.createContext(void 0),kge=_.createContext(void 0),sn=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(sn||{});function Dge({update:t,notify:e,unwatched:n}){return{link:r,unlink:s,propagate:o,checkDirty:a,shallowPropagate:u};function r(f,h,g){const m=h.depsTail;if(m!==void 0&&m.dep===f)return;const y=m!==void 0?m.nextDep:h.deps;if(y!==void 0&&y.dep===f){y.version=g,h.depsTail=y;return}const S=f.subsTail;if(S!==void 0&&S.version===g&&S.sub===h)return;const E=h.depsTail=f.subsTail={version:g,dep:f,sub:h,prevDep:m,nextDep:y,prevSub:S,nextSub:void 0};y!==void 0&&(y.prevDep=E),m!==void 0?m.nextDep=E:h.deps=E,S!==void 0?S.nextSub=E:f.subs=E}function s(f,h=f.sub){const g=f.dep,m=f.prevDep,y=f.nextDep,S=f.nextSub,E=f.prevSub;return y!==void 0?y.prevDep=m:h.depsTail=m,m!==void 0?m.nextDep=y:h.deps=y,S!==void 0?S.prevSub=E:g.subsTail=E,E!==void 0?E.nextSub=S:(g.subs=S)===void 0&&n(g),y}function o(f){let h=f.nextSub,g;e:do{const m=f.sub;let y=m.flags;if(y&60?y&12?y&4?!(y&48)&&c(f,m)?(m.flags=y|40,y&=1):y=0:m.flags=y&-9|32:y=0:m.flags=y|32,y&2&&e(m),y&1){const S=m.subs;if(S!==void 0){const E=(f=S).nextSub;E!==void 0&&(g={value:h,prev:g},h=E);continue}}if((f=h)!==void 0){h=f.nextSub;continue}for(;g!==void 0;)if(f=g.value,g=g.prev,f!==void 0){h=f.nextSub;continue e}break}while(!0)}function a(f,h){let g,m=0,y=!1;e:do{const S=f.dep,E=S.flags;if(h.flags&16)y=!0;else if((E&17)===17){if(t(S)){const C=S.subs;C.nextSub!==void 0&&u(C),y=!0}}else if((E&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(g={value:f,prev:g}),f=S.deps,h=S,++m;continue}if(!y){const C=f.nextDep;if(C!==void 0){f=C;continue}}for(;m--;){const C=h.subs,w=C.nextSub!==void 0;if(w?(f=g.value,g=g.prev):f=C,y){if(t(h)){w&&u(C),h=f.sub;continue}y=!1}else h.flags&=-33;h=f.sub;const T=f.nextDep;if(T!==void 0){f=T;continue e}}return y}while(!0)}function u(f){do{const h=f.sub,g=h.flags;(g&48)===32&&(h.flags=g|16,(g&6)===2&&e(h))}while((f=f.nextSub)!==void 0)}function c(f,h){let g=h.depsTail;for(;g!==void 0;){if(g===f)return!0;g=g.prevDep}return!1}}function Lge(t,e,n){const r=typeof t=="object",s=r?t:void 0;return{next:(r?t.next:t)?.bind(s),error:(r?t.error:e)?.bind(s),complete:(r?t.complete:n)?.bind(s)}}const P_=[];let fv=0;const{link:FU,unlink:Uge,propagate:Fge,checkDirty:sz,shallowPropagate:zU}=Dge({update(t){return t._update()},notify(t){P_[k_++]=t,t.flags&=~sn.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=sn.Mutable|sn.Dirty,qv(t))}});let fm=0,k_=0,Eo,D_=0;function oz(t){try{++D_,t()}finally{--D_||iz()}}function qv(t){const e=t.depsTail;let n=e!==void 0?e.nextDep:t.deps;for(;n!==void 0;)n=Uge(n,t)}function iz(){if(!(D_>0)){for(;fm<k_;){const t=P_[fm];P_[fm++]=void 0,t.notify()}fm=0,k_=0}}function jU(t,e){const n=typeof t=="function",r=t,s={_snapshot:n?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?sn.None:sn.Mutable,get(){return Eo!==void 0&&FU(s,Eo,fv),s._snapshot},subscribe(o){const a=Lge(o),u={current:!1},c=zge(()=>{s.get(),u.current?a.next?.(s._snapshot):u.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(o){const a=Eo,u=e?.compare??Object.is;if(n)Eo=s,++fv,s.depsTail=void 0;else if(o===void 0)return!1;n&&(s.flags=sn.Mutable|sn.RecursedCheck);try{const c=s._snapshot,f=typeof o=="function"?o(c):o===void 0&&n?r(c):o;return c===void 0||!u(c,f)?(s._snapshot=f,!0):!1}finally{Eo=a,n&&(s.flags&=~sn.RecursedCheck),qv(s)}}};return n?(s.flags=sn.Mutable|sn.Dirty,s.get=function(){const o=s.flags;if(o&sn.Dirty||o&sn.Pending&&sz(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&zU(a)}}else o&sn.Pending&&(s.flags=o&~sn.Pending);return Eo!==void 0&&FU(s,Eo,fv),s._snapshot}):s.set=function(o){if(s._update(o)){const a=s.subs;a!==void 0&&(Fge(a),zU(a),iz())}},s}function zge(t){const e=()=>{const r=Eo;Eo=n,++fv,n.depsTail=void 0,n.flags=sn.Watching|sn.RecursedCheck;try{return t()}finally{Eo=r,n.flags&=~sn.RecursedCheck,qv(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:sn.Watching|sn.RecursedCheck,notify(){const r=this.flags;r&sn.Dirty||r&sn.Pending&&sz(this.deps,this)?e():this.flags=sn.Watching},stop(){this.flags=sn.None,this.depsTail=void 0,qv(this)}};return e(),n}function jge(t,e){return t===e}function Wr(t,e,n=jge){const r=_.useCallback(a=>{if(!t)return()=>{};const{unsubscribe:u}=t.subscribe(a);return u},[t]),s=_.useCallback(()=>t?.get(),[t]);return AT.useSyncExternalStoreWithSelector(r,s,s,e,n)}var Jw={get(){},subscribe(){return{unsubscribe(){}}}};function Bge(t,e){const n=_.useRef();return r=>{const s=t?.select?t.select(r):r;return t?.structuralSharing??e.options.defaultStructuralSharing?n.current=Il(n.current,s):s}}function fu(t){const e=hs(),n=_.useContext(t.from?kge:Sb),r=t.from?e.stores.getRouteMatchStore(t.from):e.stores.matchStores.get(n),s=Bge(t,e),o=Wr(r??Jw,a=>a?s(a):Jw);if(o!==Jw)return o;(t.shouldThrow??!0)&&mi()}function az(t){return fu({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}function lz(t){const{select:e,...n}=t;return fu({...n,select:r=>e?e(r.loaderDeps):r.loaderDeps})}function uz(t){return fu({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:e=>{const n=t.strict===!1?e.params:e._strictParams;return t.select?t.select(n):n}})}function cz(t){return fu({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}function ER(t){const e=hs();return _.useCallback(n=>e.navigate({...n,from:n.from??t?.from}),[t?.from,e])}function zRe(t){const e=hs(),n=ER(),r=_.useRef(null);return Rc(()=>{r.current!==t&&(n(t),r.current=t)},[e,t,n]),null}function dz(t){return fu({...t,select:e=>t.select?t.select(e.context):e.context})}function $ge(t,e){const n=hs(),r=Ipe(e),{activeProps:s,inactiveProps:o,activeOptions:a,to:u,preload:c,preloadDelay:f,preloadIntentProximity:h,hashScrollIntoView:g,replace:m,startTransition:y,resetScroll:S,viewTransition:E,children:C,target:w,disabled:T,style:x,className:R,onClick:M,onBlur:N,onFocus:O,onMouseEnter:k,onMouseLeave:F,onTouchStart:H,ignoreBlocker:D,params:z,search:q,hash:K,state:ee,mask:$,reloadDocument:te,unsafeRelative:fe,from:ae,_fromLocation:xe,...L}=t,G=nz(),Y=_.useMemo(()=>t,[n,t.from,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),J=Wr(n.stores.location,gt=>gt,(gt,yn)=>gt.href===yn.href),oe=_.useMemo(()=>{const gt={_fromLocation:J,...Y};return n.buildLocation(gt)},[n,J,Y]),he=oe.maskedLocation?oe.maskedLocation.publicHref:oe.publicHref,ce=oe.maskedLocation?oe.maskedLocation.external:oe.external,ve=_.useMemo(()=>Kge(he,ce,n.history,T),[T,ce,he,n.history]),_e=_.useMemo(()=>{if(ve?.external)return jv(ve.href,n.protocolAllowlist)?void 0:ve.href;if(!Yge(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),jv(u,n.protocolAllowlist)?void 0:u}catch{}},[u,ve,n.protocolAllowlist]),Xe=_.useMemo(()=>{if(_e)return!1;if(a?.exact){if(!Kpe(J.pathname,oe.pathname,n.basepath))return!1}else{const gt=Bv(J.pathname,n.basepath),yn=Bv(oe.pathname,n.basepath);if(!(gt.startsWith(yn)&&(gt.length===yn.length||gt[yn.length]==="/")))return!1}return(a?.includeSearch??!0)&&!Ll(J.search,oe.search,{partial:!a?.exact,ignoreUndefined:!a?.explicitUndefined})?!1:a?.includeHash?G&&J.hash===oe.hash:!0},[a?.exact,a?.explicitUndefined,a?.includeHash,a?.includeSearch,J,_e,G,oe.hash,oe.pathname,oe.search,n.basepath]),Ee=Xe?Rl(s,{})??Hge:ex,pt=Xe?ex:Rl(o,{})??ex,Ce=[R,Ee.className,pt.className].filter(Boolean).join(" "),je=(x||Ee.style||pt.style)&&{...x,...Ee.style,...pt.style},[Be,He]=_.useState(!1),gr=_.useRef(!1),Ct=t.reloadDocument||_e?!1:c??n.options.defaultPreload,Gr=f??n.options.defaultPreloadDelay??0,Yn=_.useCallback(()=>{n.preloadRoute({...Y,_builtLocation:oe}).catch(gt=>{console.warn(gt),console.warn(Ige)})},[n,Y,oe]);Rpe(r,_.useCallback(gt=>{gt?.isIntersecting&&Yn()},[Yn]),Gge,{disabled:!!T||Ct!=="viewport"}),_.useEffect(()=>{gr.current||!T&&Ct==="render"&&(Yn(),gr.current=!0)},[T,Yn,Ct]);const Tr=gt=>{const yn=gt.currentTarget.getAttribute("target"),Ir=w!==void 0?w:yn;if(!T&&!Zge(gt)&&!gt.defaultPrevented&&(!Ir||Ir==="_self")&>.button===0){gt.preventDefault(),j8.flushSync(()=>{He(!0)});const ro=n.subscribe("onResolved",()=>{ro(),He(!1)});n.navigate({...Y,replace:m,resetScroll:S,hashScrollIntoView:g,startTransition:y,viewTransition:E,ignoreBlocker:D})}};if(_e)return{...L,ref:r,href:_e,...C&&{children:C},...w&&{target:w},...T&&{disabled:T},...x&&{style:x},...R&&{className:R},...M&&{onClick:M},...N&&{onBlur:N},...O&&{onFocus:O},...k&&{onMouseEnter:k},...F&&{onMouseLeave:F},...H&&{onTouchStart:H}};const no=gt=>{if(T||Ct!=="intent")return;if(!Gr){Yn();return}const yn=gt.currentTarget;if(Bf.has(yn))return;const Ir=setTimeout(()=>{Bf.delete(yn),Yn()},Gr);Bf.set(yn,Ir)},Rr=gt=>{T||Ct!=="intent"||Yn()},Gt=gt=>{if(T||!Ct||!Gr)return;const yn=gt.currentTarget,Ir=Bf.get(yn);Ir&&(clearTimeout(Ir),Bf.delete(yn))};return{...L,...Ee,...pt,href:ve?.href,ref:r,onClick:uc([M,Tr]),onBlur:uc([N,Gt]),onFocus:uc([O,no]),onMouseEnter:uc([k,no]),onMouseLeave:uc([F,Gt]),onTouchStart:uc([H,Rr]),disabled:!!T,target:w,...je&&{style:je},...Ce&&{className:Ce},...T&&qge,...Xe&&Wge,...G&&Be&&Vge}}var ex={},Hge={className:"active"},qge={role:"link","aria-disabled":!0},Wge={"data-status":"active","aria-current":"page"},Vge={"data-transitioning":"transitioning"},Bf=new WeakMap,Gge={rootMargin:"100px"},uc=t=>e=>{for(const n of t)if(n){if(e.defaultPrevented)return;n(e)}};function Kge(t,e,n,r){if(!r)return e?{href:t,external:!0}:{href:n.createHref(t)||"/",external:!1}}function Yge(t){if(typeof t!="string")return!1;const e=t.charCodeAt(0);return e===47?t.charCodeAt(1)!==47:e===46}var fz=_.forwardRef((t,e)=>{const{_asChild:n,...r}=t,{type:s,...o}=$ge(r,e),a=typeof r.children=="function"?r.children({isActive:o["data-status"]==="active"}):r.children;if(!n){const{disabled:u,...c}=o;return _.createElement("a",c,a)}return _.createElement(n,o,a)});function Zge(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}var Xge=class extends tz{constructor(e){super(e),this.useMatch=n=>fu({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>dz({...n,from:this.id}),this.useSearch=n=>cz({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>uz({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>lz({...n,from:this.id}),this.useLoaderData=n=>az({...n,from:this.id}),this.useNavigate=()=>ER({from:this.fullPath}),this.Link=j.forwardRef((n,r)=>I.jsx(fz,{ref:r,from:this.fullPath,...n}))}};function Qge(t){return new Xge(t)}function Jge(){return t=>tme(t)}var eme=class extends Oge{constructor(t){super(t),this.useMatch=e=>fu({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>dz({...e,from:this.id}),this.useSearch=e=>cz({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>uz({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>lz({...e,from:this.id}),this.useLoaderData=e=>az({...e,from:this.id}),this.useNavigate=()=>ER({from:this.fullPath}),this.Link=j.forwardRef((e,n)=>I.jsx(fz,{ref:n,from:this.fullPath,...e}))}};function tme(t){return new eme(t)}function lr(t){return new nme(t,{silent:!0}).createRoute}var nme=class{constructor(t,e){this.path=t,this.createRoute=n=>{const r=Qge(n);return r.isRoot=!1,r},this.silent=e?.silent}};function qn(t,e){let n,r,s,o;const a=()=>(n||(n=t().then(c=>{n=void 0,r=c[e??"default"]}).catch(c=>{if(s=c,Mpe(s)&&s instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const f=`tanstack_router_reload:${s.message}`;sessionStorage.getItem(f)||(sessionStorage.setItem(f,"1"),o=!0)}})),n),u=function(f){if(o)throw window.location.reload(),new Promise(()=>{});if(s)throw s;if(!r)if(yU)yU(a());else throw a();return _.createElement(r,f)};return u.preload=a,u}function rme(t){const e=hs(),n=`not-found-${Wr(e.stores.location,r=>r.pathname)}-${Wr(e.stores.status,r=>r)}`;return I.jsx(bR,{getResetKey:()=>n,onCatch:(r,s)=>{if(hr(r))t.onCatch?.(r,s);else throw r},errorComponent:({error:r})=>{if(hr(r))return t.fallback?.(r);throw r},children:t.children})}function sme(){return I.jsx("p",{children:"Not Found"})}function Ec(t){return I.jsx(I.Fragment,{children:t.children})}function hz(t,e,n){return e.options.notFoundComponent?I.jsx(e.options.notFoundComponent,{...n}):t.options.defaultNotFoundComponent?I.jsx(t.options.defaultNotFoundComponent,{...n}):I.jsx(sme,{})}function ome(t){return null}function ime(){return ome(hs()),null}var ame=(t,e)=>t.routeId===e.routeId&&t._displayPending===e._displayPending,lme=(t,e)=>t[0]===e[0]&&t[1]===e[1],pz=_.memo(function({matchId:e}){const n=hs(),r=n.stores.matchStores.get(e);r||mi();const s=Wr(n.stores.loadedAt,a=>a),o=Wr(r,a=>a,ame);return I.jsx(ume,{router:n,matchId:e,resetKey:s,matchState:_.useMemo(()=>{const a=o.routeId,u=n.routesById[a].parentRoute?.id;return{routeId:a,ssr:o.ssr,_displayPending:o._displayPending,parentRouteId:u}},[o._displayPending,o.routeId,o.ssr,n.routesById])})});function ume({router:t,matchId:e,resetKey:n,matchState:r}){const s=t.routesById[r.routeId],o=s.options.pendingComponent??t.options.defaultPendingComponent,a=o?I.jsx(o,{}):null,u=s.options.errorComponent??t.options.defaultErrorComponent,c=s.options.onCatch??t.options.defaultOnCatch,f=s.isRoot?s.options.notFoundComponent??t.options.notFoundRoute?.options.component:s.options.notFoundComponent,h=r.ssr===!1||r.ssr==="data-only",g=(!s.isRoot||s.options.wrapInSuspense||h)&&(s.options.wrapInSuspense??o??(s.options.errorComponent?.preload||h))?_.Suspense:Ec,m=u?bR:Ec,y=f?rme:Ec;return I.jsxs(s.isRoot?s.options.shellComponent??Ec:Ec,{children:[I.jsx(Sb.Provider,{value:e,children:I.jsx(g,{fallback:a,children:I.jsx(m,{getResetKey:()=>n,errorComponent:u||SR,onCatch:(S,E)=>{if(hr(S))throw S.routeId??=r.routeId,S;c?.(S,E)},children:I.jsx(y,{fallback:S=>{if(S.routeId??=r.routeId,!f||S.routeId&&S.routeId!==r.routeId||!S.routeId&&!s.isRoot)throw S;return _.createElement(f,S)},children:h||r._displayPending?I.jsx(Mge,{fallback:a,children:I.jsx(BU,{matchId:e})}):I.jsx(BU,{matchId:e})})})})}),r.parentRouteId===Ul?I.jsxs(I.Fragment,{children:[I.jsx(cme,{}),t.options.scrollRestoration&&z7?I.jsx(ime,{}):null]}):null]})}function cme(){const t=hs(),e=_.useRef();return Rc(()=>{const n=t.stores.resolvedLocation.get(),r=e.current;n&&(!r||r.href!==n.href)&&t.emit({type:"onRendered",...Fc(t.stores.location.get(),r??n)}),e.current=n},[Wr(t.stores.resolvedLocation,n=>n?.state.__TSR_key),t]),null}var BU=_.memo(function({matchId:e}){const n=hs(),r=(h,g)=>n.getMatch(h.id)?._nonReactive[g]??h._nonReactive[g],s=n.stores.matchStores.get(e);s||mi();const o=Wr(s,h=>h),a=o.routeId,u=n.routesById[a],c=_.useMemo(()=>{const h=(n.routesById[a].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:a,loaderDeps:o.loaderDeps,params:o._strictParams,search:o._strictSearch});return h?JSON.stringify(h):void 0},[a,o.loaderDeps,o._strictParams,o._strictSearch,n.options.defaultRemountDeps,n.routesById]),f=_.useMemo(()=>{const h=u.options.component??n.options.defaultComponent;return h?I.jsx(h,{},c):I.jsx(gz,{})},[c,u.options.component,n.options.defaultComponent]);if(o._displayPending)throw r(o,"displayPendingPromise");if(o._forcePending)throw r(o,"minPendingPromise");if(o.status==="pending"){const h=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(h){const g=n.getMatch(o.id);if(g&&!g._nonReactive.minPendingPromise){const m=Vc();g._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),g._nonReactive.minPendingPromise=void 0},h)}}throw r(o,"loadPromise")}if(o.status==="notFound")return hr(o.error)||mi(),hz(n,u,o.error);if(o.status==="redirected")throw zr(o.error)||mi(),r(o,"loadPromise");if(o.status==="error")throw o.error;return f}),gz=_.memo(function(){const e=hs(),n=_.useContext(Sb);let r,s=!1,o;{const f=n?e.stores.matchStores.get(n):void 0;[r,s]=Wr(f,h=>[h?.routeId,h?.globalNotFound??!1],lme),o=Wr(e.stores.matchesId,h=>h[h.findIndex(g=>g===n)+1])}const a=r?e.routesById[r]:void 0,u=e.options.defaultPendingComponent?I.jsx(e.options.defaultPendingComponent,{}):null;if(s)return a||mi(),hz(e,a,void 0);if(!o)return null;const c=I.jsx(pz,{matchId:o});return r===Ul?I.jsx(_.Suspense,{fallback:u,children:c}):c});function dme(){const t=hs(),e=_.useRef({router:t,mounted:!1}),[n,r]=_.useState(!1),s=Wr(t.stores.isLoading,g=>g),o=Wr(t.stores.hasPending,g=>g),a=Vw(s),u=s||n||o,c=Vw(u),f=s||o,h=Vw(f);return t.startTransition=g=>{r(!0),_.startTransition(()=>{g(),r(!1)})},_.useEffect(()=>{const g=t.history.subscribe(t.load),m=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return pi(t.latestLocation.publicHref)!==pi(m.publicHref)&&t.commitLocation({...m,replace:!0}),()=>{g()}},[t,t.history]),Rc(()=>{if(typeof window<"u"&&t.ssr||e.current.router===t&&e.current.mounted)return;e.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(m){console.error(m)}})()},[t]),Rc(()=>{a&&!s&&t.emit({type:"onLoad",...Fc(t.stores.location.get(),t.stores.resolvedLocation.get())})},[a,t,s]),Rc(()=>{h&&!f&&t.emit({type:"onBeforeRouteMount",...Fc(t.stores.location.get(),t.stores.resolvedLocation.get())})},[f,h,t]),Rc(()=>{if(c&&!u){const g=Fc(t.stores.location.get(),t.stores.resolvedLocation.get());t.emit({type:"onResolved",...g}),oz(()=>{t.stores.status.set("idle"),t.stores.resolvedLocation.set(t.stores.location.get())})}},[u,c,t]),null}function fme(){const t=hs(),e=t.routesById[Ul].options.pendingComponent??t.options.defaultPendingComponent,n=e?I.jsx(e,{}):null,r=I.jsxs(typeof document<"u"&&t.ssr?Ec:_.Suspense,{fallback:n,children:[I.jsx(dme,{}),I.jsx(hme,{})]});return t.options.InnerWrap?I.jsx(t.options.InnerWrap,{children:r}):r}function hme(){const t=hs(),e=Wr(t.stores.firstId,s=>s),n=Wr(t.stores.loadedAt,s=>s),r=e?I.jsx(pz,{matchId:e}):null;return I.jsx(Sb.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?r:I.jsx(bR,{getResetKey:()=>n,errorComponent:SR,onCatch:void 0,children:r})})}var pme=t=>({createMutableStore:jU,createReadonlyStore:jU,batch:oz}),gme=t=>new mme(t),mme=class extends Cge{constructor(t){super(t,pme)}};function vme({router:t,children:e,...n}){B7(n)&&t.update({...t.options,...n,context:{...t.options.context,...n.context}});const r=I.jsx(rz.Provider,{value:t,children:e});return t.options.Wrap?I.jsx(t.options.Wrap,{children:r}):r}function yme({router:t,...e}){return I.jsx(vme,{router:t,...e,children:I.jsx(fme,{})})}var tx={exports:{}},$f={},nx={exports:{}},rx={};var $U;function bme(){return $U||($U=1,(function(t){function e($,te){var fe=$.length;$.push(te);e:for(;0<fe;){var ae=fe-1>>>1,xe=$[ae];if(0<s(xe,te))$[ae]=te,$[fe]=xe,fe=ae;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var te=$[0],fe=$.pop();if(fe!==te){$[0]=fe;e:for(var ae=0,xe=$.length,L=xe>>>1;ae<L;){var G=2*(ae+1)-1,Y=$[G],J=G+1,oe=$[J];if(0>s(Y,fe))J<xe&&0>s(oe,Y)?($[ae]=oe,$[J]=fe,ae=J):($[ae]=Y,$[G]=fe,ae=G);else if(J<xe&&0>s(oe,fe))$[ae]=oe,$[J]=fe,ae=J;else break e}}return te}function s($,te){var fe=$.sortIndex-te.sortIndex;return fe!==0?fe:$.id-te.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var c=[],f=[],h=1,g=null,m=3,y=!1,S=!1,E=!1,C=!1,w=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function R($){for(var te=n(f);te!==null;){if(te.callback===null)r(f);else if(te.startTime<=$)r(f),te.sortIndex=te.expirationTime,e(c,te);else break;te=n(f)}}function M($){if(E=!1,R($),!S)if(n(c)!==null)S=!0,N||(N=!0,z());else{var te=n(f);te!==null&&ee(M,te.startTime-$)}}var N=!1,O=-1,k=5,F=-1;function H(){return C?!0:!(t.unstable_now()-F<k)}function D(){if(C=!1,N){var $=t.unstable_now();F=$;var te=!0;try{e:{S=!1,E&&(E=!1,T(O),O=-1),y=!0;var fe=m;try{t:{for(R($),g=n(c);g!==null&&!(g.expirationTime>$&&H());){var ae=g.callback;if(typeof ae=="function"){g.callback=null,m=g.priorityLevel;var xe=ae(g.expirationTime<=$);if($=t.unstable_now(),typeof xe=="function"){g.callback=xe,R($),te=!0;break t}g===n(c)&&r(c),R($)}else r(c);g=n(c)}if(g!==null)te=!0;else{var L=n(f);L!==null&&ee(M,L.startTime-$),te=!1}}break e}finally{g=null,m=fe,y=!1}te=void 0}}finally{te?z():N=!1}}}var z;if(typeof x=="function")z=function(){x(D)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,K=q.port2;q.port1.onmessage=D,z=function(){K.postMessage(null)}}else z=function(){w(D,0)};function ee($,te){O=w(function(){$(t.unstable_now())},te)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_next=function($){switch(m){case 1:case 2:case 3:var te=3;break;default:te=m}var fe=m;m=te;try{return $()}finally{m=fe}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function($,te){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var fe=m;m=$;try{return te()}finally{m=fe}},t.unstable_scheduleCallback=function($,te,fe){var ae=t.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?ae+fe:ae):fe=ae,$){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=fe+xe,$={id:h++,callback:te,priorityLevel:$,startTime:fe,expirationTime:xe,sortIndex:-1},fe>ae?($.sortIndex=fe,e(f,$),n(c)===null&&$===n(f)&&(E?(T(O),O=-1):E=!0,ee(M,fe-ae))):($.sortIndex=xe,e(c,$),S||y||(S=!0,N||(N=!0,z()))),$},t.unstable_shouldYield=H,t.unstable_wrapCallback=function($){var te=m;return function(){var fe=m;m=te;try{return $.apply(this,arguments)}finally{m=fe}}}})(rx)),rx}var HU;function Sme(){return HU||(HU=1,nx.exports=bme()),nx.exports}var qU;function Eme(){if(qU)return $f;qU=1;var t=Sme(),e=ip(),n=z8();function r(i){var l="https://react.dev/errors/"+i;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){var l=i,d=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(d=l.return),i=l.return;while(i)}return l.tag===3?d:null}function a(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function u(i){if(i.tag===31){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function c(i){if(o(i)!==i)throw Error(r(188))}function f(i){var l=i.alternate;if(!l){if(l=o(i),l===null)throw Error(r(188));return l!==i?null:i}for(var d=i,p=l;;){var v=d.return;if(v===null)break;var b=v.alternate;if(b===null){if(p=v.return,p!==null){d=p;continue}break}if(v.child===b.child){for(b=v.child;b;){if(b===d)return c(v),i;if(b===p)return c(v),l;b=b.sibling}throw Error(r(188))}if(d.return!==p.return)d=v,p=b;else{for(var A=!1,P=v.child;P;){if(P===d){A=!0,d=v,p=b;break}if(P===p){A=!0,p=v,d=b;break}P=P.sibling}if(!A){for(P=b.child;P;){if(P===d){A=!0,d=b,p=v;break}if(P===p){A=!0,p=b,d=v;break}P=P.sibling}if(!A)throw Error(r(189))}}if(d.alternate!==p)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?i:l}function h(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i;for(i=i.child;i!==null;){if(l=h(i),l!==null)return l;i=i.sibling}return null}var g=Object.assign,m=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),x=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),D=Symbol.iterator;function z(i){return i===null||typeof i!="object"?null:(i=D&&i[D]||i["@@iterator"],typeof i=="function"?i:null)}var q=Symbol.for("react.client.reference");function K(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===q?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case E:return"Fragment";case w:return"Profiler";case C:return"StrictMode";case M:return"Suspense";case N:return"SuspenseList";case F:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case x:return i.displayName||"Context";case T:return(i._context.displayName||"Context")+".Consumer";case R:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case O:return l=i.displayName||null,l!==null?l:K(i.type)||"Memo";case k:l=i._payload,i=i._init;try{return K(i(l))}catch{}}return null}var ee=Array.isArray,$=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},ae=[],xe=-1;function L(i){return{current:i}}function G(i){0>xe||(i.current=ae[xe],ae[xe]=null,xe--)}function Y(i,l){xe++,ae[xe]=i.current,i.current=l}var J=L(null),oe=L(null),he=L(null),ce=L(null);function ve(i,l){switch(Y(he,l),Y(oe,i),Y(J,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?pN(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=pN(l),i=gN(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}G(J),Y(J,i)}function _e(){G(J),G(oe),G(he)}function Xe(i){i.memoizedState!==null&&Y(ce,i);var l=J.current,d=gN(l,i.type);l!==d&&(Y(oe,i),Y(J,d))}function Ee(i){oe.current===i&&(G(J),G(oe)),ce.current===i&&(G(ce),bf._currentValue=fe)}var pt,Ce;function je(i){if(pt===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);pt=l&&l[1]||"",Ce=-1<d.stack.indexOf(`
|
|
217
217
|
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
218
218
|
`+pt+i+Ce}var Be=!1;function He(i,l){if(!i||Be)return"";Be=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(l){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(re){var ne=re}Reflect.construct(i,[],le)}else{try{le.call()}catch(re){ne=re}i.call(le.prototype)}}else{try{throw Error()}catch(re){ne=re}(le=i())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(re){if(re&&ne&&typeof re.stack=="string")return[re.stack,ne.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=p.DetermineComponentFrameRoot(),A=b[0],P=b[1];if(A&&P){var B=A.split(`
|
|
219
219
|
`),Q=P.split(`
|
|
@@ -227,7 +227,7 @@ Error generating stack: `+p.message+`
|
|
|
227
227
|
|
|
228
228
|
`);k=z.pop()??"";for(const q of z){const K=q.split(`
|
|
229
229
|
`),ee=[];let $;for(const ae of K)if(ae.startsWith("data:"))ee.push(ae.replace(/^data:\s*/,""));else if(ae.startsWith("event:"))$=ae.replace(/^event:\s*/,"");else if(ae.startsWith("id:"))g=ae.replace(/^id:\s*/,"");else if(ae.startsWith("retry:")){const xe=Number.parseInt(ae.replace(/^retry:\s*/,""),10);Number.isNaN(xe)||(E=xe)}let te,fe=!1;if(ee.length){const ae=ee.join(`
|
|
230
|
-
`);try{te=JSON.parse(ae),fe=!0}catch{te=ae}}fe&&(s&&await s(te),r&&(te=await r(te))),n?.({data:te,event:$,id:g,retry:E}),ee.length&&(yield te)}}}finally{w.removeEventListener("abort",F),O.releaseLock()}break}catch(x){if(e?.(x),a!==void 0&&C>=a)break;const R=Math.min(E*2**(C-1),u??3e4);await m(R)}}}()}},Ame=t=>{switch(t){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Tme=t=>{switch(t){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},Rme=t=>{switch(t){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},mz=({allowReserved:t,explode:e,name:n,style:r,value:s})=>{if(!e){const u=(t?s:s.map(c=>encodeURIComponent(c))).join(Tme(r));switch(r){case"label":return`.${u}`;case"matrix":return`;${n}=${u}`;case"simple":return u;default:return`${n}=${u}`}}const o=Ame(r),a=s.map(u=>r==="label"||r==="simple"?t?u:encodeURIComponent(u):Eb({allowReserved:t,name:n,value:u})).join(o);return r==="label"||r==="matrix"?o+a:a},Eb=({allowReserved:t,name:e,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${t?n:encodeURIComponent(n)}`},vz=({allowReserved:t,explode:e,name:n,style:r,value:s,valueOnly:o})=>{if(s instanceof Date)return o?s.toISOString():`${n}=${s.toISOString()}`;if(r!=="deepObject"&&!e){let c=[];Object.entries(s).forEach(([h,g])=>{c=[...c,h,t?g:encodeURIComponent(g)]});const f=c.join(",");switch(r){case"form":return`${n}=${f}`;case"label":return`.${f}`;case"matrix":return`;${n}=${f}`;default:return f}}const a=Rme(r),u=Object.entries(s).map(([c,f])=>Eb({allowReserved:t,name:r==="deepObject"?`${n}[${c}]`:c,value:f})).join(a);return r==="label"||r==="matrix"?a+u:u},Ime=/\{[^{}]+\}/g,Ome=({path:t,url:e})=>{let n=e;const r=e.match(Ime);if(r)for(const s of r){let o=!1,a=s.substring(1,s.length-1),u="simple";a.endsWith("*")&&(o=!0,a=a.substring(0,a.length-1)),a.startsWith(".")?(a=a.substring(1),u="label"):a.startsWith(";")&&(a=a.substring(1),u="matrix");const c=t[a];if(c==null)continue;if(Array.isArray(c)){n=n.replace(s,mz({explode:o,name:a,style:u,value:c}));continue}if(typeof c=="object"){n=n.replace(s,vz({explode:o,name:a,style:u,value:c,valueOnly:!0}));continue}if(u==="matrix"){n=n.replace(s,`;${Eb({name:a,value:c})}`);continue}const f=encodeURIComponent(u==="label"?`.${c}`:c);n=n.replace(s,f)}return n},Nme=({baseUrl:t,path:e,query:n,querySerializer:r,url:s})=>{const o=s.startsWith("/")?s:`/${s}`;let a=(t??"")+o;e&&(a=Ome({path:e,url:a}));let u=n?r(n):"";return u.startsWith("?")&&(u=u.substring(1)),u&&(a+=`?${u}`),a};function VU(t){const e=t.body!==void 0;if(e&&t.bodySerializer)return"serializedBody"in t?t.serializedBody!==void 0&&t.serializedBody!==""?t.serializedBody:null:t.body!==""?t.body:null;if(e)return t.body}const Mme=async(t,e)=>{const n=typeof e=="function"?await e(t):e;if(n)return t.scheme==="bearer"?`Bearer ${n}`:t.scheme==="basic"?`Basic ${btoa(n)}`:n},yz=({parameters:t={},...e}={})=>r=>{const s=[];if(r&&typeof r=="object")for(const o in r){const a=r[o];if(a==null)continue;const u=t[o]||e;if(Array.isArray(a)){const c=mz({allowReserved:u.allowReserved,explode:!0,name:o,style:"form",value:a,...u.array});c&&s.push(c)}else if(typeof a=="object"){const c=vz({allowReserved:u.allowReserved,explode:!0,name:o,style:"deepObject",value:a,...u.object});c&&s.push(c)}else{const c=Eb({allowReserved:u.allowReserved,name:o,value:a});c&&s.push(c)}}return s.join("&")},Pme=t=>{if(!t)return"stream";const e=t.split(";")[0]?.trim();if(e){if(e.startsWith("application/json")||e.endsWith("+json"))return"json";if(e==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(n=>e.startsWith(n)))return"blob";if(e.startsWith("text/"))return"text"}},kme=(t,e)=>e?!!(t.headers.has(e)||t.query?.[e]||t.headers.get("Cookie")?.includes(`${e}=`)):!1,Dme=async({security:t,...e})=>{for(const n of t){if(kme(e,n.name))continue;const r=await Mme(n,e.auth);if(!r)continue;const s=n.name??"Authorization";switch(n.in){case"query":e.query||(e.query={}),e.query[s]=r;break;case"cookie":e.headers.append("Cookie",`${s}=${r}`);break;default:e.headers.set(s,r);break}}},GU=t=>Nme({baseUrl:t.baseUrl,path:t.path,query:t.query,querySerializer:typeof t.querySerializer=="function"?t.querySerializer:yz(t.querySerializer),url:t.url}),KU=(t,e)=>{const n={...t,...e};return n.baseUrl?.endsWith("/")&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=bz(t.headers,e.headers),n},Lme=t=>{const e=[];return t.forEach((n,r)=>{e.push([r,n])}),e},bz=(...t)=>{const e=new Headers;for(const n of t){if(!n)continue;const r=n instanceof Headers?Lme(n):Object.entries(n);for(const[s,o]of r)if(o===null)e.delete(s);else if(Array.isArray(o))for(const a of o)e.append(s,a);else o!==void 0&&e.set(s,typeof o=="object"?JSON.stringify(o):o)}return e};class sx{fns=[];clear(){this.fns=[]}eject(e){const n=this.getInterceptorIndex(e);this.fns[n]&&(this.fns[n]=null)}exists(e){const n=this.getInterceptorIndex(e);return!!this.fns[n]}getInterceptorIndex(e){return typeof e=="number"?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,n){const r=this.getInterceptorIndex(e);return this.fns[r]?(this.fns[r]=n,e):!1}use(e){return this.fns.push(e),this.fns.length-1}}const Ume=()=>({error:new sx,request:new sx,response:new sx}),Fme=yz({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),zme={"Content-Type":"application/json"},Sz=(t={})=>({...xme,headers:zme,parseAs:"auto",querySerializer:Fme,...t}),jme=(t={})=>{let e=KU(Sz(),t);const n=()=>({...e}),r=f=>(e=KU(e,f),n()),s=Ume(),o=async f=>{const h={...e,...f,fetch:f.fetch??e.fetch??globalThis.fetch,headers:bz(e.headers,f.headers),serializedBody:void 0};h.security&&await Dme({...h,security:h.security}),h.requestValidator&&await h.requestValidator(h),h.body!==void 0&&h.bodySerializer&&(h.serializedBody=h.bodySerializer(h.body)),(h.body===void 0||h.serializedBody==="")&&h.headers.delete("Content-Type");const g=GU(h);return{opts:h,url:g}},a=async f=>{const{opts:h,url:g}=await o(f),m={redirect:"follow",...h,body:VU(h)};let y=new Request(g,m);for(const M of s.request.fns)M&&(y=await M(y,h));const S=h.fetch;let E;try{E=await S(y)}catch(M){let N=M;for(const O of s.error.fns)O&&(N=await O(M,void 0,y,h));if(N=N||{},h.throwOnError)throw N;return h.responseStyle==="data"?void 0:{error:N,request:y,response:void 0}}for(const M of s.response.fns)M&&(E=await M(E,y,h));const C={request:y,response:E};if(E.ok){const M=(h.parseAs==="auto"?Pme(E.headers.get("Content-Type")):h.parseAs)??"json";if(E.status===204||E.headers.get("Content-Length")==="0"){let O;switch(M){case"arrayBuffer":case"blob":case"text":O=await E[M]();break;case"formData":O=new FormData;break;case"stream":O=E.body;break;default:O={};break}return h.responseStyle==="data"?O:{data:O,...C}}let N;switch(M){case"arrayBuffer":case"blob":case"formData":case"text":N=await E[M]();break;case"json":{const O=await E.text();N=O?JSON.parse(O):{};break}case"stream":return h.responseStyle==="data"?E.body:{data:E.body,...C}}return M==="json"&&(h.responseValidator&&await h.responseValidator(N),h.responseTransformer&&(N=await h.responseTransformer(N))),h.responseStyle==="data"?N:{data:N,...C}}const w=await E.text();let T;try{T=JSON.parse(w)}catch{}const x=T??w;let R=x;for(const M of s.error.fns)M&&(R=await M(x,E,y,h));if(R=R||{},h.throwOnError)throw R;return h.responseStyle==="data"?void 0:{error:R,...C}},u=f=>h=>a({...h,method:f}),c=f=>async h=>{const{opts:g,url:m}=await o(h);return _me({...g,body:g.body,headers:g.headers,method:f,onRequest:async(y,S)=>{let E=new Request(y,S);for(const C of s.request.fns)C&&(E=await C(E,g));return E},serializedBody:VU(g),url:m})};return{buildUrl:GU,connect:u("CONNECT"),delete:u("DELETE"),get:u("GET"),getConfig:n,head:u("HEAD"),interceptors:s,options:u("OPTIONS"),patch:u("PATCH"),post:u("POST"),put:u("PUT"),request:a,setConfig:r,sse:{connect:c("CONNECT"),delete:c("DELETE"),get:c("GET"),head:c("HEAD"),options:c("OPTIONS"),patch:c("PATCH"),post:c("POST"),put:c("PUT"),trace:c("TRACE")},trace:u("TRACE")}},ke=jme(Sz({baseUrl:"https://api.remit.example.com"}));let YU=!1;const Bme=t=>{YU||(ke.interceptors.request.use(async e=>{const n=await t.getToken();return n&&e.headers.set("Authorization",`Bearer ${n}`),e}),YU=!0)},$me=({children:t})=>I.jsx(I.Fragment,{children:t}),Hme={configure:()=>{},getToken:async()=>null,resetToken:()=>{},Shell:$me,Account:({fallback:t=null})=>I.jsx(I.Fragment,{children:t})},Ez=_.createContext(Hme),qme=Ez.Provider,$Re=()=>_.useContext(Ez),Wme=(t,e)=>{L9(t,e.meta)&&ql(t)},Vme=(t,e,n,r)=>{L9(t,r.meta)&&ql(t)},L_=t=>new TextEncoder().encode(t),Cz={},U_={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),Cz[t]=e,U_[e]=t}function Gme(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2){const r=t.slice(n,n+2).toLowerCase();if(r in U_)e[n/2]=U_[r];else throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`)}return e}function zl(t){let e="";for(let n=0;n<t.byteLength;n++)e+=Cz[t[n]];return e}const Fh=t=>t instanceof Uint8Array?t:typeof t=="string"?L_(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t),Kme=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]";class wi{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const n=new wi({...e,headers:{...e.headers}});return n.query&&(n.query=Yme(n.query)),n}static isInstance(e){if(!e)return!1;const n=e;return"method"in n&&"protocol"in n&&"hostname"in n&&"path"in n&&typeof n.query=="object"&&typeof n.headers=="object"}clone(){return wi.clone(this)}}function Yme(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];return{...e,[n]:Array.isArray(r)?[...r]:r}},{})}class zh{statusCode;reason;headers;body;constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const n=e;return typeof n.statusCode=="number"&&typeof n.headers=="object"}}const ZU=t=>{if(typeof t=="function")return t;const e=Promise.resolve(t);return()=>e},jl=t=>encodeURIComponent(t).replace(/[!'()*]/g,Zme),Zme=t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`;function CR(t){const e=[];for(let n of Object.keys(t).sort()){const r=t[n];if(n=jl(n),Array.isArray(r))for(let s=0,o=r.length;s<o;s++)e.push(`${n}=${jl(r[s])}`);else{let s=n;(r||typeof r=="string")&&(s+=`=${jl(r)}`),e.push(s)}}return e.join("&")}const hm="[aws-rum-web:unknown.unknown]";class be{static configure(e){be.debugEnabled=e}static getCallerInfo(){var e,n;try{const r=new Error().stack;if(!r)return hm;const s=r.split(`
|
|
230
|
+
`);try{te=JSON.parse(ae),fe=!0}catch{te=ae}}fe&&(s&&await s(te),r&&(te=await r(te))),n?.({data:te,event:$,id:g,retry:E}),ee.length&&(yield te)}}}finally{w.removeEventListener("abort",F),O.releaseLock()}break}catch(x){if(e?.(x),a!==void 0&&C>=a)break;const R=Math.min(E*2**(C-1),u??3e4);await m(R)}}}()}},Ame=t=>{switch(t){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Tme=t=>{switch(t){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},Rme=t=>{switch(t){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},mz=({allowReserved:t,explode:e,name:n,style:r,value:s})=>{if(!e){const u=(t?s:s.map(c=>encodeURIComponent(c))).join(Tme(r));switch(r){case"label":return`.${u}`;case"matrix":return`;${n}=${u}`;case"simple":return u;default:return`${n}=${u}`}}const o=Ame(r),a=s.map(u=>r==="label"||r==="simple"?t?u:encodeURIComponent(u):Eb({allowReserved:t,name:n,value:u})).join(o);return r==="label"||r==="matrix"?o+a:a},Eb=({allowReserved:t,name:e,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${t?n:encodeURIComponent(n)}`},vz=({allowReserved:t,explode:e,name:n,style:r,value:s,valueOnly:o})=>{if(s instanceof Date)return o?s.toISOString():`${n}=${s.toISOString()}`;if(r!=="deepObject"&&!e){let c=[];Object.entries(s).forEach(([h,g])=>{c=[...c,h,t?g:encodeURIComponent(g)]});const f=c.join(",");switch(r){case"form":return`${n}=${f}`;case"label":return`.${f}`;case"matrix":return`;${n}=${f}`;default:return f}}const a=Rme(r),u=Object.entries(s).map(([c,f])=>Eb({allowReserved:t,name:r==="deepObject"?`${n}[${c}]`:c,value:f})).join(a);return r==="label"||r==="matrix"?a+u:u},Ime=/\{[^{}]+\}/g,Ome=({path:t,url:e})=>{let n=e;const r=e.match(Ime);if(r)for(const s of r){let o=!1,a=s.substring(1,s.length-1),u="simple";a.endsWith("*")&&(o=!0,a=a.substring(0,a.length-1)),a.startsWith(".")?(a=a.substring(1),u="label"):a.startsWith(";")&&(a=a.substring(1),u="matrix");const c=t[a];if(c==null)continue;if(Array.isArray(c)){n=n.replace(s,mz({explode:o,name:a,style:u,value:c}));continue}if(typeof c=="object"){n=n.replace(s,vz({explode:o,name:a,style:u,value:c,valueOnly:!0}));continue}if(u==="matrix"){n=n.replace(s,`;${Eb({name:a,value:c})}`);continue}const f=encodeURIComponent(u==="label"?`.${c}`:c);n=n.replace(s,f)}return n},Nme=({baseUrl:t,path:e,query:n,querySerializer:r,url:s})=>{const o=s.startsWith("/")?s:`/${s}`;let a=(t??"")+o;e&&(a=Ome({path:e,url:a}));let u=n?r(n):"";return u.startsWith("?")&&(u=u.substring(1)),u&&(a+=`?${u}`),a};function VU(t){const e=t.body!==void 0;if(e&&t.bodySerializer)return"serializedBody"in t?t.serializedBody!==void 0&&t.serializedBody!==""?t.serializedBody:null:t.body!==""?t.body:null;if(e)return t.body}const Mme=async(t,e)=>{const n=typeof e=="function"?await e(t):e;if(n)return t.scheme==="bearer"?`Bearer ${n}`:t.scheme==="basic"?`Basic ${btoa(n)}`:n},yz=({parameters:t={},...e}={})=>r=>{const s=[];if(r&&typeof r=="object")for(const o in r){const a=r[o];if(a==null)continue;const u=t[o]||e;if(Array.isArray(a)){const c=mz({allowReserved:u.allowReserved,explode:!0,name:o,style:"form",value:a,...u.array});c&&s.push(c)}else if(typeof a=="object"){const c=vz({allowReserved:u.allowReserved,explode:!0,name:o,style:"deepObject",value:a,...u.object});c&&s.push(c)}else{const c=Eb({allowReserved:u.allowReserved,name:o,value:a});c&&s.push(c)}}return s.join("&")},Pme=t=>{if(!t)return"stream";const e=t.split(";")[0]?.trim();if(e){if(e.startsWith("application/json")||e.endsWith("+json"))return"json";if(e==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(n=>e.startsWith(n)))return"blob";if(e.startsWith("text/"))return"text"}},kme=(t,e)=>e?!!(t.headers.has(e)||t.query?.[e]||t.headers.get("Cookie")?.includes(`${e}=`)):!1,Dme=async({security:t,...e})=>{for(const n of t){if(kme(e,n.name))continue;const r=await Mme(n,e.auth);if(!r)continue;const s=n.name??"Authorization";switch(n.in){case"query":e.query||(e.query={}),e.query[s]=r;break;case"cookie":e.headers.append("Cookie",`${s}=${r}`);break;default:e.headers.set(s,r);break}}},GU=t=>Nme({baseUrl:t.baseUrl,path:t.path,query:t.query,querySerializer:typeof t.querySerializer=="function"?t.querySerializer:yz(t.querySerializer),url:t.url}),KU=(t,e)=>{const n={...t,...e};return n.baseUrl?.endsWith("/")&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=bz(t.headers,e.headers),n},Lme=t=>{const e=[];return t.forEach((n,r)=>{e.push([r,n])}),e},bz=(...t)=>{const e=new Headers;for(const n of t){if(!n)continue;const r=n instanceof Headers?Lme(n):Object.entries(n);for(const[s,o]of r)if(o===null)e.delete(s);else if(Array.isArray(o))for(const a of o)e.append(s,a);else o!==void 0&&e.set(s,typeof o=="object"?JSON.stringify(o):o)}return e};class sx{fns=[];clear(){this.fns=[]}eject(e){const n=this.getInterceptorIndex(e);this.fns[n]&&(this.fns[n]=null)}exists(e){const n=this.getInterceptorIndex(e);return!!this.fns[n]}getInterceptorIndex(e){return typeof e=="number"?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,n){const r=this.getInterceptorIndex(e);return this.fns[r]?(this.fns[r]=n,e):!1}use(e){return this.fns.push(e),this.fns.length-1}}const Ume=()=>({error:new sx,request:new sx,response:new sx}),Fme=yz({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),zme={"Content-Type":"application/json"},Sz=(t={})=>({...xme,headers:zme,parseAs:"auto",querySerializer:Fme,...t}),jme=(t={})=>{let e=KU(Sz(),t);const n=()=>({...e}),r=f=>(e=KU(e,f),n()),s=Ume(),o=async f=>{const h={...e,...f,fetch:f.fetch??e.fetch??globalThis.fetch,headers:bz(e.headers,f.headers),serializedBody:void 0};h.security&&await Dme({...h,security:h.security}),h.requestValidator&&await h.requestValidator(h),h.body!==void 0&&h.bodySerializer&&(h.serializedBody=h.bodySerializer(h.body)),(h.body===void 0||h.serializedBody==="")&&h.headers.delete("Content-Type");const g=GU(h);return{opts:h,url:g}},a=async f=>{const{opts:h,url:g}=await o(f),m={redirect:"follow",...h,body:VU(h)};let y=new Request(g,m);for(const M of s.request.fns)M&&(y=await M(y,h));const S=h.fetch;let E;try{E=await S(y)}catch(M){let N=M;for(const O of s.error.fns)O&&(N=await O(M,void 0,y,h));if(N=N||{},h.throwOnError)throw N;return h.responseStyle==="data"?void 0:{error:N,request:y,response:void 0}}for(const M of s.response.fns)M&&(E=await M(E,y,h));const C={request:y,response:E};if(E.ok){const M=(h.parseAs==="auto"?Pme(E.headers.get("Content-Type")):h.parseAs)??"json";if(E.status===204||E.headers.get("Content-Length")==="0"){let O;switch(M){case"arrayBuffer":case"blob":case"text":O=await E[M]();break;case"formData":O=new FormData;break;case"stream":O=E.body;break;default:O={};break}return h.responseStyle==="data"?O:{data:O,...C}}let N;switch(M){case"arrayBuffer":case"blob":case"formData":case"text":N=await E[M]();break;case"json":{const O=await E.text();N=O?JSON.parse(O):{};break}case"stream":return h.responseStyle==="data"?E.body:{data:E.body,...C}}return M==="json"&&(h.responseValidator&&await h.responseValidator(N),h.responseTransformer&&(N=await h.responseTransformer(N))),h.responseStyle==="data"?N:{data:N,...C}}const w=await E.text();let T;try{T=JSON.parse(w)}catch{}const x=T??w;let R=x;for(const M of s.error.fns)M&&(R=await M(x,E,y,h));if(R=R||{},h.throwOnError)throw R;return h.responseStyle==="data"?void 0:{error:R,...C}},u=f=>h=>a({...h,method:f}),c=f=>async h=>{const{opts:g,url:m}=await o(h);return _me({...g,body:g.body,headers:g.headers,method:f,onRequest:async(y,S)=>{let E=new Request(y,S);for(const C of s.request.fns)C&&(E=await C(E,g));return E},serializedBody:VU(g),url:m})};return{buildUrl:GU,connect:u("CONNECT"),delete:u("DELETE"),get:u("GET"),getConfig:n,head:u("HEAD"),interceptors:s,options:u("OPTIONS"),patch:u("PATCH"),post:u("POST"),put:u("PUT"),request:a,setConfig:r,sse:{connect:c("CONNECT"),delete:c("DELETE"),get:c("GET"),head:c("HEAD"),options:c("OPTIONS"),patch:c("PATCH"),post:c("POST"),put:c("PUT"),trace:c("TRACE")},trace:u("TRACE")}},ke=jme(Sz({baseUrl:"https://api.remit.example.com"}));let YU=!1;const Bme=t=>{YU||(ke.interceptors.request.use(async e=>{const n=await t.getToken();return n&&e.headers.set("Authorization",`Bearer ${n}`),e}),YU=!0)},$me=({children:t})=>I.jsx(I.Fragment,{children:t}),Hme={configure:()=>{},getToken:async()=>null,resetToken:()=>{},Shell:$me,Account:({fallback:t=null})=>I.jsx(I.Fragment,{children:t})},Ez=_.createContext(Hme),qme=Ez.Provider,BRe=()=>_.useContext(Ez),Wme=(t,e)=>{L9(t,e.meta)&&ql(t)},Vme=(t,e,n,r)=>{L9(t,r.meta)&&ql(t)},L_=t=>new TextEncoder().encode(t),Cz={},U_={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),Cz[t]=e,U_[e]=t}function Gme(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2){const r=t.slice(n,n+2).toLowerCase();if(r in U_)e[n/2]=U_[r];else throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`)}return e}function zl(t){let e="";for(let n=0;n<t.byteLength;n++)e+=Cz[t[n]];return e}const Fh=t=>t instanceof Uint8Array?t:typeof t=="string"?L_(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t),Kme=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]";class wi{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const n=new wi({...e,headers:{...e.headers}});return n.query&&(n.query=Yme(n.query)),n}static isInstance(e){if(!e)return!1;const n=e;return"method"in n&&"protocol"in n&&"hostname"in n&&"path"in n&&typeof n.query=="object"&&typeof n.headers=="object"}clone(){return wi.clone(this)}}function Yme(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];return{...e,[n]:Array.isArray(r)?[...r]:r}},{})}class zh{statusCode;reason;headers;body;constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const n=e;return typeof n.statusCode=="number"&&typeof n.headers=="object"}}const ZU=t=>{if(typeof t=="function")return t;const e=Promise.resolve(t);return()=>e},jl=t=>encodeURIComponent(t).replace(/[!'()*]/g,Zme),Zme=t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`;function CR(t){const e=[];for(let n of Object.keys(t).sort()){const r=t[n];if(n=jl(n),Array.isArray(r))for(let s=0,o=r.length;s<o;s++)e.push(`${n}=${jl(r[s])}`);else{let s=n;(r||typeof r=="string")&&(s+=`=${jl(r)}`),e.push(s)}}return e.join("&")}const hm="[aws-rum-web:unknown.unknown]";class be{static configure(e){be.debugEnabled=e}static getCallerInfo(){var e,n;try{const r=new Error().stack;if(!r)return hm;const s=r.split(`
|
|
231
231
|
`);if(s.length<4)return hm;const o=s[3];if(!o)return hm;const a=o.match(/at (?:(.+?)\s+\()?/);if(a&&a.length>=2){const u=a[1].trim(),c=u.split(".");if(c.length>=2){const f=(e=c[c.length-2])!==null&&e!==void 0?e:"unknown",h=(n=c[c.length-1])!==null&&n!==void 0?n:"unknown";return`[aws-rum-web:${f}.${h}]`}return`[aws-rum-web:${u}]`}}catch{}return hm}static info(e,...n){if(!be.debugEnabled)return;const r=this.getCallerInfo();console.info(r,e,...n)}static debug(e,...n){if(!be.debugEnabled)return;const r=this.getCallerInfo();console.debug(r,e,...n)}static warn(e,...n){if(!be.debugEnabled)return;const r=this.getCallerInfo();console.warn(r,e,...n)}static error(e,...n){if(!be.debugEnabled)return;const r=this.getCallerInfo();console.error(r,e,...n)}}be.debugEnabled=!1;const XU=2048,QU=.2,Xme=()=>typeof CompressionStream<"u",Qme=async t=>{const e=new Blob([t]).stream().pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(e).arrayBuffer())},Jme=async t=>{const e=t.length;if(be.debug(`compressIfBeneficial called, payload size: ${e}B`),!Xme())return be.debug("CompressionStream not supported, skipping compression"),{body:t,compressed:!1};if(e<XU)return be.debug(`Payload size ${e}B below threshold ${XU}B, skipping compression`),{body:t,compressed:!1};const n=await Qme(t),r=1-n.length/e;return r>=QU?(be.debug(`Compressed ${e}B -> ${n.length}B (${(r*100).toFixed(1)}% reduction)`),{body:n,compressed:!0}):(be.debug(`Compression ratio ${(r*100).toFixed(1)}% below threshold ${QU*100}%, skipping`),{body:t,compressed:!1})},eve="POST",tve="application/json",nve="text/plain;charset=UTF-8",rve=64e3;class sve{constructor(e,n){this.sendFetch=async r=>{var s,o;const a=JSON.stringify(JU(r)),u=(o=(s=this.config.compressionStrategy)===null||s===void 0?void 0:s.enabled)!==null&&o!==void 0?o:!1,{body:c,compressed:f}=u?await Jme(a):{body:a,compressed:!1},h=await this.getHttpRequestOptions(r,c,tve,f);let g=new wi(h);return this.signing&&(g=await this.signing.sign(g)),this.config.fetchRequestHandler.handle(g)},this.sendBeacon=async r=>{const s=JSON.stringify(JU(r));if(s.length>rve)throw new Error("Payload too large for sendBeacon");const o=await this.getHttpRequestOptions(r,s,nve,!1);let a=new wi(o);return this.signing&&(a=await this.signing.presign(a)),this.config.beaconRequestHandler.handle(a)},this.getHttpRequestOptions=async(r,s,o,a)=>{const u=this.config.endpoint.pathname.replace(/\/$/,""),c=Object.assign({"content-type":o,host:this.config.endpoint.host},this.config.headers);a&&(c["Content-Encoding"]="gzip");const f={method:eve,protocol:this.config.endpoint.protocol,port:Number(this.config.endpoint.port)||void 0,headers:c,hostname:this.config.endpoint.hostname,path:`${u}/appmonitors/${r.AppMonitorDetails.id}`,body:s};return this.signing?Object.assign(Object.assign({},f),{headers:Object.assign(Object.assign({},f.headers),{"X-Amz-Content-Sha256":await this.signing.hashAndEncode(s)})}):f},this.config=e,this.signing=n}}const JU=t=>{const e=[];t.RumEvents.forEach(r=>e.push(ove(r)));let n={BatchId:t.BatchId,AppMonitorDetails:t.AppMonitorDetails,UserDetails:t.UserDetails,RumEvents:e};return t.SessionMetadata&&(n=Object.assign(Object.assign({},n),{SessionMetadata:t.SessionMetadata})),t.Alias&&(n=Object.assign(Object.assign({},n),{Alias:t.Alias})),n},ove=t=>({id:t.id,timestamp:Math.round(t.timestamp.getTime()/1e3),type:t.type,metadata:t.metadata,details:t.details});class ive{handle(e){const n=this.sendBeacon(e);return new Promise((r,s)=>{n?r({response:new zh({statusCode:200})}):s()})}updateHttpClientConfig(e,n){}httpHandlerConfigs(){return{}}sendBeacon(e){let n=e.path;if(e.query){const o=CR(e.query);o&&(n+=`?${o}`)}const{port:r}=e,s=`${e.protocol}//${e.hostname}${r?`:${r}`:""}${n}`;return navigator.sendBeacon(s,e.body)}}const ave=(t=0)=>new Promise((e,n)=>{t&&setTimeout(()=>{const r=new Error(`Request did not complete within ${t} ms`);r.name="TimeoutError",n(r)},t)});let lve=class{constructor({fetchFunction:e,requestTimeout:n}={}){this.requestTimeout=n,this.fetchFunction=e}destroy(){}handle(e,{abortSignal:n}={}){const r=this.requestTimeout;if(n?.aborted){const m=new Error("Request aborted");return m.name="AbortError",Promise.reject(m)}let s=e.path;if(e.query){const m=CR(e.query);m&&(s+=`?${m}`)}const{port:o,method:a}=e,u=`${e.protocol}//${e.hostname}${o?`:${o}`:""}${s}`,f={body:a==="GET"||a==="HEAD"?void 0:e.body,headers:new Headers(e.headers),method:a};typeof AbortController<"u"&&(f.signal=n);const h=new Request(u,f),g=[this.fetchFunction.apply(window,[h]).then(m=>{const y=m.headers,S={};for(const C of y.entries())S[C[0]]=C[1];return m.body!==void 0?{response:new zh({headers:S,statusCode:m.status,body:m.body})}:m.blob().then(C=>({response:new zh({headers:S,statusCode:m.status,body:C})}))}),ave(r)];return n&&g.push(new Promise((m,y)=>{n.onabort=()=>{const S=new Error("Request aborted");S.name="AbortError",y(S)}})),Promise.race(g)}updateHttpClientConfig(e,n){}httpHandlerConfigs(){return{}}},pm;const uve=new Uint8Array(16);function cve(){if(!pm&&(pm=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pm))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pm(uve)}const nr=[];for(let t=0;t<256;++t)nr.push((t+256).toString(16).slice(1));function dve(t,e=0){return nr[t[e+0]]+nr[t[e+1]]+nr[t[e+2]]+nr[t[e+3]]+"-"+nr[t[e+4]]+nr[t[e+5]]+"-"+nr[t[e+6]]+nr[t[e+7]]+"-"+nr[t[e+8]]+nr[t[e+9]]+"-"+nr[t[e+10]]+nr[t[e+11]]+nr[t[e+12]]+nr[t[e+13]]+nr[t[e+14]]+nr[t[e+15]]}const fve=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),e4={randomUUID:fve};function gh(t,e,n){if(e4.randomUUID&&!t)return e4.randomUUID();t=t||{};const r=t.random||(t.rng||cve)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,dve(r)}const wR=t=>{if(crypto)return crypto.getRandomValues(t);if(msCrypto)return msCrypto.getRandomValues(t);throw new Error("No crypto library found.")},wz=[];for(let t=0;t<256;t++)wz[t]=(t+256).toString(16).substr(1);const Cb="X-Amzn-Trace-Id",wb="traceparent",hve=2,pve=32,gve=16,mve=4,xz=(t,e)=>Array.isArray(e)?e.some(n=>n.test(t)):e,_z={logicalServiceName:"rum.aws.amazon.com",urlsToInclude:[/.*/],urlsToExclude:[/cognito\-identity\.([^\.]*\.)?amazonaws\.com/,/sts\.([^\.]*\.)?amazonaws\.com/],stackTraceLength:200,recordAllRequests:!1,addXRayTraceIdHeader:!1},vve=t=>200<=t&&t<300,Az=t=>Math.floor(t/100)===4,xR=t=>Math.floor(t/100)===5,_R=t=>t===429,Tz=(t,e)=>{const n=e.urlsToInclude.some(s=>s.test(t)),r=e.urlsToExclude.some(s=>s.test(t));return n&&!r},Ic=()=>Date.now()/1e3,yve=(t,e,n)=>{const r={request:{}};return r.request.method=e?.method?e.method:"GET",r.request.traced=n,r.request.url=hv(t),r},Rz=(t,e,n,r)=>({version:"1.0.0",name:t,origin:"AWS::RUM::AppMonitor",id:Nz(),start_time:e,trace_id:n?xve():wve(),end_time:void 0,subsegments:[],in_progress:!1}),Iz=(t,e,n)=>{const r={id:Nz(),name:t,start_time:e,end_time:void 0,in_progress:!1,namespace:t.endsWith(".amazonaws.com")?"aws":"remote"};return n&&(r.http=n),r},Oz=t=>{try{return t.hostname?t.hostname:t.url?new URL(t.url).hostname:new URL(t.toString()).hostname}catch{return window.location.hostname}},bve=(t,e,n,r)=>{t.headers||(t.headers={}),r?t.headers[wb]=TR(e,n):t.headers[Cb]=AR(e,n)},Sve=(t,e,n,r)=>{r?t.set(wb,TR(e,n)):t.set(Cb,AR(e,n))},AR=(t,e)=>"Root="+t+";Parent="+e+";Sampled=1",TR=(t,e)=>"00-"+t+"-"+e+"-01",Eve=t=>t?.length===mve&&t[0].length===hve&&t[1].length===pve&&t[2].length===gve&&(t[3]==="00"||t[3]==="01"),Cve=(t,e)=>{var n,r;const s={};if(t)if(e){const o=(n=t.get(wb))===null||n===void 0?void 0:n.split("-");o&&Eve(o)&&(s.traceId=o[1],s.segmentId=o[2])}else{const o=(r=t.get(Cb))===null||r===void 0?void 0:r.split(";");o?.length===3&&(s.traceId=o[0].split("Root=")[1],s.segmentId=o[1].split("Parent=")[1])}return s},hv=t=>t.url?t.url:t.toString(),wve=()=>`1-${_ve()}-${Ave()}`,xve=()=>{const t=new Uint8Array(16);return wR(t),`${RR(t)}`},Nz=()=>{const t=new Uint8Array(8);return wR(t),RR(t)},_ve=()=>Math.floor(Date.now()/1e3).toString(16),Ave=()=>{const t=new Uint8Array(12);return wR(t),RR(t)},RR=t=>{let e="";for(let n=0;n<t.length;n++)e+=wz[t[n]];return e};class Tve{constructor(e,n,r=s=>2e3*Math.pow(2,s-1)){this.handler=e,this.retries=n,this.backoff=r}async handle(e){let n=this.retries;for(;;)try{const r=await this.handler.handle(e);if(vve(r.response.statusCode))return r;throw r.response.statusCode}catch(r){if(typeof r=="number"&&!_R(r)&&!xR(r))throw new Error(`${r}`);if(n<=0)throw r;n--,await this.sleep(this.backoff(this.retries-n))}}async sleep(e){return new Promise(n=>setTimeout(n,e))}updateHttpClientConfig(e,n){}httpHandlerConfigs(){return{}}}const Gc="cwr_c",Wv="cwr_i",Vv="cwr_s",Gv="cwr_u",Rve=3e4,Ive="arw-module",t4="CWR: Cannot dispatch; no AWS credentials.";class Ove{constructor(e,n,r,s,o){this.disableCodes=["403","404"],this.shouldPurgeCredentials=!0,this.dispatchFetch=async()=>{if(this.doRequest()){const a=this.createRequest();return be.info(`Dispatching ${a.RumEvents.length} events via fetch`),this.rum.sendFetch(a).catch(this.handleReject)}},this.dispatchBeacon=async()=>{if(this.doRequest()){const a=this.createRequest();return be.info(`Dispatching ${a.RumEvents.length} events via beacon`),this.rum.sendBeacon(a).catch(()=>this.rum.sendFetch(a))}},this.dispatchFetchFailSilent=async()=>this.dispatchFetch().catch(a=>{be.error("Dispatch fetch failed silently:",a)}),this.dispatchBeaconFailSilent=async()=>this.dispatchBeacon().catch(a=>{be.error("Dispatch beacon failed silently:",a)}),this.flushSync=()=>{if(document.visibilityState==="hidden"&&this.doRequest(!0)){let a=this.rum.sendBeacon,u=this.rum.sendFetch;this.config.useBeacon||([a,u]=[u,a]);const c=this.createRequest(!0);be.debug(`Flushing ${c.RumEvents.length} events on page hide`),a(c).catch(()=>u(c)).catch(f=>{be.error("Page hide flush failed:",f)})}},this.handleReject=a=>{throw a instanceof Error&&(a.message==="403"&&this.config.signing&&this.shouldPurgeCredentials?(this.shouldPurgeCredentials=!1,this.forceRebuildClient()):this.disableCodes.includes(a.message)&&(be.error("Dispatch failed with status code:",a.message),this.disable())),a},this.defaultClientBuilder=(a,u,c,f)=>{const h=c&&this.signingConfigFactory?this.signingConfigFactory(c,u):void 0;return new sve({fetchRequestHandler:new Tve(new lve({fetchFunction:this.config.fetchFunction}),this.config.retries),beaconRequestHandler:new ive,endpoint:a,region:u,credentials:c,headers:this.headers,compressionStrategy:f},h)},this.applicationId=e,this.region=n,this.endpoint=r,this.eventCache=s,this.enabled=!0,this.buildClient=o.clientBuilder||this.defaultClientBuilder,this.config=o,this.headers=o.headers,this.startDispatchTimer(),o.signing?this.rum={sendFetch:()=>Promise.reject(new Error(t4)),sendBeacon:()=>Promise.reject(new Error(t4))}:this.rum=this.buildClient(this.endpoint,this.region,void 0,this.config.compressionStrategy),this.credentialStorageKey=this.config.cookieAttributes.unique?`${Gc}_${e}`:Gc,this.identityStorageKey=this.config.cookieAttributes.unique?`${Wv}_${e}`:Wv}enable(){this.enabled=!0,this.startDispatchTimer()}disable(){this.stopDispatchTimer(),this.enabled=!1,be.warn("Dispatch disabled")}setAwsCredentials(e){this.credentialProvider=e,this.rum=this.buildClient(this.endpoint,this.region,e,this.config.compressionStrategy),typeof e=="function"&&e()}setCognitoCredentialProviderFactory(e){this.cognitoCredentialProviderFactory=e}setSigningConfigFactory(e){this.signingConfigFactory=e}setCognitoCredentials(e,n){this.identityPoolId=e,this.guestRoleArn=n,this.cognitoCredentialProviderFactory&&this.setAwsCredentials(this.cognitoCredentialProviderFactory(this.config,this.applicationId,e,n))}startDispatchTimer(){document.addEventListener("visibilitychange",this.flushSync),document.addEventListener("pagehide",this.flushSync),!(this.config.dispatchInterval<=0||this.dispatchTimerId)&&(this.dispatchTimerId=window.setInterval(this.dispatchFetchFailSilent,this.config.dispatchInterval))}stopDispatchTimer(){document.removeEventListener("visibilitychange",this.flushSync),document.removeEventListener("pagehide",this.flushSync),this.dispatchTimerId&&(window.clearInterval(this.dispatchTimerId),this.dispatchTimerId=void 0)}doRequest(e=!1){return this.enabled?e&&this.eventCache.hasCandidates()?!0:this.eventCache.hasEvents():!1}createRequest(e=!1){return{BatchId:gh(),AppMonitorDetails:this.eventCache.getAppMonitorDetails(),UserDetails:this.eventCache.getUserDetails(),SessionMetadata:JSON.stringify(this.eventCache.getCommonMetadata()),RumEvents:this.eventCache.getEventBatch(e),Alias:this.config.alias}}forceRebuildClient(){be.warn("Removing credentials from local storage"),localStorage.removeItem(this.credentialStorageKey),this.identityPoolId?(be.info("Rebuilding client with fresh cognito credentials"),localStorage.removeItem(this.identityStorageKey),this.setCognitoCredentials(this.identityPoolId,this.guestRoleArn)):this.credentialProvider&&(be.info("Rebuilding client with most recently passed provider"),this.setAwsCredentials(this.credentialProvider))}}const Mz={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),Mz[t]=e}function Nve(t){let e="";for(let n=0;n<t.byteLength;n++)e+=Mz[t[n]];return e}class Mve{format(e){const n=[];for(const o of Object.keys(e)){const a=L_(o);n.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(e[o]))}const r=new Uint8Array(n.reduce((o,a)=>o+a.byteLength,0));let s=0;for(const o of n)r.set(o,s),s+=o.byteLength;return r}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?_s.boolTrue:_s.boolFalse]);case"byte":return Uint8Array.from([_s.byte,e.value]);case"short":const n=new DataView(new ArrayBuffer(3));return n.setUint8(0,_s.short),n.setInt16(1,e.value,!1),new Uint8Array(n.buffer);case"integer":const r=new DataView(new ArrayBuffer(5));return r.setUint8(0,_s.integer),r.setInt32(1,e.value,!1),new Uint8Array(r.buffer);case"long":const s=new Uint8Array(9);return s[0]=_s.long,s.set(e.value.bytes,1),s;case"binary":const o=new DataView(new ArrayBuffer(3+e.value.byteLength));o.setUint8(0,_s.byteArray),o.setUint16(1,e.value.byteLength,!1);const a=new Uint8Array(o.buffer);return a.set(e.value,3),a;case"string":const u=L_(e.value),c=new DataView(new ArrayBuffer(3+u.byteLength));c.setUint8(0,_s.string),c.setUint16(1,u.byteLength,!1);const f=new Uint8Array(c.buffer);return f.set(u,3),f;case"timestamp":const h=new Uint8Array(9);return h[0]=_s.timestamp,h.set(IR.fromNumber(e.value.valueOf()).bytes,1),h;case"uuid":if(!Pve.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const g=new Uint8Array(17);return g[0]=_s.uuid,g.set(Gme(e.value.replace(/-/g,"")),1),g}}}var _s;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(_s||(_s={}));const Pve=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class IR{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const n=new Uint8Array(8);for(let r=7,s=Math.abs(Math.round(e));r>-1&&s>0;r--,s/=256)n[r]=s;return e<0&&n4(n),new IR(n)}valueOf(){const e=this.bytes.slice(0),n=e[0]&128;return n&&n4(e),parseInt(zl(e),16)*(n?-1:1)}toString(){return String(this.valueOf())}}function n4(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}const kve="X-Amz-Algorithm",Dve="X-Amz-Credential",Pz="X-Amz-Date",Lve="X-Amz-SignedHeaders",Uve="X-Amz-Expires",kz="X-Amz-Signature",Dz="X-Amz-Security-Token",Lz="authorization",Uz=Pz.toLowerCase(),Fve="date",zve=[Lz,Uz,Fve],jve=kz.toLowerCase(),F_="x-amz-content-sha256",Bve=Dz.toLowerCase(),$ve={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Hve=/^proxy-/,qve=/^sec-/,ox="AWS4-HMAC-SHA256",Wve="AWS4-HMAC-SHA256-PAYLOAD",Vve="UNSIGNED-PAYLOAD",Gve=50,Fz="aws4_request",Kve=3600*24*7,Yve=({query:t={}})=>{const e=[],n={};for(const r of Object.keys(t)){if(r.toLowerCase()===jve)continue;const s=jl(r);e.push(s);const o=t[r];typeof o=="string"?n[s]=`${s}=${jl(o)}`:Array.isArray(o)&&(n[s]=o.slice(0).reduce((a,u)=>a.concat([`${s}=${jl(u)}`]),[]).sort().join("&"))}return e.sort().map(r=>n[r]).filter(r=>r).join("&")},Zve=t=>Xve(t).toISOString().replace(/\.\d{3}Z$/,"Z"),Xve=t=>typeof t=="number"?new Date(t*1e3):typeof t=="string"?Number(t)?new Date(Number(t)*1e3):new Date(t):t;class Qve{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:n,region:r,service:s,sha256:o,uriEscapePath:a=!0}){this.service=s,this.sha256=o,this.uriEscapePath=a,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=ZU(r),this.credentialProvider=ZU(n)}createCanonicalRequest(e,n,r){const s=Object.keys(n).sort();return`${e.method}
|
|
232
232
|
${this.getCanonicalPath(e)}
|
|
233
233
|
${Yve(e)}
|
|
@@ -291,5 +291,5 @@ https://www.w3ctech.com/topic/2226`));let u=n(...a);return u.postcssPlugin=e,u.p
|
|
|
291
291
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),Qv.LANG&&Qv.LANG.startsWith("cn")&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
292
292
|
https://www.w3ctech.com/topic/2226`));let u=n(...a);return u.postcssPlugin=e,u.postcssVersion=new aI().version,u}let o;return Object.defineProperty(s,"postcss",{get(){return o||(o=s()),o}}),s.process=function(a,u,c){return Ut([s(c)]).process(a,u)},s};Ut.stringify=ZEe;Ut.parse=tCe;Ut.fromJSON=XEe;Ut.list=nCe;Ut.comment=t=>new AB(t);Ut.atRule=t=>new TB(t);Ut.decl=t=>new xB(t);Ut.rule=t=>new RB(t);Ut.root=t=>new IB(t);Ut.document=t=>new _B(t);Ut.CssSyntaxError=GEe;Ut.Declaration=xB;Ut.Container=YEe;Ut.Processor=aI;Ut.Document=_B;Ut.Comment=AB;Ut.Warning=QEe;Ut.AtRule=TB;Ut.Result=JEe;Ut.Input=eCe;Ut.Rule=RB;Ut.Root=IB;Ut.Node=rCe;KEe.registerPostcss(Ut);var sCe=Ut;Ut.default=Ut;const an=vSe(sCe);an.stringify;an.fromJSON;an.plugin;an.parse;an.list;an.document;an.comment;an.atRule;an.rule;an.decl;an.root;an.CssSyntaxError;an.Declaration;an.Container;an.Processor;an.Document;an.Comment;an.Warning;an.AtRule;an.Result;an.Input;an.Rule;an.Root;an.Node;class lI{constructor(...e){xs(this,"parentElement",null),xs(this,"parentNode",null),xs(this,"ownerDocument"),xs(this,"firstChild",null),xs(this,"lastChild",null),xs(this,"previousSibling",null),xs(this,"nextSibling",null),xs(this,"ELEMENT_NODE",1),xs(this,"TEXT_NODE",3),xs(this,"nodeType"),xs(this,"nodeName"),xs(this,"RRNodeType")}get childNodes(){const e=[];let n=this.firstChild;for(;n;)e.push(n),n=n.nextSibling;return e}contains(e){if(e instanceof lI){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,n){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const u5={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},c5={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Fm={},oCe=()=>!!globalThis.Zone;function uI(t){if(Fm[t])return Fm[t];const e=globalThis[t],n=e.prototype,r=t in u5?u5[t]:void 0,s=!!(r&&r.every(u=>{var c,f;return!!((f=(c=Object.getOwnPropertyDescriptor(n,u))==null?void 0:c.get)!=null&&f.toString().includes("[native code]"))})),o=t in c5?c5[t]:void 0,a=!!(o&&o.every(u=>{var c;return typeof n[u]=="function"&&((c=n[u])==null?void 0:c.toString().includes("[native code]"))}));if(s&&a&&!oCe())return Fm[t]=e.prototype,e.prototype;try{const u=document.createElement("iframe");document.body.appendChild(u);const c=u.contentWindow;if(!c)return e.prototype;const f=c[t].prototype;return document.body.removeChild(u),f?Fm[t]=f:n}catch{return n}}const Tx={};function Mi(t,e,n){var r;const s=`${t}.${String(n)}`;if(Tx[s])return Tx[s].call(e);const o=uI(t),a=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return a?(Tx[s]=a,a.call(e)):e[n]}const Rx={};function OB(t,e,n){const r=`${t}.${String(n)}`;if(Rx[r])return Rx[r].bind(e);const o=uI(t)[n];return typeof o!="function"?e[n]:(Rx[r]=o,o.bind(e))}function iCe(t){return Mi("Node",t,"ownerDocument")}function aCe(t){return Mi("Node",t,"childNodes")}function lCe(t){return Mi("Node",t,"parentNode")}function uCe(t){return Mi("Node",t,"parentElement")}function cCe(t){return Mi("Node",t,"textContent")}function dCe(t,e){return OB("Node",t,"contains")(e)}function fCe(t){return OB("Node",t,"getRootNode")()}function hCe(t){return!t||!("host"in t)?null:Mi("ShadowRoot",t,"host")}function pCe(t){return t.styleSheets}function gCe(t){return!t||!("shadowRoot"in t)?null:Mi("Element",t,"shadowRoot")}function mCe(t,e){return Mi("Element",t,"querySelector")(e)}function vCe(t,e){return Mi("Element",t,"querySelectorAll")(e)}function NB(){return uI("MutationObserver").constructor}function mu(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],s=n(r);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=s,()=>{t[e]=r}}catch{return()=>{}}}const rt={ownerDocument:iCe,childNodes:aCe,parentNode:lCe,parentElement:uCe,textContent:cCe,contains:dCe,getRootNode:fCe,host:hCe,styleSheets:pCe,shadowRoot:gCe,querySelector:mCe,querySelectorAll:vCe,mutationObserver:NB,patch:mu};function Cr(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const Cc=`Please stop import mirror directly. Instead of that,\r
|
|
293
293
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
294
|
-
or you can use record.mirror to access the mirror instance during recording.`;let d5={map:{},getId(){return console.error(Cc),-1},getNode(){return console.error(Cc),null},removeNodeFromMap(){console.error(Cc)},has(){return console.error(Cc),!1},reset(){console.error(Cc)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(d5=new Proxy(d5,{get(t,e,n){return e==="map"&&console.error(Cc),Reflect.get(t,e,n)}}));function Zh(t,e,n={}){let r=null,s=0;return function(...o){const a=Date.now();!s&&n.leading===!1&&(s=a);const u=e-(a-s),c=this;u<=0||u>e?(r&&(clearTimeout(r),r=null),s=a,t.apply(c,o)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{s=n.leading===!1?0:Date.now(),r=null,t.apply(c,o)},u))}}function zb(t,e,n,r,s=window){const o=s.Object.getOwnPropertyDescriptor(t,e);return s.Object.defineProperty(t,e,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>zb(t,e,o||{},!0)}let dy=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(dy=()=>new Date().getTime());function MB(t){var e,n,r,s;const o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:o.documentElement.scrollLeft||o?.body&&((e=rt.parentElement(o.body))==null?void 0:e.scrollLeft)||((n=o?.body)==null?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:o?.documentElement.scrollTop||o?.body&&((r=rt.parentElement(o.body))==null?void 0:r.scrollTop)||((s=o?.body)==null?void 0:s.scrollTop)||0}}function PB(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function kB(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function DB(t){return t?t.nodeType===t.ELEMENT_NODE?t:rt.parentElement(t):null}function wr(t,e,n,r){if(!t)return!1;const s=DB(t);if(!s)return!1;try{if(typeof e=="string"){if(s.classList.contains(e)||r&&s.closest("."+e)!==null)return!0}else if(ny(s,e,r))return!0}catch{}return!!(n&&(s.matches(n)||r&&s.closest(n)!==null))}function yCe(t,e){return e.getId(t)!==-1}function Ix(t,e,n){return t.tagName==="TITLE"&&n.headTitleMutations?!0:e.getId(t)===Bh}function LB(t,e){if(bh(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const r=rt.parentNode(t);return r&&r.nodeType===t.DOCUMENT_NODE?!1:r?LB(r,e):!0}function EA(t){return!!t.changedTouches}function bCe(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function UB(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function FB(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function CA(t){return t?t instanceof lI&&"shadowRoot"in t?!!t.shadowRoot:!!rt.shadowRoot(t):!1}class SCe{constructor(){Se(this,"id",1),Se(this,"styleIDMap",new WeakMap),Se(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function zB(t){var e;let n=null;return"getRootNode"in t&&((e=rt.getRootNode(t))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&rt.host(rt.getRootNode(t))&&(n=rt.host(rt.getRootNode(t))),n}function ECe(t){let e=t,n;for(;n=zB(e);)e=n;return e}function CCe(t){const e=rt.ownerDocument(t);if(!e)return!1;const n=ECe(t);return rt.contains(e,n)}function jB(t){const e=rt.ownerDocument(t);return e?rt.contains(e,t)||CCe(t):!1}var wt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(wt||{}),ft=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(ft||{}),Ur=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Ur||{}),ii=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(ii||{}),ed=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(ed||{}),wc=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(wc||{}),BB=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(BB||{});function f5(t){return"__ln"in t}class wCe{constructor(){Se(this,"length",0),Se(this,"head",null),Se(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=n?.next||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&f5(e.previousSibling)){const r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&f5(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(e){const n=e.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const h5=(t,e)=>`${t}@${e}`;class xCe{constructor(){Se(this,"frozen",!1),Se(this,"locked",!1),Se(this,"texts",[]),Se(this,"attributes",[]),Se(this,"attributeMap",new WeakMap),Se(this,"removes",[]),Se(this,"mapRemoves",[]),Se(this,"movedMap",{}),Se(this,"addedSet",new Set),Se(this,"movedSet",new Set),Se(this,"droppedSet",new Set),Se(this,"removesSubTreeCache",new Set),Se(this,"mutationCb"),Se(this,"blockClass"),Se(this,"blockSelector"),Se(this,"maskTextClass"),Se(this,"maskTextSelector"),Se(this,"inlineStylesheet"),Se(this,"maskInputOptions"),Se(this,"maskTextFn"),Se(this,"maskInputFn"),Se(this,"keepIframeSrcFn"),Se(this,"recordCanvas"),Se(this,"inlineImages"),Se(this,"slimDOMOptions"),Se(this,"dataURLOptions"),Se(this,"doc"),Se(this,"mirror"),Se(this,"iframeManager"),Se(this,"stylesheetManager"),Se(this,"shadowDomManager"),Se(this,"canvasManager"),Se(this,"processedNodeManager"),Se(this,"unattachedDoc"),Se(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Se(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],n=new Set,r=new wCe,s=c=>{let f=c,h=Bh;for(;h===Bh;)f=f&&f.nextSibling,h=f&&this.mirror.getId(f);return h},o=c=>{const f=rt.parentNode(c);if(!f||!jB(c))return;let h=!1;if(c.nodeType===Node.TEXT_NODE){const S=f.tagName;if(S==="TEXTAREA")return;S==="STYLE"&&this.addedSet.has(f)&&(h=!0)}const g=bh(f)?this.mirror.getId(zB(c)):this.mirror.getId(f),m=s(c);if(g===-1||m===-1)return r.addNode(c);const y=Mc(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:S=>{UB(S,this.mirror)&&this.iframeManager.addIframe(S),FB(S,this.mirror)&&this.stylesheetManager.trackLinkElement(S),CA(c)&&this.shadowDomManager.addShadowRoot(rt.shadowRoot(c),this.doc)},onIframeLoad:(S,E)=>{this.iframeManager.attachIframe(S,E),this.shadowDomManager.observeAttachShadow(S)},onStylesheetLoad:(S,E)=>{this.stylesheetManager.attachLinkElement(S,E)},cssCaptured:h});y&&(e.push({parentId:g,nextId:m,node:y}),n.add(y.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of this.movedSet)p5(this.removesSubTreeCache,c,this.mirror)&&!this.movedSet.has(rt.parentNode(c))||o(c);for(const c of this.addedSet)!g5(this.droppedSet,c)&&!p5(this.removesSubTreeCache,c,this.mirror)||g5(this.movedSet,c)?o(c):this.droppedSet.add(c);let a=null;for(;r.length;){let c=null;if(a){const f=this.mirror.getId(rt.parentNode(a.value)),h=s(a.value);f!==-1&&h!==-1&&(c=a)}if(!c){let f=r.tail;for(;f;){const h=f;if(f=f.previous,h){const g=this.mirror.getId(rt.parentNode(h.value));if(s(h.value)===-1)continue;if(g!==-1){c=h;break}else{const y=h.value,S=rt.parentNode(y);if(S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const E=rt.host(S);if(this.mirror.getId(E)!==-1){c=h;break}}}}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}a=c.previous,r.removeNode(c.value),o(c.value)}const u={texts:this.texts.map(c=>{const f=c.node,h=rt.parentNode(f);return h&&h.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(h),{id:this.mirror.getId(f),value:c.value}}).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:f}=c;if(typeof f.style=="string"){const h=JSON.stringify(c.styleDiff),g=JSON.stringify(c._unchangedStyles);h.length<f.style.length&&(h+g).split("var(").length===f.style.split("var(").length&&(f.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:f}}).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:e};!u.texts.length&&!u.attributes.length&&!u.removes.length&&!u.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(u))}),Se(this,"genTextAreaValueMutation",e=>{let n=this.attributeMap.get(e);n||(n={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e,n));const r=Array.from(rt.childNodes(e),s=>rt.textContent(s)||"").join("");n.attributes.value=Jv({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:ey(e),value:r,maskInputFn:this.maskInputFn})}),Se(this,"processMutation",e=>{if(!Ix(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const n=rt.textContent(e.target);!wr(e.target,this.blockClass,this.blockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:cj(e.target,this.maskTextClass,this.maskTextSelector,!0)&&n?this.maskTextFn?this.maskTextFn(n,DB(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,s=e.target.getAttribute(r);if(r==="value"){const a=ey(n);s=Jv({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:a,value:s,maskInputFn:this.maskInputFn})}if(wr(e.target,this.blockClass,this.blockSelector,!1)||s===e.oldValue)return;let o=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!n.contentDocument)r="rr_src";else return;if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),r==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!uj(n.tagName,r))if(o.attributes[r]=lj(this.doc,Ql(n.tagName),Ql(r),s),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");e.oldValue&&a.setAttribute("style",e.oldValue);for(const u of Array.from(n.style)){const c=n.style.getPropertyValue(u),f=n.style.getPropertyPriority(u);c!==a.style.getPropertyValue(u)||f!==a.style.getPropertyPriority(u)?f===""?o.styleDiff[u]=c:o.styleDiff[u]=[c,f]:o._unchangedStyles[u]=[c,f]}for(const u of Array.from(a.style))n.style.getPropertyValue(u)===""&&(o.styleDiff[u]=!1)}else r==="open"&&n.tagName==="DIALOG"&&(n.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(wr(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const r=this.mirror.getId(n),s=bh(e.target)?this.mirror.getId(rt.host(e.target)):this.mirror.getId(e.target);wr(e.target,this.blockClass,this.blockSelector,!1)||Ix(n,this.mirror,this.slimDOMOptions)||!yCe(n,this.mirror)||(this.addedSet.has(n)?(wA(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||LB(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[h5(r,s)]?wA(this.movedSet,n):(this.removes.push({parentId:s,id:r,isShadow:bh(e.target)&&Sh(e.target)?!0:void 0}),_Ce(n,this.removesSubTreeCache))),this.mapRemoves.push(n))});break}}}),Se(this,"genAdds",(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Ix(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[h5(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);wr(e,this.blockClass,this.blockSelector,!1)||(rt.childNodes(e).forEach(r=>this.genAdds(r)),CA(e)&&rt.childNodes(rt.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=e[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function wA(t,e){t.delete(e),rt.childNodes(e).forEach(n=>wA(t,n))}function _Ce(t,e){const n=[t];for(;n.length;){const r=n.pop();e.has(r)||(e.add(r),rt.childNodes(r).forEach(s=>n.push(s)))}}function p5(t,e,n){return t.size===0?!1:ACe(t,e)}function ACe(t,e,n){const r=rt.parentNode(e);return r?t.has(r):!1}function g5(t,e){return t.size===0?!1:$B(t,e)}function $B(t,e){const n=rt.parentNode(e);return n?t.has(n)?!0:$B(t,n):!1}let Eh;function TCe(t){Eh=t}function RCe(){Eh=void 0}const vt=t=>Eh?(...n)=>{try{return t(...n)}catch(r){if(Eh&&Eh(r)===!0)return;throw r}}:t,Nl=[];function yp(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function HB(t,e){const n=new xCe;Nl.push(n),n.init(t);const r=new(NB())(vt(n.processMutations.bind(n)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function ICe({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};const s=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let a=[],u;const c=Zh(vt(g=>{const m=Date.now()-u;t(a.map(y=>(y.timeOffset-=m,y)),g),a=[],u=null}),o),f=vt(Zh(vt(g=>{const m=yp(g),{clientX:y,clientY:S}=EA(g)?g.changedTouches[0]:g;u||(u=dy()),a.push({x:y,y:S,id:r.getId(m),timeOffset:dy()-u}),c(typeof DragEvent<"u"&&g instanceof DragEvent?ft.Drag:g instanceof MouseEvent?ft.MouseMove:ft.TouchMove)}),s,{trailing:!1})),h=[Cr("mousemove",f,n),Cr("touchmove",f,n),Cr("drag",f,n)];return vt(()=>{h.forEach(g=>g())})}function OCe({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,u=[];let c=null;const f=h=>g=>{const m=yp(g);if(wr(m,r,s,!0))return;let y=null,S=h;if("pointerType"in g){switch(g.pointerType){case"mouse":y=ii.Mouse;break;case"touch":y=ii.Touch;break;case"pen":y=ii.Pen;break}y===ii.Touch?Ur[h]===Ur.MouseDown?S="TouchStart":Ur[h]===Ur.MouseUp&&(S="TouchEnd"):ii.Pen}else EA(g)&&(y=ii.Touch);y!==null?(c=y,(S.startsWith("Touch")&&y===ii.Touch||S.startsWith("Mouse")&&y===ii.Mouse)&&(y=null)):Ur[h]===Ur.Click&&(y=c,c=null);const E=EA(g)?g.changedTouches[0]:g;if(!E)return;const C=n.getId(m),{clientX:w,clientY:T}=E;vt(t)({type:Ur[S],id:C,x:w,y:T,...y!==null&&{pointerType:y}})};return Object.keys(Ur).filter(h=>Number.isNaN(Number(h))&&!h.endsWith("_Departed")&&a[h]!==!1).forEach(h=>{let g=Ql(h);const m=f(h);if(window.PointerEvent)switch(Ur[h]){case Ur.MouseDown:case Ur.MouseUp:g=g.replace("mouse","pointer");break;case Ur.TouchStart:case Ur.TouchEnd:return}u.push(Cr(g,m,e))}),vt(()=>{u.forEach(h=>h())})}function qB({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,sampling:o}){const a=vt(Zh(vt(u=>{const c=yp(u);if(!c||wr(c,r,s,!0))return;const f=n.getId(c);if(c===e&&e.defaultView){const h=MB(e.defaultView);t({id:f,x:h.left,y:h.top})}else t({id:f,x:c.scrollLeft,y:c.scrollTop})}),o.scroll||100));return Cr("scroll",a,e)}function NCe({viewportResizeCb:t},{win:e}){let n=-1,r=-1;const s=vt(Zh(vt(()=>{const o=PB(),a=kB();(n!==o||r!==a)&&(t({width:Number(a),height:Number(o)}),n=o,r=a)}),200));return Cr("resize",s,e)}const MCe=["INPUT","TEXTAREA","SELECT"],m5=new WeakMap;function PCe({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:u,maskInputFn:c,sampling:f,userTriggeredOnInput:h}){function g(T){let x=yp(T);const R=T.isTrusted,M=x&&x.tagName;if(x&&M==="OPTION"&&(x=rt.parentElement(x)),!x||!M||MCe.indexOf(M)<0||wr(x,r,s,!0)||x.classList.contains(o)||a&&x.matches(a))return;let N=x.value,O=!1;const k=ey(x)||"";k==="radio"||k==="checkbox"?O=x.checked:(u[M.toLowerCase()]||u[k])&&(N=Jv({element:x,maskInputOptions:u,tagName:M,type:k,value:N,maskInputFn:c})),m(x,h?{text:N,isChecked:O,userTriggered:R}:{text:N,isChecked:O});const F=x.name;k==="radio"&&F&&O&&e.querySelectorAll(`input[type="radio"][name="${F}"]`).forEach(H=>{if(H!==x){const D=H.value;m(H,h?{text:D,isChecked:!O,userTriggered:!1}:{text:D,isChecked:!O})}})}function m(T,x){const R=m5.get(T);if(!R||R.text!==x.text||R.isChecked!==x.isChecked){m5.set(T,x);const M=n.getId(T);vt(t)({...x,id:M})}}const S=(f.input==="last"?["change"]:["input","change"]).map(T=>Cr(T,vt(g),e)),E=e.defaultView;if(!E)return()=>{S.forEach(T=>T())};const C=E.Object.getOwnPropertyDescriptor(E.HTMLInputElement.prototype,"value"),w=[[E.HTMLInputElement.prototype,"value"],[E.HTMLInputElement.prototype,"checked"],[E.HTMLSelectElement.prototype,"value"],[E.HTMLTextAreaElement.prototype,"value"],[E.HTMLSelectElement.prototype,"selectedIndex"],[E.HTMLOptionElement.prototype,"selected"]];return C&&C.set&&S.push(...w.map(T=>zb(T[0],T[1],{set(){vt(g)({target:this,isTrusted:!1})}},!1,E))),vt(()=>{S.forEach(T=>T())})}function fy(t){const e=[];function n(r,s){if(zm("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||zm("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||zm("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||zm("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const a=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(a)}else if(r.parentStyleSheet){const a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(a)}return s}return n(t,e)}function Sa(t,e,n){let r,s;return t?(t.ownerNode?r=e.getId(t.ownerNode):s=n.getId(t),{styleId:s,id:r}):{}}function kCe({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:vt((h,g,m)=>{const[y,S]=m,{id:E,styleId:C}=Sa(g,e,n.styleMirror);return(E&&E!==-1||C&&C!==-1)&&t({id:E,styleId:C,adds:[{rule:y,index:S}]}),h.apply(g,m)})}),r.CSSStyleSheet.prototype.addRule=function(h,g,m=this.cssRules.length){const y=`${h} { ${g} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[y,m])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:vt((h,g,m)=>{const[y]=m,{id:S,styleId:E}=Sa(g,e,n.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,removes:[{index:y}]}),h.apply(g,m)})}),r.CSSStyleSheet.prototype.removeRule=function(h){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[h])};let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:vt((h,g,m)=>{const[y]=m,{id:S,styleId:E}=Sa(g,e,n.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,replace:y}),h.apply(g,m)})}));let u;r.CSSStyleSheet.prototype.replaceSync&&(u=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:vt((h,g,m)=>{const[y]=m,{id:S,styleId:E}=Sa(g,e,n.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,replaceSync:y}),h.apply(g,m)})}));const c={};jm("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(jm("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),jm("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),jm("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const f={};return Object.entries(c).forEach(([h,g])=>{f[h]={insertRule:g.prototype.insertRule,deleteRule:g.prototype.deleteRule},g.prototype.insertRule=new Proxy(f[h].insertRule,{apply:vt((m,y,S)=>{const[E,C]=S,{id:w,styleId:T}=Sa(y.parentStyleSheet,e,n.styleMirror);return(w&&w!==-1||T&&T!==-1)&&t({id:w,styleId:T,adds:[{rule:E,index:[...fy(y),C||0]}]}),m.apply(y,S)})}),g.prototype.deleteRule=new Proxy(f[h].deleteRule,{apply:vt((m,y,S)=>{const[E]=S,{id:C,styleId:w}=Sa(y.parentStyleSheet,e,n.styleMirror);return(C&&C!==-1||w&&w!==-1)&&t({id:C,styleId:w,removes:[{index:[...fy(y),E]}]}),m.apply(y,S)})})}),vt(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=o,a&&(r.CSSStyleSheet.prototype.replace=a),u&&(r.CSSStyleSheet.prototype.replaceSync=u),Object.entries(c).forEach(([h,g])=>{g.prototype.insertRule=f[h].insertRule,g.prototype.deleteRule=f[h].deleteRule})})}function WB({mirror:t,stylesheetManager:e},n){var r,s,o;let a=null;n.nodeName==="#document"?a=t.getId(n):a=t.getId(rt.host(n));const u=n.nodeName==="#document"?(r=n.defaultView)==null?void 0:r.Document:(o=(s=n.ownerDocument)==null?void 0:s.defaultView)==null?void 0:o.ShadowRoot,c=u?.prototype?Object.getOwnPropertyDescriptor(u?.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!u||!c?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var f;return(f=c.get)==null?void 0:f.call(this)},set(f){var h;const g=(h=c.set)==null?void 0:h.call(this,f);if(a!==null&&a!==-1)try{e.adoptStyleSheets(f,a)}catch{}return g}}),vt(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))}function DCe({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:vt((u,c,f)=>{var h;const[g,m,y]=f;if(n.has(g))return o.apply(c,[g,m,y]);const{id:S,styleId:E}=Sa((h=c.parentRule)==null?void 0:h.parentStyleSheet,e,r.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,set:{property:g,value:m,priority:y},index:fy(c.parentRule)}),u.apply(c,f)})});const a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:vt((u,c,f)=>{var h;const[g]=f;if(n.has(g))return a.apply(c,[g]);const{id:m,styleId:y}=Sa((h=c.parentRule)==null?void 0:h.parentStyleSheet,e,r.styleMirror);return(m&&m!==-1||y&&y!==-1)&&t({id:m,styleId:y,remove:{property:g},index:fy(c.parentRule)}),u.apply(c,f)})}),vt(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a})}function LCe({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:r,sampling:s,doc:o}){const a=vt(c=>Zh(vt(f=>{const h=yp(f);if(!h||wr(h,e,n,!0))return;const{currentTime:g,volume:m,muted:y,playbackRate:S,loop:E}=h;t({type:c,id:r.getId(h),currentTime:g,volume:m,muted:y,playbackRate:S,loop:E})}),s.media||500)),u=[Cr("play",a(wc.Play),o),Cr("pause",a(wc.Pause),o),Cr("seeked",a(wc.Seeked),o),Cr("volumechange",a(wc.VolumeChange),o),Cr("ratechange",a(wc.RateChange),o)];return vt(()=>{u.forEach(c=>c())})}function UCe({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,o=n.FontFace;n.FontFace=function(c,f,h){const g=new o(c,f,h);return s.set(g,{family:c,buffer:typeof f!="string",descriptors:h,fontSource:typeof f=="string"?f:JSON.stringify(Array.from(new Uint8Array(f)))}),g};const a=mu(e.fonts,"add",function(u){return function(c){return setTimeout(vt(()=>{const f=s.get(c);f&&(t(f),s.delete(c))}),0),u.apply(this,[c])}});return r.push(()=>{n.FontFace=o}),r.push(a),vt(()=>{r.forEach(u=>u())})}function FCe(t){const{doc:e,mirror:n,blockClass:r,blockSelector:s,selectionCb:o}=t;let a=!0;const u=vt(()=>{const c=e.getSelection();if(!c||a&&c?.isCollapsed)return;a=c.isCollapsed||!1;const f=[],h=c.rangeCount||0;for(let g=0;g<h;g++){const m=c.getRangeAt(g),{startContainer:y,startOffset:S,endContainer:E,endOffset:C}=m;wr(y,r,s,!0)||wr(E,r,s,!0)||f.push({start:n.getId(y),startOffset:S,end:n.getId(E),endOffset:C})}o({ranges:f})});return u(),Cr("selectionchange",u)}function zCe({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:mu(n.customElements,"define",function(s){return function(o,a,u){try{e({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return s.apply(this,[o,a,u])}})}function jCe(t,e){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:a,inputCb:u,mediaInteractionCb:c,styleSheetRuleCb:f,styleDeclarationCb:h,canvasMutationCb:g,fontCb:m,selectionCb:y,customElementCb:S}=t;t.mutationCb=(...E)=>{e.mutation&&e.mutation(...E),n(...E)},t.mousemoveCb=(...E)=>{e.mousemove&&e.mousemove(...E),r(...E)},t.mouseInteractionCb=(...E)=>{e.mouseInteraction&&e.mouseInteraction(...E),s(...E)},t.scrollCb=(...E)=>{e.scroll&&e.scroll(...E),o(...E)},t.viewportResizeCb=(...E)=>{e.viewportResize&&e.viewportResize(...E),a(...E)},t.inputCb=(...E)=>{e.input&&e.input(...E),u(...E)},t.mediaInteractionCb=(...E)=>{e.mediaInteaction&&e.mediaInteaction(...E),c(...E)},t.styleSheetRuleCb=(...E)=>{e.styleSheetRule&&e.styleSheetRule(...E),f(...E)},t.styleDeclarationCb=(...E)=>{e.styleDeclaration&&e.styleDeclaration(...E),h(...E)},t.canvasMutationCb=(...E)=>{e.canvasMutation&&e.canvasMutation(...E),g(...E)},t.fontCb=(...E)=>{e.font&&e.font(...E),m(...E)},t.selectionCb=(...E)=>{e.selection&&e.selection(...E),y(...E)},t.customElementCb=(...E)=>{e.customElement&&e.customElement(...E),S(...E)}}function BCe(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};jCe(t,e);let r;t.recordDOM&&(r=HB(t,t.doc));const s=ICe(t),o=OCe(t),a=qB(t),u=NCe(t,{win:n}),c=PCe(t),f=LCe(t);let h=()=>{},g=()=>{},m=()=>{},y=()=>{};t.recordDOM&&(h=kCe(t,{win:n}),g=WB(t,t.doc),m=DCe(t,{win:n}),t.collectFonts&&(y=UCe(t)));const S=FCe(t),E=zCe(t),C=[];for(const w of t.plugins)C.push(w.observer(w.callback,n,w.options));return vt(()=>{Nl.forEach(w=>w.reset()),r?.disconnect(),s(),o(),a(),u(),c(),f(),h(),g(),m(),y(),S(),E(),C.forEach(w=>w())})}function zm(t){return typeof window[t]<"u"}function jm(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class v5{constructor(e){Se(this,"iframeIdToRemoteIdMap",new WeakMap),Se(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,n,r,s){const o=r||this.getIdToRemoteIdMap(e),a=s||this.getRemoteIdToIdMap(e);let u=o.get(n);return u||(u=this.generateIdFn(),o.set(n,u),a.set(u,n)),u}getIds(e,n){const r=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return n.map(o=>this.getId(e,o,r,s))}getRemoteId(e,n,r){const s=r||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;const o=s.get(n);return o||-1}getRemoteIds(e,n){const r=this.getRemoteIdToIdMap(e);return n.map(s=>this.getRemoteId(e,s,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}}class $Ce{constructor(e){Se(this,"iframes",new WeakMap),Se(this,"crossOriginIframeMap",new WeakMap),Se(this,"crossOriginIframeMirror",new v5(aj)),Se(this,"crossOriginIframeStyleMirror"),Se(this,"crossOriginIframeRootIdMap",new WeakMap),Se(this,"mirror"),Se(this,"mutationCb"),Se(this,"wrappedEmit"),Se(this,"loadListener"),Se(this,"stylesheetManager"),Se(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new v5(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){var r,s;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;const s=this.crossOriginIframeMap.get(e.source);if(!s)return;const o=this.transformCrossOriginEvent(s,n.data.event);o&&this.wrappedEmit(o,n.data.isCheckout)}transformCrossOriginEvent(e,n){var r;switch(n.type){case wt.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);const s=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,s),this.patchRootIdOnNode(n.data.node,s),{timestamp:n.timestamp,type:wt.IncrementalSnapshot,data:{source:ft.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case wt.Meta:case wt.Load:case wt.DomContentLoaded:return!1;case wt.Plugin:return n;case wt.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case wt.IncrementalSnapshot:switch(n.data.source){case ft.Mutation:return n.data.adds.forEach(s=>{this.replaceIds(s,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,e);const o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(s.node,o)}),n.data.removes.forEach(s=>{this.replaceIds(s,e,["parentId","id"])}),n.data.attributes.forEach(s=>{this.replaceIds(s,e,["id"])}),n.data.texts.forEach(s=>{this.replaceIds(s,e,["id"])}),n;case ft.Drag:case ft.TouchMove:case ft.MouseMove:return n.data.positions.forEach(s=>{this.replaceIds(s,e,["id"])}),n;case ft.ViewportResize:return!1;case ft.MediaInteraction:case ft.MouseInteraction:case ft.Scroll:case ft.CanvasMutation:case ft.Input:return this.replaceIds(n.data,e,["id"]),n;case ft.StyleSheetRule:case ft.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case ft.Font:return n;case ft.Selection:return n.data.ranges.forEach(s=>{this.replaceIds(s,e,["start","end"])}),n;case ft.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),(r=n.data.styles)==null||r.forEach(s=>{this.replaceStyleIds(s,e,["styleId"])}),n}}return!1}replace(e,n,r,s){for(const o of s)!Array.isArray(n[o])&&typeof n[o]!="number"||(Array.isArray(n[o])?n[o]=e.getIds(r,n[o]):n[o]=e.getId(r,n[o]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(e,n){e.type!==BB.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class HCe{constructor(e){Se(this,"shadowDoms",new WeakSet),Se(this,"mutationCb"),Se(this,"scrollCb"),Se(this,"bypassOptions"),Se(this,"mirror"),Se(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!Sh(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=HB({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(qB({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(rt.host(e))),this.restoreHandlers.push(WB({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,n){const r=this;this.restoreHandlers.push(mu(e.prototype,"attachShadow",function(s){return function(o){const a=s.call(this,o),u=rt.shadowRoot(this);return u&&jB(this)&&r.addShadowRoot(u,n),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Pc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qCe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Bm=0;Bm<Pc.length;Bm++)qCe[Pc.charCodeAt(Bm)]=Bm;var WCe=function(t){var e=new Uint8Array(t),n,r=e.length,s="";for(n=0;n<r;n+=3)s+=Pc[e[n]>>2],s+=Pc[(e[n]&3)<<4|e[n+1]>>4],s+=Pc[(e[n+1]&15)<<2|e[n+2]>>6],s+=Pc[e[n+2]&63];return r%3===2?s=s.substring(0,s.length-1)+"=":r%3===1&&(s=s.substring(0,s.length-2)+"=="),s};const y5=new Map;function VCe(t,e){let n=y5.get(t);return n||(n=new Map,y5.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}const VB=(t,e,n)=>{if(!t||!(KB(t,e)||typeof t=="object"))return;const r=t.constructor.name,s=VCe(n,r);let o=s.indexOf(t);return o===-1&&(o=s.length,s.push(t)),o};function yv(t,e,n){if(t instanceof Array)return t.map(r=>yv(r,e,n));if(t===null)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){const r=t.constructor.name,s=WCe(t);return{rr_type:r,base64:s}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[yv(t.buffer,e,n),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const r=t.constructor.name,{src:s}=t;return{rr_type:r,src:s}}else if(t instanceof HTMLCanvasElement){const r="HTMLImageElement",s=t.toDataURL();return{rr_type:r,src:s}}else{if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[yv(t.data,e,n),t.width,t.height]};if(KB(t,e)||typeof t=="object"){const r=t.constructor.name,s=VB(t,e,n);return{rr_type:r,index:s}}}}return t}const GB=(t,e,n)=>t.map(r=>yv(r,e,n)),KB=(t,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof e[s]=="function").find(s=>t instanceof e[s]);function GCe(t,e,n,r){const s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of o)try{if(typeof e.CanvasRenderingContext2D.prototype[a]!="function")continue;const u=mu(e.CanvasRenderingContext2D.prototype,a,function(c){return function(...f){return wr(this.canvas,n,r,!0)||setTimeout(()=>{const h=GB(f,e,this);t(this.canvas,{type:ed["2D"],property:a,args:h})},0),c.apply(this,f)}});s.push(u)}catch{const u=zb(e.CanvasRenderingContext2D.prototype,a,{set(c){t(this.canvas,{type:ed["2D"],property:a,args:[c],setter:!0})}});s.push(u)}return()=>{s.forEach(a=>a())}}function KCe(t){return t==="experimental-webgl"?"webgl":t}function b5(t,e,n,r){const s=[];try{const o=mu(t.HTMLCanvasElement.prototype,"getContext",function(a){return function(u,...c){if(!wr(this,e,n,!0)){const f=KCe(u);if("__context"in this||(this.__context=f),r&&["webgl","webgl2"].includes(f))if(c[0]&&typeof c[0]=="object"){const h=c[0];h.preserveDrawingBuffer||(h.preserveDrawingBuffer=!0)}else c.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[u,...c])}});s.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(o=>o())}}function S5(t,e,n,r,s,o){const a=[],u=Object.getOwnPropertyNames(t);for(const c of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof t[c]!="function")continue;const f=mu(t,c,function(h){return function(...g){const m=h.apply(this,g);if(VB(m,o,this),"tagName"in this.canvas&&!wr(this.canvas,r,s,!0)){const y=GB(g,o,this),S={type:e,property:c,args:y};n(this.canvas,S)}return m}});a.push(f)}catch{const f=zb(t,c,{set(h){n(this.canvas,{type:e,property:c,args:[h],setter:!0})}});a.push(f)}return a}function YCe(t,e,n,r){const s=[];return s.push(...S5(e.WebGLRenderingContext.prototype,ed.WebGL,t,n,r,e)),typeof e.WebGL2RenderingContext<"u"&&s.push(...S5(e.WebGL2RenderingContext.prototype,ed.WebGL2,t,n,r,e)),()=>{s.forEach(o=>o())}}const YB="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",ZCe=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),E5=typeof window<"u"&&window.Blob&&new Blob([ZCe(YB)],{type:"text/javascript;charset=utf-8"});function XCe(t){let e;try{if(e=E5&&(window.URL||window.webkitURL).createObjectURL(E5),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),n}catch{return new Worker("data:text/javascript;base64,"+YB,{name:t?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class QCe{constructor(e){Se(this,"pendingCanvasMutations",new Map),Se(this,"rafStamps",{latestId:0,invokeId:null}),Se(this,"mirror"),Se(this,"mutationCb"),Se(this,"resetObservers"),Se(this,"frozen",!1),Se(this,"locked",!1),Se(this,"processMutation",(c,f)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(f)});const{sampling:n="all",win:r,blockClass:s,blockSelector:o,recordCanvas:a,dataURLOptions:u}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&n==="all"&&this.initCanvasMutationObserver(r,s,o),a&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,s,o,{dataURLOptions:u})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,n,r,s,o){const a=b5(n,r,s,!0),u=new Map,c=new XCe;c.onmessage=S=>{const{id:E}=S.data;if(u.set(E,!1),!("base64"in S.data))return;const{base64:C,type:w,width:T,height:x}=S.data;this.mutationCb({id:E,type:ed["2D"],commands:[{property:"clearRect",args:[0,0,T,x]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:C}],type:w}]},0,0]}]})};const f=1e3/e;let h=0,g;const m=()=>{const S=[];return n.document.querySelectorAll("canvas").forEach(E=>{wr(E,r,s,!0)||S.push(E)}),S},y=S=>{if(h&&S-h<f){g=requestAnimationFrame(y);return}h=S,m().forEach(async E=>{var C;const w=this.mirror.getId(E);if(u.get(w)||E.width===0||E.height===0)return;if(u.set(w,!0),["webgl","webgl2"].includes(E.__context)){const x=E.getContext(E.__context);((C=x?.getContextAttributes())==null?void 0:C.preserveDrawingBuffer)===!1&&x.clear(x.COLOR_BUFFER_BIT)}const T=await createImageBitmap(E);c.postMessage({id:w,bitmap:T,width:E.width,height:E.height,dataURLOptions:o.dataURLOptions},[T])}),g=requestAnimationFrame(y)};g=requestAnimationFrame(y),this.resetObservers=()=>{a(),cancelAnimationFrame(g)}}initCanvasMutationObserver(e,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=b5(e,n,r,!1),o=GCe(this.processMutation.bind(this),e,n,r),a=YCe(this.processMutation.bind(this),e,n,r);this.resetObservers=()=>{s(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=n=>{this.rafStamps.latestId=n,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||n===-1)return;const s=r.map(a=>{const{type:u,...c}=a;return c}),{type:o}=r[0];this.mutationCb({id:n,type:o,commands:s}),this.pendingCanvasMutations.delete(e)}}class JCe{constructor(e){Se(this,"trackedLinkElements",new WeakSet),Se(this,"mutationCb"),Se(this,"adoptedStyleSheetCb"),Se(this,"styleMirror",new SCe),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;const r={id:n,styleIds:[]},s=[];for(const o of e){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),s.push({styleId:a,rules:Array.from(o.rules||CSSRule,(u,c)=>({rule:sj(u,o.href),index:c}))})),r.styleIds.push(a)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class ewe{constructor(){Se(this,"nodeMap",new WeakMap),Se(this,"active",!1)}inOtherBuffer(e,n){const r=this.nodeMap.get(e);return r&&Array.from(r).some(s=>s!==n)}add(e,n){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}destroy(){}}let mn,bv,Ox,hy=!1;try{if(Array.from([1],t=>t*2)[0]!==2){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=((x4=t.contentWindow)==null?void 0:x4.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}const $s=n0e();function bp(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:c="rr-mask",maskTextSelector:f=null,inlineStylesheet:h=!0,maskAllInputs:g,maskInputOptions:m,slimDOMOptions:y,maskInputFn:S,maskTextFn:E,hooks:C,packFn:w,sampling:T={},dataURLOptions:x={},mousemoveWait:R,recordDOM:M=!0,recordCanvas:N=!1,recordCrossOriginIframes:O=!1,recordAfter:k=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:F=!1,collectFonts:H=!1,inlineImages:D=!1,plugins:z,keepIframeSrcFn:q=()=>!1,ignoreCSSAttributes:K=new Set([]),errorHandler:ee}=t;TCe(ee);const $=O?window.parent===window:!0;let te=!1;if(!$)try{window.parent.document&&(te=!1)}catch{te=!0}if($&&!e)throw new Error("emit function is required");if(!$&&!te)return()=>{};R!==void 0&&T.mousemove===void 0&&(T.mousemove=R),$s.reset();const fe=g===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:m!==void 0?m:{password:!0},ae=dj(y);bCe();let xe,L=0;const G=Ee=>{for(const pt of z||[])pt.eventProcessor&&(Ee=pt.eventProcessor(Ee));return w&&!te&&(Ee=w(Ee)),Ee};mn=(Ee,pt)=>{var Ce;const je=Ee;if(je.timestamp=dy(),(Ce=Nl[0])!=null&&Ce.isFrozen()&&je.type!==wt.FullSnapshot&&!(je.type===wt.IncrementalSnapshot&&je.data.source===ft.Mutation)&&Nl.forEach(Be=>Be.unfreeze()),$)e?.(G(je),pt);else if(te){const Be={type:"rrweb",event:G(je),origin:window.location.origin,isCheckout:pt};window.parent.postMessage(Be,"*")}if(je.type===wt.FullSnapshot)xe=je,L=0;else if(je.type===wt.IncrementalSnapshot){if(je.data.source===ft.Mutation&&je.data.isAttachIframe)return;L++;const Be=r&&L>=r,He=n&&je.timestamp-xe.timestamp>n;(Be||He)&&bv(!0)}};const Y=Ee=>{mn({type:wt.IncrementalSnapshot,data:{source:ft.Mutation,...Ee}})},J=Ee=>mn({type:wt.IncrementalSnapshot,data:{source:ft.Scroll,...Ee}}),oe=Ee=>mn({type:wt.IncrementalSnapshot,data:{source:ft.CanvasMutation,...Ee}}),he=Ee=>mn({type:wt.IncrementalSnapshot,data:{source:ft.AdoptedStyleSheet,...Ee}}),ce=new JCe({mutationCb:Y,adoptedStyleSheetCb:he}),ve=new $Ce({mirror:$s,mutationCb:Y,stylesheetManager:ce,recordCrossOriginIframes:O,wrappedEmit:mn});for(const Ee of z||[])Ee.getMirror&&Ee.getMirror({nodeMirror:$s,crossOriginIframeMirror:ve.crossOriginIframeMirror,crossOriginIframeStyleMirror:ve.crossOriginIframeStyleMirror});const _e=new ewe;Ox=new QCe({recordCanvas:N,mutationCb:oe,win:window,blockClass:s,blockSelector:o,mirror:$s,sampling:T.canvas,dataURLOptions:x});const Xe=new HCe({mutationCb:Y,scrollCb:J,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:f,inlineStylesheet:h,maskInputOptions:fe,dataURLOptions:x,maskTextFn:E,maskInputFn:S,recordCanvas:N,inlineImages:D,sampling:T,slimDOMOptions:ae,iframeManager:ve,stylesheetManager:ce,canvasManager:Ox,keepIframeSrcFn:q,processedNodeManager:_e},mirror:$s});bv=(Ee=!1)=>{if(!M)return;mn({type:wt.Meta,data:{href:window.location.href,width:kB(),height:PB()}},Ee),ce.reset(),Xe.init(),Nl.forEach(Ce=>Ce.lock());const pt=A0e(document,{mirror:$s,blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:f,inlineStylesheet:h,maskAllInputs:fe,maskTextFn:E,maskInputFn:S,slimDOM:ae,dataURLOptions:x,recordCanvas:N,inlineImages:D,onSerialize:Ce=>{UB(Ce,$s)&&ve.addIframe(Ce),FB(Ce,$s)&&ce.trackLinkElement(Ce),CA(Ce)&&Xe.addShadowRoot(rt.shadowRoot(Ce),document)},onIframeLoad:(Ce,je)=>{ve.attachIframe(Ce,je),Xe.observeAttachShadow(Ce)},onStylesheetLoad:(Ce,je)=>{ce.attachLinkElement(Ce,je)},keepIframeSrcFn:q});if(!pt)return console.warn("Failed to snapshot the document");mn({type:wt.FullSnapshot,data:{node:pt,initialOffset:MB(window)}},Ee),Nl.forEach(Ce=>Ce.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ce.adoptStyleSheets(document.adoptedStyleSheets,$s.getId(document))};try{const Ee=[],pt=je=>{var Be;return vt(BCe)({mutationCb:Y,mousemoveCb:(He,gr)=>mn({type:wt.IncrementalSnapshot,data:{source:gr,positions:He}}),mouseInteractionCb:He=>mn({type:wt.IncrementalSnapshot,data:{source:ft.MouseInteraction,...He}}),scrollCb:J,viewportResizeCb:He=>mn({type:wt.IncrementalSnapshot,data:{source:ft.ViewportResize,...He}}),inputCb:He=>mn({type:wt.IncrementalSnapshot,data:{source:ft.Input,...He}}),mediaInteractionCb:He=>mn({type:wt.IncrementalSnapshot,data:{source:ft.MediaInteraction,...He}}),styleSheetRuleCb:He=>mn({type:wt.IncrementalSnapshot,data:{source:ft.StyleSheetRule,...He}}),styleDeclarationCb:He=>mn({type:wt.IncrementalSnapshot,data:{source:ft.StyleDeclaration,...He}}),canvasMutationCb:oe,fontCb:He=>mn({type:wt.IncrementalSnapshot,data:{source:ft.Font,...He}}),selectionCb:He=>{mn({type:wt.IncrementalSnapshot,data:{source:ft.Selection,...He}})},customElementCb:He=>{mn({type:wt.IncrementalSnapshot,data:{source:ft.CustomElement,...He}})},blockClass:s,ignoreClass:a,ignoreSelector:u,maskTextClass:c,maskTextSelector:f,maskInputOptions:fe,inlineStylesheet:h,sampling:T,recordDOM:M,recordCanvas:N,inlineImages:D,userTriggeredOnInput:F,collectFonts:H,doc:je,maskInputFn:S,maskTextFn:E,keepIframeSrcFn:q,blockSelector:o,slimDOMOptions:ae,dataURLOptions:x,mirror:$s,iframeManager:ve,stylesheetManager:ce,shadowDomManager:Xe,processedNodeManager:_e,canvasManager:Ox,ignoreCSSAttributes:K,plugins:((Be=z?.filter(He=>He.observer))==null?void 0:Be.map(He=>({observer:He.observer,options:He.options,callback:gr=>mn({type:wt.Plugin,data:{plugin:He.name,payload:gr}})})))||[]},C)};ve.addLoadListener(je=>{try{Ee.push(pt(je.contentDocument))}catch(Be){console.warn(Be)}});const Ce=()=>{bv(),Ee.push(pt(document)),hy=!0};return["interactive","complete"].includes(document.readyState)?Ce():(Ee.push(Cr("DOMContentLoaded",()=>{mn({type:wt.DomContentLoaded,data:{}}),k==="DOMContentLoaded"&&Ce()})),Ee.push(Cr("load",()=>{mn({type:wt.Load,data:{}}),k==="load"&&Ce()},window))),()=>{Ee.forEach(je=>{try{je()}catch(Be){String(Be).toLowerCase().includes("cross-origin")||console.warn(Be)}}),_e.destroy(),hy=!1,RCe()}}catch(Ee){console.warn(Ee)}}bp.addCustomEvent=(t,e)=>{if(!hy)throw new Error("please add custom event after start recording");mn({type:wt.Custom,data:{tag:t,payload:e}})};bp.freezePage=()=>{Nl.forEach(t=>t.freeze())};bp.takeFullSnapshot=t=>{if(!hy)throw new Error("please take full snapshot after start recording");bv(t)};bp.mirror=$s;var C5;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(C5||(C5={}));const twe="rrweb",nwe={maskAllInputs:!0,maskTextSelector:"*",maskInputOptions:void 0},rwe={additionalSampleRate:1,batchSize:50,flushInterval:5e3,recordOptions:{slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,recordCrossOriginIframes:!1}},w5=rwe;class swe extends Ms{constructor(e){super(twe),this.recordingEvents=[],this.isRecording=!1,this.recordingStartTime=null,this.flushTimer=null,this.stopRecording=null,this.enabled=!1;const n=Object.assign(Object.assign(Object.assign({},w5.recordOptions),e?.recordOptions),nwe);this.config=Object.assign(Object.assign(Object.assign({},w5),e),{recordOptions:n}),be.info("RRWebPlugin initialized",{additionalSampleRate:this.config.additionalSampleRate,batchSize:this.config.batchSize,flushInterval:this.config.flushInterval})}enable(){var e;if(this.enabled){be.info("RRWebPlugin already enabled");return}const n=(e=this.context)===null||e===void 0?void 0:e.getSession();if(!n||!n.record){be.warn("RRWebPlugin skipping - session not being recorded",{hasSession:!!n,sessionRecord:n?.record});return}const r=Math.random();if(r>this.config.additionalSampleRate){be.warn("RRWebPlugin skipping - session replay additionalSampleRate",{randomValue:r,samplingRate:this.config.additionalSampleRate});return}this.enabled=!0,be.info("RRWebPlugin enabled - starting recording"),this.startRecording()}disable(){if(!this.enabled){be.info("RRWebPlugin already disabled");return}be.info("RRWebPlugin disabled - stopping recording"),this.enabled=!1,this.stopCurrentRecording()}record(e){const n=e?.action;n==="start"?(be.info("RRWebPlugin manual start recording"),this.startRecording()):n==="stop"&&(be.info("RRWebPlugin manual stop recording"),this.stopCurrentRecording())}onload(){}startRecording(){this.recordingStartTime=Date.now(),this.recordingEvents=[],this.isRecording=!0,be.info("RRWebPlugin starting rrweb recording",{startTime:this.recordingStartTime});const e=bp(Object.assign(Object.assign({},this.config.recordOptions),{emit:this.handleRRWebEvent.bind(this)}));e?(this.stopRecording=e,be.info("RRWebPlugin rrweb recording initialized successfully")):be.warn("RRWebPlugin failed to initialize rrweb recording"),this.flushTimer=window.setInterval(()=>{this.flush()},this.config.flushInterval)}stopCurrentRecording(){if(!this.isRecording){be.info("RRWebPlugin stopCurrentRecording called but not recording");return}be.info("RRWebPlugin stopping current recording"),this.isRecording=!1,this.stopRecording&&(this.stopRecording(),this.stopRecording=null,be.info("RRWebPlugin rrweb recording stopped")),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null,be.info("RRWebPlugin flush timer cleared")),this.flush()}handleRRWebEvent(e){this.isRecording&&(this.recordingEvents.push(e),this.recordingEvents.length>=this.config.batchSize&&(be.info("RRWebPlugin flushing events due to batch size",{eventCount:this.recordingEvents.length,batchSize:this.config.batchSize}),this.flush()))}flush(){if(this.recordingEvents.length===0){be.info("RRWebPlugin flushEvent called but no events to flush");return}be.info("RRWebPlugin flushing events",{eventCount:this.recordingEvents.length});const e=[...this.recordingEvents],n={version:"1.0.0",events:e,eventCount:e.length};this.context.record(l4,n),be.info("RRWebPlugin events sent to RUM",{eventType:l4,eventCount:this.recordingEvents.length}),this.recordingEvents=[]}}var owe=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n},xA;(function(t){t.Path="PATH",t.Hash="HASH",t.PathAndHash="PATH_AND_HASH"})(xA||(xA={}));const ZB="us-west-2",_A=`https://dataplane.rum.${ZB}.amazonaws.com`,XB=()=>({unique:!1,domain:window.location.hostname,path:"/",sameSite:"Strict",secure:!0}),QB=t=>({allowCookies:!1,batchLimit:100,client:Ive,compressionStrategy:{enabled:!0},cookieAttributes:t,debug:!1,disableAutoPageView:!1,dispatchInterval:5*1e3,enableRumClient:!0,enableXRay:!1,endpoint:_A,endpointUrl:new URL(_A),eventCacheSize:1e3,eventPluginsToLoad:[],pageIdFormat:xA.Path,pagesToExclude:[],pagesToInclude:[/.*/],signing:!1,recordResourceUrl:!0,retries:2,routeChangeComplete:100,routeChangeTimeout:1e4,sessionAttributes:{},sessionEventLimit:200,sessionLengthSeconds:1800,sessionSampleRate:1,suppressSessionStartEvent:!1,useBeacon:!0,userIdRetentionDays:30,enableW3CTraceId:!1,candidatesCacheSize:10});let iwe=class{constructor(e,n,r,s={}){var{cookieAttributes:o}=s,a=owe(s,["cookieAttributes"]);this.eventBus=new $z,typeof r>"u"&&(r="us-west-2"),this.applicationId=e;const u=Object.assign(Object.assign({},XB()),o);this.config=Object.assign(Object.assign({fetchFunction:fetch},QB(u)),a),this.config.sessionId&&(this.config.suppressSessionStartEvent=!0),this.config.endpoint=a.endpoint?a.endpoint:_A.replace(ZB,r),this.config.endpointUrl=new URL(this.config.endpoint),be.configure(this.config.debug),be.info("Initialized RUM Slim"),this.eventCache=new jye({id:e,version:n},this.config,this.eventBus),this.dispatchManager=this.initDispatch(r,e),this.pluginManager=this.initPluginManager(e,n),this.eventCache.setPluginFlushHook(()=>this.pluginManager.flush()),this.config.enableRumClient?this.enable():this.disable()}setAwsCredentials(e){this.dispatchManager.setAwsCredentials(e)}setSigningConfigFactory(e){this.dispatchManager.setSigningConfigFactory(e)}addSessionAttributes(e){this.eventCache.addSessionAttributes(e)}getSessionId(){return this.eventCache.getSessionId()}pinSessionId(e){this.eventCache.pinSessionId(e)}startSession(e){return this.eventCache.startSession(e)}getUserId(){return this.eventCache.getUserId()}pinUserId(e){this.eventCache.pinUserId(e)}setEventMetadataHook(e){this.eventCache.setEventMetadataHook(e)}clearEventMetadataHook(){this.eventCache.clearEventMetadataHook()}addPlugin(e){this.pluginManager.addPlugin(e)}dispatch(){this.dispatchManager.dispatchFetch()}dispatchBeacon(){this.dispatchManager.dispatchBeacon()}enable(){this.eventCache.enable(),this.pluginManager.enable(),this.dispatchManager.enable()}disable(){this.dispatchManager.disable(),this.pluginManager.disable(),this.eventCache.disable()}allowCookies(e){this.config.allowCookies=e}clearCookies(){const e=this.config.cookieAttributes;[Vv,Gv,Gc,`${Vv}_${this.applicationId}`,`${Gv}_${this.applicationId}`,`${Gc}_${this.applicationId}`].forEach(r=>Mye(r,e))}recordPageView(e){this.eventCache.recordPageView(e)}recordError(e){this.pluginManager.record("com.amazonaws.rum.js-error",e)}registerDomEvents(e){this.pluginManager.updatePlugin("com.amazonaws.rum.dom-event",e)}recordEvent(e,n,r){this.eventCache.recordEvent(e,n,r)}initDispatch(e,n){return new Ove(n,e,this.config.endpointUrl,this.eventCache,this.config)}initPluginManager(e,n){const r={applicationId:e,applicationVersion:n,config:this.config,record:this.eventCache.recordEvent,recordCandidate:this.eventCache.recordCandidate,recordPageView:this.eventCache.recordPageView,getSession:this.eventCache.getSession,eventBus:this.eventBus},s=new Nye(r);return this.config.disableAutoPageView||s.addPlugin(new sbe),this.config.eventPluginsToLoad.forEach(o=>{s.addPlugin(o)}),s}};var Ys;(function(t){t.Errors="errors",t.Performance="performance",t.Interaction="interaction",t.Http="http",t.Replay="replay"})(Ys||(Ys={}));var x5;(function(t){t.Path="PATH",t.Hash="HASH",t.PathAndHash="PATH_AND_HASH"})(x5||(x5={}));const awe=t=>Object.assign(Object.assign({},QB(t)),{signing:!0,telemetries:[Ys.Errors,Ys.Performance,Ys.Http,Ys.Replay]});class lwe extends iwe{constructor(e,n,r,s={}){super(e,n,r,Object.assign(Object.assign({},awe(XB())),s)),be.info(`RUM client initialized for app: ${e}`),be.info(`Telemetries enabled: ${this.config.telemetries.join(", ")||"none"}`)}initDispatch(e,n){const r=super.initDispatch(e,n);return r.setSigningConfigFactory(oye),r.setCognitoCredentialProviderFactory((s,o,a,u)=>{const c={identityPoolId:a,guestRoleArn:u,cookieAttributes:s.cookieAttributes};return a&&u?new Eye(c,o).ChainAnonymousCredentialsProvider:new Cye(c,o).ChainAnonymousCredentialsProvider}),this.config.signing&&this.config.identityPoolId&&r.setCognitoCredentials(this.config.identityPoolId,this.config.guestRoleArn),r}initPluginManager(e,n){const r=super.initPluginManager(e,n);return this.constructBuiltinPlugins().forEach(o=>{r.addPlugin(o)}),r}recordError(e){this.pluginManager.record(Wz,e)}registerDomEvents(e){this.pluginManager.updatePlugin(Hz,e)}constructBuiltinPlugins(){let e=[];const n=this.telemetryFunctor();return this.config.telemetries.forEach(r=>{typeof r=="string"&&n[r.toLowerCase()]?e=[...e,...n[r.toLowerCase()]({})]:Array.isArray(r)&&n[r[0].toLowerCase()]&&(e=[...e,...n[r[0].toLowerCase()](r[1])])}),e}telemetryFunctor(){return{[Ys.Errors]:e=>[new Xye(e)],[Ys.Performance]:e=>[new ebe(e),new ibe(e),new Abe(e)],[Ys.Interaction]:e=>[new OR(e)],[Ys.Http]:e=>[new Nbe(e),new Rbe(e)],[Ys.Replay]:e=>[new swe(e)]}}}const JB={recordPageView:()=>{},recordError:()=>{},recordEvent:()=>{},recordTiming:()=>{}},uwe=/([?&](token|access_token|id_token|authorization)=[^&]*)|\/messages\/[a-z0-9_-]+/gi;function e$(t){return t.replace(uwe,"[redacted]")}function cwe(t){const e=t.indexOf("?"),n=t.indexOf("#"),r=e===-1&&n===-1?t.length:e===-1?n:n===-1?e:Math.min(e,n);return e$(t.slice(0,r))}function dwe(t){const e=e$(t.message);if(e===t.message)return t;const n=new Error(e);return n.name=t.name,n.stack=t.stack,n}function fwe(t){return{recordPageView(e){t.recordPageView(cwe(e))},recordError(e,n){t.recordError(dwe(e)),n&&t.recordEvent("telemetry.error_context",n)},recordEvent(e,n){t.recordEvent(e,n??{})},recordTiming(e,n,r){t.recordEvent("telemetry.timing",{...r,name:e,durationMs:String(n)})}}}function _5(t){return t instanceof Error?t:new Error(String(t))}function hwe(t){window.addEventListener("error",e=>{t.recordError(_5(e.error??e.message))}),window.addEventListener("unhandledrejection",e=>{t.recordError(_5(e.reason))})}function pwe(){const{appMonitorId:t,identityPoolId:e,region:n}=Dy().rum;if(!t)return JB;const r=new lwe(t,"1.0.0",n,{sessionSampleRate:1,identityPoolId:e,endpoint:`https://dataplane.rum.${n}.amazonaws.com`,telemetries:["performance"],disableAutoPageView:!0,allowCookies:!1,enableXRay:!1}),s=fwe(r);return hwe(s),s}const t$=_.createContext(JB);function wIe(){return _.useContext(t$)}const AA="remit.theme",gwe="dark";function A5(){return typeof localStorage>"u"?"system":localStorage.getItem(AA)??"system"}function TA(t){if(typeof document>"u")return;const e=t==="dark"||t==="system"&&typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.classList.toggle(gwe,e)}function xIe(t){typeof localStorage<"u"&&(t==="system"?localStorage.removeItem(AA):localStorage.setItem(AA,t)),TA(t)}const mwe=()=>{if(typeof window>"u"||(TA(A5()),typeof window.matchMedia!="function"))return;const t=window.matchMedia("(prefers-color-scheme: dark)"),e=()=>{TA(A5())};typeof t.addEventListener=="function"?t.addEventListener("change",e):t.addListener(e)},vwe=(t,e,n,r)=>{const s=[n,{code:e,...r||{}}];if(t?.services?.logger?.forward)return t.services.logger.forward(s,"warn","react-i18next::",!0);Bl(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),t?.services?.logger?.warn?t.services.logger.warn(...s):console?.warn&&console.warn(...s)},T5={},RA=(t,e,n,r)=>{Bl(n)&&T5[n]||(Bl(n)&&(T5[n]=new Date),vwe(t,e,n,r))},n$=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},IA=(t,e,n)=>{t.loadNamespaces(e,n$(t,n))},R5=(t,e,n,r)=>{if(Bl(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return IA(t,n,r);n.forEach(s=>{t.options.ns.indexOf(s)<0&&t.options.ns.push(s)}),t.loadLanguages(e,n$(t,r))},ywe=(t,e,n={})=>!e.languages||!e.languages.length?(RA(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,s)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,t))return!1}}),Bl=t=>typeof t=="string",bwe=t=>typeof t=="object"&&t!==null,Swe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ewe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Cwe=t=>Ewe[t],wwe=t=>t.replace(Swe,Cwe);let OA={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:wwe};const xwe=(t={})=>{OA={...OA,...t}},_we=()=>OA;let r$;const Awe=t=>{r$=t},Twe=()=>r$,Rwe={type:"3rdParty",init(t){xwe(t.options.react),Awe(t)}},Iwe=_.createContext();class Owe{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Nwe=(t,e)=>{const n=_.useRef();return _.useEffect(()=>{n.current=t},[t,e]),n.current},s$=(t,e,n,r)=>t.getFixedT(e,n,r),Mwe=(t,e,n,r)=>_.useCallback(s$(t,e,n,r),[t,e,n,r]),Pwe=(t,e={})=>{const{i18n:n}=e,{i18n:r,defaultNS:s}=_.useContext(Iwe)||{},o=n||r||Twe();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Owe),!o){RA(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const R=(N,O)=>Bl(O)?O:bwe(O)&&Bl(O.defaultValue)?O.defaultValue:Array.isArray(N)?N[N.length-1]:N,M=[R,{},!1];return M.t=R,M.i18n={},M.ready=!1,M}o.options.react?.wait&&RA(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={..._we(),...o.options.react,...e},{useSuspense:u,keyPrefix:c}=a;let f=t||s||o.options?.defaultNS;f=Bl(f)?[f]:f||["translation"],o.reportNamespaces.addUsedNamespaces?.(f);const h=(o.isInitialized||o.initializedStoreOnce)&&f.every(R=>ywe(R,o,a)),g=Mwe(o,e.lng||null,a.nsMode==="fallback"?f:f[0],c),m=()=>g,y=()=>s$(o,e.lng||null,a.nsMode==="fallback"?f:f[0],c),[S,E]=_.useState(m);let C=f.join();e.lng&&(C=`${e.lng}${C}`);const w=Nwe(C),T=_.useRef(!0);_.useEffect(()=>{const{bindI18n:R,bindI18nStore:M}=a;T.current=!0,!h&&!u&&(e.lng?R5(o,e.lng,f,()=>{T.current&&E(y)}):IA(o,f,()=>{T.current&&E(y)})),h&&w&&w!==C&&T.current&&E(y);const N=()=>{T.current&&E(y)};return R&&o?.on(R,N),M&&o?.store.on(M,N),()=>{T.current=!1,o&&R&&R?.split(" ").forEach(O=>o.off(O,N)),M&&o&&M.split(" ").forEach(O=>o.store.off(O,N))}},[o,C]),_.useEffect(()=>{T.current&&h&&E(m)},[o,c,h]);const x=[S,o,h];if(x.t=S,x.i18n=o,x.ready=h,h||!h&&!u)return x;throw new Promise(R=>{e.lng?R5(o,e.lng,f,()=>R()):IA(o,f,()=>R())})},kwe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts",...t,headers:{"Content-Type":"application/json",...t.headers}}),Dwe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/oauth/microsoft/start",...t,headers:{"Content-Type":"application/json",...t.headers}}),Lwe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/test-connection",...t,headers:{"Content-Type":"application/json",...t.headers}}),Uwe=t=>(t.client??ke).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}",...t}),Fwe=t=>(t.client??ke).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),zwe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters",...t}),jwe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters",...t,headers:{"Content-Type":"application/json",...t.headers}}),Bwe=t=>(t.client??ke).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters/{filterId}",...t}),$we=t=>(t.client??ke).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters/{filterId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),Hwe=t=>(t.client??ke).put({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/folder-roles/{role}",...t,headers:{"Content-Type":"application/json",...t.headers}}),qwe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/labels",...t}),Wwe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/labels",...t,headers:{"Content-Type":"application/json",...t.headers}}),Vwe=t=>(t.client??ke).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/labels/{labelId}",...t}),Gwe=t=>(t.client??ke).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/labels/{labelId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),Kwe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes",...t}),Ywe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes",...t,headers:{"Content-Type":"application/json",...t.headers}}),_Ie=t=>(t.client??ke).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes/{mailboxId}",...t}),Zwe=t=>(t.client??ke).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes/{mailboxId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),Xwe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize",...t,headers:{"Content-Type":"application/json",...t.headers}}),Qwe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize/preview",...t,headers:{"Content-Type":"application/json",...t.headers}}),Jwe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize/{organizeJobId}",...t}),exe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/sync",...t}),txe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/sync/status",...t}),nxe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/addresses/search",...t}),rxe=t=>(t.client??ke).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/addresses/{addressId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),sxe=t=>(t?.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/config",...t}),AIe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/mailboxes/{mailboxId}/threads",...t}),oxe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/mailboxes/{mailboxId}/threads/search",...t}),ixe=t=>(t.client??ke).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/me",...t,headers:{"Content-Type":"application/json",...t.headers}}),axe=t=>(t?.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/me/export",...t}),lxe=t=>(t?.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/me/vip-suggestions",...t}),uxe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/delete",...t,headers:{"Content-Type":"application/json",...t.headers}}),cxe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/flags",...t,headers:{"Content-Type":"application/json",...t.headers}}),dxe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/labels",...t,headers:{"Content-Type":"application/json",...t.headers}}),fxe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/move",...t,headers:{"Content-Type":"application/json",...t.headers}}),hxe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}",...t}),pxe=t=>(t.client??ke).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}/flags",...t,headers:{"Content-Type":"application/json",...t.headers}}),gxe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}/raw",...t}),mxe=t=>(t?.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox",...t}),vxe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox",...t,headers:{"Content-Type":"application/json",...t.headers}}),yxe=t=>(t.client??ke).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t}),bxe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t}),Sxe=t=>(t.client??ke).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),Exe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}/send",...t}),Cxe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/search/semantic",...t}),wxe=t=>(t?.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/system/update",...t}),xxe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/system/update",...t,headers:{"Content-Type":"application/json",...t.headers}}),_xe=t=>(t?.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/threads",...t}),Axe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/threads/{threadId}/messages",...t}),TIe=t=>({mutationFn:async n=>{const{data:r}=await kwe({...t,...n,throwOnError:!0});return r}}),Fn=(t,e,n,r)=>{const s={_id:t,baseUrl:e?.baseUrl||(e?.client??ke).getConfig().baseUrl};return e?.body&&(s.body=e.body),e?.headers&&(s.headers=e.headers),e?.path&&(s.path=e.path),e?.query&&(s.query=e.query),[s]},RIe=t=>({mutationFn:async n=>{const{data:r}=await Dwe({...t,...n,throwOnError:!0});return r}}),IIe=t=>({mutationFn:async n=>{const{data:r}=await Lwe({...t,...n,throwOnError:!0});return r}}),OIe=t=>({mutationFn:async n=>{const{data:r}=await Uwe({...t,...n,throwOnError:!0});return r}}),NIe=t=>({mutationFn:async n=>{const{data:r}=await Fwe({...t,...n,throwOnError:!0});return r}}),Txe=t=>Fn("filterOperationsListFilters",t),MIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await zwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Txe(t)}),PIe=t=>({mutationFn:async n=>{const{data:r}=await jwe({...t,...n,throwOnError:!0});return r}}),kIe=t=>({mutationFn:async n=>{const{data:r}=await Bwe({...t,...n,throwOnError:!0});return r}}),DIe=t=>Fn("filterDetailOperationsGetFilter",t),LIe=t=>({mutationFn:async n=>{const{data:r}=await $we({...t,...n,throwOnError:!0});return r}}),UIe=t=>({mutationFn:async n=>{const{data:r}=await Hwe({...t,...n,throwOnError:!0});return r}}),Rxe=t=>Fn("labelOperationsListLabels",t),FIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await qwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Rxe(t)}),zIe=t=>({mutationFn:async n=>{const{data:r}=await Wwe({...t,...n,throwOnError:!0});return r}}),jIe=t=>({mutationFn:async n=>{const{data:r}=await Vwe({...t,...n,throwOnError:!0});return r}}),BIe=t=>({mutationFn:async n=>{const{data:r}=await Gwe({...t,...n,throwOnError:!0});return r}}),Ixe=t=>Fn("mailboxOperationsListMailboxes",t),$Ie=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Kwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Ixe(t)}),HIe=t=>({mutationFn:async n=>{const{data:r}=await Ywe({...t,...n,throwOnError:!0});return r}}),qIe=t=>({mutationFn:async n=>{const{data:r}=await Zwe({...t,...n,throwOnError:!0});return r}}),WIe=t=>({mutationFn:async n=>{const{data:r}=await Xwe({...t,...n,throwOnError:!0});return r}}),VIe=t=>({mutationFn:async n=>{const{data:r}=await Qwe({...t,...n,throwOnError:!0});return r}}),Oxe=t=>Fn("organizeJobDetailOperationsGetOrganizeJob",t),GIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Jwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Oxe(t)}),KIe=t=>({mutationFn:async n=>{const{data:r}=await exe({...t,...n,throwOnError:!0});return r}}),Nxe=t=>Fn("syncOperationsGetSyncStatus",t),YIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await txe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Nxe(t)}),Mxe=t=>Fn("addressOperationsSearchAddresses",t),ZIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await nxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Mxe(t)}),XIe=t=>({mutationFn:async n=>{const{data:r}=await rxe({...t,...n,throwOnError:!0});return r}}),Pxe=t=>Fn("configOperationsGetConfig",t),kxe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await sxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Pxe(t)}),QIe=t=>Fn("threadOperationsListThreads",t),Dxe=t=>Fn("threadOperationsSearchThreads",t),JIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await oxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Dxe(t)}),e2e=t=>({mutationFn:async n=>{const{data:r}=await ixe({...t,...n,throwOnError:!0});return r}}),t2e=t=>({mutationFn:async n=>{const{data:r}=await axe({...t,...n,throwOnError:!0});return r}}),Lxe=t=>Fn("meOperationsListVipSuggestions",t),n2e=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await lxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Lxe(t)}),r2e=t=>({mutationFn:async n=>{const{data:r}=await uxe({...t,...n,throwOnError:!0});return r}}),s2e=t=>({mutationFn:async n=>{const{data:r}=await cxe({...t,...n,throwOnError:!0});return r}}),o2e=t=>({mutationFn:async n=>{const{data:r}=await dxe({...t,...n,throwOnError:!0});return r}}),i2e=t=>({mutationFn:async n=>{const{data:r}=await fxe({...t,...n,throwOnError:!0});return r}}),Uxe=t=>Fn("messageOperationsDescribeMessage",t),a2e=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await hxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Uxe(t)}),l2e=t=>({mutationFn:async n=>{const{data:r}=await pxe({...t,...n,throwOnError:!0});return r}}),Fxe=t=>Fn("messageOperationsGetRawMessage",t),u2e=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await gxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Fxe(t)}),o$=t=>Fn("outboxOperationsListOutboxMessages",t),c2e=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await mxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:o$(t)}),d2e=t=>({mutationFn:async n=>{const{data:r}=await vxe({...t,...n,throwOnError:!0});return r}}),f2e=t=>({mutationFn:async n=>{const{data:r}=await yxe({...t,...n,throwOnError:!0});return r}}),zxe=t=>Fn("outboxDetailOperationsGetOutboxMessage",t),jxe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await bxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:zxe(t)}),h2e=t=>({mutationFn:async n=>{const{data:r}=await Sxe({...t,...n,throwOnError:!0});return r}}),p2e=t=>({mutationFn:async n=>{const{data:r}=await Exe({...t,...n,throwOnError:!0});return r}}),Bxe=t=>Fn("semanticSearchOperationsSemanticSearch",t),g2e=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Cxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Bxe(t)}),i$=t=>Fn("systemOperationsGetSystemUpdate",t),$xe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await wxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:i$(t)}),Hxe=t=>({mutationFn:async n=>{const{data:r}=await xxe({...t,...n,throwOnError:!0});return r}}),qxe=t=>Fn("unifiedThreadOperationsListAllThreads",t),Wxe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await _xe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:qxe(t)}),Vxe=t=>Fn("threadDetailOperationsListThreadMessages",t),m2e=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Axe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Vxe(t)}),a$=_.createContext(void 0),I5={isOpen:!1,mode:"new"},Gxe=2e3,Kxe=6e4,Yxe=({children:t})=>{const[e,n]=_.useState(I5),[r,s]=_.useState(),o=_.useRef(0),a=vb(),{data:u}=F7({...jxe({path:{outboxMessageId:r??""}}),enabled:!!r,refetchInterval:y=>{const S=y.state.data?.status;return S==="sent"||S==="failed"||S==="blocked"||Date.now()-o.current>Kxe?!1:Gxe}});_.useEffect(()=>{if(!u||!r)return;(u.status==="sent"||u.status==="failed"||u.status==="blocked")&&(s(void 0),a.invalidateQueries({queryKey:o$()}))},[u,r,a]);const c=_.useCallback(y=>{n({...y,isOpen:!0})},[]),f=_.useCallback(()=>{n(I5)},[]),h=_.useCallback(y=>{n(S=>({...S,outboxMessageId:y}))},[]),g=_.useCallback(y=>{o.current=Date.now(),s(y)},[]),m=_.useMemo(()=>({state:e,openCompose:c,closeCompose:f,setOutboxMessageId:h,startSendPolling:g}),[e,c,f,h,g]);return I.jsx(a$.Provider,{value:m,children:t})},v2e=()=>{const t=_.useContext(a$);if(!t)throw new Error("useCompose must be used within a ComposeProvider");return t},cI="remit.self-update.run",Zxe=600,Xxe=300,O5="remit logs",Qxe="https://github.com/remit-mail/reader/releases/tag/",Jxe={checking:"preparing",pulling:"preparing",snapshotting:"preparing",stopping:"restarting",starting:"restarting",verifying:"reconnecting",committing:"reconnecting",rollingBack:"reconnecting",recovering:"reconnecting"};function NA(t){return Jxe[t]??"reconnecting"}function l$(t){const e=au(t);return e===404||e===403||e===401}function u$(t,e){const n=t?.check;if(n?.status==="ok"&&!(!n.updateAvailable||!n.latestVersion))return{version:n.latestVersion,releasedAt:py(n.publishedAt)??e,releaseNotesUrl:n.releaseNotesUrl??d$(n.latestVersion),summary:n.summary??""}}function e_e(t){const e=t?.check.schemaVersion,n=t?.currentSchemaVersion;return e===void 0||n===void 0?!1:e>n}function t_e(){try{const t=localStorage.getItem(cI);if(!t)return null;const e=JSON.parse(t);return r_e(e)?e:null}catch{return null}}function n_e(t){try{localStorage.setItem(cI,JSON.stringify(t))}catch{}}function N5(){try{localStorage.removeItem(cI)}catch{}}function r_e(t){if(!t||typeof t!="object")return!1;const e=t;return typeof e.runId=="string"&&typeof e.attemptedVersion=="string"&&typeof e.previousVersion=="string"&&typeof e.startedAt=="number"}function M5(){return Zxe+Xxe}function c$(t,e){return Math.max(0,Math.floor((e-t)/1e3))}function py(t){if(!t)return;const e=Date.parse(t);return Number.isNaN(e)?void 0:e}function d$(t){return`${Qxe}${t}`}function ah(t,e,n,r,s){return{status:"applying",runId:t,version:e,target:n,phase:r,elapsedSeconds:s}}function s_e(t,e,n){switch(n){case"succeeded":return{status:"succeeded",runId:e.runId,version:e.targetVersion,previousVersion:e.fromVersion,releaseNotesUrl:t.check.releaseNotesUrl??d$(e.targetVersion)};case"rolledBack":return{status:"rolledBack",runId:e.runId,version:e.fromVersion,attemptedVersion:e.targetVersion,reason:e.message,logsCommand:e.logCommand};case"rollbackFailed":return{status:"rollbackFailed",runId:e.runId,attemptedVersion:e.targetVersion,previousVersion:e.fromVersion,reason:e.message,logsCommand:e.logCommand};case"abandoned":return{status:"abandoned",runId:e.runId,version:e.fromVersion,attemptedVersion:e.targetVersion,reason:e.message,logsCommand:e.logCommand};default:return n}}function o_e(t,e,n){const r=t.check;if(e)return{status:"checking",version:t.currentVersion};if(r.status==="failed")return{status:"checkFailed",version:t.currentVersion,reason:r.error??"Remit could not reach the update service.",lastCheckedAt:py(r.lastCheckedAt)};if(r.status==="disabled")return{status:"neverChecked",version:t.currentVersion};const s=u$(t,n);return s?{status:"available",version:t.currentVersion,release:s}:{status:"upToDate",version:t.currentVersion,checkedAt:py(r.lastCheckedAt)??n}}function $m(t,e,n,r){return{surface:{status:"ready",section:t,overlay:e},clearStoredRun:n,releaseHeld:r}}function i_e(t,e,n,r,s){const o=c$(t.startedAt,s),a=e?.currentVersion??t.previousVersion,u=!r&&n!==null&&n.runId===t.runId;if(u&&n!==null&&n.outcome!==null)return null;if(u&&n!==null){const f=NA(n.phase);return $m(ah(n.runId,a,n.targetVersion,f,o),{kind:"applying",target:n.targetVersion,phase:f,elapsedSeconds:o},!1,!1)}if(r){const f=ah(t.runId,t.previousVersion,t.attemptedVersion,"reconnecting",o);return o>M5()?{surface:{status:"ready",section:f,overlay:{kind:"neverCameBack",attemptedVersion:t.attemptedVersion,previousVersion:t.previousVersion,elapsedSeconds:o,logsCommand:O5}},clearStoredRun:!0,releaseHeld:!1}:$m(f,{kind:"applying",target:t.attemptedVersion,phase:"reconnecting",elapsedSeconds:o},!1,!1)}if(e===void 0)return $m(ah(t.runId,a,t.attemptedVersion,"preparing",o),{kind:"applying",target:t.attemptedVersion,phase:"preparing",elapsedSeconds:o},!1,!1);if(o>M5())return{surface:{status:"ready",section:{status:"unreachable",runId:t.runId,previousVersion:t.previousVersion,attemptedVersion:t.attemptedVersion,elapsedSeconds:o,logsCommand:n?.logCommand??O5},overlay:{kind:"none"}},clearStoredRun:!0,releaseHeld:!0};const c=n!==null&&n.outcome===null?NA(n.phase):"preparing";return $m(ah(t.runId,a,t.attemptedVersion,c,o),{kind:"applying",target:t.attemptedVersion,phase:c,elapsedSeconds:o},!1,!1)}function P5(t){const{data:e,isError:n,isFetching:r,dismissedRunId:s,checkRequested:o,now:a}=t;if(n)return{surface:{status:"ready",section:{status:"checkFailed",version:e?.currentVersion??"the current version",reason:"Remit could not reach the update service."},overlay:{kind:"none"}},clearStoredRun:!0};if(!e)return{surface:{status:"loading"},clearStoredRun:!1};const u=e.run,c=u!==null&&s!==null&&u.runId===s;if(u!==null&&!c&&u.outcome!==null)return{surface:{status:"ready",section:s_e(e,u,u.outcome),overlay:{kind:"none"}},clearStoredRun:!0};if(u!==null&&!c&&u.outcome===null){const f=c$(py(u.startedAt)??a,a),h=NA(u.phase);return{surface:{status:"ready",section:ah(u.runId,u.fromVersion,u.targetVersion,h,f),overlay:{kind:"applying",target:u.targetVersion,phase:h,elapsedSeconds:f}},clearStoredRun:!1}}return{surface:{status:"ready",section:o_e(e,o&&r,a),overlay:{kind:"none"}},clearStoredRun:!1}}function a_e(t){const{data:e,isError:n,error:r,held:s,now:o}=t,a=e?.run??null;if(l$(r)&&!s)return{surface:{status:"absent"},clearStoredRun:!0,releaseHeld:!0};if(s){const c=i_e(s,e,a,n,o);return c||{surface:P5(t).surface,clearStoredRun:!0,releaseHeld:!0}}const u=P5(t);return{surface:u.surface,clearStoredRun:u.clearStoredRun,releaseHeld:!1}}const l_e=3e4,u_e=5e3;function c_e(t,e,n){if(l$(t)&&!n)return!1;const r=e!==null&&e.outcome===null;return n||r?u_e:l_e}function d_e(){const t=vb(),[e,n]=_.useState(()=>t_e()),[r,s]=_.useState(null),[o,a]=_.useState(!1),u=_.useRef(e);u.current=e;const c=F7({...$xe(),retry:!1,meta:{softError:!0},refetchInterval:R=>c_e(R.state.error,R.state.data?.run??null,u.current!==null)}),f=a_e({data:c.data,isError:c.isError,error:c.error,isFetching:c.isFetching,held:e,dismissedRunId:r,checkRequested:o,now:Date.now()}),h=_.useRef(null);h.current=f.surface.status==="ready"&&"runId"in f.surface.section?f.surface.section.runId:null;const{clearStoredRun:g,releaseHeld:m}=f;_.useEffect(()=>{g&&N5()},[g]),_.useEffect(()=>{m&&n(R=>R===null?R:null)},[m]),_.useEffect(()=>{o&&!c.isFetching&&a(!1)},[o,c.isFetching]);const{refetch:y}=c,S=_.useCallback(()=>{a(!0),y()},[y]),E=_.useCallback(()=>{y()},[y]),C=_pe({...Hxe(),meta:{softError:!0},onSuccess:R=>{const M=R.run;if(M!==null){const N={runId:M.runId,attemptedVersion:M.targetVersion,previousVersion:M.fromVersion,startedAt:Date.now()};n_e(N),n(N),s(null)}t.setQueryData(i$(),R)},onError:()=>{y()}}),{mutate:w}=C,T=_.useCallback(R=>{w({body:{targetVersion:R}})},[w]),x=_.useCallback(()=>{h.current!==null&&s(h.current),N5(),n(null)},[]);return{surface:f.surface,appliesSchemaMigration:e_e(c.data),currentVersion:c.data?.currentVersion,release:u$(c.data,Date.now()),onCheck:S,install:T,onDismissResult:x,onRetryConnection:E}}const dI=_.createContext(null);function f_e({children:t}){const e=d_e();return _.createElement(dI.Provider,{value:e},t)}function h_e(){const t=_.useContext(dI);if(t===null)throw new Error("useSelfUpdate must be used within a SelfUpdateProvider");return t}function p_e(){return _.useContext(dI)}function g_e(){const{surface:t,onRetryConnection:e}=h_e();if(t.status!=="ready")return null;const{overlay:n}=t;return n.kind==="applying"?I.jsx(gte,{target:n.target,phase:n.phase,elapsedSeconds:n.elapsedSeconds}):n.kind==="neverCameBack"?I.jsx(mte,{attemptedVersion:n.attemptedVersion,previousVersion:n.previousVersion,elapsedSeconds:n.elapsedSeconds,logsCommand:n.logsCommand,onRetryConnection:e}):null}const Nx=(...t)=>Y8(F8(t)),m_e={error:{container:"border-danger/50 bg-danger-soft",icon:"text-danger",title:"text-danger"},warning:{container:"border-warning/50 bg-warning-soft",icon:"text-warning",title:"text-warning"},info:{container:"border-accent-2/50 bg-accent-2-soft",icon:"text-accent-2",title:"text-accent-2"}},v_e={error:cQ,warning:H8,info:pQ},y_e={error:"Error",warning:"Warning",info:"Information"},b_e=({id:t,severity:e,title:n,detail:r,onDismiss:s})=>{const o=m_e[e],a=v_e[e];return I.jsxs("div",{role:e==="error"?"alert":"status","aria-live":e==="error"?"assertive":"polite",className:Nx("pointer-events-auto flex items-start gap-3 rounded-md border bg-canvas px-3 py-2 shadow-lg",o.container),children:[I.jsx(a,{className:Nx("size-5 shrink-0 mt-0.5",o.icon),"aria-hidden":"true"}),I.jsxs("div",{className:"flex-1 min-w-0",children:[I.jsx("p",{className:Nx("text-sm font-medium",o.title),children:n}),r&&I.jsx("p",{className:"mt-0.5 text-xs text-fg-muted break-words",children:r})]}),I.jsx("button",{type:"button",onClick:()=>s(t),className:"shrink-0 rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors","aria-label":`Dismiss ${y_e[e].toLowerCase()}`,children:I.jsx(Ua,{className:"size-4","aria-hidden":"true"})})]})},S_e=({errors:t,onDismiss:e})=>t.length===0?null:I.jsx("section",{"aria-label":"Notifications",className:"pointer-events-none fixed inset-x-0 top-0 z-[60] flex flex-col items-center gap-2 px-4 pt-4 sm:items-end sm:pr-6",children:I.jsx("div",{className:"flex w-full max-w-md flex-col gap-2",children:t.map(n=>I.jsx(b_e,{id:n.id,severity:n.severity,title:n.title,detail:n.detail,onDismiss:e},n.id))})}),k5=5,y2e=(t,e,n)=>({title:t,detail:f$(n)??e,error:n}),f$=t=>{if(t!=null){if(t instanceof Error)return t.message||void 0;if(typeof t=="string")return t||void 0;if(typeof t=="object"&&"message"in t&&typeof t.message=="string")return t.message||void 0}},b2e=t=>{const e=f$(t);return e?e.startsWith("Message not found"):!1},E_e=(t,e,n)=>t.severity===n&&t.title===e.title&&t.detail===e.detail,C_e=(t,e)=>{const r=[...t.filter(s=>!E_e(s,{title:e.title,detail:e.detail,severity:e.severity},e.severity)),e];return r.length<=k5?r:r.slice(r.length-k5)},w_e=(t,e)=>t.filter(n=>n.id!==e),x_e=(t,e,n)=>({id:e,severity:t.severity??"error",title:t.title,detail:t.detail,createdAt:n}),h$=_.createContext(void 0),__e=()=>typeof globalThis.crypto<"u"&&typeof globalThis.crypto.randomUUID=="function"?globalThis.crypto.randomUUID():`banner-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,A_e=({children:t})=>{const[e,n]=_.useState([]),r=_.useCallback(u=>{if(u.error!=null&&D9(u.error))return ql(u.error).correlationId;const c=x_e(u,__e(),Date.now());return n(f=>C_e(f,c)),c.id},[]),s=_.useCallback(u=>{n(c=>w_e(c,u))},[]),o=_.useCallback(()=>{n([])},[]),a=_.useMemo(()=>({errors:e,pushError:r,dismissError:s,clearAll:o}),[e,r,s,o]);return I.jsxs(h$.Provider,{value:a,children:[t,I.jsx(S_e,{errors:e,onDismiss:s})]})},S2e=()=>{const t=_.useContext(h$);if(!t)throw new Error("useErrorBanners must be used within an ErrorBannerProvider");return t},T_e=({error:t,reset:e,info:n})=>{const r=$y(t),s=ql(t,{recoverable:r,componentStack:n?.componentStack});return I.jsx(H9,{fatal:s,onRetry:r?e:void 0})},Sp=Jge()({component:I_e,errorComponent:T_e}),R_e=()=>{const{t}=Pwe("common",{useSuspense:!1});return I.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:z-50 focus:p-4 focus:bg-canvas focus:text-fg focus:rounded-md",children:t("accessibility.skipToContent","Skip to main content")})};function I_e(){return I.jsxs(A_e,{children:[I.jsxs(f_e,{children:[I.jsxs(Yxe,{children:[I.jsx(R_e,{}),I.jsx("main",{id:"main-content",className:"h-dvh overflow-hidden",children:I.jsx(_.Suspense,{fallback:I.jsx(hT,{}),children:I.jsx(gz,{})})})]}),I.jsx(g_e,{})]}),I.jsx($9,{})]})}const O_e=lr("/")({beforeLoad:()=>{throw Y7({to:"/mail"})}});var Rt;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),a={};for(const u of o)a[u]=s[u];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},t.find=(s,o)=>{for(const a of s)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(Rt||(Rt={}));var D5;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(D5||(D5={}));const Oe=Rt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ea=t=>{switch(typeof t){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return Number.isNaN(t)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(t)?Oe.array:t===null?Oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Oe.promise:typeof Map<"u"&&t instanceof Map?Oe.map:typeof Set<"u"&&t instanceof Set?Oe.set:typeof Date<"u"&&t instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},ge=Rt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ai extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,c=0;for(;c<a.path.length;){const f=a.path[c];c===a.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(a))):u[f]=u[f]||{_errors:[]},u=u[f],c++}}};return s(this),r}static assert(e){if(!(e instanceof Ai))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Rt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];n[o]=n[o]||[],n[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ai.create=t=>new Ai(t);const MA=(t,e)=>{let n;switch(t.code){case ge.invalid_type:t.received===Oe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ge.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Rt.jsonStringifyReplacer)}`;break;case ge.unrecognized_keys:n=`Unrecognized key(s) in object: ${Rt.joinValues(t.keys,", ")}`;break;case ge.invalid_union:n="Invalid input";break;case ge.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Rt.joinValues(t.options)}`;break;case ge.invalid_enum_value:n=`Invalid enum value. Expected ${Rt.joinValues(t.options)}, received '${t.received}'`;break;case ge.invalid_arguments:n="Invalid function arguments";break;case ge.invalid_return_type:n="Invalid function return type";break;case ge.invalid_date:n="Invalid date";break;case ge.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Rt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ge.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ge.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ge.custom:n="Invalid input";break;case ge.invalid_intersection_types:n="Intersection results could not be merged";break;case ge.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ge.not_finite:n="Number must be finite";break;default:n=e.defaultError,Rt.assertNever(t)}return{message:n}};let N_e=MA;function M_e(){return N_e}const P_e=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,o=[...n,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let u="";const c=r.filter(f=>!!f).slice().reverse();for(const f of c)u=f(a,{data:e,defaultError:u}).message;return{...s,path:o,message:u}};function Ae(t,e){const n=M_e(),r=P_e({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===MA?void 0:MA].filter(s=>!!s)});t.common.issues.push(r)}class cs{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return Ye;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const o=await s.key,a=await s.value;r.push({key:o,value:a})}return cs.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return Ye;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(r[o.value]=a.value)}return{status:e.value,value:r}}}const Ye=Object.freeze({status:"aborted"}),lh=t=>({status:"dirty",value:t}),Ps=t=>({status:"valid",value:t}),L5=t=>t.status==="aborted",U5=t=>t.status==="dirty",td=t=>t.status==="valid",gy=t=>typeof Promise<"u"&&t instanceof Promise;var Me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Me||(Me={}));class qa{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const F5=(t,e)=>{if(td(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ai(t.common.issues);return this._error=n,this._error}}};function st(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,u)=>{const{message:c}=t;return a.code==="invalid_enum_value"?{message:c??u.defaultError}:typeof u.data>"u"?{message:c??r??u.defaultError}:a.code!=="invalid_type"?{message:u.defaultError}:{message:c??n??u.defaultError}},description:s}}class xt{get description(){return this._def.description}_getType(e){return Ea(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Ea(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new cs,ctx:{common:e.parent.common,data:e.data,parsedType:Ea(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(gy(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ea(e)},s=this._parseSync({data:e,path:r.path,parent:r});return F5(r,s)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ea(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return td(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>td(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ea(e)},s=this._parse({data:e,path:r.path,parent:r}),o=await(gy(s)?s:Promise.resolve(s));return F5(r,o)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const a=e(s),u=()=>o.addIssue({code:ge.custom,...r(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new sd({schema:this,typeName:Ze.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return ka.create(this,this._def)}nullable(){return od.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _o.create(this)}promise(){return by.create(this,this._def)}or(e){return vy.create([this,e],this._def)}and(e){return yy.create(this,e,this._def)}transform(e){return new sd({...st(this._def),schema:this,typeName:Ze.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new kA({...st(this._def),innerType:this,defaultValue:n,typeName:Ze.ZodDefault})}brand(){return new nAe({typeName:Ze.ZodBranded,type:this,...st(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new DA({...st(this._def),innerType:this,catchValue:n,typeName:Ze.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return fI.create(this,e)}readonly(){return LA.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const k_e=/^c[^\s-]{8,}$/i,D_e=/^[0-9a-z]+$/,L_e=/^[0-9A-HJKMNP-TV-Z]{26}$/i,U_e=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,F_e=/^[a-z0-9_-]{21}$/i,z_e=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,j_e=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,B_e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$_e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Mx;const H_e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,q_e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,W_e=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,V_e=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,G_e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,K_e=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,p$="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Y_e=new RegExp(`^${p$}$`);function g$(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Z_e(t){return new RegExp(`^${g$(t)}$`)}function X_e(t){let e=`${p$}T${g$(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Q_e(t,e){return!!((e==="v4"||!e)&&H_e.test(t)||(e==="v6"||!e)&&W_e.test(t))}function J_e(t,e){if(!z_e.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function eAe(t,e){return!!((e==="v4"||!e)&&q_e.test(t)||(e==="v6"||!e)&&V_e.test(t))}class gi extends xt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Oe.string){const o=this._getOrReturnCtx(e);return Ae(o,{code:ge.invalid_type,expected:Oe.string,received:o.parsedType}),Ye}const r=new cs;let s;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=e.data.length>o.value,u=e.data.length<o.value;(a||u)&&(s=this._getOrReturnCtx(e,s),a?Ae(s,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&Ae(s,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")B_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"email",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Mx||(Mx=new RegExp($_e,"u")),Mx.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"emoji",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")U_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"uuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")F_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"nanoid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")k_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"cuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")D_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"cuid2",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")L_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"ulid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),Ae(s,{validation:"url",code:ge.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"regex",code:ge.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?X_e(o).test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?Y_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Z_e(o).test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?j_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"duration",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?Q_e(e.data,o.version)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"ip",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?J_e(e.data,o.alg)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"jwt",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?eAe(e.data,o.version)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"cidr",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?G_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"base64",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?K_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"base64url",code:ge.invalid_string,message:o.message}),r.dirty()):Rt.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:ge.invalid_string,...Me.errToObj(r)})}_addCheck(e){return new gi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Me.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Me.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Me.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Me.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Me.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Me.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Me.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Me.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Me.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Me.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Me.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Me.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Me.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Me.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Me.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Me.errToObj(n)})}nonempty(e){return this.min(1,Me.errToObj(e))}trim(){return new gi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new gi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new gi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}gi.create=t=>new gi({checks:[],typeName:Ze.ZodString,coerce:t?.coerce??!1,...st(t)});function tAe(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,o=Number.parseInt(t.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return o%a/10**s}class Jl extends xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Oe.number){const o=this._getOrReturnCtx(e);return Ae(o,{code:ge.invalid_type,expected:Oe.number,received:o.parsedType}),Ye}let r;const s=new cs;for(const o of this._def.checks)o.kind==="int"?Rt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?tAe(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.not_finite,message:o.message}),s.dirty()):Rt.assertNever(o);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Me.toString(n))}setLimit(e,n,r,s){return new Jl({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Me.toString(s)}]})}_addCheck(e){return new Jl({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Me.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Me.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Rt.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Jl.create=t=>new Jl({checks:[],typeName:Ze.ZodNumber,coerce:t?.coerce||!1,...st(t)});class eu extends xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Oe.bigint)return this._getInvalidInput(e);let r;const s=new cs;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):Rt.assertNever(o);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Ae(n,{code:ge.invalid_type,expected:Oe.bigint,received:n.parsedType}),Ye}gte(e,n){return this.setLimit("min",e,!0,Me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Me.toString(n))}setLimit(e,n,r,s){return new eu({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Me.toString(s)}]})}_addCheck(e){return new eu({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Me.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}eu.create=t=>new eu({checks:[],typeName:Ze.ZodBigInt,coerce:t?.coerce??!1,...st(t)});class my extends xt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Oe.boolean){const r=this._getOrReturnCtx(e);return Ae(r,{code:ge.invalid_type,expected:Oe.boolean,received:r.parsedType}),Ye}return Ps(e.data)}}my.create=t=>new my({typeName:Ze.ZodBoolean,coerce:t?.coerce||!1,...st(t)});class nd extends xt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Oe.date){const o=this._getOrReturnCtx(e);return Ae(o,{code:ge.invalid_type,expected:Oe.date,received:o.parsedType}),Ye}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return Ae(o,{code:ge.invalid_date}),Ye}const r=new cs;let s;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Rt.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new nd({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Me.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Me.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}nd.create=t=>new nd({checks:[],coerce:t?.coerce||!1,typeName:Ze.ZodDate,...st(t)});class z5 extends xt{_parse(e){if(this._getType(e)!==Oe.symbol){const r=this._getOrReturnCtx(e);return Ae(r,{code:ge.invalid_type,expected:Oe.symbol,received:r.parsedType}),Ye}return Ps(e.data)}}z5.create=t=>new z5({typeName:Ze.ZodSymbol,...st(t)});class j5 extends xt{_parse(e){if(this._getType(e)!==Oe.undefined){const r=this._getOrReturnCtx(e);return Ae(r,{code:ge.invalid_type,expected:Oe.undefined,received:r.parsedType}),Ye}return Ps(e.data)}}j5.create=t=>new j5({typeName:Ze.ZodUndefined,...st(t)});class B5 extends xt{_parse(e){if(this._getType(e)!==Oe.null){const r=this._getOrReturnCtx(e);return Ae(r,{code:ge.invalid_type,expected:Oe.null,received:r.parsedType}),Ye}return Ps(e.data)}}B5.create=t=>new B5({typeName:Ze.ZodNull,...st(t)});class $5 extends xt{constructor(){super(...arguments),this._any=!0}_parse(e){return Ps(e.data)}}$5.create=t=>new $5({typeName:Ze.ZodAny,...st(t)});class H5 extends xt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ps(e.data)}}H5.create=t=>new H5({typeName:Ze.ZodUnknown,...st(t)});class Wa extends xt{_parse(e){const n=this._getOrReturnCtx(e);return Ae(n,{code:ge.invalid_type,expected:Oe.never,received:n.parsedType}),Ye}}Wa.create=t=>new Wa({typeName:Ze.ZodNever,...st(t)});class q5 extends xt{_parse(e){if(this._getType(e)!==Oe.undefined){const r=this._getOrReturnCtx(e);return Ae(r,{code:ge.invalid_type,expected:Oe.void,received:r.parsedType}),Ye}return Ps(e.data)}}q5.create=t=>new q5({typeName:Ze.ZodVoid,...st(t)});class _o extends xt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==Oe.array)return Ae(n,{code:ge.invalid_type,expected:Oe.array,received:n.parsedType}),Ye;if(s.exactLength!==null){const a=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(a||u)&&(Ae(n,{code:a?ge.too_big:ge.too_small,minimum:u?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(Ae(n,{code:ge.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(Ae(n,{code:ge.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,u)=>s.type._parseAsync(new qa(n,a,n.path,u)))).then(a=>cs.mergeArray(r,a));const o=[...n.data].map((a,u)=>s.type._parseSync(new qa(n,a,n.path,u)));return cs.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new _o({...this._def,minLength:{value:e,message:Me.toString(n)}})}max(e,n){return new _o({...this._def,maxLength:{value:e,message:Me.toString(n)}})}length(e,n){return new _o({...this._def,exactLength:{value:e,message:Me.toString(n)}})}nonempty(e){return this.min(1,e)}}_o.create=(t,e)=>new _o({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ze.ZodArray,...st(e)});function xc(t){if(t instanceof An){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=ka.create(xc(r))}return new An({...t._def,shape:()=>e})}else return t instanceof _o?new _o({...t._def,type:xc(t.element)}):t instanceof ka?ka.create(xc(t.unwrap())):t instanceof od?od.create(xc(t.unwrap())):t instanceof tu?tu.create(t.items.map(e=>xc(e))):t}class An extends xt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Rt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Oe.object){const f=this._getOrReturnCtx(e);return Ae(f,{code:ge.invalid_type,expected:Oe.object,received:f.parsedType}),Ye}const{status:r,ctx:s}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof Wa&&this._def.unknownKeys==="strip"))for(const f in s.data)a.includes(f)||u.push(f);const c=[];for(const f of a){const h=o[f],g=s.data[f];c.push({key:{status:"valid",value:f},value:h._parse(new qa(s,g,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Wa){const f=this._def.unknownKeys;if(f==="passthrough")for(const h of u)c.push({key:{status:"valid",value:h},value:{status:"valid",value:s.data[h]}});else if(f==="strict")u.length>0&&(Ae(s,{code:ge.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const h of u){const g=s.data[h];c.push({key:{status:"valid",value:h},value:f._parse(new qa(s,g,s.path,h)),alwaysSet:h in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const h of c){const g=await h.key,m=await h.value;f.push({key:g,value:m,alwaysSet:h.alwaysSet})}return f}).then(f=>cs.mergeObjectSync(r,f)):cs.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return Me.errToObj,new An({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{const s=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Me.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new An({...this._def,unknownKeys:"strip"})}passthrough(){return new An({...this._def,unknownKeys:"passthrough"})}extend(e){return new An({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new An({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ze.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new An({...this._def,catchall:e})}pick(e){const n={};for(const r of Rt.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new An({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Rt.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new An({...this._def,shape:()=>n})}deepPartial(){return xc(this)}partial(e){const n={};for(const r of Rt.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new An({...this._def,shape:()=>n})}required(e){const n={};for(const r of Rt.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof ka;)o=o._def.innerType;n[r]=o}return new An({...this._def,shape:()=>n})}keyof(){return m$(Rt.objectKeys(this.shape))}}An.create=(t,e)=>new An({shape:()=>t,unknownKeys:"strip",catchall:Wa.create(),typeName:Ze.ZodObject,...st(e)});An.strictCreate=(t,e)=>new An({shape:()=>t,unknownKeys:"strict",catchall:Wa.create(),typeName:Ze.ZodObject,...st(e)});An.lazycreate=(t,e)=>new An({shape:t,unknownKeys:"strip",catchall:Wa.create(),typeName:Ze.ZodObject,...st(e)});class vy extends xt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const a=o.map(u=>new Ai(u.ctx.common.issues));return Ae(n,{code:ge.invalid_union,unionErrors:a}),Ye}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(s);{let o;const a=[];for(const c of r){const f={...n,common:{...n.common,issues:[]},parent:null},h=c._parseSync({data:n.data,path:n.path,parent:f});if(h.status==="valid")return h;h.status==="dirty"&&!o&&(o={result:h,ctx:f}),f.common.issues.length&&a.push(f.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const u=a.map(c=>new Ai(c));return Ae(n,{code:ge.invalid_union,unionErrors:u}),Ye}}get options(){return this._def.options}}vy.create=(t,e)=>new vy({options:t,typeName:Ze.ZodUnion,...st(e)});function PA(t,e){const n=Ea(t),r=Ea(e);if(t===e)return{valid:!0,data:t};if(n===Oe.object&&r===Oe.object){const s=Rt.objectKeys(e),o=Rt.objectKeys(t).filter(u=>s.indexOf(u)!==-1),a={...t,...e};for(const u of o){const c=PA(t[u],e[u]);if(!c.valid)return{valid:!1};a[u]=c.data}return{valid:!0,data:a}}else if(n===Oe.array&&r===Oe.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let o=0;o<t.length;o++){const a=t[o],u=e[o],c=PA(a,u);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===Oe.date&&r===Oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class yy extends xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(o,a)=>{if(L5(o)||L5(a))return Ye;const u=PA(o.value,a.value);return u.valid?((U5(o)||U5(a))&&n.dirty(),{status:n.value,value:u.data}):(Ae(r,{code:ge.invalid_intersection_types}),Ye)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}yy.create=(t,e,n)=>new yy({left:t,right:e,typeName:Ze.ZodIntersection,...st(n)});class tu extends xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.array)return Ae(r,{code:ge.invalid_type,expected:Oe.array,received:r.parsedType}),Ye;if(r.data.length<this._def.items.length)return Ae(r,{code:ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ye;!this._def.rest&&r.data.length>this._def.items.length&&(Ae(r,{code:ge.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,u)=>{const c=this._def.items[u]||this._def.rest;return c?c._parse(new qa(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>cs.mergeArray(n,a)):cs.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new tu({...this._def,rest:e})}}tu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tu({items:t,typeName:Ze.ZodTuple,rest:null,...st(e)})};class W5 extends xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.map)return Ae(r,{code:ge.invalid_type,expected:Oe.map,received:r.parsedType}),Ye;const s=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,c],f)=>({key:s._parse(new qa(r,u,r.path,[f,"key"])),value:o._parse(new qa(r,c,r.path,[f,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const c of a){const f=await c.key,h=await c.value;if(f.status==="aborted"||h.status==="aborted")return Ye;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),u.set(f.value,h.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const c of a){const f=c.key,h=c.value;if(f.status==="aborted"||h.status==="aborted")return Ye;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),u.set(f.value,h.value)}return{status:n.value,value:u}}}}W5.create=(t,e,n)=>new W5({valueType:e,keyType:t,typeName:Ze.ZodMap,...st(n)});class Xh extends xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.set)return Ae(r,{code:ge.invalid_type,expected:Oe.set,received:r.parsedType}),Ye;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Ae(r,{code:ge.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(Ae(r,{code:ge.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function a(c){const f=new Set;for(const h of c){if(h.status==="aborted")return Ye;h.status==="dirty"&&n.dirty(),f.add(h.value)}return{status:n.value,value:f}}const u=[...r.data.values()].map((c,f)=>o._parse(new qa(r,c,r.path,f)));return r.common.async?Promise.all(u).then(c=>a(c)):a(u)}min(e,n){return new Xh({...this._def,minSize:{value:e,message:Me.toString(n)}})}max(e,n){return new Xh({...this._def,maxSize:{value:e,message:Me.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Xh.create=(t,e)=>new Xh({valueType:t,minSize:null,maxSize:null,typeName:Ze.ZodSet,...st(e)});class V5 extends xt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}V5.create=(t,e)=>new V5({getter:t,typeName:Ze.ZodLazy,...st(e)});class G5 extends xt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Ae(n,{received:n.data,code:ge.invalid_literal,expected:this._def.value}),Ye}return{status:"valid",value:e.data}}get value(){return this._def.value}}G5.create=(t,e)=>new G5({value:t,typeName:Ze.ZodLiteral,...st(e)});function m$(t,e){return new rd({values:t,typeName:Ze.ZodEnum,...st(e)})}class rd extends xt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Ae(n,{expected:Rt.joinValues(r),received:n.parsedType,code:ge.invalid_type}),Ye}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Ae(n,{received:n.data,code:ge.invalid_enum_value,options:r}),Ye}return Ps(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return rd.create(e,{...this._def,...n})}exclude(e,n=this._def){return rd.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}rd.create=m$;class K5 extends xt{_parse(e){const n=Rt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Oe.string&&r.parsedType!==Oe.number){const s=Rt.objectValues(n);return Ae(r,{expected:Rt.joinValues(s),received:r.parsedType,code:ge.invalid_type}),Ye}if(this._cache||(this._cache=new Set(Rt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=Rt.objectValues(n);return Ae(r,{received:r.data,code:ge.invalid_enum_value,options:s}),Ye}return Ps(e.data)}get enum(){return this._def.values}}K5.create=(t,e)=>new K5({values:t,typeName:Ze.ZodNativeEnum,...st(e)});class by extends xt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Oe.promise&&n.common.async===!1)return Ae(n,{code:ge.invalid_type,expected:Oe.promise,received:n.parsedType}),Ye;const r=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return Ps(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}by.create=(t,e)=>new by({type:t,typeName:Ze.ZodPromise,...st(e)});class sd extends xt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ze.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,o={addIssue:a=>{Ae(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const a=s.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async u=>{if(n.value==="aborted")return Ye;const c=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return c.status==="aborted"?Ye:c.status==="dirty"||n.value==="dirty"?lh(c.value):c});{if(n.value==="aborted")return Ye;const u=this._def.schema._parseSync({data:a,path:r.path,parent:r});return u.status==="aborted"?Ye:u.status==="dirty"||n.value==="dirty"?lh(u.value):u}}if(s.type==="refinement"){const a=u=>{const c=s.refinement(u,o);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?Ye:(u.status==="dirty"&&n.dirty(),a(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?Ye:(u.status==="dirty"&&n.dirty(),a(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!td(a))return Ye;const u=s.transform(a.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>td(a)?Promise.resolve(s.transform(a.value,o)).then(u=>({status:n.value,value:u})):Ye);Rt.assertNever(s)}}sd.create=(t,e,n)=>new sd({schema:t,typeName:Ze.ZodEffects,effect:e,...st(n)});sd.createWithPreprocess=(t,e,n)=>new sd({schema:e,effect:{type:"preprocess",transform:t},typeName:Ze.ZodEffects,...st(n)});class ka extends xt{_parse(e){return this._getType(e)===Oe.undefined?Ps(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ka.create=(t,e)=>new ka({innerType:t,typeName:Ze.ZodOptional,...st(e)});class od extends xt{_parse(e){return this._getType(e)===Oe.null?Ps(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}od.create=(t,e)=>new od({innerType:t,typeName:Ze.ZodNullable,...st(e)});class kA extends xt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}kA.create=(t,e)=>new kA({innerType:t,typeName:Ze.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...st(e)});class DA extends xt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return gy(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ai(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ai(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}DA.create=(t,e)=>new DA({innerType:t,typeName:Ze.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...st(e)});class Y5 extends xt{_parse(e){if(this._getType(e)!==Oe.nan){const r=this._getOrReturnCtx(e);return Ae(r,{code:ge.invalid_type,expected:Oe.nan,received:r.parsedType}),Ye}return{status:"valid",value:e.data}}}Y5.create=t=>new Y5({typeName:Ze.ZodNaN,...st(t)});class nAe extends xt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class fI extends xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ye:o.status==="dirty"?(n.dirty(),lh(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ye:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new fI({in:e,out:n,typeName:Ze.ZodPipeline})}}class LA extends xt{_parse(e){const n=this._def.innerType._parse(e),r=s=>(td(s)&&(s.value=Object.freeze(s.value)),s);return gy(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}LA.create=(t,e)=>new LA({innerType:t,typeName:Ze.ZodReadonly,...st(e)});var Ze;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Ze||(Ze={}));const xr=gi.create;Jl.create;eu.create;const rAe=my.create;nd.create;Wa.create;_o.create;const Ed=An.create;vy.create;yy.create;tu.create;rd.create;by.create;ka.create;od.create;const E2e={string:(t=>gi.create({...t,coerce:!0})),number:(t=>Jl.create({...t,coerce:!0})),boolean:(t=>my.create({...t,coerce:!0})),bigint:(t=>eu.create({...t,coerce:!0})),date:(t=>nd.create({...t,coerce:!0}))},sAe=Dy().apiUrl;ke.setConfig({baseUrl:sAe,fetch:k8});ke.interceptors.error.use((t,e)=>{if(t instanceof i_||!e)return t;const n=t,r=n&&typeof n=="object"&&"message"in n?String(n.message):`Request failed with status ${e.status}`;return new i_(r,e.status,n)});const Px={Inbox:"inbox",Drafts:"drafts",Sent:"sent",Archive:"archive",Junk:"junk",Trash:"trash",All:"all",Flagged:"flagged"},C2e={inbox:"Inbox",drafts:"Drafts",sent:"Sent",archive:"Archive",junk:"Junk",trash:"Trash",all:"All",flagged:"Flagged"},Z5=["inbox","flagged","drafts","sent","archive","all","junk","trash"];function oAe(t){const e=new Map,n=[...t].sort((r,s)=>Z5.indexOf(Px[r.role])-Z5.indexOf(Px[s.role]));for(const r of n){if(!r.mailboxId||e.has(r.mailboxId))continue;const s=Px[r.role];s&&e.set(r.mailboxId,s)}return e}const iAe=t=>{const e=t.split("/");return e[e.length-1]||t};function w2e(t,e,n){const r=t.displayNameOverride?.trim();if(r)return r;const s=iAe(t.fullPath);return!e||!n?s:n(`sidebar.${e}`,s)}const aAe=new Set(["sent","drafts","trash"]),x2e=t=>t===void 0||!aAe.has(t),lAe=new Map;function _2e(t){const e=new Map;for(const n of t){const r=oAe(n.folderAppointments);for(const[s,o]of r)e.set(s,{role:o});for(const s of n.mailboxes){const o=r.get(s.mailboxId);e.set(s.mailboxId,{...o?{role:o}:{},providerPath:s.fullPath})}}return e}function A2e(t,e){const n=e[0];if(!t)return n?{mailboxId:n}:{};for(const s of e){const o=t.get(s);if(o&&nte(o)!==void 0)return{mailboxId:s,folder:o}}if(!n)return{};const r=t.get(n);return{mailboxId:n,...r?{folder:r}:{}}}const uAe=_.createContext(null),T2e=()=>_.useContext(uAe)??{accounts:[],mailboxNameIndex:new Map,accountNameIndex:new Map,resultFolderIndex:lAe,searchQuery:"",searchInput:"",searchViewKey:"",onSearchChange:()=>{},onSearchClear:()=>{},onSearchClearQuery:()=>{},intelligenceOpen:!1,onToggleIntelligence:()=>{},onSetIntelligenceOpen:()=>{}},cAe=()=>Un(()=>import("./mail-BAulNO3X.js").then(t=>t.m),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])),dAe=Ed({q:xr().optional()}),fAe=lr("/mail")({loader:({context:{queryClient:t}})=>{t.prefetchQuery(kxe()),t.prefetchQuery({...Wxe(),staleTime:6e4})},component:qn(cAe,"component"),validateSearch:dAe}),hAe=()=>Un(()=>import("./onboarding-BB4MeGUs.js"),__vite__mapDeps([16,17,3,4])),pAe=lr("/onboarding")({component:qn(hAe,"component")});function gAe(){const t=p_e(),e=t?.surface.status==="ready"&&t.surface.section.status==="available";return I.jsx(hte,{show:e,children:I.jsx(wQ,{className:"size-4"})})}const mAe=()=>Un(()=>import("./settings-llSZSjha.js"),[]),R2e=[{id:"accounts",label:"Accounts",icon:I.jsx($8,{className:"size-4"})},{id:"senders",label:"Senders & Rules",icon:I.jsx(CQ,{className:"size-4"})},{id:"folders",label:"Folder roles",icon:I.jsx(hQ,{className:"size-4"})},{id:"filters",label:"Filters",icon:I.jsx(fQ,{className:"size-4"})},{id:"labels",label:"Labels",icon:I.jsx(SQ,{className:"size-4"})},{id:"appearance",label:"Appearance",icon:I.jsx(mQ,{className:"size-4"})},{id:"advanced",label:"Advanced",icon:I.jsx(gAe,{})}],I2e={accounts:"/settings/accounts",senders:"/settings/senders",folders:"/settings/folders",filters:"/settings/filters",labels:"/settings/labels",appearance:"/settings/appearance",advanced:"/settings/advanced"},vAe=lr("/settings")({component:qn(mAe,"component")}),yAe=()=>Un(()=>import("./index-Bs5XAxW4.js"),__vite__mapDeps([18,8])),bAe=()=>Un(()=>import("./index-DtqBFgK5.js"),[]),SAe=Ed({selectedMessageId:xr().optional(),selectedThreadId:xr().optional(),selectedMailboxId:xr().optional(),q:xr().optional()}),EAe=lr("/mail/")({component:qn(bAe,"component"),validateSearch:SAe,errorComponent:qn(yAe,"errorComponent")}),CAe=()=>Un(()=>import("./_mailboxId-DtqBFgK5.js"),[]),wAe=Ed({selectedMessageId:xr().optional(),selectedThreadId:xr().optional(),q:xr().optional()}),xAe=lr("/mail/$mailboxId")({component:qn(CAe,"component"),validateSearch:wAe}),_Ae=()=>Un(()=>import("./flagged-Dz6s_8ns.js"),__vite__mapDeps([19,8])),AAe=()=>Un(()=>import("./flagged-DtqBFgK5.js"),[]),TAe=Ed({selectedMessageId:xr().optional(),q:xr().optional()}),RAe=lr("/mail/flagged")({component:qn(AAe,"component"),validateSearch:TAe,errorComponent:qn(_Ae,"errorComponent")}),IAe=()=>Un(()=>import("./outbox-DtqBFgK5.js"),[]),OAe=Ed({selectedOutboxMessageId:xr().optional(),q:xr().optional()}),NAe=lr("/mail/outbox")({component:qn(IAe,"component"),validateSearch:OAe}),MAe=()=>Un(()=>import("./index-ObGYHrA7.js"),[]),PAe=lr("/settings/")({component:qn(MAe,"component")}),kAe=()=>Un(()=>import("./accounts-2Psoeq13.js"),__vite__mapDeps([20,5,21,2,17,3,4,22,8,9])),DAe=Ed({editAccountId:xr().optional(),focusSmtp:rAe().optional(),connected:xr().optional(),oauthError:xr().optional()}),LAe=lr("/settings/accounts")({component:qn(kAe,"component"),validateSearch:DAe}),UAe=()=>Un(()=>import("./advanced-u1bJcWgy.js"),__vite__mapDeps([23,21,2,22,12,13])),FAe=lr("/settings/advanced")({component:qn(UAe,"component")}),zAe=()=>Un(()=>import("./appearance-N8MKy-4d.js"),__vite__mapDeps([24,21,2])),jAe=lr("/settings/appearance")({component:qn(zAe,"component")}),BAe=()=>Un(()=>import("./filters-fTvJjzw2.js"),__vite__mapDeps([25,21,2,7,10,15,13,8])),$Ae=lr("/settings/filters")({component:qn(BAe,"component")}),HAe=()=>Un(()=>import("./folders-DNmbv735.js"),__vite__mapDeps([26,11,1,21,2,10,8])),qAe=lr("/settings/folders")({component:qn(HAe,"component")}),WAe=()=>Un(()=>import("./labels-CLeRnhvG.js"),__vite__mapDeps([27,21,2,14,8,15])),VAe=lr("/settings/labels")({component:qn(WAe,"component")}),GAe=()=>Un(()=>import("./senders-C099fqMU.js"),__vite__mapDeps([28,3,21,2,8,6,9,1])),KAe=lr("/settings/senders")({component:qn(GAe,"component")}),YAe=()=>Un(()=>import("./suggested-vips-BSmTKJ57.js"),[]),ZAe=lr("/settings/suggested-vips")({component:qn(YAe,"component")}),XAe=O_e.update({id:"/",path:"/",getParentRoute:()=>Sp}),Ep=fAe.update({id:"/mail",path:"/mail",getParentRoute:()=>Sp}),QAe=pAe.update({id:"/onboarding",path:"/onboarding",getParentRoute:()=>Sp}),Do=vAe.update({id:"/settings",path:"/settings",getParentRoute:()=>Sp}),JAe=EAe.update({id:"/",path:"/",getParentRoute:()=>Ep}),eTe=xAe.update({id:"/$mailboxId",path:"/$mailboxId",getParentRoute:()=>Ep}),tTe=RAe.update({id:"/flagged",path:"/flagged",getParentRoute:()=>Ep}),nTe=NAe.update({id:"/outbox",path:"/outbox",getParentRoute:()=>Ep}),rTe=PAe.update({id:"/",path:"/",getParentRoute:()=>Do}),sTe=LAe.update({id:"/accounts",path:"/accounts",getParentRoute:()=>Do}),oTe=FAe.update({id:"/advanced",path:"/advanced",getParentRoute:()=>Do}),iTe=jAe.update({id:"/appearance",path:"/appearance",getParentRoute:()=>Do}),aTe=$Ae.update({id:"/filters",path:"/filters",getParentRoute:()=>Do}),lTe=qAe.update({id:"/folders",path:"/folders",getParentRoute:()=>Do}),uTe=VAe.update({id:"/labels",path:"/labels",getParentRoute:()=>Do}),cTe=KAe.update({id:"/senders",path:"/senders",getParentRoute:()=>Do}),dTe=ZAe.update({id:"/suggested-vips",path:"/suggested-vips",getParentRoute:()=>Do}),fTe={MailMailboxIdRoute:eTe,MailFlaggedRoute:tTe,MailOutboxRoute:nTe,MailIndexRoute:JAe},hTe=Ep._addFileChildren(fTe),pTe={SettingsAccountsRoute:sTe,SettingsAdvancedRoute:oTe,SettingsAppearanceRoute:iTe,SettingsFiltersRoute:aTe,SettingsFoldersRoute:lTe,SettingsLabelsRoute:uTe,SettingsSendersRoute:cTe,SettingsSuggestedVipsRoute:dTe,SettingsIndexRoute:rTe},gTe=Do._addFileChildren(pTe),mTe={IndexRoute:XAe,MailRoute:hTe,OnboardingRoute:QAe,SettingsRoute:gTe},vTe=Sp._addFileChildren(mTe)._addFileTypes(),yTe=(t,e)=>{const n=gme({routeTree:vTe,context:{queryClient:t},defaultPreload:"intent"});return n.subscribe("onResolved",r=>{e.recordPageView(r.toLocation.pathname),Bte(r.toLocation.pathname)}),n},We=t=>typeof t=="string",Gf=()=>{let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n},X5=t=>t==null?"":""+t,bTe=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},STe=/###/g,Q5=t=>t&&t.indexOf("###")>-1?t.replace(STe,"."):t,J5=t=>!t||We(t),Ch=(t,e,n)=>{const r=We(e)?e.split("."):e;let s=0;for(;s<r.length-1;){if(J5(t))return{};const o=Q5(r[s]);!t[o]&&n&&(t[o]=new n),Object.prototype.hasOwnProperty.call(t,o)?t=t[o]:t={},++s}return J5(t)?{}:{obj:t,k:Q5(r[s])}},e6=(t,e,n)=>{const{obj:r,k:s}=Ch(t,e,Object);if(r!==void 0||e.length===1){r[s]=n;return}let o=e[e.length-1],a=e.slice(0,e.length-1),u=Ch(t,a,Object);for(;u.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),u=Ch(t,a,Object),u?.obj&&typeof u.obj[`${u.k}.${o}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${o}`]=n},ETe=(t,e,n,r)=>{const{obj:s,k:o}=Ch(t,e,Object);s[o]=s[o]||[],s[o].push(n)},Sy=(t,e)=>{const{obj:n,k:r}=Ch(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},CTe=(t,e,n)=>{const r=Sy(t,n);return r!==void 0?r:Sy(e,n)},v$=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?We(t[r])||t[r]instanceof String||We(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):v$(t[r],e[r],n):t[r]=e[r]);return t},fc=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var wTe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const xTe=t=>We(t)?t.replace(/[&<>"'\/]/g,e=>wTe[e]):t;class _Te{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const ATe=[" ",",","?","!",";"],TTe=new _Te(20),RTe=(t,e,n)=>{e=e||"",n=n||"";const r=ATe.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=TTe.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!s.test(t);if(!o){const a=t.indexOf(n);a>0&&!s.test(t.substring(0,a))&&(o=!0)}return o},UA=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(n);let s=t;for(let o=0;o<r.length;){if(!s||typeof s!="object")return;let a,u="";for(let c=o;c<r.length;++c)if(c!==o&&(u+=n),u+=r[c],a=s[u],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&c<r.length-1)continue;o+=c-o+1;break}s=a}return s},Ey=t=>t?.replace("_","-"),ITe={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class Cy{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||ITe,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,s){return s&&!this.debug?null:(We(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new Cy(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Cy(this.logger,e)}}var xo=new Cy;class jb{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(a=>{let[u,c]=a;for(let f=0;f<c;f++)u(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[u,c]=a;for(let f=0;f<c;f++)u.apply(u,[e,...r])})}}class t6 extends jb{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let u;e.indexOf(".")>-1?u=e.split("."):(u=[e,n],r&&(Array.isArray(r)?u.push(...r):We(r)&&o?u.push(...r.split(o)):u.push(r)));const c=Sy(this.data,u);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=u[0],n=u[1],r=u.slice(2).join(".")),c||!a||!We(r)?c:UA(this.data?.[e]?.[n],r,o)}addResource(e,n,r,s){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let u=[e,n];r&&(u=u.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(u=e.split("."),s=n,n=u[1]),this.addNamespaces(n),e6(this.data,u,s),o.silent||this.emit("added",e,n,r,s)}addResources(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(We(r[o])||Array.isArray(r[o]))&&this.addResource(e,n,o,r[o],{silent:!0});s.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,s,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},u=[e,n];e.indexOf(".")>-1&&(u=e.split("."),s=r,r=n,n=u[1]),this.addNamespaces(n);let c=Sy(this.data,u)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?v$(c,r,o):c={...c,...r},e6(this.data,u,c),a.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var y$={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,s){return t.forEach(o=>{e=this.processors[o]?.process(e,n,r,s)??e}),e}};const n6={},r6=t=>!We(t)&&typeof t!="boolean"&&typeof t!="number";class wy extends jb{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),bTe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=xo.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};return e==null?!1:this.resolve(e,n)?.res!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&e.indexOf(r)>-1,u=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!RTe(e,r,s);if(a&&!u){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:We(o)?[o]:o};const f=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(f[0])>-1)&&(o=f.shift()),e=f.join(s)}return{key:e,namespaces:We(o)?[o]:o}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:u}=this.extractFromKey(e[e.length-1],n),c=u[u.length-1],f=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()==="cimode"){if(h){const D=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${D}${a}`,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${D}${a}`}return s?{res:a,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:a}const g=this.resolve(e,n);let m=g?.res;const y=g?.usedKey||a,S=g?.exactUsedKey||a,E=["[object Number]","[object Function]","[object RegExp]"],C=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,T=n.count!==void 0&&!We(n.count),x=wy.hasDefaultValue(n),R=T?this.pluralResolver.getSuffix(f,n.count,n):"",M=n.ordinal&&T?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",N=T&&!n.ordinal&&n.count===0,O=N&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${R}`]||n[`defaultValue${M}`]||n.defaultValue;let k=m;w&&!m&&x&&(k=O);const F=r6(k),H=Object.prototype.toString.apply(k);if(w&&k&&F&&E.indexOf(H)<0&&!(We(C)&&Array.isArray(k))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,k,{...n,ns:u}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(g.res=D,g.usedParams=this.getUsedParamsDetails(n),g):D}if(o){const D=Array.isArray(k),z=D?[]:{},q=D?S:y;for(const K in k)if(Object.prototype.hasOwnProperty.call(k,K)){const ee=`${q}${o}${K}`;x&&!m?z[K]=this.translate(ee,{...n,defaultValue:r6(O)?O[K]:void 0,joinArrays:!1,ns:u}):z[K]=this.translate(ee,{...n,joinArrays:!1,ns:u}),z[K]===ee&&(z[K]=k[K])}m=z}}else if(w&&We(C)&&Array.isArray(m))m=m.join(C),m&&(m=this.extendTranslation(m,e,n,r));else{let D=!1,z=!1;!this.isValidLookup(m)&&x&&(D=!0,m=O),this.isValidLookup(m)||(z=!0,m=a);const K=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&z?void 0:m,ee=x&&O!==m&&this.options.updateMissing;if(z||D||ee){if(this.logger.log(ee?"updateKey":"missingKey",f,c,a,ee?O:m),o){const ae=this.resolve(a,{...n,keySeparator:!1});ae&&ae.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let $=[];const te=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&te&&te[0])for(let ae=0;ae<te.length;ae++)$.push(te[ae]);else this.options.saveMissingTo==="all"?$=this.languageUtils.toResolveHierarchy(n.lng||this.language):$.push(n.lng||this.language);const fe=(ae,xe,L)=>{const G=x&&L!==m?L:K;this.options.missingKeyHandler?this.options.missingKeyHandler(ae,c,xe,G,ee,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ae,c,xe,G,ee,n),this.emit("missingKey",ae,c,xe,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?$.forEach(ae=>{const xe=this.pluralResolver.getSuffixes(ae,n);N&&n[`defaultValue${this.options.pluralSeparator}zero`]&&xe.indexOf(`${this.options.pluralSeparator}zero`)<0&&xe.push(`${this.options.pluralSeparator}zero`),xe.forEach(L=>{fe([ae],a+L,n[`defaultValue${L}`]||O)})}):fe($,a,O))}m=this.extendTranslation(m,e,n,g,r),z&&m===a&&this.options.appendNamespaceToMissingKey&&(m=`${c}:${a}`),(z||D)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${a}`:a,D?m:void 0))}return s?(g.res=m,g.usedParams=this.getUsedParamsDetails(n),g):m}extendTranslation(e,n,r,s,o){var a=this;if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=We(e)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(f){const m=e.match(this.interpolator.nestingRegexp);h=m&&m.length}let g=r.replace&&!We(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(g={...this.options.interpolation.defaultVariables,...g}),e=this.interpolator.interpolate(e,g,r.lng||this.language||s.usedLng,r),f){const m=e.match(this.interpolator.nestingRegexp),y=m&&m.length;h<y&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var m=arguments.length,y=new Array(m),S=0;S<m;S++)y[S]=arguments[S];return o?.[0]===y[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${n[0]}`),null):a.translate(...y,n)},r)),r.interpolation&&this.interpolator.reset()}const u=r.postProcess||this.options.postProcess,c=We(u)?[u]:u;return e!=null&&c?.length&&r.applyPostProcessor!==!1&&(e=y$.handle(c,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,s,o,a,u;return We(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const f=this.extractFromKey(c,n),h=f.key;s=h;let g=f.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const m=n.count!==void 0&&!We(n.count),y=m&&!n.ordinal&&n.count===0,S=n.context!==void 0&&(We(n.context)||typeof n.context=="number")&&n.context!=="",E=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);g.forEach(C=>{this.isValidLookup(r)||(u=C,!n6[`${E[0]}-${C}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(u)&&(n6[`${E[0]}-${C}`]=!0,this.logger.warn(`key "${s}" for languages "${E.join(", ")}" won't get resolved as namespace "${u}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),E.forEach(w=>{if(this.isValidLookup(r))return;a=w;const T=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(T,h,w,C,n);else{let R;m&&(R=this.pluralResolver.getSuffix(w,n.count,n));const M=`${this.options.pluralSeparator}zero`,N=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(T.push(h+R),n.ordinal&&R.indexOf(N)===0&&T.push(h+R.replace(N,this.options.pluralSeparator)),y&&T.push(h+M)),S){const O=`${h}${this.options.contextSeparator}${n.context}`;T.push(O),m&&(T.push(O+R),n.ordinal&&R.indexOf(N)===0&&T.push(O+R.replace(N,this.options.pluralSeparator)),y&&T.push(O+M))}}let x;for(;x=T.pop();)this.isValidLookup(r)||(o=x,r=this.getResource(w,C,x,n))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:a,usedNS:u}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,n,r,s):this.resourceStore.getResource(e,n,r,s)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!We(e.replace);let s=r?e.replace:e;if(r&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of n)delete s[o]}return s}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class s6{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=xo.create("languageUtils")}getScriptPartFromCode(e){if(e=Ey(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=Ey(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(We(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>{if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&(o.indexOf("-")>0&&s.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===s||o.indexOf(s)===0&&s.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),We(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),s=[],o=a=>{a&&(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return We(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(e))):We(e)&&o(this.formatLanguageCode(e)),r.forEach(a=>{s.indexOf(a)<0&&o(this.formatLanguageCode(a))}),s}}const o6={zero:0,one:1,two:2,few:3,many:4,other:5},i6={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class OTe{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=xo.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=Ey(e==="dev"?"en":e),s=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),i6;if(!e.match(/-|_/))return i6;const c=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(c,n)}return this.pluralRulesCache[o]=a,a}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(s=>`${n}${s}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((s,o)=>o6[s]-o6[o]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(e,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const a6=function(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=CTe(t,e,n);return!o&&s&&We(n)&&(o=UA(t,n,r),o===void 0&&(o=UA(e,n,r))),o},kx=t=>t.replace(/\$/g,"$$$$");class NTe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=xo.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:a,suffix:u,suffixEscaped:c,formatSeparator:f,unescapeSuffix:h,unescapePrefix:g,nestingPrefix:m,nestingPrefixEscaped:y,nestingSuffix:S,nestingSuffixEscaped:E,nestingOptionsSeparator:C,maxReplaces:w,alwaysFormat:T}=e.interpolation;this.escape=n!==void 0?n:xTe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?fc(o):a||"{{",this.suffix=u?fc(u):c||"}}",this.formatSeparator=f||",",this.unescapePrefix=h?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=m?fc(m):y||fc("$t("),this.nestingSuffix=S?fc(S):E||fc(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=w||1e3,this.alwaysFormat=T!==void 0?T:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,s){let o,a,u;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=y=>{if(y.indexOf(this.formatSeparator)<0){const w=a6(n,c,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,r,{...s,...n,interpolationkey:y}):w}const S=y.split(this.formatSeparator),E=S.shift().trim(),C=S.join(this.formatSeparator).trim();return this.format(a6(n,c,E,this.options.keySeparator,this.options.ignoreJSONStructure),C,r,{...s,...n,interpolationkey:E})};this.resetRegExp();const h=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,g=s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:y=>kx(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?kx(this.escape(y)):kx(y)}].forEach(y=>{for(u=0;o=y.regex.exec(e);){const S=o[1].trim();if(a=f(S),a===void 0)if(typeof h=="function"){const C=h(e,o,s);a=We(C)?C:""}else if(s&&Object.prototype.hasOwnProperty.call(s,S))a="";else if(g){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${S} for interpolating ${e}`),a="";else!We(a)&&!this.useRawValueToEscape&&(a=X5(a));const E=y.safeValue(a);if(e=e.replace(o[0],E),g?(y.regex.lastIndex+=a.length,y.regex.lastIndex-=o[0].length):y.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,o,a;const u=(c,f)=>{const h=this.nestingOptionsSeparator;if(c.indexOf(h)<0)return c;const g=c.split(new RegExp(`${h}[ ]*{`));let m=`{${g[1]}`;c=g[0],m=this.interpolate(m,a);const y=m.match(/'/g),S=m.match(/"/g);((y?.length??0)%2===0&&!S||S.length%2!==0)&&(m=m.replace(/'/g,'"'));try{a=JSON.parse(m),f&&(a={...f,...a})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,E),`${c}${h}${m}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];a={...r},a=a.replace&&!We(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const h=s[1].split(this.formatSeparator).map(g=>g.trim());s[1]=h.shift(),c=h,f=!0}if(o=n(u.call(this,s[1].trim(),a),a),o&&s[0]===e&&!We(o))return o;We(o)||(o=X5(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),o=""),f&&(o=c.reduce((h,g)=>this.format(h,g,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),e=e.replace(s[0],o),this.regexp.lastIndex=0}return e}}const MTe=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);e==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(a=>{if(a){const[u,...c]=a.split(":"),f=c.join(":").trim().replace(/^'+|'+$/g,""),h=u.trim();n[h]||(n[h]=f),f==="false"&&(n[h]=!1),f==="true"&&(n[h]=!0),isNaN(f)||(n[h]=parseInt(f,10))}})}return{formatName:e,formatOptions:n}},hc=t=>{const e={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const a=r+JSON.stringify(o);let u=e[a];return u||(u=t(Ey(r),s),e[a]=u),u(n)}};class PTe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=xo.create("formatter"),this.options=e,this.formats={number:hc((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return o=>s.format(o)}),currency:hc((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>s.format(o)}),datetime:hc((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return o=>s.format(o)}),relativetime:hc((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return o=>s.format(o,r.range||"day")}),list:hc((n,r)=>{const s=new Intl.ListFormat(n,{...r});return o=>s.format(o)})},this.init(e)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=hc(n)}format(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(u=>u.indexOf(")")>-1)){const u=o.findIndex(c=>c.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,u)].join(this.formatSeparator)}return o.reduce((u,c)=>{const{formatName:f,formatOptions:h}=MTe(c);if(this.formats[f]){let g=u;try{const m=s?.formatParams?.[s.interpolationkey]||{},y=m.locale||m.lng||s.locale||s.lng||r;g=this.formats[f](u,y,{...h,...s,...m})}catch(m){this.logger.warn(m)}return g}else this.logger.warn(`there was no format function for ${f}`);return u},e)}}const kTe=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class DTe extends jb{constructor(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=xo.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,s.backend,s)}queueLoad(e,n,r,s){const o={},a={},u={},c={};return e.forEach(f=>{let h=!0;n.forEach(g=>{const m=`${f}|${g}`;!r.reload&&this.store.hasResourceBundle(f,g)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?a[m]===void 0&&(a[m]=!0):(this.state[m]=1,h=!1,a[m]===void 0&&(a[m]=!0),o[m]===void 0&&(o[m]=!0),c[g]===void 0&&(c[g]=!0)))}),h||(u[f]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const s=e.split("|"),o=s[0],a=s[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const u={};this.queue.forEach(c=>{ETe(c.loaded,[o],a),kTe(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(f=>{u[f]||(u[f]={});const h=c.loaded[f];h.length&&h.forEach(g=>{u[f][g]===void 0&&(u[f][g]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(c=>!c.done)}read(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:s,wait:o,callback:a});return}this.readingCalls++;const u=(f,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(f&&h&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,s+1,o*2,a)},o);return}a(f,h)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const f=c(e,n);f&&typeof f.then=="function"?f.then(h=>u(null,h)).catch(u):u(null,f)}catch(f){u(f)}return}return c(e,n,u)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();We(e)&&(e=this.languageUtils.toResolveHierarchy(e)),We(n)&&(n=[n]);const o=this.queueLoad(e,n,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(a,u)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${s} failed`,a),!a&&u&&this.logger.log(`${n}loaded namespace ${o} for language ${s}`,u),this.loaded(e,a,u)})}saveMissing(e,n,r,s,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const c={...a,isUpdate:o},f=this.backend.create.bind(this.backend);if(f.length<6)try{let h;f.length===5?h=f(e,n,r,s,c):h=f(e,n,r,s),h&&typeof h.then=="function"?h.then(g=>u(null,g)).catch(u):u(null,h)}catch(h){u(h)}else f(e,n,r,s,u,c)}!e||!e[0]||this.store.addResource(e[0],n,r,s)}}}const l6=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),We(t[1])&&(e.defaultValue=t[1]),We(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),u6=t=>(We(t.ns)&&(t.ns=[t.ns]),We(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),We(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t),Hm=()=>{},LTe=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class Qh extends jb{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=u6(e),this.services={},this.logger=xo,this.modules={external:[]},LTe(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(We(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=l6();this.options={...s,...this.options,...u6(n)},this.options.interpolation={...s.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?xo.init(o(this.modules.logger),this.options):xo.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=PTe;const g=new s6(this.options);this.store=new t6(this.options.resources,this.options);const m=this.services;m.logger=xo,m.resourceStore=this.store,m.languageUtils=g,m.pluralResolver=new OTe(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(m.formatter=o(h),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new NTe(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new DTe(o(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(y){for(var S=arguments.length,E=new Array(S>1?S-1:0),C=1;C<S;C++)E[C-1]=arguments[C];e.emit(y,...E)}),this.modules.languageDetector&&(m.languageDetector=o(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=o(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new wy(this.services,this.options),this.translator.on("*",function(y){for(var S=arguments.length,E=new Array(S>1?S-1:0),C=1;C<S;C++)E[C-1]=arguments[C];e.emit(y,...E)}),this.modules.external.forEach(y=>{y.init&&y.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Hm),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=function(){return e.store[h](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=function(){return e.store[h](...arguments),e}});const c=Gf(),f=()=>{const h=(g,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(m),r(g,m)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?f():setTimeout(f,0),c}loadResources(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hm;const s=We(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(s?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&o.indexOf(f)<0&&o.push(f)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),this.options.preload?.forEach?.(u=>a(u)),this.services.backendConnector.load(o,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(e,n,r){const s=Gf();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=Hm),this.services.backendConnector.reload(e,n,o=>{s.resolve(),r(o)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&y$.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const s=Gf();this.emit("languageChanging",e);const o=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},a=(c,f)=>{f?(o(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},u=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const f=We(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);f&&(this.language||o(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector?.cacheUserLanguage?.(f)),this.loadResources(f,h=>{a(h,f)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(e),s}getFixedT(e,n,r){var s=this;const o=function(a,u){let c;if(typeof u!="object"){for(var f=arguments.length,h=new Array(f>2?f-2:0),g=2;g<f;g++)h[g-2]=arguments[g];c=s.options.overloadTranslationOptionHandler([a,u].concat(h))}else c={...u};c.lng=c.lng||o.lng,c.lngs=c.lngs||o.lngs,c.ns=c.ns||o.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||o.keyPrefix);const m=s.options.keySeparator||".";let y;return c.keyPrefix&&Array.isArray(a)?y=a.map(S=>`${c.keyPrefix}${m}${S}`):y=c.keyPrefix?`${c.keyPrefix}${m}${a}`:a,s.t(y,c)};return We(e)?o.lng=e:o.lngs=e,o.ns=n,o.keyPrefix=r,o}t(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.translator?.translate(...n)}exists(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.translator?.exists(...n)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(u,c)=>{const f=this.services.backendConnector.state[`${u}|${c}`];return f===-1||f===0||f===2};if(n.precheck){const u=n.precheck(this,a);if(u!==void 0)return u}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,e)&&(!s||a(o,e)))}loadNamespaces(e,n){const r=Gf();return this.options.ns?(We(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=Gf();We(e)&&(e=[e]);const s=this.options.preload||[],o=e.filter(a=>s.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=s.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new s6(l6());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Qh(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hm;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},o=new Qh(s);if((e.debug!==void 0||e.prefix!==void 0)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(u=>{o[u]=this[u]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const u=Object.keys(this.store.data).reduce((c,f)=>(c[f]={...this.store.data[f]},Object.keys(c[f]).reduce((h,g)=>(h[g]={...c[f][g]},h),{})),{});o.store=new t6(u,s),o.services.resourceStore=o.store}return o.translator=new wy(o.services,s),o.translator.on("*",function(u){for(var c=arguments.length,f=new Array(c>1?c-1:0),h=1;h<c;h++)f[h-1]=arguments[h];o.emit(u,...f)}),o.init(s,n),o.translator.options=s,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const pr=Qh.createInstance();pr.createInstance=Qh.createInstance;pr.createInstance;pr.dir;pr.init;pr.loadResources;pr.reloadResources;pr.use;pr.changeLanguage;pr.getFixedT;pr.t;pr.exists;pr.setDefaultNamespace;pr.hasLoadedNamespace;pr.loadNamespaces;pr.loadLanguages;const{slice:UTe,forEach:FTe}=[];function zTe(t){return FTe.call(UTe.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}function jTe(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(t))}const c6=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,BTe=function(t,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(e);let o=`${t}=${s}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!c6.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!c6.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},d6={create(t,e,n,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+n*60*1e3)),r&&(s.domain=r),document.cookie=BTe(t,e,s)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let s=n[r];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return s.substring(e.length,s.length)}return null},remove(t,e){this.create(t,"",-1,e)}};var $Te={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return d6.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:s,cookieOptions:o}=e;n&&typeof document<"u"&&d6.create(n,t,r,s,o)}},HTe={name:"querystring",lookup(t){let{lookupQuerystring:e}=t,n;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const o=r.substring(1).split("&");for(let a=0;a<o.length;a++){const u=o[a].indexOf("=");u>0&&o[a].substring(0,u)===e&&(n=o[a].substring(u+1))}}return n}},qTe={name:"hash",lookup(t){let{lookupHash:e,lookupFromHashIndex:n}=t,r;if(typeof window<"u"){const{hash:s}=window.location;if(s&&s.length>2){const o=s.substring(1);if(e){const a=o.split("&");for(let u=0;u<a.length;u++){const c=a[u].indexOf("=");c>0&&a[u].substring(0,c)===e&&(r=a[u].substring(c+1))}}if(r)return r;if(!r&&n>-1){const a=s.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return r}};let pc=null;const f6=()=>{if(pc!==null)return pc;try{if(pc=typeof window<"u"&&window.localStorage!==null,!pc)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{pc=!1}return pc};var WTe={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&f6())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&f6()&&window.localStorage.setItem(n,t)}};let gc=null;const h6=()=>{if(gc!==null)return gc;try{if(gc=typeof window<"u"&&window.sessionStorage!==null,!gc)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{gc=!1}return gc};var VTe={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&h6())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&h6()&&window.sessionStorage.setItem(n,t)}},GTe={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:s}=navigator;if(n)for(let o=0;o<n.length;o++)e.push(n[o]);r&&e.push(r),s&&e.push(s)}return e.length>0?e:void 0}},KTe={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},YTe={name:"path",lookup(t){let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof e=="number"?e:0]?.replace("/",""):void 0}},ZTe={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let b$=!1;try{document.cookie,b$=!0}catch{}const S$=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];b$||S$.splice(1,1);const XTe=()=>({order:S$,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class E${constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=zTe(n,this.options||{},XTe()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector($Te),this.addDetector(HTe),this.addDetector(WTe),this.addDetector(VTe),this.addDetector(GTe),this.addDetector(KTe),this.addDetector(YTe),this.addDetector(ZTe),this.addDetector(qTe)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return e.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.filter(r=>r!=null&&!jTe(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}E$.type="languageDetector";function QTe(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=JTe(t))||e){n&&(t=n);var r=0,s=function(){};return{s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(f){throw f},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
295
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var f=n.next();return a=f.done,f},e:function(f){u=!0,o=f},f:function(){try{a||n.return==null||n.return()}finally{if(u)throw o}}}}function JTe(t,e){if(t){if(typeof t=="string")return p6(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p6(t,e):void 0}}function p6(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function FA(t){"@babel/helpers - typeof";return FA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},FA(t)}var C$=["__proto__","constructor","prototype"];function w$(t){return!(typeof t!="string"||t.length===0||t.length>128||C$.indexOf(t)>-1||t.indexOf("..")>-1||t.indexOf("\\")>-1||/[?#%\s@]/.test(t)||/[\x00-\x1F\x7F]/.test(t))}function x$(t){return!(!w$(t)||t.indexOf("/")>-1)}function eRe(t){return w$(t)}var tRe={lng:x$,ns:eRe};function qm(t){return typeof t!="string"?t:t.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function nRe(t){if(typeof t!="string"||t.length===0)return t;try{var e=new URL(t);return e.username||e.password?(e.username="",e.password="",e.toString()):t}catch{return t.replace(/(\/\/)[^/@\s]+@/g,"$1")}}function _$(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":FA(XMLHttpRequest))==="object"}function rRe(t){return!!t&&typeof t.then=="function"}function sRe(t){return rRe(t)?t:Promise.resolve(t)}var oRe=/\{\{(.+?)\}\}/g;function g6(t,e){var n=!1,r=t.replace(oRe,function(s,o){var a=o.trim();if(C$.indexOf(a)>-1)return s;var u=e[a];if(u==null)return s;var c=tRe[a]||x$,f=String(u).split("+"),h=QTe(f),g;try{for(h.s();!(g=h.n()).done;){var m=g.value;if(!c(m))return n=!0,s}}catch(y){h.e(y)}finally{h.f()}return f.join("+")});return n?null:r}function m6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function v6(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?m6(Object(n),!0).forEach(function(r){iRe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function iRe(t,e,n){return(e=aRe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aRe(t){var e=lRe(t,"string");return nu(e)=="symbol"?e:e+""}function lRe(t,e){if(nu(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(nu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nu(t){"@babel/helpers - typeof";return nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nu(t)}var Va=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?Va=global.fetch:typeof window<"u"&&window.fetch&&(Va=window.fetch);var Jh;_$()&&(typeof global<"u"&&global.XMLHttpRequest?Jh=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Jh=window.XMLHttpRequest));var xy;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?xy=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(xy=window.ActiveXObject));typeof Va!="function"&&(Va=void 0);if(!Va&&!Jh&&!xy)try{Un(()=>import("./browser-ponyfill-DHOWeyHw.js").then(t=>t.b),[]).then(function(t){Va=t.default}).catch(function(){})}catch{}var A$=["__proto__","constructor","prototype"],zA=function(e,n){if(n&&nu(n)==="object"){for(var r="",s=0,o=Object.keys(n);s<o.length;s++){var a=o[s];A$.indexOf(a)>-1||(r+="&"+encodeURIComponent(a)+"="+encodeURIComponent(n[a]))}if(!r)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+r.slice(1)}return e},y6=function(e,n,r,s){var o=function(c){if(!c.ok)return r(c.statusText||"Error",{status:c.status});c.text().then(function(f){r(null,{status:c.status,data:f})}).catch(r)};if(s){var a=s(e,n);if(a instanceof Promise){a.then(o).catch(r);return}}typeof fetch=="function"?fetch(e,n).then(o).catch(r):Va(e,n).then(o).catch(r)},uRe=function(e,n,r,s){e.queryStringParams&&(n=zA(n,e.queryStringParams));var o=v6({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(o["Content-Type"]="application/json");var a=typeof e.requestOptions=="function"?e.requestOptions(r):e.requestOptions,u=v6({method:r?"POST":"GET",body:r?e.stringify(r):void 0,headers:o},e._omitFetchOptions?{}:a),c=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{y6(n,u,s,c)}catch(f){if(!a||Object.keys(a).length===0||!f.message||f.message.indexOf("not implemented")<0)return s(f);try{Object.keys(a).forEach(function(h){delete u[h]}),y6(n,u,s,c),e._omitFetchOptions=!0}catch(h){s(h)}}},cRe=function(e,n,r,s){r&&nu(r)==="object"&&(r=zA("",r).slice(1)),e.queryStringParams&&(n=zA(n,e.queryStringParams));try{var o=Jh?new Jh:new xy("MSXML2.XMLHTTP.3.0");o.open(r?"POST":"GET",n,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=e.customHeaders;if(a=typeof a=="function"?a():a,a)for(var u=0,c=Object.keys(a);u<c.length;u++){var f=c[u];A$.indexOf(f)>-1||o.setRequestHeader(f,a[f])}o.onreadystatechange=function(){o.readyState>3&&s(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(h){console&&console.log(h)}},dRe=function(e,n,r,s){if(typeof r=="function"&&(s=r,r=void 0),s=s||function(){},Va&&n.indexOf("file:")!==0)return uRe(e,n,r,s);if(_$()||typeof ActiveXObject=="function")return cRe(e,n,r,s);s(new Error("No fetch and no xhr implementation found!"))};function id(t){"@babel/helpers - typeof";return id=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},id(t)}function b6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function Dx(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?b6(Object(n),!0).forEach(function(r){T$(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function fRe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hRe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,R$(r.key),r)}}function pRe(t,e,n){return e&&hRe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function T$(t,e,n){return(e=R$(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R$(t){var e=gRe(t,"string");return id(e)=="symbol"?e:e+""}function gRe(t,e){if(id(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(id(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var mRe=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,s){return T$({},r,s||"")},parseLoadPayload:function(n,r){},request:dRe,reloadInterval:typeof window<"u"?!1:3600*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},I$=(function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};fRe(this,t),this.services=e,this.options=n,this.allOptions=r,this.type="backend",this.init(e,n,r)}return pRe(t,[{key:"init",value:function(n){var r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=Dx(Dx(Dx({},mRe()),this.options||{}),s),this.allOptions=o,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);id(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,s){this._readAny(n,n,r,r,s)}},{key:"read",value:function(n,r,s){this._readAny([n],n,[r],r,s)}},{key:"_readAny",value:function(n,r,s,o,a){var u=this,c=this.options.loadPath;typeof this.options.loadPath=="function"&&(c=this.options.loadPath(n,s)),c=sRe(c),c.then(function(f){if(!f)return a(null,{});var h=g6(f,{lng:n.join("+"),ns:s.join("+")});if(h==null){var g=n.map(qm).join(", "),m=s.map(qm).join(", ");return a(new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+g+"] namespaces=["+m+"]"),!1)}u.loadUrl(h,a,r,o)})}},{key:"loadUrl",value:function(n,r,s,o){var a=this,u=typeof s=="string"?[s]:s,c=typeof o=="string"?[o]:o,f=this.options.parseLoadPayload(u,c),h=qm(nRe(n));this.options.request(this.options,n,f,function(g,m){if(m&&(m.status>=500&&m.status<600||!m.status))return r("failed loading "+h+"; status code: "+m.status,!0);if(m&&m.status>=400&&m.status<500)return r("failed loading "+h+"; status code: "+m.status,!1);if(!m&&g&&g.message){var y=g.message.toLowerCase(),S=["failed","fetch","network","load"].find(function(w){return y.indexOf(w)>-1});if(S)return r("failed loading "+h+": "+qm(g.message),!0)}if(g)return r(g,!1);var E,C;try{typeof m.data=="string"?E=a.options.parse(m.data,s,o):E=m.data}catch{C="failed parsing "+h+" to json"}if(C)return r(C,!1);r(null,E)})}},{key:"create",value:function(n,r,s,o,a){var u=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var c=this.options.parsePayload(r,s,o),f=0,h=[],g=[];n.forEach(function(m){var y=u.options.addPath;typeof u.options.addPath=="function"&&(y=u.options.addPath(m,r));var S=g6(y,{lng:m,ns:r});if(S==null){f+=1,a&&f===n.length&&a(h,g);return}u.options.request(u.options,S,c,function(E,C){f+=1,h.push(E),g.push(C),f===n.length&&typeof a=="function"&&a(h,g)})})}}},{key:"reload",value:function(){var n=this,r=this.services,s=r.backendConnector,o=r.languageUtils,a=r.logger,u=s.language;if(!(u&&u.toLowerCase()==="cimode")){var c=[],f=function(g){var m=o.toResolveHierarchy(g);m.forEach(function(y){c.indexOf(y)<0&&c.push(y)})};f(u),this.allOptions.preload&&this.allOptions.preload.forEach(function(h){return f(h)}),c.forEach(function(h){n.allOptions.ns.forEach(function(g){s.read(h,g,"read",null,null,function(m,y){m&&a.warn("loading namespace ".concat(g," for language ").concat(h," failed"),m),!m&&y&&a.log("loaded namespace ".concat(g," for language ").concat(h),y),s.loaded("".concat(h,"|").concat(g),m,y)})})})}}}])})();I$.type="backend";pr.use(I$).use(E$).use(Rwe).init({fallbackLng:"en",supportedLngs:["en","nl","de","fr"],ns:["common","mail","settings","errors"],defaultNS:"common",backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},detection:{order:["navigator","htmlTag"],caches:[]},interpolation:{escapeValue:!1},react:{useSuspense:!0,bindI18n:"languageChanged loaded"}});const vRe=({authProvider:t,rootElementId:e="root"})=>{Fte(),mwe(),t.configure(),Bme(t);const n=pwe();Rte(n);const r=new fpe({queryCache:new D7({onError:Wme}),mutationCache:new k7({onError:Vme}),defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1}}}),s=yTe(r,n);n.recordPageView(window.location.pathname);const o=document.getElementById(e);if(!o)throw new Error(`Root element not found: #${e}`);const{Shell:a}=t;wme.createRoot(o).render(I.jsx(_.StrictMode,{children:I.jsx(t$.Provider,{value:n,children:I.jsxs(hpe,{client:r,children:[I.jsx(qme,{value:t,children:I.jsx(a,{children:I.jsx(yme,{router:s})})}),!1]})})}))};vRe({authProvider:Hhe});export{vb as $,lQ as A,as as B,Qx as C,aJ as D,WJ as E,dQ as F,P8 as G,j8 as H,pQ as I,yRe as J,bRe as K,_Re as L,gQ as M,FRe as N,iT as O,MRe as P,ape as Q,j as R,bQ as S,EQ as T,URe as U,bd as V,Dn as W,Ua as X,Uv as Y,A7 as Z,XN as _,hn as a,o2e as a$,ppe as a0,vpe as a1,Epe as a2,ype as a3,bpe as a4,Er as a5,wpe as a6,mU as a7,Spe as a8,xpe as a9,jxe as aA,f$ as aB,p2e as aC,y2e as aD,f2e as aE,Un as aF,QIe as aG,Dxe as aH,qxe as aI,Ixe as aJ,s2e as aK,Vxe as aL,l2e as aM,i2e as aN,iAe as aO,r2e as aP,XIe as aQ,cz as aR,u2e as aS,a2e as aT,b2e as aU,m2e as aV,g2e as aW,A2e as aX,VIe as aY,IRe as aZ,CRe as a_,hs as aa,Wr as ab,Bge as ac,v2e as ad,ER as ae,$Ie as af,oAe as ag,Nx as ah,$Re as ai,o3 as aj,Yte as ak,uz as al,Pwe as am,w2e as an,T2e as ao,wIe as ap,F7 as aq,Uxe as ar,k8 as as,_pe as at,d2e as au,h2e as av,c2e as aw,ZIe as ax,kxe as ay,S2e as az,yt as b,kIe as b$,n_ as b0,VJ as b1,SQ as b2,fz as b3,Wxe as b4,$y as b5,Mxe as b6,ql as b7,_xe as b8,o$ as b9,rAe as bA,xr as bB,E2e as bC,e2e as bD,t2e as bE,LAe as bF,RIe as bG,OIe as bH,R2e as bI,vQ as bJ,I2e as bK,YIe as bL,kRe as bM,xRe as bN,PRe as bO,h_e as bP,Cte as bQ,Ste as bR,bte as bS,A5 as bT,QP as bU,xIe as bV,DIe as bW,LIe as bX,Uee as bY,$ee as bZ,MIe as b_,oxe as ba,fxe as bb,cxe as bc,uxe as bd,Na as be,KIe as bf,JIe as bg,LRe as bh,AIe as bi,x2e as bj,_2e as bk,Ga as bl,exe as bm,L9 as bn,Dy as bo,uAe as bp,wRe as bq,hT as br,gz as bs,Pxe as bt,jRe as bu,IIe as bv,TIe as bw,NIe as bx,fT as by,Ed as bz,F8 as c,vae as c$,Txe as c0,PIe as c1,WIe as c2,GIe as c3,Qee as c4,ORe as c5,Xee as c6,_Ie as c7,Kwe as c8,UIe as c9,_ae as cA,kae as cB,zoe as cC,Moe as cD,Vy as cE,ET as cF,Y9 as cG,Nae as cH,Tae as cI,qoe as cJ,Cae as cK,WT as cL,Q9 as cM,joe as cN,gae as cO,mae as cP,lre as cQ,uu as cR,Jne as cS,Qne as cT,ST as cU,BF as cV,pae as cW,nre as cX,Hoe as cY,bae as cZ,CT as c_,qIe as ca,Px as cb,C2e as cc,Wee as cd,HIe as ce,Z5 as cf,TRe as cg,FIe as ch,zIe as ci,Rxe as cj,BIe as ck,jIe as cl,n2e as cm,Lxe as cn,Ug as co,nF as cp,Mo as cq,FT as cr,Ri as cs,Eae as ct,Ii as cu,hae as cv,tF as cw,Zy as cx,UF as cy,Uoe as cz,IP as d,Uae as d0,VF as d1,ERe as d2,ip as d3,DRe as d4,BT as d5,sb as d6,up as d7,Mae as d8,ap as d9,Pae as da,Aae as db,vP as e,cQ as f,iJ as g,GJ as h,uQ as i,I as j,Jx as k,r_ as l,UJ as m,ARe as n,$8 as o,RRe as p,BJ as q,_ as r,yQ as s,ste as t,zJ as u,nte as v,NRe as w,fQ as x,HJ as y,H8 as z};
|
|
294
|
+
or you can use record.mirror to access the mirror instance during recording.`;let d5={map:{},getId(){return console.error(Cc),-1},getNode(){return console.error(Cc),null},removeNodeFromMap(){console.error(Cc)},has(){return console.error(Cc),!1},reset(){console.error(Cc)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(d5=new Proxy(d5,{get(t,e,n){return e==="map"&&console.error(Cc),Reflect.get(t,e,n)}}));function Zh(t,e,n={}){let r=null,s=0;return function(...o){const a=Date.now();!s&&n.leading===!1&&(s=a);const u=e-(a-s),c=this;u<=0||u>e?(r&&(clearTimeout(r),r=null),s=a,t.apply(c,o)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{s=n.leading===!1?0:Date.now(),r=null,t.apply(c,o)},u))}}function zb(t,e,n,r,s=window){const o=s.Object.getOwnPropertyDescriptor(t,e);return s.Object.defineProperty(t,e,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>zb(t,e,o||{},!0)}let dy=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(dy=()=>new Date().getTime());function MB(t){var e,n,r,s;const o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:o.documentElement.scrollLeft||o?.body&&((e=rt.parentElement(o.body))==null?void 0:e.scrollLeft)||((n=o?.body)==null?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:o?.documentElement.scrollTop||o?.body&&((r=rt.parentElement(o.body))==null?void 0:r.scrollTop)||((s=o?.body)==null?void 0:s.scrollTop)||0}}function PB(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function kB(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function DB(t){return t?t.nodeType===t.ELEMENT_NODE?t:rt.parentElement(t):null}function wr(t,e,n,r){if(!t)return!1;const s=DB(t);if(!s)return!1;try{if(typeof e=="string"){if(s.classList.contains(e)||r&&s.closest("."+e)!==null)return!0}else if(ny(s,e,r))return!0}catch{}return!!(n&&(s.matches(n)||r&&s.closest(n)!==null))}function yCe(t,e){return e.getId(t)!==-1}function Ix(t,e,n){return t.tagName==="TITLE"&&n.headTitleMutations?!0:e.getId(t)===Bh}function LB(t,e){if(bh(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const r=rt.parentNode(t);return r&&r.nodeType===t.DOCUMENT_NODE?!1:r?LB(r,e):!0}function EA(t){return!!t.changedTouches}function bCe(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function UB(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function FB(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function CA(t){return t?t instanceof lI&&"shadowRoot"in t?!!t.shadowRoot:!!rt.shadowRoot(t):!1}class SCe{constructor(){Se(this,"id",1),Se(this,"styleIDMap",new WeakMap),Se(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function zB(t){var e;let n=null;return"getRootNode"in t&&((e=rt.getRootNode(t))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&rt.host(rt.getRootNode(t))&&(n=rt.host(rt.getRootNode(t))),n}function ECe(t){let e=t,n;for(;n=zB(e);)e=n;return e}function CCe(t){const e=rt.ownerDocument(t);if(!e)return!1;const n=ECe(t);return rt.contains(e,n)}function jB(t){const e=rt.ownerDocument(t);return e?rt.contains(e,t)||CCe(t):!1}var wt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(wt||{}),ft=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(ft||{}),Ur=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Ur||{}),ii=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(ii||{}),ed=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(ed||{}),wc=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(wc||{}),BB=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(BB||{});function f5(t){return"__ln"in t}class wCe{constructor(){Se(this,"length",0),Se(this,"head",null),Se(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=n?.next||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&f5(e.previousSibling)){const r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&f5(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(e){const n=e.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const h5=(t,e)=>`${t}@${e}`;class xCe{constructor(){Se(this,"frozen",!1),Se(this,"locked",!1),Se(this,"texts",[]),Se(this,"attributes",[]),Se(this,"attributeMap",new WeakMap),Se(this,"removes",[]),Se(this,"mapRemoves",[]),Se(this,"movedMap",{}),Se(this,"addedSet",new Set),Se(this,"movedSet",new Set),Se(this,"droppedSet",new Set),Se(this,"removesSubTreeCache",new Set),Se(this,"mutationCb"),Se(this,"blockClass"),Se(this,"blockSelector"),Se(this,"maskTextClass"),Se(this,"maskTextSelector"),Se(this,"inlineStylesheet"),Se(this,"maskInputOptions"),Se(this,"maskTextFn"),Se(this,"maskInputFn"),Se(this,"keepIframeSrcFn"),Se(this,"recordCanvas"),Se(this,"inlineImages"),Se(this,"slimDOMOptions"),Se(this,"dataURLOptions"),Se(this,"doc"),Se(this,"mirror"),Se(this,"iframeManager"),Se(this,"stylesheetManager"),Se(this,"shadowDomManager"),Se(this,"canvasManager"),Se(this,"processedNodeManager"),Se(this,"unattachedDoc"),Se(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Se(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],n=new Set,r=new wCe,s=c=>{let f=c,h=Bh;for(;h===Bh;)f=f&&f.nextSibling,h=f&&this.mirror.getId(f);return h},o=c=>{const f=rt.parentNode(c);if(!f||!jB(c))return;let h=!1;if(c.nodeType===Node.TEXT_NODE){const S=f.tagName;if(S==="TEXTAREA")return;S==="STYLE"&&this.addedSet.has(f)&&(h=!0)}const g=bh(f)?this.mirror.getId(zB(c)):this.mirror.getId(f),m=s(c);if(g===-1||m===-1)return r.addNode(c);const y=Mc(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:S=>{UB(S,this.mirror)&&this.iframeManager.addIframe(S),FB(S,this.mirror)&&this.stylesheetManager.trackLinkElement(S),CA(c)&&this.shadowDomManager.addShadowRoot(rt.shadowRoot(c),this.doc)},onIframeLoad:(S,E)=>{this.iframeManager.attachIframe(S,E),this.shadowDomManager.observeAttachShadow(S)},onStylesheetLoad:(S,E)=>{this.stylesheetManager.attachLinkElement(S,E)},cssCaptured:h});y&&(e.push({parentId:g,nextId:m,node:y}),n.add(y.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of this.movedSet)p5(this.removesSubTreeCache,c,this.mirror)&&!this.movedSet.has(rt.parentNode(c))||o(c);for(const c of this.addedSet)!g5(this.droppedSet,c)&&!p5(this.removesSubTreeCache,c,this.mirror)||g5(this.movedSet,c)?o(c):this.droppedSet.add(c);let a=null;for(;r.length;){let c=null;if(a){const f=this.mirror.getId(rt.parentNode(a.value)),h=s(a.value);f!==-1&&h!==-1&&(c=a)}if(!c){let f=r.tail;for(;f;){const h=f;if(f=f.previous,h){const g=this.mirror.getId(rt.parentNode(h.value));if(s(h.value)===-1)continue;if(g!==-1){c=h;break}else{const y=h.value,S=rt.parentNode(y);if(S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const E=rt.host(S);if(this.mirror.getId(E)!==-1){c=h;break}}}}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}a=c.previous,r.removeNode(c.value),o(c.value)}const u={texts:this.texts.map(c=>{const f=c.node,h=rt.parentNode(f);return h&&h.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(h),{id:this.mirror.getId(f),value:c.value}}).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:f}=c;if(typeof f.style=="string"){const h=JSON.stringify(c.styleDiff),g=JSON.stringify(c._unchangedStyles);h.length<f.style.length&&(h+g).split("var(").length===f.style.split("var(").length&&(f.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:f}}).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:e};!u.texts.length&&!u.attributes.length&&!u.removes.length&&!u.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(u))}),Se(this,"genTextAreaValueMutation",e=>{let n=this.attributeMap.get(e);n||(n={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e,n));const r=Array.from(rt.childNodes(e),s=>rt.textContent(s)||"").join("");n.attributes.value=Jv({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:ey(e),value:r,maskInputFn:this.maskInputFn})}),Se(this,"processMutation",e=>{if(!Ix(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const n=rt.textContent(e.target);!wr(e.target,this.blockClass,this.blockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:cj(e.target,this.maskTextClass,this.maskTextSelector,!0)&&n?this.maskTextFn?this.maskTextFn(n,DB(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,s=e.target.getAttribute(r);if(r==="value"){const a=ey(n);s=Jv({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:a,value:s,maskInputFn:this.maskInputFn})}if(wr(e.target,this.blockClass,this.blockSelector,!1)||s===e.oldValue)return;let o=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!n.contentDocument)r="rr_src";else return;if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),r==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!uj(n.tagName,r))if(o.attributes[r]=lj(this.doc,Ql(n.tagName),Ql(r),s),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");e.oldValue&&a.setAttribute("style",e.oldValue);for(const u of Array.from(n.style)){const c=n.style.getPropertyValue(u),f=n.style.getPropertyPriority(u);c!==a.style.getPropertyValue(u)||f!==a.style.getPropertyPriority(u)?f===""?o.styleDiff[u]=c:o.styleDiff[u]=[c,f]:o._unchangedStyles[u]=[c,f]}for(const u of Array.from(a.style))n.style.getPropertyValue(u)===""&&(o.styleDiff[u]=!1)}else r==="open"&&n.tagName==="DIALOG"&&(n.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(wr(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const r=this.mirror.getId(n),s=bh(e.target)?this.mirror.getId(rt.host(e.target)):this.mirror.getId(e.target);wr(e.target,this.blockClass,this.blockSelector,!1)||Ix(n,this.mirror,this.slimDOMOptions)||!yCe(n,this.mirror)||(this.addedSet.has(n)?(wA(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||LB(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[h5(r,s)]?wA(this.movedSet,n):(this.removes.push({parentId:s,id:r,isShadow:bh(e.target)&&Sh(e.target)?!0:void 0}),_Ce(n,this.removesSubTreeCache))),this.mapRemoves.push(n))});break}}}),Se(this,"genAdds",(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Ix(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[h5(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);wr(e,this.blockClass,this.blockSelector,!1)||(rt.childNodes(e).forEach(r=>this.genAdds(r)),CA(e)&&rt.childNodes(rt.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=e[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function wA(t,e){t.delete(e),rt.childNodes(e).forEach(n=>wA(t,n))}function _Ce(t,e){const n=[t];for(;n.length;){const r=n.pop();e.has(r)||(e.add(r),rt.childNodes(r).forEach(s=>n.push(s)))}}function p5(t,e,n){return t.size===0?!1:ACe(t,e)}function ACe(t,e,n){const r=rt.parentNode(e);return r?t.has(r):!1}function g5(t,e){return t.size===0?!1:$B(t,e)}function $B(t,e){const n=rt.parentNode(e);return n?t.has(n)?!0:$B(t,n):!1}let Eh;function TCe(t){Eh=t}function RCe(){Eh=void 0}const vt=t=>Eh?(...n)=>{try{return t(...n)}catch(r){if(Eh&&Eh(r)===!0)return;throw r}}:t,Nl=[];function yp(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function HB(t,e){const n=new xCe;Nl.push(n),n.init(t);const r=new(NB())(vt(n.processMutations.bind(n)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function ICe({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};const s=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let a=[],u;const c=Zh(vt(g=>{const m=Date.now()-u;t(a.map(y=>(y.timeOffset-=m,y)),g),a=[],u=null}),o),f=vt(Zh(vt(g=>{const m=yp(g),{clientX:y,clientY:S}=EA(g)?g.changedTouches[0]:g;u||(u=dy()),a.push({x:y,y:S,id:r.getId(m),timeOffset:dy()-u}),c(typeof DragEvent<"u"&&g instanceof DragEvent?ft.Drag:g instanceof MouseEvent?ft.MouseMove:ft.TouchMove)}),s,{trailing:!1})),h=[Cr("mousemove",f,n),Cr("touchmove",f,n),Cr("drag",f,n)];return vt(()=>{h.forEach(g=>g())})}function OCe({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,u=[];let c=null;const f=h=>g=>{const m=yp(g);if(wr(m,r,s,!0))return;let y=null,S=h;if("pointerType"in g){switch(g.pointerType){case"mouse":y=ii.Mouse;break;case"touch":y=ii.Touch;break;case"pen":y=ii.Pen;break}y===ii.Touch?Ur[h]===Ur.MouseDown?S="TouchStart":Ur[h]===Ur.MouseUp&&(S="TouchEnd"):ii.Pen}else EA(g)&&(y=ii.Touch);y!==null?(c=y,(S.startsWith("Touch")&&y===ii.Touch||S.startsWith("Mouse")&&y===ii.Mouse)&&(y=null)):Ur[h]===Ur.Click&&(y=c,c=null);const E=EA(g)?g.changedTouches[0]:g;if(!E)return;const C=n.getId(m),{clientX:w,clientY:T}=E;vt(t)({type:Ur[S],id:C,x:w,y:T,...y!==null&&{pointerType:y}})};return Object.keys(Ur).filter(h=>Number.isNaN(Number(h))&&!h.endsWith("_Departed")&&a[h]!==!1).forEach(h=>{let g=Ql(h);const m=f(h);if(window.PointerEvent)switch(Ur[h]){case Ur.MouseDown:case Ur.MouseUp:g=g.replace("mouse","pointer");break;case Ur.TouchStart:case Ur.TouchEnd:return}u.push(Cr(g,m,e))}),vt(()=>{u.forEach(h=>h())})}function qB({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,sampling:o}){const a=vt(Zh(vt(u=>{const c=yp(u);if(!c||wr(c,r,s,!0))return;const f=n.getId(c);if(c===e&&e.defaultView){const h=MB(e.defaultView);t({id:f,x:h.left,y:h.top})}else t({id:f,x:c.scrollLeft,y:c.scrollTop})}),o.scroll||100));return Cr("scroll",a,e)}function NCe({viewportResizeCb:t},{win:e}){let n=-1,r=-1;const s=vt(Zh(vt(()=>{const o=PB(),a=kB();(n!==o||r!==a)&&(t({width:Number(a),height:Number(o)}),n=o,r=a)}),200));return Cr("resize",s,e)}const MCe=["INPUT","TEXTAREA","SELECT"],m5=new WeakMap;function PCe({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:u,maskInputFn:c,sampling:f,userTriggeredOnInput:h}){function g(T){let x=yp(T);const R=T.isTrusted,M=x&&x.tagName;if(x&&M==="OPTION"&&(x=rt.parentElement(x)),!x||!M||MCe.indexOf(M)<0||wr(x,r,s,!0)||x.classList.contains(o)||a&&x.matches(a))return;let N=x.value,O=!1;const k=ey(x)||"";k==="radio"||k==="checkbox"?O=x.checked:(u[M.toLowerCase()]||u[k])&&(N=Jv({element:x,maskInputOptions:u,tagName:M,type:k,value:N,maskInputFn:c})),m(x,h?{text:N,isChecked:O,userTriggered:R}:{text:N,isChecked:O});const F=x.name;k==="radio"&&F&&O&&e.querySelectorAll(`input[type="radio"][name="${F}"]`).forEach(H=>{if(H!==x){const D=H.value;m(H,h?{text:D,isChecked:!O,userTriggered:!1}:{text:D,isChecked:!O})}})}function m(T,x){const R=m5.get(T);if(!R||R.text!==x.text||R.isChecked!==x.isChecked){m5.set(T,x);const M=n.getId(T);vt(t)({...x,id:M})}}const S=(f.input==="last"?["change"]:["input","change"]).map(T=>Cr(T,vt(g),e)),E=e.defaultView;if(!E)return()=>{S.forEach(T=>T())};const C=E.Object.getOwnPropertyDescriptor(E.HTMLInputElement.prototype,"value"),w=[[E.HTMLInputElement.prototype,"value"],[E.HTMLInputElement.prototype,"checked"],[E.HTMLSelectElement.prototype,"value"],[E.HTMLTextAreaElement.prototype,"value"],[E.HTMLSelectElement.prototype,"selectedIndex"],[E.HTMLOptionElement.prototype,"selected"]];return C&&C.set&&S.push(...w.map(T=>zb(T[0],T[1],{set(){vt(g)({target:this,isTrusted:!1})}},!1,E))),vt(()=>{S.forEach(T=>T())})}function fy(t){const e=[];function n(r,s){if(zm("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||zm("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||zm("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||zm("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const a=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(a)}else if(r.parentStyleSheet){const a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(a)}return s}return n(t,e)}function Sa(t,e,n){let r,s;return t?(t.ownerNode?r=e.getId(t.ownerNode):s=n.getId(t),{styleId:s,id:r}):{}}function kCe({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:vt((h,g,m)=>{const[y,S]=m,{id:E,styleId:C}=Sa(g,e,n.styleMirror);return(E&&E!==-1||C&&C!==-1)&&t({id:E,styleId:C,adds:[{rule:y,index:S}]}),h.apply(g,m)})}),r.CSSStyleSheet.prototype.addRule=function(h,g,m=this.cssRules.length){const y=`${h} { ${g} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[y,m])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:vt((h,g,m)=>{const[y]=m,{id:S,styleId:E}=Sa(g,e,n.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,removes:[{index:y}]}),h.apply(g,m)})}),r.CSSStyleSheet.prototype.removeRule=function(h){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[h])};let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:vt((h,g,m)=>{const[y]=m,{id:S,styleId:E}=Sa(g,e,n.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,replace:y}),h.apply(g,m)})}));let u;r.CSSStyleSheet.prototype.replaceSync&&(u=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:vt((h,g,m)=>{const[y]=m,{id:S,styleId:E}=Sa(g,e,n.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,replaceSync:y}),h.apply(g,m)})}));const c={};jm("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(jm("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),jm("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),jm("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const f={};return Object.entries(c).forEach(([h,g])=>{f[h]={insertRule:g.prototype.insertRule,deleteRule:g.prototype.deleteRule},g.prototype.insertRule=new Proxy(f[h].insertRule,{apply:vt((m,y,S)=>{const[E,C]=S,{id:w,styleId:T}=Sa(y.parentStyleSheet,e,n.styleMirror);return(w&&w!==-1||T&&T!==-1)&&t({id:w,styleId:T,adds:[{rule:E,index:[...fy(y),C||0]}]}),m.apply(y,S)})}),g.prototype.deleteRule=new Proxy(f[h].deleteRule,{apply:vt((m,y,S)=>{const[E]=S,{id:C,styleId:w}=Sa(y.parentStyleSheet,e,n.styleMirror);return(C&&C!==-1||w&&w!==-1)&&t({id:C,styleId:w,removes:[{index:[...fy(y),E]}]}),m.apply(y,S)})})}),vt(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=o,a&&(r.CSSStyleSheet.prototype.replace=a),u&&(r.CSSStyleSheet.prototype.replaceSync=u),Object.entries(c).forEach(([h,g])=>{g.prototype.insertRule=f[h].insertRule,g.prototype.deleteRule=f[h].deleteRule})})}function WB({mirror:t,stylesheetManager:e},n){var r,s,o;let a=null;n.nodeName==="#document"?a=t.getId(n):a=t.getId(rt.host(n));const u=n.nodeName==="#document"?(r=n.defaultView)==null?void 0:r.Document:(o=(s=n.ownerDocument)==null?void 0:s.defaultView)==null?void 0:o.ShadowRoot,c=u?.prototype?Object.getOwnPropertyDescriptor(u?.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!u||!c?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var f;return(f=c.get)==null?void 0:f.call(this)},set(f){var h;const g=(h=c.set)==null?void 0:h.call(this,f);if(a!==null&&a!==-1)try{e.adoptStyleSheets(f,a)}catch{}return g}}),vt(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))}function DCe({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:vt((u,c,f)=>{var h;const[g,m,y]=f;if(n.has(g))return o.apply(c,[g,m,y]);const{id:S,styleId:E}=Sa((h=c.parentRule)==null?void 0:h.parentStyleSheet,e,r.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,set:{property:g,value:m,priority:y},index:fy(c.parentRule)}),u.apply(c,f)})});const a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:vt((u,c,f)=>{var h;const[g]=f;if(n.has(g))return a.apply(c,[g]);const{id:m,styleId:y}=Sa((h=c.parentRule)==null?void 0:h.parentStyleSheet,e,r.styleMirror);return(m&&m!==-1||y&&y!==-1)&&t({id:m,styleId:y,remove:{property:g},index:fy(c.parentRule)}),u.apply(c,f)})}),vt(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a})}function LCe({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:r,sampling:s,doc:o}){const a=vt(c=>Zh(vt(f=>{const h=yp(f);if(!h||wr(h,e,n,!0))return;const{currentTime:g,volume:m,muted:y,playbackRate:S,loop:E}=h;t({type:c,id:r.getId(h),currentTime:g,volume:m,muted:y,playbackRate:S,loop:E})}),s.media||500)),u=[Cr("play",a(wc.Play),o),Cr("pause",a(wc.Pause),o),Cr("seeked",a(wc.Seeked),o),Cr("volumechange",a(wc.VolumeChange),o),Cr("ratechange",a(wc.RateChange),o)];return vt(()=>{u.forEach(c=>c())})}function UCe({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,o=n.FontFace;n.FontFace=function(c,f,h){const g=new o(c,f,h);return s.set(g,{family:c,buffer:typeof f!="string",descriptors:h,fontSource:typeof f=="string"?f:JSON.stringify(Array.from(new Uint8Array(f)))}),g};const a=mu(e.fonts,"add",function(u){return function(c){return setTimeout(vt(()=>{const f=s.get(c);f&&(t(f),s.delete(c))}),0),u.apply(this,[c])}});return r.push(()=>{n.FontFace=o}),r.push(a),vt(()=>{r.forEach(u=>u())})}function FCe(t){const{doc:e,mirror:n,blockClass:r,blockSelector:s,selectionCb:o}=t;let a=!0;const u=vt(()=>{const c=e.getSelection();if(!c||a&&c?.isCollapsed)return;a=c.isCollapsed||!1;const f=[],h=c.rangeCount||0;for(let g=0;g<h;g++){const m=c.getRangeAt(g),{startContainer:y,startOffset:S,endContainer:E,endOffset:C}=m;wr(y,r,s,!0)||wr(E,r,s,!0)||f.push({start:n.getId(y),startOffset:S,end:n.getId(E),endOffset:C})}o({ranges:f})});return u(),Cr("selectionchange",u)}function zCe({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:mu(n.customElements,"define",function(s){return function(o,a,u){try{e({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return s.apply(this,[o,a,u])}})}function jCe(t,e){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:a,inputCb:u,mediaInteractionCb:c,styleSheetRuleCb:f,styleDeclarationCb:h,canvasMutationCb:g,fontCb:m,selectionCb:y,customElementCb:S}=t;t.mutationCb=(...E)=>{e.mutation&&e.mutation(...E),n(...E)},t.mousemoveCb=(...E)=>{e.mousemove&&e.mousemove(...E),r(...E)},t.mouseInteractionCb=(...E)=>{e.mouseInteraction&&e.mouseInteraction(...E),s(...E)},t.scrollCb=(...E)=>{e.scroll&&e.scroll(...E),o(...E)},t.viewportResizeCb=(...E)=>{e.viewportResize&&e.viewportResize(...E),a(...E)},t.inputCb=(...E)=>{e.input&&e.input(...E),u(...E)},t.mediaInteractionCb=(...E)=>{e.mediaInteaction&&e.mediaInteaction(...E),c(...E)},t.styleSheetRuleCb=(...E)=>{e.styleSheetRule&&e.styleSheetRule(...E),f(...E)},t.styleDeclarationCb=(...E)=>{e.styleDeclaration&&e.styleDeclaration(...E),h(...E)},t.canvasMutationCb=(...E)=>{e.canvasMutation&&e.canvasMutation(...E),g(...E)},t.fontCb=(...E)=>{e.font&&e.font(...E),m(...E)},t.selectionCb=(...E)=>{e.selection&&e.selection(...E),y(...E)},t.customElementCb=(...E)=>{e.customElement&&e.customElement(...E),S(...E)}}function BCe(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};jCe(t,e);let r;t.recordDOM&&(r=HB(t,t.doc));const s=ICe(t),o=OCe(t),a=qB(t),u=NCe(t,{win:n}),c=PCe(t),f=LCe(t);let h=()=>{},g=()=>{},m=()=>{},y=()=>{};t.recordDOM&&(h=kCe(t,{win:n}),g=WB(t,t.doc),m=DCe(t,{win:n}),t.collectFonts&&(y=UCe(t)));const S=FCe(t),E=zCe(t),C=[];for(const w of t.plugins)C.push(w.observer(w.callback,n,w.options));return vt(()=>{Nl.forEach(w=>w.reset()),r?.disconnect(),s(),o(),a(),u(),c(),f(),h(),g(),m(),y(),S(),E(),C.forEach(w=>w())})}function zm(t){return typeof window[t]<"u"}function jm(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class v5{constructor(e){Se(this,"iframeIdToRemoteIdMap",new WeakMap),Se(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,n,r,s){const o=r||this.getIdToRemoteIdMap(e),a=s||this.getRemoteIdToIdMap(e);let u=o.get(n);return u||(u=this.generateIdFn(),o.set(n,u),a.set(u,n)),u}getIds(e,n){const r=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return n.map(o=>this.getId(e,o,r,s))}getRemoteId(e,n,r){const s=r||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;const o=s.get(n);return o||-1}getRemoteIds(e,n){const r=this.getRemoteIdToIdMap(e);return n.map(s=>this.getRemoteId(e,s,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}}class $Ce{constructor(e){Se(this,"iframes",new WeakMap),Se(this,"crossOriginIframeMap",new WeakMap),Se(this,"crossOriginIframeMirror",new v5(aj)),Se(this,"crossOriginIframeStyleMirror"),Se(this,"crossOriginIframeRootIdMap",new WeakMap),Se(this,"mirror"),Se(this,"mutationCb"),Se(this,"wrappedEmit"),Se(this,"loadListener"),Se(this,"stylesheetManager"),Se(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new v5(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){var r,s;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;const s=this.crossOriginIframeMap.get(e.source);if(!s)return;const o=this.transformCrossOriginEvent(s,n.data.event);o&&this.wrappedEmit(o,n.data.isCheckout)}transformCrossOriginEvent(e,n){var r;switch(n.type){case wt.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);const s=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,s),this.patchRootIdOnNode(n.data.node,s),{timestamp:n.timestamp,type:wt.IncrementalSnapshot,data:{source:ft.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case wt.Meta:case wt.Load:case wt.DomContentLoaded:return!1;case wt.Plugin:return n;case wt.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case wt.IncrementalSnapshot:switch(n.data.source){case ft.Mutation:return n.data.adds.forEach(s=>{this.replaceIds(s,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,e);const o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(s.node,o)}),n.data.removes.forEach(s=>{this.replaceIds(s,e,["parentId","id"])}),n.data.attributes.forEach(s=>{this.replaceIds(s,e,["id"])}),n.data.texts.forEach(s=>{this.replaceIds(s,e,["id"])}),n;case ft.Drag:case ft.TouchMove:case ft.MouseMove:return n.data.positions.forEach(s=>{this.replaceIds(s,e,["id"])}),n;case ft.ViewportResize:return!1;case ft.MediaInteraction:case ft.MouseInteraction:case ft.Scroll:case ft.CanvasMutation:case ft.Input:return this.replaceIds(n.data,e,["id"]),n;case ft.StyleSheetRule:case ft.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case ft.Font:return n;case ft.Selection:return n.data.ranges.forEach(s=>{this.replaceIds(s,e,["start","end"])}),n;case ft.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),(r=n.data.styles)==null||r.forEach(s=>{this.replaceStyleIds(s,e,["styleId"])}),n}}return!1}replace(e,n,r,s){for(const o of s)!Array.isArray(n[o])&&typeof n[o]!="number"||(Array.isArray(n[o])?n[o]=e.getIds(r,n[o]):n[o]=e.getId(r,n[o]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(e,n){e.type!==BB.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class HCe{constructor(e){Se(this,"shadowDoms",new WeakSet),Se(this,"mutationCb"),Se(this,"scrollCb"),Se(this,"bypassOptions"),Se(this,"mirror"),Se(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!Sh(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=HB({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(qB({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(rt.host(e))),this.restoreHandlers.push(WB({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,n){const r=this;this.restoreHandlers.push(mu(e.prototype,"attachShadow",function(s){return function(o){const a=s.call(this,o),u=rt.shadowRoot(this);return u&&jB(this)&&r.addShadowRoot(u,n),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Pc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qCe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Bm=0;Bm<Pc.length;Bm++)qCe[Pc.charCodeAt(Bm)]=Bm;var WCe=function(t){var e=new Uint8Array(t),n,r=e.length,s="";for(n=0;n<r;n+=3)s+=Pc[e[n]>>2],s+=Pc[(e[n]&3)<<4|e[n+1]>>4],s+=Pc[(e[n+1]&15)<<2|e[n+2]>>6],s+=Pc[e[n+2]&63];return r%3===2?s=s.substring(0,s.length-1)+"=":r%3===1&&(s=s.substring(0,s.length-2)+"=="),s};const y5=new Map;function VCe(t,e){let n=y5.get(t);return n||(n=new Map,y5.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}const VB=(t,e,n)=>{if(!t||!(KB(t,e)||typeof t=="object"))return;const r=t.constructor.name,s=VCe(n,r);let o=s.indexOf(t);return o===-1&&(o=s.length,s.push(t)),o};function yv(t,e,n){if(t instanceof Array)return t.map(r=>yv(r,e,n));if(t===null)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){const r=t.constructor.name,s=WCe(t);return{rr_type:r,base64:s}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[yv(t.buffer,e,n),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const r=t.constructor.name,{src:s}=t;return{rr_type:r,src:s}}else if(t instanceof HTMLCanvasElement){const r="HTMLImageElement",s=t.toDataURL();return{rr_type:r,src:s}}else{if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[yv(t.data,e,n),t.width,t.height]};if(KB(t,e)||typeof t=="object"){const r=t.constructor.name,s=VB(t,e,n);return{rr_type:r,index:s}}}}return t}const GB=(t,e,n)=>t.map(r=>yv(r,e,n)),KB=(t,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof e[s]=="function").find(s=>t instanceof e[s]);function GCe(t,e,n,r){const s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of o)try{if(typeof e.CanvasRenderingContext2D.prototype[a]!="function")continue;const u=mu(e.CanvasRenderingContext2D.prototype,a,function(c){return function(...f){return wr(this.canvas,n,r,!0)||setTimeout(()=>{const h=GB(f,e,this);t(this.canvas,{type:ed["2D"],property:a,args:h})},0),c.apply(this,f)}});s.push(u)}catch{const u=zb(e.CanvasRenderingContext2D.prototype,a,{set(c){t(this.canvas,{type:ed["2D"],property:a,args:[c],setter:!0})}});s.push(u)}return()=>{s.forEach(a=>a())}}function KCe(t){return t==="experimental-webgl"?"webgl":t}function b5(t,e,n,r){const s=[];try{const o=mu(t.HTMLCanvasElement.prototype,"getContext",function(a){return function(u,...c){if(!wr(this,e,n,!0)){const f=KCe(u);if("__context"in this||(this.__context=f),r&&["webgl","webgl2"].includes(f))if(c[0]&&typeof c[0]=="object"){const h=c[0];h.preserveDrawingBuffer||(h.preserveDrawingBuffer=!0)}else c.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[u,...c])}});s.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(o=>o())}}function S5(t,e,n,r,s,o){const a=[],u=Object.getOwnPropertyNames(t);for(const c of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof t[c]!="function")continue;const f=mu(t,c,function(h){return function(...g){const m=h.apply(this,g);if(VB(m,o,this),"tagName"in this.canvas&&!wr(this.canvas,r,s,!0)){const y=GB(g,o,this),S={type:e,property:c,args:y};n(this.canvas,S)}return m}});a.push(f)}catch{const f=zb(t,c,{set(h){n(this.canvas,{type:e,property:c,args:[h],setter:!0})}});a.push(f)}return a}function YCe(t,e,n,r){const s=[];return s.push(...S5(e.WebGLRenderingContext.prototype,ed.WebGL,t,n,r,e)),typeof e.WebGL2RenderingContext<"u"&&s.push(...S5(e.WebGL2RenderingContext.prototype,ed.WebGL2,t,n,r,e)),()=>{s.forEach(o=>o())}}const YB="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",ZCe=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),E5=typeof window<"u"&&window.Blob&&new Blob([ZCe(YB)],{type:"text/javascript;charset=utf-8"});function XCe(t){let e;try{if(e=E5&&(window.URL||window.webkitURL).createObjectURL(E5),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),n}catch{return new Worker("data:text/javascript;base64,"+YB,{name:t?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class QCe{constructor(e){Se(this,"pendingCanvasMutations",new Map),Se(this,"rafStamps",{latestId:0,invokeId:null}),Se(this,"mirror"),Se(this,"mutationCb"),Se(this,"resetObservers"),Se(this,"frozen",!1),Se(this,"locked",!1),Se(this,"processMutation",(c,f)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(f)});const{sampling:n="all",win:r,blockClass:s,blockSelector:o,recordCanvas:a,dataURLOptions:u}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&n==="all"&&this.initCanvasMutationObserver(r,s,o),a&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,s,o,{dataURLOptions:u})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,n,r,s,o){const a=b5(n,r,s,!0),u=new Map,c=new XCe;c.onmessage=S=>{const{id:E}=S.data;if(u.set(E,!1),!("base64"in S.data))return;const{base64:C,type:w,width:T,height:x}=S.data;this.mutationCb({id:E,type:ed["2D"],commands:[{property:"clearRect",args:[0,0,T,x]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:C}],type:w}]},0,0]}]})};const f=1e3/e;let h=0,g;const m=()=>{const S=[];return n.document.querySelectorAll("canvas").forEach(E=>{wr(E,r,s,!0)||S.push(E)}),S},y=S=>{if(h&&S-h<f){g=requestAnimationFrame(y);return}h=S,m().forEach(async E=>{var C;const w=this.mirror.getId(E);if(u.get(w)||E.width===0||E.height===0)return;if(u.set(w,!0),["webgl","webgl2"].includes(E.__context)){const x=E.getContext(E.__context);((C=x?.getContextAttributes())==null?void 0:C.preserveDrawingBuffer)===!1&&x.clear(x.COLOR_BUFFER_BIT)}const T=await createImageBitmap(E);c.postMessage({id:w,bitmap:T,width:E.width,height:E.height,dataURLOptions:o.dataURLOptions},[T])}),g=requestAnimationFrame(y)};g=requestAnimationFrame(y),this.resetObservers=()=>{a(),cancelAnimationFrame(g)}}initCanvasMutationObserver(e,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=b5(e,n,r,!1),o=GCe(this.processMutation.bind(this),e,n,r),a=YCe(this.processMutation.bind(this),e,n,r);this.resetObservers=()=>{s(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=n=>{this.rafStamps.latestId=n,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||n===-1)return;const s=r.map(a=>{const{type:u,...c}=a;return c}),{type:o}=r[0];this.mutationCb({id:n,type:o,commands:s}),this.pendingCanvasMutations.delete(e)}}class JCe{constructor(e){Se(this,"trackedLinkElements",new WeakSet),Se(this,"mutationCb"),Se(this,"adoptedStyleSheetCb"),Se(this,"styleMirror",new SCe),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;const r={id:n,styleIds:[]},s=[];for(const o of e){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),s.push({styleId:a,rules:Array.from(o.rules||CSSRule,(u,c)=>({rule:sj(u,o.href),index:c}))})),r.styleIds.push(a)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class ewe{constructor(){Se(this,"nodeMap",new WeakMap),Se(this,"active",!1)}inOtherBuffer(e,n){const r=this.nodeMap.get(e);return r&&Array.from(r).some(s=>s!==n)}add(e,n){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}destroy(){}}let mn,bv,Ox,hy=!1;try{if(Array.from([1],t=>t*2)[0]!==2){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=((x4=t.contentWindow)==null?void 0:x4.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}const $s=n0e();function bp(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:c="rr-mask",maskTextSelector:f=null,inlineStylesheet:h=!0,maskAllInputs:g,maskInputOptions:m,slimDOMOptions:y,maskInputFn:S,maskTextFn:E,hooks:C,packFn:w,sampling:T={},dataURLOptions:x={},mousemoveWait:R,recordDOM:M=!0,recordCanvas:N=!1,recordCrossOriginIframes:O=!1,recordAfter:k=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:F=!1,collectFonts:H=!1,inlineImages:D=!1,plugins:z,keepIframeSrcFn:q=()=>!1,ignoreCSSAttributes:K=new Set([]),errorHandler:ee}=t;TCe(ee);const $=O?window.parent===window:!0;let te=!1;if(!$)try{window.parent.document&&(te=!1)}catch{te=!0}if($&&!e)throw new Error("emit function is required");if(!$&&!te)return()=>{};R!==void 0&&T.mousemove===void 0&&(T.mousemove=R),$s.reset();const fe=g===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:m!==void 0?m:{password:!0},ae=dj(y);bCe();let xe,L=0;const G=Ee=>{for(const pt of z||[])pt.eventProcessor&&(Ee=pt.eventProcessor(Ee));return w&&!te&&(Ee=w(Ee)),Ee};mn=(Ee,pt)=>{var Ce;const je=Ee;if(je.timestamp=dy(),(Ce=Nl[0])!=null&&Ce.isFrozen()&&je.type!==wt.FullSnapshot&&!(je.type===wt.IncrementalSnapshot&&je.data.source===ft.Mutation)&&Nl.forEach(Be=>Be.unfreeze()),$)e?.(G(je),pt);else if(te){const Be={type:"rrweb",event:G(je),origin:window.location.origin,isCheckout:pt};window.parent.postMessage(Be,"*")}if(je.type===wt.FullSnapshot)xe=je,L=0;else if(je.type===wt.IncrementalSnapshot){if(je.data.source===ft.Mutation&&je.data.isAttachIframe)return;L++;const Be=r&&L>=r,He=n&&je.timestamp-xe.timestamp>n;(Be||He)&&bv(!0)}};const Y=Ee=>{mn({type:wt.IncrementalSnapshot,data:{source:ft.Mutation,...Ee}})},J=Ee=>mn({type:wt.IncrementalSnapshot,data:{source:ft.Scroll,...Ee}}),oe=Ee=>mn({type:wt.IncrementalSnapshot,data:{source:ft.CanvasMutation,...Ee}}),he=Ee=>mn({type:wt.IncrementalSnapshot,data:{source:ft.AdoptedStyleSheet,...Ee}}),ce=new JCe({mutationCb:Y,adoptedStyleSheetCb:he}),ve=new $Ce({mirror:$s,mutationCb:Y,stylesheetManager:ce,recordCrossOriginIframes:O,wrappedEmit:mn});for(const Ee of z||[])Ee.getMirror&&Ee.getMirror({nodeMirror:$s,crossOriginIframeMirror:ve.crossOriginIframeMirror,crossOriginIframeStyleMirror:ve.crossOriginIframeStyleMirror});const _e=new ewe;Ox=new QCe({recordCanvas:N,mutationCb:oe,win:window,blockClass:s,blockSelector:o,mirror:$s,sampling:T.canvas,dataURLOptions:x});const Xe=new HCe({mutationCb:Y,scrollCb:J,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:f,inlineStylesheet:h,maskInputOptions:fe,dataURLOptions:x,maskTextFn:E,maskInputFn:S,recordCanvas:N,inlineImages:D,sampling:T,slimDOMOptions:ae,iframeManager:ve,stylesheetManager:ce,canvasManager:Ox,keepIframeSrcFn:q,processedNodeManager:_e},mirror:$s});bv=(Ee=!1)=>{if(!M)return;mn({type:wt.Meta,data:{href:window.location.href,width:kB(),height:PB()}},Ee),ce.reset(),Xe.init(),Nl.forEach(Ce=>Ce.lock());const pt=A0e(document,{mirror:$s,blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:f,inlineStylesheet:h,maskAllInputs:fe,maskTextFn:E,maskInputFn:S,slimDOM:ae,dataURLOptions:x,recordCanvas:N,inlineImages:D,onSerialize:Ce=>{UB(Ce,$s)&&ve.addIframe(Ce),FB(Ce,$s)&&ce.trackLinkElement(Ce),CA(Ce)&&Xe.addShadowRoot(rt.shadowRoot(Ce),document)},onIframeLoad:(Ce,je)=>{ve.attachIframe(Ce,je),Xe.observeAttachShadow(Ce)},onStylesheetLoad:(Ce,je)=>{ce.attachLinkElement(Ce,je)},keepIframeSrcFn:q});if(!pt)return console.warn("Failed to snapshot the document");mn({type:wt.FullSnapshot,data:{node:pt,initialOffset:MB(window)}},Ee),Nl.forEach(Ce=>Ce.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ce.adoptStyleSheets(document.adoptedStyleSheets,$s.getId(document))};try{const Ee=[],pt=je=>{var Be;return vt(BCe)({mutationCb:Y,mousemoveCb:(He,gr)=>mn({type:wt.IncrementalSnapshot,data:{source:gr,positions:He}}),mouseInteractionCb:He=>mn({type:wt.IncrementalSnapshot,data:{source:ft.MouseInteraction,...He}}),scrollCb:J,viewportResizeCb:He=>mn({type:wt.IncrementalSnapshot,data:{source:ft.ViewportResize,...He}}),inputCb:He=>mn({type:wt.IncrementalSnapshot,data:{source:ft.Input,...He}}),mediaInteractionCb:He=>mn({type:wt.IncrementalSnapshot,data:{source:ft.MediaInteraction,...He}}),styleSheetRuleCb:He=>mn({type:wt.IncrementalSnapshot,data:{source:ft.StyleSheetRule,...He}}),styleDeclarationCb:He=>mn({type:wt.IncrementalSnapshot,data:{source:ft.StyleDeclaration,...He}}),canvasMutationCb:oe,fontCb:He=>mn({type:wt.IncrementalSnapshot,data:{source:ft.Font,...He}}),selectionCb:He=>{mn({type:wt.IncrementalSnapshot,data:{source:ft.Selection,...He}})},customElementCb:He=>{mn({type:wt.IncrementalSnapshot,data:{source:ft.CustomElement,...He}})},blockClass:s,ignoreClass:a,ignoreSelector:u,maskTextClass:c,maskTextSelector:f,maskInputOptions:fe,inlineStylesheet:h,sampling:T,recordDOM:M,recordCanvas:N,inlineImages:D,userTriggeredOnInput:F,collectFonts:H,doc:je,maskInputFn:S,maskTextFn:E,keepIframeSrcFn:q,blockSelector:o,slimDOMOptions:ae,dataURLOptions:x,mirror:$s,iframeManager:ve,stylesheetManager:ce,shadowDomManager:Xe,processedNodeManager:_e,canvasManager:Ox,ignoreCSSAttributes:K,plugins:((Be=z?.filter(He=>He.observer))==null?void 0:Be.map(He=>({observer:He.observer,options:He.options,callback:gr=>mn({type:wt.Plugin,data:{plugin:He.name,payload:gr}})})))||[]},C)};ve.addLoadListener(je=>{try{Ee.push(pt(je.contentDocument))}catch(Be){console.warn(Be)}});const Ce=()=>{bv(),Ee.push(pt(document)),hy=!0};return["interactive","complete"].includes(document.readyState)?Ce():(Ee.push(Cr("DOMContentLoaded",()=>{mn({type:wt.DomContentLoaded,data:{}}),k==="DOMContentLoaded"&&Ce()})),Ee.push(Cr("load",()=>{mn({type:wt.Load,data:{}}),k==="load"&&Ce()},window))),()=>{Ee.forEach(je=>{try{je()}catch(Be){String(Be).toLowerCase().includes("cross-origin")||console.warn(Be)}}),_e.destroy(),hy=!1,RCe()}}catch(Ee){console.warn(Ee)}}bp.addCustomEvent=(t,e)=>{if(!hy)throw new Error("please add custom event after start recording");mn({type:wt.Custom,data:{tag:t,payload:e}})};bp.freezePage=()=>{Nl.forEach(t=>t.freeze())};bp.takeFullSnapshot=t=>{if(!hy)throw new Error("please take full snapshot after start recording");bv(t)};bp.mirror=$s;var C5;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(C5||(C5={}));const twe="rrweb",nwe={maskAllInputs:!0,maskTextSelector:"*",maskInputOptions:void 0},rwe={additionalSampleRate:1,batchSize:50,flushInterval:5e3,recordOptions:{slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,recordCrossOriginIframes:!1}},w5=rwe;class swe extends Ms{constructor(e){super(twe),this.recordingEvents=[],this.isRecording=!1,this.recordingStartTime=null,this.flushTimer=null,this.stopRecording=null,this.enabled=!1;const n=Object.assign(Object.assign(Object.assign({},w5.recordOptions),e?.recordOptions),nwe);this.config=Object.assign(Object.assign(Object.assign({},w5),e),{recordOptions:n}),be.info("RRWebPlugin initialized",{additionalSampleRate:this.config.additionalSampleRate,batchSize:this.config.batchSize,flushInterval:this.config.flushInterval})}enable(){var e;if(this.enabled){be.info("RRWebPlugin already enabled");return}const n=(e=this.context)===null||e===void 0?void 0:e.getSession();if(!n||!n.record){be.warn("RRWebPlugin skipping - session not being recorded",{hasSession:!!n,sessionRecord:n?.record});return}const r=Math.random();if(r>this.config.additionalSampleRate){be.warn("RRWebPlugin skipping - session replay additionalSampleRate",{randomValue:r,samplingRate:this.config.additionalSampleRate});return}this.enabled=!0,be.info("RRWebPlugin enabled - starting recording"),this.startRecording()}disable(){if(!this.enabled){be.info("RRWebPlugin already disabled");return}be.info("RRWebPlugin disabled - stopping recording"),this.enabled=!1,this.stopCurrentRecording()}record(e){const n=e?.action;n==="start"?(be.info("RRWebPlugin manual start recording"),this.startRecording()):n==="stop"&&(be.info("RRWebPlugin manual stop recording"),this.stopCurrentRecording())}onload(){}startRecording(){this.recordingStartTime=Date.now(),this.recordingEvents=[],this.isRecording=!0,be.info("RRWebPlugin starting rrweb recording",{startTime:this.recordingStartTime});const e=bp(Object.assign(Object.assign({},this.config.recordOptions),{emit:this.handleRRWebEvent.bind(this)}));e?(this.stopRecording=e,be.info("RRWebPlugin rrweb recording initialized successfully")):be.warn("RRWebPlugin failed to initialize rrweb recording"),this.flushTimer=window.setInterval(()=>{this.flush()},this.config.flushInterval)}stopCurrentRecording(){if(!this.isRecording){be.info("RRWebPlugin stopCurrentRecording called but not recording");return}be.info("RRWebPlugin stopping current recording"),this.isRecording=!1,this.stopRecording&&(this.stopRecording(),this.stopRecording=null,be.info("RRWebPlugin rrweb recording stopped")),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null,be.info("RRWebPlugin flush timer cleared")),this.flush()}handleRRWebEvent(e){this.isRecording&&(this.recordingEvents.push(e),this.recordingEvents.length>=this.config.batchSize&&(be.info("RRWebPlugin flushing events due to batch size",{eventCount:this.recordingEvents.length,batchSize:this.config.batchSize}),this.flush()))}flush(){if(this.recordingEvents.length===0){be.info("RRWebPlugin flushEvent called but no events to flush");return}be.info("RRWebPlugin flushing events",{eventCount:this.recordingEvents.length});const e=[...this.recordingEvents],n={version:"1.0.0",events:e,eventCount:e.length};this.context.record(l4,n),be.info("RRWebPlugin events sent to RUM",{eventType:l4,eventCount:this.recordingEvents.length}),this.recordingEvents=[]}}var owe=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n},xA;(function(t){t.Path="PATH",t.Hash="HASH",t.PathAndHash="PATH_AND_HASH"})(xA||(xA={}));const ZB="us-west-2",_A=`https://dataplane.rum.${ZB}.amazonaws.com`,XB=()=>({unique:!1,domain:window.location.hostname,path:"/",sameSite:"Strict",secure:!0}),QB=t=>({allowCookies:!1,batchLimit:100,client:Ive,compressionStrategy:{enabled:!0},cookieAttributes:t,debug:!1,disableAutoPageView:!1,dispatchInterval:5*1e3,enableRumClient:!0,enableXRay:!1,endpoint:_A,endpointUrl:new URL(_A),eventCacheSize:1e3,eventPluginsToLoad:[],pageIdFormat:xA.Path,pagesToExclude:[],pagesToInclude:[/.*/],signing:!1,recordResourceUrl:!0,retries:2,routeChangeComplete:100,routeChangeTimeout:1e4,sessionAttributes:{},sessionEventLimit:200,sessionLengthSeconds:1800,sessionSampleRate:1,suppressSessionStartEvent:!1,useBeacon:!0,userIdRetentionDays:30,enableW3CTraceId:!1,candidatesCacheSize:10});let iwe=class{constructor(e,n,r,s={}){var{cookieAttributes:o}=s,a=owe(s,["cookieAttributes"]);this.eventBus=new $z,typeof r>"u"&&(r="us-west-2"),this.applicationId=e;const u=Object.assign(Object.assign({},XB()),o);this.config=Object.assign(Object.assign({fetchFunction:fetch},QB(u)),a),this.config.sessionId&&(this.config.suppressSessionStartEvent=!0),this.config.endpoint=a.endpoint?a.endpoint:_A.replace(ZB,r),this.config.endpointUrl=new URL(this.config.endpoint),be.configure(this.config.debug),be.info("Initialized RUM Slim"),this.eventCache=new jye({id:e,version:n},this.config,this.eventBus),this.dispatchManager=this.initDispatch(r,e),this.pluginManager=this.initPluginManager(e,n),this.eventCache.setPluginFlushHook(()=>this.pluginManager.flush()),this.config.enableRumClient?this.enable():this.disable()}setAwsCredentials(e){this.dispatchManager.setAwsCredentials(e)}setSigningConfigFactory(e){this.dispatchManager.setSigningConfigFactory(e)}addSessionAttributes(e){this.eventCache.addSessionAttributes(e)}getSessionId(){return this.eventCache.getSessionId()}pinSessionId(e){this.eventCache.pinSessionId(e)}startSession(e){return this.eventCache.startSession(e)}getUserId(){return this.eventCache.getUserId()}pinUserId(e){this.eventCache.pinUserId(e)}setEventMetadataHook(e){this.eventCache.setEventMetadataHook(e)}clearEventMetadataHook(){this.eventCache.clearEventMetadataHook()}addPlugin(e){this.pluginManager.addPlugin(e)}dispatch(){this.dispatchManager.dispatchFetch()}dispatchBeacon(){this.dispatchManager.dispatchBeacon()}enable(){this.eventCache.enable(),this.pluginManager.enable(),this.dispatchManager.enable()}disable(){this.dispatchManager.disable(),this.pluginManager.disable(),this.eventCache.disable()}allowCookies(e){this.config.allowCookies=e}clearCookies(){const e=this.config.cookieAttributes;[Vv,Gv,Gc,`${Vv}_${this.applicationId}`,`${Gv}_${this.applicationId}`,`${Gc}_${this.applicationId}`].forEach(r=>Mye(r,e))}recordPageView(e){this.eventCache.recordPageView(e)}recordError(e){this.pluginManager.record("com.amazonaws.rum.js-error",e)}registerDomEvents(e){this.pluginManager.updatePlugin("com.amazonaws.rum.dom-event",e)}recordEvent(e,n,r){this.eventCache.recordEvent(e,n,r)}initDispatch(e,n){return new Ove(n,e,this.config.endpointUrl,this.eventCache,this.config)}initPluginManager(e,n){const r={applicationId:e,applicationVersion:n,config:this.config,record:this.eventCache.recordEvent,recordCandidate:this.eventCache.recordCandidate,recordPageView:this.eventCache.recordPageView,getSession:this.eventCache.getSession,eventBus:this.eventBus},s=new Nye(r);return this.config.disableAutoPageView||s.addPlugin(new sbe),this.config.eventPluginsToLoad.forEach(o=>{s.addPlugin(o)}),s}};var Ys;(function(t){t.Errors="errors",t.Performance="performance",t.Interaction="interaction",t.Http="http",t.Replay="replay"})(Ys||(Ys={}));var x5;(function(t){t.Path="PATH",t.Hash="HASH",t.PathAndHash="PATH_AND_HASH"})(x5||(x5={}));const awe=t=>Object.assign(Object.assign({},QB(t)),{signing:!0,telemetries:[Ys.Errors,Ys.Performance,Ys.Http,Ys.Replay]});class lwe extends iwe{constructor(e,n,r,s={}){super(e,n,r,Object.assign(Object.assign({},awe(XB())),s)),be.info(`RUM client initialized for app: ${e}`),be.info(`Telemetries enabled: ${this.config.telemetries.join(", ")||"none"}`)}initDispatch(e,n){const r=super.initDispatch(e,n);return r.setSigningConfigFactory(oye),r.setCognitoCredentialProviderFactory((s,o,a,u)=>{const c={identityPoolId:a,guestRoleArn:u,cookieAttributes:s.cookieAttributes};return a&&u?new Eye(c,o).ChainAnonymousCredentialsProvider:new Cye(c,o).ChainAnonymousCredentialsProvider}),this.config.signing&&this.config.identityPoolId&&r.setCognitoCredentials(this.config.identityPoolId,this.config.guestRoleArn),r}initPluginManager(e,n){const r=super.initPluginManager(e,n);return this.constructBuiltinPlugins().forEach(o=>{r.addPlugin(o)}),r}recordError(e){this.pluginManager.record(Wz,e)}registerDomEvents(e){this.pluginManager.updatePlugin(Hz,e)}constructBuiltinPlugins(){let e=[];const n=this.telemetryFunctor();return this.config.telemetries.forEach(r=>{typeof r=="string"&&n[r.toLowerCase()]?e=[...e,...n[r.toLowerCase()]({})]:Array.isArray(r)&&n[r[0].toLowerCase()]&&(e=[...e,...n[r[0].toLowerCase()](r[1])])}),e}telemetryFunctor(){return{[Ys.Errors]:e=>[new Xye(e)],[Ys.Performance]:e=>[new ebe(e),new ibe(e),new Abe(e)],[Ys.Interaction]:e=>[new OR(e)],[Ys.Http]:e=>[new Nbe(e),new Rbe(e)],[Ys.Replay]:e=>[new swe(e)]}}}const JB={recordPageView:()=>{},recordError:()=>{},recordEvent:()=>{},recordTiming:()=>{}},uwe=/([?&](token|access_token|id_token|authorization)=[^&]*)|\/messages\/[a-z0-9_-]+/gi;function e$(t){return t.replace(uwe,"[redacted]")}function cwe(t){const e=t.indexOf("?"),n=t.indexOf("#"),r=e===-1&&n===-1?t.length:e===-1?n:n===-1?e:Math.min(e,n);return e$(t.slice(0,r))}function dwe(t){const e=e$(t.message);if(e===t.message)return t;const n=new Error(e);return n.name=t.name,n.stack=t.stack,n}function fwe(t){return{recordPageView(e){t.recordPageView(cwe(e))},recordError(e,n){t.recordError(dwe(e)),n&&t.recordEvent("telemetry.error_context",n)},recordEvent(e,n){t.recordEvent(e,n??{})},recordTiming(e,n,r){t.recordEvent("telemetry.timing",{...r,name:e,durationMs:String(n)})}}}function _5(t){return t instanceof Error?t:new Error(String(t))}function hwe(t){window.addEventListener("error",e=>{t.recordError(_5(e.error??e.message))}),window.addEventListener("unhandledrejection",e=>{t.recordError(_5(e.reason))})}function pwe(){const{appMonitorId:t,identityPoolId:e,region:n}=Dy().rum;if(!t)return JB;const r=new lwe(t,"1.0.0",n,{sessionSampleRate:1,identityPoolId:e,endpoint:`https://dataplane.rum.${n}.amazonaws.com`,telemetries:["performance"],disableAutoPageView:!0,allowCookies:!1,enableXRay:!1}),s=fwe(r);return hwe(s),s}const t$=_.createContext(JB);function CIe(){return _.useContext(t$)}const AA="remit.theme",gwe="dark";function A5(){return typeof localStorage>"u"?"system":localStorage.getItem(AA)??"system"}function TA(t){if(typeof document>"u")return;const e=t==="dark"||t==="system"&&typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.classList.toggle(gwe,e)}function wIe(t){typeof localStorage<"u"&&(t==="system"?localStorage.removeItem(AA):localStorage.setItem(AA,t)),TA(t)}const mwe=()=>{if(typeof window>"u"||(TA(A5()),typeof window.matchMedia!="function"))return;const t=window.matchMedia("(prefers-color-scheme: dark)"),e=()=>{TA(A5())};typeof t.addEventListener=="function"?t.addEventListener("change",e):t.addListener(e)},vwe=(t,e,n,r)=>{const s=[n,{code:e,...r||{}}];if(t?.services?.logger?.forward)return t.services.logger.forward(s,"warn","react-i18next::",!0);Bl(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),t?.services?.logger?.warn?t.services.logger.warn(...s):console?.warn&&console.warn(...s)},T5={},RA=(t,e,n,r)=>{Bl(n)&&T5[n]||(Bl(n)&&(T5[n]=new Date),vwe(t,e,n,r))},n$=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},IA=(t,e,n)=>{t.loadNamespaces(e,n$(t,n))},R5=(t,e,n,r)=>{if(Bl(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return IA(t,n,r);n.forEach(s=>{t.options.ns.indexOf(s)<0&&t.options.ns.push(s)}),t.loadLanguages(e,n$(t,r))},ywe=(t,e,n={})=>!e.languages||!e.languages.length?(RA(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,s)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,t))return!1}}),Bl=t=>typeof t=="string",bwe=t=>typeof t=="object"&&t!==null,Swe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ewe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Cwe=t=>Ewe[t],wwe=t=>t.replace(Swe,Cwe);let OA={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:wwe};const xwe=(t={})=>{OA={...OA,...t}},_we=()=>OA;let r$;const Awe=t=>{r$=t},Twe=()=>r$,Rwe={type:"3rdParty",init(t){xwe(t.options.react),Awe(t)}},Iwe=_.createContext();class Owe{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Nwe=(t,e)=>{const n=_.useRef();return _.useEffect(()=>{n.current=t},[t,e]),n.current},s$=(t,e,n,r)=>t.getFixedT(e,n,r),Mwe=(t,e,n,r)=>_.useCallback(s$(t,e,n,r),[t,e,n,r]),Pwe=(t,e={})=>{const{i18n:n}=e,{i18n:r,defaultNS:s}=_.useContext(Iwe)||{},o=n||r||Twe();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Owe),!o){RA(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const R=(N,O)=>Bl(O)?O:bwe(O)&&Bl(O.defaultValue)?O.defaultValue:Array.isArray(N)?N[N.length-1]:N,M=[R,{},!1];return M.t=R,M.i18n={},M.ready=!1,M}o.options.react?.wait&&RA(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={..._we(),...o.options.react,...e},{useSuspense:u,keyPrefix:c}=a;let f=t||s||o.options?.defaultNS;f=Bl(f)?[f]:f||["translation"],o.reportNamespaces.addUsedNamespaces?.(f);const h=(o.isInitialized||o.initializedStoreOnce)&&f.every(R=>ywe(R,o,a)),g=Mwe(o,e.lng||null,a.nsMode==="fallback"?f:f[0],c),m=()=>g,y=()=>s$(o,e.lng||null,a.nsMode==="fallback"?f:f[0],c),[S,E]=_.useState(m);let C=f.join();e.lng&&(C=`${e.lng}${C}`);const w=Nwe(C),T=_.useRef(!0);_.useEffect(()=>{const{bindI18n:R,bindI18nStore:M}=a;T.current=!0,!h&&!u&&(e.lng?R5(o,e.lng,f,()=>{T.current&&E(y)}):IA(o,f,()=>{T.current&&E(y)})),h&&w&&w!==C&&T.current&&E(y);const N=()=>{T.current&&E(y)};return R&&o?.on(R,N),M&&o?.store.on(M,N),()=>{T.current=!1,o&&R&&R?.split(" ").forEach(O=>o.off(O,N)),M&&o&&M.split(" ").forEach(O=>o.store.off(O,N))}},[o,C]),_.useEffect(()=>{T.current&&h&&E(m)},[o,c,h]);const x=[S,o,h];if(x.t=S,x.i18n=o,x.ready=h,h||!h&&!u)return x;throw new Promise(R=>{e.lng?R5(o,e.lng,f,()=>R()):IA(o,f,()=>R())})},kwe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts",...t,headers:{"Content-Type":"application/json",...t.headers}}),Dwe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/oauth/microsoft/start",...t,headers:{"Content-Type":"application/json",...t.headers}}),Lwe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/test-connection",...t,headers:{"Content-Type":"application/json",...t.headers}}),Uwe=t=>(t.client??ke).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}",...t}),Fwe=t=>(t.client??ke).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),zwe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters",...t}),jwe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters",...t,headers:{"Content-Type":"application/json",...t.headers}}),Bwe=t=>(t.client??ke).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters/{filterId}",...t}),$we=t=>(t.client??ke).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters/{filterId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),Hwe=t=>(t.client??ke).put({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/folder-roles/{role}",...t,headers:{"Content-Type":"application/json",...t.headers}}),qwe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/labels",...t}),Wwe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/labels",...t,headers:{"Content-Type":"application/json",...t.headers}}),Vwe=t=>(t.client??ke).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/labels/{labelId}",...t}),Gwe=t=>(t.client??ke).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/labels/{labelId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),Kwe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes",...t}),Ywe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes",...t,headers:{"Content-Type":"application/json",...t.headers}}),xIe=t=>(t.client??ke).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes/{mailboxId}",...t}),Zwe=t=>(t.client??ke).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes/{mailboxId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),Xwe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize",...t,headers:{"Content-Type":"application/json",...t.headers}}),Qwe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize/preview",...t,headers:{"Content-Type":"application/json",...t.headers}}),Jwe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize/{organizeJobId}",...t}),exe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/sync",...t}),txe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/sync/status",...t}),nxe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/addresses/search",...t}),rxe=t=>(t.client??ke).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/addresses/{addressId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),sxe=t=>(t?.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/config",...t}),_Ie=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/mailboxes/{mailboxId}/threads",...t}),oxe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/mailboxes/{mailboxId}/threads/search",...t}),ixe=t=>(t.client??ke).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/me",...t,headers:{"Content-Type":"application/json",...t.headers}}),axe=t=>(t?.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/me/export",...t}),lxe=t=>(t?.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/me/vip-suggestions",...t}),uxe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/delete",...t,headers:{"Content-Type":"application/json",...t.headers}}),cxe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/flags",...t,headers:{"Content-Type":"application/json",...t.headers}}),dxe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/labels",...t,headers:{"Content-Type":"application/json",...t.headers}}),fxe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/move",...t,headers:{"Content-Type":"application/json",...t.headers}}),hxe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}",...t}),pxe=t=>(t.client??ke).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}/flags",...t,headers:{"Content-Type":"application/json",...t.headers}}),gxe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}/raw",...t}),mxe=t=>(t?.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox",...t}),vxe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox",...t,headers:{"Content-Type":"application/json",...t.headers}}),yxe=t=>(t.client??ke).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t}),bxe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t}),Sxe=t=>(t.client??ke).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),Exe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}/send",...t}),Cxe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/search/semantic",...t}),wxe=t=>(t?.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/system/update",...t}),xxe=t=>(t.client??ke).post({security:[{name:"Authorization",type:"apiKey"}],url:"/system/update",...t,headers:{"Content-Type":"application/json",...t.headers}}),_xe=t=>(t?.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/threads",...t}),Axe=t=>(t.client??ke).get({security:[{name:"Authorization",type:"apiKey"}],url:"/threads/{threadId}/messages",...t}),AIe=t=>({mutationFn:async n=>{const{data:r}=await kwe({...t,...n,throwOnError:!0});return r}}),Fn=(t,e,n,r)=>{const s={_id:t,baseUrl:e?.baseUrl||(e?.client??ke).getConfig().baseUrl};return e?.body&&(s.body=e.body),e?.headers&&(s.headers=e.headers),e?.path&&(s.path=e.path),e?.query&&(s.query=e.query),[s]},TIe=t=>({mutationFn:async n=>{const{data:r}=await Dwe({...t,...n,throwOnError:!0});return r}}),RIe=t=>({mutationFn:async n=>{const{data:r}=await Lwe({...t,...n,throwOnError:!0});return r}}),IIe=t=>({mutationFn:async n=>{const{data:r}=await Uwe({...t,...n,throwOnError:!0});return r}}),OIe=t=>({mutationFn:async n=>{const{data:r}=await Fwe({...t,...n,throwOnError:!0});return r}}),Txe=t=>Fn("filterOperationsListFilters",t),NIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await zwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Txe(t)}),MIe=t=>({mutationFn:async n=>{const{data:r}=await jwe({...t,...n,throwOnError:!0});return r}}),PIe=t=>({mutationFn:async n=>{const{data:r}=await Bwe({...t,...n,throwOnError:!0});return r}}),kIe=t=>Fn("filterDetailOperationsGetFilter",t),DIe=t=>({mutationFn:async n=>{const{data:r}=await $we({...t,...n,throwOnError:!0});return r}}),LIe=t=>({mutationFn:async n=>{const{data:r}=await Hwe({...t,...n,throwOnError:!0});return r}}),Rxe=t=>Fn("labelOperationsListLabels",t),UIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await qwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Rxe(t)}),FIe=t=>({mutationFn:async n=>{const{data:r}=await Wwe({...t,...n,throwOnError:!0});return r}}),zIe=t=>({mutationFn:async n=>{const{data:r}=await Vwe({...t,...n,throwOnError:!0});return r}}),jIe=t=>({mutationFn:async n=>{const{data:r}=await Gwe({...t,...n,throwOnError:!0});return r}}),Ixe=t=>Fn("mailboxOperationsListMailboxes",t),BIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Kwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Ixe(t)}),$Ie=t=>({mutationFn:async n=>{const{data:r}=await Ywe({...t,...n,throwOnError:!0});return r}}),HIe=t=>({mutationFn:async n=>{const{data:r}=await Zwe({...t,...n,throwOnError:!0});return r}}),qIe=t=>({mutationFn:async n=>{const{data:r}=await Xwe({...t,...n,throwOnError:!0});return r}}),WIe=t=>({mutationFn:async n=>{const{data:r}=await Qwe({...t,...n,throwOnError:!0});return r}}),Oxe=t=>Fn("organizeJobDetailOperationsGetOrganizeJob",t),VIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Jwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Oxe(t)}),GIe=t=>({mutationFn:async n=>{const{data:r}=await exe({...t,...n,throwOnError:!0});return r}}),Nxe=t=>Fn("syncOperationsGetSyncStatus",t),KIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await txe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Nxe(t)}),Mxe=t=>Fn("addressOperationsSearchAddresses",t),YIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await nxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Mxe(t)}),ZIe=t=>({mutationFn:async n=>{const{data:r}=await rxe({...t,...n,throwOnError:!0});return r}}),Pxe=t=>Fn("configOperationsGetConfig",t),kxe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await sxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Pxe(t)}),XIe=t=>Fn("threadOperationsListThreads",t),Dxe=t=>Fn("threadOperationsSearchThreads",t),QIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await oxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Dxe(t)}),JIe=t=>({mutationFn:async n=>{const{data:r}=await ixe({...t,...n,throwOnError:!0});return r}}),e2e=t=>({mutationFn:async n=>{const{data:r}=await axe({...t,...n,throwOnError:!0});return r}}),Lxe=t=>Fn("meOperationsListVipSuggestions",t),t2e=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await lxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Lxe(t)}),n2e=t=>({mutationFn:async n=>{const{data:r}=await uxe({...t,...n,throwOnError:!0});return r}}),r2e=t=>({mutationFn:async n=>{const{data:r}=await cxe({...t,...n,throwOnError:!0});return r}}),s2e=t=>({mutationFn:async n=>{const{data:r}=await dxe({...t,...n,throwOnError:!0});return r}}),o2e=t=>({mutationFn:async n=>{const{data:r}=await fxe({...t,...n,throwOnError:!0});return r}}),Uxe=t=>Fn("messageOperationsDescribeMessage",t),i2e=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await hxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Uxe(t)}),a2e=t=>({mutationFn:async n=>{const{data:r}=await pxe({...t,...n,throwOnError:!0});return r}}),Fxe=t=>Fn("messageOperationsGetRawMessage",t),l2e=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await gxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Fxe(t)}),o$=t=>Fn("outboxOperationsListOutboxMessages",t),u2e=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await mxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:o$(t)}),c2e=t=>({mutationFn:async n=>{const{data:r}=await vxe({...t,...n,throwOnError:!0});return r}}),d2e=t=>({mutationFn:async n=>{const{data:r}=await yxe({...t,...n,throwOnError:!0});return r}}),zxe=t=>Fn("outboxDetailOperationsGetOutboxMessage",t),jxe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await bxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:zxe(t)}),f2e=t=>({mutationFn:async n=>{const{data:r}=await Sxe({...t,...n,throwOnError:!0});return r}}),h2e=t=>({mutationFn:async n=>{const{data:r}=await Exe({...t,...n,throwOnError:!0});return r}}),Bxe=t=>Fn("semanticSearchOperationsSemanticSearch",t),p2e=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Cxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Bxe(t)}),i$=t=>Fn("systemOperationsGetSystemUpdate",t),$xe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await wxe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:i$(t)}),Hxe=t=>({mutationFn:async n=>{const{data:r}=await xxe({...t,...n,throwOnError:!0});return r}}),qxe=t=>Fn("unifiedThreadOperationsListAllThreads",t),Wxe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await _xe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:qxe(t)}),Vxe=t=>Fn("threadDetailOperationsListThreadMessages",t),g2e=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Axe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Vxe(t)}),a$=_.createContext(void 0),I5={isOpen:!1,mode:"new"},Gxe=2e3,Kxe=6e4,Yxe=({children:t})=>{const[e,n]=_.useState(I5),[r,s]=_.useState(),o=_.useRef(0),a=vb(),{data:u}=F7({...jxe({path:{outboxMessageId:r??""}}),enabled:!!r,refetchInterval:y=>{const S=y.state.data?.status;return S==="sent"||S==="failed"||S==="blocked"||Date.now()-o.current>Kxe?!1:Gxe}});_.useEffect(()=>{if(!u||!r)return;(u.status==="sent"||u.status==="failed"||u.status==="blocked")&&(s(void 0),a.invalidateQueries({queryKey:o$()}))},[u,r,a]);const c=_.useCallback(y=>{n({...y,isOpen:!0})},[]),f=_.useCallback(()=>{n(I5)},[]),h=_.useCallback(y=>{n(S=>({...S,outboxMessageId:y}))},[]),g=_.useCallback(y=>{o.current=Date.now(),s(y)},[]),m=_.useMemo(()=>({state:e,openCompose:c,closeCompose:f,setOutboxMessageId:h,startSendPolling:g}),[e,c,f,h,g]);return I.jsx(a$.Provider,{value:m,children:t})},m2e=()=>{const t=_.useContext(a$);if(!t)throw new Error("useCompose must be used within a ComposeProvider");return t},cI="remit.self-update.run",Zxe=600,Xxe=300,O5="remit logs",Qxe="https://github.com/remit-mail/reader/releases/tag/",Jxe={checking:"preparing",pulling:"preparing",snapshotting:"preparing",stopping:"restarting",starting:"restarting",verifying:"reconnecting",committing:"reconnecting",rollingBack:"reconnecting",recovering:"reconnecting"};function NA(t){return Jxe[t]??"reconnecting"}function l$(t){const e=au(t);return e===404||e===403||e===401}function u$(t,e){const n=t?.check;if(n?.status==="ok"&&!(!n.updateAvailable||!n.latestVersion))return{version:n.latestVersion,releasedAt:py(n.publishedAt)??e,releaseNotesUrl:n.releaseNotesUrl??d$(n.latestVersion),summary:n.summary??""}}function e_e(t){const e=t?.check.schemaVersion,n=t?.currentSchemaVersion;return e===void 0||n===void 0?!1:e>n}function t_e(){try{const t=localStorage.getItem(cI);if(!t)return null;const e=JSON.parse(t);return r_e(e)?e:null}catch{return null}}function n_e(t){try{localStorage.setItem(cI,JSON.stringify(t))}catch{}}function N5(){try{localStorage.removeItem(cI)}catch{}}function r_e(t){if(!t||typeof t!="object")return!1;const e=t;return typeof e.runId=="string"&&typeof e.attemptedVersion=="string"&&typeof e.previousVersion=="string"&&typeof e.startedAt=="number"}function M5(){return Zxe+Xxe}function c$(t,e){return Math.max(0,Math.floor((e-t)/1e3))}function py(t){if(!t)return;const e=Date.parse(t);return Number.isNaN(e)?void 0:e}function d$(t){return`${Qxe}${t}`}function ah(t,e,n,r,s){return{status:"applying",runId:t,version:e,target:n,phase:r,elapsedSeconds:s}}function s_e(t,e,n){switch(n){case"succeeded":return{status:"succeeded",runId:e.runId,version:e.targetVersion,previousVersion:e.fromVersion,releaseNotesUrl:t.check.releaseNotesUrl??d$(e.targetVersion)};case"rolledBack":return{status:"rolledBack",runId:e.runId,version:e.fromVersion,attemptedVersion:e.targetVersion,reason:e.message,logsCommand:e.logCommand};case"rollbackFailed":return{status:"rollbackFailed",runId:e.runId,attemptedVersion:e.targetVersion,previousVersion:e.fromVersion,reason:e.message,logsCommand:e.logCommand};case"abandoned":return{status:"abandoned",runId:e.runId,version:e.fromVersion,attemptedVersion:e.targetVersion,reason:e.message,logsCommand:e.logCommand};default:return n}}function o_e(t,e,n){const r=t.check;if(e)return{status:"checking",version:t.currentVersion};if(r.status==="failed")return{status:"checkFailed",version:t.currentVersion,reason:r.error??"Remit could not reach the update service.",lastCheckedAt:py(r.lastCheckedAt)};if(r.status==="disabled")return{status:"neverChecked",version:t.currentVersion};const s=u$(t,n);return s?{status:"available",version:t.currentVersion,release:s}:{status:"upToDate",version:t.currentVersion,checkedAt:py(r.lastCheckedAt)??n}}function $m(t,e,n,r){return{surface:{status:"ready",section:t,overlay:e},clearStoredRun:n,releaseHeld:r}}function i_e(t,e,n,r,s){const o=c$(t.startedAt,s),a=e?.currentVersion??t.previousVersion,u=!r&&n!==null&&n.runId===t.runId;if(u&&n!==null&&n.outcome!==null)return null;if(u&&n!==null){const f=NA(n.phase);return $m(ah(n.runId,a,n.targetVersion,f,o),{kind:"applying",target:n.targetVersion,phase:f,elapsedSeconds:o},!1,!1)}if(r){const f=ah(t.runId,t.previousVersion,t.attemptedVersion,"reconnecting",o);return o>M5()?{surface:{status:"ready",section:f,overlay:{kind:"neverCameBack",attemptedVersion:t.attemptedVersion,previousVersion:t.previousVersion,elapsedSeconds:o,logsCommand:O5}},clearStoredRun:!0,releaseHeld:!1}:$m(f,{kind:"applying",target:t.attemptedVersion,phase:"reconnecting",elapsedSeconds:o},!1,!1)}if(e===void 0)return $m(ah(t.runId,a,t.attemptedVersion,"preparing",o),{kind:"applying",target:t.attemptedVersion,phase:"preparing",elapsedSeconds:o},!1,!1);if(o>M5())return{surface:{status:"ready",section:{status:"unreachable",runId:t.runId,previousVersion:t.previousVersion,attemptedVersion:t.attemptedVersion,elapsedSeconds:o,logsCommand:n?.logCommand??O5},overlay:{kind:"none"}},clearStoredRun:!0,releaseHeld:!0};const c=n!==null&&n.outcome===null?NA(n.phase):"preparing";return $m(ah(t.runId,a,t.attemptedVersion,c,o),{kind:"applying",target:t.attemptedVersion,phase:c,elapsedSeconds:o},!1,!1)}function P5(t){const{data:e,isError:n,isFetching:r,dismissedRunId:s,checkRequested:o,now:a}=t;if(n)return{surface:{status:"ready",section:{status:"checkFailed",version:e?.currentVersion??"the current version",reason:"Remit could not reach the update service."},overlay:{kind:"none"}},clearStoredRun:!0};if(!e)return{surface:{status:"loading"},clearStoredRun:!1};const u=e.run,c=u!==null&&s!==null&&u.runId===s;if(u!==null&&!c&&u.outcome!==null)return{surface:{status:"ready",section:s_e(e,u,u.outcome),overlay:{kind:"none"}},clearStoredRun:!0};if(u!==null&&!c&&u.outcome===null){const f=c$(py(u.startedAt)??a,a),h=NA(u.phase);return{surface:{status:"ready",section:ah(u.runId,u.fromVersion,u.targetVersion,h,f),overlay:{kind:"applying",target:u.targetVersion,phase:h,elapsedSeconds:f}},clearStoredRun:!1}}return{surface:{status:"ready",section:o_e(e,o&&r,a),overlay:{kind:"none"}},clearStoredRun:!1}}function a_e(t){const{data:e,isError:n,error:r,held:s,now:o}=t,a=e?.run??null;if(l$(r)&&!s)return{surface:{status:"absent"},clearStoredRun:!0,releaseHeld:!0};if(s){const c=i_e(s,e,a,n,o);return c||{surface:P5(t).surface,clearStoredRun:!0,releaseHeld:!0}}const u=P5(t);return{surface:u.surface,clearStoredRun:u.clearStoredRun,releaseHeld:!1}}const l_e=3e4,u_e=5e3;function c_e(t,e,n){if(l$(t)&&!n)return!1;const r=e!==null&&e.outcome===null;return n||r?u_e:l_e}function d_e(){const t=vb(),[e,n]=_.useState(()=>t_e()),[r,s]=_.useState(null),[o,a]=_.useState(!1),u=_.useRef(e);u.current=e;const c=F7({...$xe(),retry:!1,meta:{softError:!0},refetchInterval:R=>c_e(R.state.error,R.state.data?.run??null,u.current!==null)}),f=a_e({data:c.data,isError:c.isError,error:c.error,isFetching:c.isFetching,held:e,dismissedRunId:r,checkRequested:o,now:Date.now()}),h=_.useRef(null);h.current=f.surface.status==="ready"&&"runId"in f.surface.section?f.surface.section.runId:null;const{clearStoredRun:g,releaseHeld:m}=f;_.useEffect(()=>{g&&N5()},[g]),_.useEffect(()=>{m&&n(R=>R===null?R:null)},[m]),_.useEffect(()=>{o&&!c.isFetching&&a(!1)},[o,c.isFetching]);const{refetch:y}=c,S=_.useCallback(()=>{a(!0),y()},[y]),E=_.useCallback(()=>{y()},[y]),C=_pe({...Hxe(),meta:{softError:!0},onSuccess:R=>{const M=R.run;if(M!==null){const N={runId:M.runId,attemptedVersion:M.targetVersion,previousVersion:M.fromVersion,startedAt:Date.now()};n_e(N),n(N),s(null)}t.setQueryData(i$(),R)},onError:()=>{y()}}),{mutate:w}=C,T=_.useCallback(R=>{w({body:{targetVersion:R}})},[w]),x=_.useCallback(()=>{h.current!==null&&s(h.current),N5(),n(null)},[]);return{surface:f.surface,appliesSchemaMigration:e_e(c.data),currentVersion:c.data?.currentVersion,release:u$(c.data,Date.now()),onCheck:S,install:T,onDismissResult:x,onRetryConnection:E}}const dI=_.createContext(null);function f_e({children:t}){const e=d_e();return _.createElement(dI.Provider,{value:e},t)}function h_e(){const t=_.useContext(dI);if(t===null)throw new Error("useSelfUpdate must be used within a SelfUpdateProvider");return t}function p_e(){return _.useContext(dI)}function g_e(){const{surface:t,onRetryConnection:e}=h_e();if(t.status!=="ready")return null;const{overlay:n}=t;return n.kind==="applying"?I.jsx(gte,{target:n.target,phase:n.phase,elapsedSeconds:n.elapsedSeconds}):n.kind==="neverCameBack"?I.jsx(mte,{attemptedVersion:n.attemptedVersion,previousVersion:n.previousVersion,elapsedSeconds:n.elapsedSeconds,logsCommand:n.logsCommand,onRetryConnection:e}):null}const Nx=(...t)=>Y8(F8(t)),m_e={error:{container:"border-danger/50 bg-danger-soft",icon:"text-danger",title:"text-danger"},warning:{container:"border-warning/50 bg-warning-soft",icon:"text-warning",title:"text-warning"},info:{container:"border-accent-2/50 bg-accent-2-soft",icon:"text-accent-2",title:"text-accent-2"}},v_e={error:cQ,warning:H8,info:pQ},y_e={error:"Error",warning:"Warning",info:"Information"},b_e=({id:t,severity:e,title:n,detail:r,onDismiss:s})=>{const o=m_e[e],a=v_e[e];return I.jsxs("div",{role:e==="error"?"alert":"status","aria-live":e==="error"?"assertive":"polite",className:Nx("pointer-events-auto flex items-start gap-3 rounded-md border bg-canvas px-3 py-2 shadow-lg",o.container),children:[I.jsx(a,{className:Nx("size-5 shrink-0 mt-0.5",o.icon),"aria-hidden":"true"}),I.jsxs("div",{className:"flex-1 min-w-0",children:[I.jsx("p",{className:Nx("text-sm font-medium",o.title),children:n}),r&&I.jsx("p",{className:"mt-0.5 text-xs text-fg-muted break-words",children:r})]}),I.jsx("button",{type:"button",onClick:()=>s(t),className:"shrink-0 rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors","aria-label":`Dismiss ${y_e[e].toLowerCase()}`,children:I.jsx(Ua,{className:"size-4","aria-hidden":"true"})})]})},S_e=({errors:t,onDismiss:e})=>t.length===0?null:I.jsx("section",{"aria-label":"Notifications",className:"pointer-events-none fixed inset-x-0 top-0 z-[60] flex flex-col items-center gap-2 px-4 pt-4 sm:items-end sm:pr-6",children:I.jsx("div",{className:"flex w-full max-w-md flex-col gap-2",children:t.map(n=>I.jsx(b_e,{id:n.id,severity:n.severity,title:n.title,detail:n.detail,onDismiss:e},n.id))})}),k5=5,v2e=(t,e,n)=>({title:t,detail:f$(n)??e,error:n}),f$=t=>{if(t!=null){if(t instanceof Error)return t.message||void 0;if(typeof t=="string")return t||void 0;if(typeof t=="object"&&"message"in t&&typeof t.message=="string")return t.message||void 0}},y2e=t=>{const e=f$(t);return e?e.startsWith("Message not found"):!1},E_e=(t,e,n)=>t.severity===n&&t.title===e.title&&t.detail===e.detail,C_e=(t,e)=>{const r=[...t.filter(s=>!E_e(s,{title:e.title,detail:e.detail,severity:e.severity},e.severity)),e];return r.length<=k5?r:r.slice(r.length-k5)},w_e=(t,e)=>t.filter(n=>n.id!==e),x_e=(t,e,n)=>({id:e,severity:t.severity??"error",title:t.title,detail:t.detail,createdAt:n}),h$=_.createContext(void 0),__e=()=>typeof globalThis.crypto<"u"&&typeof globalThis.crypto.randomUUID=="function"?globalThis.crypto.randomUUID():`banner-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,A_e=({children:t})=>{const[e,n]=_.useState([]),r=_.useCallback(u=>{if(u.error!=null&&D9(u.error))return ql(u.error).correlationId;const c=x_e(u,__e(),Date.now());return n(f=>C_e(f,c)),c.id},[]),s=_.useCallback(u=>{n(c=>w_e(c,u))},[]),o=_.useCallback(()=>{n([])},[]),a=_.useMemo(()=>({errors:e,pushError:r,dismissError:s,clearAll:o}),[e,r,s,o]);return I.jsxs(h$.Provider,{value:a,children:[t,I.jsx(S_e,{errors:e,onDismiss:s})]})},b2e=()=>{const t=_.useContext(h$);if(!t)throw new Error("useErrorBanners must be used within an ErrorBannerProvider");return t},T_e=({error:t,reset:e,info:n})=>{const r=$y(t),s=ql(t,{recoverable:r,componentStack:n?.componentStack});return I.jsx(H9,{fatal:s,onRetry:r?e:void 0})},Sp=Jge()({component:I_e,errorComponent:T_e}),R_e=()=>{const{t}=Pwe("common",{useSuspense:!1});return I.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:z-50 focus:p-4 focus:bg-canvas focus:text-fg focus:rounded-md",children:t("accessibility.skipToContent","Skip to main content")})};function I_e(){return I.jsxs(A_e,{children:[I.jsxs(f_e,{children:[I.jsxs(Yxe,{children:[I.jsx(R_e,{}),I.jsx("main",{id:"main-content",className:"h-dvh overflow-hidden",children:I.jsx(_.Suspense,{fallback:I.jsx(hT,{}),children:I.jsx(gz,{})})})]}),I.jsx(g_e,{})]}),I.jsx($9,{})]})}const O_e=lr("/")({beforeLoad:()=>{throw Y7({to:"/mail"})}});var Rt;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),a={};for(const u of o)a[u]=s[u];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},t.find=(s,o)=>{for(const a of s)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(Rt||(Rt={}));var D5;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(D5||(D5={}));const Oe=Rt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ea=t=>{switch(typeof t){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return Number.isNaN(t)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(t)?Oe.array:t===null?Oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Oe.promise:typeof Map<"u"&&t instanceof Map?Oe.map:typeof Set<"u"&&t instanceof Set?Oe.set:typeof Date<"u"&&t instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},ge=Rt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ai extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,c=0;for(;c<a.path.length;){const f=a.path[c];c===a.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(a))):u[f]=u[f]||{_errors:[]},u=u[f],c++}}};return s(this),r}static assert(e){if(!(e instanceof Ai))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Rt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];n[o]=n[o]||[],n[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ai.create=t=>new Ai(t);const MA=(t,e)=>{let n;switch(t.code){case ge.invalid_type:t.received===Oe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ge.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Rt.jsonStringifyReplacer)}`;break;case ge.unrecognized_keys:n=`Unrecognized key(s) in object: ${Rt.joinValues(t.keys,", ")}`;break;case ge.invalid_union:n="Invalid input";break;case ge.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Rt.joinValues(t.options)}`;break;case ge.invalid_enum_value:n=`Invalid enum value. Expected ${Rt.joinValues(t.options)}, received '${t.received}'`;break;case ge.invalid_arguments:n="Invalid function arguments";break;case ge.invalid_return_type:n="Invalid function return type";break;case ge.invalid_date:n="Invalid date";break;case ge.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Rt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ge.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ge.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ge.custom:n="Invalid input";break;case ge.invalid_intersection_types:n="Intersection results could not be merged";break;case ge.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ge.not_finite:n="Number must be finite";break;default:n=e.defaultError,Rt.assertNever(t)}return{message:n}};let N_e=MA;function M_e(){return N_e}const P_e=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,o=[...n,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let u="";const c=r.filter(f=>!!f).slice().reverse();for(const f of c)u=f(a,{data:e,defaultError:u}).message;return{...s,path:o,message:u}};function Ae(t,e){const n=M_e(),r=P_e({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===MA?void 0:MA].filter(s=>!!s)});t.common.issues.push(r)}class cs{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return Ye;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const o=await s.key,a=await s.value;r.push({key:o,value:a})}return cs.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return Ye;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(r[o.value]=a.value)}return{status:e.value,value:r}}}const Ye=Object.freeze({status:"aborted"}),lh=t=>({status:"dirty",value:t}),Ps=t=>({status:"valid",value:t}),L5=t=>t.status==="aborted",U5=t=>t.status==="dirty",td=t=>t.status==="valid",gy=t=>typeof Promise<"u"&&t instanceof Promise;var Me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Me||(Me={}));class qa{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const F5=(t,e)=>{if(td(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ai(t.common.issues);return this._error=n,this._error}}};function st(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,u)=>{const{message:c}=t;return a.code==="invalid_enum_value"?{message:c??u.defaultError}:typeof u.data>"u"?{message:c??r??u.defaultError}:a.code!=="invalid_type"?{message:u.defaultError}:{message:c??n??u.defaultError}},description:s}}class xt{get description(){return this._def.description}_getType(e){return Ea(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Ea(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new cs,ctx:{common:e.parent.common,data:e.data,parsedType:Ea(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(gy(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ea(e)},s=this._parseSync({data:e,path:r.path,parent:r});return F5(r,s)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ea(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return td(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>td(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ea(e)},s=this._parse({data:e,path:r.path,parent:r}),o=await(gy(s)?s:Promise.resolve(s));return F5(r,o)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const a=e(s),u=()=>o.addIssue({code:ge.custom,...r(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new sd({schema:this,typeName:Ze.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return ka.create(this,this._def)}nullable(){return od.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _o.create(this)}promise(){return by.create(this,this._def)}or(e){return vy.create([this,e],this._def)}and(e){return yy.create(this,e,this._def)}transform(e){return new sd({...st(this._def),schema:this,typeName:Ze.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new kA({...st(this._def),innerType:this,defaultValue:n,typeName:Ze.ZodDefault})}brand(){return new nAe({typeName:Ze.ZodBranded,type:this,...st(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new DA({...st(this._def),innerType:this,catchValue:n,typeName:Ze.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return fI.create(this,e)}readonly(){return LA.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const k_e=/^c[^\s-]{8,}$/i,D_e=/^[0-9a-z]+$/,L_e=/^[0-9A-HJKMNP-TV-Z]{26}$/i,U_e=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,F_e=/^[a-z0-9_-]{21}$/i,z_e=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,j_e=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,B_e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$_e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Mx;const H_e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,q_e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,W_e=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,V_e=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,G_e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,K_e=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,p$="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Y_e=new RegExp(`^${p$}$`);function g$(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Z_e(t){return new RegExp(`^${g$(t)}$`)}function X_e(t){let e=`${p$}T${g$(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Q_e(t,e){return!!((e==="v4"||!e)&&H_e.test(t)||(e==="v6"||!e)&&W_e.test(t))}function J_e(t,e){if(!z_e.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function eAe(t,e){return!!((e==="v4"||!e)&&q_e.test(t)||(e==="v6"||!e)&&V_e.test(t))}class gi extends xt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Oe.string){const o=this._getOrReturnCtx(e);return Ae(o,{code:ge.invalid_type,expected:Oe.string,received:o.parsedType}),Ye}const r=new cs;let s;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=e.data.length>o.value,u=e.data.length<o.value;(a||u)&&(s=this._getOrReturnCtx(e,s),a?Ae(s,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&Ae(s,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")B_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"email",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Mx||(Mx=new RegExp($_e,"u")),Mx.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"emoji",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")U_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"uuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")F_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"nanoid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")k_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"cuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")D_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"cuid2",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")L_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"ulid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),Ae(s,{validation:"url",code:ge.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"regex",code:ge.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?X_e(o).test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?Y_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Z_e(o).test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?j_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"duration",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?Q_e(e.data,o.version)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"ip",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?J_e(e.data,o.alg)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"jwt",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?eAe(e.data,o.version)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"cidr",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?G_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"base64",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?K_e.test(e.data)||(s=this._getOrReturnCtx(e,s),Ae(s,{validation:"base64url",code:ge.invalid_string,message:o.message}),r.dirty()):Rt.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:ge.invalid_string,...Me.errToObj(r)})}_addCheck(e){return new gi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Me.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Me.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Me.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Me.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Me.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Me.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Me.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Me.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Me.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Me.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Me.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Me.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Me.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Me.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Me.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Me.errToObj(n)})}nonempty(e){return this.min(1,Me.errToObj(e))}trim(){return new gi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new gi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new gi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}gi.create=t=>new gi({checks:[],typeName:Ze.ZodString,coerce:t?.coerce??!1,...st(t)});function tAe(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,o=Number.parseInt(t.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return o%a/10**s}class Jl extends xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Oe.number){const o=this._getOrReturnCtx(e);return Ae(o,{code:ge.invalid_type,expected:Oe.number,received:o.parsedType}),Ye}let r;const s=new cs;for(const o of this._def.checks)o.kind==="int"?Rt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?tAe(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.not_finite,message:o.message}),s.dirty()):Rt.assertNever(o);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Me.toString(n))}setLimit(e,n,r,s){return new Jl({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Me.toString(s)}]})}_addCheck(e){return new Jl({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Me.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Me.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Rt.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Jl.create=t=>new Jl({checks:[],typeName:Ze.ZodNumber,coerce:t?.coerce||!1,...st(t)});class eu extends xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Oe.bigint)return this._getInvalidInput(e);let r;const s=new cs;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Ae(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):Rt.assertNever(o);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Ae(n,{code:ge.invalid_type,expected:Oe.bigint,received:n.parsedType}),Ye}gte(e,n){return this.setLimit("min",e,!0,Me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Me.toString(n))}setLimit(e,n,r,s){return new eu({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Me.toString(s)}]})}_addCheck(e){return new eu({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Me.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}eu.create=t=>new eu({checks:[],typeName:Ze.ZodBigInt,coerce:t?.coerce??!1,...st(t)});class my extends xt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Oe.boolean){const r=this._getOrReturnCtx(e);return Ae(r,{code:ge.invalid_type,expected:Oe.boolean,received:r.parsedType}),Ye}return Ps(e.data)}}my.create=t=>new my({typeName:Ze.ZodBoolean,coerce:t?.coerce||!1,...st(t)});class nd extends xt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Oe.date){const o=this._getOrReturnCtx(e);return Ae(o,{code:ge.invalid_type,expected:Oe.date,received:o.parsedType}),Ye}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return Ae(o,{code:ge.invalid_date}),Ye}const r=new cs;let s;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(s=this._getOrReturnCtx(e,s),Ae(s,{code:ge.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Rt.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new nd({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Me.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Me.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}nd.create=t=>new nd({checks:[],coerce:t?.coerce||!1,typeName:Ze.ZodDate,...st(t)});class z5 extends xt{_parse(e){if(this._getType(e)!==Oe.symbol){const r=this._getOrReturnCtx(e);return Ae(r,{code:ge.invalid_type,expected:Oe.symbol,received:r.parsedType}),Ye}return Ps(e.data)}}z5.create=t=>new z5({typeName:Ze.ZodSymbol,...st(t)});class j5 extends xt{_parse(e){if(this._getType(e)!==Oe.undefined){const r=this._getOrReturnCtx(e);return Ae(r,{code:ge.invalid_type,expected:Oe.undefined,received:r.parsedType}),Ye}return Ps(e.data)}}j5.create=t=>new j5({typeName:Ze.ZodUndefined,...st(t)});class B5 extends xt{_parse(e){if(this._getType(e)!==Oe.null){const r=this._getOrReturnCtx(e);return Ae(r,{code:ge.invalid_type,expected:Oe.null,received:r.parsedType}),Ye}return Ps(e.data)}}B5.create=t=>new B5({typeName:Ze.ZodNull,...st(t)});class $5 extends xt{constructor(){super(...arguments),this._any=!0}_parse(e){return Ps(e.data)}}$5.create=t=>new $5({typeName:Ze.ZodAny,...st(t)});class H5 extends xt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ps(e.data)}}H5.create=t=>new H5({typeName:Ze.ZodUnknown,...st(t)});class Wa extends xt{_parse(e){const n=this._getOrReturnCtx(e);return Ae(n,{code:ge.invalid_type,expected:Oe.never,received:n.parsedType}),Ye}}Wa.create=t=>new Wa({typeName:Ze.ZodNever,...st(t)});class q5 extends xt{_parse(e){if(this._getType(e)!==Oe.undefined){const r=this._getOrReturnCtx(e);return Ae(r,{code:ge.invalid_type,expected:Oe.void,received:r.parsedType}),Ye}return Ps(e.data)}}q5.create=t=>new q5({typeName:Ze.ZodVoid,...st(t)});class _o extends xt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==Oe.array)return Ae(n,{code:ge.invalid_type,expected:Oe.array,received:n.parsedType}),Ye;if(s.exactLength!==null){const a=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(a||u)&&(Ae(n,{code:a?ge.too_big:ge.too_small,minimum:u?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(Ae(n,{code:ge.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(Ae(n,{code:ge.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,u)=>s.type._parseAsync(new qa(n,a,n.path,u)))).then(a=>cs.mergeArray(r,a));const o=[...n.data].map((a,u)=>s.type._parseSync(new qa(n,a,n.path,u)));return cs.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new _o({...this._def,minLength:{value:e,message:Me.toString(n)}})}max(e,n){return new _o({...this._def,maxLength:{value:e,message:Me.toString(n)}})}length(e,n){return new _o({...this._def,exactLength:{value:e,message:Me.toString(n)}})}nonempty(e){return this.min(1,e)}}_o.create=(t,e)=>new _o({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ze.ZodArray,...st(e)});function xc(t){if(t instanceof An){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=ka.create(xc(r))}return new An({...t._def,shape:()=>e})}else return t instanceof _o?new _o({...t._def,type:xc(t.element)}):t instanceof ka?ka.create(xc(t.unwrap())):t instanceof od?od.create(xc(t.unwrap())):t instanceof tu?tu.create(t.items.map(e=>xc(e))):t}class An extends xt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Rt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Oe.object){const f=this._getOrReturnCtx(e);return Ae(f,{code:ge.invalid_type,expected:Oe.object,received:f.parsedType}),Ye}const{status:r,ctx:s}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof Wa&&this._def.unknownKeys==="strip"))for(const f in s.data)a.includes(f)||u.push(f);const c=[];for(const f of a){const h=o[f],g=s.data[f];c.push({key:{status:"valid",value:f},value:h._parse(new qa(s,g,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Wa){const f=this._def.unknownKeys;if(f==="passthrough")for(const h of u)c.push({key:{status:"valid",value:h},value:{status:"valid",value:s.data[h]}});else if(f==="strict")u.length>0&&(Ae(s,{code:ge.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const h of u){const g=s.data[h];c.push({key:{status:"valid",value:h},value:f._parse(new qa(s,g,s.path,h)),alwaysSet:h in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const h of c){const g=await h.key,m=await h.value;f.push({key:g,value:m,alwaysSet:h.alwaysSet})}return f}).then(f=>cs.mergeObjectSync(r,f)):cs.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return Me.errToObj,new An({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{const s=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Me.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new An({...this._def,unknownKeys:"strip"})}passthrough(){return new An({...this._def,unknownKeys:"passthrough"})}extend(e){return new An({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new An({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ze.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new An({...this._def,catchall:e})}pick(e){const n={};for(const r of Rt.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new An({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Rt.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new An({...this._def,shape:()=>n})}deepPartial(){return xc(this)}partial(e){const n={};for(const r of Rt.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new An({...this._def,shape:()=>n})}required(e){const n={};for(const r of Rt.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof ka;)o=o._def.innerType;n[r]=o}return new An({...this._def,shape:()=>n})}keyof(){return m$(Rt.objectKeys(this.shape))}}An.create=(t,e)=>new An({shape:()=>t,unknownKeys:"strip",catchall:Wa.create(),typeName:Ze.ZodObject,...st(e)});An.strictCreate=(t,e)=>new An({shape:()=>t,unknownKeys:"strict",catchall:Wa.create(),typeName:Ze.ZodObject,...st(e)});An.lazycreate=(t,e)=>new An({shape:t,unknownKeys:"strip",catchall:Wa.create(),typeName:Ze.ZodObject,...st(e)});class vy extends xt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const a=o.map(u=>new Ai(u.ctx.common.issues));return Ae(n,{code:ge.invalid_union,unionErrors:a}),Ye}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(s);{let o;const a=[];for(const c of r){const f={...n,common:{...n.common,issues:[]},parent:null},h=c._parseSync({data:n.data,path:n.path,parent:f});if(h.status==="valid")return h;h.status==="dirty"&&!o&&(o={result:h,ctx:f}),f.common.issues.length&&a.push(f.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const u=a.map(c=>new Ai(c));return Ae(n,{code:ge.invalid_union,unionErrors:u}),Ye}}get options(){return this._def.options}}vy.create=(t,e)=>new vy({options:t,typeName:Ze.ZodUnion,...st(e)});function PA(t,e){const n=Ea(t),r=Ea(e);if(t===e)return{valid:!0,data:t};if(n===Oe.object&&r===Oe.object){const s=Rt.objectKeys(e),o=Rt.objectKeys(t).filter(u=>s.indexOf(u)!==-1),a={...t,...e};for(const u of o){const c=PA(t[u],e[u]);if(!c.valid)return{valid:!1};a[u]=c.data}return{valid:!0,data:a}}else if(n===Oe.array&&r===Oe.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let o=0;o<t.length;o++){const a=t[o],u=e[o],c=PA(a,u);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===Oe.date&&r===Oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class yy extends xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(o,a)=>{if(L5(o)||L5(a))return Ye;const u=PA(o.value,a.value);return u.valid?((U5(o)||U5(a))&&n.dirty(),{status:n.value,value:u.data}):(Ae(r,{code:ge.invalid_intersection_types}),Ye)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}yy.create=(t,e,n)=>new yy({left:t,right:e,typeName:Ze.ZodIntersection,...st(n)});class tu extends xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.array)return Ae(r,{code:ge.invalid_type,expected:Oe.array,received:r.parsedType}),Ye;if(r.data.length<this._def.items.length)return Ae(r,{code:ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ye;!this._def.rest&&r.data.length>this._def.items.length&&(Ae(r,{code:ge.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,u)=>{const c=this._def.items[u]||this._def.rest;return c?c._parse(new qa(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>cs.mergeArray(n,a)):cs.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new tu({...this._def,rest:e})}}tu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tu({items:t,typeName:Ze.ZodTuple,rest:null,...st(e)})};class W5 extends xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.map)return Ae(r,{code:ge.invalid_type,expected:Oe.map,received:r.parsedType}),Ye;const s=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,c],f)=>({key:s._parse(new qa(r,u,r.path,[f,"key"])),value:o._parse(new qa(r,c,r.path,[f,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const c of a){const f=await c.key,h=await c.value;if(f.status==="aborted"||h.status==="aborted")return Ye;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),u.set(f.value,h.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const c of a){const f=c.key,h=c.value;if(f.status==="aborted"||h.status==="aborted")return Ye;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),u.set(f.value,h.value)}return{status:n.value,value:u}}}}W5.create=(t,e,n)=>new W5({valueType:e,keyType:t,typeName:Ze.ZodMap,...st(n)});class Xh extends xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.set)return Ae(r,{code:ge.invalid_type,expected:Oe.set,received:r.parsedType}),Ye;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Ae(r,{code:ge.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(Ae(r,{code:ge.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function a(c){const f=new Set;for(const h of c){if(h.status==="aborted")return Ye;h.status==="dirty"&&n.dirty(),f.add(h.value)}return{status:n.value,value:f}}const u=[...r.data.values()].map((c,f)=>o._parse(new qa(r,c,r.path,f)));return r.common.async?Promise.all(u).then(c=>a(c)):a(u)}min(e,n){return new Xh({...this._def,minSize:{value:e,message:Me.toString(n)}})}max(e,n){return new Xh({...this._def,maxSize:{value:e,message:Me.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Xh.create=(t,e)=>new Xh({valueType:t,minSize:null,maxSize:null,typeName:Ze.ZodSet,...st(e)});class V5 extends xt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}V5.create=(t,e)=>new V5({getter:t,typeName:Ze.ZodLazy,...st(e)});class G5 extends xt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Ae(n,{received:n.data,code:ge.invalid_literal,expected:this._def.value}),Ye}return{status:"valid",value:e.data}}get value(){return this._def.value}}G5.create=(t,e)=>new G5({value:t,typeName:Ze.ZodLiteral,...st(e)});function m$(t,e){return new rd({values:t,typeName:Ze.ZodEnum,...st(e)})}class rd extends xt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Ae(n,{expected:Rt.joinValues(r),received:n.parsedType,code:ge.invalid_type}),Ye}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Ae(n,{received:n.data,code:ge.invalid_enum_value,options:r}),Ye}return Ps(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return rd.create(e,{...this._def,...n})}exclude(e,n=this._def){return rd.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}rd.create=m$;class K5 extends xt{_parse(e){const n=Rt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Oe.string&&r.parsedType!==Oe.number){const s=Rt.objectValues(n);return Ae(r,{expected:Rt.joinValues(s),received:r.parsedType,code:ge.invalid_type}),Ye}if(this._cache||(this._cache=new Set(Rt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=Rt.objectValues(n);return Ae(r,{received:r.data,code:ge.invalid_enum_value,options:s}),Ye}return Ps(e.data)}get enum(){return this._def.values}}K5.create=(t,e)=>new K5({values:t,typeName:Ze.ZodNativeEnum,...st(e)});class by extends xt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Oe.promise&&n.common.async===!1)return Ae(n,{code:ge.invalid_type,expected:Oe.promise,received:n.parsedType}),Ye;const r=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return Ps(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}by.create=(t,e)=>new by({type:t,typeName:Ze.ZodPromise,...st(e)});class sd extends xt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ze.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,o={addIssue:a=>{Ae(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const a=s.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async u=>{if(n.value==="aborted")return Ye;const c=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return c.status==="aborted"?Ye:c.status==="dirty"||n.value==="dirty"?lh(c.value):c});{if(n.value==="aborted")return Ye;const u=this._def.schema._parseSync({data:a,path:r.path,parent:r});return u.status==="aborted"?Ye:u.status==="dirty"||n.value==="dirty"?lh(u.value):u}}if(s.type==="refinement"){const a=u=>{const c=s.refinement(u,o);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?Ye:(u.status==="dirty"&&n.dirty(),a(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?Ye:(u.status==="dirty"&&n.dirty(),a(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!td(a))return Ye;const u=s.transform(a.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>td(a)?Promise.resolve(s.transform(a.value,o)).then(u=>({status:n.value,value:u})):Ye);Rt.assertNever(s)}}sd.create=(t,e,n)=>new sd({schema:t,typeName:Ze.ZodEffects,effect:e,...st(n)});sd.createWithPreprocess=(t,e,n)=>new sd({schema:e,effect:{type:"preprocess",transform:t},typeName:Ze.ZodEffects,...st(n)});class ka extends xt{_parse(e){return this._getType(e)===Oe.undefined?Ps(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ka.create=(t,e)=>new ka({innerType:t,typeName:Ze.ZodOptional,...st(e)});class od extends xt{_parse(e){return this._getType(e)===Oe.null?Ps(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}od.create=(t,e)=>new od({innerType:t,typeName:Ze.ZodNullable,...st(e)});class kA extends xt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}kA.create=(t,e)=>new kA({innerType:t,typeName:Ze.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...st(e)});class DA extends xt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return gy(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ai(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ai(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}DA.create=(t,e)=>new DA({innerType:t,typeName:Ze.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...st(e)});class Y5 extends xt{_parse(e){if(this._getType(e)!==Oe.nan){const r=this._getOrReturnCtx(e);return Ae(r,{code:ge.invalid_type,expected:Oe.nan,received:r.parsedType}),Ye}return{status:"valid",value:e.data}}}Y5.create=t=>new Y5({typeName:Ze.ZodNaN,...st(t)});class nAe extends xt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class fI extends xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ye:o.status==="dirty"?(n.dirty(),lh(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ye:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new fI({in:e,out:n,typeName:Ze.ZodPipeline})}}class LA extends xt{_parse(e){const n=this._def.innerType._parse(e),r=s=>(td(s)&&(s.value=Object.freeze(s.value)),s);return gy(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}LA.create=(t,e)=>new LA({innerType:t,typeName:Ze.ZodReadonly,...st(e)});var Ze;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Ze||(Ze={}));const xr=gi.create;Jl.create;eu.create;const rAe=my.create;nd.create;Wa.create;_o.create;const Ed=An.create;vy.create;yy.create;tu.create;rd.create;by.create;ka.create;od.create;const S2e={string:(t=>gi.create({...t,coerce:!0})),number:(t=>Jl.create({...t,coerce:!0})),boolean:(t=>my.create({...t,coerce:!0})),bigint:(t=>eu.create({...t,coerce:!0})),date:(t=>nd.create({...t,coerce:!0}))},sAe=Dy().apiUrl;ke.setConfig({baseUrl:sAe,fetch:k8});ke.interceptors.error.use((t,e)=>{if(t instanceof i_||!e)return t;const n=t,r=n&&typeof n=="object"&&"message"in n?String(n.message):`Request failed with status ${e.status}`;return new i_(r,e.status,n)});const Px={Inbox:"inbox",Drafts:"drafts",Sent:"sent",Archive:"archive",Junk:"junk",Trash:"trash",All:"all",Flagged:"flagged"},E2e={inbox:"Inbox",drafts:"Drafts",sent:"Sent",archive:"Archive",junk:"Junk",trash:"Trash",all:"All",flagged:"Flagged"},Z5=["inbox","flagged","drafts","sent","archive","all","junk","trash"];function oAe(t){const e=new Map,n=[...t].sort((r,s)=>Z5.indexOf(Px[r.role])-Z5.indexOf(Px[s.role]));for(const r of n){if(!r.mailboxId||e.has(r.mailboxId))continue;const s=Px[r.role];s&&e.set(r.mailboxId,s)}return e}const iAe=t=>{const e=t.split("/");return e[e.length-1]||t};function C2e(t,e,n){const r=t.displayNameOverride?.trim();if(r)return r;const s=iAe(t.fullPath);return!e||!n?s:n(`sidebar.${e}`,s)}const aAe=new Set(["sent","drafts","trash"]),w2e=t=>t===void 0||!aAe.has(t),lAe=new Map;function x2e(t){const e=new Map;for(const n of t){const r=oAe(n.folderAppointments);for(const[s,o]of r)e.set(s,{role:o});for(const s of n.mailboxes){const o=r.get(s.mailboxId);e.set(s.mailboxId,{...o?{role:o}:{},providerPath:s.fullPath})}}return e}function _2e(t,e){const n=e[0];if(!t)return n?{mailboxId:n}:{};for(const s of e){const o=t.get(s);if(o&&nte(o)!==void 0)return{mailboxId:s,folder:o}}if(!n)return{};const r=t.get(n);return{mailboxId:n,...r?{folder:r}:{}}}const uAe=_.createContext(null),A2e=()=>_.useContext(uAe)??{accounts:[],mailboxNameIndex:new Map,accountNameIndex:new Map,resultFolderIndex:lAe,searchQuery:"",searchInput:"",searchViewKey:"",onSearchChange:()=>{},onSearchClear:()=>{},onSearchClearQuery:()=>{},intelligenceOpen:!1,onToggleIntelligence:()=>{},onSetIntelligenceOpen:()=>{}},cAe=()=>Un(()=>import("./mail-CXe7Cs9r.js").then(t=>t.m),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])),dAe=Ed({q:xr().optional()}),fAe=lr("/mail")({loader:({context:{queryClient:t}})=>{t.prefetchQuery(kxe()),t.prefetchQuery({...Wxe(),staleTime:6e4})},component:qn(cAe,"component"),validateSearch:dAe}),hAe=()=>Un(()=>import("./onboarding-D9DuvOKE.js"),__vite__mapDeps([16,17,3,4])),pAe=lr("/onboarding")({component:qn(hAe,"component")});function gAe(){const t=p_e(),e=t?.surface.status==="ready"&&t.surface.section.status==="available";return I.jsx(hte,{show:e,children:I.jsx(wQ,{className:"size-4"})})}const mAe=()=>Un(()=>import("./settings-BGTNY-zQ.js"),[]),T2e=[{id:"accounts",label:"Accounts",icon:I.jsx($8,{className:"size-4"})},{id:"senders",label:"Senders & Rules",icon:I.jsx(CQ,{className:"size-4"})},{id:"folders",label:"Folder roles",icon:I.jsx(hQ,{className:"size-4"})},{id:"filters",label:"Filters",icon:I.jsx(fQ,{className:"size-4"})},{id:"labels",label:"Labels",icon:I.jsx(SQ,{className:"size-4"})},{id:"appearance",label:"Appearance",icon:I.jsx(mQ,{className:"size-4"})},{id:"advanced",label:"Advanced",icon:I.jsx(gAe,{})}],R2e={accounts:"/settings/accounts",senders:"/settings/senders",folders:"/settings/folders",filters:"/settings/filters",labels:"/settings/labels",appearance:"/settings/appearance",advanced:"/settings/advanced"},vAe=lr("/settings")({component:qn(mAe,"component")}),yAe=()=>Un(()=>import("./index-BKjXiP3s.js"),__vite__mapDeps([18,8])),bAe=()=>Un(()=>import("./index-DtqBFgK5.js"),[]),SAe=Ed({selectedMessageId:xr().optional(),selectedThreadId:xr().optional(),selectedMailboxId:xr().optional(),q:xr().optional()}),EAe=lr("/mail/")({component:qn(bAe,"component"),validateSearch:SAe,errorComponent:qn(yAe,"errorComponent")}),CAe=()=>Un(()=>import("./_mailboxId-DtqBFgK5.js"),[]),wAe=Ed({selectedMessageId:xr().optional(),selectedThreadId:xr().optional(),q:xr().optional()}),xAe=lr("/mail/$mailboxId")({component:qn(CAe,"component"),validateSearch:wAe}),_Ae=()=>Un(()=>import("./flagged-BQE8ngVG.js"),__vite__mapDeps([19,8])),AAe=()=>Un(()=>import("./flagged-DtqBFgK5.js"),[]),TAe=Ed({selectedMessageId:xr().optional(),q:xr().optional()}),RAe=lr("/mail/flagged")({component:qn(AAe,"component"),validateSearch:TAe,errorComponent:qn(_Ae,"errorComponent")}),IAe=()=>Un(()=>import("./outbox-DtqBFgK5.js"),[]),OAe=Ed({selectedOutboxMessageId:xr().optional(),q:xr().optional()}),NAe=lr("/mail/outbox")({component:qn(IAe,"component"),validateSearch:OAe}),MAe=()=>Un(()=>import("./index-DuJVCSPo.js"),[]),PAe=lr("/settings/")({component:qn(MAe,"component")}),kAe=()=>Un(()=>import("./accounts-B7zI2caP.js"),__vite__mapDeps([20,5,21,2,17,3,4,22,8,9])),DAe=Ed({editAccountId:xr().optional(),focusSmtp:rAe().optional(),connected:xr().optional(),oauthError:xr().optional()}),LAe=lr("/settings/accounts")({component:qn(kAe,"component"),validateSearch:DAe}),UAe=()=>Un(()=>import("./advanced-BG0z84LJ.js"),__vite__mapDeps([23,21,2,22,12,13])),FAe=lr("/settings/advanced")({component:qn(UAe,"component")}),zAe=()=>Un(()=>import("./appearance-CMcsFswi.js"),__vite__mapDeps([24,21,2])),jAe=lr("/settings/appearance")({component:qn(zAe,"component")}),BAe=()=>Un(()=>import("./filters-CUiHcPSX.js"),__vite__mapDeps([25,21,2,7,10,15,13,8])),$Ae=lr("/settings/filters")({component:qn(BAe,"component")}),HAe=()=>Un(()=>import("./folders-Cc9RqpfY.js"),__vite__mapDeps([26,11,1,21,2,10,8])),qAe=lr("/settings/folders")({component:qn(HAe,"component")}),WAe=()=>Un(()=>import("./labels-SrbbdmRw.js"),__vite__mapDeps([27,21,2,14,8,15])),VAe=lr("/settings/labels")({component:qn(WAe,"component")}),GAe=()=>Un(()=>import("./senders-DtqZAJV5.js"),__vite__mapDeps([28,3,21,2,8,6,9,1])),KAe=lr("/settings/senders")({component:qn(GAe,"component")}),YAe=()=>Un(()=>import("./suggested-vips-BKMEAUye.js"),[]),ZAe=lr("/settings/suggested-vips")({component:qn(YAe,"component")}),XAe=O_e.update({id:"/",path:"/",getParentRoute:()=>Sp}),Ep=fAe.update({id:"/mail",path:"/mail",getParentRoute:()=>Sp}),QAe=pAe.update({id:"/onboarding",path:"/onboarding",getParentRoute:()=>Sp}),Do=vAe.update({id:"/settings",path:"/settings",getParentRoute:()=>Sp}),JAe=EAe.update({id:"/",path:"/",getParentRoute:()=>Ep}),eTe=xAe.update({id:"/$mailboxId",path:"/$mailboxId",getParentRoute:()=>Ep}),tTe=RAe.update({id:"/flagged",path:"/flagged",getParentRoute:()=>Ep}),nTe=NAe.update({id:"/outbox",path:"/outbox",getParentRoute:()=>Ep}),rTe=PAe.update({id:"/",path:"/",getParentRoute:()=>Do}),sTe=LAe.update({id:"/accounts",path:"/accounts",getParentRoute:()=>Do}),oTe=FAe.update({id:"/advanced",path:"/advanced",getParentRoute:()=>Do}),iTe=jAe.update({id:"/appearance",path:"/appearance",getParentRoute:()=>Do}),aTe=$Ae.update({id:"/filters",path:"/filters",getParentRoute:()=>Do}),lTe=qAe.update({id:"/folders",path:"/folders",getParentRoute:()=>Do}),uTe=VAe.update({id:"/labels",path:"/labels",getParentRoute:()=>Do}),cTe=KAe.update({id:"/senders",path:"/senders",getParentRoute:()=>Do}),dTe=ZAe.update({id:"/suggested-vips",path:"/suggested-vips",getParentRoute:()=>Do}),fTe={MailMailboxIdRoute:eTe,MailFlaggedRoute:tTe,MailOutboxRoute:nTe,MailIndexRoute:JAe},hTe=Ep._addFileChildren(fTe),pTe={SettingsAccountsRoute:sTe,SettingsAdvancedRoute:oTe,SettingsAppearanceRoute:iTe,SettingsFiltersRoute:aTe,SettingsFoldersRoute:lTe,SettingsLabelsRoute:uTe,SettingsSendersRoute:cTe,SettingsSuggestedVipsRoute:dTe,SettingsIndexRoute:rTe},gTe=Do._addFileChildren(pTe),mTe={IndexRoute:XAe,MailRoute:hTe,OnboardingRoute:QAe,SettingsRoute:gTe},vTe=Sp._addFileChildren(mTe)._addFileTypes(),yTe=(t,e)=>{const n=gme({routeTree:vTe,context:{queryClient:t},defaultPreload:"intent"});return n.subscribe("onResolved",r=>{e.recordPageView(r.toLocation.pathname),Bte(r.toLocation.pathname)}),n},We=t=>typeof t=="string",Gf=()=>{let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n},X5=t=>t==null?"":""+t,bTe=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},STe=/###/g,Q5=t=>t&&t.indexOf("###")>-1?t.replace(STe,"."):t,J5=t=>!t||We(t),Ch=(t,e,n)=>{const r=We(e)?e.split("."):e;let s=0;for(;s<r.length-1;){if(J5(t))return{};const o=Q5(r[s]);!t[o]&&n&&(t[o]=new n),Object.prototype.hasOwnProperty.call(t,o)?t=t[o]:t={},++s}return J5(t)?{}:{obj:t,k:Q5(r[s])}},e6=(t,e,n)=>{const{obj:r,k:s}=Ch(t,e,Object);if(r!==void 0||e.length===1){r[s]=n;return}let o=e[e.length-1],a=e.slice(0,e.length-1),u=Ch(t,a,Object);for(;u.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),u=Ch(t,a,Object),u?.obj&&typeof u.obj[`${u.k}.${o}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${o}`]=n},ETe=(t,e,n,r)=>{const{obj:s,k:o}=Ch(t,e,Object);s[o]=s[o]||[],s[o].push(n)},Sy=(t,e)=>{const{obj:n,k:r}=Ch(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},CTe=(t,e,n)=>{const r=Sy(t,n);return r!==void 0?r:Sy(e,n)},v$=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?We(t[r])||t[r]instanceof String||We(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):v$(t[r],e[r],n):t[r]=e[r]);return t},fc=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var wTe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const xTe=t=>We(t)?t.replace(/[&<>"'\/]/g,e=>wTe[e]):t;class _Te{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const ATe=[" ",",","?","!",";"],TTe=new _Te(20),RTe=(t,e,n)=>{e=e||"",n=n||"";const r=ATe.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=TTe.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!s.test(t);if(!o){const a=t.indexOf(n);a>0&&!s.test(t.substring(0,a))&&(o=!0)}return o},UA=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(n);let s=t;for(let o=0;o<r.length;){if(!s||typeof s!="object")return;let a,u="";for(let c=o;c<r.length;++c)if(c!==o&&(u+=n),u+=r[c],a=s[u],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&c<r.length-1)continue;o+=c-o+1;break}s=a}return s},Ey=t=>t?.replace("_","-"),ITe={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class Cy{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||ITe,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,s){return s&&!this.debug?null:(We(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new Cy(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Cy(this.logger,e)}}var xo=new Cy;class jb{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(a=>{let[u,c]=a;for(let f=0;f<c;f++)u(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[u,c]=a;for(let f=0;f<c;f++)u.apply(u,[e,...r])})}}class t6 extends jb{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let u;e.indexOf(".")>-1?u=e.split("."):(u=[e,n],r&&(Array.isArray(r)?u.push(...r):We(r)&&o?u.push(...r.split(o)):u.push(r)));const c=Sy(this.data,u);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=u[0],n=u[1],r=u.slice(2).join(".")),c||!a||!We(r)?c:UA(this.data?.[e]?.[n],r,o)}addResource(e,n,r,s){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let u=[e,n];r&&(u=u.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(u=e.split("."),s=n,n=u[1]),this.addNamespaces(n),e6(this.data,u,s),o.silent||this.emit("added",e,n,r,s)}addResources(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(We(r[o])||Array.isArray(r[o]))&&this.addResource(e,n,o,r[o],{silent:!0});s.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,s,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},u=[e,n];e.indexOf(".")>-1&&(u=e.split("."),s=r,r=n,n=u[1]),this.addNamespaces(n);let c=Sy(this.data,u)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?v$(c,r,o):c={...c,...r},e6(this.data,u,c),a.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var y$={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,s){return t.forEach(o=>{e=this.processors[o]?.process(e,n,r,s)??e}),e}};const n6={},r6=t=>!We(t)&&typeof t!="boolean"&&typeof t!="number";class wy extends jb{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),bTe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=xo.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};return e==null?!1:this.resolve(e,n)?.res!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&e.indexOf(r)>-1,u=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!RTe(e,r,s);if(a&&!u){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:We(o)?[o]:o};const f=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(f[0])>-1)&&(o=f.shift()),e=f.join(s)}return{key:e,namespaces:We(o)?[o]:o}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:u}=this.extractFromKey(e[e.length-1],n),c=u[u.length-1],f=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()==="cimode"){if(h){const D=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${D}${a}`,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${D}${a}`}return s?{res:a,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:a}const g=this.resolve(e,n);let m=g?.res;const y=g?.usedKey||a,S=g?.exactUsedKey||a,E=["[object Number]","[object Function]","[object RegExp]"],C=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,T=n.count!==void 0&&!We(n.count),x=wy.hasDefaultValue(n),R=T?this.pluralResolver.getSuffix(f,n.count,n):"",M=n.ordinal&&T?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",N=T&&!n.ordinal&&n.count===0,O=N&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${R}`]||n[`defaultValue${M}`]||n.defaultValue;let k=m;w&&!m&&x&&(k=O);const F=r6(k),H=Object.prototype.toString.apply(k);if(w&&k&&F&&E.indexOf(H)<0&&!(We(C)&&Array.isArray(k))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,k,{...n,ns:u}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(g.res=D,g.usedParams=this.getUsedParamsDetails(n),g):D}if(o){const D=Array.isArray(k),z=D?[]:{},q=D?S:y;for(const K in k)if(Object.prototype.hasOwnProperty.call(k,K)){const ee=`${q}${o}${K}`;x&&!m?z[K]=this.translate(ee,{...n,defaultValue:r6(O)?O[K]:void 0,joinArrays:!1,ns:u}):z[K]=this.translate(ee,{...n,joinArrays:!1,ns:u}),z[K]===ee&&(z[K]=k[K])}m=z}}else if(w&&We(C)&&Array.isArray(m))m=m.join(C),m&&(m=this.extendTranslation(m,e,n,r));else{let D=!1,z=!1;!this.isValidLookup(m)&&x&&(D=!0,m=O),this.isValidLookup(m)||(z=!0,m=a);const K=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&z?void 0:m,ee=x&&O!==m&&this.options.updateMissing;if(z||D||ee){if(this.logger.log(ee?"updateKey":"missingKey",f,c,a,ee?O:m),o){const ae=this.resolve(a,{...n,keySeparator:!1});ae&&ae.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let $=[];const te=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&te&&te[0])for(let ae=0;ae<te.length;ae++)$.push(te[ae]);else this.options.saveMissingTo==="all"?$=this.languageUtils.toResolveHierarchy(n.lng||this.language):$.push(n.lng||this.language);const fe=(ae,xe,L)=>{const G=x&&L!==m?L:K;this.options.missingKeyHandler?this.options.missingKeyHandler(ae,c,xe,G,ee,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ae,c,xe,G,ee,n),this.emit("missingKey",ae,c,xe,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?$.forEach(ae=>{const xe=this.pluralResolver.getSuffixes(ae,n);N&&n[`defaultValue${this.options.pluralSeparator}zero`]&&xe.indexOf(`${this.options.pluralSeparator}zero`)<0&&xe.push(`${this.options.pluralSeparator}zero`),xe.forEach(L=>{fe([ae],a+L,n[`defaultValue${L}`]||O)})}):fe($,a,O))}m=this.extendTranslation(m,e,n,g,r),z&&m===a&&this.options.appendNamespaceToMissingKey&&(m=`${c}:${a}`),(z||D)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${a}`:a,D?m:void 0))}return s?(g.res=m,g.usedParams=this.getUsedParamsDetails(n),g):m}extendTranslation(e,n,r,s,o){var a=this;if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=We(e)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(f){const m=e.match(this.interpolator.nestingRegexp);h=m&&m.length}let g=r.replace&&!We(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(g={...this.options.interpolation.defaultVariables,...g}),e=this.interpolator.interpolate(e,g,r.lng||this.language||s.usedLng,r),f){const m=e.match(this.interpolator.nestingRegexp),y=m&&m.length;h<y&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var m=arguments.length,y=new Array(m),S=0;S<m;S++)y[S]=arguments[S];return o?.[0]===y[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${n[0]}`),null):a.translate(...y,n)},r)),r.interpolation&&this.interpolator.reset()}const u=r.postProcess||this.options.postProcess,c=We(u)?[u]:u;return e!=null&&c?.length&&r.applyPostProcessor!==!1&&(e=y$.handle(c,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,s,o,a,u;return We(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const f=this.extractFromKey(c,n),h=f.key;s=h;let g=f.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const m=n.count!==void 0&&!We(n.count),y=m&&!n.ordinal&&n.count===0,S=n.context!==void 0&&(We(n.context)||typeof n.context=="number")&&n.context!=="",E=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);g.forEach(C=>{this.isValidLookup(r)||(u=C,!n6[`${E[0]}-${C}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(u)&&(n6[`${E[0]}-${C}`]=!0,this.logger.warn(`key "${s}" for languages "${E.join(", ")}" won't get resolved as namespace "${u}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),E.forEach(w=>{if(this.isValidLookup(r))return;a=w;const T=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(T,h,w,C,n);else{let R;m&&(R=this.pluralResolver.getSuffix(w,n.count,n));const M=`${this.options.pluralSeparator}zero`,N=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(T.push(h+R),n.ordinal&&R.indexOf(N)===0&&T.push(h+R.replace(N,this.options.pluralSeparator)),y&&T.push(h+M)),S){const O=`${h}${this.options.contextSeparator}${n.context}`;T.push(O),m&&(T.push(O+R),n.ordinal&&R.indexOf(N)===0&&T.push(O+R.replace(N,this.options.pluralSeparator)),y&&T.push(O+M))}}let x;for(;x=T.pop();)this.isValidLookup(r)||(o=x,r=this.getResource(w,C,x,n))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:a,usedNS:u}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,n,r,s):this.resourceStore.getResource(e,n,r,s)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!We(e.replace);let s=r?e.replace:e;if(r&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of n)delete s[o]}return s}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class s6{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=xo.create("languageUtils")}getScriptPartFromCode(e){if(e=Ey(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=Ey(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(We(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>{if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&(o.indexOf("-")>0&&s.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===s||o.indexOf(s)===0&&s.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),We(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),s=[],o=a=>{a&&(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return We(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(e))):We(e)&&o(this.formatLanguageCode(e)),r.forEach(a=>{s.indexOf(a)<0&&o(this.formatLanguageCode(a))}),s}}const o6={zero:0,one:1,two:2,few:3,many:4,other:5},i6={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class OTe{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=xo.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=Ey(e==="dev"?"en":e),s=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),i6;if(!e.match(/-|_/))return i6;const c=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(c,n)}return this.pluralRulesCache[o]=a,a}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(s=>`${n}${s}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((s,o)=>o6[s]-o6[o]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(e,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const a6=function(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=CTe(t,e,n);return!o&&s&&We(n)&&(o=UA(t,n,r),o===void 0&&(o=UA(e,n,r))),o},kx=t=>t.replace(/\$/g,"$$$$");class NTe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=xo.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:a,suffix:u,suffixEscaped:c,formatSeparator:f,unescapeSuffix:h,unescapePrefix:g,nestingPrefix:m,nestingPrefixEscaped:y,nestingSuffix:S,nestingSuffixEscaped:E,nestingOptionsSeparator:C,maxReplaces:w,alwaysFormat:T}=e.interpolation;this.escape=n!==void 0?n:xTe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?fc(o):a||"{{",this.suffix=u?fc(u):c||"}}",this.formatSeparator=f||",",this.unescapePrefix=h?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=m?fc(m):y||fc("$t("),this.nestingSuffix=S?fc(S):E||fc(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=w||1e3,this.alwaysFormat=T!==void 0?T:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,s){let o,a,u;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=y=>{if(y.indexOf(this.formatSeparator)<0){const w=a6(n,c,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,r,{...s,...n,interpolationkey:y}):w}const S=y.split(this.formatSeparator),E=S.shift().trim(),C=S.join(this.formatSeparator).trim();return this.format(a6(n,c,E,this.options.keySeparator,this.options.ignoreJSONStructure),C,r,{...s,...n,interpolationkey:E})};this.resetRegExp();const h=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,g=s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:y=>kx(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?kx(this.escape(y)):kx(y)}].forEach(y=>{for(u=0;o=y.regex.exec(e);){const S=o[1].trim();if(a=f(S),a===void 0)if(typeof h=="function"){const C=h(e,o,s);a=We(C)?C:""}else if(s&&Object.prototype.hasOwnProperty.call(s,S))a="";else if(g){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${S} for interpolating ${e}`),a="";else!We(a)&&!this.useRawValueToEscape&&(a=X5(a));const E=y.safeValue(a);if(e=e.replace(o[0],E),g?(y.regex.lastIndex+=a.length,y.regex.lastIndex-=o[0].length):y.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,o,a;const u=(c,f)=>{const h=this.nestingOptionsSeparator;if(c.indexOf(h)<0)return c;const g=c.split(new RegExp(`${h}[ ]*{`));let m=`{${g[1]}`;c=g[0],m=this.interpolate(m,a);const y=m.match(/'/g),S=m.match(/"/g);((y?.length??0)%2===0&&!S||S.length%2!==0)&&(m=m.replace(/'/g,'"'));try{a=JSON.parse(m),f&&(a={...f,...a})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,E),`${c}${h}${m}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];a={...r},a=a.replace&&!We(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const h=s[1].split(this.formatSeparator).map(g=>g.trim());s[1]=h.shift(),c=h,f=!0}if(o=n(u.call(this,s[1].trim(),a),a),o&&s[0]===e&&!We(o))return o;We(o)||(o=X5(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),o=""),f&&(o=c.reduce((h,g)=>this.format(h,g,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),e=e.replace(s[0],o),this.regexp.lastIndex=0}return e}}const MTe=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);e==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(a=>{if(a){const[u,...c]=a.split(":"),f=c.join(":").trim().replace(/^'+|'+$/g,""),h=u.trim();n[h]||(n[h]=f),f==="false"&&(n[h]=!1),f==="true"&&(n[h]=!0),isNaN(f)||(n[h]=parseInt(f,10))}})}return{formatName:e,formatOptions:n}},hc=t=>{const e={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const a=r+JSON.stringify(o);let u=e[a];return u||(u=t(Ey(r),s),e[a]=u),u(n)}};class PTe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=xo.create("formatter"),this.options=e,this.formats={number:hc((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return o=>s.format(o)}),currency:hc((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>s.format(o)}),datetime:hc((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return o=>s.format(o)}),relativetime:hc((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return o=>s.format(o,r.range||"day")}),list:hc((n,r)=>{const s=new Intl.ListFormat(n,{...r});return o=>s.format(o)})},this.init(e)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=hc(n)}format(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(u=>u.indexOf(")")>-1)){const u=o.findIndex(c=>c.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,u)].join(this.formatSeparator)}return o.reduce((u,c)=>{const{formatName:f,formatOptions:h}=MTe(c);if(this.formats[f]){let g=u;try{const m=s?.formatParams?.[s.interpolationkey]||{},y=m.locale||m.lng||s.locale||s.lng||r;g=this.formats[f](u,y,{...h,...s,...m})}catch(m){this.logger.warn(m)}return g}else this.logger.warn(`there was no format function for ${f}`);return u},e)}}const kTe=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class DTe extends jb{constructor(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=xo.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,s.backend,s)}queueLoad(e,n,r,s){const o={},a={},u={},c={};return e.forEach(f=>{let h=!0;n.forEach(g=>{const m=`${f}|${g}`;!r.reload&&this.store.hasResourceBundle(f,g)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?a[m]===void 0&&(a[m]=!0):(this.state[m]=1,h=!1,a[m]===void 0&&(a[m]=!0),o[m]===void 0&&(o[m]=!0),c[g]===void 0&&(c[g]=!0)))}),h||(u[f]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const s=e.split("|"),o=s[0],a=s[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const u={};this.queue.forEach(c=>{ETe(c.loaded,[o],a),kTe(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(f=>{u[f]||(u[f]={});const h=c.loaded[f];h.length&&h.forEach(g=>{u[f][g]===void 0&&(u[f][g]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(c=>!c.done)}read(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:s,wait:o,callback:a});return}this.readingCalls++;const u=(f,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(f&&h&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,s+1,o*2,a)},o);return}a(f,h)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const f=c(e,n);f&&typeof f.then=="function"?f.then(h=>u(null,h)).catch(u):u(null,f)}catch(f){u(f)}return}return c(e,n,u)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();We(e)&&(e=this.languageUtils.toResolveHierarchy(e)),We(n)&&(n=[n]);const o=this.queueLoad(e,n,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(a,u)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${s} failed`,a),!a&&u&&this.logger.log(`${n}loaded namespace ${o} for language ${s}`,u),this.loaded(e,a,u)})}saveMissing(e,n,r,s,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const c={...a,isUpdate:o},f=this.backend.create.bind(this.backend);if(f.length<6)try{let h;f.length===5?h=f(e,n,r,s,c):h=f(e,n,r,s),h&&typeof h.then=="function"?h.then(g=>u(null,g)).catch(u):u(null,h)}catch(h){u(h)}else f(e,n,r,s,u,c)}!e||!e[0]||this.store.addResource(e[0],n,r,s)}}}const l6=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),We(t[1])&&(e.defaultValue=t[1]),We(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),u6=t=>(We(t.ns)&&(t.ns=[t.ns]),We(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),We(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t),Hm=()=>{},LTe=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class Qh extends jb{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=u6(e),this.services={},this.logger=xo,this.modules={external:[]},LTe(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(We(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=l6();this.options={...s,...this.options,...u6(n)},this.options.interpolation={...s.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?xo.init(o(this.modules.logger),this.options):xo.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=PTe;const g=new s6(this.options);this.store=new t6(this.options.resources,this.options);const m=this.services;m.logger=xo,m.resourceStore=this.store,m.languageUtils=g,m.pluralResolver=new OTe(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(m.formatter=o(h),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new NTe(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new DTe(o(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(y){for(var S=arguments.length,E=new Array(S>1?S-1:0),C=1;C<S;C++)E[C-1]=arguments[C];e.emit(y,...E)}),this.modules.languageDetector&&(m.languageDetector=o(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=o(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new wy(this.services,this.options),this.translator.on("*",function(y){for(var S=arguments.length,E=new Array(S>1?S-1:0),C=1;C<S;C++)E[C-1]=arguments[C];e.emit(y,...E)}),this.modules.external.forEach(y=>{y.init&&y.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Hm),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=function(){return e.store[h](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=function(){return e.store[h](...arguments),e}});const c=Gf(),f=()=>{const h=(g,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(m),r(g,m)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?f():setTimeout(f,0),c}loadResources(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hm;const s=We(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(s?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&o.indexOf(f)<0&&o.push(f)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),this.options.preload?.forEach?.(u=>a(u)),this.services.backendConnector.load(o,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(e,n,r){const s=Gf();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=Hm),this.services.backendConnector.reload(e,n,o=>{s.resolve(),r(o)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&y$.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const s=Gf();this.emit("languageChanging",e);const o=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},a=(c,f)=>{f?(o(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},u=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const f=We(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);f&&(this.language||o(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector?.cacheUserLanguage?.(f)),this.loadResources(f,h=>{a(h,f)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(e),s}getFixedT(e,n,r){var s=this;const o=function(a,u){let c;if(typeof u!="object"){for(var f=arguments.length,h=new Array(f>2?f-2:0),g=2;g<f;g++)h[g-2]=arguments[g];c=s.options.overloadTranslationOptionHandler([a,u].concat(h))}else c={...u};c.lng=c.lng||o.lng,c.lngs=c.lngs||o.lngs,c.ns=c.ns||o.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||o.keyPrefix);const m=s.options.keySeparator||".";let y;return c.keyPrefix&&Array.isArray(a)?y=a.map(S=>`${c.keyPrefix}${m}${S}`):y=c.keyPrefix?`${c.keyPrefix}${m}${a}`:a,s.t(y,c)};return We(e)?o.lng=e:o.lngs=e,o.ns=n,o.keyPrefix=r,o}t(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.translator?.translate(...n)}exists(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.translator?.exists(...n)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(u,c)=>{const f=this.services.backendConnector.state[`${u}|${c}`];return f===-1||f===0||f===2};if(n.precheck){const u=n.precheck(this,a);if(u!==void 0)return u}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,e)&&(!s||a(o,e)))}loadNamespaces(e,n){const r=Gf();return this.options.ns?(We(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=Gf();We(e)&&(e=[e]);const s=this.options.preload||[],o=e.filter(a=>s.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=s.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new s6(l6());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Qh(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hm;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},o=new Qh(s);if((e.debug!==void 0||e.prefix!==void 0)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(u=>{o[u]=this[u]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const u=Object.keys(this.store.data).reduce((c,f)=>(c[f]={...this.store.data[f]},Object.keys(c[f]).reduce((h,g)=>(h[g]={...c[f][g]},h),{})),{});o.store=new t6(u,s),o.services.resourceStore=o.store}return o.translator=new wy(o.services,s),o.translator.on("*",function(u){for(var c=arguments.length,f=new Array(c>1?c-1:0),h=1;h<c;h++)f[h-1]=arguments[h];o.emit(u,...f)}),o.init(s,n),o.translator.options=s,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const pr=Qh.createInstance();pr.createInstance=Qh.createInstance;pr.createInstance;pr.dir;pr.init;pr.loadResources;pr.reloadResources;pr.use;pr.changeLanguage;pr.getFixedT;pr.t;pr.exists;pr.setDefaultNamespace;pr.hasLoadedNamespace;pr.loadNamespaces;pr.loadLanguages;const{slice:UTe,forEach:FTe}=[];function zTe(t){return FTe.call(UTe.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}function jTe(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(t))}const c6=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,BTe=function(t,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(e);let o=`${t}=${s}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!c6.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!c6.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},d6={create(t,e,n,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+n*60*1e3)),r&&(s.domain=r),document.cookie=BTe(t,e,s)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let s=n[r];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return s.substring(e.length,s.length)}return null},remove(t,e){this.create(t,"",-1,e)}};var $Te={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return d6.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:s,cookieOptions:o}=e;n&&typeof document<"u"&&d6.create(n,t,r,s,o)}},HTe={name:"querystring",lookup(t){let{lookupQuerystring:e}=t,n;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const o=r.substring(1).split("&");for(let a=0;a<o.length;a++){const u=o[a].indexOf("=");u>0&&o[a].substring(0,u)===e&&(n=o[a].substring(u+1))}}return n}},qTe={name:"hash",lookup(t){let{lookupHash:e,lookupFromHashIndex:n}=t,r;if(typeof window<"u"){const{hash:s}=window.location;if(s&&s.length>2){const o=s.substring(1);if(e){const a=o.split("&");for(let u=0;u<a.length;u++){const c=a[u].indexOf("=");c>0&&a[u].substring(0,c)===e&&(r=a[u].substring(c+1))}}if(r)return r;if(!r&&n>-1){const a=s.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return r}};let pc=null;const f6=()=>{if(pc!==null)return pc;try{if(pc=typeof window<"u"&&window.localStorage!==null,!pc)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{pc=!1}return pc};var WTe={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&f6())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&f6()&&window.localStorage.setItem(n,t)}};let gc=null;const h6=()=>{if(gc!==null)return gc;try{if(gc=typeof window<"u"&&window.sessionStorage!==null,!gc)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{gc=!1}return gc};var VTe={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&h6())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&h6()&&window.sessionStorage.setItem(n,t)}},GTe={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:s}=navigator;if(n)for(let o=0;o<n.length;o++)e.push(n[o]);r&&e.push(r),s&&e.push(s)}return e.length>0?e:void 0}},KTe={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},YTe={name:"path",lookup(t){let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof e=="number"?e:0]?.replace("/",""):void 0}},ZTe={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let b$=!1;try{document.cookie,b$=!0}catch{}const S$=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];b$||S$.splice(1,1);const XTe=()=>({order:S$,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class E${constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=zTe(n,this.options||{},XTe()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector($Te),this.addDetector(HTe),this.addDetector(WTe),this.addDetector(VTe),this.addDetector(GTe),this.addDetector(KTe),this.addDetector(YTe),this.addDetector(ZTe),this.addDetector(qTe)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return e.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.filter(r=>r!=null&&!jTe(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}E$.type="languageDetector";function QTe(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=JTe(t))||e){n&&(t=n);var r=0,s=function(){};return{s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(f){throw f},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
295
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var f=n.next();return a=f.done,f},e:function(f){u=!0,o=f},f:function(){try{a||n.return==null||n.return()}finally{if(u)throw o}}}}function JTe(t,e){if(t){if(typeof t=="string")return p6(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p6(t,e):void 0}}function p6(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function FA(t){"@babel/helpers - typeof";return FA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},FA(t)}var C$=["__proto__","constructor","prototype"];function w$(t){return!(typeof t!="string"||t.length===0||t.length>128||C$.indexOf(t)>-1||t.indexOf("..")>-1||t.indexOf("\\")>-1||/[?#%\s@]/.test(t)||/[\x00-\x1F\x7F]/.test(t))}function x$(t){return!(!w$(t)||t.indexOf("/")>-1)}function eRe(t){return w$(t)}var tRe={lng:x$,ns:eRe};function qm(t){return typeof t!="string"?t:t.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function nRe(t){if(typeof t!="string"||t.length===0)return t;try{var e=new URL(t);return e.username||e.password?(e.username="",e.password="",e.toString()):t}catch{return t.replace(/(\/\/)[^/@\s]+@/g,"$1")}}function _$(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":FA(XMLHttpRequest))==="object"}function rRe(t){return!!t&&typeof t.then=="function"}function sRe(t){return rRe(t)?t:Promise.resolve(t)}var oRe=/\{\{(.+?)\}\}/g;function g6(t,e){var n=!1,r=t.replace(oRe,function(s,o){var a=o.trim();if(C$.indexOf(a)>-1)return s;var u=e[a];if(u==null)return s;var c=tRe[a]||x$,f=String(u).split("+"),h=QTe(f),g;try{for(h.s();!(g=h.n()).done;){var m=g.value;if(!c(m))return n=!0,s}}catch(y){h.e(y)}finally{h.f()}return f.join("+")});return n?null:r}function m6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function v6(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?m6(Object(n),!0).forEach(function(r){iRe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function iRe(t,e,n){return(e=aRe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aRe(t){var e=lRe(t,"string");return nu(e)=="symbol"?e:e+""}function lRe(t,e){if(nu(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(nu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nu(t){"@babel/helpers - typeof";return nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nu(t)}var Va=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?Va=global.fetch:typeof window<"u"&&window.fetch&&(Va=window.fetch);var Jh;_$()&&(typeof global<"u"&&global.XMLHttpRequest?Jh=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Jh=window.XMLHttpRequest));var xy;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?xy=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(xy=window.ActiveXObject));typeof Va!="function"&&(Va=void 0);if(!Va&&!Jh&&!xy)try{Un(()=>import("./browser-ponyfill-CJ5rYtwO.js").then(t=>t.b),[]).then(function(t){Va=t.default}).catch(function(){})}catch{}var A$=["__proto__","constructor","prototype"],zA=function(e,n){if(n&&nu(n)==="object"){for(var r="",s=0,o=Object.keys(n);s<o.length;s++){var a=o[s];A$.indexOf(a)>-1||(r+="&"+encodeURIComponent(a)+"="+encodeURIComponent(n[a]))}if(!r)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+r.slice(1)}return e},y6=function(e,n,r,s){var o=function(c){if(!c.ok)return r(c.statusText||"Error",{status:c.status});c.text().then(function(f){r(null,{status:c.status,data:f})}).catch(r)};if(s){var a=s(e,n);if(a instanceof Promise){a.then(o).catch(r);return}}typeof fetch=="function"?fetch(e,n).then(o).catch(r):Va(e,n).then(o).catch(r)},uRe=function(e,n,r,s){e.queryStringParams&&(n=zA(n,e.queryStringParams));var o=v6({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(o["Content-Type"]="application/json");var a=typeof e.requestOptions=="function"?e.requestOptions(r):e.requestOptions,u=v6({method:r?"POST":"GET",body:r?e.stringify(r):void 0,headers:o},e._omitFetchOptions?{}:a),c=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{y6(n,u,s,c)}catch(f){if(!a||Object.keys(a).length===0||!f.message||f.message.indexOf("not implemented")<0)return s(f);try{Object.keys(a).forEach(function(h){delete u[h]}),y6(n,u,s,c),e._omitFetchOptions=!0}catch(h){s(h)}}},cRe=function(e,n,r,s){r&&nu(r)==="object"&&(r=zA("",r).slice(1)),e.queryStringParams&&(n=zA(n,e.queryStringParams));try{var o=Jh?new Jh:new xy("MSXML2.XMLHTTP.3.0");o.open(r?"POST":"GET",n,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=e.customHeaders;if(a=typeof a=="function"?a():a,a)for(var u=0,c=Object.keys(a);u<c.length;u++){var f=c[u];A$.indexOf(f)>-1||o.setRequestHeader(f,a[f])}o.onreadystatechange=function(){o.readyState>3&&s(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(h){console&&console.log(h)}},dRe=function(e,n,r,s){if(typeof r=="function"&&(s=r,r=void 0),s=s||function(){},Va&&n.indexOf("file:")!==0)return uRe(e,n,r,s);if(_$()||typeof ActiveXObject=="function")return cRe(e,n,r,s);s(new Error("No fetch and no xhr implementation found!"))};function id(t){"@babel/helpers - typeof";return id=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},id(t)}function b6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function Dx(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?b6(Object(n),!0).forEach(function(r){T$(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function fRe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hRe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,R$(r.key),r)}}function pRe(t,e,n){return e&&hRe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function T$(t,e,n){return(e=R$(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R$(t){var e=gRe(t,"string");return id(e)=="symbol"?e:e+""}function gRe(t,e){if(id(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(id(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var mRe=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,s){return T$({},r,s||"")},parseLoadPayload:function(n,r){},request:dRe,reloadInterval:typeof window<"u"?!1:3600*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},I$=(function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};fRe(this,t),this.services=e,this.options=n,this.allOptions=r,this.type="backend",this.init(e,n,r)}return pRe(t,[{key:"init",value:function(n){var r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=Dx(Dx(Dx({},mRe()),this.options||{}),s),this.allOptions=o,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);id(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,s){this._readAny(n,n,r,r,s)}},{key:"read",value:function(n,r,s){this._readAny([n],n,[r],r,s)}},{key:"_readAny",value:function(n,r,s,o,a){var u=this,c=this.options.loadPath;typeof this.options.loadPath=="function"&&(c=this.options.loadPath(n,s)),c=sRe(c),c.then(function(f){if(!f)return a(null,{});var h=g6(f,{lng:n.join("+"),ns:s.join("+")});if(h==null){var g=n.map(qm).join(", "),m=s.map(qm).join(", ");return a(new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+g+"] namespaces=["+m+"]"),!1)}u.loadUrl(h,a,r,o)})}},{key:"loadUrl",value:function(n,r,s,o){var a=this,u=typeof s=="string"?[s]:s,c=typeof o=="string"?[o]:o,f=this.options.parseLoadPayload(u,c),h=qm(nRe(n));this.options.request(this.options,n,f,function(g,m){if(m&&(m.status>=500&&m.status<600||!m.status))return r("failed loading "+h+"; status code: "+m.status,!0);if(m&&m.status>=400&&m.status<500)return r("failed loading "+h+"; status code: "+m.status,!1);if(!m&&g&&g.message){var y=g.message.toLowerCase(),S=["failed","fetch","network","load"].find(function(w){return y.indexOf(w)>-1});if(S)return r("failed loading "+h+": "+qm(g.message),!0)}if(g)return r(g,!1);var E,C;try{typeof m.data=="string"?E=a.options.parse(m.data,s,o):E=m.data}catch{C="failed parsing "+h+" to json"}if(C)return r(C,!1);r(null,E)})}},{key:"create",value:function(n,r,s,o,a){var u=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var c=this.options.parsePayload(r,s,o),f=0,h=[],g=[];n.forEach(function(m){var y=u.options.addPath;typeof u.options.addPath=="function"&&(y=u.options.addPath(m,r));var S=g6(y,{lng:m,ns:r});if(S==null){f+=1,a&&f===n.length&&a(h,g);return}u.options.request(u.options,S,c,function(E,C){f+=1,h.push(E),g.push(C),f===n.length&&typeof a=="function"&&a(h,g)})})}}},{key:"reload",value:function(){var n=this,r=this.services,s=r.backendConnector,o=r.languageUtils,a=r.logger,u=s.language;if(!(u&&u.toLowerCase()==="cimode")){var c=[],f=function(g){var m=o.toResolveHierarchy(g);m.forEach(function(y){c.indexOf(y)<0&&c.push(y)})};f(u),this.allOptions.preload&&this.allOptions.preload.forEach(function(h){return f(h)}),c.forEach(function(h){n.allOptions.ns.forEach(function(g){s.read(h,g,"read",null,null,function(m,y){m&&a.warn("loading namespace ".concat(g," for language ").concat(h," failed"),m),!m&&y&&a.log("loaded namespace ".concat(g," for language ").concat(h),y),s.loaded("".concat(h,"|").concat(g),m,y)})})})}}}])})();I$.type="backend";pr.use(I$).use(E$).use(Rwe).init({fallbackLng:"en",supportedLngs:["en","nl","de","fr"],ns:["common","mail","settings","errors"],defaultNS:"common",backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},detection:{order:["navigator","htmlTag"],caches:[]},interpolation:{escapeValue:!1},react:{useSuspense:!0,bindI18n:"languageChanged loaded"}});const vRe=({authProvider:t,rootElementId:e="root"})=>{Fte(),mwe(),t.configure(),Bme(t);const n=pwe();Rte(n);const r=new fpe({queryCache:new D7({onError:Wme}),mutationCache:new k7({onError:Vme}),defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1}}}),s=yTe(r,n);n.recordPageView(window.location.pathname);const o=document.getElementById(e);if(!o)throw new Error(`Root element not found: #${e}`);const{Shell:a}=t;wme.createRoot(o).render(I.jsx(_.StrictMode,{children:I.jsx(t$.Provider,{value:n,children:I.jsxs(hpe,{client:r,children:[I.jsx(qme,{value:t,children:I.jsx(a,{children:I.jsx(yme,{router:s})})}),!1]})})}))};vRe({authProvider:Hhe});export{vb as $,lQ as A,as as B,Qx as C,aJ as D,WJ as E,dQ as F,P8 as G,j8 as H,pQ as I,yRe as J,bRe as K,Jx as L,gQ as M,URe as N,iT as O,MRe as P,ape as Q,j as R,bQ as S,EQ as T,LRe as U,bd as V,Dn as W,Ua as X,Uv as Y,A7 as Z,XN as _,hn as a,s2e as a$,ppe as a0,vpe as a1,Epe as a2,ype as a3,bpe as a4,Er as a5,wpe as a6,mU as a7,Spe as a8,xpe as a9,jxe as aA,f$ as aB,h2e as aC,v2e as aD,d2e as aE,Un as aF,XIe as aG,Dxe as aH,qxe as aI,Ixe as aJ,r2e as aK,Vxe as aL,a2e as aM,o2e as aN,iAe as aO,n2e as aP,ZIe as aQ,cz as aR,l2e as aS,i2e as aT,y2e as aU,g2e as aV,p2e as aW,_2e as aX,WIe as aY,IRe as aZ,CRe as a_,hs as aa,Wr as ab,Bge as ac,m2e as ad,ER as ae,BIe as af,oAe as ag,Nx as ah,BRe as ai,o3 as aj,Yte as ak,uz as al,Pwe as am,C2e as an,A2e as ao,CIe as ap,F7 as aq,Uxe as ar,k8 as as,_pe as at,c2e as au,f2e as av,u2e as aw,YIe as ax,kxe as ay,b2e as az,yt as b,Txe as b$,n_ as b0,VJ as b1,SQ as b2,fz as b3,Wxe as b4,$y as b5,Mxe as b6,ql as b7,_xe as b8,o$ as b9,xr as bA,S2e as bB,JIe as bC,e2e as bD,LAe as bE,TIe as bF,IIe as bG,T2e as bH,vQ as bI,R2e as bJ,KIe as bK,kRe as bL,xRe as bM,PRe as bN,h_e as bO,Cte as bP,Ste as bQ,bte as bR,A5 as bS,QP as bT,wIe as bU,kIe as bV,DIe as bW,Uee as bX,$ee as bY,NIe as bZ,PIe as b_,oxe as ba,fxe as bb,cxe as bc,uxe as bd,Na as be,GIe as bf,QIe as bg,_Ie as bh,w2e as bi,x2e as bj,Ga as bk,exe as bl,L9 as bm,Dy as bn,uAe as bo,wRe as bp,hT as bq,gz as br,Pxe as bs,zRe as bt,RIe as bu,AIe as bv,OIe as bw,fT as bx,Ed as by,rAe as bz,F8 as c,Uae as c$,MIe as c0,qIe as c1,VIe as c2,Qee as c3,ORe as c4,Xee as c5,xIe as c6,Kwe as c7,LIe as c8,HIe as c9,kae as cA,zoe as cB,Moe as cC,Vy as cD,ET as cE,Y9 as cF,Nae as cG,Tae as cH,qoe as cI,Cae as cJ,WT as cK,Q9 as cL,joe as cM,gae as cN,mae as cO,lre as cP,uu as cQ,Jne as cR,Qne as cS,ST as cT,BF as cU,pae as cV,nre as cW,Hoe as cX,bae as cY,CT as cZ,vae as c_,Px as ca,E2e as cb,Wee as cc,$Ie as cd,Z5 as ce,TRe as cf,UIe as cg,FIe as ch,Rxe as ci,jIe as cj,zIe as ck,t2e as cl,Lxe as cm,Ug as cn,nF as co,Mo as cp,FT as cq,Ri as cr,Eae as cs,Ii as ct,hae as cu,tF as cv,Zy as cw,UF as cx,Uoe as cy,_ae as cz,IP as d,VF as d0,ERe as d1,ip as d2,DRe as d3,BT as d4,sb as d5,up as d6,Mae as d7,ap as d8,Pae as d9,Aae as da,vP as e,cQ as f,_Re as g,iJ as h,GJ as i,I as j,uQ as k,r_ as l,UJ as m,ARe as n,$8 as o,RRe as p,BJ as q,_ as r,yQ as s,ste as t,zJ as u,nte as v,NRe as w,fQ as x,HJ as y,H8 as z};
|