dccxx-s3-explorer 0.0.1-workspace
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/LICENSE +21 -0
- package/README.md +340 -0
- package/dist/locales/en/translations.json +5 -0
- package/dist/locales/es/translations.json +5 -0
- package/dist/s3-explorer.js +39417 -0
- package/dist/s3-explorer.js.map +1 -0
- package/dist/s3-explorer.umd.cjs +1068 -0
- package/dist/s3-explorer.umd.cjs.map +1 -0
- package/dist/style.css +1 -0
- package/dist/vite-react-boilerplate.png +0 -0
- package/package.json +144 -0
|
@@ -0,0 +1,1068 @@
|
|
|
1
|
+
(function(Gt,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],d):(Gt=typeof globalThis<"u"?globalThis:Gt||self,d(Gt.S3Explorer={},Gt.jsxRuntime,Gt.React,Gt.ReactDOM))})(this,function(Gt,d,D,ou){"use strict";var Fk=Gt=>{throw TypeError(Gt)};var $k=(Gt,d,D)=>d.has(Gt)||Fk("Cannot "+D);var lr=(Gt,d,D)=>($k(Gt,d,"read from private field"),D?D.call(Gt):d.get(Gt)),Uk=(Gt,d,D)=>d.has(Gt)?Fk("Cannot add the same private member more than once"):d instanceof WeakSet?d.add(Gt):d.set(Gt,D),tb=(Gt,d,D,ou)=>($k(Gt,d,"write to private field"),ou?ou.call(Gt,D):d.set(Gt,D),D);var En,Qr;function nb(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const S=nb(D),ja=nb(ou);/*! @azure/msal-common v15.17.0 2026-03-18 */const ve={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},Ji={SUCCESS:200,SUCCESS_RANGE_START:200,SUCCESS_RANGE_END:299,REDIRECT:302,CLIENT_ERROR:400,CLIENT_ERROR_RANGE_START:400,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,REQUEST_TIMEOUT:408,GONE:410,TOO_MANY_REQUESTS:429,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR:500,SERVER_ERROR_RANGE_START:500,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,SERVER_ERROR_RANGE_END:599,MULTI_SIDED_ERROR:600},zs={GET:"GET",POST:"POST"},Wa=[ve.OPENID_SCOPE,ve.PROFILE_SCOPE,ve.OFFLINE_ACCESS_SCOPE],rb=[...Wa,ve.EMAIL_SCOPE],dr={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},ob={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},Xi={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},iu={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},Dn={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",NO_SESSION:"no_session"},yp={CODE:"code",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},su={QUERY:"query",FRAGMENT:"fragment"},zk={QUERY:"query"},ib={AUTHORIZATION_CODE_GRANT:"authorization_code",REFRESH_TOKEN_GRANT:"refresh_token"},au={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",GENERIC_ACCOUNT_TYPE:"Generic"},yl={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},$n={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},wp="appmetadata",Vk="client_info",cu="1",lu={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},jr={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},Un={SCHEMA_VERSION:5,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},zt={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},wl={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},sb={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},qa={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},bp={CONFIGURED_NO_AUTO_DETECTION:"2",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},Vs={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},Kk={Pop:"pop"},ab=300;/*! @azure/msal-common v15.17.0 2026-03-18 */const du="unexpected_error",Gk="post_request_failed";/*! @azure/msal-common v15.17.0 2026-03-18 */const cb={[du]:"Unexpected error in authentication.",[Gk]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};class jt extends Error{constructor(e,n,r){const o=n?`${e}: ${n}`:e;super(o),Object.setPrototypeOf(this,jt.prototype),this.errorCode=e||ve.EMPTY_STRING,this.errorMessage=n||ve.EMPTY_STRING,this.subError=r||ve.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function Cp(t,e){return new jt(t,e?`${cb[t]} ${e}`:cb[t])}/*! @azure/msal-common v15.17.0 2026-03-18 */const xp="client_info_decoding_error",lb="client_info_empty_error",_p="token_parsing_error",db="null_or_empty_token",ci="endpoints_resolution_error",ub="network_error",fb="openid_config_error",hb="hash_not_deserialized",Ya="invalid_state",pb="state_mismatch",Sp="state_not_found",gb="nonce_mismatch",Tp="auth_time_not_found",mb="max_age_transpired",jk="multiple_matching_tokens",Wk="multiple_matching_accounts",vb="multiple_matching_appMetadata",yb="request_cannot_be_made",wb="cannot_remove_empty_scope",bb="cannot_append_scopeset",Ep="empty_input_scopeset",qk="device_code_polling_cancelled",Yk="device_code_expired",Qk="device_code_unknown_error",Ap="no_account_in_silent_request",Cb="invalid_cache_record",Ip="invalid_cache_environment",kp="no_account_found",Pp="no_crypto_object",Jk="unexpected_credential_type",Xk="invalid_assertion",Zk="invalid_client_credential",Zi="token_refresh_required",eP="user_timeout_reached",xb="token_claims_cnf_required_for_signedjwt",_b="authorization_code_missing_from_server_response",Sb="binding_key_not_removed",Tb="end_session_endpoint_not_supported",Op="key_id_missing",tP="no_network_connectivity",nP="user_canceled",rP="missing_tenant_id_error",ht="method_not_implemented",oP="nested_app_auth_bridge_disabled",iP="platform_broker_error";/*! @azure/msal-common v15.17.0 2026-03-18 */const Eb={[xp]:"The client info could not be parsed/decoded correctly",[lb]:"The client info was empty",[_p]:"Token cannot be parsed",[db]:"The token is null or empty",[ci]:"Endpoints cannot be resolved",[ub]:"Network request failed",[fb]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[hb]:"The hash parameters could not be deserialized",[Ya]:"State was not the expected format",[pb]:"State mismatch error",[Sp]:"State not found",[gb]:"Nonce mismatch error",[Tp]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[mb]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[jk]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[Wk]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[vb]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[yb]:"Token request cannot be made without authorization code or refresh token.",[wb]:"Cannot remove null or empty scope from ScopeSet",[bb]:"Cannot append ScopeSet",[Ep]:"Empty input ScopeSet cannot be processed",[qk]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[Yk]:"Device code is expired.",[Qk]:"Device code stopped polling for unknown reasons.",[Ap]:"Please pass an account object, silent flow is not supported without account information",[Cb]:"Cache record object was null or undefined.",[Ip]:"Invalid environment when attempting to create cache entry",[kp]:"No account found in cache for given key.",[Pp]:"No crypto object detected.",[Jk]:"Unexpected credential type.",[Xk]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[Zk]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[Zi]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[eP]:"User defined timeout for device code polling reached",[xb]:"Cannot generate a POP jwt if the token_claims are not populated",[_b]:"Server response does not contain an authorization code to proceed",[Sb]:"Could not remove the credential's binding key from storage.",[Tb]:"The provided authority does not support logout",[Op]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[tP]:"No network connectivity. Check your internet connection.",[nP]:"User cancelled the flow.",[rP]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[ht]:"This method has not been implemented",[oP]:"The nested app auth bridge is disabled",[iP]:"An error occurred in the native broker. See the platformBrokerError property for details."};class Np extends jt{constructor(e,n){super(e,n?`${Eb[e]}: ${n}`:Eb[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,Np.prototype)}}function Ae(t,e){return new Np(t,e)}/*! @azure/msal-common v15.17.0 2026-03-18 */const uu={createNewGuid:()=>{throw Ae(ht)},base64Decode:()=>{throw Ae(ht)},base64Encode:()=>{throw Ae(ht)},base64UrlEncode:()=>{throw Ae(ht)},encodeKid:()=>{throw Ae(ht)},async getPublicKeyThumbprint(){throw Ae(ht)},async removeTokenBindingKey(){throw Ae(ht)},async clearKeystore(){throw Ae(ht)},async signJwt(){throw Ae(ht)},async hashString(){throw Ae(ht)}};/*! @azure/msal-common v15.17.0 2026-03-18 */var an;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(an||(an={}));class es{constructor(e,n,r){this.level=an.Info;const o=()=>{},i=e||es.createDefaultLoggerOptions();this.localCallback=i.loggerCallback||o,this.piiLoggingEnabled=i.piiLoggingEnabled||!1,this.level=typeof i.logLevel=="number"?i.logLevel:an.Info,this.correlationId=i.correlationId||ve.EMPTY_STRING,this.packageName=n||ve.EMPTY_STRING,this.packageVersion=r||ve.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:an.Info}}clone(e,n,r){return new es({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},e,n)}logMessage(e,n){if(n.logLevel>this.level||!this.piiLoggingEnabled&&n.containsPii)return;const i=`${`[${new Date().toUTCString()}] : [${n.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${an[n.logLevel]} - ${e}`;this.executeCallback(n.logLevel,i,n.containsPii||!1)}executeCallback(e,n,r){this.localCallback&&this.localCallback(e,n,r)}error(e,n){this.logMessage(e,{logLevel:an.Error,containsPii:!1,correlationId:n||ve.EMPTY_STRING})}errorPii(e,n){this.logMessage(e,{logLevel:an.Error,containsPii:!0,correlationId:n||ve.EMPTY_STRING})}warning(e,n){this.logMessage(e,{logLevel:an.Warning,containsPii:!1,correlationId:n||ve.EMPTY_STRING})}warningPii(e,n){this.logMessage(e,{logLevel:an.Warning,containsPii:!0,correlationId:n||ve.EMPTY_STRING})}info(e,n){this.logMessage(e,{logLevel:an.Info,containsPii:!1,correlationId:n||ve.EMPTY_STRING})}infoPii(e,n){this.logMessage(e,{logLevel:an.Info,containsPii:!0,correlationId:n||ve.EMPTY_STRING})}verbose(e,n){this.logMessage(e,{logLevel:an.Verbose,containsPii:!1,correlationId:n||ve.EMPTY_STRING})}verbosePii(e,n){this.logMessage(e,{logLevel:an.Verbose,containsPii:!0,correlationId:n||ve.EMPTY_STRING})}trace(e,n){this.logMessage(e,{logLevel:an.Trace,containsPii:!1,correlationId:n||ve.EMPTY_STRING})}tracePii(e,n){this.logMessage(e,{logLevel:an.Trace,containsPii:!0,correlationId:n||ve.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}/*! @azure/msal-common v15.17.0 2026-03-18 */const Ab="@azure/msal-common",Dp="15.17.0";/*! @azure/msal-common v15.17.0 2026-03-18 */const Mp={None:"none"};/*! @azure/msal-common v15.17.0 2026-03-18 */const Ib="redirect_uri_empty",sP="claims_request_parsing_error",kb="authority_uri_insecure",bl="url_parse_error",Pb="empty_url_error",Ob="empty_input_scopes_error",Rp="invalid_claims",Nb="token_request_empty",Db="logout_request_empty",aP="invalid_code_challenge_method",Lp="pkce_params_missing",Fp="invalid_cloud_discovery_metadata",Mb="invalid_authority_metadata",Rb="untrusted_authority",fu="missing_ssh_jwk",Lb="missing_ssh_kid",cP="missing_nonce_authentication_header",lP="invalid_authentication_header",Fb="cannot_set_OIDCOptions",$b="cannot_allow_platform_broker",Ub="authority_mismatch",Hb="invalid_request_method_for_EAR",Bb="invalid_authorize_post_body_parameters",zb="invalid_platform_broker_configuration";/*! @azure/msal-common v15.17.0 2026-03-18 */const dP={[Ib]:"A redirect URI is required for all calls, and none has been set.",[sP]:"Could not parse the given claims request object.",[kb]:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[bl]:"URL could not be parsed into appropriate segments.",[Pb]:"URL was empty or null.",[Ob]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[Rp]:"Given claims parameter must be a stringified JSON object.",[Nb]:"Token request was empty and not found in cache.",[Db]:"The logout request was null or undefined.",[aP]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[Lp]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[Fp]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[Mb]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[Rb]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[fu]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[Lb]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[cP]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[lP]:"Invalid authentication header provided",[Fb]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[$b]:"Cannot set allowPlatformBroker parameter to true when not in AAD protocol mode.",[Ub]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority.",[Bb]:"Invalid authorize post body parameters provided. If you are using authorizePostBodyParameters, the request method must be POST. Please check the request method and parameters.",[Hb]:"Invalid request method for EAR protocol mode. The request method cannot be GET when using EAR protocol mode. Please change the request method to POST.",[zb]:"Invalid platform broker configuration. `allowPlatformBrokerWithDOM` can only be enabled when `allowPlatformBroker` is enabled."};class $p extends jt{constructor(e){super(e,dP[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,$p.prototype)}}function Wt(t){return new $p(t)}/*! @azure/msal-common v15.17.0 2026-03-18 */class Wr{static isEmptyObj(e){if(e)try{const n=JSON.parse(e);return Object.keys(n).length===0}catch{}return!0}static startsWith(e,n){return e.indexOf(n)===0}static endsWith(e,n){return e.length>=n.length&&e.lastIndexOf(n)===e.length-n.length}static queryStringToObject(e){const n={},r=e.split("&"),o=i=>decodeURIComponent(i.replace(/\+/g," "));return r.forEach(i=>{if(i.trim()){const[a,c]=i.split(/=(.+)/g,2);a&&c&&(n[o(a)]=o(c))}}),n}static trimArrayEntries(e){return e.map(n=>n.trim())}static removeEmptyStringsFromArray(e){return e.filter(n=>!!n)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}static matchPattern(e,n){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(n)}static matchPatternStrict(e,n,r){const o=r==null?void 0:r.component;let i=e.replace(/[.+^${}()|[\]\\*?]/g,"\\$&");return o==="host"?i=i.replace(/\\\*/g,"[^.]*"):i=i.replace(/\\\*/g,".*"),new RegExp(`^${i}$`).test(n)}}/*! @azure/msal-common v15.17.0 2026-03-18 */class Pn{constructor(e){const n=e?Wr.trimArrayEntries([...e]):[],r=n?Wr.removeEmptyStringsFromArray(n):[];if(!r||!r.length)throw Wt(Ob);this.scopes=new Set,r.forEach(o=>this.scopes.add(o))}static fromString(e){const r=(e||ve.EMPTY_STRING).split(" ");return new Pn(r)}static createSearchScopes(e){const n=e&&e.length>0?e:[...Wa],r=new Pn(n);return r.containsOnlyOIDCScopes()?r.removeScope(ve.OFFLINE_ACCESS_SCOPE):r.removeOIDCScopes(),r}containsScope(e){const n=this.printScopesLowerCase().split(" "),r=new Pn(n);return e?r.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(n=>this.containsScope(n))}containsOnlyOIDCScopes(){let e=0;return rb.forEach(n=>{this.containsScope(n)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(n=>this.appendScope(n))}catch{throw Ae(bb)}}removeScope(e){if(!e)throw Ae(wb);this.scopes.delete(e.trim())}removeOIDCScopes(){rb.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw Ae(Ep);const n=new Set;return e.scopes.forEach(r=>n.add(r.toLowerCase())),this.scopes.forEach(r=>n.add(r.toLowerCase())),n}intersectingScopeSets(e){if(!e)throw Ae(Ep);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const n=this.unionScopeSets(e),r=e.getScopeCount(),o=this.getScopeCount();return n.size<o+r}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach(n=>e.push(n)),e}printScopes(){return this.scopes?this.asArray().join(" "):ve.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}}/*! @azure/msal-common v15.17.0 2026-03-18 */function hu(t,e){if(!t)throw Ae(lb);try{const n=e(t);return JSON.parse(n)}catch{throw Ae(xp)}}function Qa(t){if(!t)throw Ae(xp);const e=t.split(yl.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?ve.EMPTY_STRING:e[1]}}/*! @azure/msal-common v15.17.0 2026-03-18 */function Vb(t,e){return!!t&&!!e&&t===e.split(".")[1]}function Ja(t,e,n,r){if(r){const{oid:o,sub:i,tid:a,name:c,tfp:u,acr:h,preferred_username:p,upn:g,login_hint:v}=r,m=a||u||h||"";return{tenantId:m,localAccountId:o||i||"",name:c,username:p||g||"",loginHint:v,isHomeTenant:Vb(m,t)}}else return{tenantId:n,localAccountId:e,username:"",isHomeTenant:Vb(n,t)}}function Up(t,e,n,r){let o=t;if(e){const{isHomeTenant:i,...a}=e;o={...t,...a}}if(n){const{isHomeTenant:i,...a}=Ja(t.homeAccountId,t.localAccountId,t.tenantId,n);return o={...o,...a,idTokenClaims:n,idToken:r},o}return o}/*! @azure/msal-common v15.17.0 2026-03-18 */const vo={Default:0,Adfs:1,Dsts:2,Ciam:3};/*! @azure/msal-common v15.17.0 2026-03-18 */function Hp(t){return t&&(t.tid||t.tfp||t.acr)||null}/*! @azure/msal-common v15.17.0 2026-03-18 */const Ir={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};/*! @azure/msal-common v15.17.0 2026-03-18 */class wn{static getAccountInfo(e){const n=e.tenantProfiles||[];return n.length===0&&e.realm&&e.localAccountId&&n.push(Ja(e.homeAccountId,e.localAccountId,e.realm)),{homeAccountId:e.homeAccountId,environment:e.environment,tenantId:e.realm,username:e.username,localAccountId:e.localAccountId,loginHint:e.loginHint,name:e.name,nativeAccountId:e.nativeAccountId,authorityType:e.authorityType,tenantProfiles:new Map(n.map(r=>[r.tenantId,r])),dataBoundary:e.dataBoundary}}isSingleTenant(){return!this.tenantProfiles}static createAccount(e,n,r){var h,p,g,v,m,C,b;const o=new wn;n.authorityType===vo.Adfs?o.authorityType=au.ADFS_ACCOUNT_TYPE:n.protocolMode===Ir.OIDC?o.authorityType=au.GENERIC_ACCOUNT_TYPE:o.authorityType=au.MSSTS_ACCOUNT_TYPE;let i;e.clientInfo&&r&&(i=hu(e.clientInfo,r),i.xms_tdbr&&(o.dataBoundary=i.xms_tdbr==="EU"?"EU":"None")),o.clientInfo=e.clientInfo,o.homeAccountId=e.homeAccountId,o.nativeAccountId=e.nativeAccountId;const a=e.environment||n&&n.getPreferredCache();if(!a)throw Ae(Ip);o.environment=a,o.realm=(i==null?void 0:i.utid)||Hp(e.idTokenClaims)||"",o.localAccountId=(i==null?void 0:i.uid)||((h=e.idTokenClaims)==null?void 0:h.oid)||((p=e.idTokenClaims)==null?void 0:p.sub)||"";const c=((g=e.idTokenClaims)==null?void 0:g.preferred_username)||((v=e.idTokenClaims)==null?void 0:v.upn),u=(m=e.idTokenClaims)!=null&&m.emails?e.idTokenClaims.emails[0]:null;if(o.username=c||u||"",o.loginHint=(C=e.idTokenClaims)==null?void 0:C.login_hint,o.name=((b=e.idTokenClaims)==null?void 0:b.name)||"",o.cloudGraphHostName=e.cloudGraphHostName,o.msGraphHost=e.msGraphHost,e.tenantProfiles)o.tenantProfiles=e.tenantProfiles;else{const w=Ja(e.homeAccountId,o.localAccountId,o.realm,e.idTokenClaims);o.tenantProfiles=[w]}return o}static createFromAccountInfo(e,n,r){var a;const o=new wn;o.authorityType=e.authorityType||au.GENERIC_ACCOUNT_TYPE,o.homeAccountId=e.homeAccountId,o.localAccountId=e.localAccountId,o.nativeAccountId=e.nativeAccountId,o.realm=e.tenantId,o.environment=e.environment,o.username=e.username,o.name=e.name,o.loginHint=e.loginHint,o.cloudGraphHostName=n,o.msGraphHost=r;const i=Array.from(((a=e.tenantProfiles)==null?void 0:a.values())||[]);return i.length===0&&e.tenantId&&e.localAccountId&&i.push(Ja(e.homeAccountId,e.localAccountId,e.tenantId,e.idTokenClaims)),o.tenantProfiles=i,o.dataBoundary=e.dataBoundary,o}static generateHomeAccountId(e,n,r,o,i){if(!(n===vo.Adfs||n===vo.Dsts)){if(e)try{const a=hu(e,o.base64Decode);if(a.uid&&a.utid)return`${a.uid}.${a.utid}`}catch{}r.warning("No client info in response")}return(i==null?void 0:i.sub)||""}static isAccountEntity(e){return e?e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"):!1}static accountInfoIsEqual(e,n,r){if(!e||!n)return!1;let o=!0;if(r){const i=e.idTokenClaims||{},a=n.idTokenClaims||{};o=i.iat===a.iat&&i.nonce===a.nonce}return e.homeAccountId===n.homeAccountId&&e.localAccountId===n.localAccountId&&e.username===n.username&&e.tenantId===n.tenantId&&e.loginHint===n.loginHint&&e.environment===n.environment&&e.nativeAccountId===n.nativeAccountId&&o}}/*! @azure/msal-common v15.17.0 2026-03-18 */function Uo(t,e){const n=uP(t);try{const r=e(n);return JSON.parse(r)}catch{throw Ae(_p)}}function Ho(t){if(!t.signin_state)return!1;const e=["kmsi","dvc_dmjd"];return t.signin_state.some(r=>e.includes(r.trim().toLowerCase()))}function uP(t){if(!t)throw Ae(db);const n=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!n||n.length<4)throw Ae(_p);return n[2]}function Kb(t,e){if(e===0||Date.now()-3e5>t+e)throw Ae(mb)}/*! @azure/msal-common v15.17.0 2026-03-18 */function Gb(t){if(!t)return t;let e=t.toLowerCase();return Wr.endsWith(e,"?")?e=e.slice(0,-1):Wr.endsWith(e,"?/")&&(e=e.slice(0,-2)),Wr.endsWith(e,"/")||(e+="/"),e}function jb(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}function pu(t){if(!t||t.indexOf("=")<0)return null;try{const e=jb(t),n=Object.fromEntries(new URLSearchParams(e));if(n.code||n.ear_jwe||n.error||n.error_description||n.state)return n}catch{throw Ae(hb)}return null}function Cl(t,e=!0,n){const r=new Array;return t.forEach((o,i)=>{!e&&n&&i in n?r.push(`${i}=${o}`):r.push(`${i}=${encodeURIComponent(o)}`)}),r.join("&")}function Wb(t){if(!t)return t;const e=t.split("#")[0];try{const n=new URL(e),r=n.origin+n.pathname+n.search;return Gb(r)}catch{return Gb(e)}}/*! @azure/msal-common v15.17.0 2026-03-18 */class It{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Wt(Pb);e.includes("#")||(this._urlString=It.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let n=e.toLowerCase();return Wr.endsWith(n,"?")?n=n.slice(0,-1):Wr.endsWith(n,"?/")&&(n=n.slice(0,-2)),Wr.endsWith(n,"/")||(n+="/"),n}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw Wt(bl)}if(!e.HostNameAndPort||!e.PathSegments)throw Wt(bl);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw Wt(kb)}static appendQueryString(e,n){return n?e.indexOf("?")<0?`${e}?${n}`:`${e}&${n}`:e}static removeHashFromUrl(e){return It.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const n=this.getUrlComponents(),r=n.PathSegments;return e&&r.length!==0&&(r[0]===Xi.COMMON||r[0]===Xi.ORGANIZATIONS)&&(r[0]=e),It.constructAuthorityUriFromObject(n)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),n=this.urlString.match(e);if(!n)throw Wt(bl);const r={Protocol:n[1],HostNameAndPort:n[4],AbsolutePath:n[5],QueryString:n[7]};let o=r.AbsolutePath.split("/");return o=o.filter(i=>i&&i.length>0),r.PathSegments=o,r.QueryString&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r}static getDomainFromUrl(e){const n=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(n);if(!r)throw Wt(bl);return r[2]}static getAbsoluteUrl(e,n){if(e[0]===ve.FORWARD_SLASH){const o=new It(n).getUrlComponents();return o.Protocol+"//"+o.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new It(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!pu(e)}}/*! @azure/msal-common v15.17.0 2026-03-18 */const qb={endpointMetadata:{"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"},"login.sovcloud-identity.fr":{token_endpoint:"https://login.sovcloud-identity.fr/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.sovcloud-identity.fr/{tenantid}/discovery/v2.0/keys",issuer:"https://login.sovcloud-identity.fr/{tenantid}/v2.0",authorization_endpoint:"https://login.sovcloud-identity.fr/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.sovcloud-identity.fr/{tenantid}/oauth2/v2.0/logout"},"login.sovcloud-identity.de":{token_endpoint:"https://login.sovcloud-identity.de/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.sovcloud-identity.de/{tenantid}/discovery/v2.0/keys",issuer:"https://login.sovcloud-identity.de/{tenantid}/v2.0",authorization_endpoint:"https://login.sovcloud-identity.de/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.sovcloud-identity.de/{tenantid}/oauth2/v2.0/logout"},"login.sovcloud-identity.sg":{token_endpoint:"https://login.sovcloud-identity.sg/common/oauth2/v2.0/token",jwks_uri:"https://login.sovcloud-identity.sg/common/discovery/v2.0/keys",issuer:"https://login.sovcloud-identity.sg/{tenantid}/v2.0",authorization_endpoint:"https://login.sovcloud-identity.sg/common/oauth2/v2.0/authorize",end_session_endpoint:"https://login.sovcloud-identity.sg/common/oauth2/v2.0/logout"}},instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]},{preferred_network:"login.sovcloud-identity.fr",preferred_cache:"login.sovcloud-identity.fr",aliases:["login.sovcloud-identity.fr"]},{preferred_network:"login.sovcloud-identity.de",preferred_cache:"login.sovcloud-identity.de",aliases:["login.sovcloud-identity.de"]},{preferred_network:"login.sovcloud-identity.sg",preferred_cache:"login.sovcloud-identity.sg",aliases:["login.sovcloud-identity.sg"]}]}},Yb=qb.endpointMetadata,Bp=qb.instanceDiscoveryMetadata,Qb=new Set;Bp.metadata.forEach(t=>{t.aliases.forEach(e=>{Qb.add(e)})});function fP(t,e){var o;let n;const r=t.canonicalAuthority;if(r){const i=new It(r).getUrlComponents().HostNameAndPort;n=Jb(i,(o=t.cloudDiscoveryMetadata)==null?void 0:o.metadata,jr.CONFIG,e)||Jb(i,Bp.metadata,jr.HARDCODED_VALUES,e)||t.knownAuthorities}return n||[]}function Jb(t,e,n,r){if(r==null||r.trace(`getAliasesFromMetadata called with source: ${n}`),t&&e){const o=gu(e,t);if(o)return r==null||r.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${n}, returning aliases`),o.aliases;r==null||r.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${n}`)}return null}function hP(t){return gu(Bp.metadata,t)}function gu(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(r.aliases.includes(e))return r}return null}/*! @azure/msal-common v15.17.0 2026-03-18 */const mu="cache_quota_exceeded",zp="cache_error_unknown";/*! @azure/msal-common v15.17.0 2026-03-18 */const Vp={[mu]:"Exceeded cache storage capacity.",[zp]:"Unexpected error occurred when using cache storage."};class Xa extends jt{constructor(e,n){const r=n||(Vp[e]?Vp[e]:Vp[zp]);super(`${e}: ${r}`),Object.setPrototypeOf(this,Xa.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=r}}function Kp(t){return t instanceof Error?t.name==="QuotaExceededError"||t.name==="NS_ERROR_DOM_QUOTA_REACHED"||t.message.includes("exceeded the quota")?new Xa(mu):new Xa(t.name,t.message):new Xa(zp)}/*! @azure/msal-common v15.17.0 2026-03-18 */class Gp{constructor(e,n,r,o,i){this.clientId=e,this.cryptoImpl=n,this.commonLogger=r.clone(Ab,Dp),this.staticAuthorityOptions=i,this.performanceClient=o}getAllAccounts(e,n){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,n),n,e)}getAccountInfoFilteredBy(e,n){if(Object.keys(e).length===0||Object.values(e).every(o=>!o))return this.commonLogger.warning("getAccountInfoFilteredBy: Account filter is empty or invalid, returning null"),null;const r=this.getAllAccounts(e,n);return r.length>1?r.sort(i=>i.idTokenClaims?-1:1)[0]:r.length===1?r[0]:null}getBaseAccountInfo(e,n){const r=this.getAccountsFilteredBy(e,n);return r.length>0?wn.getAccountInfo(r[0]):null}buildTenantProfiles(e,n,r){return e.flatMap(o=>this.getTenantProfilesFromAccountEntity(o,n,r==null?void 0:r.tenantId,r))}getTenantedAccountInfoByFilter(e,n,r,o,i){let a=null,c;if(i&&!this.tenantProfileMatchesFilter(r,i))return null;const u=this.getIdToken(e,o,n,r.tenantId);return u&&(c=Uo(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(c,i))?null:(a=Up(e,r,c,u==null?void 0:u.secret),a)}getTenantProfilesFromAccountEntity(e,n,r,o){const i=wn.getAccountInfo(e);let a=i.tenantProfiles||new Map;const c=this.getTokenKeys();if(r){const h=a.get(r);if(h)a=new Map([[r,h]]);else return[]}const u=[];return a.forEach(h=>{const p=this.getTenantedAccountInfoByFilter(i,c,h,n,o);p&&u.push(p)}),u}tenantProfileMatchesFilter(e,n){return!(n.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,n.localAccountId)||n.name&&e.name!==n.name||n.isHomeTenant!==void 0&&e.isHomeTenant!==n.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,n){return!(n&&(n.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,n.localAccountId)||n.loginHint&&!this.matchLoginHintFromTokenClaims(e,n.loginHint)||n.username&&!this.matchUsername(e.preferred_username,n.username)||n.name&&!this.matchName(e,n.name)||n.sid&&!this.matchSid(e,n.sid)))}async saveCacheRecord(e,n,r,o,i){var a;if(!e)throw Ae(Cb);try{e.account&&await this.setAccount(e.account,n,r,o),e.idToken&&(i==null?void 0:i.idToken)!==!1&&await this.setIdTokenCredential(e.idToken,n,r),e.accessToken&&(i==null?void 0:i.accessToken)!==!1&&await this.saveAccessToken(e.accessToken,n,r),e.refreshToken&&(i==null?void 0:i.refreshToken)!==!1&&await this.setRefreshTokenCredential(e.refreshToken,n,r),e.appMetadata&&this.setAppMetadata(e.appMetadata,n)}catch(c){throw(a=this.commonLogger)==null||a.error("CacheManager.saveCacheRecord: failed"),c instanceof jt?c:Kp(c)}}async saveAccessToken(e,n,r){const o={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},i=this.getTokenKeys(),a=Pn.fromString(e.target);i.accessToken.forEach(c=>{if(!this.accessTokenKeyMatchesFilter(c,o,!1))return;const u=this.getAccessTokenCredential(c,n);u&&this.credentialMatchesFilter(u,o)&&Pn.fromString(u.target).intersectingScopeSets(a)&&this.removeAccessToken(c,n)}),await this.setAccessTokenCredential(e,n,r)}getAccountsFilteredBy(e,n){const r=this.getAccountKeys(),o=[];return r.forEach(i=>{var h;const a=this.getAccount(i,n);if(!a||e.homeAccountId&&!this.matchHomeAccountId(a,e.homeAccountId)||e.username&&!this.matchUsername(a.username,e.username)||e.environment&&!this.matchEnvironment(a,e.environment)||e.realm&&!this.matchRealm(a,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(a,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(a,e.authorityType))return;const c={localAccountId:e==null?void 0:e.localAccountId,name:e==null?void 0:e.name},u=(h=a.tenantProfiles)==null?void 0:h.filter(p=>this.tenantProfileMatchesFilter(p,c));u&&u.length===0||o.push(a)}),o}credentialMatchesFilter(e,n){return!(n.clientId&&!this.matchClientId(e,n.clientId)||n.userAssertionHash&&!this.matchUserAssertionHash(e,n.userAssertionHash)||typeof n.homeAccountId=="string"&&!this.matchHomeAccountId(e,n.homeAccountId)||n.environment&&!this.matchEnvironment(e,n.environment)||n.realm&&!this.matchRealm(e,n.realm)||n.credentialType&&!this.matchCredentialType(e,n.credentialType)||n.familyId&&!this.matchFamilyId(e,n.familyId)||n.target&&!this.matchTarget(e,n.target)||(n.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==n.requestedClaimsHash||e.credentialType===$n.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(n.tokenType&&!this.matchTokenType(e,n.tokenType)||n.tokenType===zt.SSH&&n.keyId&&!this.matchKeyId(e,n.keyId)))}getAppMetadataFilteredBy(e){const n=this.getKeys(),r={};return n.forEach(o=>{if(!this.isAppMetadata(o))return;const i=this.getAppMetadata(o);i&&(e.environment&&!this.matchEnvironment(i,e.environment)||e.clientId&&!this.matchClientId(i,e.clientId)||(r[o]=i))}),r}getAuthorityMetadataByAlias(e){const n=this.getAuthorityMetadataKeys();let r=null;return n.forEach(o=>{if(!this.isAuthorityMetadata(o)||o.indexOf(this.clientId)===-1)return;const i=this.getAuthorityMetadata(o);i&&i.aliases.indexOf(e)!==-1&&(r=i)}),r}removeAllAccounts(e){this.getAllAccounts({},e).forEach(r=>{this.removeAccount(r,e)})}removeAccount(e,n){this.removeAccountContext(e,n);const r=this.getAccountKeys(),o=i=>i.includes(e.homeAccountId)&&i.includes(e.environment);r.filter(o).forEach(i=>{this.removeItem(i,n),this.performanceClient.incrementFields({accountsRemoved:1},n)})}removeAccountContext(e,n){const r=this.getTokenKeys(),o=i=>i.includes(e.homeAccountId)&&i.includes(e.environment);r.idToken.filter(o).forEach(i=>{this.removeIdToken(i,n)}),r.accessToken.filter(o).forEach(i=>{this.removeAccessToken(i,n)}),r.refreshToken.filter(o).forEach(i=>{this.removeRefreshToken(i,n)})}removeAccessToken(e,n){const r=this.getAccessTokenCredential(e,n);if(this.removeItem(e,n),this.performanceClient.incrementFields({accessTokensRemoved:1},n),!r||r.credentialType.toLowerCase()!==$n.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()||r.tokenType!==zt.POP)return;const o=r.keyId;o&&this.cryptoImpl.removeTokenBindingKey(o).catch(()=>{var i;this.commonLogger.error(`Failed to remove token binding key ${o}`,n),(i=this.performanceClient)==null||i.incrementFields({removeTokenBindingKeyFailure:1},n)})}removeAppMetadata(e){return this.getKeys().forEach(r=>{this.isAppMetadata(r)&&this.removeItem(r,e)}),!0}getIdToken(e,n,r,o,i){this.commonLogger.trace("CacheManager - getIdToken called");const a={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:$n.ID_TOKEN,clientId:this.clientId,realm:o},c=this.getIdTokensByFilter(a,n,r),u=c.size;if(u<1)return this.commonLogger.info("CacheManager:getIdToken - No token found"),null;if(u>1){let h=c;if(!o){const p=new Map;c.forEach((v,m)=>{v.realm===e.tenantId&&p.set(m,v)});const g=p.size;if(g<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result"),c.values().next().value;if(g===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile"),p.values().next().value;h=p}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them"),h.forEach((p,g)=>{this.removeIdToken(g,n)}),i&&n&&i.addFields({multiMatchedID:c.size},n),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token"),c.values().next().value}getIdTokensByFilter(e,n,r){const o=r&&r.idToken||this.getTokenKeys().idToken,i=new Map;return o.forEach(a=>{if(!this.idTokenKeyMatchesFilter(a,{clientId:this.clientId,...e}))return;const c=this.getIdTokenCredential(a,n);c&&this.credentialMatchesFilter(c,e)&&i.set(a,c)}),i}idTokenKeyMatchesFilter(e,n){const r=e.toLowerCase();return!(n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1)}removeIdToken(e,n){this.removeItem(e,n)}removeRefreshToken(e,n){this.removeItem(e,n)}getAccessToken(e,n,r,o){const i=n.correlationId;this.commonLogger.trace("CacheManager - getAccessToken called",i);const a=Pn.createSearchScopes(n.scopes),c=n.authenticationScheme||zt.BEARER,u=c.toLowerCase()!==zt.BEARER.toLowerCase()?$n.ACCESS_TOKEN_WITH_AUTH_SCHEME:$n.ACCESS_TOKEN,h={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:u,clientId:this.clientId,realm:o||e.tenantId,target:a,tokenType:c,keyId:n.sshKid,requestedClaimsHash:n.requestedClaimsHash},p=r&&r.accessToken||this.getTokenKeys().accessToken,g=[];p.forEach(m=>{if(this.accessTokenKeyMatchesFilter(m,h,!0)){const C=this.getAccessTokenCredential(m,i);C&&this.credentialMatchesFilter(C,h)&&g.push(C)}});const v=g.length;return v<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found",i),null):v>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them",i),g.forEach(m=>{this.removeAccessToken(this.generateCredentialKey(m),i)}),this.performanceClient.addFields({multiMatchedAT:g.length},i),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token",i),g[0])}accessTokenKeyMatchesFilter(e,n,r){const o=e.toLowerCase();if(n.clientId&&o.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&o.indexOf(n.homeAccountId.toLowerCase())===-1||n.realm&&o.indexOf(n.realm.toLowerCase())===-1||n.requestedClaimsHash&&o.indexOf(n.requestedClaimsHash.toLowerCase())===-1)return!1;if(n.target){const i=n.target.asArray();for(let a=0;a<i.length;a++){if(r&&!o.includes(i[a].toLowerCase()))return!1;if(!r&&o.includes(i[a].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e,n){const r=this.getTokenKeys(),o=[];return r.accessToken.forEach(i=>{if(!this.accessTokenKeyMatchesFilter(i,e,!0))return;const a=this.getAccessTokenCredential(i,n);a&&this.credentialMatchesFilter(a,e)&&o.push(a)}),o}getRefreshToken(e,n,r,o,i){this.commonLogger.trace("CacheManager - getRefreshToken called");const a=n?cu:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:$n.REFRESH_TOKEN,clientId:this.clientId,familyId:a},u=o&&o.refreshToken||this.getTokenKeys().refreshToken,h=[];u.forEach(g=>{if(this.refreshTokenKeyMatchesFilter(g,c)){const v=this.getRefreshTokenCredential(g,r);v&&this.credentialMatchesFilter(v,c)&&h.push(v)}});const p=h.length;return p<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(p>1&&i&&r&&i.addFields({multiMatchedRT:p},r),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),h[0])}refreshTokenKeyMatchesFilter(e,n){const r=e.toLowerCase();return!(n.familyId&&r.indexOf(n.familyId.toLowerCase())===-1||!n.familyId&&n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e){const n={environment:e,clientId:this.clientId},r=this.getAppMetadataFilteredBy(n),o=Object.keys(r).map(a=>r[a]),i=o.length;if(i<1)return null;if(i>1)throw Ae(vb);return o[0]}isAppMetadataFOCI(e){const n=this.readAppMetadataFromCache(e);return!!(n&&n.familyId===cu)}matchHomeAccountId(e,n){return typeof e.homeAccountId=="string"&&n===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,n){const r=e.oid||e.sub;return n===r}matchLocalAccountIdFromTenantProfile(e,n){return e.localAccountId===n}matchName(e,n){var r;return n.toLowerCase()===((r=e.name)==null?void 0:r.toLowerCase())}matchUsername(e,n){return!!(e&&typeof e=="string"&&(n==null?void 0:n.toLowerCase())===e.toLowerCase())}matchUserAssertionHash(e,n){return!!(e.userAssertionHash&&n===e.userAssertionHash)}matchEnvironment(e,n){if(this.staticAuthorityOptions){const o=fP(this.staticAuthorityOptions,this.commonLogger);if(o.includes(n)&&o.includes(e.environment))return!0}const r=this.getAuthorityMetadataByAlias(n);return!!(r&&r.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,n){return e.credentialType&&n.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,n){return!!(e.clientId&&n===e.clientId)}matchFamilyId(e,n){return!!(e.familyId&&n===e.familyId)}matchRealm(e,n){var r;return((r=e.realm)==null?void 0:r.toLowerCase())===n.toLowerCase()}matchNativeAccountId(e,n){return!!(e.nativeAccountId&&n===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,n){return e.login_hint===n||e.preferred_username===n||e.upn===n}matchSid(e,n){return e.sid===n}matchAuthorityType(e,n){return!!(e.authorityType&&n.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,n){return e.credentialType!==$n.ACCESS_TOKEN&&e.credentialType!==$n.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:Pn.fromString(e.target).containsScopeSet(n)}matchTokenType(e,n){return!!(e.tokenType&&e.tokenType===n)}matchKeyId(e,n){return!!(e.keyId&&e.keyId===n)}isAppMetadata(e){return e.indexOf(wp)!==-1}isAuthorityMetadata(e){return e.indexOf(lu.CACHE_KEY)!==-1}generateAuthorityMetadataCacheKey(e){return`${lu.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,n){for(const r in n)e[r]=n[r];return e}}class pP extends Gp{async setAccount(){throw Ae(ht)}getAccount(){throw Ae(ht)}async setIdTokenCredential(){throw Ae(ht)}getIdTokenCredential(){throw Ae(ht)}async setAccessTokenCredential(){throw Ae(ht)}getAccessTokenCredential(){throw Ae(ht)}async setRefreshTokenCredential(){throw Ae(ht)}getRefreshTokenCredential(){throw Ae(ht)}setAppMetadata(){throw Ae(ht)}getAppMetadata(){throw Ae(ht)}setServerTelemetry(){throw Ae(ht)}getServerTelemetry(){throw Ae(ht)}setAuthorityMetadata(){throw Ae(ht)}getAuthorityMetadata(){throw Ae(ht)}getAuthorityMetadataKeys(){throw Ae(ht)}setThrottlingCache(){throw Ae(ht)}getThrottlingCache(){throw Ae(ht)}removeItem(){throw Ae(ht)}getKeys(){throw Ae(ht)}getAccountKeys(){throw Ae(ht)}getTokenKeys(){throw Ae(ht)}generateCredentialKey(){throw Ae(ht)}generateAccountKey(){throw Ae(ht)}}/*! @azure/msal-common v15.17.0 2026-03-18 */const H={AcquireTokenByCode:"acquireTokenByCode",AcquireTokenByRefreshToken:"acquireTokenByRefreshToken",AcquireTokenSilent:"acquireTokenSilent",AcquireTokenSilentAsync:"acquireTokenSilentAsync",AcquireTokenPopup:"acquireTokenPopup",AcquireTokenPreRedirect:"acquireTokenPreRedirect",AcquireTokenRedirect:"acquireTokenRedirect",CryptoOptsGetPublicKeyThumbprint:"cryptoOptsGetPublicKeyThumbprint",CryptoOptsSignJwt:"cryptoOptsSignJwt",SilentCacheClientAcquireToken:"silentCacheClientAcquireToken",SilentIframeClientAcquireToken:"silentIframeClientAcquireToken",AwaitConcurrentIframe:"awaitConcurrentIframe",SilentRefreshClientAcquireToken:"silentRefreshClientAcquireToken",SsoSilent:"ssoSilent",StandardInteractionClientGetDiscoveredAuthority:"standardInteractionClientGetDiscoveredAuthority",FetchAccountIdWithNativeBroker:"fetchAccountIdWithNativeBroker",NativeInteractionClientAcquireToken:"nativeInteractionClientAcquireToken",BaseClientCreateTokenRequestHeaders:"baseClientCreateTokenRequestHeaders",NetworkClientSendPostRequestAsync:"networkClientSendPostRequestAsync",RefreshTokenClientExecutePostToTokenEndpoint:"refreshTokenClientExecutePostToTokenEndpoint",AuthorizationCodeClientExecutePostToTokenEndpoint:"authorizationCodeClientExecutePostToTokenEndpoint",BrokerHandhshake:"brokerHandshake",AcquireTokenByRefreshTokenInBroker:"acquireTokenByRefreshTokenInBroker",AcquireTokenByBroker:"acquireTokenByBroker",RefreshTokenClientExecuteTokenRequest:"refreshTokenClientExecuteTokenRequest",RefreshTokenClientAcquireToken:"refreshTokenClientAcquireToken",RefreshTokenClientAcquireTokenWithCachedRefreshToken:"refreshTokenClientAcquireTokenWithCachedRefreshToken",RefreshTokenClientAcquireTokenByRefreshToken:"refreshTokenClientAcquireTokenByRefreshToken",RefreshTokenClientCreateTokenRequestBody:"refreshTokenClientCreateTokenRequestBody",AcquireTokenFromCache:"acquireTokenFromCache",SilentFlowClientAcquireCachedToken:"silentFlowClientAcquireCachedToken",SilentFlowClientGenerateResultFromCacheRecord:"silentFlowClientGenerateResultFromCacheRecord",AcquireTokenBySilentIframe:"acquireTokenBySilentIframe",InitializeBaseRequest:"initializeBaseRequest",InitializeSilentRequest:"initializeSilentRequest",InitializeClientApplication:"initializeClientApplication",InitializeCache:"initializeCache",SilentIframeClientTokenHelper:"silentIframeClientTokenHelper",SilentHandlerInitiateAuthRequest:"silentHandlerInitiateAuthRequest",SilentHandlerMonitorIframeForHash:"silentHandlerMonitorIframeForHash",SilentHandlerLoadFrame:"silentHandlerLoadFrame",SilentHandlerLoadFrameSync:"silentHandlerLoadFrameSync",StandardInteractionClientCreateAuthCodeClient:"standardInteractionClientCreateAuthCodeClient",StandardInteractionClientGetClientConfiguration:"standardInteractionClientGetClientConfiguration",StandardInteractionClientInitializeAuthorizationRequest:"standardInteractionClientInitializeAuthorizationRequest",GetAuthCodeUrl:"getAuthCodeUrl",GetStandardParams:"getStandardParams",HandleCodeResponseFromServer:"handleCodeResponseFromServer",HandleCodeResponse:"handleCodeResponse",HandleResponseEar:"handleResponseEar",HandleResponsePlatformBroker:"handleResponsePlatformBroker",HandleResponseCode:"handleResponseCode",UpdateTokenEndpointAuthority:"updateTokenEndpointAuthority",AuthClientAcquireToken:"authClientAcquireToken",AuthClientExecuteTokenRequest:"authClientExecuteTokenRequest",AuthClientCreateTokenRequestBody:"authClientCreateTokenRequestBody",PopTokenGenerateCnf:"popTokenGenerateCnf",PopTokenGenerateKid:"popTokenGenerateKid",HandleServerTokenResponse:"handleServerTokenResponse",DeserializeResponse:"deserializeResponse",AuthorityFactoryCreateDiscoveredInstance:"authorityFactoryCreateDiscoveredInstance",AuthorityResolveEndpointsAsync:"authorityResolveEndpointsAsync",AuthorityResolveEndpointsFromLocalSources:"authorityResolveEndpointsFromLocalSources",AuthorityGetCloudDiscoveryMetadataFromNetwork:"authorityGetCloudDiscoveryMetadataFromNetwork",AuthorityUpdateCloudDiscoveryMetadata:"authorityUpdateCloudDiscoveryMetadata",AuthorityGetEndpointMetadataFromNetwork:"authorityGetEndpointMetadataFromNetwork",AuthorityUpdateEndpointMetadata:"authorityUpdateEndpointMetadata",AuthorityUpdateMetadataWithRegionalInformation:"authorityUpdateMetadataWithRegionalInformation",RegionDiscoveryDetectRegion:"regionDiscoveryDetectRegion",RegionDiscoveryGetRegionFromIMDS:"regionDiscoveryGetRegionFromIMDS",RegionDiscoveryGetCurrentVersion:"regionDiscoveryGetCurrentVersion",AcquireTokenByCodeAsync:"acquireTokenByCodeAsync",GetEndpointMetadataFromNetwork:"getEndpointMetadataFromNetwork",GetCloudDiscoveryMetadataFromNetworkMeasurement:"getCloudDiscoveryMetadataFromNetworkMeasurement",HandleRedirectPromiseMeasurement:"handleRedirectPromise",HandleNativeRedirectPromiseMeasurement:"handleNativeRedirectPromise",UpdateCloudDiscoveryMetadataMeasurement:"updateCloudDiscoveryMetadataMeasurement",UsernamePasswordClientAcquireToken:"usernamePasswordClientAcquireToken",NativeMessageHandlerHandshake:"nativeMessageHandlerHandshake",NativeGenerateAuthResult:"nativeGenerateAuthResult",RemoveHiddenIframe:"removeHiddenIframe",ClearTokensAndKeysWithClaims:"clearTokensAndKeysWithClaims",CacheManagerGetRefreshToken:"cacheManagerGetRefreshToken",ImportExistingCache:"importExistingCache",SetUserData:"setUserData",LocalStorageUpdated:"localStorageUpdated",GeneratePkceCodes:"generatePkceCodes",GenerateCodeVerifier:"generateCodeVerifier",GenerateCodeChallengeFromVerifier:"generateCodeChallengeFromVerifier",Sha256Digest:"sha256Digest",GetRandomValues:"getRandomValues",GenerateHKDF:"generateHKDF",GenerateBaseKey:"generateBaseKey",Base64Decode:"base64Decode",UrlEncodeArr:"urlEncodeArr",Encrypt:"encrypt",Decrypt:"decrypt",GenerateEarKey:"generateEarKey",DecryptEarResponse:"decryptEarResponse",LoadExternalTokens:"LoadExternalTokens",LoadAccount:"loadAccount",LoadIdToken:"loadIdToken",LoadAccessToken:"loadAccessToken",LoadRefreshToken:"loadRefreshToken",SsoCapable:"ssoCapable"},gP={InProgress:1};/*! @azure/msal-common v15.17.0 2026-03-18 */class Xb{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class Zb{generateId(){return"callback-id"}startMeasurement(e,n){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:gP.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:n||""},measurement:new Xb}}startPerformanceMeasurement(){return new Xb}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-common v15.17.0 2026-03-18 */const eC={tokenRenewalOffsetSeconds:ab,preventCorsPreflight:!1},mP={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:an.Info,correlationId:ve.EMPTY_STRING},vP={claimsBasedCachingEnabled:!1},yP={async sendGetRequestAsync(){throw Ae(ht)},async sendPostRequestAsync(){throw Ae(ht)}},wP={sku:ve.SKU,version:Dp,cpu:ve.EMPTY_STRING,os:ve.EMPTY_STRING},bP={clientSecret:ve.EMPTY_STRING,clientAssertion:void 0},CP={azureCloudInstance:Mp.None,tenant:`${ve.DEFAULT_COMMON_TENANT}`},xP={application:{appName:"",appVersion:""}};function _P({authOptions:t,systemOptions:e,loggerOptions:n,cacheOptions:r,storageInterface:o,networkInterface:i,cryptoInterface:a,clientCredentials:c,libraryInfo:u,telemetry:h,serverTelemetryManager:p,persistencePlugin:g,serializableCache:v}){const m={...mP,...n};return{authOptions:SP(t),systemOptions:{...eC,...e},loggerOptions:m,cacheOptions:{...vP,...r},storageInterface:o||new pP(t.clientId,uu,new es(m),new Zb),networkInterface:i||yP,cryptoInterface:a||uu,clientCredentials:c||bP,libraryInfo:{...wP,...u},telemetry:{...xP,...h},serverTelemetryManager:p||null,persistencePlugin:g||null,serializableCache:v||null}}function SP(t){return{clientCapabilities:[],azureCloudOptions:CP,skipAuthorityMetadataCache:!1,instanceAware:!1,encodeExtraQueryParams:!1,...t}}function tC(t){return t.authOptions.authority.options.protocolMode===Ir.OIDC}/*! @azure/msal-common v15.17.0 2026-03-18 */const yo={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};/*! @azure/msal-common v15.17.0 2026-03-18 */const Ks="client_id",nC="redirect_uri",TP="response_type",EP="response_mode",AP="grant_type",IP="claims",kP="scope",PP="refresh_token",OP="state",NP="nonce",DP="prompt",MP="code",RP="code_challenge",LP="code_challenge_method",FP="code_verifier",$P="client-request-id",UP="x-client-SKU",HP="x-client-VER",BP="x-client-OS",zP="x-client-CPU",VP="x-client-current-telemetry",KP="x-client-last-telemetry",GP="x-ms-lib-capability",jP="x-app-name",WP="x-app-ver",qP="post_logout_redirect_uri",YP="id_token_hint",QP="client_secret",JP="client_assertion",XP="client_assertion_type",rC="token_type",oC="req_cnf",iC="return_spa_code",ZP="nativebroker",eO="logout_hint",tO="sid",nO="login_hint",rO="domain_hint",oO="x-client-xtra-sku",Gs="brk_client_id",vu="brk_redirect_uri",jp="instance_aware",iO="ear_jwk",sO="ear_jwe_crypto",aO="clidata";/*! @azure/msal-common v15.17.0 2026-03-18 */function yu(t,e,n){if(!e)return;const r=t.get(Ks);r&&t.has(Gs)&&(n==null||n.addFields({embeddedClientId:r,embeddedRedirectUri:t.get(nC)},e))}function Wp(t,e){t.set(TP,e)}function cO(t,e){t.set(EP,e||zk.QUERY)}function lO(t){t.set(ZP,"1")}function qp(t,e,n=!0,r=Wa){n&&!r.includes("openid")&&!e.includes("openid")&&r.push("openid");const o=n?[...e||[],...r]:e||[],i=new Pn(o);t.set(kP,i.printScopes())}function Yp(t,e){t.set(Ks,e)}function Qp(t,e){t.set(nC,e)}function dO(t,e){t.set(qP,e)}function uO(t,e){t.set(YP,e)}function fO(t,e){t.set(rO,e)}function wu(t,e){t.set(nO,e)}function bu(t,e){t.set(dr.CCS_HEADER,`UPN:${e}`)}function xl(t,e){t.set(dr.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}function sC(t,e){t.set(tO,e)}function Jp(t,e,n){const r=hC(e,n);try{JSON.parse(r)}catch{throw Wt(Rp)}t.set(IP,r)}function _l(t,e){t.set($P,e)}function Xp(t,e){t.set(UP,e.sku),t.set(HP,e.version),e.os&&t.set(BP,e.os),e.cpu&&t.set(zP,e.cpu)}function Zp(t,e){e!=null&&e.appName&&t.set(jP,e.appName),e!=null&&e.appVersion&&t.set(WP,e.appVersion)}function hO(t,e){t.set(DP,e)}function aC(t,e){e&&t.set(OP,e)}function pO(t,e){t.set(NP,e)}function eg(t,e,n){if(e&&n)t.set(RP,e),t.set(LP,n);else throw Wt(Lp)}function gO(t,e){t.set(MP,e)}function mO(t,e){t.set(PP,e)}function vO(t,e){t.set(FP,e)}function cC(t,e){t.set(QP,e)}function lC(t,e){e&&t.set(JP,e)}function dC(t,e){e&&t.set(XP,e)}function uC(t,e){t.set(AP,e)}function tg(t){t.set(Vk,"1")}function yO(t){t.set(aO,"1")}function fC(t){t.has(jp)||t.set(jp,"true")}function ts(t,e){Object.entries(e).forEach(([n,r])=>{!t.has(n)&&r&&t.set(n,r)})}function hC(t,e){let n;if(!t)n={};else try{n=JSON.parse(t)}catch{throw Wt(Rp)}return e&&e.length>0&&(n.hasOwnProperty(iu.ACCESS_TOKEN)||(n[iu.ACCESS_TOKEN]={}),n[iu.ACCESS_TOKEN][iu.XMS_CC]={values:e}),JSON.stringify(n)}function ng(t,e){e&&(t.set(rC,zt.POP),t.set(oC,e))}function pC(t,e){e&&(t.set(rC,zt.SSH),t.set(oC,e))}function gC(t,e){t.set(VP,e.generateCurrentRequestHeaderValue()),t.set(KP,e.generateLastRequestHeaderValue())}function mC(t){t.set(GP,wl.X_MS_LIB_CAPABILITY_VALUE)}function wO(t,e){t.set(eO,e)}function Cu(t,e,n){t.has(Gs)||t.set(Gs,e),t.has(vu)||t.set(vu,n)}function bO(t,e){t.set(iO,encodeURIComponent(e)),t.set(sO,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}function CO(t,e){Object.entries(e).forEach(([n,r])=>{r&&t.set(n,r)})}/*! @azure/msal-common v15.17.0 2026-03-18 */function xO(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}/*! @azure/msal-common v15.17.0 2026-03-18 */function _O(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}/*! @azure/msal-common v15.17.0 2026-03-18 */function SO(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}/*! @azure/msal-common v15.17.0 2026-03-18 */const kr=(t,e,n,r,o)=>(...i)=>{n.trace(`Executing function ${e}`);const a=r==null?void 0:r.startMeasurement(e,o);if(o){const c=e+"CallCount";r==null||r.incrementFields({[c]:1},o)}try{const c=t(...i);return a==null||a.end({success:!0}),n.trace(`Returning result from ${e}`),c}catch(c){n.trace(`Error occurred in ${e}`);try{n.trace(JSON.stringify(c))}catch{n.trace("Unable to print error message.")}throw a==null||a.end({success:!1},c),c}},he=(t,e,n,r,o)=>(...i)=>{n.trace(`Executing function ${e}`);const a=r==null?void 0:r.startMeasurement(e,o);if(o){const c=e+"CallCount";r==null||r.incrementFields({[c]:1},o)}return r==null||r.setPreQueueTime(e,o),t(...i).then(c=>(n.trace(`Returning result from ${e}`),a==null||a.end({success:!0}),c)).catch(c=>{n.trace(`Error occurred in ${e}`);try{n.trace(JSON.stringify(c))}catch{n.trace("Unable to print error message.")}throw a==null||a.end({success:!1},c),c})};/*! @azure/msal-common v15.17.0 2026-03-18 */class xu{constructor(e,n,r,o){this.networkInterface=e,this.logger=n,this.performanceClient=r,this.correlationId=o}async detectRegion(e,n){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(H.RegionDiscoveryDetectRegion,this.correlationId);let r=e;if(r)n.region_source=qa.ENVIRONMENT_VARIABLE;else{const i=xu.IMDS_OPTIONS;try{const a=await he(this.getRegionFromIMDS.bind(this),H.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(ve.IMDS_VERSION,i);if(a.status===Ji.SUCCESS&&(r=a.body,n.region_source=qa.IMDS),a.status===Ji.BAD_REQUEST){const c=await he(this.getCurrentVersion.bind(this),H.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(i);if(!c)return n.region_source=qa.FAILED_AUTO_DETECTION,null;const u=await he(this.getRegionFromIMDS.bind(this),H.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(c,i);u.status===Ji.SUCCESS&&(r=u.body,n.region_source=qa.IMDS)}}catch{return n.region_source=qa.FAILED_AUTO_DETECTION,null}}return r||(n.region_source=qa.FAILED_AUTO_DETECTION),r||null}async getRegionFromIMDS(e,n){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement(H.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${ve.IMDS_ENDPOINT}?api-version=${e}&format=text`,n,ve.IMDS_TIMEOUT)}async getCurrentVersion(e){var n;(n=this.performanceClient)==null||n.addQueueMeasurement(H.RegionDiscoveryGetCurrentVersion,this.correlationId);try{const r=await this.networkInterface.sendGetRequestAsync(`${ve.IMDS_ENDPOINT}?format=json`,e);return r.status===Ji.BAD_REQUEST&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}}xu.IMDS_OPTIONS={headers:{Metadata:"true"}};/*! @azure/msal-common v15.17.0 2026-03-18 */function ur(){return Math.round(new Date().getTime()/1e3)}function vC(t){return t.getTime()/1e3}function Za(t){return t?new Date(Number(t)*1e3):new Date}function _u(t,e){const n=Number(t)||0;return ur()+e>n}function yC(t,e){const n=Number(t)+e*24*60*60*1e3;return Date.now()>n}function TO(t){return Number(t)>ur()}/*! @azure/msal-common v15.17.0 2026-03-18 */function Su(t,e,n,r,o){return{credentialType:$n.ID_TOKEN,homeAccountId:t,environment:e,clientId:r,secret:n,realm:o,lastUpdatedAt:Date.now().toString()}}function Tu(t,e,n,r,o,i,a,c,u,h,p,g,v,m,C){var w,_;const b={homeAccountId:t,credentialType:$n.ACCESS_TOKEN,secret:n,cachedAt:ur().toString(),expiresOn:a.toString(),extendedExpiresOn:c.toString(),environment:e,clientId:r,realm:o,target:i,tokenType:p||zt.BEARER,lastUpdatedAt:Date.now().toString()};if(g&&(b.userAssertionHash=g),h&&(b.refreshOn=h.toString()),m&&(b.requestedClaims=m,b.requestedClaimsHash=C),((w=b.tokenType)==null?void 0:w.toLowerCase())!==zt.BEARER.toLowerCase())switch(b.credentialType=$n.ACCESS_TOKEN_WITH_AUTH_SCHEME,b.tokenType){case zt.POP:const E=Uo(n,u);if(!((_=E==null?void 0:E.cnf)!=null&&_.kid))throw Ae(xb);b.keyId=E.cnf.kid;break;case zt.SSH:b.keyId=v}return b}function wC(t,e,n,r,o,i,a){const c={credentialType:$n.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:r,secret:n,lastUpdatedAt:Date.now().toString()};return i&&(c.userAssertionHash=i),o&&(c.familyId=o),a&&(c.expiresOn=a.toString()),c}function Eu(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}function bC(t){return t?Eu(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===$n.ACCESS_TOKEN||t.credentialType===$n.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function EO(t){return t?Eu(t)&&t.hasOwnProperty("realm")&&t.credentialType===$n.ID_TOKEN:!1}function CC(t){return t?Eu(t)&&t.credentialType===$n.REFRESH_TOKEN:!1}function AO(t,e){const n=t.indexOf(Un.CACHE_KEY)===0;let r=!0;return e&&(r=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),n&&r}function IO(t,e){let n=!1;t&&(n=t.indexOf(wl.THROTTLING_PREFIX)===0);let r=!0;return e&&(r=e.hasOwnProperty("throttleTime")),n&&r}function kO({environment:t,clientId:e}){return[wp,t,e].join(yl.CACHE_KEY_SEPARATOR).toLowerCase()}function PO(t,e){return e?t.indexOf(wp)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}function OO(t,e){return e?t.indexOf(lu.CACHE_KEY)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}function xC(){return ur()+lu.REFRESH_TIME_SECONDS}function Au(t,e,n){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=n,t.jwks_uri=e.jwks_uri}function rg(t,e,n){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=n}function _C(t){return t.expiresAt<=ur()}/*! @azure/msal-common v15.17.0 2026-03-18 */class fr{constructor(e,n,r,o,i,a,c,u){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=n,this.cacheManager=r,this.authorityOptions=o,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=i,this.performanceClient=c,this.correlationId=a,this.managedIdentity=u||!1,this.regionDiscovery=new xu(n,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(ve.CIAM_AUTH_URL))return vo.Ciam;const n=e.PathSegments;if(n.length)switch(n[0].toLowerCase()){case ve.ADFS:return vo.Adfs;case ve.DSTS:return vo.Dsts}return vo.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new It(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw Ae(ci)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw Ae(ci)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw Ae(ci)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw Ae(Tb);return this.replacePath(this.metadata.end_session_endpoint)}else throw Ae(ci)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw Ae(ci)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw Ae(ci)}canReplaceTenant(e){return e.PathSegments.length===1&&!fr.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===vo.Default&&this.protocolMode!==Ir.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let n=e;const o=new It(this.metadata.canonical_authority).getUrlComponents(),i=o.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((c,u)=>{let h=i[u];if(u===0&&this.canReplaceTenant(o)){const p=new It(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];h!==p&&(this.logger.verbose(`Replacing tenant domain name ${h} with id ${p}`),h=p)}c!==h&&(n=n.replace(`/${h}/`,`/${c}/`))}),this.replaceTenant(n)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===vo.Adfs||this.protocolMode===Ir.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){var o,i;(o=this.performanceClient)==null||o.addQueueMeasurement(H.AuthorityResolveEndpointsAsync,this.correlationId);const e=this.getCurrentMetadataEntity(),n=await he(this.updateCloudDiscoveryMetadata.bind(this),H.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const r=await he(this.updateEndpointMetadata.bind(this),H.AuthorityUpdateEndpointMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,n,{source:r}),(i=this.performanceClient)==null||i.addFields({cloudDiscoverySource:n,authorityEndpointSource:r},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:xC(),jwks_uri:""}),e}updateCachedMetadata(e,n,r){n!==jr.CACHE&&(r==null?void 0:r.source)!==jr.CACHE&&(e.expiresAt=xC(),e.canonical_authority=this.canonicalAuthority);const o=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(o,e),this.metadata=e}async updateEndpointMetadata(e){var o,i,a;(o=this.performanceClient)==null||o.addQueueMeasurement(H.AuthorityUpdateEndpointMetadata,this.correlationId);const n=this.updateEndpointMetadataFromLocalSources(e);if(n){if(n.source===jr.HARDCODED_VALUES&&(i=this.authorityOptions.azureRegionConfiguration)!=null&&i.azureRegion&&n.metadata){const c=await he(this.updateMetadataWithRegionalInformation.bind(this),H.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(n.metadata);Au(e,c,!1),e.canonical_authority=this.canonicalAuthority}return n.source}let r=await he(this.getEndpointMetadataFromNetwork.bind(this),H.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return(a=this.authorityOptions.azureRegionConfiguration)!=null&&a.azureRegion&&(r=await he(this.updateMetadataWithRegionalInformation.bind(this),H.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(r)),Au(e,r,!0),jr.NETWORK;throw Ae(fb,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");const n=this.getEndpointMetadataFromConfig();if(n)return this.logger.verbose("Found endpoint metadata in authority configuration"),Au(e,n,!1),{source:jr.CONFIG};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{const o=this.getEndpointMetadataFromHardcodedValues();if(o)return Au(e,o,!1),{source:jr.HARDCODED_VALUES,metadata:o};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}const r=_C(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!r?(this.logger.verbose("Found endpoint metadata in the cache."),{source:jr.CACHE}):(r&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new It(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw Wt(Mb)}return null}async getEndpointMetadataFromNetwork(){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(H.AuthorityGetEndpointMetadataFromNetwork,this.correlationId);const e={},n=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${n}`);try{const o=await this.networkInterface.sendGetRequestAsync(n,e);return xO(o.body)?o.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(o){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${o}`),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in Yb?Yb[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){var r,o,i;(r=this.performanceClient)==null||r.addQueueMeasurement(H.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);const n=(o=this.authorityOptions.azureRegionConfiguration)==null?void 0:o.azureRegion;if(n){if(n!==ve.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=bp.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=n,fr.replaceWithRegionalInformation(e,n);const a=await he(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),H.RegionDiscoveryDetectRegion,this.logger,this.performanceClient,this.correlationId)((i=this.authorityOptions.azureRegionConfiguration)==null?void 0:i.environmentRegion,this.regionDiscoveryMetadata);if(a)return this.regionDiscoveryMetadata.region_outcome=bp.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=a,fr.replaceWithRegionalInformation(e,a);this.regionDiscoveryMetadata.region_outcome=bp.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(H.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);const n=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(n)return n;const r=await he(this.getCloudDiscoveryMetadataFromNetwork.bind(this),H.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return rg(e,r,!0),jr.NETWORK;throw Wt(Rb)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||ve.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||ve.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||ve.NOT_APPLICABLE}`);const n=this.getCloudDiscoveryMetadataFromConfig();if(n)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),rg(e,n,!1),jr.CONFIG;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{const o=hP(this.hostnameAndPort);if(o)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),rg(e,o,!1),jr.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}const r=_C(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!r?(this.logger.verbose("Found cloud discovery metadata in the cache."),jr.CACHE):(r&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===vo.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),fr.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");const e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),n=gu(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),n)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),n;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),Wt(Fp)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),fr.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(H.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);const e=`${ve.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,n={};let r=null;try{const i=await this.networkInterface.sendGetRequestAsync(e,n);let a,c;if(_O(i.body))a=i.body,c=a.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${a.tenant_discovery_endpoint}`);else if(SO(i.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${i.status}`),a=i.body,a.error===ve.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${a.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${a.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),c=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),r=gu(c,this.hostnameAndPort)}catch(i){if(i instanceof jt)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.
|
|
2
|
+
Error: ${i.errorCode}
|
|
3
|
+
Error Description: ${i.errorMessage}`);else{const a=i;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.
|
|
4
|
+
Error: ${a.name}
|
|
5
|
+
Error Description: ${a.message}`)}return null}return r||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),r=fr.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(n=>n&&It.getDomainFromUrl(n).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,n){let r;if(n&&n.azureCloudInstance!==Mp.None){const o=n.tenant?n.tenant:ve.DEFAULT_COMMON_TENANT;r=`${n.azureCloudInstance}/${o}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return ve.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw Ae(ci)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Qb.has(e)}static isPublicCloudAuthority(e){return ve.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,n,r){const o=new It(e);o.validateAsUri();const i=o.getUrlComponents();let a=`${n}.${i.HostNameAndPort}`;this.isPublicCloudAuthority(i.HostNameAndPort)&&(a=`${n}.${ve.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const c=It.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:a}).urlString;return r?`${c}?${r}`:c}static replaceWithRegionalInformation(e,n){const r={...e};return r.authorization_endpoint=fr.buildRegionalAuthorityString(r.authorization_endpoint,n),r.token_endpoint=fr.buildRegionalAuthorityString(r.token_endpoint,n),r.end_session_endpoint&&(r.end_session_endpoint=fr.buildRegionalAuthorityString(r.end_session_endpoint,n)),r}static transformCIAMAuthority(e){let n=e;const o=new It(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(ve.CIAM_AUTH_URL)){const i=o.HostNameAndPort.split(".")[0];n=`${n}${i}${ve.AAD_TENANT_DOMAIN_SUFFIX}`}return n}}fr.reservedTenantDomains=new Set(["{tenant}","{tenantid}",Xi.COMMON,Xi.CONSUMERS,Xi.ORGANIZATIONS]);function NO(t){var o;const r=(o=new It(t).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:o.toLowerCase();switch(r){case Xi.COMMON:case Xi.ORGANIZATIONS:case Xi.CONSUMERS:return;default:return r}}function SC(t){return t.endsWith(ve.FORWARD_SLASH)?t:`${t}${ve.FORWARD_SLASH}`}function DO(t){const e=t.cloudDiscoveryMetadata;let n;if(e)try{n=JSON.parse(e)}catch{throw Wt(Fp)}return{canonicalAuthority:t.authority?SC(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:n}}/*! @azure/msal-common v15.17.0 2026-03-18 */async function og(t,e,n,r,o,i,a){a==null||a.addQueueMeasurement(H.AuthorityFactoryCreateDiscoveredInstance,i);const c=fr.transformCIAMAuthority(SC(t)),u=new fr(c,e,n,r,o,i,a);try{return await he(u.resolveEndpointsAsync.bind(u),H.AuthorityResolveEndpointsAsync,o,a,i)(),u}catch{throw Ae(ci)}}/*! @azure/msal-common v15.17.0 2026-03-18 */class js extends jt{constructor(e,n,r,o,i){super(e,n,r),this.name="ServerError",this.errorNo=o,this.status=i,Object.setPrototypeOf(this,js.prototype)}}/*! @azure/msal-common v15.17.0 2026-03-18 */function Iu(t,e,n){var r;return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:n,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||((r=e.tokenBodyParameters)==null?void 0:r.clientId)}}/*! @azure/msal-common v15.17.0 2026-03-18 */class Bo{static generateThrottlingStorageKey(e){return`${wl.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,n,r){var a;const o=Bo.generateThrottlingStorageKey(n),i=e.getThrottlingCache(o);if(i){if(i.throttleTime<Date.now()){e.removeItem(o,r);return}throw new js(((a=i.errorCodes)==null?void 0:a.join(" "))||ve.EMPTY_STRING,i.errorMessage,i.subError)}}static postProcess(e,n,r,o){if(Bo.checkResponseStatus(r)||Bo.checkResponseForRetryAfter(r)){const i={throttleTime:Bo.calculateThrottleTime(parseInt(r.headers[dr.RETRY_AFTER])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(Bo.generateThrottlingStorageKey(n),i,o)}}static checkResponseStatus(e){return e.status===429||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(dr.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const n=e<=0?0:e,r=Date.now()/1e3;return Math.floor(Math.min(r+(n||wl.DEFAULT_THROTTLE_TIME_SECONDS),r+wl.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,n,r,o){const i=Iu(n,r,o),a=this.generateThrottlingStorageKey(i);e.removeItem(a,r.correlationId)}}/*! @azure/msal-common v15.17.0 2026-03-18 */class ku extends jt{constructor(e,n,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,ku.prototype),this.name="NetworkError",this.error=e,this.httpStatus=n,this.responseHeaders=r}}function Sl(t,e,n,r){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${r==null?void 0:r.name}, error.message:${r==null?void 0:r.message}`,new ku(t,e,n)}/*! @azure/msal-common v15.17.0 2026-03-18 */class ig{constructor(e,n){this.config=_P(e),this.logger=new es(this.config.loggerOptions,Ab,Dp),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=n}createTokenRequestHeaders(e){const n={};if(n[dr.CONTENT_TYPE]=ve.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case yo.HOME_ACCOUNT_ID:try{const r=Qa(e.credential);n[dr.CCS_HEADER]=`Oid:${r.uid}@${r.utid}`}catch(r){this.logger.verbose("Could not parse home account ID for CCS Header: "+r)}break;case yo.UPN:n[dr.CCS_HEADER]=`UPN: ${e.credential}`;break}return n}async executePostToTokenEndpoint(e,n,r,o,i,a){var u;a&&((u=this.performanceClient)==null||u.addQueueMeasurement(a,i));const c=await this.sendPostRequest(o,e,{body:n,headers:r},i);return this.config.serverTelemetryManager&&c.status<500&&c.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),c}async sendPostRequest(e,n,r,o){var a,c,u;Bo.preProcess(this.cacheManager,e,o);let i;try{i=await he(this.networkClient.sendPostRequestAsync.bind(this.networkClient),H.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,o)(n,r);const h=i.headers||{};(c=this.performanceClient)==null||c.addFields({refreshTokenSize:((a=i.body.refresh_token)==null?void 0:a.length)||0,httpVerToken:h[dr.X_MS_HTTP_VERSION]||"",requestId:h[dr.X_MS_REQUEST_ID]||""},o)}catch(h){if(h instanceof ku){const p=h.responseHeaders;throw p&&((u=this.performanceClient)==null||u.addFields({httpVerToken:p[dr.X_MS_HTTP_VERSION]||"",requestId:p[dr.X_MS_REQUEST_ID]||"",contentTypeHeader:p[dr.CONTENT_TYPE]||void 0,contentLengthHeader:p[dr.CONTENT_LENGTH]||void 0,httpStatus:h.httpStatus},o)),h.error}throw h instanceof jt?h:Ae(ub)}return Bo.postProcess(this.cacheManager,e,i,o),i}async updateAuthority(e,n){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(H.UpdateTokenEndpointAuthority,n);const r=`https://${e}/${this.authority.tenant}/`,o=await og(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,n,this.performanceClient);this.authority=o}createTokenQueryParameters(e){const n=new Map;return e.embeddedClientId&&Cu(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenQueryParameters&&ts(n,e.tokenQueryParameters),_l(n,e.correlationId),yu(n,e.correlationId,this.performanceClient),Cl(n)}}/*! @azure/msal-common v15.17.0 2026-03-18 */const Pu="no_tokens_found",TC="native_account_unavailable",sg="refresh_token_expired",ag="ux_not_allowed",MO="interaction_required",RO="consent_required",LO="login_required",Ou="bad_token",EC="interrupted_user";/*! @azure/msal-common v15.17.0 2026-03-18 */const AC=[MO,RO,LO,Ou,ag,EC],FO=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","interrupted_user"],$O={[Pu]:"No refresh token found in the cache. Please sign-in.",[TC]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[sg]:"Refresh token has expired.",[Ou]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve.",[ag]:"`canShowUI` flag in Edge was set to false. User interaction required on web page. Please invoke an interactive API to resolve.",[EC]:"The user could not be authenticated due to an interrupted state. Please invoke an interactive API to resolve."};class wo extends jt{constructor(e,n,r,o,i,a,c,u){super(e,n,r),Object.setPrototypeOf(this,wo.prototype),this.timestamp=o||ve.EMPTY_STRING,this.traceId=i||ve.EMPTY_STRING,this.correlationId=a||ve.EMPTY_STRING,this.claims=c||ve.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=u}}function IC(t,e,n){const r=!!t&&AC.indexOf(t)>-1,o=!!n&&FO.indexOf(n)>-1,i=!!e&&AC.some(a=>e.indexOf(a)>-1);return r||i||o}function Nu(t){return new wo(t,$O[t])}/*! @azure/msal-common v15.17.0 2026-03-18 */class ec{static setRequestState(e,n,r){const o=ec.generateLibraryState(e,r);return n?`${o}${ve.RESOURCE_DELIM}${n}`:o}static generateLibraryState(e,n){if(!e)throw Ae(Pp);const r={id:e.createNewGuid()};n&&(r.meta=n);const o=JSON.stringify(r);return e.base64Encode(o)}static parseRequestState(e,n){if(!e)throw Ae(Pp);if(!n)throw Ae(Ya);try{const r=n.split(ve.RESOURCE_DELIM),o=r[0],i=r.length>1?r.slice(1).join(ve.RESOURCE_DELIM):ve.EMPTY_STRING,a=e.base64Decode(o),c=JSON.parse(a);return{userRequestState:i||ve.EMPTY_STRING,libraryState:c}}catch{throw Ae(Ya)}}}/*! @azure/msal-common v15.17.0 2026-03-18 */const UO={SW:"sw"};class tc{constructor(e,n){this.cryptoUtils=e,this.performanceClient=n}async generateCnf(e,n){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(H.PopTokenGenerateCnf,e.correlationId);const r=await he(this.generateKid.bind(this),H.PopTokenGenerateCnf,n,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:o}}async generateKid(e){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement(H.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:UO.SW}}async signPopToken(e,n,r){return this.signPayload(e,n,r)}async signPayload(e,n,r,o){const{resourceRequestMethod:i,resourceRequestUri:a,shrClaims:c,shrNonce:u,shrOptions:h}=r,p=a?new It(a):void 0,g=p==null?void 0:p.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:ur(),m:i==null?void 0:i.toUpperCase(),u:g==null?void 0:g.HostNameAndPort,nonce:u||this.cryptoUtils.createNewGuid(),p:g==null?void 0:g.AbsolutePath,q:g!=null&&g.QueryString?[[],g.QueryString]:void 0,client_claims:c||void 0,...o},n,h,r.correlationId)}}/*! @azure/msal-common v15.17.0 2026-03-18 */class HO{constructor(e,n){this.cache=e,this.hasChanged=n}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v15.17.0 2026-03-18 */class Ws{constructor(e,n,r,o,i,a,c){this.clientId=e,this.cacheStorage=n,this.cryptoObj=r,this.logger=o,this.serializableCache=i,this.persistencePlugin=a,this.performanceClient=c}validateTokenResponse(e,n){var r;if(e.error||e.error_description||e.suberror){const o=`Error(s): ${e.error_codes||ve.NOT_AVAILABLE} - Timestamp: ${e.timestamp||ve.NOT_AVAILABLE} - Description: ${e.error_description||ve.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||ve.NOT_AVAILABLE} - Trace ID: ${e.trace_id||ve.NOT_AVAILABLE}`,i=(r=e.error_codes)!=null&&r.length?e.error_codes[0]:void 0,a=new js(e.error,o,e.suberror,i,e.status);if(n&&e.status&&e.status>=Ji.SERVER_ERROR_RANGE_START&&e.status<=Ji.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.
|
|
6
|
+
${a}`);return}else if(n&&e.status&&e.status>=Ji.CLIENT_ERROR_RANGE_START&&e.status<=Ji.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.
|
|
7
|
+
${a}`);return}throw IC(e.error,e.error_description,e.suberror)?new wo(e.error,e.error_description,e.suberror,e.timestamp||ve.EMPTY_STRING,e.trace_id||ve.EMPTY_STRING,e.correlation_id||ve.EMPTY_STRING,e.claims||ve.EMPTY_STRING,i):a}}async handleServerTokenResponse(e,n,r,o,i,a,c,u,h,p){var b,w;(b=this.performanceClient)==null||b.addQueueMeasurement(H.HandleServerTokenResponse,e.correlation_id);let g;if(e.id_token){if(g=Uo(e.id_token||ve.EMPTY_STRING,this.cryptoObj.base64Decode),a&&a.nonce&&g.nonce!==a.nonce)throw Ae(gb);if(o.maxAge||o.maxAge===0){const _=g.auth_time;if(!_)throw Ae(Tp);Kb(_,o.maxAge)}}this.homeAccountIdentifier=wn.generateHomeAccountId(e.client_info||ve.EMPTY_STRING,n.authorityType,this.logger,this.cryptoObj,g);let v;a&&a.state&&(v=ec.parseRequestState(this.cryptoObj,a.state)),e.key_id=e.key_id||o.sshKid||void 0;const m=this.generateCacheRecord(e,n,r,o,g,c,a);let C;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),C=new HO(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(C)),u&&!h&&m.account&&this.cacheStorage.getAllAccounts({homeAccountId:m.account.homeAccountId,environment:m.account.environment},o.correlationId).length<1)return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),(w=this.performanceClient)==null||w.addFields({acntLoggedOut:!0},o.correlationId),await Ws.generateAuthenticationResult(this.cryptoObj,n,m,!1,o,g,v,void 0,p);await this.cacheStorage.saveCacheRecord(m,o.correlationId,Ho(g||{}),i,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&C&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(C))}return Ws.generateAuthenticationResult(this.cryptoObj,n,m,!1,o,g,v,e,p)}generateCacheRecord(e,n,r,o,i,a,c){var b;const u=n.getPreferredCache();if(!u)throw Ae(Ip);const h=Hp(i);let p,g;e.id_token&&i&&(p=Su(this.homeAccountIdentifier,u,e.id_token,this.clientId,h||""),g=cg(this.cacheStorage,n,this.homeAccountIdentifier,this.cryptoObj.base64Decode,o.correlationId,i,e.client_info,u,h,c,void 0,this.logger));let v=null;if(e.access_token){const w=e.scope?Pn.fromString(e.scope):new Pn(o.scopes||[]),_=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,E=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,I=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,k=r+_,A=k+E,M=I&&I>0?r+I:void 0;v=Tu(this.homeAccountIdentifier,u,e.access_token,this.clientId,h||n.tenant||"",w.printScopes(),k,A,this.cryptoObj.base64Decode,M,e.token_type,a,e.key_id,o.claims,o.requestedClaimsHash)}let m=null;if(e.refresh_token){let w;if(e.refresh_token_expires_in){const _=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;w=r+_,(b=this.performanceClient)==null||b.addFields({ntwkRtExpiresOnSeconds:w},o.correlationId)}m=wC(this.homeAccountIdentifier,u,e.refresh_token,this.clientId,e.foci,a,w)}let C=null;return e.foci&&(C={clientId:this.clientId,environment:u,familyId:e.foci}),{account:g,idToken:p,accessToken:v,refreshToken:m,appMetadata:C}}static async generateAuthenticationResult(e,n,r,o,i,a,c,u,h){var I,k,A,M,B;let p=ve.EMPTY_STRING,g=[],v=null,m,C,b=ve.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===zt.POP&&!i.popKid){const W=new tc(e),{secret:Y,keyId:z}=r.accessToken;if(!z)throw Ae(Op);p=await W.signPopToken(Y,z,i)}else p=r.accessToken.secret;g=Pn.fromString(r.accessToken.target).asArray(),v=Za(r.accessToken.expiresOn),m=Za(r.accessToken.extendedExpiresOn),r.accessToken.refreshOn&&(C=Za(r.accessToken.refreshOn))}r.appMetadata&&(b=r.appMetadata.familyId===cu?cu:"");const w=(a==null?void 0:a.oid)||(a==null?void 0:a.sub)||"",_=(a==null?void 0:a.tid)||"";u!=null&&u.spa_accountid&&r.account&&(r.account.nativeAccountId=u==null?void 0:u.spa_accountid);const E=r.account?Up(wn.getAccountInfo(r.account),void 0,a,(I=r.idToken)==null?void 0:I.secret):null;return{authority:n.canonicalAuthority,uniqueId:w,tenantId:_,scopes:g,account:E,idToken:((k=r==null?void 0:r.idToken)==null?void 0:k.secret)||"",idTokenClaims:a||{},accessToken:p,fromCache:o,expiresOn:v,extExpiresOn:m,refreshOn:C,correlationId:i.correlationId,requestId:h||ve.EMPTY_STRING,familyId:b,tokenType:((A=r.accessToken)==null?void 0:A.tokenType)||ve.EMPTY_STRING,state:c?c.userRequestState:ve.EMPTY_STRING,cloudGraphHostName:((M=r.account)==null?void 0:M.cloudGraphHostName)||ve.EMPTY_STRING,msGraphHost:((B=r.account)==null?void 0:B.msGraphHost)||ve.EMPTY_STRING,code:u==null?void 0:u.spa_code,fromNativeBroker:!1}}}function cg(t,e,n,r,o,i,a,c,u,h,p,g){g==null||g.verbose("setCachedAccount called");const m=t.getAccountKeys().find(E=>E.startsWith(n));let C=null;m&&(C=t.getAccount(m,o));const b=C||wn.createAccount({homeAccountId:n,idTokenClaims:i,clientInfo:a,environment:c,cloudGraphHostName:h==null?void 0:h.cloud_graph_host_name,msGraphHost:h==null?void 0:h.msgraph_host,nativeAccountId:p},e,r),w=b.tenantProfiles||[],_=u||b.realm;if(_&&!w.find(E=>E.tenantId===_)){const E=Ja(n,b.localAccountId,_,i);w.push(E)}return b.tenantProfiles=w,b}/*! @azure/msal-common v15.17.0 2026-03-18 */async function kC(t,e,n){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:n})}/*! @azure/msal-common v15.17.0 2026-03-18 */class PC extends ig{constructor(e,n){var r;super(e,n),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async acquireToken(e,n,r){var u,h;if((u=this.performanceClient)==null||u.addQueueMeasurement(H.AuthClientAcquireToken,e.correlationId),!e.code)throw Ae(yb);const o=ur(),i=await he(this.executeTokenRequest.bind(this),H.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),a=(h=i.headers)==null?void 0:h[dr.X_MS_REQUEST_ID],c=new Ws(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return c.validateTokenResponse(i.body),he(c.handleServerTokenResponse.bind(c),H.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(i.body,this.authority,o,e,n,r,void 0,void 0,void 0,a)}getLogoutUri(e){if(!e)throw Wt(Db);const n=this.createLogoutUrlQueryString(e);return It.appendQueryString(this.authority.endSessionEndpoint,n)}async executeTokenRequest(e,n){var h;(h=this.performanceClient)==null||h.addQueueMeasurement(H.AuthClientExecuteTokenRequest,n.correlationId);const r=this.createTokenQueryParameters(n),o=It.appendQueryString(e.tokenEndpoint,r),i=await he(this.createTokenRequestBody.bind(this),H.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,n.correlationId)(n);let a;if(n.clientInfo)try{const p=hu(n.clientInfo,this.cryptoUtils.base64Decode);a={credential:`${p.uid}${yl.CLIENT_INFO_SEPARATOR}${p.utid}`,type:yo.HOME_ACCOUNT_ID}}catch(p){this.logger.verbose("Could not parse client info for CCS Header: "+p)}const c=this.createTokenRequestHeaders(a||n.ccsCredential),u=Iu(this.config.authOptions.clientId,n);return he(this.executePostToTokenEndpoint.bind(this),H.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,n.correlationId)(o,i,c,u,n.correlationId,H.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var i,a;(i=this.performanceClient)==null||i.addQueueMeasurement(H.AuthClientCreateTokenRequestBody,e.correlationId);const n=new Map;if(Yp(n,e.embeddedClientId||((a=e.tokenBodyParameters)==null?void 0:a[Ks])||this.config.authOptions.clientId),this.includeRedirectUri)Qp(n,e.redirectUri);else if(!e.redirectUri)throw Wt(Ib);if(qp(n,e.scopes,!0,this.oidcDefaultScopes),gO(n,e.code),Xp(n,this.config.libraryInfo),Zp(n,this.config.telemetry.application),mC(n),this.serverTelemetryManager&&!tC(this.config)&&gC(n,this.serverTelemetryManager),e.codeVerifier&&vO(n,e.codeVerifier),this.config.clientCredentials.clientSecret&&cC(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const c=this.config.clientCredentials.clientAssertion;lC(n,await kC(c.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),dC(n,c.assertionType)}if(uC(n,ib.AUTHORIZATION_CODE_GRANT),tg(n),e.authenticationScheme===zt.POP){const c=new tc(this.cryptoUtils,this.performanceClient);let u;e.popKid?u=this.cryptoUtils.encodeKid(e.popKid):u=(await he(c.generateCnf.bind(c),H.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,ng(n,u)}else if(e.authenticationScheme===zt.SSH)if(e.sshJwk)pC(n,e.sshJwk);else throw Wt(fu);let r;if(e.clientInfo)try{const c=hu(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${c.uid}${yl.CLIENT_INFO_SEPARATOR}${c.utid}`,type:yo.HOME_ACCOUNT_ID}}catch(c){this.logger.verbose("Could not parse client info for CCS Header: "+c)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case yo.HOME_ACCOUNT_ID:try{const c=Qa(r.credential);xl(n,c)}catch(c){this.logger.verbose("Could not parse home account ID for CCS Header: "+c)}break;case yo.UPN:bu(n,r.credential);break}e.embeddedClientId&&Cu(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&ts(n,e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[iC])&&ts(n,{[iC]:"1"}),yu(n,e.correlationId,this.performanceClient);const o=e.skipBrokerClaims&&n.has(Gs)?void 0:this.config.authOptions.clientCapabilities;return(!Wr.isEmptyObj(e.claims)||o&&o.length>0)&&Jp(n,e.claims,o),Cl(n)}createLogoutUrlQueryString(e){const n=new Map;return e.postLogoutRedirectUri&&dO(n,e.postLogoutRedirectUri),e.correlationId&&_l(n,e.correlationId),e.idTokenHint&&uO(n,e.idTokenHint),e.state&&aC(n,e.state),e.logoutHint&&wO(n,e.logoutHint),e.extraQueryParameters&&ts(n,e.extraQueryParameters),this.config.authOptions.instanceAware&&fC(n),Cl(n,this.config.authOptions.encodeExtraQueryParams,e.extraQueryParameters)}}/*! @azure/msal-common v15.17.0 2026-03-18 */const BO=300;class zO extends ig{constructor(e,n){super(e,n)}async acquireToken(e,n){var c,u;(c=this.performanceClient)==null||c.addQueueMeasurement(H.RefreshTokenClientAcquireToken,e.correlationId);const r=ur(),o=await he(this.executeTokenRequest.bind(this),H.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),i=(u=o.headers)==null?void 0:u[dr.X_MS_REQUEST_ID],a=new Ws(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return a.validateTokenResponse(o.body),he(a.handleServerTokenResponse.bind(a),H.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,r,e,n,void 0,void 0,!0,e.forceCache,i)}async acquireTokenByRefreshToken(e,n){var o;if(!e)throw Wt(Nb);if((o=this.performanceClient)==null||o.addQueueMeasurement(H.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw Ae(Ap);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await he(this.acquireTokenWithCachedRefreshToken.bind(this),H.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0,n)}catch(i){const a=i instanceof wo&&i.errorCode===Pu,c=i instanceof js&&i.errorCode===sb.INVALID_GRANT_ERROR&&i.subError===sb.CLIENT_MISMATCH_ERROR;if(a||c)return he(this.acquireTokenWithCachedRefreshToken.bind(this),H.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1,n);throw i}return he(this.acquireTokenWithCachedRefreshToken.bind(this),H.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1,n)}async acquireTokenWithCachedRefreshToken(e,n,r){var a,c;(a=this.performanceClient)==null||a.addQueueMeasurement(H.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const o=kr(this.cacheManager.getRefreshToken.bind(this.cacheManager),H.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,n,e.correlationId,void 0,this.performanceClient);if(!o)throw Nu(Pu);if(o.expiresOn){const u=e.refreshTokenExpirationOffsetSeconds||BO;if((c=this.performanceClient)==null||c.addFields({cacheRtExpiresOnSeconds:Number(o.expiresOn),rtOffsetSeconds:u},e.correlationId),_u(o.expiresOn,u))throw Nu(sg)}const i={...e,refreshToken:o.secret,authenticationScheme:e.authenticationScheme||zt.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:yo.HOME_ACCOUNT_ID}};try{return await he(this.acquireToken.bind(this),H.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(i,r)}catch(u){if(u instanceof wo&&u.subError===Ou){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const h=this.cacheManager.generateCredentialKey(o);this.cacheManager.removeRefreshToken(h,e.correlationId)}throw u}}async executeTokenRequest(e,n){var u;(u=this.performanceClient)==null||u.addQueueMeasurement(H.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),o=It.appendQueryString(n.tokenEndpoint,r),i=await he(this.createTokenRequestBody.bind(this),H.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),a=this.createTokenRequestHeaders(e.ccsCredential),c=Iu(this.config.authOptions.clientId,e);return he(this.executePostToTokenEndpoint.bind(this),H.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(o,i,a,c,e.correlationId,H.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,i,a;(o=this.performanceClient)==null||o.addQueueMeasurement(H.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const n=new Map;if(Yp(n,e.embeddedClientId||((i=e.tokenBodyParameters)==null?void 0:i[Ks])||this.config.authOptions.clientId),e.redirectUri&&Qp(n,e.redirectUri),qp(n,e.scopes,!0,(a=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:a.defaultScopes),uC(n,ib.REFRESH_TOKEN_GRANT),tg(n),Xp(n,this.config.libraryInfo),Zp(n,this.config.telemetry.application),mC(n),this.serverTelemetryManager&&!tC(this.config)&&gC(n,this.serverTelemetryManager),mO(n,e.refreshToken),this.config.clientCredentials.clientSecret&&cC(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const c=this.config.clientCredentials.clientAssertion;lC(n,await kC(c.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),dC(n,c.assertionType)}if(e.authenticationScheme===zt.POP){const c=new tc(this.cryptoUtils,this.performanceClient);let u;e.popKid?u=this.cryptoUtils.encodeKid(e.popKid):u=(await he(c.generateCnf.bind(c),H.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,ng(n,u)}else if(e.authenticationScheme===zt.SSH)if(e.sshJwk)pC(n,e.sshJwk);else throw Wt(fu);if(this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case yo.HOME_ACCOUNT_ID:try{const c=Qa(e.ccsCredential.credential);xl(n,c)}catch(c){this.logger.verbose("Could not parse home account ID for CCS Header: "+c)}break;case yo.UPN:bu(n,e.ccsCredential.credential);break}e.embeddedClientId&&Cu(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&ts(n,e.tokenBodyParameters),yu(n,e.correlationId,this.performanceClient);const r=e.skipBrokerClaims&&n.has(Gs)?void 0:this.config.authOptions.clientCapabilities;return(!Wr.isEmptyObj(e.claims)||r&&r.length>0)&&Jp(n,e.claims,r),Cl(n)}}/*! @azure/msal-common v15.17.0 2026-03-18 */class VO extends ig{constructor(e,n){super(e,n)}async acquireCachedToken(e){var u;(u=this.performanceClient)==null||u.addQueueMeasurement(H.SilentFlowClientAcquireCachedToken,e.correlationId);let n=Vs.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!Wr.isEmptyObj(e.claims))throw this.setCacheOutcome(Vs.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Ae(Zi);if(!e.account)throw Ae(Ap);const r=e.account.tenantId||NO(e.authority),o=this.cacheManager.getTokenKeys(),i=this.cacheManager.getAccessToken(e.account,e,o,r);if(i){if(TO(i.cachedAt)||_u(i.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Vs.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Ae(Zi);i.refreshOn&&_u(i.refreshOn,0)&&(n=Vs.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Vs.NO_CACHED_ACCESS_TOKEN,e.correlationId),Ae(Zi);const a=e.authority||this.authority.getPreferredCache(),c={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:i,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,o,r,this.performanceClient),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(a)};return this.setCacheOutcome(n,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await he(this.generateResultFromCacheRecord.bind(this),H.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(c,e),n]}setCacheOutcome(e,n){var r,o;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(o=this.performanceClient)==null||o.addFields({cacheOutcome:e},n),e!==Vs.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,n){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(H.SilentFlowClientGenerateResultFromCacheRecord,n.correlationId);let r;if(e.idToken&&(r=Uo(e.idToken.secret,this.config.cryptoInterface.base64Decode)),n.maxAge||n.maxAge===0){const i=r==null?void 0:r.auth_time;if(!i)throw Ae(Tp);Kb(i,n.maxAge)}return Ws.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,n,r)}}/*! @azure/msal-common v15.17.0 2026-03-18 */const KO={sendGetRequestAsync:()=>Promise.reject(Ae(ht)),sendPostRequestAsync:()=>Promise.reject(Ae(ht))};/*! @azure/msal-common v15.17.0 2026-03-18 */function GO(t,e,n,r){var u,h;const o=e.correlationId,i=new Map;Yp(i,e.embeddedClientId||((u=e.extraQueryParameters)==null?void 0:u[Ks])||t.clientId);const a=[...e.scopes||[],...e.extraScopesToConsent||[]];if(qp(i,a,!0,(h=t.authority.options.OIDCOptions)==null?void 0:h.defaultScopes),Qp(i,e.redirectUri),_l(i,o),cO(i,e.responseMode),tg(i),yO(i),e.prompt&&(hO(i,e.prompt),r==null||r.addFields({prompt:e.prompt},o)),e.domainHint&&(fO(i,e.domainHint),r==null||r.addFields({domainHintFromRequest:!0},o)),e.prompt!==Dn.SELECT_ACCOUNT)if(e.sid&&e.prompt===Dn.NONE)n.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),sC(i,e.sid),r==null||r.addFields({sidFromRequest:!0},o);else if(e.account){const p=qO(e.account);let g=YO(e.account);if(g&&e.domainHint&&(n.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),g=null),g){n.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),wu(i,g),r==null||r.addFields({loginHintFromClaim:!0},o);try{const v=Qa(e.account.homeAccountId);xl(i,v)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(p&&e.prompt===Dn.NONE){n.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),sC(i,p),r==null||r.addFields({sidFromClaim:!0},o);try{const v=Qa(e.account.homeAccountId);xl(i,v)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)n.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),wu(i,e.loginHint),bu(i,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},o);else if(e.account.username){n.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),wu(i,e.account.username),r==null||r.addFields({loginHintFromUpn:!0},o);try{const v=Qa(e.account.homeAccountId);xl(i,v)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(n.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),wu(i,e.loginHint),bu(i,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},o));else n.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");e.nonce&&pO(i,e.nonce),e.state&&aC(i,e.state),e.embeddedClientId&&Cu(i,t.clientId,t.redirectUri);const c=e.skipBrokerClaims&&i.has(Gs)?void 0:t.clientCapabilities;return(e.claims||c&&c.length>0)&&Jp(i,e.claims,c),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(jp))&&fC(i),i}function lg(t,e,n,r){const o=Cl(e,n,r);return It.appendQueryString(t.authorizationEndpoint,o)}function jO(t,e){if(dg(t,e),!t.code)throw Ae(_b);return t}function dg(t,e){if(!t.state||!e)throw t.state?Ae(Sp,"Cached State"):Ae(Sp,"Server State");let n,r;try{n=decodeURIComponent(t.state)}catch{throw Ae(Ya,t.state)}try{r=decodeURIComponent(e)}catch{throw Ae(Ya,t.state)}if(n!==r)throw Ae(pb);if(t.error||t.error_description||t.suberror){const o=WO(t);throw IC(t.error,t.error_description,t.suberror)?new wo(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new js(t.error||"",t.error_description,t.suberror,o)}}function WO(t){var r,o;const e="code=",n=(r=t.error_uri)==null?void 0:r.lastIndexOf(e);return n&&n>=0?(o=t.error_uri)==null?void 0:o.substring(n+e.length):void 0}function qO(t){var e;return((e=t.idTokenClaims)==null?void 0:e.sid)||null}function YO(t){var e;return t.loginHint||((e=t.idTokenClaims)==null?void 0:e.login_hint)||null}/*! @azure/msal-common v15.17.0 2026-03-18 */const OC=",",NC="|";function QO(t){const{skus:e,libraryName:n,libraryVersion:r,extensionName:o,extensionVersion:i}=t,a=new Map([[0,[n,r]],[2,[o,i]]]);let c=[];if(e!=null&&e.length){if(c=e.split(OC),c.length<4)return e}else c=Array.from({length:4},()=>NC);return a.forEach((u,h)=>{var p,g;u.length===2&&((p=u[0])!=null&&p.length)&&((g=u[1])!=null&&g.length)&&JO({skuArr:c,index:h,skuName:u[0],skuVersion:u[1]})}),c.join(OC)}function JO(t){const{skuArr:e,index:n,skuName:r,skuVersion:o}=t;n>=e.length||(e[n]=[r,o].join(NC))}class Tl{constructor(e,n){this.cacheOutcome=Vs.NOT_APPLICABLE,this.cacheManager=n,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||ve.EMPTY_STRING,this.wrapperVer=e.wrapperVer||ve.EMPTY_STRING,this.telemetryCacheKey=Un.CACHE_KEY+yl.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${Un.VALUE_SEPARATOR}${this.cacheOutcome}`,n=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&n.push(`broker_error=${r}`);const o=n.join(Un.VALUE_SEPARATOR),i=this.getRegionDiscoveryFields(),a=[e,i].join(Un.VALUE_SEPARATOR);return[Un.SCHEMA_VERSION,a,o].join(Un.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),n=Tl.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*n).join(Un.VALUE_SEPARATOR),o=e.errors.slice(0,n).join(Un.VALUE_SEPARATOR),i=e.errors.length,a=n<i?Un.OVERFLOW_TRUE:Un.OVERFLOW_FALSE,c=[i,a].join(Un.VALUE_SEPARATOR);return[Un.SCHEMA_VERSION,e.cacheHits,r,o,c].join(Un.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const n=this.getLastRequests();n.errors.length>=Un.MAX_CACHED_ERRORS&&(n.failedRequests.shift(),n.failedRequests.shift(),n.errors.shift()),n.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof jt?e.subError?n.errors.push(e.subError):e.errorCode?n.errors.push(e.errorCode):n.errors.push(e.toString()):n.errors.push(e.toString()):n.errors.push(Un.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),n=Tl.maxErrorsToSend(e),r=e.errors.length;if(n===r)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{const o={failedRequests:e.failedRequests.slice(n*2),errors:e.errors.slice(n),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o,this.correlationId)}}static maxErrorsToSend(e){let n,r=0,o=0;const i=e.errors.length;for(n=0;n<i;n++){const a=e.failedRequests[2*n]||ve.EMPTY_STRING,c=e.failedRequests[2*n+1]||ve.EMPTY_STRING,u=e.errors[n]||ve.EMPTY_STRING;if(o+=a.toString().length+c.toString().length+u.length+3,o<Un.MAX_LAST_HEADER_BYTES)r+=1;else break}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||ve.EMPTY_STRING),e.push(this.regionSource||ve.EMPTY_STRING),e.push(this.regionOutcome||ve.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const n=this.getLastRequests();n.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId)}static makeExtraSkuString(e){return QO(e)}}/*! @azure/msal-common v15.17.0 2026-03-18 */const DC="missing_kid_error",MC="missing_alg_error";/*! @azure/msal-common v15.17.0 2026-03-18 */const XO={[DC]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[MC]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class ug extends jt{constructor(e,n){super(e,n),this.name="JoseHeaderError",Object.setPrototypeOf(this,ug.prototype)}}function RC(t){return new ug(t,XO[t])}/*! @azure/msal-common v15.17.0 2026-03-18 */class fg{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw RC(DC);if(!e.alg)throw RC(MC);const n=new fg({typ:e.typ||Kk.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(n)}}/*! @azure/msal-browser v4.30.0 2026-03-18 */const hg="pkce_not_created",pg="ear_jwk_empty",LC="ear_jwe_empty",gg="crypto_nonexistent",Du="empty_navigate_uri",FC="hash_empty_error",mg="no_state_in_hash",$C="hash_does_not_contain_known_properties",UC="unable_to_parse_state",HC="state_interaction_type_mismatch",BC="interaction_in_progress",zC="popup_window_error",VC="empty_window_error",El="user_cancelled",ZO="monitor_popup_timeout",KC="monitor_window_timeout",GC="redirect_in_iframe",jC="block_iframe_reload",WC="block_nested_popups",eN="iframe_closed_prematurely",Mu="silent_logout_unsupported",qC="no_account_error",tN="silent_prompt_value_error",YC="no_token_request_cache_error",QC="unable_to_parse_token_request_cache_error",nN="auth_request_not_set_error",rN="invalid_cache_type",Ru="non_browser_environment",nc="database_not_open",Lu="no_network_connectivity",JC="post_request_failed",XC="get_request_failed",vg="failed_to_parse_response",ZC="unable_to_load_token",yg="crypto_key_not_found",ex="auth_code_required",tx="auth_code_or_nativeAccountId_required",nx="spa_code_and_nativeAccountId_present",wg="database_unavailable",rx="unable_to_acquire_token_from_native_platform",ox="native_handshake_timeout",ix="native_extension_not_installed",bg="native_connection_not_established",Al="uninitialized_public_client_application",sx="native_prompt_not_supported",ax="invalid_base64_string",cx="invalid_pop_token_request",lx="failed_to_build_headers",dx="failed_to_parse_headers",Fu="failed_to_decrypt_ear_response",$u="timed_out";/*! @azure/msal-browser v4.30.0 2026-03-18 */const li="For more visit: aka.ms/msaljs/browser-errors",oN={[hg]:"The PKCE code challenge and verifier could not be generated.",[pg]:"No EAR encryption key provided. This is unexpected.",[LC]:"Server response does not contain ear_jwe property. This is unexpected.",[gg]:"The crypto object or function is not available.",[Du]:"Navigation URI is empty. Please check stack trace for more info.",[FC]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${li}`,[mg]:"Hash does not contain state. Please verify that the request originated from msal.",[$C]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${li}`,[UC]:"Unable to parse state. Please verify that the request originated from msal.",[HC]:"Hash contains state but the interaction type does not match the caller.",[BC]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${li}`,[zC]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[VC]:"window.open returned null or undefined window object.",[El]:"User cancelled the flow.",[ZO]:`Token acquisition in popup failed due to timeout. ${li}`,[KC]:`Token acquisition in iframe failed due to timeout. ${li}`,[GC]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[jC]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${li}`,[WC]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[eN]:"The iframe being monitored was closed prematurely.",[Mu]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[qC]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[tN]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[YC]:"No token request found in cache.",[QC]:"The cached token request could not be parsed.",[nN]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[rN]:"Invalid cache type",[Ru]:"Login and token requests are not supported in non-browser environments.",[nc]:"Database is not open!",[Lu]:"No network connectivity. Check your internet connection.",[JC]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[XC]:"Network request failed. Please check the network trace to determine root cause.",[vg]:"Failed to parse network response. Check network trace.",[ZC]:"Error loading token to cache.",[yg]:"Cryptographic Key or Keypair not found in browser storage.",[ex]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[tx]:"An authorization code or nativeAccountId must be provided to this flow.",[nx]:"Request cannot contain both spa code and native account id.",[wg]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[rx]:`Unable to acquire token from native platform. ${li}`,[ox]:"Timed out while attempting to establish connection to browser extension",[ix]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[bg]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${li}`,[Al]:`You must call and await the initialize function before attempting to call any other MSAL API. ${li}`,[sx]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[ax]:"Invalid base64 encoded string.",[cx]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[lx]:"Failed to build request headers object.",[dx]:"Failed to parse response headers",[Fu]:"Failed to decrypt ear response",[$u]:"The request timed out."};class Il extends jt{constructor(e,n){super(e,oN[e],n),Object.setPrototypeOf(this,Il.prototype),this.name="BrowserAuthError"}}function Be(t,e){return new Il(t,e)}/*! @azure/msal-browser v4.30.0 2026-03-18 */const Pr={INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},ro={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS",MICROSOFT_ENTRA_BROKERID:"MicrosoftEntra",DOM_API_NAME:"DOM API",PLATFORM_DOM_APIS:"get-token-and-sign-out",PLATFORM_DOM_PROVIDER:"PlatformAuthDOMHandler",PLATFORM_EXTENSION_PROVIDER:"PlatformAuthExtensionHandler"},kl={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},Hn={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},ux={GET:"GET",POST:"POST"},ns={SIGNIN:"signin",SIGNOUT:"signout"},Sn={ORIGIN_URI:"request.origin",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",VERIFIER:"code.verifier",INTERACTION_STATUS_KEY:"interaction.status",NATIVE_REQUEST:"request.native"},Uu={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},xt={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962,hydrateCache:963,loadExternalTokens:964},fx={861:"acquireTokenRedirect",862:"acquireTokenPopup",863:"ssoSilent",864:"acquireTokenSilent_authCode",865:"handleRedirectPromise",866:"acquireTokenByCode",61:"acquireTokenSilent_silentFlow",961:"logout",962:"logoutPopup",963:"hydrateCache",964:"loadExternalTokens"},iN=t=>typeof t=="number"&&t in fx?fx[t]:"unknown";var Ze;(function(t){t.Redirect="redirect",t.Popup="popup",t.Silent="silent",t.None="none"})(Ze||(Ze={}));const hx={scopes:Wa},px="jwk",Cg="msal.db",sN=1,aN=`${Cg}.keys`,hr={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},cN=[hr.Default,hr.Skip,hr.RefreshTokenAndNetwork];/*! @azure/msal-browser v4.30.0 2026-03-18 */function Hu(t){return encodeURIComponent(Pl(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function rs(t){return gx(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Pl(t){return gx(new TextEncoder().encode(t))}function gx(t){const e=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(e)}/*! @azure/msal-browser v4.30.0 2026-03-18 */function pr(t){return new TextDecoder().decode(os(t))}function os(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw Be(ax)}const n=atob(e);return Uint8Array.from(n,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v4.30.0 2026-03-18 */const lN="RSASSA-PKCS1-v1_5",rc="AES-GCM",mx="HKDF",xg="SHA-256",dN=2048,uN=new Uint8Array([1,0,1]),vx="0123456789abcdef",yx=new Uint32Array(1),_g="raw",wx="encrypt",Sg="decrypt",fN="deriveKey",hN="crypto_subtle_undefined",Tg={name:lN,hash:xg,modulusLength:dN,publicExponent:uN};function pN(t){if(!window)throw Be(Ru);if(!window.crypto)throw Be(gg);if(!t&&!window.crypto.subtle)throw Be(gg,hN)}async function bx(t,e,n){e==null||e.addQueueMeasurement(H.Sha256Digest,n);const o=new TextEncoder().encode(t);return window.crypto.subtle.digest(xg,o)}function gN(t){return window.crypto.getRandomValues(t)}function Eg(){return window.crypto.getRandomValues(yx),yx[0]}function zo(){const t=Date.now(),e=Eg()*1024+(Eg()&1023),n=new Uint8Array(16),r=Math.trunc(e/2**30),o=e&2**30-1,i=Eg();n[0]=t/2**40,n[1]=t/2**32,n[2]=t/2**24,n[3]=t/2**16,n[4]=t/2**8,n[5]=t,n[6]=112|r>>>8,n[7]=r,n[8]=128|o>>>24,n[9]=o>>>16,n[10]=o>>>8,n[11]=o,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i;let a="";for(let c=0;c<n.length;c++)a+=vx.charAt(n[c]>>>4),a+=vx.charAt(n[c]&15),(c===3||c===5||c===7||c===9)&&(a+="-");return a}async function mN(t,e){return window.crypto.subtle.generateKey(Tg,t,e)}async function Ag(t){return window.crypto.subtle.exportKey(px,t)}async function vN(t,e,n){return window.crypto.subtle.importKey(px,t,Tg,e,n)}async function yN(t,e){return window.crypto.subtle.sign(Tg,t,e)}async function Ig(){const t=await Cx(),n={alg:"dir",kty:"oct",k:rs(new Uint8Array(t))};return Pl(JSON.stringify(n))}async function wN(t){const e=pr(t),r=JSON.parse(e).k,o=os(r);return window.crypto.subtle.importKey(_g,o,rc,!1,[Sg])}async function bN(t,e){const n=e.split(".");if(n.length!==5)throw Be(Fu,"jwe_length");const r=await wN(t).catch(()=>{throw Be(Fu,"import_key")});try{const o=new TextEncoder().encode(n[0]),i=os(n[2]),a=os(n[3]),c=os(n[4]),u=c.byteLength*8,h=new Uint8Array(a.length+c.length);h.set(a),h.set(c,a.length);const p=await window.crypto.subtle.decrypt({name:rc,iv:i,tagLength:u,additionalData:o},r,h);return new TextDecoder().decode(p)}catch{throw Be(Fu,"decrypt")}}async function Cx(){const t=await window.crypto.subtle.generateKey({name:rc,length:256},!0,[wx,Sg]);return window.crypto.subtle.exportKey(_g,t)}async function xx(t){return window.crypto.subtle.importKey(_g,t,mx,!1,[fN])}async function _x(t,e,n){return window.crypto.subtle.deriveKey({name:mx,salt:e,hash:xg,info:new TextEncoder().encode(n)},t,{name:rc,length:256},!1,[wx,Sg])}async function CN(t,e,n){const r=new TextEncoder().encode(e),o=window.crypto.getRandomValues(new Uint8Array(16)),i=await _x(t,o,n),a=await window.crypto.subtle.encrypt({name:rc,iv:new Uint8Array(12)},i,r);return{data:rs(new Uint8Array(a)),nonce:rs(o)}}async function Sx(t,e,n,r){const o=os(r),i=await _x(t,os(e),n),a=await window.crypto.subtle.decrypt({name:rc,iv:new Uint8Array(12)},i,o);return new TextDecoder().decode(a)}async function Tx(t){const e=await bx(t),n=new Uint8Array(e);return rs(n)}/*! @azure/msal-browser v4.30.0 2026-03-18 */const Bu="storage_not_supported",Ex="stubbed_public_client_application_called",kg="in_mem_redirect_unavailable";/*! @azure/msal-browser v4.30.0 2026-03-18 */const zu={[Bu]:"Given storage configuration option was not supported.",[Ex]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[kg]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};zu[Bu],zu[Ex],zu[kg];class Pg extends jt{constructor(e,n){super(e,n),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Pg.prototype)}}function Og(t){return new Pg(t,zu[t])}/*! @azure/msal-browser v4.30.0 2026-03-18 */function Ax(t){t.location.hash="",typeof t.history.replaceState=="function"&&t.history.replaceState(null,"",`${t.location.origin}${t.location.pathname}${t.location.search}`)}function xN(t){const e=t.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Ng(){return window.parent!==window}function _N(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Pr.POPUP_NAME_PREFIX}.`)===0}function di(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function SN(){const e=new It(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function TN(){if(It.hashContainsKnownProperties(window.location.hash)&&Ng())throw Be(jC)}function EN(t){if(Ng()&&!t)throw Be(GC)}function AN(){if(_N())throw Be(WC)}function Ix(){if(typeof window>"u")throw Be(Ru)}function kx(t){if(!t)throw Be(Al)}function Dg(t){Ix(),TN(),AN(),kx(t)}function Px(t,e){if(Dg(t),EN(e.system.allowRedirectInIframe),e.cache.cacheLocation===Hn.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw Og(kg)}function Ox(t){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(t).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function IN(){return zo()}/*! @azure/msal-browser v4.30.0 2026-03-18 */class Vu{navigateInternal(e,n){return Vu.defaultNavigateWindow(e,n)}navigateExternal(e,n){return Vu.defaultNavigateWindow(e,n)}static defaultNavigateWindow(e,n){return n.noHistory?window.location.replace(e):window.location.assign(e),new Promise((r,o)=>{setTimeout(()=>{o(Be($u,"failed_to_redirect"))},n.timeout)})}}/*! @azure/msal-browser v4.30.0 2026-03-18 */class kN{async sendGetRequestAsync(e,n){let r,o={},i=0;const a=Nx(n);try{r=await fetch(e,{method:ux.GET,headers:a})}catch(c){throw Sl(Be(window.navigator.onLine?XC:Lu),void 0,void 0,c)}o=Dx(r.headers);try{return i=r.status,{headers:o,body:await r.json(),status:i}}catch(c){throw Sl(Be(vg),i,o,c)}}async sendPostRequestAsync(e,n){const r=n&&n.body||"",o=Nx(n);let i,a=0,c={};try{i=await fetch(e,{method:ux.POST,headers:o,body:r})}catch(u){throw Sl(Be(window.navigator.onLine?JC:Lu),void 0,void 0,u)}c=Dx(i.headers);try{return a=i.status,{headers:c,body:await i.json(),status:a}}catch(u){throw Sl(Be(vg),a,c,u)}}}function Nx(t){try{const e=new Headers;if(!(t&&t.headers))return e;const n=t.headers;return Object.entries(n).forEach(([r,o])=>{e.append(r,o)}),e}catch(e){throw Sl(Be(lx),void 0,void 0,e)}}function Dx(t){try{const e={};return t.forEach((n,r)=>{e[r]=n}),e}catch{throw Be(dx)}}/*! @azure/msal-browser v4.30.0 2026-03-18 */const PN=6e4,Mg=1e4,ON=3e4,Mx=2e3;function NN({auth:t,cache:e,system:n,telemetry:r},o){const i={clientId:ve.EMPTY_STRING,authority:`${ve.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:ve.EMPTY_STRING,authorityMetadata:ve.EMPTY_STRING,redirectUri:typeof window<"u"?di():"",postLogoutRedirectUri:ve.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:Ir.AAD,OIDCOptions:{serverResponseType:su.FRAGMENT,defaultScopes:[ve.OPENID_SCOPE,ve.PROFILE_SCOPE,ve.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:Mp.None,tenant:ve.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1,encodeExtraQueryParams:!1,verifySSO:!1},a={cacheLocation:Hn.SessionStorage,cacheRetentionDays:5,temporaryCacheLocation:Hn.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===Hn.LocalStorage),claimsBasedCachingEnabled:!1},c={loggerCallback:()=>{},logLevel:an.Info,piiLoggingEnabled:!1},h={...{...eC,loggerOptions:c,networkClient:o?new kN:KO,navigationClient:new Vu,loadFrameTimeout:0,windowHashTimeout:(n==null?void 0:n.loadFrameTimeout)||PN,iframeHashTimeout:(n==null?void 0:n.loadFrameTimeout)||Mg,navigateFrameWait:0,redirectNavigationTimeout:ON,asyncPopups:!1,allowRedirectInIframe:!1,allowPlatformBroker:!1,allowPlatformBrokerWithDOM:!1,nativeBrokerHandshakeTimeout:(n==null?void 0:n.nativeBrokerHandshakeTimeout)||Mx,pollIntervalMilliseconds:Pr.DEFAULT_POLL_INTERVAL_MS},...n,loggerOptions:(n==null?void 0:n.loggerOptions)||c},p={application:{appName:ve.EMPTY_STRING,appVersion:ve.EMPTY_STRING},client:new Zb};if((t==null?void 0:t.protocolMode)!==Ir.OIDC&&(t!=null&&t.OIDCOptions)&&new es(h.loggerOptions).warning(JSON.stringify(Wt(Fb))),t!=null&&t.protocolMode&&t.protocolMode===Ir.OIDC&&(h!=null&&h.allowPlatformBroker))throw Wt($b);return{auth:{...i,...t,OIDCOptions:{...i.OIDCOptions,...t==null?void 0:t.OIDCOptions}},cache:{...a,...e},system:h,telemetry:{...p,...r}}}/*! @azure/msal-browser v4.30.0 2026-03-18 */const DN="@azure/msal-browser",qs="4.30.0";/*! @azure/msal-browser v4.30.0 2026-03-18 */const Qn="msal",Rx="browser",Lx="|",Jn=2,Ku=2,MN=`${Qn}.${Rx}.log.level`,RN=`${Qn}.${Rx}.log.pii`,Fx=`${Qn}.version`,$x="account.keys",Ux="token.keys";function oc(t=Ku){return t<1?`${Qn}.${$x}`:`${Qn}.${t}.${$x}`}function ic(t,e=Jn){return e<1?`${Qn}.${Ux}.${t}`:`${Qn}.${e}.${Ux}.${t}`}/*! @azure/msal-browser v4.30.0 2026-03-18 */class Rg{static loggerCallback(e,n){switch(e){case an.Error:console.error(n);return;case an.Info:console.info(n);return;case an.Verbose:console.debug(n);return;case an.Warning:console.warn(n);return;default:console.log(n);return}}constructor(e){var u;this.browserEnvironment=typeof window<"u",this.config=NN(e,this.browserEnvironment);let n;try{n=window[Hn.SessionStorage]}catch{}const r=n==null?void 0:n.getItem(MN),o=(u=n==null?void 0:n.getItem(RN))==null?void 0:u.toLowerCase(),i=o==="true"?!0:o==="false"?!1:void 0,a={...this.config.system.loggerOptions},c=r&&Object.keys(an).includes(r)?an[r]:void 0;c&&(a.loggerCallback=Rg.loggerCallback,a.logLevel=c),i!==void 0&&(a.piiLoggingEnabled=i),this.logger=new es(a,DN,qs),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v4.30.0 2026-03-18 */class Ys extends Rg{getModuleName(){return Ys.MODULE_NAME}getId(){return Ys.ID}async initialize(){return this.available=typeof window<"u",this.available}}Ys.MODULE_NAME="",Ys.ID="StandardOperatingContext";/*! @azure/msal-browser v4.30.0 2026-03-18 */class LN{constructor(){this.dbName=Cg,this.version=sN,this.tableName=aN,this.dbOpen=!1}async open(){return new Promise((e,n)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",o=>{o.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",o=>{const i=o;this.db=i.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>n(Be(wg)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(Be(nc));const a=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);a.addEventListener("success",c=>{const u=c;this.closeConnection(),n(u.target.result)}),a.addEventListener("error",c=>{this.closeConnection(),r(c)})})}async setItem(e,n){return await this.validateDbIsOpen(),new Promise((r,o)=>{if(!this.db)return o(Be(nc));const c=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(n,e);c.addEventListener("success",()=>{this.closeConnection(),r()}),c.addEventListener("error",u=>{this.closeConnection(),o(u)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(Be(nc));const a=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);a.addEventListener("success",()=>{this.closeConnection(),n()}),a.addEventListener("error",c=>{this.closeConnection(),r(c)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,n)=>{if(!this.db)return n(Be(nc));const i=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();i.addEventListener("success",a=>{const c=a;this.closeConnection(),e(c.target.result)}),i.addEventListener("error",a=>{this.closeConnection(),n(a)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(Be(nc));const a=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);a.addEventListener("success",c=>{const u=c;this.closeConnection(),n(u.target.result===1)}),a.addEventListener("error",c=>{this.closeConnection(),r(c)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,n)=>{const r=window.indexedDB.deleteDatabase(Cg),o=setTimeout(()=>n(!1),200);r.addEventListener("success",()=>(clearTimeout(o),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(o),e(!0))),r.addEventListener("error",()=>(clearTimeout(o),n(!1)))})}}/*! @azure/msal-browser v4.30.0 2026-03-18 */class Gu{constructor(){this.cache=new Map}async initialize(){}getItem(e){return this.cache.get(e)||null}getUserData(e){return this.getItem(e)}setItem(e,n){this.cache.set(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((n,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}decryptData(){return Promise.resolve(null)}}/*! @azure/msal-browser v4.30.0 2026-03-18 */class FN{constructor(e){this.inMemoryCache=new Gu,this.indexedDBCache=new LN,this.logger=e}handleDatabaseAccessError(e){if(e instanceof Il&&e.errorCode===wg)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const n=this.inMemoryCache.getItem(e);if(!n)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return n}async setItem(e,n){this.inMemoryCache.setItem(e,n);try{await this.indexedDBCache.setItem(e,n)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(n){this.handleDatabaseAccessError(n)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(n){this.handleDatabaseAccessError(n)}return e}async containsKey(e){const n=this.inMemoryCache.containsKey(e);if(!n)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return n}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v4.30.0 2026-03-18 */class ui{constructor(e,n,r){this.logger=e,pN(r??!1),this.cache=new FN(this.logger),this.performanceClient=n}createNewGuid(){return zo()}base64Encode(e){return Pl(e)}base64Decode(e){return pr(e)}base64UrlEncode(e){return Hu(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var p;const n=(p=this.performanceClient)==null?void 0:p.startMeasurement(H.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await mN(ui.EXTRACTABLE,ui.POP_KEY_USAGES),o=await Ag(r.publicKey),i={e:o.e,kty:o.kty,n:o.n},a=Hx(i),c=await this.hashString(a),u=await Ag(r.privateKey),h=await vN(u,!1,["sign"]);return await this.cache.setItem(c,{privateKey:h,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),n&&n.end({success:!0}),c}async removeTokenBindingKey(e){if(await this.cache.removeItem(e),await this.cache.containsKey(e))throw Ae(Sb)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,n,r,o){var I;const i=(I=this.performanceClient)==null?void 0:I.startMeasurement(H.CryptoOptsSignJwt,o),a=await this.cache.getItem(n);if(!a)throw Be(yg);const c=await Ag(a.publicKey),u=Hx(c),h=Hu(JSON.stringify({kid:n})),p=fg.getShrHeaderString({...r==null?void 0:r.header,alg:c.alg,kid:h}),g=Hu(p);e.cnf={jwk:JSON.parse(u)};const v=Hu(JSON.stringify(e)),m=`${g}.${v}`,b=new TextEncoder().encode(m),w=await yN(a.privateKey,b),_=rs(new Uint8Array(w)),E=`${m}.${_}`;return i&&i.end({success:!0}),E}async hashString(e){return Tx(e)}}ui.POP_KEY_USAGES=["sign","verify"],ui.EXTRACTABLE=!0;function Hx(t){return JSON.stringify(t,Object.keys(t).sort())}/*! @azure/msal-browser v4.30.0 2026-03-18 */const $N=24*60*60*1e3,Lg={Lax:"Lax",None:"None"};class Bx{initialize(){return Promise.resolve()}getItem(e){const n=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let o=0;o<r.length;o++){const i=r[o],[a,...c]=decodeURIComponent(i).trim().split("="),u=c.join("=");if(a===n)return u}return""}getUserData(){throw Ae(ht)}setItem(e,n,r,o=!0,i=Lg.Lax){let a=`${encodeURIComponent(e)}=${encodeURIComponent(n)};path=/;SameSite=${i};`;if(r){const c=UN(r);a+=`expires=${c};`}(o||i===Lg.None)&&(a+="Secure;"),document.cookie=a}async setUserData(){return Promise.reject(Ae(ht))}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),n=[];return e.forEach(r=>{const o=decodeURIComponent(r).trim().split("=");n.push(o[0])}),n}containsKey(e){return this.getKeys().includes(e)}decryptData(){return Promise.resolve(null)}}function UN(t){const e=new Date;return new Date(e.getTime()+t*$N).toUTCString()}/*! @azure/msal-browser v4.30.0 2026-03-18 */function is(t,e){const n=t.getItem(oc(e));return n?JSON.parse(n):[]}function bo(t,e,n){const r=e.getItem(ic(t,n));if(r){const o=JSON.parse(r);if(o&&o.hasOwnProperty("idToken")&&o.hasOwnProperty("accessToken")&&o.hasOwnProperty("refreshToken"))return o}return{idToken:[],accessToken:[],refreshToken:[]}}/*! @azure/msal-browser v4.30.0 2026-03-18 */function ju(t){return t.hasOwnProperty("id")&&t.hasOwnProperty("nonce")&&t.hasOwnProperty("data")}/*! @azure/msal-browser v4.30.0 2026-03-18 */const zx="msal.cache.encryption",HN="msal.broadcast.cache";class BN{constructor(e,n,r){if(!window.localStorage)throw Og(Bu);this.memoryStorage=new Gu,this.initialized=!1,this.clientId=e,this.logger=n,this.performanceClient=r,this.broadcast=new BroadcastChannel(HN)}async initialize(e){const n=new Bx,r=n.getItem(zx);let o={key:"",id:""};if(r)try{o=JSON.parse(r)}catch{}if(o.key&&o.id){const i=kr(os,H.Base64Decode,this.logger,this.performanceClient,e)(o.key);this.encryptionCookie={id:o.id,key:await he(xx,H.GenerateHKDF,this.logger,this.performanceClient,e)(i)}}else{const i=zo(),a=await he(Cx,H.GenerateBaseKey,this.logger,this.performanceClient,e)(),c=kr(rs,H.UrlEncodeArr,this.logger,this.performanceClient,e)(new Uint8Array(a));this.encryptionCookie={id:i,key:await he(xx,H.GenerateHKDF,this.logger,this.performanceClient,e)(a)};const u={id:i,key:c};n.setItem(zx,JSON.stringify(u),0,!0,Lg.None)}await he(this.importExistingCache.bind(this),H.ImportExistingCache,this.logger,this.performanceClient,e)(e),this.broadcast.addEventListener("message",this.updateCache.bind(this)),this.initialized=!0}getItem(e){return window.localStorage.getItem(e)}getUserData(e){if(!this.initialized)throw Be(Al);return this.memoryStorage.getItem(e)}async decryptData(e,n,r){if(!this.initialized||!this.encryptionCookie)throw Be(Al);if(n.id!==this.encryptionCookie.id)return this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},r),null;const o=await he(Sx,H.Decrypt,this.logger,this.performanceClient,r)(this.encryptionCookie.key,n.nonce,this.getContext(e),n.data);if(!o)return null;try{return{...JSON.parse(o),lastUpdatedAt:n.lastUpdatedAt}}catch{return this.performanceClient.incrementFields({encryptedCacheCorruptionCount:1},r),null}}setItem(e,n){window.localStorage.setItem(e,n)}async setUserData(e,n,r,o,i){if(!this.initialized||!this.encryptionCookie)throw Be(Al);if(i)this.setItem(e,n);else{const{data:a,nonce:c}=await he(CN,H.Encrypt,this.logger,this.performanceClient,r)(this.encryptionCookie.key,n,this.getContext(e)),u={id:this.encryptionCookie.id,nonce:c,data:a,lastUpdatedAt:o};this.setItem(e,JSON.stringify(u))}this.memoryStorage.setItem(e,n),this.broadcast.postMessage({key:e,value:n,context:this.getContext(e)})}removeItem(e){this.memoryStorage.containsKey(e)&&(this.memoryStorage.removeItem(e),this.broadcast.postMessage({key:e,value:null,context:this.getContext(e)})),window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}clear(){this.memoryStorage.clear(),is(this).forEach(r=>this.removeItem(r));const n=bo(this.clientId,this);n.idToken.forEach(r=>this.removeItem(r)),n.accessToken.forEach(r=>this.removeItem(r)),n.refreshToken.forEach(r=>this.removeItem(r)),this.getKeys().forEach(r=>{(r.startsWith(Qn)||r.indexOf(this.clientId)!==-1)&&this.removeItem(r)})}async importExistingCache(e){if(!this.encryptionCookie)return;let n=is(this);n=await this.importArray(n,e),n.length?this.setItem(oc(),JSON.stringify(n)):this.removeItem(oc());const r=bo(this.clientId,this);r.idToken=await this.importArray(r.idToken,e),r.accessToken=await this.importArray(r.accessToken,e),r.refreshToken=await this.importArray(r.refreshToken,e),r.idToken.length||r.accessToken.length||r.refreshToken.length?this.setItem(ic(this.clientId),JSON.stringify(r)):this.removeItem(ic(this.clientId))}async getItemFromEncryptedCache(e,n){if(!this.encryptionCookie)return null;const r=this.getItem(e);if(!r)return null;let o;try{o=JSON.parse(r)}catch{return null}return ju(o)?o.id!==this.encryptionCookie.id?(this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},n),null):(this.performanceClient.incrementFields({encryptedCacheCount:1},n),he(Sx,H.Decrypt,this.logger,this.performanceClient,n)(this.encryptionCookie.key,o.nonce,this.getContext(e),o.data)):(this.performanceClient.incrementFields({unencryptedCacheCount:1},n),r)}async importArray(e,n){const r=[],o=[];return e.forEach(i=>{const a=this.getItemFromEncryptedCache(i,n).then(c=>{c?(this.memoryStorage.setItem(i,c),r.push(i)):this.removeItem(i)});o.push(a)}),await Promise.all(o),r}getContext(e){let n="";return e.includes(this.clientId)&&(n=this.clientId),n}updateCache(e){this.logger.trace("Updating internal cache from broadcast event");const n=this.performanceClient.startMeasurement(H.LocalStorageUpdated);n.add({isBackground:!0});const{key:r,value:o,context:i}=e.data;if(!r){this.logger.error("Broadcast event missing key"),n.end({success:!1,errorCode:"noKey"});return}if(i&&i!==this.clientId){this.logger.trace(`Ignoring broadcast event from clientId: ${i}`),n.end({success:!1,errorCode:"contextMismatch"});return}o?(this.memoryStorage.setItem(r,o),this.logger.verbose("Updated item in internal cache")):(this.memoryStorage.removeItem(r),this.logger.verbose("Removed item from internal cache")),n.end({success:!0})}}/*! @azure/msal-browser v4.30.0 2026-03-18 */class zN{constructor(){if(!window.sessionStorage)throw Og(Bu)}async initialize(){}getItem(e){return window.sessionStorage.getItem(e)}getUserData(e){return this.getItem(e)}setItem(e,n){window.sessionStorage.setItem(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}decryptData(){return Promise.resolve(null)}}/*! @azure/msal-browser v4.30.0 2026-03-18 */const et={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache",BROKER_CONNECTION_ESTABLISHED:"msal:brokerConnectionEstablished"};/*! @azure/msal-browser v4.30.0 2026-03-18 */function ss(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}/*! @azure/msal-browser v4.30.0 2026-03-18 */class Fg extends Gp{constructor(e,n,r,o,i,a,c){super(e,r,o,i,c),this.cacheConfig=n,this.logger=o,this.internalStorage=new Gu,this.browserStorage=Vx(e,n.cacheLocation,o,i),this.temporaryCacheStorage=Vx(e,n.temporaryCacheLocation,o,i),this.cookieStorage=new Bx,this.eventHandler=a}async initialize(e){this.performanceClient.addFields({cacheLocation:this.cacheConfig.cacheLocation,cacheRetentionDays:this.cacheConfig.cacheRetentionDays},e),await this.browserStorage.initialize(e),await this.migrateExistingCache(e),this.trackVersionChanges(e)}async migrateExistingCache(e){let n=is(this.browserStorage),r=bo(this.clientId,this.browserStorage);this.performanceClient.addFields({preMigrateAcntCount:n.length,preMigrateATCount:r.accessToken.length,preMigrateITCount:r.idToken.length,preMigrateRTCount:r.refreshToken.length},e);for(let i=0;i<Ku;i++){const a=i;await this.removeStaleAccounts(i,a,e)}for(let i=0;i<Jn;i++){const a=i;await this.migrateIdTokens(i,a,e)}const o=this.getKMSIValues();for(let i=0;i<Jn;i++)await this.migrateAccessTokens(i,o,e),await this.migrateRefreshTokens(i,o,e);n=is(this.browserStorage),r=bo(this.clientId,this.browserStorage),this.performanceClient.addFields({postMigrateAcntCount:n.length,postMigrateATCount:r.accessToken.length,postMigrateITCount:r.idToken.length,postMigrateRTCount:r.refreshToken.length},e)}async updateOldEntry(e,n){const r=this.browserStorage.getItem(e),o=this.validateAndParseJson(r||"");if(!o)return this.browserStorage.removeItem(e),null;if(!o.lastUpdatedAt)o.lastUpdatedAt=Date.now().toString(),this.setItem(e,JSON.stringify(o),n);else if(yC(o.lastUpdatedAt,this.cacheConfig.cacheRetentionDays))return this.browserStorage.removeItem(e),this.performanceClient.incrementFields({expiredCacheRemovedCount:1},n),null;const i=ju(o)?await this.browserStorage.decryptData(e,o,n):o;return!i||!Eu(i)?(this.performanceClient.incrementFields({invalidCacheCount:1},n),null):(bC(i)||CC(i))&&i.expiresOn&&_u(i.expiresOn,ab)?(this.browserStorage.removeItem(e),this.performanceClient.incrementFields({expiredCacheRemovedCount:1},n),null):i}async removeStaleAccounts(e,n,r){const o=is(this.browserStorage,e);if(o.length!==0){for(const i of[...o]){this.performanceClient.incrementFields({oldAcntCount:1},r);const a=this.browserStorage.getItem(i),c=this.validateAndParseJson(a||"");if(!c){ss(o,i);continue}if(c.lastUpdatedAt)yC(c.lastUpdatedAt,this.cacheConfig.cacheRetentionDays)&&(await this.removeAccountOldSchema(i,c,n,r),ss(o,i));else{c.lastUpdatedAt=Date.now().toString(),this.setItem(i,JSON.stringify(c),r);continue}}this.setAccountKeys(o,r,e)}}async removeAccountOldSchema(e,n,r,o){const i=ju(n)?await this.browserStorage.decryptData(e,n,o):n,a=i==null?void 0:i.homeAccountId;if(a){const c=this.getTokenKeys(r);[...c.idToken].filter(u=>u.includes(a)).forEach(u=>{this.browserStorage.removeItem(u),ss(c.idToken,u)}),[...c.accessToken].filter(u=>u.includes(a)).forEach(u=>{this.browserStorage.removeItem(u),ss(c.accessToken,u)}),[...c.refreshToken].filter(u=>u.includes(a)).forEach(u=>{this.browserStorage.removeItem(u),ss(c.refreshToken,u)}),this.setTokenKeys(c,o,r)}this.performanceClient.incrementFields({expiredAcntRemovedCount:1},o),this.browserStorage.removeItem(e)}getKMSIValues(){const e={},n=this.getTokenKeys().idToken;for(const r of n){const o=this.browserStorage.getUserData(r);if(o){const i=JSON.parse(o),a=Uo(i.secret,pr);a&&(e[i.homeAccountId]=Ho(a))}}return e}async migrateIdTokens(e,n,r){const o=bo(this.clientId,this.browserStorage,e);if(o.idToken.length===0)return;const i=bo(this.clientId,this.browserStorage,Jn),a=is(this.browserStorage),c=is(this.browserStorage,n);for(const u of[...o.idToken]){this.performanceClient.incrementFields({oldITCount:1},r);const h=await this.updateOldEntry(u,r);if(!h){ss(o.idToken,u);continue}const p=a.find(E=>E.includes(h.homeAccountId)),g=c.find(E=>E.includes(h.homeAccountId));let v=null;if(p)v=this.getAccount(p,r);else if(g){const E=this.browserStorage.getItem(g),I=this.validateAndParseJson(E||"");v=I&&ju(I)?await this.browserStorage.decryptData(g,I,r):I}if(!v){this.performanceClient.incrementFields({skipITMigrateCount:1},r);continue}const m=Uo(h.secret,pr),C=this.generateCredentialKey(h),b=this.getIdTokenCredential(C,r),w=Object.keys(m).includes("signin_state"),_=b&&Object.keys(Uo(b.secret,pr)||{}).includes("signin_state");if(!b||h.lastUpdatedAt>b.lastUpdatedAt&&(w||!_)){const E=v.tenantProfiles||[],I=Hp(m)||v.realm;if(I&&!E.find(M=>M.tenantId===I)){const M=Ja(v.homeAccountId,v.localAccountId,I,m);E.push(M)}v.tenantProfiles=E;const k=this.generateAccountKey(wn.getAccountInfo(v)),A=Ho(m);await this.setUserData(k,JSON.stringify(v),r,v.lastUpdatedAt,A),a.includes(k)||a.push(k),await this.setUserData(C,JSON.stringify(h),r,h.lastUpdatedAt,A),this.performanceClient.incrementFields({migratedITCount:1},r),i.idToken.push(C)}}this.setTokenKeys(o,r,e),this.setTokenKeys(i,r),this.setAccountKeys(a,r)}async migrateAccessTokens(e,n,r){const o=bo(this.clientId,this.browserStorage,e);if(o.accessToken.length===0)return;const i=bo(this.clientId,this.browserStorage,Jn);for(const a of[...o.accessToken]){this.performanceClient.incrementFields({oldATCount:1},r);const c=await this.updateOldEntry(a,r);if(!c){ss(o.accessToken,a);continue}if(!Object.keys(n).includes(c.homeAccountId)){this.performanceClient.incrementFields({skipATMigrateCount:1},r);continue}const u=this.generateCredentialKey(c),h=n[c.homeAccountId];if(!i.accessToken.includes(u))await this.setUserData(u,JSON.stringify(c),r,c.lastUpdatedAt,h),this.performanceClient.incrementFields({migratedATCount:1},r),i.accessToken.push(u);else{const p=this.getAccessTokenCredential(u,r);(!p||c.lastUpdatedAt>p.lastUpdatedAt)&&(await this.setUserData(u,JSON.stringify(c),r,c.lastUpdatedAt,h),this.performanceClient.incrementFields({migratedATCount:1},r))}}this.setTokenKeys(o,r,e),this.setTokenKeys(i,r)}async migrateRefreshTokens(e,n,r){const o=bo(this.clientId,this.browserStorage,e);if(o.refreshToken.length===0)return;const i=bo(this.clientId,this.browserStorage,Jn);for(const a of[...o.refreshToken]){this.performanceClient.incrementFields({oldRTCount:1},r);const c=await this.updateOldEntry(a,r);if(!c){ss(o.refreshToken,a);continue}if(!Object.keys(n).includes(c.homeAccountId)){this.performanceClient.incrementFields({skipRTMigrateCount:1},r);continue}const u=this.generateCredentialKey(c),h=n[c.homeAccountId];if(!i.refreshToken.includes(u))await this.setUserData(u,JSON.stringify(c),r,c.lastUpdatedAt,h),this.performanceClient.incrementFields({migratedRTCount:1},r),i.refreshToken.push(u);else{const p=this.getRefreshTokenCredential(u,r);(!p||c.lastUpdatedAt>p.lastUpdatedAt)&&(await this.setUserData(u,JSON.stringify(c),r,c.lastUpdatedAt,h),this.performanceClient.incrementFields({migratedRTCount:1},r))}}this.setTokenKeys(o,r,e),this.setTokenKeys(i,r)}trackVersionChanges(e){const n=this.browserStorage.getItem(Fx);n&&(this.logger.info(`MSAL.js was last initialized by version: ${n}`),this.performanceClient.addFields({previousLibraryVersion:n},e)),n!==qs&&this.setItem(Fx,qs,e)}validateAndParseJson(e){if(!e)return null;try{const n=JSON.parse(e);return n&&typeof n=="object"?n:null}catch{return null}}setItem(e,n,r){const o=new Array(Jn+1).fill(0),i=[],a=20;for(let c=0;c<=a;c++)try{if(this.browserStorage.setItem(e,n),c>0)for(let u=0;u<=Jn;u++){const h=o.slice(0,u).reduce((g,v)=>g+v,0);if(h>=c)break;const p=c>h+o[u]?h+o[u]:c;c>h&&o[u]>0&&this.removeAccessTokenKeys(i.slice(h,p),r,u)}break}catch(u){const h=Kp(u);if(h.errorCode===mu&&c<a){if(!i.length)for(let p=0;p<=Jn;p++)if(e===ic(this.clientId,p)){const g=JSON.parse(n).accessToken;i.push(...g),o[p]=g.length}else{const g=this.getTokenKeys(p).accessToken;i.push(...g),o[p]=g.length}if(i.length<=c)throw h;this.removeAccessToken(i[c],r,!1)}else throw h}}async setUserData(e,n,r,o,i){const a=new Array(Jn+1).fill(0),c=[],u=20;for(let h=0;h<=u;h++)try{if(await he(this.browserStorage.setUserData.bind(this.browserStorage),H.SetUserData,this.logger,this.performanceClient)(e,n,r,o,i),h>0)for(let p=0;p<=Jn;p++){const g=a.slice(0,p).reduce((m,C)=>m+C,0);if(g>=h)break;const v=h>g+a[p]?g+a[p]:h;h>g&&a[p]>0&&this.removeAccessTokenKeys(c.slice(g,v),r,p)}break}catch(p){const g=Kp(p);if(g.errorCode===mu&&h<u){if(!c.length)for(let v=0;v<=Jn;v++){const m=this.getTokenKeys(v).accessToken;c.push(...m),a[v]=m.length}if(c.length<=h)throw g;this.removeAccessToken(c[h],r,!1)}else throw g}}getAccount(e,n){this.logger.trace("BrowserCacheManager.getAccount called");const r=this.browserStorage.getUserData(e);if(!r)return this.removeAccountKeyFromMap(e,n),null;const o=this.validateAndParseJson(r);return!o||!wn.isAccountEntity(o)?null:(this.performanceClient.addFields({accountCachedBy:iN(o.cachedByApiId)},n),Gp.toObject(new wn,o))}async setAccount(e,n,r,o){this.logger.trace("BrowserCacheManager.setAccount called");const i=this.generateAccountKey(wn.getAccountInfo(e)),a=Date.now().toString();e.lastUpdatedAt=a,e.cachedByApiId=o,await this.setUserData(i,JSON.stringify(e),n,a,r);const c=this.addAccountKeyToMap(i,n);this.performanceClient.addFields({kmsi:r},n),this.cacheConfig.cacheLocation===Hn.LocalStorage&&c&&this.eventHandler.emitEvent(et.ACCOUNT_ADDED,void 0,wn.getAccountInfo(e))}getAccountKeys(){return is(this.browserStorage)}setAccountKeys(e,n,r=Ku){e.length===0?this.removeItem(oc(r)):this.setItem(oc(r),JSON.stringify(e),n)}addAccountKeyToMap(e,n){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const r=this.getAccountKeys();return r.indexOf(e)===-1?(r.push(e),this.setItem(oc(),JSON.stringify(r),n),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added"),!0):(this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map"),!1)}removeAccountKeyFromMap(e,n){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const r=this.getAccountKeys(),o=r.indexOf(e);o>-1?(r.splice(o,1),this.setAccountKeys(r,n),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}removeAccount(e,n){const r=this.getActiveAccount(n);(r==null?void 0:r.homeAccountId)===e.homeAccountId&&(r==null?void 0:r.environment)===e.environment&&this.setActiveAccount(null,n),super.removeAccount(e,n),this.removeAccountKeyFromMap(this.generateAccountKey(e),n),this.browserStorage.getKeys().forEach(o=>{o.includes(e.homeAccountId)&&o.includes(e.environment)&&this.browserStorage.removeItem(o)}),this.cacheConfig.cacheLocation===Hn.LocalStorage&&this.eventHandler.emitEvent(et.ACCOUNT_REMOVED,void 0,e)}removeIdToken(e,n){super.removeIdToken(e,n);const r=this.getTokenKeys(),o=r.idToken.indexOf(e);o>-1&&(this.logger.info("idToken removed from tokenKeys map"),r.idToken.splice(o,1),this.setTokenKeys(r,n))}removeAccessToken(e,n,r=!0){super.removeAccessToken(e,n),r&&this.removeAccessTokenKeys([e],n)}removeAccessTokenKeys(e,n,r=Jn){this.logger.trace("removeAccessTokenKey called");const o=this.getTokenKeys(r);let i=0;if(e.forEach(a=>{const c=o.accessToken.indexOf(a);c>-1&&(o.accessToken.splice(c,1),i++)}),i>0){this.logger.info(`removed ${i} accessToken keys from tokenKeys map`),this.setTokenKeys(o,n,r);return}}removeRefreshToken(e,n){super.removeRefreshToken(e,n);const r=this.getTokenKeys(),o=r.refreshToken.indexOf(e);o>-1&&(this.logger.info("refreshToken removed from tokenKeys map"),r.refreshToken.splice(o,1),this.setTokenKeys(r,n))}getTokenKeys(e=Jn){return bo(this.clientId,this.browserStorage,e)}setTokenKeys(e,n,r=Jn){if(e.idToken.length===0&&e.accessToken.length===0&&e.refreshToken.length===0){this.removeItem(ic(this.clientId,r));return}else this.setItem(ic(this.clientId,r),JSON.stringify(e),n)}getIdTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeIdToken(e,n),null;const o=this.validateAndParseJson(r);return!o||!EO(o)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),o)}async setIdTokenCredential(e,n,r){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const o=this.generateCredentialKey(e),i=Date.now().toString();e.lastUpdatedAt=i,await this.setUserData(o,JSON.stringify(e),n,i,r);const a=this.getTokenKeys();a.idToken.indexOf(o)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),a.idToken.push(o),this.setTokenKeys(a,n))}getAccessTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeAccessTokenKeys([e],n),null;const o=this.validateAndParseJson(r);return!o||!bC(o)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),o)}async setAccessTokenCredential(e,n,r){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const o=this.generateCredentialKey(e),i=Date.now().toString();e.lastUpdatedAt=i,await this.setUserData(o,JSON.stringify(e),n,i,r);const a=this.getTokenKeys(),c=a.accessToken.indexOf(o);c!==-1&&a.accessToken.splice(c,1),this.logger.trace(`access token ${c===-1?"added to":"updated in"} map`),a.accessToken.push(o),this.setTokenKeys(a,n)}getRefreshTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeRefreshToken(e,n),null;const o=this.validateAndParseJson(r);return!o||!CC(o)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),o)}async setRefreshTokenCredential(e,n,r){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const o=this.generateCredentialKey(e),i=Date.now().toString();e.lastUpdatedAt=i,await this.setUserData(o,JSON.stringify(e),n,i,r);const a=this.getTokenKeys();a.refreshToken.indexOf(o)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),a.refreshToken.push(o),this.setTokenKeys(a,n))}getAppMetadata(e){const n=this.browserStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!PO(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e,n){this.logger.trace("BrowserCacheManager.setAppMetadata called");const r=kO(e);this.setItem(r,JSON.stringify(e),n)}getServerTelemetry(e){const n=this.browserStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!AO(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,n,r){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(n),r)}getAuthorityMetadata(e){const n=this.internalStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(n);return r&&OO(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(n=>this.isAuthorityMetadata(n))}setWrapperMetadata(e,n){this.internalStorage.setItem(Uu.WRAPPER_SKU,e),this.internalStorage.setItem(Uu.WRAPPER_VER,n)}getWrapperMetadata(){const e=this.internalStorage.getItem(Uu.WRAPPER_SKU)||ve.EMPTY_STRING,n=this.internalStorage.getItem(Uu.WRAPPER_VER)||ve.EMPTY_STRING;return[e,n]}setAuthorityMetadata(e,n){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(n))}getActiveAccount(e){const n=this.generateCacheKey(ob.ACTIVE_ACCOUNT_FILTERS),r=this.browserStorage.getItem(n);if(!r)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters found"),null;const o=this.validateAndParseJson(r);return o?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:o.homeAccountId,localAccountId:o.localAccountId,tenantId:o.tenantId},e)):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e,n){const r=this.generateCacheKey(ob.ACTIVE_ACCOUNT_FILTERS);if(e){this.logger.verbose("setActiveAccount: Active account set");const o={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId,lastUpdatedAt:ur().toString()};this.setItem(r,JSON.stringify(o),n)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(r);this.eventHandler.emitEvent(et.ACTIVE_ACCOUNT_CHANGED)}getThrottlingCache(e){const n=this.browserStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!IO(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,n,r){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(n),r)}getTemporaryCache(e,n){const r=n?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const i=this.cookieStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),i}const o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===Hn.LocalStorage){const i=this.browserStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),i}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o}setTemporaryCache(e,n,r){const o=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(o,n),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(o,n,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}clear(e){this.removeAllAccounts(e),this.removeAppMetadata(e),this.temporaryCacheStorage.getKeys().forEach(n=>{(n.indexOf(Qn)!==-1||n.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(n)}),this.browserStorage.getKeys().forEach(n=>{(n.indexOf(Qn)!==-1||n.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(n)}),this.internalStorage.clear()}clearTokensAndKeysWithClaims(e){this.performanceClient.addQueueMeasurement(H.ClearTokensAndKeysWithClaims,e);const n=this.getTokenKeys();let r=0;n.accessToken.forEach(o=>{const i=this.getAccessTokenCredential(o,e);i!=null&&i.requestedClaimsHash&&o.includes(i.requestedClaimsHash.toLowerCase())&&(this.removeAccessToken(o,e),r++)}),r>0&&this.logger.warning(`${r} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return Wr.startsWith(e,Qn)?e:`${Qn}.${this.clientId}.${e}`}generateCredentialKey(e){const n=e.credentialType===$n.REFRESH_TOKEN&&e.familyId||e.clientId,r=e.tokenType&&e.tokenType.toLowerCase()!==zt.BEARER.toLowerCase()?e.tokenType.toLowerCase():"";return[`${Qn}.${Jn}`,e.homeAccountId,e.environment,e.credentialType,n,e.realm||"",e.target||"",e.requestedClaimsHash||"",r].join(Lx).toLowerCase()}generateAccountKey(e){const n=e.homeAccountId.split(".")[1];return[`${Qn}.${Ku}`,e.homeAccountId,e.environment,n||e.tenantId||""].join(Lx).toLowerCase()}resetRequestCache(){this.logger.trace("BrowserCacheManager.resetRequestCache called"),this.removeTemporaryItem(this.generateCacheKey(Sn.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(Sn.VERIFIER)),this.removeTemporaryItem(this.generateCacheKey(Sn.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(Sn.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(Sn.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cacheAuthorizeRequest(e,n){this.logger.trace("BrowserCacheManager.cacheAuthorizeRequest called");const r=Pl(JSON.stringify(e));if(this.setTemporaryCache(Sn.REQUEST_PARAMS,r,!0),n){const o=Pl(n);this.setTemporaryCache(Sn.VERIFIER,o,!0)}}getCachedRequest(){this.logger.trace("BrowserCacheManager.getCachedRequest called");const e=this.getTemporaryCache(Sn.REQUEST_PARAMS,!0);if(!e)throw Be(YC);const n=this.getTemporaryCache(Sn.VERIFIER,!0);let r,o="";try{r=JSON.parse(pr(e)),n&&(o=pr(n))}catch(i){throw this.logger.errorPii(`Attempted to parse: ${e}`),this.logger.error(`Parsing cached token request threw with error: ${i}`),Be(QC)}return[r,o]}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(Sn.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const n=this.validateAndParseJson(e);return n||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){var r;const n=(r=this.getInteractionInProgress())==null?void 0:r.clientId;return e?n===this.clientId:!!n}getInteractionInProgress(){const e=`${Qn}.${Sn.INTERACTION_STATUS_KEY}`,n=this.getTemporaryCache(e,!1);try{return n?JSON.parse(n):null}catch{return this.logger.error("Cannot parse interaction status. Removing temporary cache items and clearing url hash. Retrying interaction should fix the error"),this.removeTemporaryItem(e),this.resetRequestCache(),Ax(window),null}}setInteractionInProgress(e,n=ns.SIGNIN){var o;const r=`${Qn}.${Sn.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw Be(BC);this.setTemporaryCache(r,JSON.stringify({clientId:this.clientId,type:n}),!1)}else!e&&((o=this.getInteractionInProgress())==null?void 0:o.clientId)===this.clientId&&this.removeTemporaryItem(r)}async hydrateCache(e,n){const r=Su(e.account.homeAccountId,e.account.environment,e.idToken,this.clientId,e.tenantId);let o;n.claims&&(o=await this.cryptoImpl.hashString(n.claims));const i=Tu(e.account.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?vC(e.expiresOn):0,e.extExpiresOn?vC(e.extExpiresOn):0,pr,void 0,e.tokenType,void 0,n.sshKid,n.claims,o),a={idToken:r,accessToken:i};return this.saveCacheRecord(a,e.correlationId,Ho(Uo(e.idToken,pr)),xt.hydrateCache)}async saveCacheRecord(e,n,r,o,i){try{await super.saveCacheRecord(e,n,r,o,i)}catch(a){if(a instanceof Xa&&this.performanceClient&&n)try{const c=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:c.refreshToken.length,cacheIdCount:c.idToken.length,cacheAtCount:c.accessToken.length},n)}catch{}throw a}}}function Vx(t,e,n,r){try{switch(e){case Hn.LocalStorage:return new BN(t,n,r);case Hn.SessionStorage:return new zN;case Hn.MemoryStorage:default:break}}catch(o){n.error(o)}return new Gu}const VN=(t,e,n,r)=>{const o={cacheLocation:Hn.MemoryStorage,cacheRetentionDays:5,temporaryCacheLocation:Hn.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new Fg(t,o,uu,e,n,r)};/*! @azure/msal-browser v4.30.0 2026-03-18 */function KN(t,e,n,r,o){return t.verbose("getAllAccounts called"),n?e.getAllAccounts(o||{},r):[]}function GN(t,e,n,r){const o=n.getAccountInfoFilteredBy(t,r);return o?(e.verbose("getAccount: Account matching provided filter found, returning"),o):(e.verbose("getAccount: No matching account found, returning null"),null)}function jN(t,e,n,r){if(e.trace("getAccountByUsername called"),!t)return e.warning("getAccountByUsername: No username provided"),null;const o=n.getAccountInfoFilteredBy({username:t},r);return o?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${t}`),o):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function WN(t,e,n,r){if(e.trace("getAccountByHomeId called"),!t)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const o=n.getAccountInfoFilteredBy({homeAccountId:t},r);return o?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${t}`),o):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function qN(t,e,n,r){if(e.trace("getAccountByLocalId called"),!t)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const o=n.getAccountInfoFilteredBy({localAccountId:t},r);return o?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${t}`),o):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function YN(t,e,n){e.setActiveAccount(t,n)}function QN(t,e){return t.getActiveAccount(e)}/*! @azure/msal-browser v4.30.0 2026-03-18 */const JN="msal.broadcast.event";class XN{constructor(e){this.eventCallbacks=new Map,this.logger=e||new es({}),typeof BroadcastChannel<"u"&&(this.broadcastChannel=new BroadcastChannel(JN)),this.invokeCrossTabCallbacks=this.invokeCrossTabCallbacks.bind(this)}addEventCallback(e,n,r){if(typeof window<"u"){const o=r||IN();return this.eventCallbacks.has(o)?(this.logger.error(`Event callback with id: ${o} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(o,[e,n||[]]),this.logger.verbose(`Event callback registered with id: ${o}`),o)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,n,r,o){var a;const i={eventType:e,interactionType:n||null,payload:r||null,error:o||null,timestamp:Date.now()};switch(e){case et.ACCOUNT_ADDED:case et.ACCOUNT_REMOVED:case et.ACTIVE_ACCOUNT_CHANGED:(a=this.broadcastChannel)==null||a.postMessage(i);break;default:this.invokeCallbacks(i);break}}invokeCallbacks(e){this.eventCallbacks.forEach(([n,r],o)=>{(r.length===0||r.includes(e.eventType))&&(this.logger.verbose(`Emitting event to callback ${o}: ${e.eventType}`),n.apply(null,[e]))})}invokeCrossTabCallbacks(e){const n=e.data;this.invokeCallbacks(n)}subscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.addEventListener("message",this.invokeCrossTabCallbacks)}unsubscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.removeEventListener("message",this.invokeCrossTabCallbacks)}}/*! @azure/msal-browser v4.30.0 2026-03-18 */class Kx{constructor(e,n,r,o,i,a,c,u,h){this.config=e,this.browserStorage=n,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=i,this.navigationClient=a,this.platformAuthProvider=u,this.correlationId=h||zo(),this.logger=o.clone(Pr.MSAL_SKU,qs,this.correlationId),this.performanceClient=c}async clearCacheOnLogout(e,n){if(n)try{this.browserStorage.removeAccount(n,e),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),this.browserStorage.clear(e),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const n=e||this.config.auth.redirectUri;return It.getAbsoluteUrl(n,di())}initializeServerTelemetryManager(e,n){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:n||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new Tl(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:n}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(H.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const o={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},i=e.requestAuthority||this.config.auth.authority,a=r!=null&&r.length?r==="true":this.config.auth.instanceAware,c=n&&a?this.config.auth.authority.replace(It.getDomainFromUrl(i),n.environment):i,u=fr.generateAuthority(c,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),h=await he(og,H.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(u,this.config.system.networkClient,this.browserStorage,o,this.logger,this.correlationId,this.performanceClient);if(n&&!h.isAlias(n.environment))throw Wt(Ub);return h}}/*! @azure/msal-browser v4.30.0 2026-03-18 */async function $g(t,e,n,r){n.addQueueMeasurement(H.InitializeBaseRequest,t.correlationId);const o=t.authority||e.auth.authority,i=[...t&&t.scopes||[]],a={...t,correlationId:t.correlationId,authority:o,scopes:i};if(!a.authenticationScheme)a.authenticationScheme=zt.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(a.authenticationScheme===zt.SSH){if(!t.sshJwk)throw Wt(fu);if(!t.sshKid)throw Wt(Lb)}r.verbose(`Authentication Scheme set to "${a.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&t.claims&&!Wr.isEmptyObj(t.claims)&&(a.requestedClaimsHash=await Tx(t.claims)),a}async function ZN(t,e,n,r,o){r.addQueueMeasurement(H.InitializeSilentRequest,t.correlationId);const i=await he($g,H.InitializeBaseRequest,o,r,t.correlationId)(t,n,r,o);return{...t,...i,account:e,forceRefresh:t.forceRefresh||!1}}function Gx(t,e){let n;const r=t.httpMethod;if(e===Ir.EAR){if(n=r||zs.POST,n!==zs.POST)throw Wt(Hb)}else n=r||zs.GET;if(t.authorizePostBodyParameters&&n!==zs.POST)throw Wt(Bb);return n}/*! @azure/msal-browser v4.30.0 2026-03-18 */class sc extends Kx{initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const n={correlationId:this.correlationId||zo(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),n.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",n.correlationId),n.postLogoutRedirectUri=It.getAbsoluteUrl(e.postLogoutRedirectUri,di())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",n.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",n.correlationId),n.postLogoutRedirectUri=It.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,di())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",n.correlationId),n.postLogoutRedirectUri=It.getAbsoluteUrl(di(),di())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",n.correlationId),n}getLogoutHintFromIdTokenClaims(e){const n=e.idTokenClaims;if(n){if(n.login_hint)return n.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(H.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const n=await he(this.getClientConfiguration.bind(this),H.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new PC(n,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:n,requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:a}=e;this.performanceClient.addQueueMeasurement(H.StandardInteractionClientGetClientConfiguration,this.correlationId);const c=e.authority||await he(this.getDiscoveredAuthority.bind(this),H.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:a}),u=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:c,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:u.loggerCallback,piiLoggingEnabled:u.piiLoggingEnabled,logLevel:u.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:n,libraryInfo:{sku:Pr.MSAL_SKU,version:qs,cpu:ve.EMPTY_STRING,os:ve.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,n){this.performanceClient.addQueueMeasurement(H.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri);new URL(r).origin!==new URL(window.location.href).origin&&(this.logger.warning("The origin of the redirect URI does not match the origin of the current page. This is likely to cause issues with authentication.",this.correlationId),this.performanceClient.addFields({isRedirectUriCrossOrigin:!0},this.correlationId));const o={interactionType:n},i=ec.setRequestState(this.browserCrypto,e&&e.state||ve.EMPTY_STRING,o),c={...await he($g,H.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:i,nonce:e.nonce||zo(),responseMode:this.config.auth.OIDCOptions.serverResponseType},u={...c,httpMethod:Gx(c,this.config.auth.protocolMode)};if(e.loginHint||e.sid)return u;const h=e.account||this.browserStorage.getActiveAccount(this.correlationId);return h&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${h.homeAccountId}`,this.correlationId),u.account=h),u}}/*! @azure/msal-browser v4.30.0 2026-03-18 */function e1(t,e){if(!e)return null;try{return ec.parseRequestState(t,e).libraryState.meta}catch{throw Ae(Ya)}}/*! @azure/msal-browser v4.30.0 2026-03-18 */function ac(t,e,n){const r=pu(t);if(!r)throw jb(t)?(n.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),n.errorPii(`The ${e} detected is: ${t}`),Be($C)):(n.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),Be(FC));return r}function t1(t,e,n){if(!t.state)throw Be(mg);const r=e1(e,t.state);if(!r)throw Be(UC);if(r.interactionType!==n)throw Be(HC)}/*! @azure/msal-browser v4.30.0 2026-03-18 */class jx{constructor(e,n,r,o,i){this.authModule=e,this.browserStorage=n,this.authCodeRequest=r,this.logger=o,this.performanceClient=i}async handleCodeResponse(e,n,r){this.performanceClient.addQueueMeasurement(H.HandleCodeResponse,n.correlationId);let o;try{o=jO(e,n.state)}catch(i){throw i instanceof js&&i.subError===El?Be(El):i}return he(this.handleCodeResponseFromServer.bind(this),H.HandleCodeResponseFromServer,this.logger,this.performanceClient,n.correlationId)(o,n,r)}async handleCodeResponseFromServer(e,n,r,o=!0){if(this.performanceClient.addQueueMeasurement(H.HandleCodeResponseFromServer,n.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await he(this.authModule.updateAuthority.bind(this.authModule),H.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,n.correlationId)(e.cloud_instance_host_name,n.correlationId),o&&(e.nonce=n.nonce||void 0),e.state=n.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const a=this.createCcsCredentials(n);a&&(this.authCodeRequest.ccsCredential=a)}return await he(this.authModule.acquireToken.bind(this.authModule),H.AuthClientAcquireToken,this.logger,this.performanceClient,n.correlationId)(this.authCodeRequest,r,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:yo.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:yo.UPN}:null}}/*! @azure/msal-browser v4.30.0 2026-03-18 */const n1="ContentError",r1="PageException",Wx="user_switch";/*! @azure/msal-browser v4.30.0 2026-03-18 */const o1="USER_INTERACTION_REQUIRED",i1="USER_CANCEL",s1="NO_NETWORK",a1="DISABLED",c1="ACCOUNT_UNAVAILABLE",l1="UX_NOT_ALLOWED";/*! @azure/msal-browser v4.30.0 2026-03-18 */const d1=-2147186943,u1={[Wx]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class Vo extends jt{constructor(e,n,r){super(e,n),Object.setPrototypeOf(this,Vo.prototype),this.name="NativeAuthError",this.ext=r}}function cc(t){if(t.ext&&t.ext.status&&t.ext.status===a1||t.ext&&t.ext.error&&t.ext.error===d1)return!0;switch(t.errorCode){case n1:case r1:return!0;default:return!1}}function Wu(t,e,n){if(n&&n.status)switch(n.status){case c1:return Nu(TC);case o1:return new wo(t,e);case i1:return Be(El);case s1:return Be(Lu);case l1:return Nu(ag)}return new Vo(t,u1[t]||e,n)}/*! @azure/msal-browser v4.30.0 2026-03-18 */class qx extends sc{async acquireToken(e){this.performanceClient.addQueueMeasurement(H.SilentCacheClientAcquireToken,e.correlationId);const n=this.initializeServerTelemetryManager(xt.acquireTokenSilent_silentFlow),r=await he(this.getClientConfiguration.bind(this),H.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),o=new VO(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const a=(await he(o.acquireCachedToken.bind(o),H.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),a}catch(i){throw i instanceof Il&&i.errorCode===yg&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),i}}logout(e){this.logger.verbose("logoutRedirect called");const n=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(n.correlationId,n==null?void 0:n.account)}}/*! @azure/msal-browser v4.30.0 2026-03-18 */class qu extends Kx{constructor(e,n,r,o,i,a,c,u,h,p,g,v){super(e,n,r,o,i,a,u,h,v),this.apiId=c,this.accountId=p,this.platformAuthProvider=h,this.nativeStorageManager=g,this.silentCacheClient=new qx(e,this.nativeStorageManager,r,o,i,a,u,h,v);const m=this.platformAuthProvider.getExtensionName();this.skus=Tl.makeExtraSkuString({libraryName:Pr.MSAL_SKU,libraryVersion:qs,extensionName:m,extensionVersion:this.platformAuthProvider.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[oO]:this.skus}}async acquireToken(e,n){this.performanceClient.addQueueMeasurement(H.NativeInteractionClientAcquireToken,this.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const r=this.performanceClient.startMeasurement(H.NativeInteractionClientAcquireToken,this.correlationId),o=ur(),i=this.initializeServerTelemetryManager(this.apiId);try{const a=await this.initializeNativeRequest(e);try{const u=await this.acquireTokensFromCache(this.accountId,a);return r.end({success:!0,isNativeBroker:!1,fromCache:!0}),u}catch(u){if(n===hr.AccessToken)throw this.logger.info("MSAL internal Cache does not contain tokens, return error as per cache policy"),r.end({success:!1,brokerErrorCode:"cache_request_failed"}),u;this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const c=await this.platformAuthProvider.sendMessage(a);return await this.handleNativeResponse(c,a,o).then(u=>(r.end({success:!0,isNativeBroker:!0,requestId:u.requestId}),i.clearNativeBrokerErrorCode(),u)).catch(u=>{throw r.end({success:!1,errorCode:u.errorCode,subErrorCode:u.subError}),u})}catch(a){throw a instanceof Vo&&i.setNativeBrokerErrorCode(a.errorCode),r.end({success:!1}),a}}createSilentCacheRequest(e,n){return{authority:e.authority,correlationId:this.correlationId,scopes:Pn.fromString(e.scope).asArray(),account:n,forceRefresh:!1}}async acquireTokensFromCache(e,n){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),Ae(kp);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e},this.correlationId);if(!r)throw Ae(kp);try{const o=this.createSilentCacheRequest(n,r),i=await this.silentCacheClient.acquireToken(o),a={...r,idTokenClaims:i==null?void 0:i.idTokenClaims,idToken:i==null?void 0:i.idToken};return{...i,account:a}}catch(o){throw o}}async acquireTokenRedirect(e,n){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const o=await this.initializeNativeRequest(r);try{await this.platformAuthProvider.sendMessage(o)}catch(c){if(c instanceof Vo&&(this.initializeServerTelemetryManager(this.apiId).setNativeBrokerErrorCode(c.errorCode),cc(c)))throw c}this.browserStorage.setTemporaryCache(Sn.NATIVE_REQUEST,JSON.stringify(o),!0);const i={apiId:xt.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);n.end({success:!0}),await this.navigationClient.navigateExternal(a,i)}async handleRedirectPromise(e,n){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&n&&(e==null||e.addFields({errorCode:"no_cached_request"},n)),null;const{prompt:o,...i}=r;o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Sn.NATIVE_REQUEST));const a=ur();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const c=await this.platformAuthProvider.sendMessage(i),u=await this.handleNativeResponse(c,i,a);return this.initializeServerTelemetryManager(this.apiId).clearNativeBrokerErrorCode(),e&&this.correlationId&&this.performanceClient.addFields({isNativeBroker:!0},this.correlationId),u}catch(c){throw c}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,n,r){var p,g;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const o=Uo(e.id_token,pr),i=this.createHomeAccountIdentifier(e,o),a=(p=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:n.accountId},this.correlationId))==null?void 0:p.homeAccountId;if((g=n.extraParameters)!=null&&g.child_client_id&&e.account.id!==n.accountId)this.logger.info("handleNativeServerResponse: Double broker flow detected, ignoring accountId mismatch");else if(i!==a&&e.account.id!==n.accountId)throw Wu(Wx);const c=await this.getDiscoveredAuthority({requestAuthority:n.authority}),u=cg(this.browserStorage,c,i,pr,this.correlationId,o,e.client_info,void 0,o.tid,void 0,e.account.id,this.logger);e.expires_in=Number(e.expires_in);const h=await this.generateAuthenticationResult(e,n,o,u,c.canonicalAuthority,r);return await this.cacheAccount(u,this.correlationId,Ho(o)),await this.cacheNativeTokens(e,n,i,o,e.access_token,h.tenantId,r),h}createHomeAccountIdentifier(e,n){return wn.generateHomeAccountId(e.client_info||ve.EMPTY_STRING,vo.Default,this.logger,this.browserCrypto,n)}generateScopes(e,n){return n?Pn.fromString(n):Pn.fromString(e)}async generatePopAccessToken(e,n){if(n.tokenType===zt.POP&&n.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new tc(this.browserCrypto),o={resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,shrNonce:n.shrNonce};if(!n.keyId)throw Ae(Op);return r.signPopToken(e.access_token,n.keyId,o)}else return e.access_token}async generateAuthenticationResult(e,n,r,o,i,a){const c=this.addTelemetryFromNativeResponse(e.properties.MATS),u=this.generateScopes(n.scope,e.scope),h=e.account.properties||{},p=h.UID||r.oid||r.sub||ve.EMPTY_STRING,g=h.TenantId||r.tid||ve.EMPTY_STRING,v=Up(wn.getAccountInfo(o),void 0,r,e.id_token);v.nativeAccountId!==e.account.id&&(v.nativeAccountId=e.account.id);const m=await this.generatePopAccessToken(e,n),C=n.tokenType===zt.POP?zt.POP:zt.BEARER;return{authority:i,uniqueId:p,tenantId:g,scopes:u.asArray(),account:v,idToken:e.id_token,idTokenClaims:r,accessToken:m,fromCache:c?this.isResponseFromCache(c):!1,expiresOn:Za(a+e.expires_in),tokenType:C,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}async cacheAccount(e,n,r){await this.browserStorage.setAccount(e,this.correlationId,r,this.apiId),this.browserStorage.removeAccountContext(wn.getAccountInfo(e),n)}cacheNativeTokens(e,n,r,o,i,a,c){const u=Su(r,n.authority,e.id_token||"",n.clientId,o.tid||""),h=n.tokenType===zt.POP?ve.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,p=c+h,g=this.generateScopes(e.scope,n.scope),v=Tu(r,n.authority,i,n.clientId,o.tid||a,g.printScopes(),p,0,pr,void 0,n.tokenType,void 0,n.keyId),m={idToken:u,accessToken:v};return this.nativeStorageManager.saveCacheRecord(m,this.correlationId,Ho(o),this.apiId,n.storeInCache)}getExpiresInValue(e,n){return e===zt.POP?ve.SHR_NONCE_VALIDITY:(typeof n=="string"?parseInt(n,10):n)||0}addTelemetryFromNativeResponse(e){const n=this.getMATSFromResponse(e);return n?(this.performanceClient.addFields({extensionId:this.platformAuthProvider.getExtensionId(),extensionVersion:this.platformAuthProvider.getExtensionVersion(),matsBrokerVersion:n.broker_version,matsAccountJoinOnStart:n.account_join_on_start,matsAccountJoinOnEnd:n.account_join_on_end,matsDeviceJoin:n.device_join,matsPromptBehavior:n.prompt_behavior,matsApiErrorCode:n.api_error_code,matsUiVisible:n.ui_visible,matsSilentCode:n.silent_code,matsSilentBiSubCode:n.silent_bi_sub_code,matsSilentMessage:n.silent_message,matsSilentStatus:n.silent_status,matsHttpStatus:n.http_status,matsHttpEventCount:n.http_event_count},this.correlationId),n):null}getMATSFromResponse(e){if(e)try{return JSON.parse(e)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const n=await this.getCanonicalAuthority(e),{scopes:r,claims:o,...i}=e,a=new Pn(r||[]);a.appendScopes(Wa);const c=e.skipBrokerClaims&&e.embeddedClientId?void 0:this.config.auth.clientCapabilities,u=c&&c.length?hC(o,c):o,h={...i,claims:u,accountId:this.accountId,clientId:this.config.auth.clientId,authority:n.urlString,scope:a.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:this.getPrompt(e.prompt),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(h.signPopToken&&e.popKid)throw Be(cx);if(this.handleExtraBrokerParams(h),h.extraParameters=h.extraParameters||{},h.extraParameters.telemetry=ro.MATS_TELEMETRY,e.authenticationScheme===zt.POP){const p={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},g=new tc(this.browserCrypto);let v;if(h.keyId)v=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:h.keyId})),h.signPopToken=!1;else{const m=await he(g.generateCnf.bind(g),H.PopTokenGenerateCnf,this.logger,this.performanceClient,this.correlationId)(p,this.logger);v=m.reqCnfString,h.keyId=m.kid,h.signPopToken=!0}h.reqCnf=v}return this.addRequestSKUs(h),h}async getCanonicalAuthority(e){const n=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:n,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new It(n);return r.validateAsUri(),r}getPrompt(e){switch(this.apiId){case xt.ssoSilent:case xt.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),Dn.NONE}if(!e){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e){case Dn.NONE:case Dn.CONSENT:case Dn.LOGIN:case Dn.SELECT_ACCOUNT:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e} is not compatible with native flow`),Be(sx)}}handleExtraBrokerParams(e){var i;const n=e.extraParameters&&e.extraParameters.hasOwnProperty(Gs)&&e.extraParameters.hasOwnProperty(vu)&&e.extraParameters.hasOwnProperty(Ks);if(!e.embeddedClientId&&!n)return;let r="";const o=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[vu],r=e.extraParameters[Ks]),e.extraParameters={child_client_id:r,child_redirect_uri:o},(i=this.performanceClient)==null||i.addFields({embeddedClientId:r,embeddedRedirectUri:o},this.correlationId)}}/*! @azure/msal-browser v4.30.0 2026-03-18 */const f1=new Map([["e","AAD"],["m","MSA"]]);function h1(t){var e,n,r,o,i;if(!t)return null;try{const c=decodeURIComponent(t).split("|");return c.length<5?null:{accountType:f1.get(((e=c[0])==null?void 0:e.trim())||"")||"",error:((n=c[1])==null?void 0:n.trim())||"",subError:((r=c[2])==null?void 0:r.trim())||"",cloudInstance:((o=c[3])==null?void 0:o.trim())||"",callerDataBoundary:((i=c[4])==null?void 0:i.trim())||""}}catch{return null}}function Yx(t,e,n){const r=h1(t.clientdata);r!=null&&r.accountType&&n.addFields({accountType:r.accountType},e),r!=null&&r.error&&n.addFields({serverErrorNo:r.error},e),r!=null&&r.subError&&n.addFields({serverSubErrorNo:r.subError},e)}async function Ug(t,e,n,r,o){const i=GO({...t.auth,authority:e},n,r,o);if(Xp(i,{sku:Pr.MSAL_SKU,version:qs,os:"",cpu:""}),t.auth.protocolMode!==Ir.OIDC&&Zp(i,t.telemetry.application),n.platformBroker&&(lO(i),o.addFields({isPlatformAuthorizeRequest:!0},n.correlationId),n.authenticationScheme===zt.POP)){const a=new ui(r,o),c=new tc(a);let u;n.popKid?u=a.encodeKid(n.popKid):u=(await he(c.generateCnf.bind(c),H.PopTokenGenerateCnf,r,o,n.correlationId)(n,r)).reqCnfString,ng(i,u)}return yu(i,n.correlationId,o),i}async function Yu(t,e,n,r,o){if(!n.codeChallenge)throw Wt(Lp);const i=await he(Ug,H.GetStandardParams,r,o,n.correlationId)(t,e,n,r,o);return Wp(i,yp.CODE),eg(i,n.codeChallenge,ve.S256_CODE_CHALLENGE_METHOD),ts(i,n.extraQueryParameters||{}),lg(e,i,t.auth.encodeExtraQueryParams,n.extraQueryParameters)}async function Hg(t,e,n,r,o,i){if(!r.earJwk)throw Be(pg);const a=await Ug(e,n,r,o,i);Wp(a,yp.IDTOKEN_TOKEN_REFRESHTOKEN),bO(a,r.earJwk),eg(a,r.codeChallenge,ve.S256_CODE_CHALLENGE_METHOD);const c=new Map;ts(c,r.extraQueryParameters||{}),_l(c,r.correlationId);const u=lg(n,c,e.auth.encodeExtraQueryParams,r.extraQueryParameters);return Qx(t,u,a)}async function Bg(t,e,n,r,o,i){const a=await Ug(e,n,r,o,i);Wp(a,yp.CODE),eg(a,r.codeChallenge,r.codeChallengeMethod||ve.S256_CODE_CHALLENGE_METHOD),CO(a,r.authorizePostBodyParameters||{});const c=new Map;ts(c,r.extraQueryParameters||{}),_l(c,r.correlationId);const u=lg(n,c,e.auth.encodeExtraQueryParams,r.extraQueryParameters);return Qx(t,u,a)}function Qx(t,e,n){const r=t.createElement("form");return r.method="post",r.action=e,n.forEach((o,i)=>{const a=t.createElement("input");a.hidden=!0,a.name=i,a.value=o,r.appendChild(a)}),t.body.appendChild(r),r}async function Jx(t,e,n,r,o,i,a,c,u,h){if(c.verbose("Account id found, calling WAM for token"),!h)throw Be(bg);const p=new ui(c,u),g=new qu(r,o,p,c,a,r.system.navigationClient,n,u,h,e,i,t.correlationId),{userRequestState:v}=ec.parseRequestState(p,t.state);return he(g.acquireToken.bind(g),H.NativeInteractionClientAcquireToken,c,u,t.correlationId)({...t,state:v,prompt:void 0})}async function lc(t,e,n,r,o,i,a,c,u,h,p,g){if(Bo.removeThrottle(a,o.auth.clientId,t),Yx(e,t.correlationId,p),e.accountId)return he(Jx,H.HandleResponsePlatformBroker,h,p,t.correlationId)(t,e.accountId,r,o,a,c,u,h,p,g);const v={...t,code:e.code||"",codeVerifier:n},m=new jx(i,a,v,h,p);return await he(m.handleCodeResponse.bind(m),H.HandleCodeResponse,h,p,t.correlationId)(e,t,r)}async function zg(t,e,n,r,o,i,a,c,u,h,p){if(Bo.removeThrottle(i,r.auth.clientId,t),Yx(e,t.correlationId,h),dg(e,t.state),!e.ear_jwe)throw Be(LC);if(!t.earJwk)throw Be(pg);const g=JSON.parse(await he(bN,H.DecryptEarResponse,u,h,t.correlationId)(t.earJwk,e.ear_jwe));if(g.accountId)return he(Jx,H.HandleResponsePlatformBroker,u,h,t.correlationId)(t,g.accountId,n,r,i,a,c,u,h,p);const v=new Ws(r.auth.clientId,i,new ui(u,h),u,null,null,h);v.validateTokenResponse(g);const m={code:"",state:t.state,nonce:t.nonce,client_info:g.client_info,cloud_graph_host_name:g.cloud_graph_host_name,cloud_instance_host_name:g.cloud_instance_host_name,cloud_instance_name:g.cloud_instance_name,msgraph_host:g.msgraph_host};return await he(v.handleServerTokenResponse.bind(v),H.HandleServerTokenResponse,u,h,t.correlationId)(g,o,ur(),t,n,m,void 0,void 0,void 0,void 0)}/*! @azure/msal-browser v4.30.0 2026-03-18 */const p1=32;async function as(t,e,n){t.addQueueMeasurement(H.GeneratePkceCodes,n);const r=kr(g1,H.GenerateCodeVerifier,e,t,n)(t,e,n),o=await he(m1,H.GenerateCodeChallengeFromVerifier,e,t,n)(r,t,e,n);return{verifier:r,challenge:o}}function g1(t,e,n){try{const r=new Uint8Array(p1);return kr(gN,H.GetRandomValues,e,t,n)(r),rs(r)}catch{throw Be(hg)}}async function m1(t,e,n,r){e.addQueueMeasurement(H.GenerateCodeChallengeFromVerifier,r);try{const o=await he(bx,H.Sha256Digest,n,e,r)(t,e,r);return rs(new Uint8Array(o))}catch{throw Be(hg)}}/*! @azure/msal-browser v4.30.0 2026-03-18 */class Qu{constructor(e,n,r,o){this.logger=e,this.handshakeTimeoutMs=n,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(H.NativeMessageHandlerHandshake),this.platformAuthType=ro.PLATFORM_EXTENSION_PROVIDER}async sendMessage(e){this.logger.trace(this.platformAuthType+" - sendMessage called.");const n={method:kl.GetToken,request:e},r={channel:ro.CHANNEL_ID,extensionId:this.extensionId,responseId:zo(),body:n};this.logger.trace(this.platformAuthType+" - Sending request to browser extension"),this.logger.tracePii(this.platformAuthType+` - Sending request to browser extension: ${JSON.stringify(r)}`),this.messageChannel.port1.postMessage(r);const o=await new Promise((a,c)=>{this.resolvers.set(r.responseId,{resolve:a,reject:c})});return this.validatePlatformBrokerResponse(o)}static async createProvider(e,n,r){e.trace("PlatformAuthExtensionHandler - createProvider called.");try{const o=new Qu(e,n,r,ro.PREFERRED_EXTENSION_ID);return await o.sendHandshakeRequest(),o}catch{const i=new Qu(e,n,r);return await i.sendHandshakeRequest(),i}}async sendHandshakeRequest(){this.logger.trace(this.platformAuthType+" - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:ro.CHANNEL_ID,extensionId:this.extensionId,responseId:zo(),body:{method:kl.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=n=>{this.onChannelMessage(n)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((n,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:n,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(Be(ox)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace(this.platformAuthType+" - onWindowMessage called"),e.source!==window)return;const n=e.data;if(!(!n.channel||n.channel!==ro.CHANNEL_ID)&&!(n.extensionId&&n.extensionId!==this.extensionId)&&n.body.method===kl.HandshakeRequest){const r=this.handshakeResolvers.get(n.responseId);if(!r){this.logger.trace(this.platformAuthType+`.onWindowMessage - resolver can't be found for request ${n.responseId}`);return}this.logger.verbose(n.extensionId?`Extension with id: ${n.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(Be(ix))}}onChannelMessage(e){this.logger.trace(this.platformAuthType+" - onChannelMessage called.");const n=e.data,r=this.resolvers.get(n.responseId),o=this.handshakeResolvers.get(n.responseId);try{const i=n.body.method;if(i===kl.Response){if(!r)return;const a=n.body.response;if(this.logger.trace(this.platformAuthType+" - Received response from browser extension"),this.logger.tracePii(this.platformAuthType+` - Received response from browser extension: ${JSON.stringify(a)}`),a.status!=="Success")r.reject(Wu(a.code,a.description,a.ext));else if(a.result)a.result.code&&a.result.description?r.reject(Wu(a.result.code,a.result.description,a.result.ext)):r.resolve(a.result);else throw Cp(du,"Event does not contain result.");this.resolvers.delete(n.responseId)}else if(i===kl.HandshakeResponse){if(!o){this.logger.trace(this.platformAuthType+`.onChannelMessage - resolver can't be found for request ${n.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=n.extensionId,this.extensionVersion=n.body.version,this.logger.verbose(this.platformAuthType+` - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(n.responseId)}}catch(i){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${i}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(i):o&&o.reject(i)}}validatePlatformBrokerResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw Cp(du,"Response missing expected properties.")}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}getExtensionName(){var e;return this.getExtensionId()===ro.PREFERRED_EXTENSION_ID?"chrome":(e=this.getExtensionId())!=null&&e.length?"unknown":void 0}}/*! @azure/msal-browser v4.30.0 2026-03-18 */class Vg{constructor(e,n,r){this.logger=e,this.performanceClient=n,this.correlationId=r,this.platformAuthType=ro.PLATFORM_DOM_PROVIDER}static async createProvider(e,n,r){var o;if(e.trace("PlatformAuthDOMHandler: createProvider called"),(o=window.navigator)!=null&&o.platformAuthentication){const i=await window.navigator.platformAuthentication.getSupportedContracts(ro.MICROSOFT_ENTRA_BROKERID);if(i!=null&&i.includes(ro.PLATFORM_DOM_APIS))return e.trace("Platform auth api available in DOM"),new Vg(e,n,r)}}getExtensionId(){return ro.MICROSOFT_ENTRA_BROKERID}getExtensionVersion(){return""}getExtensionName(){return ro.DOM_API_NAME}async sendMessage(e){this.logger.trace(this.platformAuthType+" - Sending request to browser DOM API");try{const n=this.initializePlatformDOMRequest(e),r=await window.navigator.platformAuthentication.executeGetToken(n);return this.validatePlatformBrokerResponse(r)}catch(n){throw this.logger.error(this.platformAuthType+" - executeGetToken DOM API error"),n}}initializePlatformDOMRequest(e){this.logger.trace(this.platformAuthType+" - initializeNativeDOMRequest called");const{accountId:n,clientId:r,authority:o,scope:i,redirectUri:a,correlationId:c,state:u,storeInCache:h,embeddedClientId:p,extraParameters:g,...v}=e,m=this.getDOMExtraParams(v);return{accountId:n,brokerId:this.getExtensionId(),authority:o,clientId:r,correlationId:c||this.correlationId,extraParameters:{...g,...m},isSecurityTokenService:!1,redirectUri:a,scope:i,state:u,storeInCache:h,embeddedClientId:p}}validatePlatformBrokerResponse(e){if(e.hasOwnProperty("isSuccess")){if(e.hasOwnProperty("accessToken")&&e.hasOwnProperty("idToken")&&e.hasOwnProperty("clientInfo")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scopes")&&e.hasOwnProperty("expiresIn"))return this.logger.trace(this.platformAuthType+" - platform broker returned successful and valid response"),this.convertToPlatformBrokerResponse(e);if(e.hasOwnProperty("error")){const n=e;if(n.isSuccess===!1&&n.error&&n.error.code)throw this.logger.trace(this.platformAuthType+" - platform broker returned error response"),Wu(n.error.code,n.error.description,{error:parseInt(n.error.errorCode),protocol_error:n.error.protocolError,status:n.error.status,properties:n.error.properties})}}throw Cp(du,"Response missing expected properties.")}convertToPlatformBrokerResponse(e){return this.logger.trace(this.platformAuthType+" - convertToNativeResponse called"),{access_token:e.accessToken,id_token:e.idToken,client_info:e.clientInfo,account:e.account,expires_in:e.expiresIn,scope:e.scopes,state:e.state||"",properties:e.properties||{},extendedLifetimeToken:e.extendedLifetimeToken??!1,shr:e.proofOfPossessionPayload}}getDOMExtraParams(e){try{const n={};for(const[r,o]of Object.entries(e))o&&(typeof o=="object"?n[r]=JSON.stringify(o):n[r]=String(o));return n}catch(n){return this.logger.error(this.platformAuthType+" - Error stringifying extra parameters"),this.logger.errorPii(this.platformAuthType+" - Error stringifying extra parameters: "+n),{}}}}/*! @azure/msal-browser v4.30.0 2026-03-18 */async function v1(t,e,n,r,o){t.trace("getPlatformAuthProvider called",n),t.trace("Has client allowed platform auth via DOM API: "+o);let i;try{o&&(i=await Vg.createProvider(t,e,n)),i||(t.trace("Platform auth via DOM API not available, checking for extension"),i=await Qu.createProvider(t,r||Mx,e))}catch(a){t.trace("Platform auth not available",a)}return i}function Ol(t,e,n,r){if(e.trace("isPlatformAuthAllowed called"),!t.system.allowPlatformBroker&&t.system.allowPlatformBrokerWithDOM)throw Wt(zb);if(!t.system.allowPlatformBroker)return e.trace("isPlatformAuthAllowed: allowPlatformBroker is not enabled, returning false"),!1;if(!n)return e.trace("isPlatformAuthAllowed: Platform auth provider is not initialized, returning false"),!1;if(r)switch(r){case zt.BEARER:case zt.POP:return e.trace("isPlatformAuthAllowed: authenticationScheme is supported, returning true"),!0;default:return e.trace("isPlatformAuthAllowed: authenticationScheme is not supported, returning false"),!1}return!0}/*! @azure/msal-browser v4.30.0 2026-03-18 */class y1 extends sc{constructor(e,n,r,o,i,a,c,u,h,p){super(e,n,r,o,i,a,c,h,p),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=u,this.eventHandler=i}acquireToken(e,n){let r;try{if(r={popupName:this.generatePopupName(e.scopes||Wa,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window},this.performanceClient.addFields({isAsyncPopup:this.config.system.asyncPopups},this.correlationId),this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,r,n);{const i={...e,httpMethod:Gx(e,this.config.auth.protocolMode)};return this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(i,r,n)}}catch(o){return Promise.reject(o)}}logout(e){try{this.logger.verbose("logoutPopup called");const n=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(n),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},o=e&&e.authority,i=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(n,r,o,i)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(n,r,o,i))}catch(n){return Promise.reject(n)}}async acquireTokenPopupAsync(e,n,r){this.logger.verbose("acquireTokenPopupAsync called");const o=await he(this.initializeAuthorizationRequest.bind(this),H.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,Ze.Popup);n.popup&&Ox(o.authority);const i=Ol(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme);return o.platformBroker=i,this.config.auth.protocolMode===Ir.EAR?this.executeEarFlow(o,n,r):this.executeCodeFlow(o,n,r)}async executeCodeFlow(e,n,r){var u;const o=e.correlationId,i=this.initializeServerTelemetryManager(xt.acquireTokenPopup),a=r||await he(as,H.GeneratePkceCodes,this.logger,this.performanceClient,o)(this.performanceClient,this.logger,o),c={...e,codeChallenge:a.challenge};try{const h=await he(this.createAuthCodeClient.bind(this),H.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,o)({serverTelemetryManager:i,requestAuthority:c.authority,requestAzureCloudOptions:c.azureCloudOptions,requestExtraQueryParameters:c.extraQueryParameters,account:c.account});if(c.httpMethod===zs.POST)return await this.executeCodeFlowWithPost(c,n,h,a.verifier);{const p=await he(Yu,H.GetAuthCodeUrl,this.logger,this.performanceClient,o)(this.config,h.authority,c,this.logger,this.performanceClient),g=this.initiateAuthRequest(p,n);this.eventHandler.emitEvent(et.POPUP_OPENED,Ze.Popup,{popupWindow:g},null);const v=await this.monitorPopupForHash(g,n.popupWindowParent),m=kr(ac,H.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(v,this.config.auth.OIDCOptions.serverResponseType,this.logger);return await he(lc,H.HandleResponseCode,this.logger,this.performanceClient,o)(e,m,a.verifier,xt.acquireTokenPopup,this.config,h,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}catch(h){throw(u=n.popup)==null||u.close(),h instanceof jt&&(h.setCorrelationId(this.correlationId),i.cacheFailedRequest(h)),h}}async executeEarFlow(e,n,r){const o=e.correlationId,i=await he(this.getDiscoveredAuthority.bind(this),H.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,o)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),a=await he(Ig,H.GenerateEarKey,this.logger,this.performanceClient,o)(),c=r||await he(as,H.GeneratePkceCodes,this.logger,this.performanceClient,o)(this.performanceClient,this.logger,o),u={...e,earJwk:a,codeChallenge:c.challenge},h=n.popup||this.openPopup("about:blank",n);(await Hg(h.document,this.config,i,u,this.logger,this.performanceClient)).submit();const g=await he(this.monitorPopupForHash.bind(this),H.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,o)(h,n.popupWindowParent),v=kr(ac,H.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(g,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(!v.ear_jwe&&v.code){const m=await he(this.createAuthCodeClient.bind(this),H.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,o)({serverTelemetryManager:this.initializeServerTelemetryManager(xt.acquireTokenPopup),requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account,authority:i});return he(lc,H.HandleResponseCode,this.logger,this.performanceClient,o)(u,v,c.verifier,xt.acquireTokenPopup,this.config,m,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}else return he(zg,H.HandleResponseEar,this.logger,this.performanceClient,o)(u,v,xt.acquireTokenPopup,this.config,i,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async executeCodeFlowWithPost(e,n,r,o){const i=e.correlationId,a=await he(this.getDiscoveredAuthority.bind(this),H.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,i)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),c=n.popup||this.openPopup("about:blank",n);(await Bg(c.document,this.config,a,e,this.logger,this.performanceClient)).submit();const h=await he(this.monitorPopupForHash.bind(this),H.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,i)(c,n.popupWindowParent),p=kr(ac,H.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(h,this.config.auth.OIDCOptions.serverResponseType,this.logger);return he(lc,H.HandleResponseCode,this.logger,this.performanceClient,i)(e,p,o,xt.acquireTokenPopup,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async logoutPopupAsync(e,n,r,o){var a,c,u;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(et.LOGOUT_START,Ze.Popup,e);const i=this.initializeServerTelemetryManager(xt.logoutPopup);try{await this.clearCacheOnLogout(this.correlationId,e.account);const h=await he(this.createAuthCodeClient.bind(this),H.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:r,account:e.account||void 0});try{h.authority.endSessionEndpoint}catch{if((a=e.account)!=null&&a.homeAccountId&&e.postLogoutRedirectUri&&h.authority.protocolMode===Ir.OIDC){if(this.eventHandler.emitEvent(et.LOGOUT_SUCCESS,Ze.Popup,e),o){const v={apiId:xt.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},m=It.getAbsoluteUrl(o,di());await this.navigationClient.navigateInternal(m,v)}(c=n.popup)==null||c.close();return}}const p=h.getLogoutUri(e);this.eventHandler.emitEvent(et.LOGOUT_SUCCESS,Ze.Popup,e);const g=this.openPopup(p,n);if(this.eventHandler.emitEvent(et.POPUP_OPENED,Ze.Popup,{popupWindow:g},null),await this.monitorPopupForHash(g,n.popupWindowParent).catch(()=>{}),o){const v={apiId:xt.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},m=It.getAbsoluteUrl(o,di());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${m}`),await this.navigationClient.navigateInternal(m,v)}else this.logger.verbose("No main window navigation requested")}catch(h){throw(u=n.popup)==null||u.close(),h instanceof jt&&(h.setCorrelationId(this.correlationId),i.cacheFailedRequest(h)),this.eventHandler.emitEvent(et.LOGOUT_FAILURE,Ze.Popup,null,h),this.eventHandler.emitEvent(et.LOGOUT_END,Ze.Popup),h}this.eventHandler.emitEvent(et.LOGOUT_END,Ze.Popup)}initiateAuthRequest(e,n){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,n);throw this.logger.error("Navigate url is empty"),Be(Du)}monitorPopupForHash(e,n){return new Promise((r,o)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const i=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(i),o(Be(El));return}let a="";try{a=e.location.href}catch{}if(!a||a==="about:blank")return;clearInterval(i);let c="";const u=this.config.auth.OIDCOptions.serverResponseType;e&&(u===su.QUERY?c=e.location.search:c=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(c)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,n)})}openPopup(e,n){try{let r;if(n.popup?(r=n.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof n.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,n)),!r)throw Be(VC);return r.focus&&r.focus(),this.currentWindow=r,n.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),Be(zC)}}openSizedPopup(e,{popupName:n,popupWindowAttributes:r,popupWindowParent:o}){var m,C,b,w;const i=o.screenLeft?o.screenLeft:o.screenX,a=o.screenTop?o.screenTop:o.screenY,c=o.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,u=o.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let h=(m=r.popupSize)==null?void 0:m.width,p=(C=r.popupSize)==null?void 0:C.height,g=(b=r.popupPosition)==null?void 0:b.top,v=(w=r.popupPosition)==null?void 0:w.left;return(!h||h<0||h>c)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),h=Pr.POPUP_WIDTH),(!p||p<0||p>u)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),p=Pr.POPUP_HEIGHT),(!g||g<0||g>u)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),g=Math.max(0,u/2-Pr.POPUP_HEIGHT/2+a)),(!v||v<0||v>c)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),v=Math.max(0,c/2-Pr.POPUP_WIDTH/2+i)),o.open(e,n,`width=${h}, height=${p}, top=${g}, left=${v}, scrollbars=yes`)}unloadWindow(e){this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,n){e.close(),n.removeEventListener("beforeunload",this.unloadWindow)}generatePopupName(e,n){return`${Pr.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${n}.${this.correlationId}`}generateLogoutPopupName(e){const n=e.account&&e.account.homeAccountId;return`${Pr.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${n}.${this.correlationId}`}}/*! @azure/msal-browser v4.30.0 2026-03-18 */function w1(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const t=window.performance.getEntriesByType("navigation"),e=t.length?t[0]:void 0;return e==null?void 0:e.type}class b1 extends sc{constructor(e,n,r,o,i,a,c,u,h,p){super(e,n,r,o,i,a,c,h,p),this.nativeStorage=u}async acquireToken(e){const n=await he(this.initializeAuthorizationRequest.bind(this),H.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,Ze.Redirect);n.platformBroker=Ol(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme);const r=i=>{i.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.resetRequestCache(),this.eventHandler.emitEvent(et.RESTORE_FROM_BFCACHE,Ze.Redirect))},o=this.getRedirectStartPage(e.redirectStartPage);this.logger.verbosePii(`Redirect start page: ${o}`),this.browserStorage.setTemporaryCache(Sn.ORIGIN_URI,o,!0),window.addEventListener("pageshow",r);try{this.config.auth.protocolMode===Ir.EAR?await this.executeEarFlow(n):await this.executeCodeFlow(n,e.onRedirectNavigate)}catch(i){throw i instanceof jt&&i.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",r),i}}async executeCodeFlow(e,n){const r=e.correlationId,o=this.initializeServerTelemetryManager(xt.acquireTokenRedirect),i=await he(as,H.GeneratePkceCodes,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),a={...e,codeChallenge:i.challenge};this.browserStorage.cacheAuthorizeRequest(a,i.verifier);try{if(a.httpMethod===zs.POST)return await this.executeCodeFlowWithPost(a);{const c=await he(this.createAuthCodeClient.bind(this),H.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:a.authority,requestAzureCloudOptions:a.azureCloudOptions,requestExtraQueryParameters:a.extraQueryParameters,account:a.account}),u=await he(Yu,H.GetAuthCodeUrl,this.logger,this.performanceClient,e.correlationId)(this.config,c.authority,a,this.logger,this.performanceClient);return await this.initiateAuthRequest(u,n)}}catch(c){throw c instanceof jt&&(c.setCorrelationId(this.correlationId),o.cacheFailedRequest(c)),c}}async executeEarFlow(e){const n=e.correlationId,r=await he(this.getDiscoveredAuthority.bind(this),H.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),o=await he(Ig,H.GenerateEarKey,this.logger,this.performanceClient,n)(),i=await he(as,H.GeneratePkceCodes,this.logger,this.performanceClient,n)(this.performanceClient,this.logger,n),a={...e,earJwk:o,codeChallenge:i.challenge};return this.browserStorage.cacheAuthorizeRequest(a,i.verifier),(await Hg(document,this.config,r,a,this.logger,this.performanceClient)).submit(),new Promise((u,h)=>{setTimeout(()=>{h(Be($u,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async executeCodeFlowWithPost(e){const n=e.correlationId,r=await he(this.getDiscoveredAuthority.bind(this),H.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return this.browserStorage.cacheAuthorizeRequest(e),(await Bg(document,this.config,r,e,this.logger,this.performanceClient)).submit(),new Promise((i,a)=>{setTimeout(()=>{a(Be($u,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async handleRedirectPromise(e="",n,r,o){const i=this.initializeServerTelemetryManager(xt.handleRedirectPromise);try{const[a,c]=this.getRedirectResponse(e||"");if(!a)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.resetRequestCache(),w1()!=="back_forward"?o.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const u=this.browserStorage.getTemporaryCache(Sn.ORIGIN_URI,!0)||ve.EMPTY_STRING,h=Wb(u),p=Wb(window.location.href);if(h===p&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),u.indexOf("#")>-1&&xN(u),await this.handleResponse(a,n,r,i);if(this.config.auth.navigateToLoginRequestUrl){if(!Ng()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(Sn.URL_HASH,c,!0);const g={apiId:xt.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let v=!0;if(!u||u==="null"){const m=SN();this.browserStorage.setTemporaryCache(Sn.ORIGIN_URI,m,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),v=await this.navigationClient.navigateInternal(m,g)}else this.logger.verbose(`Navigating to loginRequestUrl: ${u}`),v=await this.navigationClient.navigateInternal(u,g);if(!v)return await this.handleResponse(a,n,r,i)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(a,n,r,i);return null}catch(a){throw a instanceof jt&&(a.setCorrelationId(this.correlationId),i.cacheFailedRequest(a)),a}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let n=e;n||(this.config.auth.OIDCOptions.serverResponseType===su.QUERY?n=window.location.search:n=window.location.hash);let r=pu(n);if(r){try{t1(r,this.browserCrypto,Ze.Redirect)}catch(i){return i instanceof jt&&this.logger.error(`Interaction type validation failed due to ${i.errorCode}: ${i.errorMessage}`),[null,""]}return Ax(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,n]}const o=this.browserStorage.getTemporaryCache(Sn.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Sn.URL_HASH)),o&&(r=pu(o),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,o]):[null,""]}async handleResponse(e,n,r,o){if(!e.state)throw Be(mg);if(e.ear_jwe){const c=await he(this.getDiscoveredAuthority.bind(this),H.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n.correlationId)({requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account});return he(zg,H.HandleResponseEar,this.logger,this.performanceClient,n.correlationId)(n,e,xt.acquireTokenRedirect,this.config,c,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}const a=await he(this.createAuthCodeClient.bind(this),H.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:n.authority});return he(lc,H.HandleResponseCode,this.logger,this.performanceClient,n.correlationId)(n,e,r,xt.acquireTokenRedirect,this.config,a,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async initiateAuthRequest(e,n){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:xt.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=n||this.config.auth.onRedirectNavigate;if(typeof o=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),o(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await this.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await this.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),Be(Du)}async logout(e){var o;this.logger.verbose("logoutRedirect called");const n=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(xt.logout);try{this.eventHandler.emitEvent(et.LOGOUT_START,Ze.Redirect,e),await this.clearCacheOnLogout(this.correlationId,n.account);const i={apiId:xt.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=await he(this.createAuthCodeClient.bind(this),H.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(a.authority.protocolMode===Ir.OIDC)try{a.authority.endSessionEndpoint}catch{if((o=n.account)!=null&&o.homeAccountId){this.eventHandler.emitEvent(et.LOGOUT_SUCCESS,Ze.Redirect,n);return}}const c=a.getLogoutUri(n);if(this.eventHandler.emitEvent(et.LOGOUT_SUCCESS,Ze.Redirect,n),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(c)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,ns.SIGNOUT),await this.navigationClient.navigateExternal(c,i);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,ns.SIGNOUT),await this.navigationClient.navigateExternal(c,i);return}}catch(i){throw i instanceof jt&&(i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i)),this.eventHandler.emitEvent(et.LOGOUT_FAILURE,Ze.Redirect,null,i),this.eventHandler.emitEvent(et.LOGOUT_END,Ze.Redirect),i}this.eventHandler.emitEvent(et.LOGOUT_END,Ze.Redirect)}getRedirectStartPage(e){const n=e||window.location.href;return It.getAbsoluteUrl(n,di())}}/*! @azure/msal-browser v4.30.0 2026-03-18 */async function Xx(t,e,n,r,o){if(e.addQueueMeasurement(H.SilentHandlerInitiateAuthRequest,r),!t)throw n.info("Navigate url is empty"),Be(Du);return o?he(_1,H.SilentHandlerLoadFrame,n,e,r)(t,o,e,r):kr(S1,H.SilentHandlerLoadFrameSync,n,e,r)(t)}async function C1(t,e,n,r,o){const i=Ju();if(!i.contentDocument)throw"No document associated with iframe!";return(await Bg(i.contentDocument,t,e,n,r,o)).submit(),i}async function x1(t,e,n,r,o){const i=Ju();if(!i.contentDocument)throw"No document associated with iframe!";return(await Hg(i.contentDocument,t,e,n,r,o)).submit(),i}async function Kg(t,e,n,r,o,i,a){r.addQueueMeasurement(H.SilentHandlerMonitorIframeForHash,i),r.addFields({iframePollIntervalMs:n,iframeTimeoutMs:e},i);let c=0,u=0;return new Promise((h,p)=>{e<Mg&&o.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${Mg}ms). This may result in timeouts.`);const g=window.setTimeout(()=>{window.clearInterval(v),p(Be(KC))},e),v=window.setInterval(()=>{c++;let m="";const C=t.contentWindow;try{m=C?C.location.href:""}catch{u++}if(!m||m==="about:blank")return;let b="";C&&(a===su.QUERY?b=C.location.search:b=C.location.hash),window.clearTimeout(g),window.clearInterval(v),h(b)},n)}).finally(()=>{r.addFields({iframeTickCount:c,crossOriginTickCount:u},i),kr(T1,H.RemoveHiddenIframe,o,r,i)(t)})}function _1(t,e,n,r){return n.addQueueMeasurement(H.SilentHandlerLoadFrame,r),new Promise((o,i)=>{const a=Ju();window.setTimeout(()=>{if(!a){i("Unable to load iframe");return}a.src=t,o(a)},e)})}function S1(t){const e=Ju();return e.src=t,e}function Ju(){const t=document.createElement("iframe");return t.className="msalSilentIframe",t.style.visibility="hidden",t.style.position="absolute",t.style.width=t.style.height="0",t.style.border="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),t.setAttribute("allow","local-network-access *"),document.body.appendChild(t),t}function T1(t){document.body===t.parentNode&&document.body.removeChild(t)}/*! @azure/msal-browser v4.30.0 2026-03-18 */class E1 extends sc{constructor(e,n,r,o,i,a,c,u,h,p,g){super(e,n,r,o,i,a,u,p,g),this.apiId=c,this.nativeStorage=h}async acquireToken(e){this.performanceClient.addQueueMeasurement(H.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const n={...e};n.prompt?n.prompt!==Dn.NONE&&n.prompt!==Dn.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${n.prompt} with ${Dn.NONE}`),n.prompt=Dn.NONE):n.prompt=Dn.NONE;const r=await he(this.initializeAuthorizationRequest.bind(this),H.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(n,Ze.Silent);return r.platformBroker=Ol(this.config,this.logger,this.platformAuthProvider,r.authenticationScheme),Ox(r.authority),this.config.auth.protocolMode===Ir.EAR?this.executeEarFlow(r):this.executeCodeFlow(r)}async executeCodeFlow(e){let n;const r=this.initializeServerTelemetryManager(this.apiId);try{return n=await he(this.createAuthCodeClient.bind(this),H.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),await he(this.silentTokenHelper.bind(this),H.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(n,e)}catch(o){if(o instanceof jt&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),!n||!(o instanceof jt)||o.errorCode!==Pr.INVALID_GRANT_ERROR)throw o;return this.performanceClient.addFields({retryError:o.errorCode},this.correlationId),await he(this.silentTokenHelper.bind(this),H.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(n,e)}}async executeEarFlow(e){const n=e.correlationId,r=await he(this.getDiscoveredAuthority.bind(this),H.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),o=await he(Ig,H.GenerateEarKey,this.logger,this.performanceClient,n)(),i=await he(as,H.GeneratePkceCodes,this.logger,this.performanceClient,n)(this.performanceClient,this.logger,n),a={...e,earJwk:o,codeChallenge:i.challenge},c=await he(x1,H.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,n)(this.config,r,a,this.logger,this.performanceClient),u=this.config.auth.OIDCOptions.serverResponseType,h=await he(Kg,H.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,n)(c,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,n,u),p=kr(ac,H.DeserializeResponse,this.logger,this.performanceClient,n)(h,u,this.logger);if(!p.ear_jwe&&p.code){const g=await he(this.createAuthCodeClient.bind(this),H.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,n)({serverTelemetryManager:this.initializeServerTelemetryManager(this.apiId),requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account,authority:r});return he(lc,H.HandleResponseCode,this.logger,this.performanceClient,n)(a,p,i.verifier,this.apiId,this.config,g,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}else return he(zg,H.HandleResponseEar,this.logger,this.performanceClient,n)(a,p,this.apiId,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async verifySso(e){this.performanceClient.addQueueMeasurement(H.SilentIframeClientAcquireToken,e.correlationId);const n={...e};n.prompt||(n.prompt=Dn.NONE);const r=await he(this.initializeAuthorizationRequest.bind(this),H.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(n,Ze.Silent),o=await he(this.createAuthCodeClient.bind(this),H.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:this.initializeServerTelemetryManager(this.apiId),requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),i=r.correlationId,a=await he(as,H.GeneratePkceCodes,this.logger,this.performanceClient,i)(this.performanceClient,this.logger,i),c={...r,codeChallenge:a.challenge},u=await he(Yu,H.GetAuthCodeUrl,this.logger,this.performanceClient,i)(this.config,o.authority,c,this.logger,this.performanceClient),h=await he(Xx,H.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,i)(u,this.performanceClient,this.logger,i,this.config.system.navigateFrameWait),p=this.config.auth.OIDCOptions.serverResponseType,g=await he(Kg,H.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,i)(h,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,i,p),v=kr(ac,H.DeserializeResponse,this.logger,this.performanceClient,i)(g,p,this.logger);return dg(v,r.state),v.code?(this.logger.verbose("SSO verification completed successfully with valid authorization code - skipped token exchange",i),!0):(this.logger.warning("SSO verification response did not contain an authorization code",i),!1)}logout(){return Promise.reject(Be(Mu))}async silentTokenHelper(e,n){const r=n.correlationId;this.performanceClient.addQueueMeasurement(H.SilentIframeClientTokenHelper,r);const o=await he(as,H.GeneratePkceCodes,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),i={...n,codeChallenge:o.challenge};let a;if(n.httpMethod===zs.POST)a=await he(C1,H.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(this.config,e.authority,i,this.logger,this.performanceClient);else{const p=await he(Yu,H.GetAuthCodeUrl,this.logger,this.performanceClient,r)(this.config,e.authority,i,this.logger,this.performanceClient);a=await he(Xx,H.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(p,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait)}const c=this.config.auth.OIDCOptions.serverResponseType,u=await he(Kg,H.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(a,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,c),h=kr(ac,H.DeserializeResponse,this.logger,this.performanceClient,r)(u,c,this.logger);return he(lc,H.HandleResponseCode,this.logger,this.performanceClient,r)(n,h,o.verifier,this.apiId,this.config,e,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}/*! @azure/msal-browser v4.30.0 2026-03-18 */class A1 extends sc{async acquireToken(e){this.performanceClient.addQueueMeasurement(H.SilentRefreshClientAcquireToken,e.correlationId);const n=await he($g,H.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...n};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const o=this.initializeServerTelemetryManager(xt.acquireTokenSilent_silentFlow),i=await this.createRefreshTokenClient({serverTelemetryManager:o,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return he(i.acquireTokenByRefreshToken.bind(i),H.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r,xt.acquireTokenSilent_silentFlow).catch(a=>{throw a.setCorrelationId(this.correlationId),o.cacheFailedRequest(a),a})}logout(){return Promise.reject(Be(Mu))}async createRefreshTokenClient(e){const n=await he(this.getClientConfiguration.bind(this),H.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new zO(n,this.performanceClient)}}/*! @azure/msal-browser v4.30.0 2026-03-18 */class I1{constructor(e,n,r,o,i){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=n,this.logger=r,this.cryptoObj=o,this.performanceClient=i}async loadExternalTokens(e,n,r){if(!this.isBrowserEnvironment)throw Be(Ru);const o=e.correlationId||zo(),i=this.performanceClient.startMeasurement(H.LoadExternalTokens,o);try{const a=n.id_token?Uo(n.id_token,pr):void 0,c=Ho(a||{}),u={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},h=e.authority||this.config.auth.authority,p=await og(fr.generateAuthority(h,e.azureCloudOptions),this.config.system.networkClient,this.storage,u,this.logger,o,this.performanceClient),g=await he(this.loadAccount.bind(this),H.LoadAccount,this.logger,this.performanceClient,o)(e,r.clientInfo||n.client_info||"",o,p,a),v=await he(this.loadIdToken.bind(this),H.LoadIdToken,this.logger,this.performanceClient,o)(n,g.homeAccountId,g.environment,g.realm,o,c),m=await he(this.loadAccessToken.bind(this),H.LoadAccessToken,this.logger,this.performanceClient,o)(e,n,g.homeAccountId,g.environment,g.realm,r,o,c),C=await he(this.loadRefreshToken.bind(this),H.LoadRefreshToken,this.logger,this.performanceClient,o)(n,g.homeAccountId,g.environment,o,c);return i.end({success:!0},void 0,wn.getAccountInfo(g)),this.generateAuthenticationResult(e,{account:g,idToken:v,accessToken:m,refreshToken:C},p,a)}catch(a){throw i.end({success:!1},a),a}}async loadAccount(e,n,r,o,i){if(this.logger.verbose("TokenCache - loading account"),e.account){const h=wn.createFromAccountInfo(e.account);return await this.storage.setAccount(h,r,Ho(i||{}),xt.loadExternalTokens),h}else if(!n&&!i)throw this.logger.error("TokenCache - if an account is not provided on the request, clientInfo or idToken must be provided instead."),Be(ZC);const a=wn.generateHomeAccountId(n,o.authorityType,this.logger,this.cryptoObj,i),c=i==null?void 0:i.tid,u=cg(this.storage,o,a,pr,r,i,n,o.getPreferredCache(),c,void 0,void 0,this.logger);return await this.storage.setAccount(u,r,Ho(i||{}),xt.loadExternalTokens),u}async loadIdToken(e,n,r,o,i,a){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const c=Su(n,r,e.id_token,this.config.auth.clientId,o);return await this.storage.setIdTokenCredential(c,i,a),c}async loadAccessToken(e,n,r,o,i,a,c,u){if(n.access_token)if(n.expires_in){if(!n.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const h=n.scope?Pn.fromString(n.scope):new Pn(e.scopes),p=a.expiresOn||n.expires_in+ur(),g=a.extendedExpiresOn||(n.ext_expires_in||n.expires_in)+ur(),v=Tu(r,o,n.access_token,this.config.auth.clientId,i,h.printScopes(),p,g,pr);return await this.storage.setAccessTokenCredential(v,c,u),v}async loadRefreshToken(e,n,r,o,i){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;const a=e.refresh_token_expires_in?e.refresh_token_expires_in+ur():void 0;this.performanceClient.addFields({extRtExpiresOnSeconds:a},o),this.logger.verbose("TokenCache - loading refresh token");const c=wC(n,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,a);return await this.storage.setRefreshTokenCredential(c,o,i),c}generateAuthenticationResult(e,n,r,o){var p,g,v;let i="",a=[],c=null,u;n!=null&&n.accessToken&&(i=n.accessToken.secret,a=Pn.fromString(n.accessToken.target).asArray(),c=Za(n.accessToken.expiresOn),u=Za(n.accessToken.extendedExpiresOn));const h=n.account;return{authority:r?r.canonicalAuthority:"",uniqueId:n.account.localAccountId,tenantId:n.account.realm,scopes:a,account:wn.getAccountInfo(h),idToken:((p=n.idToken)==null?void 0:p.secret)||"",idTokenClaims:o||{},accessToken:i,fromCache:!0,expiresOn:c,correlationId:e.correlationId||"",requestId:"",extExpiresOn:u,familyId:((g=n.refreshToken)==null?void 0:g.familyId)||"",tokenType:((v=n==null?void 0:n.accessToken)==null?void 0:v.tokenType)||"",state:e.state||"",cloudGraphHostName:h.cloudGraphHostName||"",msGraphHost:h.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v4.30.0 2026-03-18 */class k1 extends PC{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v4.30.0 2026-03-18 */class P1 extends sc{constructor(e,n,r,o,i,a,c,u,h,p){super(e,n,r,o,i,a,u,h,p),this.apiId=c}async acquireToken(e){if(!e.code)throw Be(ex);const n=await he(this.initializeAuthorizationRequest.bind(this),H.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,Ze.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const o={...n,code:e.code},i=await he(this.getClientConfiguration.bind(this),H.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),a=new k1(i);this.logger.verbose("Auth code client created");const c=new jx(a,this.browserStorage,o,this.logger,this.performanceClient);return await he(c.handleCodeResponseFromServer.bind(c),H.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},n,this.apiId,!1)}catch(o){throw o instanceof jt&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}logout(){return Promise.reject(Be(Mu))}}/*! @azure/msal-browser v4.30.0 2026-03-18 */function O1(t,e,n){var a;const r=((a=window.msal)==null?void 0:a.clientIds)||[],o=r.length,i=r.filter(c=>c===t).length;i>1&&n.warning("There is already an instance of MSAL.js in the window with the same client id."),e.add({msalInstanceCount:o,sameClientIdInstanceCount:i})}/*! @azure/msal-browser v4.30.0 2026-03-18 */function Xu(t,e,n){try{Dg(t)}catch(r){throw e.end({success:!1},r,n),r}}class Zu{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new ui(this.logger,this.performanceClient):uu,this.eventHandler=new XN(this.logger),this.browserStorage=this.isBrowserEnvironment?new Fg(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,DO(this.config.auth)):VN(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler);const n={cacheLocation:Hn.MemoryStorage,cacheRetentionDays:5,temporaryCacheLocation:Hn.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new Fg(this.config.auth.clientId,n,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler),this.tokenCache=new I1(this.config,this.browserStorage,this.logger,this.browserCrypto,this.performanceClient),this.activeSilentTokenRequests=new Map,this.trackStateChangeWithMeasurement=this.trackStateChangeWithMeasurement.bind(this)}static async createController(e,n){const r=new Zu(e);return await r.initialize(n),r}trackStateChange(e,n){e&&(n.type==="visibilitychange"?(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e)):n.type==="online"?(this.logger.info("Perf: Online status change detected"),this.performanceClient.incrementFields({onlineStatusChangeCount:1},e)):n.type==="offline"&&(this.logger.info("Perf: Offline status change detected"),this.performanceClient.incrementFields({onlineStatusChangeCount:1},e)))}async initialize(e,n){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(et.INITIALIZE_END);return}const r=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),o=this.config.system.allowPlatformBroker,i=this.performanceClient.startMeasurement(H.InitializeClientApplication,r);if(this.eventHandler.emitEvent(et.INITIALIZE_START),!n)try{this.logMultipleInstances(i)}catch{}if(await he(this.browserStorage.initialize.bind(this.browserStorage),H.InitializeCache,this.logger,this.performanceClient,r)(r),o)try{this.platformAuthProvider=await v1(this.logger,this.performanceClient,r,this.config.system.nativeBrokerHandshakeTimeout,this.config.system.allowPlatformBrokerWithDOM)}catch(a){this.logger.verbose(a)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),kr(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),H.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,r)(r)),this.config.system.asyncPopups&&await this.preGeneratePkceCodes(r),this.initialized=!0,this.eventHandler.emitEvent(et.INITIALIZE_END),i.end({allowPlatformBroker:o,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),kx(this.initialized),this.isBrowserEnvironment){const n=e||"";let r=this.redirectResponse.get(n);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(n,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){var u;if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;if(((u=this.browserStorage.getInteractionInProgress())==null?void 0:u.type)===ns.SIGNOUT)return this.logger.verbose("handleRedirectPromise removing interaction_in_progress flag and returning null after sign-out"),this.browserStorage.setInteractionInProgress(!1),Promise.resolve(null);const r=this.getAllAccounts(),o=this.browserStorage.getCachedNativeRequest(),i=o&&this.platformAuthProvider&&!e;let a;this.eventHandler.emitEvent(et.HANDLE_REDIRECT_START,Ze.Redirect);let c;try{if(i&&this.platformAuthProvider){a=this.performanceClient.startMeasurement(H.AcquireTokenRedirect,(o==null?void 0:o.correlationId)||""),this.logger.trace("handleRedirectPromise - acquiring token from native platform"),a.add({isPlatformBrokerRequest:!0});const h=new qu(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,xt.handleRedirectPromise,this.performanceClient,this.platformAuthProvider,o.accountId,this.nativeInternalStorage,o.correlationId);c=he(h.handleRedirectPromise.bind(h),H.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,a.event.correlationId)(this.performanceClient,a.event.correlationId)}else{const[h,p]=this.browserStorage.getCachedRequest(),g=h.correlationId;a=this.performanceClient.startMeasurement(H.AcquireTokenRedirect,g),this.logger.trace("handleRedirectPromise - acquiring token from web flow");const v=this.createRedirectClient(g);c=he(v.handleRedirectPromise.bind(v),H.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,a.event.correlationId)(e,h,p,a)}}catch(h){throw this.browserStorage.resetRequestCache(),h}return c.then(h=>(h?(this.browserStorage.resetRequestCache(),r.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(et.LOGIN_SUCCESS,Ze.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(et.ACQUIRE_TOKEN_SUCCESS,Ze.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),a.end({success:!0},void 0,h.account),this.verifySsoCapability(h.account,Ze.Redirect)):a.event.errorCode?a.end({success:!1},void 0):a.discard(),this.eventHandler.emitEvent(et.HANDLE_REDIRECT_END,Ze.Redirect),h)).catch(h=>{this.browserStorage.resetRequestCache();const p=h;throw r.length>0?this.eventHandler.emitEvent(et.ACQUIRE_TOKEN_FAILURE,Ze.Redirect,null,p):this.eventHandler.emitEvent(et.LOGIN_FAILURE,Ze.Redirect,null,p),this.eventHandler.emitEvent(et.HANDLE_REDIRECT_END,Ze.Redirect),a.end({success:!1},p),h})}async acquireTokenRedirect(e){const n=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",n);const r=this.performanceClient.startMeasurement(H.AcquireTokenPreRedirect,n);r.add({scenarioId:e.scenarioId});const o=e.onRedirectNavigate;if(o)e.onRedirectNavigate=a=>{const c=typeof o=="function"?o(a):void 0;return r.add({navigateCallbackResult:c!==!1}),r.event=r.end({success:!0},void 0,e.account)||r.event,c};else{const a=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=c=>{const u=typeof a=="function"?a(c):void 0;return r.add({navigateCallbackResult:u!==!1}),r.event=r.end({success:!0},void 0,e.account)||r.event,u}}const i=this.getAllAccounts().length>0;try{Px(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,ns.SIGNIN),i?this.eventHandler.emitEvent(et.ACQUIRE_TOKEN_START,Ze.Redirect,e):this.eventHandler.emitEvent(et.LOGIN_START,Ze.Redirect,e);let a;return this.platformAuthProvider&&this.canUsePlatformBroker(e)?a=new qu(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,xt.acquireTokenRedirect,this.performanceClient,this.platformAuthProvider,this.getNativeAccountId(e),this.nativeInternalStorage,n).acquireTokenRedirect(e,r).catch(u=>{if(r.add({brokerErrorName:u.name,brokerErrorCode:u.errorCode}),u instanceof Vo&&cc(u))return this.platformAuthProvider=void 0,this.createRedirectClient(n).acquireToken(e);if(u instanceof wo)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(n).acquireToken(e);throw u}):a=this.createRedirectClient(n).acquireToken(e),await a}catch(a){throw this.browserStorage.resetRequestCache(),r.event.status===2?this.performanceClient.startMeasurement(H.AcquireTokenRedirect,n).end({success:!1},a,e.account):r.end({success:!1},a,e.account),i?this.eventHandler.emitEvent(et.ACQUIRE_TOKEN_FAILURE,Ze.Redirect,null,a):this.eventHandler.emitEvent(et.LOGIN_FAILURE,Ze.Redirect,null,a),a}}acquireTokenPopup(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(H.AcquireTokenPopup,n);r.add({scenarioId:e.scenarioId});try{this.logger.verbose("acquireTokenPopup called",n),Xu(this.initialized,r,e.account),this.browserStorage.setInteractionInProgress(!0,ns.SIGNIN)}catch(c){return Promise.reject(c)}const o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(et.ACQUIRE_TOKEN_START,Ze.Popup,e):this.eventHandler.emitEvent(et.LOGIN_START,Ze.Popup,e);let i;const a=this.getPreGeneratedPkceCodes(n);return this.canUsePlatformBroker(e)?(r.add({isPlatformBrokerRequest:!0}),i=this.acquireTokenNative({...e,correlationId:n},xt.acquireTokenPopup).then(c=>(r.end({success:!0},void 0,c.account),c)).catch(c=>{if(r.add({brokerErrorName:c.name,brokerErrorCode:c.errorCode}),c instanceof Vo&&cc(c))return this.platformAuthProvider=void 0,this.createPopupClient(n).acquireToken(e,a);if(c instanceof wo)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(n).acquireToken(e,a);throw c})):i=this.createPopupClient(n).acquireToken(e,a),i.then(c=>(o.length<this.getAllAccounts().length?this.eventHandler.emitEvent(et.LOGIN_SUCCESS,Ze.Popup,c):this.eventHandler.emitEvent(et.ACQUIRE_TOKEN_SUCCESS,Ze.Popup,c),r.end({success:!0,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length},void 0,c.account),this.verifySsoCapability(c.account,Ze.Popup),c)).catch(c=>(o.length>0?this.eventHandler.emitEvent(et.ACQUIRE_TOKEN_FAILURE,Ze.Popup,null,c):this.eventHandler.emitEvent(et.LOGIN_FAILURE,Ze.Popup,null,c),r.end({success:!1},c,e.account),Promise.reject(c))).finally(async()=>{this.browserStorage.setInteractionInProgress(!1),this.config.system.asyncPopups&&await this.preGeneratePkceCodes(n)})}trackStateChangeWithMeasurement(e){const n=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;n&&(e.type==="visibilitychange"?(this.logger.info("Perf: Visibility change detected in ",n.event.name),n.increment({visibilityChangeCount:1})):e.type==="online"?(this.logger.info("Perf: Online status change detected in ",n.event.name),n.increment({onlineStatusChangeCount:1})):e.type==="offline"&&(this.logger.info("Perf: Offline status change detected in ",n.event.name),n.increment({onlineStatusChangeCount:1})))}addStateChangeListeners(e){document.addEventListener("visibilitychange",e),window.addEventListener("online",e),window.addEventListener("offline",e)}removeStateChangeListeners(e){document.removeEventListener("visibilitychange",e),window.removeEventListener("online",e),window.removeEventListener("offline",e)}verifySsoCapability(e,n){if(!this.config.auth.verifySSO)return;const r=this.browserCrypto.createNewGuid(),o=this.performanceClient.startMeasurement(H.SsoCapable,r);o.add({parentApi:n}),this.logger.verbose(`SSO capability verification initiated after ${n}`,r),setTimeout(()=>{const i={account:e,correlationId:r};this.createSilentIframeClient(r).verifySso(i).then(c=>{this.logger.verbose(`SSO capability verification completed after ${n}, success: ${c}`,r),o.end({fromCache:!1,success:c},void 0,e)}).catch(c=>{this.logger.warning(`SSO capability verification failed after ${n}: ${c.message}`,r),o.end({fromCache:!1,success:!1},c,e)})},0)}async ssoSilent(e){var i,a,c;const n=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:n};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(H.SsoSilent,n),(i=this.ssoSilentMeasurement)==null||i.add({scenarioId:e.scenarioId}),Xu(this.initialized,this.ssoSilentMeasurement,e.account),(a=this.ssoSilentMeasurement)==null||a.increment({visibilityChangeCount:0,onlineStatusChangeCount:0}),this.addStateChangeListeners(this.trackStateChangeWithMeasurement),this.logger.verbose("ssoSilent called",n),this.eventHandler.emitEvent(et.SSO_SILENT_START,Ze.Silent,r);let o;return this.canUsePlatformBroker(r)?((c=this.ssoSilentMeasurement)==null||c.add({isPlatformBrokerRequest:!0}),o=this.acquireTokenNative(r,xt.ssoSilent).catch(u=>{var h;if((h=this.ssoSilentMeasurement)==null||h.add({brokerErrorName:u.name,brokerErrorCode:u.errorCode}),u instanceof Vo&&cc(u))return this.platformAuthProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw u})):o=this.createSilentIframeClient(r.correlationId).acquireToken(r),o.then(u=>{var h;return this.eventHandler.emitEvent(et.SSO_SILENT_SUCCESS,Ze.Silent,u),(h=this.ssoSilentMeasurement)==null||h.end({success:!0,accessTokenSize:u.accessToken.length,idTokenSize:u.idToken.length},void 0,u.account),u}).catch(u=>{var h;throw this.eventHandler.emitEvent(et.SSO_SILENT_FAILURE,Ze.Silent,null,u),(h=this.ssoSilentMeasurement)==null||h.end({success:!1},u,e.account),u}).finally(()=>{this.removeStateChangeListeners(this.trackStateChangeWithMeasurement)})}async acquireTokenByCode(e){const n=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",n);const r=this.performanceClient.startMeasurement(H.AcquireTokenByCode,n);Xu(this.initialized,r),this.eventHandler.emitEvent(et.ACQUIRE_TOKEN_BY_CODE_START,Ze.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw Be(nx);if(e.code){const o=e.code;let i=this.hybridAuthCodeResponses.get(o);return i?(this.logger.verbose("Existing acquireTokenByCode request found",n),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",n),i=this.acquireTokenByCodeAsync({...e,correlationId:n}).then(a=>(this.eventHandler.emitEvent(et.ACQUIRE_TOKEN_BY_CODE_SUCCESS,Ze.Silent,a),this.hybridAuthCodeResponses.delete(o),r.end({success:!0,accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length},void 0,a.account),a)).catch(a=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(et.ACQUIRE_TOKEN_BY_CODE_FAILURE,Ze.Silent,null,a),r.end({success:!1},a),a}),this.hybridAuthCodeResponses.set(o,i)),await i}else if(e.nativeAccountId)if(this.canUsePlatformBroker(e,e.nativeAccountId)){r.add({isPlatformBrokerRequest:!0});const o=await this.acquireTokenNative({...e,correlationId:n},xt.acquireTokenByCode,e.nativeAccountId).catch(i=>{throw i instanceof Vo&&cc(i)&&(this.platformAuthProvider=void 0),r.add({brokerErrorName:i.name,brokerErrorCode:i.errorCode}),i});return r.end({success:!0},void 0,o.account),o}else throw Be(rx);else throw Be(tx)}catch(o){throw this.eventHandler.emitEvent(et.ACQUIRE_TOKEN_BY_CODE_FAILURE,Ze.Silent,null,o),r.end({success:!1},o),o}}async acquireTokenByCodeAsync(e){var o;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(H.AcquireTokenByCodeAsync,e.correlationId),(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.increment({visibilityChangeCount:0,onlineStatusChangeCount:0}),this.addStateChangeListeners(this.trackStateChangeWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(i=>{var a;return(a=this.acquireTokenByCodeAsyncMeasurement)==null||a.end({success:!0,fromCache:i.fromCache}),i}).catch(i=>{var a;throw(a=this.acquireTokenByCodeAsyncMeasurement)==null||a.end({success:!1},i),i}).finally(()=>{this.removeStateChangeListeners(this.trackStateChangeWithMeasurement)})}async acquireTokenFromCache(e,n){switch(this.performanceClient.addQueueMeasurement(H.AcquireTokenFromCache,e.correlationId),n){case hr.Default:case hr.AccessToken:case hr.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return he(r.acquireToken.bind(r),H.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw Ae(Zi)}}async acquireTokenByRefreshToken(e,n){switch(this.performanceClient.addQueueMeasurement(H.AcquireTokenByRefreshToken,e.correlationId),n){case hr.Default:case hr.AccessTokenAndRefreshToken:case hr.RefreshToken:case hr.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return he(r.acquireToken.bind(r),H.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw Ae(Zi)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(H.AcquireTokenBySilentIframe,e.correlationId);const n=this.createSilentIframeClient(e.correlationId);return he(n.acquireToken.bind(n),H.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const n=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",n),this.logoutRedirect({correlationId:n,...e})}async logoutRedirect(e){const n=this.getRequestCorrelationId(e);return Px(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,ns.SIGNOUT),this.createRedirectClient(n).logout(e)}logoutPopup(e){try{const n=this.getRequestCorrelationId(e);return Dg(this.initialized),this.browserStorage.setInteractionInProgress(!0,ns.SIGNOUT),this.createPopupClient(n).logout(e).finally(()=>{this.browserStorage.setInteractionInProgress(!1)})}catch(n){return Promise.reject(n)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const n=this.getRequestCorrelationId(e);return this.createSilentCacheClient(n).logout(e)}getAllAccounts(e){const n=this.getRequestCorrelationId();return KN(this.logger,this.browserStorage,this.isBrowserEnvironment,n,e)}getAccount(e){const n=this.getRequestCorrelationId();return GN(e,this.logger,this.browserStorage,n)}getAccountByUsername(e){const n=this.getRequestCorrelationId();return jN(e,this.logger,this.browserStorage,n)}getAccountByHomeId(e){const n=this.getRequestCorrelationId();return WN(e,this.logger,this.browserStorage,n)}getAccountByLocalId(e){const n=this.getRequestCorrelationId();return qN(e,this.logger,this.browserStorage,n)}setActiveAccount(e){const n=this.getRequestCorrelationId();YN(e,this.browserStorage,n)}getActiveAccount(){const e=this.getRequestCorrelationId();return QN(this.browserStorage,e)}async hydrateCache(e,n){this.logger.verbose("hydrateCache called");const r=wn.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return await this.browserStorage.setAccount(r,e.correlationId,Ho(e.idTokenClaims),xt.hydrateCache),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,n)):this.browserStorage.hydrateCache(e,n)}async acquireTokenNative(e,n,r,o){if(this.logger.trace("acquireTokenNative called"),!this.platformAuthProvider)throw Be(bg);return new qu(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,n,this.performanceClient,this.platformAuthProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e,o)}canUsePlatformBroker(e,n){if(this.logger.trace("canUsePlatformBroker called"),!this.platformAuthProvider)return this.logger.trace("canUsePlatformBroker: platform broker unavilable, returning false"),!1;if(!Ol(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme))return this.logger.trace("canUsePlatformBroker: isBrokerAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case Dn.NONE:case Dn.CONSENT:case Dn.LOGIN:case Dn.SELECT_ACCOUNT:this.logger.trace("canUsePlatformBroker: prompt is compatible with platform broker flow");break;default:return this.logger.trace(`canUsePlatformBroker: prompt = ${e.prompt} is not compatible with platform broker flow, returning false`),!1}return!n&&!this.getNativeAccountId(e)?(this.logger.trace("canUsePlatformBroker: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const n=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return n&&n.nativeAccountId||""}createPopupClient(e){return new y1(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.platformAuthProvider,e)}createRedirectClient(e){return new b1(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.platformAuthProvider,e)}createSilentIframeClient(e){return new E1(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,xt.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.platformAuthProvider,e)}createSilentCacheClient(e){return new qx(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.platformAuthProvider,e)}createSilentRefreshClient(e){return new A1(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.platformAuthProvider,e)}createSilentAuthCodeClient(e){return new P1(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,xt.acquireTokenByCode,this.performanceClient,this.platformAuthProvider,e)}addEventCallback(e,n){return this.eventHandler.addEventCallback(e,n)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return Ix(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){if(this.config.cache.cacheLocation!==Hn.LocalStorage){this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");return}this.eventHandler.subscribeCrossTab()}disableAccountStorageEvents(){if(this.config.cache.cacheLocation!==Hn.LocalStorage){this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");return}this.eventHandler.unsubscribeCrossTab()}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,n){this.browserStorage.setWrapperMetadata(e,n)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?zo():ve.EMPTY_STRING}async loginRedirect(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",n),this.acquireTokenRedirect({correlationId:n,...e||hx})}loginPopup(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",n),this.acquireTokenPopup({correlationId:n,...e||hx})}async acquireTokenSilent(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(H.AcquireTokenSilent,n);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),Xu(this.initialized,r,e.account),this.logger.verbose("acquireTokenSilent called",n);const o=e.account||this.getActiveAccount();if(!o)throw Be(qC);return this.acquireTokenSilentDeduped(e,o,n).then(i=>(r.end({success:!0,fromCache:i.fromCache,accessTokenSize:i.accessToken.length,idTokenSize:i.idToken.length},void 0,i.account),{...i,state:e.state,correlationId:n})).catch(i=>{throw i instanceof jt&&i.setCorrelationId(n),r.end({success:!1},i,o),i})}async acquireTokenSilentDeduped(e,n,r){const o=Iu(this.config.auth.clientId,{...e,authority:e.authority||this.config.auth.authority},n.homeAccountId),i=JSON.stringify(o),a=this.activeSilentTokenRequests.get(i);if(typeof a>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",r),this.performanceClient.addFields({deduped:!1},r);const c=he(this.acquireTokenSilentAsync.bind(this),H.AcquireTokenSilentAsync,this.logger,this.performanceClient,r)({...e,correlationId:r},n);return this.activeSilentTokenRequests.set(i,c),c.finally(()=>{this.activeSilentTokenRequests.delete(i)})}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",r),this.performanceClient.addFields({deduped:!0},r),a}async acquireTokenSilentAsync(e,n){const r=c=>this.trackStateChange(e.correlationId,c);this.performanceClient.addQueueMeasurement(H.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(et.ACQUIRE_TOKEN_START,Ze.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0,onlineStatusChangeCount:0},e.correlationId),this.addStateChangeListeners(r);const o=await he(ZN,H.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,n,this.config,this.performanceClient,this.logger),i=e.cacheLookupPolicy||hr.Default;return this.acquireTokenSilentNoIframe(o,i).catch(async c=>{if(N1(c,i)){const h=`${c.errorCode}${c.subError?`|${c.subError}`:""}`;if(this.performanceClient.addFields({silentRefreshReason:h},o.correlationId),this.activeIframeRequest)if(i!==hr.Skip){const[p,g]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${g}`,o.correlationId);const v=this.performanceClient.startMeasurement(H.AwaitConcurrentIframe,o.correlationId);v.add({awaitIframeCorrelationId:g});const m=await p;if(v.end({success:m}),m)return this.logger.verbose(`Parallel iframe request with correlationId: ${g} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,i);throw this.logger.info(`Iframe request with correlationId: ${g} failed. Interaction is required.`),c}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),he(this.acquireTokenBySilentIframe.bind(this),H.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o);else{let p;return this.activeIframeRequest=[new Promise(g=>{p=g}),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),he(this.acquireTokenBySilentIframe.bind(this),H.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then(g=>(p(!0),g)).catch(g=>{throw p(!1),g}).finally(()=>{this.activeIframeRequest=void 0})}}else throw c}).then(c=>(this.eventHandler.emitEvent(et.ACQUIRE_TOKEN_SUCCESS,Ze.Silent,c),this.performanceClient.addFields({fromCache:c.fromCache},e.correlationId),c)).catch(c=>{throw this.eventHandler.emitEvent(et.ACQUIRE_TOKEN_FAILURE,Ze.Silent,null,c),c}).finally(()=>{this.removeStateChangeListeners(r)})}async acquireTokenSilentNoIframe(e,n){return Ol(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.performanceClient.addFields({isPlatformBrokerRequest:!0},e.correlationId),this.acquireTokenNative(e,xt.acquireTokenSilent_silentFlow,e.account.nativeAccountId,n).catch(async r=>{throw this.performanceClient.addFields({brokerErrorName:r.name,brokerErrorCode:r.errorCode},e.correlationId),r instanceof Vo&&cc(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.platformAuthProvider=void 0,Ae(Zi)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),n===hr.AccessToken&&this.logger.verbose("acquireTokenSilent - cache lookup policy set to AccessToken, attempting to acquire token from local cache"),he(this.acquireTokenFromCache.bind(this),H.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,n).catch(r=>{if(n===hr.AccessToken)throw r;return this.eventHandler.emitEvent(et.ACQUIRE_TOKEN_NETWORK_START,Ze.Silent,e),he(this.acquireTokenByRefreshToken.bind(this),H.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,n)}))}async preGeneratePkceCodes(e){return this.logger.verbose("Generating new PKCE codes"),this.pkceCode=await he(as,H.GeneratePkceCodes,this.logger,this.performanceClient,e)(this.performanceClient,this.logger,e),Promise.resolve()}getPreGeneratedPkceCodes(e){this.logger.verbose("Attempting to pick up pre-generated PKCE codes");const n=this.pkceCode?{...this.pkceCode}:void 0;return this.pkceCode=void 0,this.logger.verbose(`${n?"Found":"Did not find"} pre-generated PKCE codes`),this.performanceClient.addFields({usePreGeneratedPkce:!!n},e),n}logMultipleInstances(e){const n=this.config.auth.clientId;if(!window)return;window.msal=window.msal||{},window.msal.clientIds=window.msal.clientIds||[],window.msal.clientIds.length>0&&this.logger.verbose("There is already an instance of MSAL.js in the window."),window.msal.clientIds.push(n),O1(n,e,this.logger)}}function N1(t,e){const n=!(t instanceof wo&&t.subError!==Ou),r=t.errorCode===Pr.INVALID_GRANT_ERROR||t.errorCode===Zi,o=n&&r||t.errorCode===Pu||t.errorCode===sg,i=cN.includes(e);return o&&i}/*! @azure/msal-browser v4.30.0 2026-03-18 */async function D1(t,e){const n=new Ys(t);return await n.initialize(),Zu.createController(n,e)}/*! @azure/msal-browser v4.30.0 2026-03-18 */class Gg{static async createPublicClientApplication(e){const n=await D1(e);return new Gg(e,n)}constructor(e,n){this.isBroker=!1,this.controller=n||new Zu(new Ys(e))}async initialize(e){return this.controller.initialize(e,this.isBroker)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,n){return this.controller.addEventCallback(e,n)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,n){return this.controller.initializeWrapperLibrary(e,n)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,n){return this.controller.hydrateCache(e,n)}clearCache(e){return this.controller.clearCache(e)}}function M1({title:t,titleId:e,...n},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?S.createElement("title",{id:e},t):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const R1=S.forwardRef(M1);function L1({title:t,titleId:e,...n},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?S.createElement("title",{id:e},t):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const jg=S.forwardRef(L1);function F1({title:t,titleId:e,...n},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?S.createElement("title",{id:e},t):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"}))}const Wg=S.forwardRef(F1);function $1({title:t,titleId:e,...n},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?S.createElement("title",{id:e},t):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"}))}const U1=S.forwardRef($1);function H1({title:t,titleId:e,...n},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?S.createElement("title",{id:e},t):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const B1=S.forwardRef(H1);function z1({title:t,titleId:e,...n},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?S.createElement("title",{id:e},t):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const cs=S.forwardRef(z1);function V1({title:t,titleId:e,...n},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?S.createElement("title",{id:e},t):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const K1=S.forwardRef(V1);function G1({title:t,titleId:e,...n},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?S.createElement("title",{id:e},t):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))}const j1=S.forwardRef(G1);function W1({title:t,titleId:e,...n},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?S.createElement("title",{id:e},t):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const q1=S.forwardRef(W1);function Y1({title:t,titleId:e,...n},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?S.createElement("title",{id:e},t):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z"}))}const qg=S.forwardRef(Y1);function Q1({title:t,titleId:e,...n},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?S.createElement("title",{id:e},t):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z"}))}const J1=S.forwardRef(Q1);function X1({title:t,titleId:e,...n},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?S.createElement("title",{id:e},t):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const dc=S.forwardRef(X1);var Z1=Object.defineProperty,uc=(t,e)=>Z1(t,"name",{value:e,configurable:!0}),Zx=!!(typeof window<"u"&&window.document&&window.document.createElement);function nt(t,e,{checkForDefaultPrevented:n=!0}={}){return uc(function(o){if(t==null||t(o),n===!1||!o||!o.defaultPrevented)return e==null?void 0:e(o)},"handleEvent")}uc(nt,"composeEventHandlers");function eD(t){var e;if(!Zx)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}uc(eD,"getOwnerWindow");function Yg(t){if(!Zx)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}uc(Yg,"getOwnerDocument");function e_(t,e=!1){const{activeElement:n}=Yg(t);if(!(n!=null&&n.nodeName))return null;if(t_(n)&&n.contentDocument)return e_(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const o=Yg(n).getElementById(r);if(o)return o}}return n}uc(e_,"getActiveElement");function t_(t){return t.tagName==="IFRAME"}uc(t_,"isFrame");var tD=Object.defineProperty,Qg=(t,e)=>tD(t,"name",{value:e,configurable:!0});function Jg(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Qg(Jg,"setRef");function n_(...t){return e=>{let n=!1;const r=t.map(o=>{const i=Jg(o,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Jg(t[o],null)}}}}Qg(n_,"composeRefs");function Rt(...t){return S.useCallback(n_(...t),t)}Qg(Rt,"useComposedRefs");var nD=Object.defineProperty,oo=(t,e)=>nD(t,"name",{value:e,configurable:!0});function rD(t,e){const n=S.createContext(e);n.displayName=t+"Context";const r=oo(i=>{const{children:a,...c}=i,u=S.useMemo(()=>c,Object.values(c));return d.jsx(n.Provider,{value:u,children:a})},"Provider");r.displayName=t+"Provider";function o(i,a={}){const{optional:c=!1}=a,u=S.useContext(n);if(u)return u;if(e!==void 0)return e;if(!c)throw new Error(`\`${i}\` must be used within \`${t}\``)}return oo(o,"useContext"),[r,o]}oo(rD,"createContext");function Co(t,e=[]){let n=[];function r(i,a){const c=S.createContext(a);c.displayName=i+"Context";const u=n.length;n=[...n,a];const h=oo(g=>{var _;const{scope:v,children:m,...C}=g,b=((_=v==null?void 0:v[t])==null?void 0:_[u])||c,w=S.useMemo(()=>C,Object.values(C));return d.jsx(b.Provider,{value:w,children:m})},"Provider");h.displayName=i+"Provider";function p(g,v,m={}){var _;const{optional:C=!1}=m,b=((_=v==null?void 0:v[t])==null?void 0:_[u])||c,w=S.useContext(b);if(w)return w;if(a!==void 0)return a;if(!C)throw new Error(`\`${g}\` must be used within \`${i}\``)}return oo(p,"useContext"),[h,p]}oo(r,"createContext");const o=oo(()=>{const i=n.map(a=>S.createContext(a));return oo(function(c){const u=(c==null?void 0:c[t])||i;return S.useMemo(()=>({[`__scope${t}`]:{...c,[t]:u}}),[c,u])},"useScope")},"createScope");return o.scopeName=t,[r,r_(o,...e)]}oo(Co,"createContextScope");function r_(...t){const e=t[0];if(t.length===1)return e;const n=oo(()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return oo(function(i){const a=r.reduce((c,{useScope:u,scopeName:h})=>{const g=u(i)[`__scope${h}`];return{...c,...g}},{});return S.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}oo(r_,"composeContextScopes");var Tn=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},oD=Object.defineProperty,iD=(t,e)=>oD(t,"name",{value:e,configurable:!0}),sD=S[" useId ".trim().toString()]||(()=>{}),aD=0;function fi(t){const[e,n]=S.useState(sD());return Tn(()=>{t||n(r=>r??String(aD++))},[t]),t||(e?`radix-${e}`:"")}iD(fi,"useId");var cD=Object.defineProperty,lD=(t,e)=>cD(t,"name",{value:e,configurable:!0}),o_=S[" useEffectEvent ".trim().toString()],i_=S[" useInsertionEffect ".trim().toString()];function s_(t){if(typeof o_=="function")return o_(t);const e=S.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof i_=="function"?i_(()=>{e.current=t}):Tn(()=>{e.current=t}),S.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}lD(s_,"useEffectEvent");var dD=Object.defineProperty,Nl=(t,e)=>dD(t,"name",{value:e,configurable:!0}),uD=S[" useInsertionEffect ".trim().toString()]||Tn;function hi({prop:t,defaultProp:e,onChange:n=Nl(()=>{},"onChange"),caller:r}){const[o,i,a]=a_({defaultProp:e,onChange:n}),c=t!==void 0,u=c?t:o,h=S.useCallback(p=>{var g;if(c){const v=c_(p)?p(t):p;v!==t&&((g=a.current)==null||g.call(a,v))}else i(p)},[c,t,i,a]);return[u,h]}Nl(hi,"useControllableState");function a_({defaultProp:t,onChange:e}){const[n,r]=S.useState(t),o=S.useRef(n),i=S.useRef(e);return uD(()=>{i.current=e},[e]),S.useEffect(()=>{var a;o.current!==n&&((a=i.current)==null||a.call(i,n),o.current=n)},[n,o]),[n,r,i]}Nl(a_,"useUncontrolledState");function c_(t){return typeof t=="function"}Nl(c_,"isFunction");var l_=Symbol("RADIX:SYNC_STATE");function fD(t,e,n,r){const{prop:o,defaultProp:i,onChange:a,caller:c}=e,u=o!==void 0,h=s_(a),p=[{...n,state:i}];r&&p.push(r);const[g,v]=S.useReducer((w,_)=>{if(_.type===l_)return{...w,state:_.state};const E=t(w,_);return u&&!Object.is(E.state,w.state)&&h(E.state),E},...p),m=g.state,C=S.useRef(m);S.useEffect(()=>{C.current!==m&&(C.current=m,u||h(m))},[m,C,u]);const b=S.useMemo(()=>o!==void 0?{...g,state:o}:g,[g,o]);return S.useEffect(()=>{u&&!Object.is(o,g.state)&&v({type:l_,state:o})},[o,g.state,u]),[b,v]}Nl(fD,"useControllableStateReducer");var hD=Object.defineProperty,xo=(t,e)=>hD(t,"name",{value:e,configurable:!0});function pi(t){const e=S.forwardRef((n,r)=>{let{children:o,...i}=n,a=null,c=!1;const u=[];Xg(o)&&typeof ef=="function"&&(o=ef(o._payload)),S.Children.forEach(o,v=>{var m;if(g_(v)){c=!0;const C=v;let b="child"in C.props?C.props.child:C.props.children;Xg(b)&&typeof ef=="function"&&(b=ef(b._payload)),a=pD(C,b),u.push((m=a==null?void 0:a.props)==null?void 0:m.children)}else u.push(v)}),a?a=S.cloneElement(a,void 0,u):!c&&S.Children.count(o)===1&&S.isValidElement(o)&&(a=o);const h=a?p_(a):void 0,p=Rt(r,h);if(!a){if(o||o===0)throw new Error(c?vD(t):mD(t));return o}const g=h_(i,a.props??{});return a.type!==S.Fragment&&(g.ref=r?p:h),S.cloneElement(a,g)});return e.displayName=`${t}.Slot`,e}xo(pi,"createSlot");var d_=pi("Slot"),u_=Symbol.for("radix.slottable");function f_(t){const e=xo(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=u_,e}xo(f_,"createSlottable");var pD=xo((t,e)=>{if("child"in t.props){const n=t.props.child;return S.isValidElement(n)?S.cloneElement(n,void 0,t.props.children(n.props.children)):null}return S.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function h_(t,e){const n={...e};for(const r in e){const o=t[r],i=e[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const u=i(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...t,...n}}xo(h_,"mergeProps");function p_(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}xo(p_,"getElementRef");function g_(t){return S.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===u_}xo(g_,"isSlottable");var gD=Symbol.for("react.lazy");function Xg(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===gD&&"_payload"in t&&m_(t._payload)}xo(Xg,"isLazyComponent");function m_(t){return typeof t=="object"&&t!==null&&"then"in t}xo(m_,"isPromiseLike");var mD=xo(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),vD=xo(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ef=S[" use ".trim().toString()],yD=Object.defineProperty,wD=(t,e)=>yD(t,"name",{value:e,configurable:!0}),bD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pt=bD.reduce((t,e)=>{const n=pi(`Primitive.${e}`),r=S.forwardRef((o,i)=>{const{asChild:a,...c}=o,u=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...c,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Zg(t,e){t&&ja.flushSync(()=>t.dispatchEvent(e))}wD(Zg,"dispatchDiscreteCustomEvent");var CD=Object.defineProperty,xD=(t,e)=>CD(t,"name",{value:e,configurable:!0});function gr(t){const e=S.useRef(t);return S.useEffect(()=>{e.current=t}),S.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}xD(gr,"useCallbackRef");var _D=Object.defineProperty,On=(t,e)=>_D(t,"name",{value:e,configurable:!0}),em="dismissableLayer.update",SD="dismissableLayer.pointerDownOutside",TD="dismissableLayer.focusOutside",v_,tm=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),tf=S.forwardRef(On(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:u,onDismiss:h,...p}=e,g=S.useContext(tm),[v,m]=S.useState(null),C=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=S.useState({}),w=Rt(n,m),_=Array.from(g.layers),[E]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),I=E?_.indexOf(E):-1,k=v?_.indexOf(v):-1,A=g.layersWithOutsidePointerEventsDisabled.size>0,M=k>=I,B=S.useRef(!1),W=w_(ne=>{a==null||a(ne),u==null||u(ne),ne.defaultPrevented||h==null||h()},{ownerDocument:C,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:B,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:S.useCallback(ne=>{if(!(ne instanceof Node))return!1;const ae=[...g.branches].some(Q=>Q.contains(ne));return M&&!ae},[g.branches,M])}),Y=b_(ne=>{if(o&&B.current)return;const ae=ne.target;[...g.branches].some(re=>re.contains(ae))||(c==null||c(ne),u==null||u(ne),ne.defaultPrevented||h==null||h())},C),z=v?k===_.length-1:!1,de=gr(ne=>{ne.key==="Escape"&&(i==null||i(ne),!ne.defaultPrevented&&h&&(ne.preventDefault(),h()))});return S.useEffect(()=>{if(z)return C.addEventListener("keydown",de,{capture:!0}),()=>C.removeEventListener("keydown",de,{capture:!0})},[C,z,de]),S.useEffect(()=>{if(v)return r&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(v_=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(v)),g.layers.add(v),nm(),()=>{r&&(g.layersWithOutsidePointerEventsDisabled.delete(v),g.layersWithOutsidePointerEventsDisabled.size===0&&(C.body.style.pointerEvents=v_))}},[v,C,r,g]),S.useEffect(()=>()=>{v&&(g.layers.delete(v),g.layersWithOutsidePointerEventsDisabled.delete(v),nm())},[v,g]),S.useEffect(()=>{const ne=On(()=>b({}),"handleUpdate");return document.addEventListener(em,ne),()=>document.removeEventListener(em,ne)},[]),d.jsx(pt.div,{...p,ref:w,style:{pointerEvents:A?M?"auto":"none":void 0,...e.style},onFocusCapture:nt(e.onFocusCapture,Y.onFocusCapture),onBlurCapture:nt(e.onBlurCapture,Y.onBlurCapture),onPointerDownCapture:nt(e.onPointerDownCapture,W.onPointerDownCapture)})},"DismissableLayer")),ED=S.forwardRef(On(function(e,n){const r=S.useContext(tm),o=S.useRef(null),i=Rt(n,o);return S.useEffect(()=>{const a=o.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),d.jsx(pt.div,{...e,ref:i})},"DismissableLayerBranch"));function y_(){const t=S.useContext(tm),[e,n]=S.useState(null);return S.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}On(y_,"useDismissableLayerSurface");var AD=On(()=>!0,"IS_TRUE");function w_(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:i,shouldHandlePointerDownOutside:a=AD}=e,c=gr(t),u=S.useRef(!1),h=S.useRef(!1),p=S.useRef(new Map),g=S.useRef(()=>{});return S.useEffect(()=>{function v(){h.current=!1,o.current=!1,p.current.clear()}On(v,"resetOutsideInteraction");function m(){return Array.from(p.current.values()).some(Boolean)}On(m,"isOutsideInteractionIntercepted");function C(I){if(!h.current)return;const k=I.target;k instanceof Node&&[...i].some(M=>M.contains(k))||p.current.set(I.type,!0),I.type==="click"&&window.setTimeout(()=>{h.current&&g.current()},0)}On(C,"handleInteractionCapture");function b(I){h.current&&p.current.set(I.type,!1)}On(b,"handleInteractionBubble");const w=On(I=>{if(I.target&&!u.current){let k=function(){n.removeEventListener("click",g.current);const M=m();v(),M||rm(SD,c,A,{discrete:!0})};if(On(k,"handleAndDispatchPointerDownOutsideEvent"),!a(I.target)){n.removeEventListener("click",g.current),v(),u.current=!1;return}const A={originalEvent:I};h.current=!0,o.current=r&&I.button===0,p.current.clear(),!r||I.button!==0?k():(n.removeEventListener("click",g.current),g.current=k,n.addEventListener("click",g.current,{once:!0}))}else n.removeEventListener("click",g.current),v();u.current=!1},"handlePointerDown"),_=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const I of _)n.addEventListener(I,C,!0),n.addEventListener(I,b);const E=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(E),n.removeEventListener("pointerdown",w),n.removeEventListener("click",g.current);for(const I of _)n.removeEventListener(I,C,!0),n.removeEventListener(I,b)}},[n,c,r,o,i,a]),{onPointerDownCapture:On(()=>u.current=!0,"onPointerDownCapture")}}On(w_,"usePointerDownOutside");function b_(t,e=globalThis==null?void 0:globalThis.document){const n=gr(t),r=S.useRef(!1);return S.useEffect(()=>{const o=On(i=>{i.target&&!r.current&&rm(TD,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:On(()=>r.current=!0,"onFocusCapture"),onBlurCapture:On(()=>r.current=!1,"onBlurCapture")}}On(b_,"useFocusOutside");function nm(){const t=new CustomEvent(em);document.dispatchEvent(t)}On(nm,"dispatchUpdate");function rm(t,e,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?Zg(o,i):o.dispatchEvent(i)}On(rm,"handleAndDispatchCustomEvent");var ID=tf,kD=ED,PD=Object.defineProperty,mr=(t,e)=>PD(t,"name",{value:e,configurable:!0}),om="focusScope.autoFocusOnMount",im="focusScope.autoFocusOnUnmount",C_={bubbles:!1,cancelable:!0},x_=S.forwardRef(mr(function(e,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...c}=e,[u,h]=S.useState(null),p=gr(i),g=gr(a),v=S.useRef(null),m=Rt(n,h),C=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(o){let w=function(k){if(C.paused||!u)return;const A=k.target;u.contains(A)?v.current=A:gi(v.current,{select:!0})},_=function(k){if(C.paused||!u)return;const A=k.relatedTarget;A!==null&&(u.contains(A)||gi(v.current,{select:!0}))},E=function(k){if(document.activeElement===document.body)for(const M of k)M.removedNodes.length>0&&gi(u)};mr(w,"handleFocusIn"),mr(_,"handleFocusOut"),mr(E,"handleMutations"),document.addEventListener("focusin",w),document.addEventListener("focusout",_);const I=new MutationObserver(E);return u&&I.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",_),I.disconnect()}}},[o,u,C.paused]),S.useEffect(()=>{if(u){A_.add(C);const w=document.activeElement;if(!u.contains(w)){const E=new CustomEvent(om,C_);u.addEventListener(om,p),u.dispatchEvent(E),E.defaultPrevented||(__(k_(sm(u)),{select:!0}),document.activeElement===w&&gi(u))}return()=>{u.removeEventListener(om,p),setTimeout(()=>{const E=new CustomEvent(im,C_);u.addEventListener(im,g),u.dispatchEvent(E),E.defaultPrevented||gi(w??document.body,{select:!0}),u.removeEventListener(im,g),A_.remove(C)},0)}}},[u,p,g,C]);const b=S.useCallback(w=>{if(!r&&!o||C.paused)return;const _=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(_&&E){const I=w.currentTarget,[k,A]=S_(I);k&&A?!w.shiftKey&&E===A?(w.preventDefault(),r&&gi(k,{select:!0})):w.shiftKey&&E===k&&(w.preventDefault(),r&&gi(A,{select:!0})):E===I&&w.preventDefault()}},[r,o,C.paused]);return d.jsx(pt.div,{tabIndex:-1,...c,ref:m,onKeyDown:b})},"FocusScope"));function __(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(gi(r,{select:e}),document.activeElement!==n)return}mr(__,"focusFirst");function S_(t){const e=sm(t),n=am(e,t),r=am(e.reverse(),t);return[n,r]}mr(S_,"getTabbableEdges");function sm(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:mr(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}mr(sm,"getTabbableCandidates");function am(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):T_(r,{upTo:e})))return r}mr(am,"findVisible");function T_(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}mr(T_,"isHidden");function E_(t){return t instanceof HTMLInputElement&&"select"in t}mr(E_,"isSelectableInput");function gi(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&E_(t)&&e&&t.select()}}mr(gi,"focus");var A_=I_();function I_(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=cm(t,e),t.unshift(e)},remove(e){var n;t=cm(t,e),(n=t[0])==null||n.resume()}}}mr(I_,"createFocusScopesStack");function cm(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}mr(cm,"arrayRemove");function k_(t){return t.filter(e=>e.tagName!=="A")}mr(k_,"removeLinks");var OD=Object.defineProperty,ND=(t,e)=>OD(t,"name",{value:e,configurable:!0}),nf=S.forwardRef(ND(function(e,n){var u;const{container:r,...o}=e,[i,a]=S.useState(!1);Tn(()=>a(!0),[]);const c=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?ja.createPortal(d.jsx(pt.div,{...o,ref:n}),c):null},"Portal")),DD=Object.defineProperty,mi=(t,e)=>DD(t,"name",{value:e,configurable:!0});function P_(t,e){return S.useReducer((n,r)=>e[n][r]??n,t)}mi(P_,"useStateMachine");var vi=mi(t=>{const{present:e,children:n}=t,r=O_(e),o=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=N_(r.ref,D_(o));return typeof n=="function"||r.isPresent?S.cloneElement(o,{ref:i}):null},"Presence");function O_(t){const[e,n]=S.useState(),r=S.useRef(null),o=S.useRef(t),i=S.useRef("none"),a=S.useRef(void 0),c=t?"mounted":"unmounted",[u,h]=P_(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{u==="mounted"?(i.current=a.current??fc(r.current),a.current=void 0):i.current="none"},[u]),Tn(()=>{const p=r.current,g=o.current;if(g!==t){const m=i.current,C=fc(p);t?(a.current=C,h("MOUNT")):C==="none"||(p==null?void 0:p.display)==="none"?h("UNMOUNT"):h(g&&m!==C?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,h]),Tn(()=>{if(e){let p;const g=e.ownerDocument.defaultView??window,v=mi(C=>{const w=fc(r.current).includes(CSS.escape(C.animationName));if(C.target===e&&w&&(h("ANIMATION_END"),!o.current)){const _=e.style.animationFillMode;e.style.animationFillMode="forwards",p=g.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=_)})}},"handleAnimationEnd"),m=mi(C=>{C.target===e&&(i.current=fc(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",v),e.addEventListener("animationend",v),()=>{g.clearTimeout(p),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",v),e.removeEventListener("animationend",v)}}else h("ANIMATION_END")},[e,h]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:S.useCallback(p=>{if(p){const g=getComputedStyle(p);r.current=g,a.current=fc(g)}else r.current=null;n(p)},[])}}mi(O_,"usePresence");function lm(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}mi(lm,"setRef");function N_(...t){const e=S.useRef(t);return e.current=t,S.useCallback(n=>{const r=e.current;let o=!1;const i=r.map(a=>{const c=lm(a,n);return!o&&typeof c=="function"&&(o=!0),c});if(o)return()=>{for(let a=0;a<i.length;a++){const c=i[a];typeof c=="function"?c():lm(r[a],null)}}},[])}mi(N_,"useStableComposedRefs");function fc(t){return(t==null?void 0:t.animationName)||"none"}mi(fc,"getAnimationName");function D_(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}mi(D_,"getElementRef");var MD=Object.defineProperty,dm=(t,e)=>MD(t,"name",{value:e,configurable:!0}),rf=0,Ko=null;function RD(t){return of(),t.children}dm(RD,"FocusGuards");function of(){S.useEffect(()=>{Ko||(Ko={start:um(),end:um()});const{start:t,end:e}=Ko;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),rf++,()=>{rf===1&&(Ko==null||Ko.start.remove(),Ko==null||Ko.end.remove(),Ko=null),rf=Math.max(0,rf-1)}},[])}dm(of,"useFocusGuards");function um(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}dm(um,"createFocusGuard");var Go=function(){return Go=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Go.apply(this,arguments)};function M_(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 o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function Qs(t,e,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function c(p){try{h(r.next(p))}catch(g){a(g)}}function u(p){try{h(r.throw(p))}catch(g){a(g)}}function h(p){p.done?i(p.value):o(p.value).then(c,u)}h((r=r.apply(t,e||[])).next())})}function R_(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(c){a={error:c}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return i}function L_(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var sf="right-scroll-bar-position",af="width-before-scroll-bar",LD="with-scroll-bars-hidden",FD="--removed-body-scroll-bar-size";function fm(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function $D(t,e){var n=D.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var UD=typeof window<"u"?S.useLayoutEffect:S.useEffect,F_=new WeakMap;function HD(t,e){var n=$D(null,function(r){return t.forEach(function(o){return fm(o,r)})});return UD(function(){var r=F_.get(n);if(r){var o=new Set(r),i=new Set(t),a=n.current;o.forEach(function(c){i.has(c)||fm(c,null)}),i.forEach(function(c){o.has(c)||fm(c,a)})}F_.set(n,t)},[t]),n}function BD(t){return t}function zD(t,e){e===void 0&&(e=BD);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var a=e(i,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(i),a=n}var u=function(){var p=a;a=[],p.forEach(i)},h=function(){return Promise.resolve().then(u)};h(),n={push:function(p){a.push(p),h()},filter:function(p){return a=a.filter(p),n}}}};return o}function VD(t){t===void 0&&(t={});var e=zD(null);return e.options=Go({async:!0,ssr:!1},t),e}var $_=function(t){var e=t.sideCar,n=M_(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return S.createElement(r,Go({},n))};$_.isSideCarExport=!0;function KD(t,e){return t.useMedium(e),$_}var U_=VD(),hm=function(){},cf=S.forwardRef(function(t,e){var n=S.useRef(null),r=S.useState({onScrollCapture:hm,onWheelCapture:hm,onTouchMoveCapture:hm}),o=r[0],i=r[1],a=t.forwardProps,c=t.children,u=t.className,h=t.removeScrollBar,p=t.enabled,g=t.shards,v=t.sideCar,m=t.noRelative,C=t.noIsolation,b=t.inert,w=t.allowPinchZoom,_=t.as,E=_===void 0?"div":_,I=t.gapMode,k=M_(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=v,M=HD([n,e]),B=Go(Go({},k),o);return S.createElement(S.Fragment,null,p&&S.createElement(A,{sideCar:U_,removeScrollBar:h,shards:g,noRelative:m,noIsolation:C,inert:b,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:I}),a?S.cloneElement(S.Children.only(c),Go(Go({},B),{ref:M})):S.createElement(E,Go({},B,{className:u,ref:M}),c))});cf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},cf.classNames={fullWidth:af,zeroRight:sf};var GD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jD(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=GD();return e&&t.setAttribute("nonce",e),t}function WD(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function qD(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var YD=function(){var t=0,e=null;return{add:function(n){t==0&&(e=jD())&&(WD(e,n),qD(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},QD=function(){var t=YD();return function(e,n){S.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},H_=function(){var t=QD(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},JD={left:0,top:0,right:0,gap:0},pm=function(t){return parseInt(t||"",10)||0},XD=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[pm(n),pm(r),pm(o)]},ZD=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return JD;var e=XD(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},eM=H_(),hc="data-scroll-locked",tM=function(t,e,n,r){var o=t.left,i=t.top,a=t.right,c=t.gap;return n===void 0&&(n="margin"),`
|
|
8
|
+
.`.concat(LD,` {
|
|
9
|
+
overflow: hidden `).concat(r,`;
|
|
10
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
11
|
+
}
|
|
12
|
+
body[`).concat(hc,`] {
|
|
13
|
+
overflow: hidden `).concat(r,`;
|
|
14
|
+
overscroll-behavior: contain;
|
|
15
|
+
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
16
|
+
padding-left: `.concat(o,`px;
|
|
17
|
+
padding-top: `).concat(i,`px;
|
|
18
|
+
padding-right: `).concat(a,`px;
|
|
19
|
+
margin-left:0;
|
|
20
|
+
margin-top:0;
|
|
21
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
22
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.`).concat(sf,` {
|
|
26
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.`).concat(af,` {
|
|
30
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.`).concat(sf," .").concat(sf,` {
|
|
34
|
+
right: 0 `).concat(r,`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.`).concat(af," .").concat(af,` {
|
|
38
|
+
margin-right: 0 `).concat(r,`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
body[`).concat(hc,`] {
|
|
42
|
+
`).concat(FD,": ").concat(c,`px;
|
|
43
|
+
}
|
|
44
|
+
`)},B_=function(){var t=parseInt(document.body.getAttribute(hc)||"0",10);return isFinite(t)?t:0},nM=function(){S.useEffect(function(){return document.body.setAttribute(hc,(B_()+1).toString()),function(){var t=B_()-1;t<=0?document.body.removeAttribute(hc):document.body.setAttribute(hc,t.toString())}},[])},rM=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;nM();var i=S.useMemo(function(){return ZD(o)},[o]);return S.createElement(eM,{styles:tM(i,!e,o,n?"":"!important")})},gm=!1;if(typeof window<"u")try{var lf=Object.defineProperty({},"passive",{get:function(){return gm=!0,!0}});window.addEventListener("test",lf,lf),window.removeEventListener("test",lf,lf)}catch{gm=!1}var pc=gm?{passive:!1}:!1,oM=function(t){return t.tagName==="TEXTAREA"},z_=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!oM(t)&&n[e]==="visible")},iM=function(t){return z_(t,"overflowY")},sM=function(t){return z_(t,"overflowX")},V_=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=K_(t,r);if(o){var i=G_(t,r),a=i[1],c=i[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},aM=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},cM=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},K_=function(t,e){return t==="v"?iM(e):sM(e)},G_=function(t,e){return t==="v"?aM(e):cM(e)},lM=function(t,e){return t==="h"&&e==="rtl"?-1:1},dM=function(t,e,n,r,o){var i=lM(t,window.getComputedStyle(e).direction),a=i*r,c=n.target,u=e.contains(c),h=!1,p=a>0,g=0,v=0;do{if(!c)break;var m=G_(t,c),C=m[0],b=m[1],w=m[2],_=b-w-i*C;(C||_)&&K_(t,c)&&(g+=_,v+=C);var E=c.parentNode;c=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!u&&c!==document.body||u&&(e.contains(c)||e===c));return(p&&Math.abs(g)<1||!p&&Math.abs(v)<1)&&(h=!0),h},df=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},j_=function(t){return[t.deltaX,t.deltaY]},W_=function(t){return t&&"current"in t?t.current:t},uM=function(t,e){return t[0]===e[0]&&t[1]===e[1]},fM=function(t){return`
|
|
45
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
46
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
47
|
+
`)},hM=0,gc=[];function pM(t){var e=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),o=S.useState(hM++)[0],i=S.useState(H_)[0],a=S.useRef(t);S.useEffect(function(){a.current=t},[t]),S.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var b=L_([t.lockRef.current],(t.shards||[]).map(W_),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var c=S.useCallback(function(b,w){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!a.current.allowPinchZoom;var _=df(b),E=n.current,I="deltaX"in b?b.deltaX:E[0]-_[0],k="deltaY"in b?b.deltaY:E[1]-_[1],A,M=b.target,B=Math.abs(I)>Math.abs(k)?"h":"v";if("touches"in b&&B==="h"&&M.type==="range")return!1;var W=window.getSelection(),Y=W&&W.anchorNode,z=Y?Y===M||Y.contains(M):!1;if(z)return!1;var de=V_(B,M);if(!de)return!0;if(de?A=B:(A=B==="v"?"h":"v",de=V_(B,M)),!de)return!1;if(!r.current&&"changedTouches"in b&&(I||k)&&(r.current=A),!A)return!0;var ne=r.current||A;return dM(ne,w,b,ne==="h"?I:k)},[]),u=S.useCallback(function(b){var w=b;if(!(!gc.length||gc[gc.length-1]!==i)){var _="deltaY"in w?j_(w):df(w),E=e.current.filter(function(A){return A.name===w.type&&(A.target===w.target||w.target===A.shadowParent)&&uM(A.delta,_)})[0];if(E&&E.should){w.cancelable&&w.preventDefault();return}if(!E){var I=(a.current.shards||[]).map(W_).filter(Boolean).filter(function(A){return A.contains(w.target)}),k=I.length>0?c(w,I[0]):!a.current.noIsolation;k&&w.cancelable&&w.preventDefault()}}},[]),h=S.useCallback(function(b,w,_,E){var I={name:b,delta:w,target:_,should:E,shadowParent:gM(_)};e.current.push(I),setTimeout(function(){e.current=e.current.filter(function(k){return k!==I})},1)},[]),p=S.useCallback(function(b){n.current=df(b),r.current=void 0},[]),g=S.useCallback(function(b){h(b.type,j_(b),b.target,c(b,t.lockRef.current))},[]),v=S.useCallback(function(b){h(b.type,df(b),b.target,c(b,t.lockRef.current))},[]);S.useEffect(function(){return gc.push(i),t.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",u,pc),document.addEventListener("touchmove",u,pc),document.addEventListener("touchstart",p,pc),function(){gc=gc.filter(function(b){return b!==i}),document.removeEventListener("wheel",u,pc),document.removeEventListener("touchmove",u,pc),document.removeEventListener("touchstart",p,pc)}},[]);var m=t.removeScrollBar,C=t.inert;return S.createElement(S.Fragment,null,C?S.createElement(i,{styles:fM(o)}):null,m?S.createElement(rM,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function gM(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const mM=KD(U_,pM);var mm=S.forwardRef(function(t,e){return S.createElement(cf,Go({},t,{ref:e,sideCar:mM}))});mm.classNames=cf.classNames;var vM=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},mc=new WeakMap,uf=new WeakMap,ff={},vm=0,q_=function(t){return t&&(t.host||q_(t.parentNode))},yM=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=q_(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},wM=function(t,e,n,r){var o=yM(e,Array.isArray(t)?t:[t]);ff[n]||(ff[n]=new WeakMap);var i=ff[n],a=[],c=new Set,u=new Set(o),h=function(g){!g||c.has(g)||(c.add(g),h(g.parentNode))};o.forEach(h);var p=function(g){!g||u.has(g)||Array.prototype.forEach.call(g.children,function(v){if(c.has(v))p(v);else try{var m=v.getAttribute(r),C=m!==null&&m!=="false",b=(mc.get(v)||0)+1,w=(i.get(v)||0)+1;mc.set(v,b),i.set(v,w),a.push(v),b===1&&C&&uf.set(v,!0),w===1&&v.setAttribute(n,"true"),C||v.setAttribute(r,"true")}catch(_){console.error("aria-hidden: cannot operate on ",v,_)}})};return p(e),c.clear(),vm++,function(){a.forEach(function(g){var v=mc.get(g)-1,m=i.get(g)-1;mc.set(g,v),i.set(g,m),v||(uf.has(g)||g.removeAttribute(r),uf.delete(g)),m||g.removeAttribute(n)}),vm--,vm||(mc=new WeakMap,mc=new WeakMap,uf=new WeakMap,ff={})}},Y_=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=vM(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),wM(r,o,n,"aria-hidden")):function(){return null}},bM=Object.defineProperty,qr=(t,e)=>bM(t,"name",{value:e,configurable:!0}),ym="Dialog",[Q_,Zj]=Co(ym),[CM,_o]=Q_(ym),ls=qr(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=t,c=S.useRef(null),u=S.useRef(null),[h,p]=hi({prop:r,defaultProp:o??!1,onChange:i,caller:ym}),[g,v]=S.useState(0),[m,C]=S.useState(0);return d.jsx(CM,{scope:e,triggerRef:c,contentRef:u,contentId:fi(),titleId:fi(),descriptionId:fi(),titlePresent:g>0,descriptionPresent:m>0,setTitleCount:v,setDescriptionCount:C,open:h,onOpenChange:p,onOpenToggle:S.useCallback(()=>p(b=>!b),[p]),modal:a,children:n})},"Dialog"),xM="DialogTrigger",_M=S.forwardRef(qr(function(e,n){const{__scopeDialog:r,...o}=e,i=_o(xM,r),a=Rt(n,i.triggerRef);return d.jsx(pt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":hf(i.open),...o,ref:a,onClick:nt(e.onClick,i.onOpenToggle)})},"DialogTrigger")),J_="DialogPortal",[SM,X_]=Q_(J_,{forceMount:void 0}),TM=qr(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,i=_o(J_,e);return d.jsx(SM,{scope:e,forceMount:n,children:S.Children.map(r,a=>d.jsx(vi,{present:n||i.open,children:d.jsx(nf,{asChild:!0,container:o,children:a})}))})},"DialogPortal"),wm="DialogOverlay",yi=S.forwardRef(qr(function(e,n){const r=X_(wm,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,a=_o(wm,e.__scopeDialog);return a.modal?d.jsx(vi,{present:o||a.open,children:d.jsx(AM,{...i,ref:n})}):null},"DialogOverlay")),EM=pi("DialogOverlay.RemoveScroll"),AM=S.forwardRef(qr(function(e,n){const{__scopeDialog:r,...o}=e,i=_o(wm,r),a=y_(),c=Rt(n,a);return d.jsx(mm,{as:EM,allowPinchZoom:!0,shards:[i.contentRef],children:d.jsx(pt.div,{"data-state":hf(i.open),...o,ref:c,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Dl="DialogContent",wi=S.forwardRef(qr(function(e,n){const r=X_(Dl,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,a=_o(Dl,e.__scopeDialog);return d.jsx(vi,{present:o||a.open,children:a.modal?d.jsx(IM,{...i,ref:n}):d.jsx(kM,{...i,ref:n})})},"DialogContent")),IM=S.forwardRef(qr(function(e,n){const r=_o(Dl,e.__scopeDialog),o=S.useRef(null),i=Rt(n,r.contentRef,o);return S.useEffect(()=>{const a=o.current;if(a)return Y_(a)},[]),d.jsx(Z_,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:nt(e.onCloseAutoFocus,a=>{var c;a.preventDefault(),(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:nt(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&a.preventDefault()}),onFocusOutside:nt(e.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),kM=S.forwardRef(qr(function(e,n){const r=_o(Dl,e.__scopeDialog),o=S.useRef(!1),i=S.useRef(!1);return d.jsx(Z_,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,a),a.defaultPrevented||(o.current||(u=r.triggerRef.current)==null||u.focus(),a.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:a=>{var h,p;(h=e.onInteractOutside)==null||h.call(e,a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=a.target;((p=r.triggerRef.current)==null?void 0:p.contains(c))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"DialogContentNonModal")),Z_=S.forwardRef(qr(function(e,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,...c}=e,u=_o(Dl,r);return of(),d.jsx(d.Fragment,{children:d.jsx(x_,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:a,children:d.jsx(tf,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":hf(u.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),PM="DialogTitle",e0=S.forwardRef(qr(function(e,n){const{__scopeDialog:r,...o}=e,i=_o(PM,r),{setTitleCount:a}=i;return Tn(()=>(a(c=>c+1),()=>a(c=>c-1)),[a]),d.jsx(pt.h2,{id:i.titleId,...o,ref:n})},"DialogTitle")),OM="DialogDescription",t0=S.forwardRef(qr(function(e,n){const{__scopeDialog:r,...o}=e,i=_o(OM,r),{setDescriptionCount:a}=i;return Tn(()=>(a(c=>c+1),()=>a(c=>c-1)),[a]),d.jsx(pt.p,{id:i.descriptionId,...o,ref:n})},"DialogDescription")),NM="DialogClose",vc=S.forwardRef(qr(function(e,n){const{__scopeDialog:r,...o}=e,i=_o(NM,r);return d.jsx(pt.button,{type:"button",...o,ref:n,onClick:nt(e.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function hf(t){return t?"open":"closed"}qr(hf,"getState");/**
|
|
48
|
+
* table-core
|
|
49
|
+
*
|
|
50
|
+
* Copyright (c) TanStack
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the MIT license found in the
|
|
53
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
54
|
+
*
|
|
55
|
+
* @license MIT
|
|
56
|
+
*/function ds(t,e){return typeof t=="function"?t(e):t}function Yr(t,e){return n=>{e.setState(r=>({...r,[t]:ds(n,r[t])}))}}function pf(t){return t instanceof Function}function DM(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function MM(t,e){const n=[],r=o=>{o.forEach(i=>{n.push(i);const a=e(i);a!=null&&a.length&&r(a)})};return r(t),n}function it(t,e,n){let r=[],o;return i=>{let a;n.key&&n.debug&&(a=Date.now());const c=t(i);if(!(c.length!==r.length||c.some((p,g)=>r[g]!==p)))return o;r=c;let h;if(n.key&&n.debug&&(h=Date.now()),o=e(...c),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const p=Math.round((Date.now()-a)*100)/100,g=Math.round((Date.now()-h)*100)/100,v=g/16,m=(C,b)=>{for(C=String(C);C.length<b;)C=" "+C;return C};console.info(`%c⏱ ${m(g,5)} /${m(p,5)} ms`,`
|
|
57
|
+
font-size: .6rem;
|
|
58
|
+
font-weight: bold;
|
|
59
|
+
color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function st(t,e,n,r){return{debug:()=>{var o;return(o=t==null?void 0:t.debugAll)!=null?o:t[e]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function RM(t,e,n,r){const o=()=>{var a;return(a=i.getValue())!=null?a:t.options.renderFallbackValue},i={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(r),renderValue:o,getContext:it(()=>[t,n,e,i],(a,c,u,h)=>({table:a,column:c,row:u,cell:h,getValue:h.getValue,renderValue:h.renderValue}),st(t.options,"debugCells","cell.getContext"))};return t._features.forEach(a=>{a.createCell==null||a.createCell(i,n,e,t)},{}),i}function LM(t,e,n,r){var o,i;const c={...t._getDefaultColumnDef(),...e},u=c.accessorKey;let h=(o=(i=c.id)!=null?i:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?o:typeof c.header=="string"?c.header:void 0,p;if(c.accessorFn?p=c.accessorFn:u&&(u.includes(".")?p=v=>{let m=v;for(const b of u.split(".")){var C;m=(C=m)==null?void 0:C[b],process.env.NODE_ENV!=="production"&&m===void 0&&console.warn(`"${b}" in deeply nested key "${u}" returned undefined.`)}return m}:p=v=>v[c.accessorKey]),!h)throw process.env.NODE_ENV!=="production"?new Error(c.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(h)}`,accessorFn:p,parent:r,depth:n,columnDef:c,columns:[],getFlatColumns:it(()=>[!0],()=>{var v;return[g,...(v=g.columns)==null?void 0:v.flatMap(m=>m.getFlatColumns())]},st(t.options,"debugColumns","column.getFlatColumns")),getLeafColumns:it(()=>[t._getOrderColumnsFn()],v=>{var m;if((m=g.columns)!=null&&m.length){let C=g.columns.flatMap(b=>b.getLeafColumns());return v(C)}return[g]},st(t.options,"debugColumns","column.getLeafColumns"))};for(const v of t._features)v.createColumn==null||v.createColumn(g,t);return g}const Xn="debugHeaders";function n0(t,e,n){var r;let i={id:(r=n.id)!=null?r:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],c=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(c),a.push(u)};return c(i),a},getContext:()=>({table:t,header:i,column:e})};return t._features.forEach(a=>{a.createHeader==null||a.createHeader(i,t)}),i}const FM={createTable:t=>{t.getHeaderGroups=it(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,o)=>{var i,a;const c=(i=r==null?void 0:r.map(g=>n.find(v=>v.id===g)).filter(Boolean))!=null?i:[],u=(a=o==null?void 0:o.map(g=>n.find(v=>v.id===g)).filter(Boolean))!=null?a:[],h=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(o!=null&&o.includes(g.id)));return gf(e,[...c,...h,...u],t)},st(t.options,Xn,"getHeaderGroups")),t.getCenterHeaderGroups=it(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),gf(e,n,t,"center")),st(t.options,Xn,"getCenterHeaderGroups")),t.getLeftHeaderGroups=it(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,r)=>{var o;const i=(o=r==null?void 0:r.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?o:[];return gf(e,i,t,"left")},st(t.options,Xn,"getLeftHeaderGroups")),t.getRightHeaderGroups=it(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,r)=>{var o;const i=(o=r==null?void 0:r.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?o:[];return gf(e,i,t,"right")},st(t.options,Xn,"getRightHeaderGroups")),t.getFooterGroups=it(()=>[t.getHeaderGroups()],e=>[...e].reverse(),st(t.options,Xn,"getFooterGroups")),t.getLeftFooterGroups=it(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),st(t.options,Xn,"getLeftFooterGroups")),t.getCenterFooterGroups=it(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),st(t.options,Xn,"getCenterFooterGroups")),t.getRightFooterGroups=it(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),st(t.options,Xn,"getRightFooterGroups")),t.getFlatHeaders=it(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),st(t.options,Xn,"getFlatHeaders")),t.getLeftFlatHeaders=it(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),st(t.options,Xn,"getLeftFlatHeaders")),t.getCenterFlatHeaders=it(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),st(t.options,Xn,"getCenterFlatHeaders")),t.getRightFlatHeaders=it(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),st(t.options,Xn,"getRightFlatHeaders")),t.getCenterLeafHeaders=it(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),st(t.options,Xn,"getCenterLeafHeaders")),t.getLeftLeafHeaders=it(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),st(t.options,Xn,"getLeftLeafHeaders")),t.getRightLeafHeaders=it(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),st(t.options,Xn,"getRightLeafHeaders")),t.getLeafHeaders=it(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,r)=>{var o,i,a,c,u,h;return[...(o=(i=e[0])==null?void 0:i.headers)!=null?o:[],...(a=(c=n[0])==null?void 0:c.headers)!=null?a:[],...(u=(h=r[0])==null?void 0:h.headers)!=null?u:[]].map(p=>p.getLeafHeaders()).flat()},st(t.options,Xn,"getLeafHeaders"))}};function gf(t,e,n,r){var o,i;let a=0;const c=function(v,m){m===void 0&&(m=1),a=Math.max(a,m),v.filter(C=>C.getIsVisible()).forEach(C=>{var b;(b=C.columns)!=null&&b.length&&c(C.columns,m+1)},0)};c(t);let u=[];const h=(v,m)=>{const C={depth:m,id:[r,`${m}`].filter(Boolean).join("_"),headers:[]},b=[];v.forEach(w=>{const _=[...b].reverse()[0],E=w.column.depth===C.depth;let I,k=!1;if(E&&w.column.parent?I=w.column.parent:(I=w.column,k=!0),_&&(_==null?void 0:_.column)===I)_.subHeaders.push(w);else{const A=n0(n,I,{id:[r,m,I.id,w==null?void 0:w.id].filter(Boolean).join("_"),isPlaceholder:k,placeholderId:k?`${b.filter(M=>M.column===I).length}`:void 0,depth:m,index:b.length});A.subHeaders.push(w),b.push(A)}C.headers.push(w),w.headerGroup=C}),u.push(C),m>0&&h(b,m-1)},p=e.map((v,m)=>n0(n,v,{depth:a,index:m}));h(p,a-1),u.reverse();const g=v=>v.filter(C=>C.column.getIsVisible()).map(C=>{let b=0,w=0,_=[0];C.subHeaders&&C.subHeaders.length?(_=[],g(C.subHeaders).forEach(I=>{let{colSpan:k,rowSpan:A}=I;b+=k,_.push(A)})):b=1;const E=Math.min(..._);return w=w+E,C.colSpan=b,C.rowSpan=w,{colSpan:b,rowSpan:w}});return g((o=(i=u[0])==null?void 0:i.headers)!=null?o:[]),u}const bm=(t,e,n,r,o,i,a)=>{let c={id:e,index:r,original:n,depth:o,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(c._valuesCache.hasOwnProperty(u))return c._valuesCache[u];const h=t.getColumn(u);if(h!=null&&h.accessorFn)return c._valuesCache[u]=h.accessorFn(c.original,r),c._valuesCache[u]},getUniqueValues:u=>{if(c._uniqueValuesCache.hasOwnProperty(u))return c._uniqueValuesCache[u];const h=t.getColumn(u);if(h!=null&&h.accessorFn)return h.columnDef.getUniqueValues?(c._uniqueValuesCache[u]=h.columnDef.getUniqueValues(c.original,r),c._uniqueValuesCache[u]):(c._uniqueValuesCache[u]=[c.getValue(u)],c._uniqueValuesCache[u])},renderValue:u=>{var h;return(h=c.getValue(u))!=null?h:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>MM(c.subRows,u=>u.subRows),getParentRow:()=>c.parentId?t.getRow(c.parentId,!0):void 0,getParentRows:()=>{let u=[],h=c;for(;;){const p=h.getParentRow();if(!p)break;u.push(p),h=p}return u.reverse()},getAllCells:it(()=>[t.getAllLeafColumns()],u=>u.map(h=>RM(t,c,h,h.id)),st(t.options,"debugRows","getAllCells")),_getAllCellsByColumnId:it(()=>[c.getAllCells()],u=>u.reduce((h,p)=>(h[p.column.id]=p,h),{}),st(t.options,"debugRows","getAllCellsByColumnId"))};for(let u=0;u<t._features.length;u++){const h=t._features[u];h==null||h.createRow==null||h.createRow(c,t)}return c},$M={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},r0=(t,e,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=t.getValue(e))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};r0.autoRemove=t=>So(t);const o0=(t,e,n)=>{var r;return!!(!((r=t.getValue(e))==null||(r=r.toString())==null)&&r.includes(n))};o0.autoRemove=t=>So(t);const i0=(t,e,n)=>{var r;return((r=t.getValue(e))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};i0.autoRemove=t=>So(t);const s0=(t,e,n)=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(n)};s0.autoRemove=t=>So(t);const a0=(t,e,n)=>!n.some(r=>{var o;return!((o=t.getValue(e))!=null&&o.includes(r))});a0.autoRemove=t=>So(t)||!(t!=null&&t.length);const c0=(t,e,n)=>n.some(r=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(r)});c0.autoRemove=t=>So(t)||!(t!=null&&t.length);const l0=(t,e,n)=>t.getValue(e)===n;l0.autoRemove=t=>So(t);const d0=(t,e,n)=>t.getValue(e)==n;d0.autoRemove=t=>So(t);const Cm=(t,e,n)=>{let[r,o]=n;const i=t.getValue(e);return i>=r&&i<=o};Cm.resolveFilterValue=t=>{let[e,n]=t,r=typeof e!="number"?parseFloat(e):e,o=typeof n!="number"?parseFloat(n):n,i=e===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(o)?1/0:o;if(i>a){const c=i;i=a,a=c}return[i,a]},Cm.autoRemove=t=>So(t)||So(t[0])&&So(t[1]);const bi={includesString:r0,includesStringSensitive:o0,equalsString:i0,arrIncludes:s0,arrIncludesAll:a0,arrIncludesSome:c0,equals:l0,weakEquals:d0,inNumberRange:Cm};function So(t){return t==null||t===""}const UM={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Yr("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(t.id);return typeof r=="string"?bi.includesString:typeof r=="number"?bi.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?bi.equals:Array.isArray(r)?bi.arrIncludes:bi.weakEquals},t.getFilterFn=()=>{var n,r;return pf(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[t.columnDef.filterFn])!=null?n:bi[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,r,o;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((r=e.options.enableColumnFilters)!=null?r:!0)&&((o=e.options.enableFilters)!=null?o:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(r=>r.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,r;return(n=(r=e.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(r=>{const o=t.getFilterFn(),i=r==null?void 0:r.find(p=>p.id===t.id),a=ds(n,i?i.value:void 0);if(u0(o,a,t)){var c;return(c=r==null?void 0:r.filter(p=>p.id!==t.id))!=null?c:[]}const u={id:t.id,value:a};if(i){var h;return(h=r==null?void 0:r.map(p=>p.id===t.id?u:p))!=null?h:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),r=o=>{var i;return(i=ds(e,o))==null?void 0:i.filter(a=>{const c=n.find(u=>u.id===a.id);if(c){const u=c.getFilterFn();if(u0(u,a.value,c))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(r)},t.resetColumnFilters=e=>{var n,r;t.setColumnFilters(e?[]:(n=(r=t.initialState)==null?void 0:r.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function u0(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const xm={sum:(t,e,n)=>n.reduce((r,o)=>{const i=o.getValue(t);return r+(typeof i=="number"?i:0)},0),min:(t,e,n)=>{let r;return n.forEach(o=>{const i=o.getValue(t);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},max:(t,e,n)=>{let r;return n.forEach(o=>{const i=o.getValue(t);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},extent:(t,e,n)=>{let r,o;return n.forEach(i=>{const a=i.getValue(t);a!=null&&(r===void 0?a>=a&&(r=o=a):(r>a&&(r=a),o<a&&(o=a)))}),[r,o]},mean:(t,e)=>{let n=0,r=0;if(e.forEach(o=>{let i=o.getValue(t);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},median:(t,e)=>{if(!e.length)return;const n=e.map(i=>i.getValue(t));if(!DM(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,a)=>i-a);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},unique:(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),uniqueCount:(t,e)=>new Set(e.map(n=>n.getValue(t))).size,count:(t,e)=>e.length},HM={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:Yr("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(r=>r!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,r;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((r=e.options.enableGrouping)!=null?r:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(t.id);if(typeof r=="number")return xm.sum;if(Object.prototype.toString.call(r)==="[object Date]")return xm.extent},t.getAggregationFn=()=>{var n,r;if(!t)throw new Error;return pf(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(r=e.options.aggregationFns)==null?void 0:r[t.columnDef.aggregationFn])!=null?n:xm[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,r;t.setGrouping(e?[]:(n=(r=t.initialState)==null?void 0:r.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const r=e.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(t._groupingValuesCache[n]=r.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,r)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var o;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function BM(t,e,n){if(!(e!=null&&e.length)||!n)return t;const r=t.filter(i=>!e.includes(i.id));return n==="remove"?r:[...e.map(i=>t.find(a=>a.id===i)).filter(Boolean),...r]}const zM={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Yr("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=it(n=>[Ml(e,n)],n=>n.findIndex(r=>r.id===t.id),st(e.options,"debugColumns","getIndex")),t.getIsFirstColumn=n=>{var r;return((r=Ml(e,n)[0])==null?void 0:r.id)===t.id},t.getIsLastColumn=n=>{var r;const o=Ml(e,n);return((r=o[o.length-1])==null?void 0:r.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=it(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,r)=>o=>{let i=[];if(!(e!=null&&e.length))i=o;else{const a=[...e],c=[...o];for(;c.length&&a.length;){const u=a.shift(),h=c.findIndex(p=>p.id===u);h>-1&&i.push(c.splice(h,1)[0])}i=[...i,...c]}return BM(i,n,r)},st(t.options,"debugTable","_getOrderColumnsFn"))}},_m=()=>({left:[],right:[]}),VM={getInitialState:t=>({columnPinning:_m(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Yr("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const r=t.getLeafColumns().map(o=>o.id).filter(Boolean);e.setColumnPinning(o=>{var i,a;if(n==="right"){var c,u;return{left:((c=o==null?void 0:o.left)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((u=o==null?void 0:o.right)!=null?u:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var h,p;return{left:[...((h=o==null?void 0:o.left)!=null?h:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((p=o==null?void 0:o.right)!=null?p:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(g=>!(r!=null&&r.includes(g))),right:((a=o==null?void 0:o.right)!=null?a:[]).filter(g=>!(r!=null&&r.includes(g)))}})},t.getCanPin=()=>t.getLeafColumns().some(r=>{var o,i,a;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(a=e.options.enableColumnPinning)!=null?a:e.options.enablePinning)!=null?i:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(c=>c.id),{left:r,right:o}=e.getState().columnPinning,i=n.some(c=>r==null?void 0:r.includes(c)),a=n.some(c=>o==null?void 0:o.includes(c));return i?"left":a?"right":!1},t.getPinnedIndex=()=>{var n,r;const o=t.getIsPinned();return o?(n=(r=e.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=it(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(a=>!i.includes(a.column.id))},st(e.options,"debugRows","getCenterVisibleCells")),t.getLeftVisibleCells=it(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),st(e.options,"debugRows","getLeftVisibleCells")),t.getRightVisibleCells=it(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),st(e.options,"debugRows","getRightVisibleCells"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,r;return t.setColumnPinning(e?_m():(n=(r=t.initialState)==null?void 0:r.columnPinning)!=null?n:_m())},t.getIsSomeColumnsPinned=e=>{var n;const r=t.getState().columnPinning;if(!e){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[e])!=null&&n.length)},t.getLeftLeafColumns=it(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(r=>e.find(o=>o.id===r)).filter(Boolean),st(t.options,"debugColumns","getLeftLeafColumns")),t.getRightLeafColumns=it(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(r=>e.find(o=>o.id===r)).filter(Boolean),st(t.options,"debugColumns","getRightLeafColumns")),t.getCenterLeafColumns=it(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r)=>{const o=[...n??[],...r??[]];return e.filter(i=>!o.includes(i.id))},st(t.options,"debugColumns","getCenterLeafColumns"))}};function KM(t){return t||(typeof document<"u"?document:null)}const mf={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Sm=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),GM={getDefaultColumnDef:()=>mf,getInitialState:t=>({columnSizing:{},columnSizingInfo:Sm(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Yr("columnSizing",t),onColumnSizingInfoChange:Yr("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,r,o;const i=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:mf.minSize,(r=i??t.columnDef.size)!=null?r:mf.size),(o=t.columnDef.maxSize)!=null?o:mf.maxSize)},t.getStart=it(n=>[n,Ml(e,n),e.getState().columnSizing],(n,r)=>r.slice(0,t.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),st(e.options,"debugColumns","getStart")),t.getAfter=it(n=>[n,Ml(e,n),e.getState().columnSizing],(n,r)=>r.slice(t.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),st(e.options,"debugColumns","getAfter")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:r,...o}=n;return o})},t.getCanResize=()=>{var n,r;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((r=e.options.enableColumnResizing)!=null?r:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const r=e.getColumn(t.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),Tm(i)&&i.touches&&i.touches.length>1))return;const a=t.getSize(),c=t?t.getLeafHeaders().map(_=>[_.column.id,_.column.getSize()]):[[r.id,r.getSize()]],u=Tm(i)?Math.round(i.touches[0].clientX):i.clientX,h={},p=(_,E)=>{typeof E=="number"&&(e.setColumnSizingInfo(I=>{var k,A;const M=e.options.columnResizeDirection==="rtl"?-1:1,B=(E-((k=I==null?void 0:I.startOffset)!=null?k:0))*M,W=Math.max(B/((A=I==null?void 0:I.startSize)!=null?A:0),-.999999);return I.columnSizingStart.forEach(Y=>{let[z,de]=Y;h[z]=Math.round(Math.max(de+de*W,0)*100)/100}),{...I,deltaOffset:B,deltaPercentage:W}}),(e.options.columnResizeMode==="onChange"||_==="end")&&e.setColumnSizing(I=>({...I,...h})))},g=_=>p("move",_),v=_=>{p("end",_),e.setColumnSizingInfo(E=>({...E,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},m=KM(n),C={moveHandler:_=>g(_.clientX),upHandler:_=>{m==null||m.removeEventListener("mousemove",C.moveHandler),m==null||m.removeEventListener("mouseup",C.upHandler),v(_.clientX)}},b={moveHandler:_=>(_.cancelable&&(_.preventDefault(),_.stopPropagation()),g(_.touches[0].clientX),!1),upHandler:_=>{var E;m==null||m.removeEventListener("touchmove",b.moveHandler),m==null||m.removeEventListener("touchend",b.upHandler),_.cancelable&&(_.preventDefault(),_.stopPropagation()),v((E=_.touches[0])==null?void 0:E.clientX)}},w=jM()?{passive:!1}:!1;Tm(i)?(m==null||m.addEventListener("touchmove",b.moveHandler,w),m==null||m.addEventListener("touchend",b.upHandler,w)):(m==null||m.addEventListener("mousemove",C.moveHandler,w),m==null||m.addEventListener("mouseup",C.upHandler,w)),e.setColumnSizingInfo(_=>({..._,startOffset:u,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:c,isResizingColumn:r.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?Sm():(n=t.initialState.columnSizingInfo)!=null?n:Sm())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0}}};let vf=null;function jM(){if(typeof vf=="boolean")return vf;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return vf=t,vf}function Tm(t){return t.type==="touchstart"}const WM={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Yr("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(r=>({...r,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,r;const o=t.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=e.getState().columnVisibility)==null?void 0:r[t.id])!=null?n:!0},t.getCanHide=()=>{var n,r;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((r=e.options.enableHiding)!=null?r:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=it(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),st(e.options,"debugRows","_getAllVisibleCells")),t.getVisibleCells=it(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],st(e.options,"debugRows","getVisibleCells"))},createTable:t=>{const e=(n,r)=>it(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),st(t.options,"debugColumns",n));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var r;t.setColumnVisibility(n?{}:(r=t.initialState.columnVisibility)!=null?r:{})},t.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;t.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Ml(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const qM={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},YM={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Yr("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const r=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,r,o,i;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=e.options.enableGlobalFilter)!=null?r:!0)&&((o=e.options.enableFilters)!=null?o:!0)&&((i=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?i:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>bi.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:r}=t.options;return pf(r)?r:r==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[r])!=null?e:bi[r]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},QM={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Yr("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var r,o;if(!e){t._queue(()=>{e=!0});return}if((r=(o=t.options.autoResetAll)!=null?o:t.options.autoResetExpanded)!=null?r:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=r=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(r),t.toggleAllRowsExpanded=r=>{r??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=r=>{var o,i;t.setExpanded(r?{}:(o=(i=t.initialState)==null?void 0:i.expanded)!=null?o:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const r=t.getState().expanded;return r===!0||Object.values(r).some(Boolean)},t.getIsAllRowsExpanded=()=>{const r=t.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||t.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},t.getExpandedDepth=()=>{let r=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(i=>{const a=i.split(".");r=Math.max(r,a.length)}),r},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[t.id]);let a={};if(r===!0?Object.keys(e.getRowModel().rowsById).forEach(c=>{a[c]=!0}):a=r,n=(o=n)!=null?o:!i,!i&&n)return{...a,[t.id]:!0};if(i&&!n){const{[t.id]:c,...u}=a;return u}return r})},t.getIsExpanded=()=>{var n;const r=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:r===!0||r!=null&&r[t.id])},t.getCanExpand=()=>{var n,r,o;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((r=e.options.enableExpanding)!=null?r:!0)&&!!((o=t.subRows)!=null&&o.length)},t.getIsAllParentsExpanded=()=>{let n=!0,r=t;for(;n&&r.parentId;)r=e.getRow(r.parentId,!0),n=r.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},Em=0,Am=10,Im=()=>({pageIndex:Em,pageSize:Am}),JM={getInitialState:t=>({...t,pagination:{...Im(),...t==null?void 0:t.pagination}}),getDefaultOptions:t=>({onPaginationChange:Yr("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var r,o;if(!e){t._queue(()=>{e=!0});return}if((r=(o=t.options.autoResetAll)!=null?o:t.options.autoResetPageIndex)!=null?r:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=r=>{const o=i=>ds(r,i);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(o)},t.resetPagination=r=>{var o;t.setPagination(r?Im():(o=t.initialState.pagination)!=null?o:Im())},t.setPageIndex=r=>{t.setPagination(o=>{let i=ds(r,o.pageIndex);const a=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return i=Math.max(0,Math.min(i,a)),{...o,pageIndex:i}})},t.resetPageIndex=r=>{var o,i;t.setPageIndex(r?Em:(o=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:Em)},t.resetPageSize=r=>{var o,i;t.setPageSize(r?Am:(o=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Am)},t.setPageSize=r=>{t.setPagination(o=>{const i=Math.max(1,ds(r,o.pageSize)),a=o.pageSize*o.pageIndex,c=Math.floor(a/i);return{...o,pageIndex:c,pageSize:i}})},t.setPageCount=r=>t.setPagination(o=>{var i;let a=ds(r,(i=t.options.pageCount)!=null?i:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...o,pageCount:a}}),t.getPageOptions=it(()=>[t.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,a)=>a)),o},st(t.options,"debugTable","getPageOptions")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:r}=t.getState().pagination,o=t.getPageCount();return o===-1?!0:o===0?!1:r<o-1},t.previousPage=()=>t.setPageIndex(r=>r-1),t.nextPage=()=>t.setPageIndex(r=>r+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var r;return(r=t.options.pageCount)!=null?r:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var r;return(r=t.options.rowCount)!=null?r:t.getPrePaginationRowModel().rows.length}}},km=()=>({top:[],bottom:[]}),XM={getInitialState:t=>({rowPinning:km(),...t}),getDefaultOptions:t=>({onRowPinningChange:Yr("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,r,o)=>{const i=r?t.getLeafRows().map(u=>{let{id:h}=u;return h}):[],a=o?t.getParentRows().map(u=>{let{id:h}=u;return h}):[],c=new Set([...a,t.id,...i]);e.setRowPinning(u=>{var h,p;if(n==="bottom"){var g,v;return{top:((g=u==null?void 0:u.top)!=null?g:[]).filter(b=>!(c!=null&&c.has(b))),bottom:[...((v=u==null?void 0:u.bottom)!=null?v:[]).filter(b=>!(c!=null&&c.has(b))),...Array.from(c)]}}if(n==="top"){var m,C;return{top:[...((m=u==null?void 0:u.top)!=null?m:[]).filter(b=>!(c!=null&&c.has(b))),...Array.from(c)],bottom:((C=u==null?void 0:u.bottom)!=null?C:[]).filter(b=>!(c!=null&&c.has(b)))}}return{top:((h=u==null?void 0:u.top)!=null?h:[]).filter(b=>!(c!=null&&c.has(b))),bottom:((p=u==null?void 0:u.bottom)!=null?p:[]).filter(b=>!(c!=null&&c.has(b)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=e.options;return typeof r=="function"?r(t):(n=r??o)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:r,bottom:o}=e.getState().rowPinning,i=n.some(c=>r==null?void 0:r.includes(c)),a=n.some(c=>o==null?void 0:o.includes(c));return i?"top":a?"bottom":!1},t.getPinnedIndex=()=>{var n,r;const o=t.getIsPinned();if(!o)return-1;const i=(n=o==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(a=>{let{id:c}=a;return c});return(r=i==null?void 0:i.indexOf(t.id))!=null?r:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,r;return t.setRowPinning(e?km():(n=(r=t.initialState)==null?void 0:r.rowPinning)!=null?n:km())},t.getIsSomeRowsPinned=e=>{var n;const r=t.getState().rowPinning;if(!e){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[e])!=null&&n.length)},t._getPinnedRows=(e,n,r)=>{var o;return((o=t.options.keepPinnedRows)==null||o?(n??[]).map(a=>{const c=t.getRow(a,!0);return c.getIsAllParentsExpanded()?c:null}):(n??[]).map(a=>e.find(c=>c.id===a))).filter(Boolean).map(a=>({...a,position:r}))},t.getTopRows=it(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),st(t.options,"debugRows","getTopRows")),t.getBottomRows=it(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),st(t.options,"debugRows","getBottomRows")),t.getCenterRows=it(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,r)=>{const o=new Set([...n??[],...r??[]]);return e.filter(i=>!o.has(i.id))},st(t.options,"debugRows","getCenterRows"))}},ZM={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Yr("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const r={...n},o=t.getPreGroupedRowModel().flatRows;return e?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const r=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),o={...n};return t.getRowModel().rows.forEach(i=>{Pm(o,i.id,r,!0,t)}),o}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=it(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?Om(t,n):{rows:[],flatRows:[],rowsById:{}},st(t.options,"debugTable","getSelectedRowModel")),t.getFilteredSelectedRowModel=it(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?Om(t,n):{rows:[],flatRows:[],rowsById:{}},st(t.options,"debugTable","getFilteredSelectedRowModel")),t.getGroupedSelectedRowModel=it(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?Om(t,n):{rows:[],flatRows:[],rowsById:{}},st(t.options,"debugTable","getGroupedSelectedRowModel")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let r=!!(e.length&&Object.keys(n).length);return r&&e.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=t.getState();let r=!!e.length;return r&&e.some(o=>!n[o.id])&&(r=!1),r},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,r)=>{const o=t.getIsSelected();e.setRowSelection(i=>{var a;if(n=typeof n<"u"?n:!o,t.getCanSelect()&&o===n)return i;const c={...i};return Pm(c,t.id,n,(a=r==null?void 0:r.selectChildren)!=null?a:!0,e),c})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return Nm(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return Dm(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return Dm(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return r=>{var o;n&&t.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},Pm=(t,e,n,r,o)=>{var i;const a=o.getRow(e,!0);n?(a.getCanMultiSelect()||Object.keys(t).forEach(c=>delete t[c]),a.getCanSelect()&&(t[e]=!0)):delete t[e],r&&(i=a.subRows)!=null&&i.length&&a.getCanSelectSubRows()&&a.subRows.forEach(c=>Pm(t,c.id,n,r,o))};function Om(t,e){const n=t.getState().rowSelection,r=[],o={},i=function(a,c){return a.map(u=>{var h;const p=Nm(u,n);if(p&&(r.push(u),o[u.id]=u),(h=u.subRows)!=null&&h.length&&(u={...u,subRows:i(u.subRows)}),p)return u}).filter(Boolean)};return{rows:i(e.rows),flatRows:r,rowsById:o}}function Nm(t,e){var n;return(n=e[t.id])!=null?n:!1}function Dm(t,e,n){var r;if(!((r=t.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return t.subRows.forEach(a=>{if(!(i&&!o)&&(a.getCanSelect()&&(Nm(a,e)?i=!0:o=!1),a.subRows&&a.subRows.length)){const c=Dm(a,e);c==="all"?i=!0:(c==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const Mm=/([0-9]+)/gm,eR=(t,e,n)=>f0(us(t.getValue(n)).toLowerCase(),us(e.getValue(n)).toLowerCase()),tR=(t,e,n)=>f0(us(t.getValue(n)),us(e.getValue(n))),nR=(t,e,n)=>Rm(us(t.getValue(n)).toLowerCase(),us(e.getValue(n)).toLowerCase()),rR=(t,e,n)=>Rm(us(t.getValue(n)),us(e.getValue(n))),oR=(t,e,n)=>{const r=t.getValue(n),o=e.getValue(n);return r>o?1:r<o?-1:0},iR=(t,e,n)=>Rm(t.getValue(n),e.getValue(n));function Rm(t,e){return t===e?0:t>e?1:-1}function us(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function f0(t,e){const n=t.split(Mm).filter(Boolean),r=e.split(Mm).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),a=parseInt(o,10),c=parseInt(i,10),u=[a,c].sort();if(isNaN(u[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(u[1]))return isNaN(a)?-1:1;if(a>c)return 1;if(c>a)return-1}return n.length-r.length}const Rl={alphanumeric:eR,alphanumericCaseSensitive:tR,text:nR,textCaseSensitive:rR,datetime:oR,basic:iR},sR=[FM,WM,zM,VM,$M,UM,qM,YM,{getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Yr("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(t.id);if(Object.prototype.toString.call(i)==="[object Date]")return Rl.datetime;if(typeof i=="string"&&(r=!0,i.split(Mm).length>1))return Rl.alphanumeric}return r?Rl.text:Rl.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(t.id))=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,r;if(!t)throw new Error;return pf(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(r=e.options.sortingFns)==null?void 0:r[t.columnDef.sortingFn])!=null?n:Rl[t.columnDef.sortingFn]},t.toggleSorting=(n,r)=>{const o=t.getNextSortingOrder(),i=typeof n<"u"&&n!==null;e.setSorting(a=>{const c=a==null?void 0:a.find(m=>m.id===t.id),u=a==null?void 0:a.findIndex(m=>m.id===t.id);let h=[],p,g=i?n:o==="desc";if(a!=null&&a.length&&t.getCanMultiSort()&&r?c?p="toggle":p="add":a!=null&&a.length&&u!==a.length-1?p="replace":c?p="toggle":p="replace",p==="toggle"&&(i||o||(p="remove")),p==="add"){var v;h=[...a,{id:t.id,desc:g}],h.splice(0,h.length-((v=e.options.maxMultiSortColCount)!=null?v:Number.MAX_SAFE_INTEGER))}else p==="toggle"?h=a.map(m=>m.id===t.id?{...m,desc:g}:m):p==="remove"?h=a.filter(m=>m.id!==t.id):h=[{id:t.id,desc:g}];return h})},t.getFirstSortDir=()=>{var n,r;return((n=(r=t.columnDef.sortDescFirst)!=null?r:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var r,o;const i=t.getFirstSortDir(),a=t.getIsSorted();return a?a!==i&&((r=e.options.enableSortingRemoval)==null||r)&&(!(n&&(o=e.options.enableMultiRemove)!=null)||o)?!1:a==="desc"?"asc":"desc":i},t.getCanSort=()=>{var n,r;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((r=e.options.enableSorting)!=null?r:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,r;return(n=(r=t.columnDef.enableMultiSort)!=null?r:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const r=(n=e.getState().sorting)==null?void 0:n.find(o=>o.id===t.id);return r?r.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,r;return(n=(r=e.getState().sorting)==null?void 0:r.findIndex(o=>o.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return r=>{n&&(r.persist==null||r.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(r):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,r;t.setSorting(e?[]:(n=(r=t.initialState)==null?void 0:r.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},HM,QM,JM,XM,ZM,GM];function aR(t){var e,n;process.env.NODE_ENV!=="production"&&(t.debugAll||t.debugTable)&&console.info("Creating Table Instance...");const r=[...sR,...(e=t._features)!=null?e:[]];let o={_features:r};const i=o._features.reduce((v,m)=>Object.assign(v,m.getDefaultOptions==null?void 0:m.getDefaultOptions(o)),{}),a=v=>o.options.mergeOptions?o.options.mergeOptions(i,v):{...i,...v};let u={...{},...(n=t.initialState)!=null?n:{}};o._features.forEach(v=>{var m;u=(m=v.getInitialState==null?void 0:v.getInitialState(u))!=null?m:u});const h=[];let p=!1;const g={_features:r,options:{...i,...t},initialState:u,_queue:v=>{h.push(v),p||(p=!0,Promise.resolve().then(()=>{for(;h.length;)h.shift()();p=!1}).catch(m=>setTimeout(()=>{throw m})))},reset:()=>{o.setState(o.initialState)},setOptions:v=>{const m=ds(v,o.options);o.options=a(m)},getState:()=>o.options.state,setState:v=>{o.options.onStateChange==null||o.options.onStateChange(v)},_getRowId:(v,m,C)=>{var b;return(b=o.options.getRowId==null?void 0:o.options.getRowId(v,m,C))!=null?b:`${C?[C.id,m].join("."):m}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(v,m)=>{let C=(m?o.getPrePaginationRowModel():o.getRowModel()).rowsById[v];if(!C&&(C=o.getCoreRowModel().rowsById[v],!C))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${v}`):new Error;return C},_getDefaultColumnDef:it(()=>[o.options.defaultColumn],v=>{var m;return v=(m=v)!=null?m:{},{header:C=>{const b=C.header.column.columnDef;return b.accessorKey?b.accessorKey:b.accessorFn?b.id:null},cell:C=>{var b,w;return(b=(w=C.renderValue())==null||w.toString==null?void 0:w.toString())!=null?b:null},...o._features.reduce((C,b)=>Object.assign(C,b.getDefaultColumnDef==null?void 0:b.getDefaultColumnDef()),{}),...v}},st(t,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:it(()=>[o._getColumnDefs()],v=>{const m=function(C,b,w){return w===void 0&&(w=0),C.map(_=>{const E=LM(o,_,w,b),I=_;return E.columns=I.columns?m(I.columns,E,w+1):[],E})};return m(v)},st(t,"debugColumns","getAllColumns")),getAllFlatColumns:it(()=>[o.getAllColumns()],v=>v.flatMap(m=>m.getFlatColumns()),st(t,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:it(()=>[o.getAllFlatColumns()],v=>v.reduce((m,C)=>(m[C.id]=C,m),{}),st(t,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:it(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(v,m)=>{let C=v.flatMap(b=>b.getLeafColumns());return m(C)},st(t,"debugColumns","getAllLeafColumns")),getColumn:v=>{const m=o._getAllFlatColumnsById()[v];return process.env.NODE_ENV!=="production"&&!m&&console.error(`[Table] Column with id '${v}' does not exist.`),m}};Object.assign(o,g);for(let v=0;v<o._features.length;v++){const m=o._features[v];m==null||m.createTable==null||m.createTable(o)}return o}function h0(){return t=>it(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,a){i===void 0&&(i=0);const c=[];for(let h=0;h<o.length;h++){const p=bm(t,t._getRowId(o[h],h,a),o[h],h,i,void 0,a==null?void 0:a.id);if(n.flatRows.push(p),n.rowsById[p.id]=p,c.push(p),t.options.getSubRows){var u;p.originalSubRows=t.options.getSubRows(o[h],h),(u=p.originalSubRows)!=null&&u.length&&(p.subRows=r(p.originalSubRows,i+1,p))}}return c};return n.rows=r(e),n},st(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function cR(t,e,n){return n.options.filterFromLeafRows?lR(t,e,n):dR(t,e,n)}function lR(t,e,n){var r;const o=[],i={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,c=function(u,h){h===void 0&&(h=0);const p=[];for(let v=0;v<u.length;v++){var g;let m=u[v];const C=bm(n,m.id,m.original,m.index,m.depth,void 0,m.parentId);if(C.columnFilters=m.columnFilters,(g=m.subRows)!=null&&g.length&&h<a){if(C.subRows=c(m.subRows,h+1),m=C,e(m)&&!C.subRows.length){p.push(m),i[m.id]=m,o.push(m);continue}if(e(m)||C.subRows.length){p.push(m),i[m.id]=m,o.push(m);continue}}else m=C,e(m)&&(p.push(m),i[m.id]=m,o.push(m))}return p};return{rows:c(t),flatRows:o,rowsById:i}}function dR(t,e,n){var r;const o=[],i={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,c=function(u,h){h===void 0&&(h=0);const p=[];for(let v=0;v<u.length;v++){let m=u[v];if(e(m)){var g;if((g=m.subRows)!=null&&g.length&&h<a){const b=bm(n,m.id,m.original,m.index,m.depth,void 0,m.parentId);b.subRows=c(m.subRows,h+1),m=b}p.push(m),o.push(m),i[m.id]=m}}return p};return{rows:c(t),flatRows:o,rowsById:i}}function uR(){return t=>it(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,r)=>{if(!e.rows.length||!(n!=null&&n.length)&&!r){for(let v=0;v<e.flatRows.length;v++)e.flatRows[v].columnFilters={},e.flatRows[v].columnFiltersMeta={};return e}const o=[],i=[];(n??[]).forEach(v=>{var m;const C=t.getColumn(v.id);if(!C)return;const b=C.getFilterFn();if(!b){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${C.id}.`);return}o.push({id:v.id,filterFn:b,resolvedValue:(m=b.resolveFilterValue==null?void 0:b.resolveFilterValue(v.value))!=null?m:v.value})});const a=(n??[]).map(v=>v.id),c=t.getGlobalFilterFn(),u=t.getAllLeafColumns().filter(v=>v.getCanGlobalFilter());r&&c&&u.length&&(a.push("__global__"),u.forEach(v=>{var m;i.push({id:v.id,filterFn:c,resolvedValue:(m=c.resolveFilterValue==null?void 0:c.resolveFilterValue(r))!=null?m:r})}));let h,p;for(let v=0;v<e.flatRows.length;v++){const m=e.flatRows[v];if(m.columnFilters={},o.length)for(let C=0;C<o.length;C++){h=o[C];const b=h.id;m.columnFilters[b]=h.filterFn(m,b,h.resolvedValue,w=>{m.columnFiltersMeta[b]=w})}if(i.length){for(let C=0;C<i.length;C++){p=i[C];const b=p.id;if(p.filterFn(m,b,p.resolvedValue,w=>{m.columnFiltersMeta[b]=w})){m.columnFilters.__global__=!0;break}}m.columnFilters.__global__!==!0&&(m.columnFilters.__global__=!1)}}const g=v=>{for(let m=0;m<a.length;m++)if(v.columnFilters[a[m]]===!1)return!1;return!0};return cR(e.rows,g,t)},st(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}function fR(){return t=>it(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const r=t.getState().sorting,o=[],i=r.filter(u=>{var h;return(h=t.getColumn(u.id))==null?void 0:h.getCanSort()}),a={};i.forEach(u=>{const h=t.getColumn(u.id);h&&(a[u.id]={sortUndefined:h.columnDef.sortUndefined,invertSorting:h.columnDef.invertSorting,sortingFn:h.getSortingFn()})});const c=u=>{const h=u.map(p=>({...p}));return h.sort((p,g)=>{for(let m=0;m<i.length;m+=1){var v;const C=i[m],b=a[C.id],w=b.sortUndefined,_=(v=C==null?void 0:C.desc)!=null?v:!1;let E=0;if(w){const I=p.getValue(C.id),k=g.getValue(C.id),A=I===void 0,M=k===void 0;if(A||M){if(w==="first")return A?-1:1;if(w==="last")return A?1:-1;E=A&&M?0:A?w:-w}}if(E===0&&(E=b.sortingFn(p,g,C.id)),E!==0)return _&&(E*=-1),b.invertSorting&&(E*=-1),E}return p.index-g.index}),h.forEach(p=>{var g;o.push(p),(g=p.subRows)!=null&&g.length&&(p.subRows=c(p.subRows))}),h};return{rows:c(n.rows),flatRows:o,rowsById:n.rowsById}},st(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}/**
|
|
60
|
+
* react-table
|
|
61
|
+
*
|
|
62
|
+
* Copyright (c) TanStack
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the MIT license found in the
|
|
65
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
66
|
+
*
|
|
67
|
+
* @license MIT
|
|
68
|
+
*/function yf(t,e){return t?hR(t)?S.createElement(t,e):t:null}function hR(t){return pR(t)||typeof t=="function"||gR(t)}function pR(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function gR(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function p0(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=S.useState(()=>({current:aR(e)})),[r,o]=S.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...t,state:{...r,...t.state},onStateChange:a=>{o(a),t.onStateChange==null||t.onStateChange(a)}})),n.current}var jo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var g0={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(jo,function(){var n=1e3,r=6e4,o=36e5,i="millisecond",a="second",c="minute",u="hour",h="day",p="week",g="month",v="quarter",m="year",C="date",b="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Q){var re=["th","st","nd","rd"],j=Q%100;return"["+Q+(re[(j-20)%10]||re[j]||re[0])+"]"}},I=function(Q,re,j){var se=String(Q);return!se||se.length>=re?Q:""+Array(re+1-se.length).join(j)+Q},k={s:I,z:function(Q){var re=-Q.utcOffset(),j=Math.abs(re),se=Math.floor(j/60),ie=j%60;return(re<=0?"+":"-")+I(se,2,"0")+":"+I(ie,2,"0")},m:function Q(re,j){if(re.date()<j.date())return-Q(j,re);var se=12*(j.year()-re.year())+(j.month()-re.month()),ie=re.clone().add(se,g),ce=j-ie<0,$=re.clone().add(se+(ce?-1:1),g);return+(-(se+(j-ie)/(ce?ie-$:$-ie))||0)},a:function(Q){return Q<0?Math.ceil(Q)||0:Math.floor(Q)},p:function(Q){return{M:g,y:m,w:p,d:h,D:C,h:u,m:c,s:a,ms:i,Q:v}[Q]||String(Q||"").toLowerCase().replace(/s$/,"")},u:function(Q){return Q===void 0}},A="en",M={};M[A]=E;var B="$isDayjsObject",W=function(Q){return Q instanceof ne||!(!Q||!Q[B])},Y=function Q(re,j,se){var ie;if(!re)return A;if(typeof re=="string"){var ce=re.toLowerCase();M[ce]&&(ie=ce),j&&(M[ce]=j,ie=ce);var $=re.split("-");if(!ie&&$.length>1)return Q($[0])}else{var Z=re.name;M[Z]=re,ie=Z}return!se&&ie&&(A=ie),ie||!se&&A},z=function(Q,re){if(W(Q))return Q.clone();var j=typeof re=="object"?re:{};return j.date=Q,j.args=arguments,new ne(j)},de=k;de.l=Y,de.i=W,de.w=function(Q,re){return z(Q,{locale:re.$L,utc:re.$u,x:re.$x,$offset:re.$offset})};var ne=function(){function Q(j){this.$L=Y(j.locale,null,!0),this.parse(j),this.$x=this.$x||j.x||{},this[B]=!0}var re=Q.prototype;return re.parse=function(j){this.$d=function(se){var ie=se.date,ce=se.utc;if(ie===null)return new Date(NaN);if(de.u(ie))return new Date;if(ie instanceof Date)return new Date(ie);if(typeof ie=="string"&&!/Z$/i.test(ie)){var $=ie.match(w);if($){var Z=$[2]-1||0,me=($[7]||"0").substring(0,3);return ce?new Date(Date.UTC($[1],Z,$[3]||1,$[4]||0,$[5]||0,$[6]||0,me)):new Date($[1],Z,$[3]||1,$[4]||0,$[5]||0,$[6]||0,me)}}return new Date(ie)}(j),this.init()},re.init=function(){var j=this.$d;this.$y=j.getFullYear(),this.$M=j.getMonth(),this.$D=j.getDate(),this.$W=j.getDay(),this.$H=j.getHours(),this.$m=j.getMinutes(),this.$s=j.getSeconds(),this.$ms=j.getMilliseconds()},re.$utils=function(){return de},re.isValid=function(){return this.$d.toString()!==b},re.isSame=function(j,se){var ie=z(j);return this.startOf(se)<=ie&&ie<=this.endOf(se)},re.isAfter=function(j,se){return z(j)<this.startOf(se)},re.isBefore=function(j,se){return this.endOf(se)<z(j)},re.$g=function(j,se,ie){return de.u(j)?this[se]:this.set(ie,j)},re.unix=function(){return Math.floor(this.valueOf()/1e3)},re.valueOf=function(){return this.$d.getTime()},re.startOf=function(j,se){var ie=this,ce=!!de.u(se)||se,$=de.p(j),Z=function(Ie,Pe){var Me=de.w(ie.$u?Date.UTC(ie.$y,Pe,Ie):new Date(ie.$y,Pe,Ie),ie);return ce?Me:Me.endOf(h)},me=function(Ie,Pe){return de.w(ie.toDate()[Ie].apply(ie.toDate("s"),(ce?[0,0,0,0]:[23,59,59,999]).slice(Pe)),ie)},_e=this.$W,Ee=this.$M,ke=this.$D,te="set"+(this.$u?"UTC":"");switch($){case m:return ce?Z(1,0):Z(31,11);case g:return ce?Z(1,Ee):Z(0,Ee+1);case p:var pe=this.$locale().weekStart||0,be=(_e<pe?_e+7:_e)-pe;return Z(ce?ke-be:ke+(6-be),Ee);case h:case C:return me(te+"Hours",0);case u:return me(te+"Minutes",1);case c:return me(te+"Seconds",2);case a:return me(te+"Milliseconds",3);default:return this.clone()}},re.endOf=function(j){return this.startOf(j,!1)},re.$set=function(j,se){var ie,ce=de.p(j),$="set"+(this.$u?"UTC":""),Z=(ie={},ie[h]=$+"Date",ie[C]=$+"Date",ie[g]=$+"Month",ie[m]=$+"FullYear",ie[u]=$+"Hours",ie[c]=$+"Minutes",ie[a]=$+"Seconds",ie[i]=$+"Milliseconds",ie)[ce],me=ce===h?this.$D+(se-this.$W):se;if(ce===g||ce===m){var _e=this.clone().set(C,1);_e.$d[Z](me),_e.init(),this.$d=_e.set(C,Math.min(this.$D,_e.daysInMonth())).$d}else Z&&this.$d[Z](me);return this.init(),this},re.set=function(j,se){return this.clone().$set(j,se)},re.get=function(j){return this[de.p(j)]()},re.add=function(j,se){var ie,ce=this;j=Number(j);var $=de.p(se),Z=function(Ee){var ke=z(ce);return de.w(ke.date(ke.date()+Math.round(Ee*j)),ce)};if($===g)return this.set(g,this.$M+j);if($===m)return this.set(m,this.$y+j);if($===h)return Z(1);if($===p)return Z(7);var me=(ie={},ie[c]=r,ie[u]=o,ie[a]=n,ie)[$]||1,_e=this.$d.getTime()+j*me;return de.w(_e,this)},re.subtract=function(j,se){return this.add(-1*j,se)},re.format=function(j){var se=this,ie=this.$locale();if(!this.isValid())return ie.invalidDate||b;var ce=j||"YYYY-MM-DDTHH:mm:ssZ",$=de.z(this),Z=this.$H,me=this.$m,_e=this.$M,Ee=ie.weekdays,ke=ie.months,te=ie.meridiem,pe=function(Pe,Me,fe,He){return Pe&&(Pe[Me]||Pe(se,ce))||fe[Me].slice(0,He)},be=function(Pe){return de.s(Z%12||12,Pe,"0")},Ie=te||function(Pe,Me,fe){var He=Pe<12?"AM":"PM";return fe?He.toLowerCase():He};return ce.replace(_,function(Pe,Me){return Me||function(fe){switch(fe){case"YY":return String(se.$y).slice(-2);case"YYYY":return de.s(se.$y,4,"0");case"M":return _e+1;case"MM":return de.s(_e+1,2,"0");case"MMM":return pe(ie.monthsShort,_e,ke,3);case"MMMM":return pe(ke,_e);case"D":return se.$D;case"DD":return de.s(se.$D,2,"0");case"d":return String(se.$W);case"dd":return pe(ie.weekdaysMin,se.$W,Ee,2);case"ddd":return pe(ie.weekdaysShort,se.$W,Ee,3);case"dddd":return Ee[se.$W];case"H":return String(Z);case"HH":return de.s(Z,2,"0");case"h":return be(1);case"hh":return be(2);case"a":return Ie(Z,me,!0);case"A":return Ie(Z,me,!1);case"m":return String(me);case"mm":return de.s(me,2,"0");case"s":return String(se.$s);case"ss":return de.s(se.$s,2,"0");case"SSS":return de.s(se.$ms,3,"0");case"Z":return $}return null}(Pe)||$.replace(":","")})},re.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},re.diff=function(j,se,ie){var ce,$=this,Z=de.p(se),me=z(j),_e=(me.utcOffset()-this.utcOffset())*r,Ee=this-me,ke=function(){return de.m($,me)};switch(Z){case m:ce=ke()/12;break;case g:ce=ke();break;case v:ce=ke()/3;break;case p:ce=(Ee-_e)/6048e5;break;case h:ce=(Ee-_e)/864e5;break;case u:ce=Ee/o;break;case c:ce=Ee/r;break;case a:ce=Ee/n;break;default:ce=Ee}return ie?ce:de.a(ce)},re.daysInMonth=function(){return this.endOf(g).$D},re.$locale=function(){return M[this.$L]},re.locale=function(j,se){if(!j)return this.$L;var ie=this.clone(),ce=Y(j,se,!0);return ce&&(ie.$L=ce),ie},re.clone=function(){return de.w(this.$d,this)},re.toDate=function(){return new Date(this.valueOf())},re.toJSON=function(){return this.isValid()?this.toISOString():null},re.toISOString=function(){return this.$d.toISOString()},re.toString=function(){return this.$d.toUTCString()},Q}(),ae=ne.prototype;return z.prototype=ae,[["$ms",i],["$s",a],["$m",c],["$H",u],["$W",h],["$M",g],["$y",m],["$D",C]].forEach(function(Q){ae[Q[1]]=function(re){return this.$g(re,Q[0],Q[1])}}),z.extend=function(Q,re){return Q.$i||(Q(re,ne,z),Q.$i=!0),z},z.locale=Y,z.isDayjs=W,z.unix=function(Q){return z(1e3*Q)},z.en=M[A],z.Ls=M,z.p={},z})})(g0);var mR=g0.exports;const m0=wf(mR);var bf={exports:{}};/**
|
|
69
|
+
* @license
|
|
70
|
+
* Lodash <https://lodash.com/>
|
|
71
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
72
|
+
* Released under MIT license <https://lodash.com/license>
|
|
73
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
74
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
75
|
+
*/bf.exports,function(t,e){(function(){var n,r="4.18.1",o=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",c="Invalid `variable` option passed into `_.template`",u="Invalid `imports` option passed into `_.template`",h="__lodash_hash_undefined__",p=500,g="__lodash_placeholder__",v=1,m=2,C=4,b=1,w=2,_=1,E=2,I=4,k=8,A=16,M=32,B=64,W=128,Y=256,z=512,de=30,ne="...",ae=800,Q=16,re=1,j=2,se=3,ie=1/0,ce=9007199254740991,$=17976931348623157e292,Z=NaN,me=4294967295,_e=me-1,Ee=me>>>1,ke=[["ary",W],["bind",_],["bindKey",E],["curry",k],["curryRight",A],["flip",z],["partial",M],["partialRight",B],["rearg",Y]],te="[object Arguments]",pe="[object Array]",be="[object AsyncFunction]",Ie="[object Boolean]",Pe="[object Date]",Me="[object DOMException]",fe="[object Error]",He="[object Function]",Ut="[object GeneratorFunction]",ct="[object Map]",ze="[object Number]",wt="[object Null]",vt="[object Object]",qt="[object Promise]",An="[object Proxy]",In="[object RegExp]",At="[object Set]",co="[object String]",sr="[object Symbol]",De="[object Undefined]",qe="[object WeakMap]",kt="[object WeakSet]",Et="[object ArrayBuffer]",Ht="[object DataView]",dn="[object Float32Array]",L="[object Float64Array]",X="[object Int8Array]",ee="[object Int16Array]",Ce="[object Int32Array]",Se="[object Uint8Array]",Oe="[object Uint8ClampedArray]",Ne="[object Uint16Array]",Re="[object Uint32Array]",Ge=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,Pt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Gn=/&(?:amp|lt|gt|quot|#39);/g,xr=/[&<>"']/g,Po=RegExp(Gn.source),Ye=RegExp(xr.source),Ln=/<%-([\s\S]+?)%>/g,Lc=/<%([\s\S]+?)%>/g,$r=/<%=([\s\S]+?)%>/g,ma=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,va=/^\w*$/,Fc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bd=/[\\^$.*+?()[\]{}|]/g,ya=RegExp(bd.source),xs=/^\s+/,xh=/\s/,Fy=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_h=/\{\n\/\* \[wrapped with (.+)\] \*/,$y=/,? & /,Sh=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,wa=/[()=,{}\[\]\/\s]/,Th=/\\(\\)?/g,ba=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Cd=/\w*$/,$c=/^[-+]0x[0-9a-f]+$/i,Uy=/^0b[01]+$/i,Di=/^\[object .+?Constructor\]$/,Eh=/^0o[0-7]+$/i,Uc=/^(?:0|[1-9]\d*)$/,Hc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_s=/($^)/,Hy=/['\n\r\u2028\u2029\\]/g,Ss="\\ud800-\\udfff",By="\\u0300-\\u036f",Ot="\\ufe20-\\ufe2f",xd="\\u20d0-\\u20ff",zy=By+Ot+xd,Ah="\\u2700-\\u27bf",Vy="a-z\\xdf-\\xf6\\xf8-\\xff",_d="\\xac\\xb1\\xd7\\xf7",Ih="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Bc="\\u2000-\\u206f",Sd=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Td="A-Z\\xc0-\\xd6\\xd8-\\xde",zc="\\ufe0e\\ufe0f",Ed=_d+Ih+Bc+Sd,lo="['’]",Ad="["+Ss+"]",kh="["+Ed+"]",Mi="["+zy+"]",Ri="\\d+",Ca="["+Ah+"]",xa="["+Vy+"]",ei="[^"+Ss+Ed+Ri+Ah+Vy+Td+"]",Id="\\ud83c[\\udffb-\\udfff]",Ts="(?:"+Mi+"|"+Id+")",kd="[^"+Ss+"]",_a="(?:\\ud83c[\\udde6-\\uddff]){2}",Vc="[\\ud800-\\udbff][\\udc00-\\udfff]",ti="["+Td+"]",Li="\\u200d",Fi="(?:"+xa+"|"+ei+")",Kc="(?:"+ti+"|"+ei+")",$i="(?:"+lo+"(?:d|ll|m|re|s|t|ve))?",Es="(?:"+lo+"(?:D|LL|M|RE|S|T|VE))?",Sa=Ts+"?",Ta="["+zc+"]?",Pd="(?:"+Li+"(?:"+[kd,_a,Vc].join("|")+")"+Ta+Sa+")*",As="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ea="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Od=Ta+Sa+Pd,Ky="(?:"+[Ca,_a,Vc].join("|")+")"+Od,Dt="(?:"+[kd+Mi+"?",Mi,_a,Vc,Ad].join("|")+")",Gc=RegExp(lo,"g"),Gy=RegExp(Mi,"g"),Aa=RegExp(Id+"(?="+Id+")|"+Dt+Od,"g"),jy=RegExp([ti+"?"+xa+"+"+$i+"(?="+[kh,ti,"$"].join("|")+")",Kc+"+"+Es+"(?="+[kh,ti+Fi,"$"].join("|")+")",ti+"?"+Fi+"+"+$i,ti+"+"+Es,Ea,As,Ri,Ky].join("|"),"g"),jc=RegExp("["+Li+Ss+zy+zc+"]"),Oo=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Nd=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],eI=-1,en={};en[dn]=en[L]=en[X]=en[ee]=en[Ce]=en[Se]=en[Oe]=en[Ne]=en[Re]=!0,en[te]=en[pe]=en[Et]=en[Ie]=en[Ht]=en[Pe]=en[fe]=en[He]=en[ct]=en[ze]=en[vt]=en[In]=en[At]=en[co]=en[qe]=!1;var Mt={};Mt[te]=Mt[pe]=Mt[Et]=Mt[Ht]=Mt[Ie]=Mt[Pe]=Mt[dn]=Mt[L]=Mt[X]=Mt[ee]=Mt[Ce]=Mt[ct]=Mt[ze]=Mt[vt]=Mt[In]=Mt[At]=Mt[co]=Mt[sr]=Mt[Se]=Mt[Oe]=Mt[Ne]=Mt[Re]=!0,Mt[fe]=Mt[He]=Mt[qe]=!1;var Ur={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},No={"&":"&","<":"<",">":">",'"':""","'":"'"},Wy={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ph={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ia=parseFloat,Is=parseInt,kn=typeof jo=="object"&&jo&&jo.Object===Object&&jo,Dd=typeof self=="object"&&self&&self.Object===Object&&self,Xt=kn||Dd||Function("return this")(),ka=e&&!e.nodeType&&e,Hr=ka&&!0&&t&&!t.nodeType&&t,jn=Hr&&Hr.exports===ka,Oh=jn&&kn.process,un=function(){try{var J=Hr&&Hr.require&&Hr.require("util").types;return J||Oh&&Oh.binding&&Oh.binding("util")}catch{}}(),ks=un&&un.isArrayBuffer,Nh=un&&un.isDate,Ui=un&&un.isMap,Pa=un&&un.isRegExp,Oa=un&&un.isSet,Ps=un&&un.isTypedArray;function Wn(J,ge,ue){switch(ue.length){case 0:return J.call(ge);case 1:return J.call(ge,ue[0]);case 2:return J.call(ge,ue[0],ue[1]);case 3:return J.call(ge,ue[0],ue[1],ue[2])}return J.apply(ge,ue)}function Dh(J,ge,ue,Ke){for(var at=-1,_t=J==null?0:J.length;++at<_t;){var Vt=J[at];ge(Ke,Vt,ue(Vt),J)}return Ke}function ar(J,ge){for(var ue=-1,Ke=J==null?0:J.length;++ue<Ke&&ge(J[ue],ue,J)!==!1;);return J}function Mh(J,ge){for(var ue=J==null?0:J.length;ue--&&ge(J[ue],ue,J)!==!1;);return J}function Md(J,ge){for(var ue=-1,Ke=J==null?0:J.length;++ue<Ke;)if(!ge(J[ue],ue,J))return!1;return!0}function uo(J,ge){for(var ue=-1,Ke=J==null?0:J.length,at=0,_t=[];++ue<Ke;){var Vt=J[ue];ge(Vt,ue,J)&&(_t[at++]=Vt)}return _t}function Na(J,ge){var ue=J==null?0:J.length;return!!ue&&Hi(J,ge,0)>-1}function Do(J,ge,ue){for(var Ke=-1,at=J==null?0:J.length;++Ke<at;)if(ue(ge,J[Ke]))return!0;return!1}function Zt(J,ge){for(var ue=-1,Ke=J==null?0:J.length,at=Array(Ke);++ue<Ke;)at[ue]=ge(J[ue],ue,J);return at}function tn(J,ge){for(var ue=-1,Ke=ge.length,at=J.length;++ue<Ke;)J[at+ue]=ge[ue];return J}function Da(J,ge,ue,Ke){var at=-1,_t=J==null?0:J.length;for(Ke&&_t&&(ue=J[++at]);++at<_t;)ue=ge(ue,J[at],at,J);return ue}function Wc(J,ge,ue,Ke){var at=J==null?0:J.length;for(Ke&&at&&(ue=J[--at]);at--;)ue=ge(ue,J[at],at,J);return ue}function qc(J,ge){for(var ue=-1,Ke=J==null?0:J.length;++ue<Ke;)if(ge(J[ue],ue,J))return!0;return!1}var Rh=Ra("length");function Ma(J){return J.split("")}function qy(J){return J.match(Sh)||[]}function Rd(J,ge,ue){var Ke;return ue(J,function(at,_t,Vt){if(ge(at,_t,Vt))return Ke=_t,!1}),Ke}function Yc(J,ge,ue,Ke){for(var at=J.length,_t=ue+(Ke?1:-1);Ke?_t--:++_t<at;)if(ge(J[_t],_t,J))return _t;return-1}function Hi(J,ge,ue){return ge===ge?Xy(J,ge,ue):Yc(J,Ld,ue)}function Lh(J,ge,ue,Ke){for(var at=ue-1,_t=J.length;++at<_t;)if(Ke(J[at],ge))return at;return-1}function Ld(J){return J!==J}function Fd(J,ge){var ue=J==null?0:J.length;return ue?Jc(J,ge)/ue:Z}function Ra(J){return function(ge){return ge==null?n:ge[J]}}function Qc(J){return function(ge){return J==null?n:J[ge]}}function $d(J,ge,ue,Ke,at){return at(J,function(_t,Vt,Kt){ue=Ke?(Ke=!1,_t):ge(ue,_t,Vt,Kt)}),ue}function Ud(J,ge){var ue=J.length;for(J.sort(ge);ue--;)J[ue]=J[ue].value;return J}function Jc(J,ge){for(var ue,Ke=-1,at=J.length;++Ke<at;){var _t=ge(J[Ke]);_t!==n&&(ue=ue===n?_t:ue+_t)}return ue}function Hd(J,ge){for(var ue=-1,Ke=Array(J);++ue<J;)Ke[ue]=ge(ue);return Ke}function Bd(J,ge){return Zt(ge,function(ue){return[ue,J[ue]]})}function Xc(J){return J&&J.slice(0,Vh(J)+1).replace(xs,"")}function _r(J){return function(ge){return J(ge)}}function zd(J,ge){return Zt(ge,function(ue){return J[ue]})}function Os(J,ge){return J.has(ge)}function Fh(J,ge){for(var ue=-1,Ke=J.length;++ue<Ke&&Hi(ge,J[ue],0)>-1;);return ue}function $h(J,ge){for(var ue=J.length;ue--&&Hi(ge,J[ue],0)>-1;);return ue}function Zc(J,ge){for(var ue=J.length,Ke=0;ue--;)J[ue]===ge&&++Ke;return Ke}var Uh=Qc(Ur),La=Qc(No);function Yy(J){return"\\"+Ph[J]}function Hh(J,ge){return J==null?n:J[ge]}function Ns(J){return jc.test(J)}function Qy(J){return Oo.test(J)}function Jy(J){for(var ge,ue=[];!(ge=J.next()).done;)ue.push(ge.value);return ue}function Vd(J){var ge=-1,ue=Array(J.size);return J.forEach(function(Ke,at){ue[++ge]=[at,Ke]}),ue}function Bh(J,ge){return function(ue){return J(ge(ue))}}function Mo(J,ge){for(var ue=-1,Ke=J.length,at=0,_t=[];++ue<Ke;){var Vt=J[ue];(Vt===ge||Vt===g)&&(J[ue]=g,_t[at++]=ue)}return _t}function el(J){var ge=-1,ue=Array(J.size);return J.forEach(function(Ke){ue[++ge]=Ke}),ue}function zh(J){var ge=-1,ue=Array(J.size);return J.forEach(function(Ke){ue[++ge]=[Ke,Ke]}),ue}function Xy(J,ge,ue){for(var Ke=ue-1,at=J.length;++Ke<at;)if(J[Ke]===ge)return Ke;return-1}function Zy(J,ge,ue){for(var Ke=ue+1;Ke--;)if(J[Ke]===ge)return Ke;return Ke}function Bi(J){return Ns(J)?tw(J):Rh(J)}function Sr(J){return Ns(J)?nw(J):Ma(J)}function Vh(J){for(var ge=J.length;ge--&&xh.test(J.charAt(ge)););return ge}var ew=Qc(Wy);function tw(J){for(var ge=Aa.lastIndex=0;Aa.test(J);)++ge;return ge}function nw(J){return J.match(Aa)||[]}function tl(J){return J.match(jy)||[]}var rw=function J(ge){ge=ge==null?Xt:Ds.defaults(Xt.Object(),ge,Ds.pick(Xt,Nd));var ue=ge.Array,Ke=ge.Date,at=ge.Error,_t=ge.Function,Vt=ge.Math,Kt=ge.Object,nl=ge.RegExp,ow=ge.String,Br=ge.TypeError,Jr=ue.prototype,iw=_t.prototype,Ms=Kt.prototype,rl=ge["__core-js_shared__"],ol=iw.toString,Nt=Ms.hasOwnProperty,sw=0,Kd=function(){var s=/[^.]+$/.exec(rl&&rl.keys&&rl.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Xr=Ms.toString,Fa=ol.call(Kt),aw=Xt._,ni=nl("^"+ol.call(Nt).replace(bd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),il=jn?ge.Buffer:n,ri=ge.Symbol,Rs=ge.Uint8Array,Kh=il?il.allocUnsafe:n,sl=Bh(Kt.getPrototypeOf,Kt),$a=Kt.create,Gh=Ms.propertyIsEnumerable,al=Jr.splice,jh=ri?ri.isConcatSpreadable:n,Ls=ri?ri.iterator:n,oi=ri?ri.toStringTag:n,cl=function(){try{var s=Va(Kt,"defineProperty");return s({},"",{}),s}catch{}}(),Wh=ge.clearTimeout!==Xt.clearTimeout&&ge.clearTimeout,Gd=Ke&&Ke.now!==Xt.Date.now&&Ke.now,qh=ge.setTimeout!==Xt.setTimeout&&ge.setTimeout,ll=Vt.ceil,dl=Vt.floor,ul=Kt.getOwnPropertySymbols,jd=il?il.isBuffer:n,Wd=ge.isFinite,cw=Jr.join,zi=Bh(Kt.keys,Kt),Yt=Vt.max,Cn=Vt.min,lw=Ke.now,Yh=ge.parseInt,qd=Vt.random,x=Jr.reverse,R=Va(ge,"DataView"),N=Va(ge,"Map"),G=Va(ge,"Promise"),U=Va(ge,"Set"),V=Va(ge,"WeakMap"),le=Va(Kt,"create"),xe=V&&new V,Le={},Je=Ka(R),lt=Ka(N),mn=Ka(G),fn=Ka(U),qn=Ka(V),vn=ri?ri.prototype:n,sn=vn?vn.valueOf:n,Nn=vn?vn.toString:n;function P(s){if(yn(s)&&!dt(s)&&!(s instanceof Ct)){if(s instanceof fo)return s;if(Nt.call(s,"__wrapped__"))return tk(s)}return new fo(s)}var fl=function(){function s(){}return function(l){if(!hn(l))return{};if($a)return $a(l);s.prototype=l;var f=new s;return s.prototype=n,f}}();function Qh(){}function fo(s,l){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=n}P.templateSettings={escape:Ln,evaluate:Lc,interpolate:$r,variable:"",imports:{_:P}},P.prototype=Qh.prototype,P.prototype.constructor=P,fo.prototype=fl(Qh.prototype),fo.prototype.constructor=fo;function Ct(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=me,this.__views__=[]}function hz(){var s=new Ct(this.__wrapped__);return s.__actions__=zr(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=zr(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=zr(this.__views__),s}function pz(){if(this.__filtered__){var s=new Ct(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function gz(){var s=this.__wrapped__.value(),l=this.__dir__,f=dt(s),y=l<0,T=f?s.length:0,O=AV(0,T,this.__views__),F=O.start,K=O.end,oe=K-F,ye=y?K:F-1,we=this.__iteratees__,Te=we.length,Ue=0,Qe=Cn(oe,this.__takeCount__);if(!f||!y&&T==oe&&Qe==oe)return SI(s,this.__actions__);var ot=[];e:for(;oe--&&Ue<Qe;){ye+=l;for(var gt=-1,tt=s[ye];++gt<Te;){var yt=we[gt],St=yt.iteratee,to=yt.type,Ar=St(tt);if(to==j)tt=Ar;else if(!Ar){if(to==re)continue e;break e}}ot[Ue++]=tt}return ot}Ct.prototype=fl(Qh.prototype),Ct.prototype.constructor=Ct;function Ua(s){var l=-1,f=s==null?0:s.length;for(this.clear();++l<f;){var y=s[l];this.set(y[0],y[1])}}function mz(){this.__data__=le?le(null):{},this.size=0}function vz(s){var l=this.has(s)&&delete this.__data__[s];return this.size-=l?1:0,l}function yz(s){var l=this.__data__;if(le){var f=l[s];return f===h?n:f}return Nt.call(l,s)?l[s]:n}function wz(s){var l=this.__data__;return le?l[s]!==n:Nt.call(l,s)}function bz(s,l){var f=this.__data__;return this.size+=this.has(s)?0:1,f[s]=le&&l===n?h:l,this}Ua.prototype.clear=mz,Ua.prototype.delete=vz,Ua.prototype.get=yz,Ua.prototype.has=wz,Ua.prototype.set=bz;function Vi(s){var l=-1,f=s==null?0:s.length;for(this.clear();++l<f;){var y=s[l];this.set(y[0],y[1])}}function Cz(){this.__data__=[],this.size=0}function xz(s){var l=this.__data__,f=Jh(l,s);if(f<0)return!1;var y=l.length-1;return f==y?l.pop():al.call(l,f,1),--this.size,!0}function _z(s){var l=this.__data__,f=Jh(l,s);return f<0?n:l[f][1]}function Sz(s){return Jh(this.__data__,s)>-1}function Tz(s,l){var f=this.__data__,y=Jh(f,s);return y<0?(++this.size,f.push([s,l])):f[y][1]=l,this}Vi.prototype.clear=Cz,Vi.prototype.delete=xz,Vi.prototype.get=_z,Vi.prototype.has=Sz,Vi.prototype.set=Tz;function Ki(s){var l=-1,f=s==null?0:s.length;for(this.clear();++l<f;){var y=s[l];this.set(y[0],y[1])}}function Ez(){this.size=0,this.__data__={hash:new Ua,map:new(N||Vi),string:new Ua}}function Az(s){var l=lp(this,s).delete(s);return this.size-=l?1:0,l}function Iz(s){return lp(this,s).get(s)}function kz(s){return lp(this,s).has(s)}function Pz(s,l){var f=lp(this,s),y=f.size;return f.set(s,l),this.size+=f.size==y?0:1,this}Ki.prototype.clear=Ez,Ki.prototype.delete=Az,Ki.prototype.get=Iz,Ki.prototype.has=kz,Ki.prototype.set=Pz;function Ha(s){var l=-1,f=s==null?0:s.length;for(this.__data__=new Ki;++l<f;)this.add(s[l])}function Oz(s){return this.__data__.set(s,h),this}function Nz(s){return this.__data__.has(s)}Ha.prototype.add=Ha.prototype.push=Oz,Ha.prototype.has=Nz;function Ro(s){var l=this.__data__=new Vi(s);this.size=l.size}function Dz(){this.__data__=new Vi,this.size=0}function Mz(s){var l=this.__data__,f=l.delete(s);return this.size=l.size,f}function Rz(s){return this.__data__.get(s)}function Lz(s){return this.__data__.has(s)}function Fz(s,l){var f=this.__data__;if(f instanceof Vi){var y=f.__data__;if(!N||y.length<o-1)return y.push([s,l]),this.size=++f.size,this;f=this.__data__=new Ki(y)}return f.set(s,l),this.size=f.size,this}Ro.prototype.clear=Dz,Ro.prototype.delete=Mz,Ro.prototype.get=Rz,Ro.prototype.has=Lz,Ro.prototype.set=Fz;function tI(s,l){var f=dt(s),y=!f&&Ga(s),T=!f&&!y&&Bs(s),O=!f&&!y&&!T&&ml(s),F=f||y||T||O,K=F?Hd(s.length,ow):[],oe=K.length;for(var ye in s)(l||Nt.call(s,ye))&&!(F&&(ye=="length"||T&&(ye=="offset"||ye=="parent")||O&&(ye=="buffer"||ye=="byteLength"||ye=="byteOffset")||Wi(ye,oe)))&&K.push(ye);return K}function nI(s){var l=s.length;return l?s[bw(0,l-1)]:n}function $z(s,l){return dp(zr(s),Ba(l,0,s.length))}function Uz(s){return dp(zr(s))}function dw(s,l,f){(f!==n&&!Fo(s[l],f)||f===n&&!(l in s))&&ii(s,l,f)}function Yd(s,l,f){var y=s[l];(!(Nt.call(s,l)&&Fo(y,f))||f===n&&!(l in s))&&ii(s,l,f)}function Jh(s,l){for(var f=s.length;f--;)if(Fo(s[f][0],l))return f;return-1}function Hz(s,l,f,y){return Fs(s,function(T,O,F){l(y,T,f(T),F)}),y}function rI(s,l){return s&&ai(l,Fn(l),s)}function Bz(s,l){return s&&ai(l,Kr(l),s)}function ii(s,l,f){l=="__proto__"&&cl?cl(s,l,{configurable:!0,enumerable:!0,value:f,writable:!0}):s[l]=f}function uw(s,l){for(var f=-1,y=l.length,T=ue(y),O=s==null;++f<y;)T[f]=O?n:jw(s,l[f]);return T}function Ba(s,l,f){return s===s&&(f!==n&&(s=s<=f?s:f),l!==n&&(s=s>=l?s:l)),s}function ho(s,l,f,y,T,O){var F,K=l&v,oe=l&m,ye=l&C;if(f&&(F=T?f(s,y,T,O):f(s)),F!==n)return F;if(!hn(s))return s;var we=dt(s);if(we){if(F=kV(s),!K)return zr(s,F)}else{var Te=cr(s),Ue=Te==He||Te==Ut;if(Bs(s))return AI(s,K);if(Te==vt||Te==te||Ue&&!T){if(F=oe||Ue?{}:jI(s),!K)return oe?yV(s,Bz(F,s)):vV(s,rI(F,s))}else{if(!Mt[Te])return T?s:{};F=PV(s,Te,K)}}O||(O=new Ro);var Qe=O.get(s);if(Qe)return Qe;O.set(s,F),Ck(s)?s.forEach(function(tt){F.add(ho(tt,l,f,tt,s,O))}):wk(s)&&s.forEach(function(tt,yt){F.set(yt,ho(tt,l,f,yt,s,O))});var ot=ye?oe?Ow:Pw:oe?Kr:Fn,gt=we?n:ot(s);return ar(gt||s,function(tt,yt){gt&&(yt=tt,tt=s[yt]),Yd(F,yt,ho(tt,l,f,yt,s,O))}),F}function zz(s){var l=Fn(s);return function(f){return oI(f,s,l)}}function oI(s,l,f){var y=f.length;if(s==null)return!y;for(s=Kt(s);y--;){var T=f[y],O=l[T],F=s[T];if(F===n&&!(T in s)||!O(F))return!1}return!0}function iI(s,l,f){if(typeof s!="function")throw new Br(a);return nu(function(){s.apply(n,f)},l)}function Qd(s,l,f,y){var T=-1,O=Na,F=!0,K=s.length,oe=[],ye=l.length;if(!K)return oe;f&&(l=Zt(l,_r(f))),y?(O=Do,F=!1):l.length>=o&&(O=Os,F=!1,l=new Ha(l));e:for(;++T<K;){var we=s[T],Te=f==null?we:f(we);if(we=y||we!==0?we:0,F&&Te===Te){for(var Ue=ye;Ue--;)if(l[Ue]===Te)continue e;oe.push(we)}else O(l,Te,y)||oe.push(we)}return oe}var Fs=NI(si),sI=NI(hw,!0);function Vz(s,l){var f=!0;return Fs(s,function(y,T,O){return f=!!l(y,T,O),f}),f}function Xh(s,l,f){for(var y=-1,T=s.length;++y<T;){var O=s[y],F=l(O);if(F!=null&&(K===n?F===F&&!eo(F):f(F,K)))var K=F,oe=O}return oe}function Kz(s,l,f,y){var T=s.length;for(f=ft(f),f<0&&(f=-f>T?0:T+f),y=y===n||y>T?T:ft(y),y<0&&(y+=T),y=f>y?0:_k(y);f<y;)s[f++]=l;return s}function aI(s,l){var f=[];return Fs(s,function(y,T,O){l(y,T,O)&&f.push(y)}),f}function Yn(s,l,f,y,T){var O=-1,F=s.length;for(f||(f=NV),T||(T=[]);++O<F;){var K=s[O];l>0&&f(K)?l>1?Yn(K,l-1,f,y,T):tn(T,K):y||(T[T.length]=K)}return T}var fw=DI(),cI=DI(!0);function si(s,l){return s&&fw(s,l,Fn)}function hw(s,l){return s&&cI(s,l,Fn)}function Zh(s,l){return uo(l,function(f){return qi(s[f])})}function za(s,l){l=Us(l,s);for(var f=0,y=l.length;s!=null&&f<y;)s=s[Lo(l[f++])];return f&&f==y?s:n}function lI(s,l,f){var y=l(s);return dt(s)?y:tn(y,f(s))}function Tr(s){return s==null?s===n?De:wt:oi&&oi in Kt(s)?EV(s):UV(s)}function pw(s,l){return s>l}function Gz(s,l){return s!=null&&Nt.call(s,l)}function jz(s,l){return s!=null&&l in Kt(s)}function Wz(s,l,f){return s>=Cn(l,f)&&s<Yt(l,f)}function gw(s,l,f){for(var y=f?Do:Na,T=s[0].length,O=s.length,F=O,K=ue(O),oe=1/0,ye=[];F--;){var we=s[F];F&&l&&(we=Zt(we,_r(l))),oe=Cn(we.length,oe),K[F]=!f&&(l||T>=120&&we.length>=120)?new Ha(F&&we):n}we=s[0];var Te=-1,Ue=K[0];e:for(;++Te<T&&ye.length<oe;){var Qe=we[Te],ot=l?l(Qe):Qe;if(Qe=f||Qe!==0?Qe:0,!(Ue?Os(Ue,ot):y(ye,ot,f))){for(F=O;--F;){var gt=K[F];if(!(gt?Os(gt,ot):y(s[F],ot,f)))continue e}Ue&&Ue.push(ot),ye.push(Qe)}}return ye}function qz(s,l,f,y){return si(s,function(T,O,F){l(y,f(T),O,F)}),y}function Jd(s,l,f){l=Us(l,s),s=QI(s,l);var y=s==null?s:s[Lo(go(l))];return y==null?n:Wn(y,s,f)}function dI(s){return yn(s)&&Tr(s)==te}function Yz(s){return yn(s)&&Tr(s)==Et}function Qz(s){return yn(s)&&Tr(s)==Pe}function Xd(s,l,f,y,T){return s===l?!0:s==null||l==null||!yn(s)&&!yn(l)?s!==s&&l!==l:Jz(s,l,f,y,Xd,T)}function Jz(s,l,f,y,T,O){var F=dt(s),K=dt(l),oe=F?pe:cr(s),ye=K?pe:cr(l);oe=oe==te?vt:oe,ye=ye==te?vt:ye;var we=oe==vt,Te=ye==vt,Ue=oe==ye;if(Ue&&Bs(s)){if(!Bs(l))return!1;F=!0,we=!1}if(Ue&&!we)return O||(O=new Ro),F||ml(s)?VI(s,l,f,y,T,O):SV(s,l,oe,f,y,T,O);if(!(f&b)){var Qe=we&&Nt.call(s,"__wrapped__"),ot=Te&&Nt.call(l,"__wrapped__");if(Qe||ot){var gt=Qe?s.value():s,tt=ot?l.value():l;return O||(O=new Ro),T(gt,tt,f,y,O)}}return Ue?(O||(O=new Ro),TV(s,l,f,y,T,O)):!1}function Xz(s){return yn(s)&&cr(s)==ct}function mw(s,l,f,y){var T=f.length,O=T,F=!y;if(s==null)return!O;for(s=Kt(s);T--;){var K=f[T];if(F&&K[2]?K[1]!==s[K[0]]:!(K[0]in s))return!1}for(;++T<O;){K=f[T];var oe=K[0],ye=s[oe],we=K[1];if(F&&K[2]){if(ye===n&&!(oe in s))return!1}else{var Te=new Ro;if(y)var Ue=y(ye,we,oe,s,l,Te);if(!(Ue===n?Xd(we,ye,b|w,y,Te):Ue))return!1}}return!0}function uI(s){if(!hn(s)||MV(s))return!1;var l=qi(s)?ni:Di;return l.test(Ka(s))}function Zz(s){return yn(s)&&Tr(s)==In}function eV(s){return yn(s)&&cr(s)==At}function tV(s){return yn(s)&&mp(s.length)&&!!en[Tr(s)]}function fI(s){return typeof s=="function"?s:s==null?Gr:typeof s=="object"?dt(s)?gI(s[0],s[1]):pI(s):Rk(s)}function vw(s){if(!tu(s))return zi(s);var l=[];for(var f in Kt(s))Nt.call(s,f)&&f!="constructor"&&l.push(f);return l}function nV(s){if(!hn(s))return $V(s);var l=tu(s),f=[];for(var y in s)y=="constructor"&&(l||!Nt.call(s,y))||f.push(y);return f}function yw(s,l){return s<l}function hI(s,l){var f=-1,y=Vr(s)?ue(s.length):[];return Fs(s,function(T,O,F){y[++f]=l(T,O,F)}),y}function pI(s){var l=Dw(s);return l.length==1&&l[0][2]?qI(l[0][0],l[0][1]):function(f){return f===s||mw(f,s,l)}}function gI(s,l){return Rw(s)&&WI(l)?qI(Lo(s),l):function(f){var y=jw(f,s);return y===n&&y===l?Ww(f,s):Xd(l,y,b|w)}}function ep(s,l,f,y,T){s!==l&&fw(l,function(O,F){if(T||(T=new Ro),hn(O))rV(s,l,F,f,ep,y,T);else{var K=y?y(Fw(s,F),O,F+"",s,l,T):n;K===n&&(K=O),dw(s,F,K)}},Kr)}function rV(s,l,f,y,T,O,F){var K=Fw(s,f),oe=Fw(l,f),ye=F.get(oe);if(ye){dw(s,f,ye);return}var we=O?O(K,oe,f+"",s,l,F):n,Te=we===n;if(Te){var Ue=dt(oe),Qe=!Ue&&Bs(oe),ot=!Ue&&!Qe&&ml(oe);we=oe,Ue||Qe||ot?dt(K)?we=K:xn(K)?we=zr(K):Qe?(Te=!1,we=AI(oe,!0)):ot?(Te=!1,we=II(oe,!0)):we=[]:ru(oe)||Ga(oe)?(we=K,Ga(K)?we=Sk(K):(!hn(K)||qi(K))&&(we=jI(oe))):Te=!1}Te&&(F.set(oe,we),T(we,oe,y,O,F),F.delete(oe)),dw(s,f,we)}function mI(s,l){var f=s.length;if(f)return l+=l<0?f:0,Wi(l,f)?s[l]:n}function vI(s,l,f){l.length?l=Zt(l,function(O){return dt(O)?function(F){return za(F,O.length===1?O[0]:O)}:O}):l=[Gr];var y=-1;l=Zt(l,_r(rt()));var T=hI(s,function(O,F,K){var oe=Zt(l,function(ye){return ye(O)});return{criteria:oe,index:++y,value:O}});return Ud(T,function(O,F){return mV(O,F,f)})}function oV(s,l){return yI(s,l,function(f,y){return Ww(s,y)})}function yI(s,l,f){for(var y=-1,T=l.length,O={};++y<T;){var F=l[y],K=za(s,F);f(K,F)&&Zd(O,Us(F,s),K)}return O}function iV(s){return function(l){return za(l,s)}}function ww(s,l,f,y){var T=y?Lh:Hi,O=-1,F=l.length,K=s;for(s===l&&(l=zr(l)),f&&(K=Zt(s,_r(f)));++O<F;)for(var oe=0,ye=l[O],we=f?f(ye):ye;(oe=T(K,we,oe,y))>-1;)K!==s&&al.call(K,oe,1),al.call(s,oe,1);return s}function wI(s,l){for(var f=s?l.length:0,y=f-1;f--;){var T=l[f];if(f==y||T!==O){var O=T;Wi(T)?al.call(s,T,1):_w(s,T)}}return s}function bw(s,l){return s+dl(qd()*(l-s+1))}function sV(s,l,f,y){for(var T=-1,O=Yt(ll((l-s)/(f||1)),0),F=ue(O);O--;)F[y?O:++T]=s,s+=f;return F}function Cw(s,l){var f="";if(!s||l<1||l>ce)return f;do l%2&&(f+=s),l=dl(l/2),l&&(s+=s);while(l);return f}function mt(s,l){return $w(YI(s,l,Gr),s+"")}function aV(s){return nI(vl(s))}function cV(s,l){var f=vl(s);return dp(f,Ba(l,0,f.length))}function Zd(s,l,f,y){if(!hn(s))return s;l=Us(l,s);for(var T=-1,O=l.length,F=O-1,K=s;K!=null&&++T<O;){var oe=Lo(l[T]),ye=f;if(oe==="__proto__"||oe==="constructor"||oe==="prototype")return s;if(T!=F){var we=K[oe];ye=y?y(we,oe,K):n,ye===n&&(ye=hn(we)?we:Wi(l[T+1])?[]:{})}Yd(K,oe,ye),K=K[oe]}return s}var bI=xe?function(s,l){return xe.set(s,l),s}:Gr,lV=cl?function(s,l){return cl(s,"toString",{configurable:!0,enumerable:!1,value:Yw(l),writable:!0})}:Gr;function dV(s){return dp(vl(s))}function po(s,l,f){var y=-1,T=s.length;l<0&&(l=-l>T?0:T+l),f=f>T?T:f,f<0&&(f+=T),T=l>f?0:f-l>>>0,l>>>=0;for(var O=ue(T);++y<T;)O[y]=s[y+l];return O}function uV(s,l){var f;return Fs(s,function(y,T,O){return f=l(y,T,O),!f}),!!f}function tp(s,l,f){var y=0,T=s==null?y:s.length;if(typeof l=="number"&&l===l&&T<=Ee){for(;y<T;){var O=y+T>>>1,F=s[O];F!==null&&!eo(F)&&(f?F<=l:F<l)?y=O+1:T=O}return T}return xw(s,l,Gr,f)}function xw(s,l,f,y){var T=0,O=s==null?0:s.length;if(O===0)return 0;l=f(l);for(var F=l!==l,K=l===null,oe=eo(l),ye=l===n;T<O;){var we=dl((T+O)/2),Te=f(s[we]),Ue=Te!==n,Qe=Te===null,ot=Te===Te,gt=eo(Te);if(F)var tt=y||ot;else ye?tt=ot&&(y||Ue):K?tt=ot&&Ue&&(y||!Qe):oe?tt=ot&&Ue&&!Qe&&(y||!gt):Qe||gt?tt=!1:tt=y?Te<=l:Te<l;tt?T=we+1:O=we}return Cn(O,_e)}function CI(s,l){for(var f=-1,y=s.length,T=0,O=[];++f<y;){var F=s[f],K=l?l(F):F;if(!f||!Fo(K,oe)){var oe=K;O[T++]=F===0?0:F}}return O}function xI(s){return typeof s=="number"?s:eo(s)?Z:+s}function Zr(s){if(typeof s=="string")return s;if(dt(s))return Zt(s,Zr)+"";if(eo(s))return Nn?Nn.call(s):"";var l=s+"";return l=="0"&&1/s==-ie?"-0":l}function $s(s,l,f){var y=-1,T=Na,O=s.length,F=!0,K=[],oe=K;if(f)F=!1,T=Do;else if(O>=o){var ye=l?null:xV(s);if(ye)return el(ye);F=!1,T=Os,oe=new Ha}else oe=l?[]:K;e:for(;++y<O;){var we=s[y],Te=l?l(we):we;if(we=f||we!==0?we:0,F&&Te===Te){for(var Ue=oe.length;Ue--;)if(oe[Ue]===Te)continue e;l&&oe.push(Te),K.push(we)}else T(oe,Te,f)||(oe!==K&&oe.push(Te),K.push(we))}return K}function _w(s,l){l=Us(l,s);var f=-1,y=l.length;if(!y)return!0;for(;++f<y;){var T=Lo(l[f]);if(T==="__proto__"&&!Nt.call(s,"__proto__")||(T==="constructor"||T==="prototype")&&f<y-1)return!1}var O=QI(s,l);return O==null||delete O[Lo(go(l))]}function _I(s,l,f,y){return Zd(s,l,f(za(s,l)),y)}function np(s,l,f,y){for(var T=s.length,O=y?T:-1;(y?O--:++O<T)&&l(s[O],O,s););return f?po(s,y?0:O,y?O+1:T):po(s,y?O+1:0,y?T:O)}function SI(s,l){var f=s;return f instanceof Ct&&(f=f.value()),Da(l,function(y,T){return T.func.apply(T.thisArg,tn([y],T.args))},f)}function Sw(s,l,f){var y=s.length;if(y<2)return y?$s(s[0]):[];for(var T=-1,O=ue(y);++T<y;)for(var F=s[T],K=-1;++K<y;)K!=T&&(O[T]=Qd(O[T]||F,s[K],l,f));return $s(Yn(O,1),l,f)}function TI(s,l,f){for(var y=-1,T=s.length,O=l.length,F={};++y<T;){var K=y<O?l[y]:n;f(F,s[y],K)}return F}function Tw(s){return xn(s)?s:[]}function Ew(s){return typeof s=="function"?s:Gr}function Us(s,l){return dt(s)?s:Rw(s,l)?[s]:ek(Bt(s))}var fV=mt;function Hs(s,l,f){var y=s.length;return f=f===n?y:f,!l&&f>=y?s:po(s,l,f)}var EI=Wh||function(s){return Xt.clearTimeout(s)};function AI(s,l){if(l)return s.slice();var f=s.length,y=Kh?Kh(f):new s.constructor(f);return s.copy(y),y}function Aw(s){var l=new s.constructor(s.byteLength);return new Rs(l).set(new Rs(s)),l}function hV(s,l){var f=l?Aw(s.buffer):s.buffer;return new s.constructor(f,s.byteOffset,s.byteLength)}function pV(s){var l=new s.constructor(s.source,Cd.exec(s));return l.lastIndex=s.lastIndex,l}function gV(s){return sn?Kt(sn.call(s)):{}}function II(s,l){var f=l?Aw(s.buffer):s.buffer;return new s.constructor(f,s.byteOffset,s.length)}function kI(s,l){if(s!==l){var f=s!==n,y=s===null,T=s===s,O=eo(s),F=l!==n,K=l===null,oe=l===l,ye=eo(l);if(!K&&!ye&&!O&&s>l||O&&F&&oe&&!K&&!ye||y&&F&&oe||!f&&oe||!T)return 1;if(!y&&!O&&!ye&&s<l||ye&&f&&T&&!y&&!O||K&&f&&T||!F&&T||!oe)return-1}return 0}function mV(s,l,f){for(var y=-1,T=s.criteria,O=l.criteria,F=T.length,K=f.length;++y<F;){var oe=kI(T[y],O[y]);if(oe){if(y>=K)return oe;var ye=f[y];return oe*(ye=="desc"?-1:1)}}return s.index-l.index}function PI(s,l,f,y){for(var T=-1,O=s.length,F=f.length,K=-1,oe=l.length,ye=Yt(O-F,0),we=ue(oe+ye),Te=!y;++K<oe;)we[K]=l[K];for(;++T<F;)(Te||T<O)&&(we[f[T]]=s[T]);for(;ye--;)we[K++]=s[T++];return we}function OI(s,l,f,y){for(var T=-1,O=s.length,F=-1,K=f.length,oe=-1,ye=l.length,we=Yt(O-K,0),Te=ue(we+ye),Ue=!y;++T<we;)Te[T]=s[T];for(var Qe=T;++oe<ye;)Te[Qe+oe]=l[oe];for(;++F<K;)(Ue||T<O)&&(Te[Qe+f[F]]=s[T++]);return Te}function zr(s,l){var f=-1,y=s.length;for(l||(l=ue(y));++f<y;)l[f]=s[f];return l}function ai(s,l,f,y){var T=!f;f||(f={});for(var O=-1,F=l.length;++O<F;){var K=l[O],oe=y?y(f[K],s[K],K,f,s):n;oe===n&&(oe=s[K]),T?ii(f,K,oe):Yd(f,K,oe)}return f}function vV(s,l){return ai(s,Mw(s),l)}function yV(s,l){return ai(s,KI(s),l)}function rp(s,l){return function(f,y){var T=dt(f)?Dh:Hz,O=l?l():{};return T(f,s,rt(y,2),O)}}function hl(s){return mt(function(l,f){var y=-1,T=f.length,O=T>1?f[T-1]:n,F=T>2?f[2]:n;for(O=s.length>3&&typeof O=="function"?(T--,O):n,F&&Er(f[0],f[1],F)&&(O=T<3?n:O,T=1),l=Kt(l);++y<T;){var K=f[y];K&&s(l,K,y,O)}return l})}function NI(s,l){return function(f,y){if(f==null)return f;if(!Vr(f))return s(f,y);for(var T=f.length,O=l?T:-1,F=Kt(f);(l?O--:++O<T)&&y(F[O],O,F)!==!1;);return f}}function DI(s){return function(l,f,y){for(var T=-1,O=Kt(l),F=y(l),K=F.length;K--;){var oe=F[s?K:++T];if(f(O[oe],oe,O)===!1)break}return l}}function wV(s,l,f){var y=l&_,T=eu(s);function O(){var F=this&&this!==Xt&&this instanceof O?T:s;return F.apply(y?f:this,arguments)}return O}function MI(s){return function(l){l=Bt(l);var f=Ns(l)?Sr(l):n,y=f?f[0]:l.charAt(0),T=f?Hs(f,1).join(""):l.slice(1);return y[s]()+T}}function pl(s){return function(l){return Da(Dk(Nk(l).replace(Gc,"")),s,"")}}function eu(s){return function(){var l=arguments;switch(l.length){case 0:return new s;case 1:return new s(l[0]);case 2:return new s(l[0],l[1]);case 3:return new s(l[0],l[1],l[2]);case 4:return new s(l[0],l[1],l[2],l[3]);case 5:return new s(l[0],l[1],l[2],l[3],l[4]);case 6:return new s(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new s(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var f=fl(s.prototype),y=s.apply(f,l);return hn(y)?y:f}}function bV(s,l,f){var y=eu(s);function T(){for(var O=arguments.length,F=ue(O),K=O,oe=gl(T);K--;)F[K]=arguments[K];var ye=O<3&&F[0]!==oe&&F[O-1]!==oe?[]:Mo(F,oe);if(O-=ye.length,O<f)return UI(s,l,op,T.placeholder,n,F,ye,n,n,f-O);var we=this&&this!==Xt&&this instanceof T?y:s;return Wn(we,this,F)}return T}function RI(s){return function(l,f,y){var T=Kt(l);if(!Vr(l)){var O=rt(f,3);l=Fn(l),f=function(K){return O(T[K],K,T)}}var F=s(l,f,y);return F>-1?T[O?l[F]:F]:n}}function LI(s){return ji(function(l){var f=l.length,y=f,T=fo.prototype.thru;for(s&&l.reverse();y--;){var O=l[y];if(typeof O!="function")throw new Br(a);if(T&&!F&&cp(O)=="wrapper")var F=new fo([],!0)}for(y=F?y:f;++y<f;){O=l[y];var K=cp(O),oe=K=="wrapper"?Nw(O):n;oe&&Lw(oe[0])&&oe[1]==(W|k|M|Y)&&!oe[4].length&&oe[9]==1?F=F[cp(oe[0])].apply(F,oe[3]):F=O.length==1&&Lw(O)?F[K]():F.thru(O)}return function(){var ye=arguments,we=ye[0];if(F&&ye.length==1&&dt(we))return F.plant(we).value();for(var Te=0,Ue=f?l[Te].apply(this,ye):we;++Te<f;)Ue=l[Te].call(this,Ue);return Ue}})}function op(s,l,f,y,T,O,F,K,oe,ye){var we=l&W,Te=l&_,Ue=l&E,Qe=l&(k|A),ot=l&z,gt=Ue?n:eu(s);function tt(){for(var yt=arguments.length,St=ue(yt),to=yt;to--;)St[to]=arguments[to];if(Qe)var Ar=gl(tt),no=Zc(St,Ar);if(y&&(St=PI(St,y,T,Qe)),O&&(St=OI(St,O,F,Qe)),yt-=no,Qe&&yt<ye){var _n=Mo(St,Ar);return UI(s,l,op,tt.placeholder,f,St,_n,K,oe,ye-yt)}var $o=Te?f:this,Qi=Ue?$o[s]:s;return yt=St.length,K?St=HV(St,K):ot&&yt>1&&St.reverse(),we&&oe<yt&&(St.length=oe),this&&this!==Xt&&this instanceof tt&&(Qi=gt||eu(Qi)),Qi.apply($o,St)}return tt}function FI(s,l){return function(f,y){return qz(f,s,l(y),{})}}function ip(s,l){return function(f,y){var T;if(f===n&&y===n)return l;if(f!==n&&(T=f),y!==n){if(T===n)return y;typeof f=="string"||typeof y=="string"?(f=Zr(f),y=Zr(y)):(f=xI(f),y=xI(y)),T=s(f,y)}return T}}function Iw(s){return ji(function(l){return l=Zt(l,_r(rt())),mt(function(f){var y=this;return s(l,function(T){return Wn(T,y,f)})})})}function sp(s,l){l=l===n?" ":Zr(l);var f=l.length;if(f<2)return f?Cw(l,s):l;var y=Cw(l,ll(s/Bi(l)));return Ns(l)?Hs(Sr(y),0,s).join(""):y.slice(0,s)}function CV(s,l,f,y){var T=l&_,O=eu(s);function F(){for(var K=-1,oe=arguments.length,ye=-1,we=y.length,Te=ue(we+oe),Ue=this&&this!==Xt&&this instanceof F?O:s;++ye<we;)Te[ye]=y[ye];for(;oe--;)Te[ye++]=arguments[++K];return Wn(Ue,T?f:this,Te)}return F}function $I(s){return function(l,f,y){return y&&typeof y!="number"&&Er(l,f,y)&&(f=y=n),l=Yi(l),f===n?(f=l,l=0):f=Yi(f),y=y===n?l<f?1:-1:Yi(y),sV(l,f,y,s)}}function ap(s){return function(l,f){return typeof l=="string"&&typeof f=="string"||(l=mo(l),f=mo(f)),s(l,f)}}function UI(s,l,f,y,T,O,F,K,oe,ye){var we=l&k,Te=we?F:n,Ue=we?n:F,Qe=we?O:n,ot=we?n:O;l|=we?M:B,l&=~(we?B:M),l&I||(l&=-4);var gt=[s,l,T,Qe,Te,ot,Ue,K,oe,ye],tt=f.apply(n,gt);return Lw(s)&&JI(tt,gt),tt.placeholder=y,XI(tt,s,l)}function kw(s){var l=Vt[s];return function(f,y){if(f=mo(f),y=y==null?0:Cn(ft(y),292),y&&Wd(f)){var T=(Bt(f)+"e").split("e"),O=l(T[0]+"e"+(+T[1]+y));return T=(Bt(O)+"e").split("e"),+(T[0]+"e"+(+T[1]-y))}return l(f)}}var xV=U&&1/el(new U([,-0]))[1]==ie?function(s){return new U(s)}:Xw;function HI(s){return function(l){var f=cr(l);return f==ct?Vd(l):f==At?zh(l):Bd(l,s(l))}}function Gi(s,l,f,y,T,O,F,K){var oe=l&E;if(!oe&&typeof s!="function")throw new Br(a);var ye=y?y.length:0;if(ye||(l&=-97,y=T=n),F=F===n?F:Yt(ft(F),0),K=K===n?K:ft(K),ye-=T?T.length:0,l&B){var we=y,Te=T;y=T=n}var Ue=oe?n:Nw(s),Qe=[s,l,f,y,T,we,Te,O,F,K];if(Ue&&FV(Qe,Ue),s=Qe[0],l=Qe[1],f=Qe[2],y=Qe[3],T=Qe[4],K=Qe[9]=Qe[9]===n?oe?0:s.length:Yt(Qe[9]-ye,0),!K&&l&(k|A)&&(l&=-25),!l||l==_)var ot=wV(s,l,f);else l==k||l==A?ot=bV(s,l,K):(l==M||l==(_|M))&&!T.length?ot=CV(s,l,f,y):ot=op.apply(n,Qe);var gt=Ue?bI:JI;return XI(gt(ot,Qe),s,l)}function BI(s,l,f,y){return s===n||Fo(s,Ms[f])&&!Nt.call(y,f)?l:s}function zI(s,l,f,y,T,O){return hn(s)&&hn(l)&&(O.set(l,s),ep(s,l,n,zI,O),O.delete(l)),s}function _V(s){return ru(s)?n:s}function VI(s,l,f,y,T,O){var F=f&b,K=s.length,oe=l.length;if(K!=oe&&!(F&&oe>K))return!1;var ye=O.get(s),we=O.get(l);if(ye&&we)return ye==l&&we==s;var Te=-1,Ue=!0,Qe=f&w?new Ha:n;for(O.set(s,l),O.set(l,s);++Te<K;){var ot=s[Te],gt=l[Te];if(y)var tt=F?y(gt,ot,Te,l,s,O):y(ot,gt,Te,s,l,O);if(tt!==n){if(tt)continue;Ue=!1;break}if(Qe){if(!qc(l,function(yt,St){if(!Os(Qe,St)&&(ot===yt||T(ot,yt,f,y,O)))return Qe.push(St)})){Ue=!1;break}}else if(!(ot===gt||T(ot,gt,f,y,O))){Ue=!1;break}}return O.delete(s),O.delete(l),Ue}function SV(s,l,f,y,T,O,F){switch(f){case Ht:if(s.byteLength!=l.byteLength||s.byteOffset!=l.byteOffset)return!1;s=s.buffer,l=l.buffer;case Et:return!(s.byteLength!=l.byteLength||!O(new Rs(s),new Rs(l)));case Ie:case Pe:case ze:return Fo(+s,+l);case fe:return s.name==l.name&&s.message==l.message;case In:case co:return s==l+"";case ct:var K=Vd;case At:var oe=y&b;if(K||(K=el),s.size!=l.size&&!oe)return!1;var ye=F.get(s);if(ye)return ye==l;y|=w,F.set(s,l);var we=VI(K(s),K(l),y,T,O,F);return F.delete(s),we;case sr:if(sn)return sn.call(s)==sn.call(l)}return!1}function TV(s,l,f,y,T,O){var F=f&b,K=Pw(s),oe=K.length,ye=Pw(l),we=ye.length;if(oe!=we&&!F)return!1;for(var Te=oe;Te--;){var Ue=K[Te];if(!(F?Ue in l:Nt.call(l,Ue)))return!1}var Qe=O.get(s),ot=O.get(l);if(Qe&&ot)return Qe==l&&ot==s;var gt=!0;O.set(s,l),O.set(l,s);for(var tt=F;++Te<oe;){Ue=K[Te];var yt=s[Ue],St=l[Ue];if(y)var to=F?y(St,yt,Ue,l,s,O):y(yt,St,Ue,s,l,O);if(!(to===n?yt===St||T(yt,St,f,y,O):to)){gt=!1;break}tt||(tt=Ue=="constructor")}if(gt&&!tt){var Ar=s.constructor,no=l.constructor;Ar!=no&&"constructor"in s&&"constructor"in l&&!(typeof Ar=="function"&&Ar instanceof Ar&&typeof no=="function"&&no instanceof no)&&(gt=!1)}return O.delete(s),O.delete(l),gt}function ji(s){return $w(YI(s,n,ok),s+"")}function Pw(s){return lI(s,Fn,Mw)}function Ow(s){return lI(s,Kr,KI)}var Nw=xe?function(s){return xe.get(s)}:Xw;function cp(s){for(var l=s.name+"",f=Le[l],y=Nt.call(Le,l)?f.length:0;y--;){var T=f[y],O=T.func;if(O==null||O==s)return T.name}return l}function gl(s){var l=Nt.call(P,"placeholder")?P:s;return l.placeholder}function rt(){var s=P.iteratee||Qw;return s=s===Qw?fI:s,arguments.length?s(arguments[0],arguments[1]):s}function lp(s,l){var f=s.__data__;return DV(l)?f[typeof l=="string"?"string":"hash"]:f.map}function Dw(s){for(var l=Fn(s),f=l.length;f--;){var y=l[f],T=s[y];l[f]=[y,T,WI(T)]}return l}function Va(s,l){var f=Hh(s,l);return uI(f)?f:n}function EV(s){var l=Nt.call(s,oi),f=s[oi];try{s[oi]=n;var y=!0}catch{}var T=Xr.call(s);return y&&(l?s[oi]=f:delete s[oi]),T}var Mw=ul?function(s){return s==null?[]:(s=Kt(s),uo(ul(s),function(l){return Gh.call(s,l)}))}:Zw,KI=ul?function(s){for(var l=[];s;)tn(l,Mw(s)),s=sl(s);return l}:Zw,cr=Tr;(R&&cr(new R(new ArrayBuffer(1)))!=Ht||N&&cr(new N)!=ct||G&&cr(G.resolve())!=qt||U&&cr(new U)!=At||V&&cr(new V)!=qe)&&(cr=function(s){var l=Tr(s),f=l==vt?s.constructor:n,y=f?Ka(f):"";if(y)switch(y){case Je:return Ht;case lt:return ct;case mn:return qt;case fn:return At;case qn:return qe}return l});function AV(s,l,f){for(var y=-1,T=f.length;++y<T;){var O=f[y],F=O.size;switch(O.type){case"drop":s+=F;break;case"dropRight":l-=F;break;case"take":l=Cn(l,s+F);break;case"takeRight":s=Yt(s,l-F);break}}return{start:s,end:l}}function IV(s){var l=s.match(_h);return l?l[1].split($y):[]}function GI(s,l,f){l=Us(l,s);for(var y=-1,T=l.length,O=!1;++y<T;){var F=Lo(l[y]);if(!(O=s!=null&&f(s,F)))break;s=s[F]}return O||++y!=T?O:(T=s==null?0:s.length,!!T&&mp(T)&&Wi(F,T)&&(dt(s)||Ga(s)))}function kV(s){var l=s.length,f=new s.constructor(l);return l&&typeof s[0]=="string"&&Nt.call(s,"index")&&(f.index=s.index,f.input=s.input),f}function jI(s){return typeof s.constructor=="function"&&!tu(s)?fl(sl(s)):{}}function PV(s,l,f){var y=s.constructor;switch(l){case Et:return Aw(s);case Ie:case Pe:return new y(+s);case Ht:return hV(s,f);case dn:case L:case X:case ee:case Ce:case Se:case Oe:case Ne:case Re:return II(s,f);case ct:return new y;case ze:case co:return new y(s);case In:return pV(s);case At:return new y;case sr:return gV(s)}}function OV(s,l){var f=l.length;if(!f)return s;var y=f-1;return l[y]=(f>1?"& ":"")+l[y],l=l.join(f>2?", ":" "),s.replace(Fy,`{
|
|
76
|
+
/* [wrapped with `+l+`] */
|
|
77
|
+
`)}function NV(s){return dt(s)||Ga(s)||!!(jh&&s&&s[jh])}function Wi(s,l){var f=typeof s;return l=l??ce,!!l&&(f=="number"||f!="symbol"&&Uc.test(s))&&s>-1&&s%1==0&&s<l}function Er(s,l,f){if(!hn(f))return!1;var y=typeof l;return(y=="number"?Vr(f)&&Wi(l,f.length):y=="string"&&l in f)?Fo(f[l],s):!1}function Rw(s,l){if(dt(s))return!1;var f=typeof s;return f=="number"||f=="symbol"||f=="boolean"||s==null||eo(s)?!0:va.test(s)||!ma.test(s)||l!=null&&s in Kt(l)}function DV(s){var l=typeof s;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?s!=="__proto__":s===null}function Lw(s){var l=cp(s),f=P[l];if(typeof f!="function"||!(l in Ct.prototype))return!1;if(s===f)return!0;var y=Nw(f);return!!y&&s===y[0]}function MV(s){return!!Kd&&Kd in s}var RV=rl?qi:eb;function tu(s){var l=s&&s.constructor,f=typeof l=="function"&&l.prototype||Ms;return s===f}function WI(s){return s===s&&!hn(s)}function qI(s,l){return function(f){return f==null?!1:f[s]===l&&(l!==n||s in Kt(f))}}function LV(s){var l=pp(s,function(y){return f.size===p&&f.clear(),y}),f=l.cache;return l}function FV(s,l){var f=s[1],y=l[1],T=f|y,O=T<(_|E|W),F=y==W&&f==k||y==W&&f==Y&&s[7].length<=l[8]||y==(W|Y)&&l[7].length<=l[8]&&f==k;if(!(O||F))return s;y&_&&(s[2]=l[2],T|=f&_?0:I);var K=l[3];if(K){var oe=s[3];s[3]=oe?PI(oe,K,l[4]):K,s[4]=oe?Mo(s[3],g):l[4]}return K=l[5],K&&(oe=s[5],s[5]=oe?OI(oe,K,l[6]):K,s[6]=oe?Mo(s[5],g):l[6]),K=l[7],K&&(s[7]=K),y&W&&(s[8]=s[8]==null?l[8]:Cn(s[8],l[8])),s[9]==null&&(s[9]=l[9]),s[0]=l[0],s[1]=T,s}function $V(s){var l=[];if(s!=null)for(var f in Kt(s))l.push(f);return l}function UV(s){return Xr.call(s)}function YI(s,l,f){return l=Yt(l===n?s.length-1:l,0),function(){for(var y=arguments,T=-1,O=Yt(y.length-l,0),F=ue(O);++T<O;)F[T]=y[l+T];T=-1;for(var K=ue(l+1);++T<l;)K[T]=y[T];return K[l]=f(F),Wn(s,this,K)}}function QI(s,l){return l.length<2?s:za(s,po(l,0,-1))}function HV(s,l){for(var f=s.length,y=Cn(l.length,f),T=zr(s);y--;){var O=l[y];s[y]=Wi(O,f)?T[O]:n}return s}function Fw(s,l){if(!(l==="constructor"&&typeof s[l]=="function")&&l!="__proto__")return s[l]}var JI=ZI(bI),nu=qh||function(s,l){return Xt.setTimeout(s,l)},$w=ZI(lV);function XI(s,l,f){var y=l+"";return $w(s,OV(y,BV(IV(y),f)))}function ZI(s){var l=0,f=0;return function(){var y=lw(),T=Q-(y-f);if(f=y,T>0){if(++l>=ae)return arguments[0]}else l=0;return s.apply(n,arguments)}}function dp(s,l){var f=-1,y=s.length,T=y-1;for(l=l===n?y:l;++f<l;){var O=bw(f,T),F=s[O];s[O]=s[f],s[f]=F}return s.length=l,s}var ek=LV(function(s){var l=[];return s.charCodeAt(0)===46&&l.push(""),s.replace(Fc,function(f,y,T,O){l.push(T?O.replace(Th,"$1"):y||f)}),l});function Lo(s){if(typeof s=="string"||eo(s))return s;var l=s+"";return l=="0"&&1/s==-ie?"-0":l}function Ka(s){if(s!=null){try{return ol.call(s)}catch{}try{return s+""}catch{}}return""}function BV(s,l){return ar(ke,function(f){var y="_."+f[0];l&f[1]&&!Na(s,y)&&s.push(y)}),s.sort()}function tk(s){if(s instanceof Ct)return s.clone();var l=new fo(s.__wrapped__,s.__chain__);return l.__actions__=zr(s.__actions__),l.__index__=s.__index__,l.__values__=s.__values__,l}function zV(s,l,f){(f?Er(s,l,f):l===n)?l=1:l=Yt(ft(l),0);var y=s==null?0:s.length;if(!y||l<1)return[];for(var T=0,O=0,F=ue(ll(y/l));T<y;)F[O++]=po(s,T,T+=l);return F}function VV(s){for(var l=-1,f=s==null?0:s.length,y=0,T=[];++l<f;){var O=s[l];O&&(T[y++]=O)}return T}function KV(){var s=arguments.length;if(!s)return[];for(var l=ue(s-1),f=arguments[0],y=s;y--;)l[y-1]=arguments[y];return tn(dt(f)?zr(f):[f],Yn(l,1))}var GV=mt(function(s,l){return xn(s)?Qd(s,Yn(l,1,xn,!0)):[]}),jV=mt(function(s,l){var f=go(l);return xn(f)&&(f=n),xn(s)?Qd(s,Yn(l,1,xn,!0),rt(f,2)):[]}),WV=mt(function(s,l){var f=go(l);return xn(f)&&(f=n),xn(s)?Qd(s,Yn(l,1,xn,!0),n,f):[]});function qV(s,l,f){var y=s==null?0:s.length;return y?(l=f||l===n?1:ft(l),po(s,l<0?0:l,y)):[]}function YV(s,l,f){var y=s==null?0:s.length;return y?(l=f||l===n?1:ft(l),l=y-l,po(s,0,l<0?0:l)):[]}function QV(s,l){return s&&s.length?np(s,rt(l,3),!0,!0):[]}function JV(s,l){return s&&s.length?np(s,rt(l,3),!0):[]}function XV(s,l,f,y){var T=s==null?0:s.length;return T?(f&&typeof f!="number"&&Er(s,l,f)&&(f=0,y=T),Kz(s,l,f,y)):[]}function nk(s,l,f){var y=s==null?0:s.length;if(!y)return-1;var T=f==null?0:ft(f);return T<0&&(T=Yt(y+T,0)),Yc(s,rt(l,3),T)}function rk(s,l,f){var y=s==null?0:s.length;if(!y)return-1;var T=y-1;return f!==n&&(T=ft(f),T=f<0?Yt(y+T,0):Cn(T,y-1)),Yc(s,rt(l,3),T,!0)}function ok(s){var l=s==null?0:s.length;return l?Yn(s,1):[]}function ZV(s){var l=s==null?0:s.length;return l?Yn(s,ie):[]}function eK(s,l){var f=s==null?0:s.length;return f?(l=l===n?1:ft(l),Yn(s,l)):[]}function tK(s){for(var l=-1,f=s==null?0:s.length,y={};++l<f;){var T=s[l];ii(y,T[0],T[1])}return y}function ik(s){return s&&s.length?s[0]:n}function nK(s,l,f){var y=s==null?0:s.length;if(!y)return-1;var T=f==null?0:ft(f);return T<0&&(T=Yt(y+T,0)),Hi(s,l,T)}function rK(s){var l=s==null?0:s.length;return l?po(s,0,-1):[]}var oK=mt(function(s){var l=Zt(s,Tw);return l.length&&l[0]===s[0]?gw(l):[]}),iK=mt(function(s){var l=go(s),f=Zt(s,Tw);return l===go(f)?l=n:f.pop(),f.length&&f[0]===s[0]?gw(f,rt(l,2)):[]}),sK=mt(function(s){var l=go(s),f=Zt(s,Tw);return l=typeof l=="function"?l:n,l&&f.pop(),f.length&&f[0]===s[0]?gw(f,n,l):[]});function aK(s,l){return s==null?"":cw.call(s,l)}function go(s){var l=s==null?0:s.length;return l?s[l-1]:n}function cK(s,l,f){var y=s==null?0:s.length;if(!y)return-1;var T=y;return f!==n&&(T=ft(f),T=T<0?Yt(y+T,0):Cn(T,y-1)),l===l?Zy(s,l,T):Yc(s,Ld,T,!0)}function lK(s,l){return s&&s.length?mI(s,ft(l)):n}var dK=mt(sk);function sk(s,l){return s&&s.length&&l&&l.length?ww(s,l):s}function uK(s,l,f){return s&&s.length&&l&&l.length?ww(s,l,rt(f,2)):s}function fK(s,l,f){return s&&s.length&&l&&l.length?ww(s,l,n,f):s}var hK=ji(function(s,l){var f=s==null?0:s.length,y=uw(s,l);return wI(s,Zt(l,function(T){return Wi(T,f)?+T:T}).sort(kI)),y});function pK(s,l){var f=[];if(!(s&&s.length))return f;var y=-1,T=[],O=s.length;for(l=rt(l,3);++y<O;){var F=s[y];l(F,y,s)&&(f.push(F),T.push(y))}return wI(s,T),f}function Uw(s){return s==null?s:x.call(s)}function gK(s,l,f){var y=s==null?0:s.length;return y?(f&&typeof f!="number"&&Er(s,l,f)?(l=0,f=y):(l=l==null?0:ft(l),f=f===n?y:ft(f)),po(s,l,f)):[]}function mK(s,l){return tp(s,l)}function vK(s,l,f){return xw(s,l,rt(f,2))}function yK(s,l){var f=s==null?0:s.length;if(f){var y=tp(s,l);if(y<f&&Fo(s[y],l))return y}return-1}function wK(s,l){return tp(s,l,!0)}function bK(s,l,f){return xw(s,l,rt(f,2),!0)}function CK(s,l){var f=s==null?0:s.length;if(f){var y=tp(s,l,!0)-1;if(Fo(s[y],l))return y}return-1}function xK(s){return s&&s.length?CI(s):[]}function _K(s,l){return s&&s.length?CI(s,rt(l,2)):[]}function SK(s){var l=s==null?0:s.length;return l?po(s,1,l):[]}function TK(s,l,f){return s&&s.length?(l=f||l===n?1:ft(l),po(s,0,l<0?0:l)):[]}function EK(s,l,f){var y=s==null?0:s.length;return y?(l=f||l===n?1:ft(l),l=y-l,po(s,l<0?0:l,y)):[]}function AK(s,l){return s&&s.length?np(s,rt(l,3),!1,!0):[]}function IK(s,l){return s&&s.length?np(s,rt(l,3)):[]}var kK=mt(function(s){return $s(Yn(s,1,xn,!0))}),PK=mt(function(s){var l=go(s);return xn(l)&&(l=n),$s(Yn(s,1,xn,!0),rt(l,2))}),OK=mt(function(s){var l=go(s);return l=typeof l=="function"?l:n,$s(Yn(s,1,xn,!0),n,l)});function NK(s){return s&&s.length?$s(s):[]}function DK(s,l){return s&&s.length?$s(s,rt(l,2)):[]}function MK(s,l){return l=typeof l=="function"?l:n,s&&s.length?$s(s,n,l):[]}function Hw(s){if(!(s&&s.length))return[];var l=0;return s=uo(s,function(f){if(xn(f))return l=Yt(f.length,l),!0}),Hd(l,function(f){return Zt(s,Ra(f))})}function ak(s,l){if(!(s&&s.length))return[];var f=Hw(s);return l==null?f:Zt(f,function(y){return Wn(l,n,y)})}var RK=mt(function(s,l){return xn(s)?Qd(s,l):[]}),LK=mt(function(s){return Sw(uo(s,xn))}),FK=mt(function(s){var l=go(s);return xn(l)&&(l=n),Sw(uo(s,xn),rt(l,2))}),$K=mt(function(s){var l=go(s);return l=typeof l=="function"?l:n,Sw(uo(s,xn),n,l)}),UK=mt(Hw);function HK(s,l){return TI(s||[],l||[],Yd)}function BK(s,l){return TI(s||[],l||[],Zd)}var zK=mt(function(s){var l=s.length,f=l>1?s[l-1]:n;return f=typeof f=="function"?(s.pop(),f):n,ak(s,f)});function ck(s){var l=P(s);return l.__chain__=!0,l}function VK(s,l){return l(s),s}function up(s,l){return l(s)}var KK=ji(function(s){var l=s.length,f=l?s[0]:0,y=this.__wrapped__,T=function(O){return uw(O,s)};return l>1||this.__actions__.length||!(y instanceof Ct)||!Wi(f)?this.thru(T):(y=y.slice(f,+f+(l?1:0)),y.__actions__.push({func:up,args:[T],thisArg:n}),new fo(y,this.__chain__).thru(function(O){return l&&!O.length&&O.push(n),O}))});function GK(){return ck(this)}function jK(){return new fo(this.value(),this.__chain__)}function WK(){this.__values__===n&&(this.__values__=xk(this.value()));var s=this.__index__>=this.__values__.length,l=s?n:this.__values__[this.__index__++];return{done:s,value:l}}function qK(){return this}function YK(s){for(var l,f=this;f instanceof Qh;){var y=tk(f);y.__index__=0,y.__values__=n,l?T.__wrapped__=y:l=y;var T=y;f=f.__wrapped__}return T.__wrapped__=s,l}function QK(){var s=this.__wrapped__;if(s instanceof Ct){var l=s;return this.__actions__.length&&(l=new Ct(this)),l=l.reverse(),l.__actions__.push({func:up,args:[Uw],thisArg:n}),new fo(l,this.__chain__)}return this.thru(Uw)}function JK(){return SI(this.__wrapped__,this.__actions__)}var XK=rp(function(s,l,f){Nt.call(s,f)?++s[f]:ii(s,f,1)});function ZK(s,l,f){var y=dt(s)?Md:Vz;return f&&Er(s,l,f)&&(l=n),y(s,rt(l,3))}function eG(s,l){var f=dt(s)?uo:aI;return f(s,rt(l,3))}var tG=RI(nk),nG=RI(rk);function rG(s,l){return Yn(fp(s,l),1)}function oG(s,l){return Yn(fp(s,l),ie)}function iG(s,l,f){return f=f===n?1:ft(f),Yn(fp(s,l),f)}function lk(s,l){var f=dt(s)?ar:Fs;return f(s,rt(l,3))}function dk(s,l){var f=dt(s)?Mh:sI;return f(s,rt(l,3))}var sG=rp(function(s,l,f){Nt.call(s,f)?s[f].push(l):ii(s,f,[l])});function aG(s,l,f,y){s=Vr(s)?s:vl(s),f=f&&!y?ft(f):0;var T=s.length;return f<0&&(f=Yt(T+f,0)),vp(s)?f<=T&&s.indexOf(l,f)>-1:!!T&&Hi(s,l,f)>-1}var cG=mt(function(s,l,f){var y=-1,T=typeof l=="function",O=Vr(s)?ue(s.length):[];return Fs(s,function(F){O[++y]=T?Wn(l,F,f):Jd(F,l,f)}),O}),lG=rp(function(s,l,f){ii(s,f,l)});function fp(s,l){var f=dt(s)?Zt:hI;return f(s,rt(l,3))}function dG(s,l,f,y){return s==null?[]:(dt(l)||(l=l==null?[]:[l]),f=y?n:f,dt(f)||(f=f==null?[]:[f]),vI(s,l,f))}var uG=rp(function(s,l,f){s[f?0:1].push(l)},function(){return[[],[]]});function fG(s,l,f){var y=dt(s)?Da:$d,T=arguments.length<3;return y(s,rt(l,4),f,T,Fs)}function hG(s,l,f){var y=dt(s)?Wc:$d,T=arguments.length<3;return y(s,rt(l,4),f,T,sI)}function pG(s,l){var f=dt(s)?uo:aI;return f(s,gp(rt(l,3)))}function gG(s){var l=dt(s)?nI:aV;return l(s)}function mG(s,l,f){(f?Er(s,l,f):l===n)?l=1:l=ft(l);var y=dt(s)?$z:cV;return y(s,l)}function vG(s){var l=dt(s)?Uz:dV;return l(s)}function yG(s){if(s==null)return 0;if(Vr(s))return vp(s)?Bi(s):s.length;var l=cr(s);return l==ct||l==At?s.size:vw(s).length}function wG(s,l,f){var y=dt(s)?qc:uV;return f&&Er(s,l,f)&&(l=n),y(s,rt(l,3))}var bG=mt(function(s,l){if(s==null)return[];var f=l.length;return f>1&&Er(s,l[0],l[1])?l=[]:f>2&&Er(l[0],l[1],l[2])&&(l=[l[0]]),vI(s,Yn(l,1),[])}),hp=Gd||function(){return Xt.Date.now()};function CG(s,l){if(typeof l!="function")throw new Br(a);return s=ft(s),function(){if(--s<1)return l.apply(this,arguments)}}function uk(s,l,f){return l=f?n:l,l=s&&l==null?s.length:l,Gi(s,W,n,n,n,n,l)}function fk(s,l){var f;if(typeof l!="function")throw new Br(a);return s=ft(s),function(){return--s>0&&(f=l.apply(this,arguments)),s<=1&&(l=n),f}}var Bw=mt(function(s,l,f){var y=_;if(f.length){var T=Mo(f,gl(Bw));y|=M}return Gi(s,y,l,f,T)}),hk=mt(function(s,l,f){var y=_|E;if(f.length){var T=Mo(f,gl(hk));y|=M}return Gi(l,y,s,f,T)});function pk(s,l,f){l=f?n:l;var y=Gi(s,k,n,n,n,n,n,l);return y.placeholder=pk.placeholder,y}function gk(s,l,f){l=f?n:l;var y=Gi(s,A,n,n,n,n,n,l);return y.placeholder=gk.placeholder,y}function mk(s,l,f){var y,T,O,F,K,oe,ye=0,we=!1,Te=!1,Ue=!0;if(typeof s!="function")throw new Br(a);l=mo(l)||0,hn(f)&&(we=!!f.leading,Te="maxWait"in f,O=Te?Yt(mo(f.maxWait)||0,l):O,Ue="trailing"in f?!!f.trailing:Ue);function Qe(_n){var $o=y,Qi=T;return y=T=n,ye=_n,F=s.apply(Qi,$o),F}function ot(_n){return ye=_n,K=nu(yt,l),we?Qe(_n):F}function gt(_n){var $o=_n-oe,Qi=_n-ye,Lk=l-$o;return Te?Cn(Lk,O-Qi):Lk}function tt(_n){var $o=_n-oe,Qi=_n-ye;return oe===n||$o>=l||$o<0||Te&&Qi>=O}function yt(){var _n=hp();if(tt(_n))return St(_n);K=nu(yt,gt(_n))}function St(_n){return K=n,Ue&&y?Qe(_n):(y=T=n,F)}function to(){K!==n&&EI(K),ye=0,y=oe=T=K=n}function Ar(){return K===n?F:St(hp())}function no(){var _n=hp(),$o=tt(_n);if(y=arguments,T=this,oe=_n,$o){if(K===n)return ot(oe);if(Te)return EI(K),K=nu(yt,l),Qe(oe)}return K===n&&(K=nu(yt,l)),F}return no.cancel=to,no.flush=Ar,no}var xG=mt(function(s,l){return iI(s,1,l)}),_G=mt(function(s,l,f){return iI(s,mo(l)||0,f)});function SG(s){return Gi(s,z)}function pp(s,l){if(typeof s!="function"||l!=null&&typeof l!="function")throw new Br(a);var f=function(){var y=arguments,T=l?l.apply(this,y):y[0],O=f.cache;if(O.has(T))return O.get(T);var F=s.apply(this,y);return f.cache=O.set(T,F)||O,F};return f.cache=new(pp.Cache||Ki),f}pp.Cache=Ki;function gp(s){if(typeof s!="function")throw new Br(a);return function(){var l=arguments;switch(l.length){case 0:return!s.call(this);case 1:return!s.call(this,l[0]);case 2:return!s.call(this,l[0],l[1]);case 3:return!s.call(this,l[0],l[1],l[2])}return!s.apply(this,l)}}function TG(s){return fk(2,s)}var EG=fV(function(s,l){l=l.length==1&&dt(l[0])?Zt(l[0],_r(rt())):Zt(Yn(l,1),_r(rt()));var f=l.length;return mt(function(y){for(var T=-1,O=Cn(y.length,f);++T<O;)y[T]=l[T].call(this,y[T]);return Wn(s,this,y)})}),zw=mt(function(s,l){var f=Mo(l,gl(zw));return Gi(s,M,n,l,f)}),vk=mt(function(s,l){var f=Mo(l,gl(vk));return Gi(s,B,n,l,f)}),AG=ji(function(s,l){return Gi(s,Y,n,n,n,l)});function IG(s,l){if(typeof s!="function")throw new Br(a);return l=l===n?l:ft(l),mt(s,l)}function kG(s,l){if(typeof s!="function")throw new Br(a);return l=l==null?0:Yt(ft(l),0),mt(function(f){var y=f[l],T=Hs(f,0,l);return y&&tn(T,y),Wn(s,this,T)})}function PG(s,l,f){var y=!0,T=!0;if(typeof s!="function")throw new Br(a);return hn(f)&&(y="leading"in f?!!f.leading:y,T="trailing"in f?!!f.trailing:T),mk(s,l,{leading:y,maxWait:l,trailing:T})}function OG(s){return uk(s,1)}function NG(s,l){return zw(Ew(l),s)}function DG(){if(!arguments.length)return[];var s=arguments[0];return dt(s)?s:[s]}function MG(s){return ho(s,C)}function RG(s,l){return l=typeof l=="function"?l:n,ho(s,C,l)}function LG(s){return ho(s,v|C)}function FG(s,l){return l=typeof l=="function"?l:n,ho(s,v|C,l)}function $G(s,l){return l==null||oI(s,l,Fn(l))}function Fo(s,l){return s===l||s!==s&&l!==l}var UG=ap(pw),HG=ap(function(s,l){return s>=l}),Ga=dI(function(){return arguments}())?dI:function(s){return yn(s)&&Nt.call(s,"callee")&&!Gh.call(s,"callee")},dt=ue.isArray,BG=ks?_r(ks):Yz;function Vr(s){return s!=null&&mp(s.length)&&!qi(s)}function xn(s){return yn(s)&&Vr(s)}function zG(s){return s===!0||s===!1||yn(s)&&Tr(s)==Ie}var Bs=jd||eb,VG=Nh?_r(Nh):Qz;function KG(s){return yn(s)&&s.nodeType===1&&!ru(s)}function GG(s){if(s==null)return!0;if(Vr(s)&&(dt(s)||typeof s=="string"||typeof s.splice=="function"||Bs(s)||ml(s)||Ga(s)))return!s.length;var l=cr(s);if(l==ct||l==At)return!s.size;if(tu(s))return!vw(s).length;for(var f in s)if(Nt.call(s,f))return!1;return!0}function jG(s,l){return Xd(s,l)}function WG(s,l,f){f=typeof f=="function"?f:n;var y=f?f(s,l):n;return y===n?Xd(s,l,n,f):!!y}function Vw(s){if(!yn(s))return!1;var l=Tr(s);return l==fe||l==Me||typeof s.message=="string"&&typeof s.name=="string"&&!ru(s)}function qG(s){return typeof s=="number"&&Wd(s)}function qi(s){if(!hn(s))return!1;var l=Tr(s);return l==He||l==Ut||l==be||l==An}function yk(s){return typeof s=="number"&&s==ft(s)}function mp(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=ce}function hn(s){var l=typeof s;return s!=null&&(l=="object"||l=="function")}function yn(s){return s!=null&&typeof s=="object"}var wk=Ui?_r(Ui):Xz;function YG(s,l){return s===l||mw(s,l,Dw(l))}function QG(s,l,f){return f=typeof f=="function"?f:n,mw(s,l,Dw(l),f)}function JG(s){return bk(s)&&s!=+s}function XG(s){if(RV(s))throw new at(i);return uI(s)}function ZG(s){return s===null}function e6(s){return s==null}function bk(s){return typeof s=="number"||yn(s)&&Tr(s)==ze}function ru(s){if(!yn(s)||Tr(s)!=vt)return!1;var l=sl(s);if(l===null)return!0;var f=Nt.call(l,"constructor")&&l.constructor;return typeof f=="function"&&f instanceof f&&ol.call(f)==Fa}var Kw=Pa?_r(Pa):Zz;function t6(s){return yk(s)&&s>=-ce&&s<=ce}var Ck=Oa?_r(Oa):eV;function vp(s){return typeof s=="string"||!dt(s)&&yn(s)&&Tr(s)==co}function eo(s){return typeof s=="symbol"||yn(s)&&Tr(s)==sr}var ml=Ps?_r(Ps):tV;function n6(s){return s===n}function r6(s){return yn(s)&&cr(s)==qe}function o6(s){return yn(s)&&Tr(s)==kt}var i6=ap(yw),s6=ap(function(s,l){return s<=l});function xk(s){if(!s)return[];if(Vr(s))return vp(s)?Sr(s):zr(s);if(Ls&&s[Ls])return Jy(s[Ls]());var l=cr(s),f=l==ct?Vd:l==At?el:vl;return f(s)}function Yi(s){if(!s)return s===0?s:0;if(s=mo(s),s===ie||s===-ie){var l=s<0?-1:1;return l*$}return s===s?s:0}function ft(s){var l=Yi(s),f=l%1;return l===l?f?l-f:l:0}function _k(s){return s?Ba(ft(s),0,me):0}function mo(s){if(typeof s=="number")return s;if(eo(s))return Z;if(hn(s)){var l=typeof s.valueOf=="function"?s.valueOf():s;s=hn(l)?l+"":l}if(typeof s!="string")return s===0?s:+s;s=Xc(s);var f=Uy.test(s);return f||Eh.test(s)?Is(s.slice(2),f?2:8):$c.test(s)?Z:+s}function Sk(s){return ai(s,Kr(s))}function a6(s){return s?Ba(ft(s),-ce,ce):s===0?s:0}function Bt(s){return s==null?"":Zr(s)}var c6=hl(function(s,l){if(tu(l)||Vr(l)){ai(l,Fn(l),s);return}for(var f in l)Nt.call(l,f)&&Yd(s,f,l[f])}),Tk=hl(function(s,l){ai(l,Kr(l),s)}),Ek=hl(function(s,l,f,y){ai(l,Kr(l),s,y)}),Gw=hl(function(s,l,f,y){ai(l,Fn(l),s,y)}),l6=ji(uw);function d6(s,l){var f=fl(s);return l==null?f:rI(f,l)}var u6=mt(function(s,l){s=Kt(s);var f=-1,y=l.length,T=y>2?l[2]:n;for(T&&Er(l[0],l[1],T)&&(y=1);++f<y;)for(var O=l[f],F=Kr(O),K=-1,oe=F.length;++K<oe;){var ye=F[K],we=s[ye];(we===n||Fo(we,Ms[ye])&&!Nt.call(s,ye))&&(s[ye]=O[ye])}return s}),f6=mt(function(s){return s.push(n,zI),Wn(Ak,n,s)});function h6(s,l){return Rd(s,rt(l,3),si)}function p6(s,l){return Rd(s,rt(l,3),hw)}function g6(s,l){return s==null?s:fw(s,rt(l,3),Kr)}function m6(s,l){return s==null?s:cI(s,rt(l,3),Kr)}function v6(s,l){return s&&si(s,rt(l,3))}function y6(s,l){return s&&hw(s,rt(l,3))}function w6(s){return s==null?[]:Zh(s,Fn(s))}function b6(s){return s==null?[]:Zh(s,Kr(s))}function jw(s,l,f){var y=s==null?n:za(s,l);return y===n?f:y}function C6(s,l){return s!=null&&GI(s,l,Gz)}function Ww(s,l){return s!=null&&GI(s,l,jz)}var x6=FI(function(s,l,f){l!=null&&typeof l.toString!="function"&&(l=Xr.call(l)),s[l]=f},Yw(Gr)),_6=FI(function(s,l,f){l!=null&&typeof l.toString!="function"&&(l=Xr.call(l)),Nt.call(s,l)?s[l].push(f):s[l]=[f]},rt),S6=mt(Jd);function Fn(s){return Vr(s)?tI(s):vw(s)}function Kr(s){return Vr(s)?tI(s,!0):nV(s)}function T6(s,l){var f={};return l=rt(l,3),si(s,function(y,T,O){ii(f,l(y,T,O),y)}),f}function E6(s,l){var f={};return l=rt(l,3),si(s,function(y,T,O){ii(f,T,l(y,T,O))}),f}var A6=hl(function(s,l,f){ep(s,l,f)}),Ak=hl(function(s,l,f,y){ep(s,l,f,y)}),I6=ji(function(s,l){var f={};if(s==null)return f;var y=!1;l=Zt(l,function(O){return O=Us(O,s),y||(y=O.length>1),O}),ai(s,Ow(s),f),y&&(f=ho(f,v|m|C,_V));for(var T=l.length;T--;)_w(f,l[T]);return f});function k6(s,l){return Ik(s,gp(rt(l)))}var P6=ji(function(s,l){return s==null?{}:oV(s,l)});function Ik(s,l){if(s==null)return{};var f=Zt(Ow(s),function(y){return[y]});return l=rt(l),yI(s,f,function(y,T){return l(y,T[0])})}function O6(s,l,f){l=Us(l,s);var y=-1,T=l.length;for(T||(T=1,s=n);++y<T;){var O=s==null?n:s[Lo(l[y])];O===n&&(y=T,O=f),s=qi(O)?O.call(s):O}return s}function N6(s,l,f){return s==null?s:Zd(s,l,f)}function D6(s,l,f,y){return y=typeof y=="function"?y:n,s==null?s:Zd(s,l,f,y)}var kk=HI(Fn),Pk=HI(Kr);function M6(s,l,f){var y=dt(s),T=y||Bs(s)||ml(s);if(l=rt(l,4),f==null){var O=s&&s.constructor;T?f=y?new O:[]:hn(s)?f=qi(O)?fl(sl(s)):{}:f={}}return(T?ar:si)(s,function(F,K,oe){return l(f,F,K,oe)}),f}function R6(s,l){return s==null?!0:_w(s,l)}function L6(s,l,f){return s==null?s:_I(s,l,Ew(f))}function F6(s,l,f,y){return y=typeof y=="function"?y:n,s==null?s:_I(s,l,Ew(f),y)}function vl(s){return s==null?[]:zd(s,Fn(s))}function $6(s){return s==null?[]:zd(s,Kr(s))}function U6(s,l,f){return f===n&&(f=l,l=n),f!==n&&(f=mo(f),f=f===f?f:0),l!==n&&(l=mo(l),l=l===l?l:0),Ba(mo(s),l,f)}function H6(s,l,f){return l=Yi(l),f===n?(f=l,l=0):f=Yi(f),s=mo(s),Wz(s,l,f)}function B6(s,l,f){if(f&&typeof f!="boolean"&&Er(s,l,f)&&(l=f=n),f===n&&(typeof l=="boolean"?(f=l,l=n):typeof s=="boolean"&&(f=s,s=n)),s===n&&l===n?(s=0,l=1):(s=Yi(s),l===n?(l=s,s=0):l=Yi(l)),s>l){var y=s;s=l,l=y}if(f||s%1||l%1){var T=qd();return Cn(s+T*(l-s+Ia("1e-"+((T+"").length-1))),l)}return bw(s,l)}var z6=pl(function(s,l,f){return l=l.toLowerCase(),s+(f?Ok(l):l)});function Ok(s){return qw(Bt(s).toLowerCase())}function Nk(s){return s=Bt(s),s&&s.replace(Hc,Uh).replace(Gy,"")}function V6(s,l,f){s=Bt(s),l=Zr(l);var y=s.length;f=f===n?y:Ba(ft(f),0,y);var T=f;return f-=l.length,f>=0&&s.slice(f,T)==l}function K6(s){return s=Bt(s),s&&Ye.test(s)?s.replace(xr,La):s}function G6(s){return s=Bt(s),s&&ya.test(s)?s.replace(bd,"\\$&"):s}var j6=pl(function(s,l,f){return s+(f?"-":"")+l.toLowerCase()}),W6=pl(function(s,l,f){return s+(f?" ":"")+l.toLowerCase()}),q6=MI("toLowerCase");function Y6(s,l,f){s=Bt(s),l=ft(l);var y=l?Bi(s):0;if(!l||y>=l)return s;var T=(l-y)/2;return sp(dl(T),f)+s+sp(ll(T),f)}function Q6(s,l,f){s=Bt(s),l=ft(l);var y=l?Bi(s):0;return l&&y<l?s+sp(l-y,f):s}function J6(s,l,f){s=Bt(s),l=ft(l);var y=l?Bi(s):0;return l&&y<l?sp(l-y,f)+s:s}function X6(s,l,f){return f||l==null?l=0:l&&(l=+l),Yh(Bt(s).replace(xs,""),l||0)}function Z6(s,l,f){return(f?Er(s,l,f):l===n)?l=1:l=ft(l),Cw(Bt(s),l)}function ej(){var s=arguments,l=Bt(s[0]);return s.length<3?l:l.replace(s[1],s[2])}var tj=pl(function(s,l,f){return s+(f?"_":"")+l.toLowerCase()});function nj(s,l,f){return f&&typeof f!="number"&&Er(s,l,f)&&(l=f=n),f=f===n?me:f>>>0,f?(s=Bt(s),s&&(typeof l=="string"||l!=null&&!Kw(l))&&(l=Zr(l),!l&&Ns(s))?Hs(Sr(s),0,f):s.split(l,f)):[]}var rj=pl(function(s,l,f){return s+(f?" ":"")+qw(l)});function oj(s,l,f){return s=Bt(s),f=f==null?0:Ba(ft(f),0,s.length),l=Zr(l),s.slice(f,f+l.length)==l}function ij(s,l,f){var y=P.templateSettings;f&&Er(s,l,f)&&(l=n),s=Bt(s),l=Gw({},l,y,BI);var T=Gw({},l.imports,y.imports,BI),O=Fn(T),F=zd(T,O);ar(O,function(tt){if(wa.test(tt))throw new at(u)});var K,oe,ye=0,we=l.interpolate||_s,Te="__p += '",Ue=nl((l.escape||_s).source+"|"+we.source+"|"+(we===$r?ba:_s).source+"|"+(l.evaluate||_s).source+"|$","g"),Qe="//# sourceURL="+(Nt.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++eI+"]")+`
|
|
78
|
+
`;s.replace(Ue,function(tt,yt,St,to,Ar,no){return St||(St=to),Te+=s.slice(ye,no).replace(Hy,Yy),yt&&(K=!0,Te+=`' +
|
|
79
|
+
__e(`+yt+`) +
|
|
80
|
+
'`),Ar&&(oe=!0,Te+=`';
|
|
81
|
+
`+Ar+`;
|
|
82
|
+
__p += '`),St&&(Te+=`' +
|
|
83
|
+
((__t = (`+St+`)) == null ? '' : __t) +
|
|
84
|
+
'`),ye=no+tt.length,tt}),Te+=`';
|
|
85
|
+
`;var ot=Nt.call(l,"variable")&&l.variable;if(!ot)Te=`with (obj) {
|
|
86
|
+
`+Te+`
|
|
87
|
+
}
|
|
88
|
+
`;else if(wa.test(ot))throw new at(c);Te=(oe?Te.replace(Ge,""):Te).replace(bt,"$1").replace(Pt,"$1;"),Te="function("+(ot||"obj")+`) {
|
|
89
|
+
`+(ot?"":`obj || (obj = {});
|
|
90
|
+
`)+"var __t, __p = ''"+(K?", __e = _.escape":"")+(oe?`, __j = Array.prototype.join;
|
|
91
|
+
function print() { __p += __j.call(arguments, '') }
|
|
92
|
+
`:`;
|
|
93
|
+
`)+Te+`return __p
|
|
94
|
+
}`;var gt=Mk(function(){return _t(O,Qe+"return "+Te).apply(n,F)});if(gt.source=Te,Vw(gt))throw gt;return gt}function sj(s){return Bt(s).toLowerCase()}function aj(s){return Bt(s).toUpperCase()}function cj(s,l,f){if(s=Bt(s),s&&(f||l===n))return Xc(s);if(!s||!(l=Zr(l)))return s;var y=Sr(s),T=Sr(l),O=Fh(y,T),F=$h(y,T)+1;return Hs(y,O,F).join("")}function lj(s,l,f){if(s=Bt(s),s&&(f||l===n))return s.slice(0,Vh(s)+1);if(!s||!(l=Zr(l)))return s;var y=Sr(s),T=$h(y,Sr(l))+1;return Hs(y,0,T).join("")}function dj(s,l,f){if(s=Bt(s),s&&(f||l===n))return s.replace(xs,"");if(!s||!(l=Zr(l)))return s;var y=Sr(s),T=Fh(y,Sr(l));return Hs(y,T).join("")}function uj(s,l){var f=de,y=ne;if(hn(l)){var T="separator"in l?l.separator:T;f="length"in l?ft(l.length):f,y="omission"in l?Zr(l.omission):y}s=Bt(s);var O=s.length;if(Ns(s)){var F=Sr(s);O=F.length}if(f>=O)return s;var K=f-Bi(y);if(K<1)return y;var oe=F?Hs(F,0,K).join(""):s.slice(0,K);if(T===n)return oe+y;if(F&&(K+=oe.length-K),Kw(T)){if(s.slice(K).search(T)){var ye,we=oe;for(T.global||(T=nl(T.source,Bt(Cd.exec(T))+"g")),T.lastIndex=0;ye=T.exec(we);)var Te=ye.index;oe=oe.slice(0,Te===n?K:Te)}}else if(s.indexOf(Zr(T),K)!=K){var Ue=oe.lastIndexOf(T);Ue>-1&&(oe=oe.slice(0,Ue))}return oe+y}function fj(s){return s=Bt(s),s&&Po.test(s)?s.replace(Gn,ew):s}var hj=pl(function(s,l,f){return s+(f?" ":"")+l.toUpperCase()}),qw=MI("toUpperCase");function Dk(s,l,f){return s=Bt(s),l=f?n:l,l===n?Qy(s)?tl(s):qy(s):s.match(l)||[]}var Mk=mt(function(s,l){try{return Wn(s,n,l)}catch(f){return Vw(f)?f:new at(f)}}),pj=ji(function(s,l){return ar(l,function(f){f=Lo(f),ii(s,f,Bw(s[f],s))}),s});function gj(s){var l=s==null?0:s.length,f=rt();return s=l?Zt(s,function(y){if(typeof y[1]!="function")throw new Br(a);return[f(y[0]),y[1]]}):[],mt(function(y){for(var T=-1;++T<l;){var O=s[T];if(Wn(O[0],this,y))return Wn(O[1],this,y)}})}function mj(s){return zz(ho(s,v))}function Yw(s){return function(){return s}}function vj(s,l){return s==null||s!==s?l:s}var yj=LI(),wj=LI(!0);function Gr(s){return s}function Qw(s){return fI(typeof s=="function"?s:ho(s,v))}function bj(s){return pI(ho(s,v))}function Cj(s,l){return gI(s,ho(l,v))}var xj=mt(function(s,l){return function(f){return Jd(f,s,l)}}),_j=mt(function(s,l){return function(f){return Jd(s,f,l)}});function Jw(s,l,f){var y=Fn(l),T=Zh(l,y);f==null&&!(hn(l)&&(T.length||!y.length))&&(f=l,l=s,s=this,T=Zh(l,Fn(l)));var O=!(hn(f)&&"chain"in f)||!!f.chain,F=qi(s);return ar(T,function(K){var oe=l[K];s[K]=oe,F&&(s.prototype[K]=function(){var ye=this.__chain__;if(O||ye){var we=s(this.__wrapped__),Te=we.__actions__=zr(this.__actions__);return Te.push({func:oe,args:arguments,thisArg:s}),we.__chain__=ye,we}return oe.apply(s,tn([this.value()],arguments))})}),s}function Sj(){return Xt._===this&&(Xt._=aw),this}function Xw(){}function Tj(s){return s=ft(s),mt(function(l){return mI(l,s)})}var Ej=Iw(Zt),Aj=Iw(Md),Ij=Iw(qc);function Rk(s){return Rw(s)?Ra(Lo(s)):iV(s)}function kj(s){return function(l){return s==null?n:za(s,l)}}var Pj=$I(),Oj=$I(!0);function Zw(){return[]}function eb(){return!1}function Nj(){return{}}function Dj(){return""}function Mj(){return!0}function Rj(s,l){if(s=ft(s),s<1||s>ce)return[];var f=me,y=Cn(s,me);l=rt(l),s-=me;for(var T=Hd(y,l);++f<s;)l(f);return T}function Lj(s){return dt(s)?Zt(s,Lo):eo(s)?[s]:zr(ek(Bt(s)))}function Fj(s){var l=++sw;return Bt(s)+l}var $j=ip(function(s,l){return s+l},0),Uj=kw("ceil"),Hj=ip(function(s,l){return s/l},1),Bj=kw("floor");function zj(s){return s&&s.length?Xh(s,Gr,pw):n}function Vj(s,l){return s&&s.length?Xh(s,rt(l,2),pw):n}function Kj(s){return Fd(s,Gr)}function Gj(s,l){return Fd(s,rt(l,2))}function jj(s){return s&&s.length?Xh(s,Gr,yw):n}function Wj(s,l){return s&&s.length?Xh(s,rt(l,2),yw):n}var qj=ip(function(s,l){return s*l},1),Yj=kw("round"),Qj=ip(function(s,l){return s-l},0);function Jj(s){return s&&s.length?Jc(s,Gr):0}function Xj(s,l){return s&&s.length?Jc(s,rt(l,2)):0}return P.after=CG,P.ary=uk,P.assign=c6,P.assignIn=Tk,P.assignInWith=Ek,P.assignWith=Gw,P.at=l6,P.before=fk,P.bind=Bw,P.bindAll=pj,P.bindKey=hk,P.castArray=DG,P.chain=ck,P.chunk=zV,P.compact=VV,P.concat=KV,P.cond=gj,P.conforms=mj,P.constant=Yw,P.countBy=XK,P.create=d6,P.curry=pk,P.curryRight=gk,P.debounce=mk,P.defaults=u6,P.defaultsDeep=f6,P.defer=xG,P.delay=_G,P.difference=GV,P.differenceBy=jV,P.differenceWith=WV,P.drop=qV,P.dropRight=YV,P.dropRightWhile=QV,P.dropWhile=JV,P.fill=XV,P.filter=eG,P.flatMap=rG,P.flatMapDeep=oG,P.flatMapDepth=iG,P.flatten=ok,P.flattenDeep=ZV,P.flattenDepth=eK,P.flip=SG,P.flow=yj,P.flowRight=wj,P.fromPairs=tK,P.functions=w6,P.functionsIn=b6,P.groupBy=sG,P.initial=rK,P.intersection=oK,P.intersectionBy=iK,P.intersectionWith=sK,P.invert=x6,P.invertBy=_6,P.invokeMap=cG,P.iteratee=Qw,P.keyBy=lG,P.keys=Fn,P.keysIn=Kr,P.map=fp,P.mapKeys=T6,P.mapValues=E6,P.matches=bj,P.matchesProperty=Cj,P.memoize=pp,P.merge=A6,P.mergeWith=Ak,P.method=xj,P.methodOf=_j,P.mixin=Jw,P.negate=gp,P.nthArg=Tj,P.omit=I6,P.omitBy=k6,P.once=TG,P.orderBy=dG,P.over=Ej,P.overArgs=EG,P.overEvery=Aj,P.overSome=Ij,P.partial=zw,P.partialRight=vk,P.partition=uG,P.pick=P6,P.pickBy=Ik,P.property=Rk,P.propertyOf=kj,P.pull=dK,P.pullAll=sk,P.pullAllBy=uK,P.pullAllWith=fK,P.pullAt=hK,P.range=Pj,P.rangeRight=Oj,P.rearg=AG,P.reject=pG,P.remove=pK,P.rest=IG,P.reverse=Uw,P.sampleSize=mG,P.set=N6,P.setWith=D6,P.shuffle=vG,P.slice=gK,P.sortBy=bG,P.sortedUniq=xK,P.sortedUniqBy=_K,P.split=nj,P.spread=kG,P.tail=SK,P.take=TK,P.takeRight=EK,P.takeRightWhile=AK,P.takeWhile=IK,P.tap=VK,P.throttle=PG,P.thru=up,P.toArray=xk,P.toPairs=kk,P.toPairsIn=Pk,P.toPath=Lj,P.toPlainObject=Sk,P.transform=M6,P.unary=OG,P.union=kK,P.unionBy=PK,P.unionWith=OK,P.uniq=NK,P.uniqBy=DK,P.uniqWith=MK,P.unset=R6,P.unzip=Hw,P.unzipWith=ak,P.update=L6,P.updateWith=F6,P.values=vl,P.valuesIn=$6,P.without=RK,P.words=Dk,P.wrap=NG,P.xor=LK,P.xorBy=FK,P.xorWith=$K,P.zip=UK,P.zipObject=HK,P.zipObjectDeep=BK,P.zipWith=zK,P.entries=kk,P.entriesIn=Pk,P.extend=Tk,P.extendWith=Ek,Jw(P,P),P.add=$j,P.attempt=Mk,P.camelCase=z6,P.capitalize=Ok,P.ceil=Uj,P.clamp=U6,P.clone=MG,P.cloneDeep=LG,P.cloneDeepWith=FG,P.cloneWith=RG,P.conformsTo=$G,P.deburr=Nk,P.defaultTo=vj,P.divide=Hj,P.endsWith=V6,P.eq=Fo,P.escape=K6,P.escapeRegExp=G6,P.every=ZK,P.find=tG,P.findIndex=nk,P.findKey=h6,P.findLast=nG,P.findLastIndex=rk,P.findLastKey=p6,P.floor=Bj,P.forEach=lk,P.forEachRight=dk,P.forIn=g6,P.forInRight=m6,P.forOwn=v6,P.forOwnRight=y6,P.get=jw,P.gt=UG,P.gte=HG,P.has=C6,P.hasIn=Ww,P.head=ik,P.identity=Gr,P.includes=aG,P.indexOf=nK,P.inRange=H6,P.invoke=S6,P.isArguments=Ga,P.isArray=dt,P.isArrayBuffer=BG,P.isArrayLike=Vr,P.isArrayLikeObject=xn,P.isBoolean=zG,P.isBuffer=Bs,P.isDate=VG,P.isElement=KG,P.isEmpty=GG,P.isEqual=jG,P.isEqualWith=WG,P.isError=Vw,P.isFinite=qG,P.isFunction=qi,P.isInteger=yk,P.isLength=mp,P.isMap=wk,P.isMatch=YG,P.isMatchWith=QG,P.isNaN=JG,P.isNative=XG,P.isNil=e6,P.isNull=ZG,P.isNumber=bk,P.isObject=hn,P.isObjectLike=yn,P.isPlainObject=ru,P.isRegExp=Kw,P.isSafeInteger=t6,P.isSet=Ck,P.isString=vp,P.isSymbol=eo,P.isTypedArray=ml,P.isUndefined=n6,P.isWeakMap=r6,P.isWeakSet=o6,P.join=aK,P.kebabCase=j6,P.last=go,P.lastIndexOf=cK,P.lowerCase=W6,P.lowerFirst=q6,P.lt=i6,P.lte=s6,P.max=zj,P.maxBy=Vj,P.mean=Kj,P.meanBy=Gj,P.min=jj,P.minBy=Wj,P.stubArray=Zw,P.stubFalse=eb,P.stubObject=Nj,P.stubString=Dj,P.stubTrue=Mj,P.multiply=qj,P.nth=lK,P.noConflict=Sj,P.noop=Xw,P.now=hp,P.pad=Y6,P.padEnd=Q6,P.padStart=J6,P.parseInt=X6,P.random=B6,P.reduce=fG,P.reduceRight=hG,P.repeat=Z6,P.replace=ej,P.result=O6,P.round=Yj,P.runInContext=J,P.sample=gG,P.size=yG,P.snakeCase=tj,P.some=wG,P.sortedIndex=mK,P.sortedIndexBy=vK,P.sortedIndexOf=yK,P.sortedLastIndex=wK,P.sortedLastIndexBy=bK,P.sortedLastIndexOf=CK,P.startCase=rj,P.startsWith=oj,P.subtract=Qj,P.sum=Jj,P.sumBy=Xj,P.template=ij,P.times=Rj,P.toFinite=Yi,P.toInteger=ft,P.toLength=_k,P.toLower=sj,P.toNumber=mo,P.toSafeInteger=a6,P.toString=Bt,P.toUpper=aj,P.trim=cj,P.trimEnd=lj,P.trimStart=dj,P.truncate=uj,P.unescape=fj,P.uniqueId=Fj,P.upperCase=hj,P.upperFirst=qw,P.each=lk,P.eachRight=dk,P.first=ik,Jw(P,function(){var s={};return si(P,function(l,f){Nt.call(P.prototype,f)||(s[f]=l)}),s}(),{chain:!1}),P.VERSION=r,ar(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){P[s].placeholder=P}),ar(["drop","take"],function(s,l){Ct.prototype[s]=function(f){f=f===n?1:Yt(ft(f),0);var y=this.__filtered__&&!l?new Ct(this):this.clone();return y.__filtered__?y.__takeCount__=Cn(f,y.__takeCount__):y.__views__.push({size:Cn(f,me),type:s+(y.__dir__<0?"Right":"")}),y},Ct.prototype[s+"Right"]=function(f){return this.reverse()[s](f).reverse()}}),ar(["filter","map","takeWhile"],function(s,l){var f=l+1,y=f==re||f==se;Ct.prototype[s]=function(T){var O=this.clone();return O.__iteratees__.push({iteratee:rt(T,3),type:f}),O.__filtered__=O.__filtered__||y,O}}),ar(["head","last"],function(s,l){var f="take"+(l?"Right":"");Ct.prototype[s]=function(){return this[f](1).value()[0]}}),ar(["initial","tail"],function(s,l){var f="drop"+(l?"":"Right");Ct.prototype[s]=function(){return this.__filtered__?new Ct(this):this[f](1)}}),Ct.prototype.compact=function(){return this.filter(Gr)},Ct.prototype.find=function(s){return this.filter(s).head()},Ct.prototype.findLast=function(s){return this.reverse().find(s)},Ct.prototype.invokeMap=mt(function(s,l){return typeof s=="function"?new Ct(this):this.map(function(f){return Jd(f,s,l)})}),Ct.prototype.reject=function(s){return this.filter(gp(rt(s)))},Ct.prototype.slice=function(s,l){s=ft(s);var f=this;return f.__filtered__&&(s>0||l<0)?new Ct(f):(s<0?f=f.takeRight(-s):s&&(f=f.drop(s)),l!==n&&(l=ft(l),f=l<0?f.dropRight(-l):f.take(l-s)),f)},Ct.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Ct.prototype.toArray=function(){return this.take(me)},si(Ct.prototype,function(s,l){var f=/^(?:filter|find|map|reject)|While$/.test(l),y=/^(?:head|last)$/.test(l),T=P[y?"take"+(l=="last"?"Right":""):l],O=y||/^find/.test(l);T&&(P.prototype[l]=function(){var F=this.__wrapped__,K=y?[1]:arguments,oe=F instanceof Ct,ye=K[0],we=oe||dt(F),Te=function(yt){var St=T.apply(P,tn([yt],K));return y&&Ue?St[0]:St};we&&f&&typeof ye=="function"&&ye.length!=1&&(oe=we=!1);var Ue=this.__chain__,Qe=!!this.__actions__.length,ot=O&&!Ue,gt=oe&&!Qe;if(!O&&we){F=gt?F:new Ct(this);var tt=s.apply(F,K);return tt.__actions__.push({func:up,args:[Te],thisArg:n}),new fo(tt,Ue)}return ot&>?s.apply(this,K):(tt=this.thru(Te),ot?y?tt.value()[0]:tt.value():tt)})}),ar(["pop","push","shift","sort","splice","unshift"],function(s){var l=Jr[s],f=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",y=/^(?:pop|shift)$/.test(s);P.prototype[s]=function(){var T=arguments;if(y&&!this.__chain__){var O=this.value();return l.apply(dt(O)?O:[],T)}return this[f](function(F){return l.apply(dt(F)?F:[],T)})}}),si(Ct.prototype,function(s,l){var f=P[l];if(f){var y=f.name+"";Nt.call(Le,y)||(Le[y]=[]),Le[y].push({name:l,func:f})}}),Le[op(n,E).name]=[{name:"wrapper",func:n}],Ct.prototype.clone=hz,Ct.prototype.reverse=pz,Ct.prototype.value=gz,P.prototype.at=KK,P.prototype.chain=GK,P.prototype.commit=jK,P.prototype.next=WK,P.prototype.plant=YK,P.prototype.reverse=QK,P.prototype.toJSON=P.prototype.valueOf=P.prototype.value=JK,P.prototype.first=P.prototype.head,Ls&&(P.prototype[Ls]=qK),P},Ds=rw();Hr?((Hr.exports=Ds)._=Ds,ka._=Ds):Xt._=Ds}).call(jo)}(bf,bf.exports);var Cf=bf.exports;/**
|
|
95
|
+
* @license lucide-react v0.468.0 - ISC
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the ISC license.
|
|
98
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/const vR=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),v0=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
|
|
100
|
+
* @license lucide-react v0.468.0 - ISC
|
|
101
|
+
*
|
|
102
|
+
* This source code is licensed under the ISC license.
|
|
103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
+
*/var yR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
105
|
+
* @license lucide-react v0.468.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/const wR=D.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...c},u)=>D.createElement("svg",{ref:u,...yR,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:v0("lucide",o),...c},[...a.map(([h,p])=>D.createElement(h,p)),...Array.isArray(i)?i:[i]]));/**
|
|
110
|
+
* @license lucide-react v0.468.0 - ISC
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the ISC license.
|
|
113
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
+
*/const pn=(t,e)=>{const n=D.forwardRef(({className:r,...o},i)=>D.createElement(wR,{ref:i,iconNode:e,className:v0(`lucide-${vR(t)}`,r),...o}));return n.displayName=`${t}`,n};/**
|
|
115
|
+
* @license lucide-react v0.468.0 - ISC
|
|
116
|
+
*
|
|
117
|
+
* This source code is licensed under the ISC license.
|
|
118
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
+
*/const Lm=pn("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
|
|
120
|
+
* @license lucide-react v0.468.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/const bR=pn("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
|
|
125
|
+
* @license lucide-react v0.468.0 - ISC
|
|
126
|
+
*
|
|
127
|
+
* This source code is licensed under the ISC license.
|
|
128
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
+
*/const y0=pn("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
130
|
+
* @license lucide-react v0.468.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/const CR=pn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
135
|
+
* @license lucide-react v0.468.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const xR=pn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
140
|
+
* @license lucide-react v0.468.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const w0=pn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
145
|
+
* @license lucide-react v0.468.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const _R=pn("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
150
|
+
* @license lucide-react v0.468.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const SR=pn("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
155
|
+
* @license lucide-react v0.468.0 - ISC
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the ISC license.
|
|
158
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/const TR=pn("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
160
|
+
* @license lucide-react v0.468.0 - ISC
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the ISC license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/const ER=pn("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
165
|
+
* @license lucide-react v0.468.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const AR=pn("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
170
|
+
* @license lucide-react v0.468.0 - ISC
|
|
171
|
+
*
|
|
172
|
+
* This source code is licensed under the ISC license.
|
|
173
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
+
*/const Fm=pn("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
175
|
+
* @license lucide-react v0.468.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/const $m=pn("FileX",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m14.5 12.5-5 5",key:"b62r18"}],["path",{d:"m9.5 12.5 5 5",key:"1rk7el"}]]);/**
|
|
180
|
+
* @license lucide-react v0.468.0 - ISC
|
|
181
|
+
*
|
|
182
|
+
* This source code is licensed under the ISC license.
|
|
183
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
+
*/const IR=pn("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
185
|
+
* @license lucide-react v0.468.0 - ISC
|
|
186
|
+
*
|
|
187
|
+
* This source code is licensed under the ISC license.
|
|
188
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
+
*/const Tt=pn("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
190
|
+
* @license lucide-react v0.468.0 - ISC
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the ISC license.
|
|
193
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
+
*/const kR=pn("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
195
|
+
* @license lucide-react v0.468.0 - ISC
|
|
196
|
+
*
|
|
197
|
+
* This source code is licensed under the ISC license.
|
|
198
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
+
*/const PR=pn("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
200
|
+
* @license lucide-react v0.468.0 - ISC
|
|
201
|
+
*
|
|
202
|
+
* This source code is licensed under the ISC license.
|
|
203
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
+
*/const OR=pn("MoveUpRight",[["path",{d:"M13 5H19V11",key:"1n1gyv"}],["path",{d:"M19 5L5 19",key:"72u4yj"}]]);/**
|
|
205
|
+
* @license lucide-react v0.468.0 - ISC
|
|
206
|
+
*
|
|
207
|
+
* This source code is licensed under the ISC license.
|
|
208
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
+
*/const NR=pn("PenOff",[["path",{d:"m10 10-6.157 6.162a2 2 0 0 0-.5.833l-1.322 4.36a.5.5 0 0 0 .622.624l4.358-1.323a2 2 0 0 0 .83-.5L14 13.982",key:"bjo8r8"}],["path",{d:"m12.829 7.172 4.359-4.346a1 1 0 1 1 3.986 3.986l-4.353 4.353",key:"16h5ne"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
210
|
+
* @license lucide-react v0.468.0 - ISC
|
|
211
|
+
*
|
|
212
|
+
* This source code is licensed under the ISC license.
|
|
213
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
+
*/const DR=pn("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
215
|
+
* @license lucide-react v0.468.0 - ISC
|
|
216
|
+
*
|
|
217
|
+
* This source code is licensed under the ISC license.
|
|
218
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
+
*/const fs=pn("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
220
|
+
* @license lucide-react v0.468.0 - ISC
|
|
221
|
+
*
|
|
222
|
+
* This source code is licensed under the ISC license.
|
|
223
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
+
*/const Um=pn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function b0(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=b0(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Ci(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=b0(t))&&(r&&(r+=" "),r+=e);return r}var Ll=t=>typeof t=="number"&&!isNaN(t),Js=t=>typeof t=="string",xi=t=>typeof t=="function",MR=t=>Js(t)||Ll(t),Hm=t=>Js(t)||xi(t)?t:null,RR=(t,e)=>t===!1||Ll(t)&&t>0?t:e,Bm=t=>D.isValidElement(t)||Js(t)||xi(t)||Ll(t);function LR(t,e,n=300){let{scrollHeight:r,style:o}=t;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(e,n)})})}function FR({enter:t,exit:e,appendPosition:n=!1,collapse:r=!0,collapseDuration:o=300}){return function({children:i,position:a,preventExitTransition:c,done:u,nodeRef:h,isIn:p,playToast:g}){let v=n?`${t}--${a}`:t,m=n?`${e}--${a}`:e,C=D.useRef(0);return D.useLayoutEffect(()=>{let b=h.current,w=v.split(" "),_=E=>{E.target===h.current&&(g(),b.removeEventListener("animationend",_),b.removeEventListener("animationcancel",_),C.current===0&&E.type!=="animationcancel"&&b.classList.remove(...w))};b.classList.add(...w),b.addEventListener("animationend",_),b.addEventListener("animationcancel",_)},[]),D.useEffect(()=>{let b=h.current,w=()=>{b.removeEventListener("animationend",w),r?LR(b,u,o):u()};p||(c?w():(C.current=1,b.className+=` ${m}`,b.addEventListener("animationend",w)))},[p]),D.createElement(D.Fragment,null,i)}}function C0(t,e){return{content:x0(t.content,t.props),containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,reason:t.removalReason,status:e}}function x0(t,e,n=!1){return D.isValidElement(t)&&!Js(t.type)?D.cloneElement(t,{closeToast:e.closeToast,toastProps:e,data:e.data,isPaused:n}):xi(t)?t({closeToast:e.closeToast,toastProps:e,data:e.data,isPaused:n}):t}function $R({closeToast:t,theme:e,ariaLabel:n="close"}){return D.createElement("button",{className:`Toastify__close-button Toastify__close-button--${e}`,type:"button",onClick:r=>{r.stopPropagation(),t(!0)},"aria-label":n},D.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},D.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function UR({delay:t,isRunning:e,closeToast:n,type:r="default",hide:o,className:i,controlledProgress:a,progress:c,rtl:u,isIn:h,theme:p}){let g=o||a&&c===0,v={animationDuration:`${t}ms`,animationPlayState:e?"running":"paused"};a&&(v.transform=`scaleX(${c})`);let m=Ci("Toastify__progress-bar",a?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${p}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":u}),C=xi(i)?i({rtl:u,type:r,defaultClassName:m}):Ci(m,i),b={[a&&c>=1?"onTransitionEnd":"onAnimationEnd"]:a&&c<1?null:()=>{h&&n()}};return D.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":g},D.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${p} Toastify__progress-bar--${r}`}),D.createElement("div",{role:"progressbar","aria-hidden":g?"true":"false","aria-label":"notification timer","aria-valuenow":a?Math.round(c*100):void 0,"aria-valuemin":0,"aria-valuemax":100,className:C,style:v,...b}))}var HR=1,_0=()=>`${HR++}`;function BR(t,e,n){let r=1,o=0,i=[],a=[],c=e,u=new Map,h=new Set,p=E=>(h.add(E),()=>h.delete(E)),g=()=>{a=Array.from(u.values()),h.forEach(E=>E())},v=({containerId:E,toastId:I,updateId:k})=>{let A=E?E!==t:t!==1,M=u.has(I)&&k==null;return A||M},m=(E,I)=>{u.forEach(k=>{var A;(I==null||I===k.props.toastId)&&((A=k.toggle)==null||A.call(k,E))})},C=E=>{var I,k;E.isActive&&((k=(I=E.props)==null?void 0:I.onClose)==null||k.call(I,E.removalReason),E.isActive=!1,n(C0(E,"removed")))},b=E=>{if(E==null)u.forEach(C);else{let I=u.get(E);I&&C(I)}g()},w=()=>{o-=i.length,i=[]},_=E=>{var I,k;let{toastId:A,updateId:M}=E.props,B=M==null;E.staleId&&u.delete(E.staleId),E.isActive=!0,u.set(A,E),g(),n(C0(E,B?"added":"updated")),B&&((k=(I=E.props).onOpen)==null||k.call(I))};return{id:t,props:c,observe:p,toggle:m,removeToast:b,toasts:u,clearQueue:w,buildToast:(E,I)=>{if(v(I))return;let{toastId:k,updateId:A,data:M,staleId:B,delay:W}=I,Y=A==null;Y&&o++;let z={...c,style:c.toastStyle,key:r++,...Object.fromEntries(Object.entries(I).filter(([ne,ae])=>ae!=null)),toastId:k,updateId:A,data:M,isIn:!1,className:Hm(I.className||c.toastClassName),progressClassName:Hm(I.progressClassName||c.progressClassName),autoClose:I.isLoading?!1:RR(I.autoClose,c.autoClose),closeToast(ne){let ae=u.get(k);ae&&(ae.removalReason=ne,b(k))},deleteToast(){if(u.get(k)!=null){if(u.delete(k),o--,o<0&&(o=0),i.length>0){_(i.shift());return}g()}}};z.closeButton=c.closeButton,I.closeButton===!1||Bm(I.closeButton)?z.closeButton=I.closeButton:I.closeButton===!0&&(z.closeButton=Bm(c.closeButton)?c.closeButton:!0);let de={content:E,props:z,staleId:B};c.limit&&c.limit>0&&o>c.limit&&Y?i.push(de):Ll(W)?setTimeout(()=>{_(de)},W):_(de)},setProps(E){c=E},setToggle:(E,I)=>{let k=u.get(E);k&&(k.toggle=I)},isToastActive:E=>{var I;return(I=u.get(E))==null?void 0:I.isActive},getSnapshot:()=>a}}var vr=new Map,Fl=[],zm=new Set,zR=t=>zm.forEach(e=>e(t)),S0=()=>vr.size>0;function VR(){Fl.forEach(t=>E0(t.content,t.options)),Fl=[]}var KR=(t,{containerId:e})=>{var n;return(n=vr.get(e||1))==null?void 0:n.toasts.get(t)};function T0(t,e){var n;if(e)return!!((n=vr.get(e))!=null&&n.isToastActive(t));let r=!1;return vr.forEach(o=>{o.isToastActive(t)&&(r=!0)}),r}function GR(t){if(!S0()){Fl=Fl.filter(e=>t!=null&&e.options.toastId!==t);return}if(t==null||MR(t))vr.forEach(e=>{e.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){let e=vr.get(t.containerId);e?e.removeToast(t.id):vr.forEach(n=>{n.removeToast(t.id)})}}var jR=(t={})=>{vr.forEach(e=>{e.props.limit&&(!t.containerId||e.id===t.containerId)&&e.clearQueue()})};function E0(t,e){Bm(t)&&(S0()||Fl.push({content:t,options:e}),vr.forEach(n=>{n.buildToast(t,e)}))}function WR(t){var e;(e=vr.get(t.containerId||1))==null||e.setToggle(t.id,t.fn)}function A0(t,e){vr.forEach(n=>{(e==null||!(e!=null&&e.containerId)||(e==null?void 0:e.containerId)===n.id)&&n.toggle(t,e==null?void 0:e.id)})}function qR(t){let e=t.containerId||1;return{subscribe(n){let r=BR(e,t,zR);vr.set(e,r);let o=r.observe(n);return VR(),()=>{o(),vr.delete(e)}},setProps(n){var r;(r=vr.get(e))==null||r.setProps(n)},getSnapshot(){var n;return(n=vr.get(e))==null?void 0:n.getSnapshot()}}}function YR(t){return zm.add(t),()=>{zm.delete(t)}}function QR(t){return t&&(Js(t.toastId)||Ll(t.toastId))?t.toastId:_0()}function $l(t,e){return E0(t,e),e.toastId}function xf(t,e){return{...e,type:e&&e.type||t,toastId:QR(e)}}function _f(t){return(e,n)=>$l(e,xf(t,n))}function Ve(t,e){return $l(t,xf("default",e))}Ve.loading=(t,e)=>$l(t,xf("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e}));function JR(t,{pending:e,error:n,success:r},o){let i;e&&(i=Js(e)?Ve.loading(e,o):Ve.loading(e.render,{...o,...e}));let a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(h,p,g)=>{if(p==null){Ve.dismiss(i);return}let v={type:h,...a,...o,data:g},m=Js(p)?{render:p}:p;return i?Ve.update(i,{...v,...m}):Ve(m.render,{...v,...m}),g},u=xi(t)?t():t;return u.then(h=>c("success",r,h)).catch(h=>c("error",n,h)),u}Ve.promise=JR,Ve.success=_f("success"),Ve.info=_f("info"),Ve.error=_f("error"),Ve.warning=_f("warning"),Ve.warn=Ve.warning,Ve.dark=(t,e)=>$l(t,xf("default",{theme:"dark",...e}));function XR(t){GR(t)}Ve.dismiss=XR,Ve.clearWaitingQueue=jR,Ve.isActive=T0,Ve.update=(t,e={})=>{let n=KR(t,e);if(n){let{props:r,content:o}=n,i={delay:100,...r,...e,toastId:e.toastId||t,updateId:_0()};i.toastId!==t&&(i.staleId=t);let a=i.render||o;delete i.render,$l(a,i)}},Ve.done=t=>{Ve.update(t,{progress:1})},Ve.onChange=YR,Ve.play=t=>A0(!0,t),Ve.pause=t=>A0(!1,t);function ZR(t){var e;let{subscribe:n,getSnapshot:r,setProps:o}=D.useRef(qR(t)).current;o(t);let i=(e=D.useSyncExternalStore(n,r,r))==null?void 0:e.slice();function a(c){if(!i)return[];let u=new Map;return t.newestOnTop&&i.reverse(),i.forEach(h=>{let{position:p}=h.props;u.has(p)||u.set(p,[]),u.get(p).push(h)}),Array.from(u,h=>c(h[0],h[1]))}return{getToastToRender:a,isToastActive:T0,count:i==null?void 0:i.length}}function e2(t){let[e,n]=D.useState(!1),[r,o]=D.useState(!1),i=D.useRef(null),a=D.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:c,pauseOnHover:u,closeToast:h,onClick:p,closeOnClick:g}=t;WR({id:t.toastId,containerId:t.containerId,fn:n}),D.useEffect(()=>{if(t.pauseOnFocusLoss)return v(),()=>{m()}},[t.pauseOnFocusLoss]);function v(){document.hasFocus()||_(),window.addEventListener("focus",w),window.addEventListener("blur",_)}function m(){window.removeEventListener("focus",w),window.removeEventListener("blur",_)}function C(B){if(t.draggable===!0||t.draggable===B.pointerType){E();let W=i.current;a.canCloseOnClick=!0,a.canDrag=!0,W.style.transition="none",t.draggableDirection==="x"?(a.start=B.clientX,a.removalDistance=W.offsetWidth*(t.draggablePercent/100)):(a.start=B.clientY,a.removalDistance=W.offsetHeight*(t.draggablePercent===80?t.draggablePercent*1.5:t.draggablePercent)/100)}}function b(B){let{top:W,bottom:Y,left:z,right:de}=i.current.getBoundingClientRect();B.pointerType==="mouse"&&t.pauseOnHover&&B.clientX>=z&&B.clientX<=de&&B.clientY>=W&&B.clientY<=Y?_():w()}function w(){n(!0)}function _(){n(!1)}function E(){a.didMove=!1,document.addEventListener("pointermove",k),document.addEventListener("pointerup",A)}function I(){document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",A)}function k(B){let W=i.current;if(a.canDrag&&W){a.didMove=!0,e&&_(),t.draggableDirection==="x"?a.delta=B.clientX-a.start:a.delta=B.clientY-a.start,a.start!==B.clientX&&(a.canCloseOnClick=!1);let Y=t.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`;W.style.transform=`translate3d(${Y},0)`,W.style.opacity=`${1-Math.abs(a.delta/a.removalDistance)}`}}function A(){I();let B=i.current;if(a.canDrag&&a.didMove&&B){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance){o(!0),t.closeToast(!0),t.collapseAll();return}B.style.transition="transform 0.2s, opacity 0.2s",B.style.removeProperty("transform"),B.style.removeProperty("opacity")}}let M={onPointerDown:C,onPointerUp:b};return c&&u&&(M.onMouseEnter=_,t.stacked||(M.onMouseLeave=w)),g&&(M.onClick=B=>{p&&p(B),a.canCloseOnClick&&h(!0)}),{playToast:w,pauseToast:_,isRunning:e,preventExitTransition:r,toastRef:i,eventHandlers:M}}var I0=typeof window<"u"?D.useLayoutEffect:D.useEffect,Sf=({theme:t,type:e,isLoading:n,...r})=>D.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${e})`,...r});function t2(t){return D.createElement(Sf,{...t},D.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function n2(t){return D.createElement(Sf,{...t},D.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function r2(t){return D.createElement(Sf,{...t},D.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function o2(t){return D.createElement(Sf,{...t},D.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function i2(){return D.createElement("div",{className:"Toastify__spinner"})}var Vm={info:n2,warning:t2,success:r2,error:o2,spinner:i2},s2=t=>t in Vm;function a2({theme:t,type:e,isLoading:n,icon:r}){let o=null,i={theme:t,type:e};return r===!1||(xi(r)?o=r({...i,isLoading:n}):D.isValidElement(r)?o=D.cloneElement(r,i):n?o=Vm.spinner():s2(e)&&(o=Vm[e](i))),o}var c2=t=>{let{isRunning:e,preventExitTransition:n,toastRef:r,eventHandlers:o,playToast:i}=e2(t),{closeButton:a,children:c,autoClose:u,onClick:h,type:p,hideProgressBar:g,closeToast:v,transition:m,position:C,className:b,style:w,progressClassName:_,updateId:E,role:I,progress:k,rtl:A,toastId:M,deleteToast:B,isIn:W,isLoading:Y,closeOnClick:z,theme:de,ariaLabel:ne}=t,ae=Ci("Toastify__toast",`Toastify__toast-theme--${de}`,`Toastify__toast--${p}`,{"Toastify__toast--rtl":A},{"Toastify__toast--close-on-click":z}),Q=xi(b)?b({rtl:A,position:C,type:p,defaultClassName:ae}):Ci(ae,b),re=a2(t),j=!!k||!u,se={closeToast:v,type:p,theme:de},ie=null;return a===!1||(xi(a)?ie=a(se):D.isValidElement(a)?ie=D.cloneElement(a,se):ie=$R(se)),D.createElement(m,{isIn:W,done:B,position:C,preventExitTransition:n,nodeRef:r,playToast:i},D.createElement("div",{id:M,tabIndex:0,onClick:h,"data-in":W,className:Q,...o,style:w,ref:r,...W&&{role:I,"aria-label":ne}},re!=null&&D.createElement("div",{className:Ci("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!Y})},re),x0(c,t,!e),ie,!t.customProgressBar&&D.createElement(UR,{...E&&!j?{key:`p-${E}`}:{},rtl:A,theme:de,delay:u,isRunning:e,isIn:W,closeToast:v,hide:g,type:p,className:_,controlledProgress:j,progress:k||0})))},l2=(t,e=!1)=>({enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}),d2=FR(l2("bounce",!0)),u2={position:"top-right",transition:d2,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:t=>t.altKey&&t.code==="KeyT"};function f2(t){let e={...u2,...t},n=t.stacked,[r,o]=D.useState(!0),i=D.useRef(null),{getToastToRender:a,isToastActive:c,count:u}=ZR(e),{className:h,style:p,rtl:g,containerId:v,hotKeys:m}=e;function C(w){let _=Ci("Toastify__toast-container",`Toastify__toast-container--${w}`,{"Toastify__toast-container--rtl":g});return xi(h)?h({position:w,rtl:g,defaultClassName:_}):Ci(_,Hm(h))}function b(){n&&(o(!0),Ve.play())}return I0(()=>{var w;if(n){let _=i.current.querySelectorAll('[data-in="true"]'),E=12,I=(w=e.position)==null?void 0:w.includes("top"),k=0,A=0;Array.from(_).reverse().forEach((M,B)=>{let W=M;W.classList.add("Toastify__toast--stacked"),B>0&&(W.dataset.collapsed=`${r}`),W.dataset.pos||(W.dataset.pos=I?"top":"bot");let Y=k*(r?.2:1)+(r?0:E*B),z=Math.max(.5,1-(r?A:0));W.style.setProperty("--y",`${I?Y:Y*-1}px`),W.style.setProperty("--g",`${E}`),W.style.setProperty("--s",`${z}`),k+=W.offsetHeight,A+=.025})}},[r,u,n]),D.useEffect(()=>{function w(_){var E;let I=i.current;m(_)&&((E=I==null?void 0:I.querySelector('[tabIndex="0"]'))==null||E.focus(),o(!1),Ve.pause()),_.key==="Escape"&&(document.activeElement===I||I!=null&&I.contains(document.activeElement))&&(o(!0),Ve.play())}return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[m]),D.createElement("section",{ref:i,className:"Toastify",id:v,onMouseEnter:()=>{n&&(o(!1),Ve.pause())},onMouseLeave:b,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":e["aria-label"]},a((w,_)=>{let E=_.length?{...p}:{...p,pointerEvents:"none"};return D.createElement("div",{tabIndex:-1,className:C(w),"data-stacked":n,style:E,key:`c-${w}`},_.map(({content:I,props:k})=>D.createElement(c2,{...k,stacked:n,collapseAll:b,isIn:c(k.toastId,k.containerId),key:`t-${k.key}`},I)))}))}var h2=`:root {
|
|
225
|
+
--toastify-color-light: #fff;
|
|
226
|
+
--toastify-color-dark: #121212;
|
|
227
|
+
--toastify-color-info: #3498db;
|
|
228
|
+
--toastify-color-success: #07bc0c;
|
|
229
|
+
--toastify-color-warning: #f1c40f;
|
|
230
|
+
--toastify-color-error: hsl(6, 78%, 57%);
|
|
231
|
+
--toastify-color-transparent: rgba(255, 255, 255, 0.7);
|
|
232
|
+
|
|
233
|
+
--toastify-icon-color-info: var(--toastify-color-info);
|
|
234
|
+
--toastify-icon-color-success: var(--toastify-color-success);
|
|
235
|
+
--toastify-icon-color-warning: var(--toastify-color-warning);
|
|
236
|
+
--toastify-icon-color-error: var(--toastify-color-error);
|
|
237
|
+
|
|
238
|
+
--toastify-container-width: fit-content;
|
|
239
|
+
--toastify-toast-width: 320px;
|
|
240
|
+
--toastify-toast-offset: 16px;
|
|
241
|
+
--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));
|
|
242
|
+
--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));
|
|
243
|
+
--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));
|
|
244
|
+
--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));
|
|
245
|
+
--toastify-toast-background: #fff;
|
|
246
|
+
--toastify-toast-padding: 14px;
|
|
247
|
+
--toastify-toast-min-height: 64px;
|
|
248
|
+
--toastify-toast-max-height: 800px;
|
|
249
|
+
--toastify-toast-bd-radius: 6px;
|
|
250
|
+
--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
251
|
+
--toastify-font-family: sans-serif;
|
|
252
|
+
--toastify-z-index: 9999;
|
|
253
|
+
--toastify-text-color-light: #757575;
|
|
254
|
+
--toastify-text-color-dark: #fff;
|
|
255
|
+
|
|
256
|
+
/* Used only for colored theme */
|
|
257
|
+
--toastify-text-color-info: #fff;
|
|
258
|
+
--toastify-text-color-success: #fff;
|
|
259
|
+
--toastify-text-color-warning: #fff;
|
|
260
|
+
--toastify-text-color-error: #fff;
|
|
261
|
+
|
|
262
|
+
--toastify-spinner-color: #616161;
|
|
263
|
+
--toastify-spinner-color-empty-area: #e0e0e0;
|
|
264
|
+
--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);
|
|
265
|
+
--toastify-color-progress-dark: #bb86fc;
|
|
266
|
+
--toastify-color-progress-info: var(--toastify-color-info);
|
|
267
|
+
--toastify-color-progress-success: var(--toastify-color-success);
|
|
268
|
+
--toastify-color-progress-warning: var(--toastify-color-warning);
|
|
269
|
+
--toastify-color-progress-error: var(--toastify-color-error);
|
|
270
|
+
/* used to control the opacity of the progress trail */
|
|
271
|
+
--toastify-color-progress-bgo: 0.2;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.Toastify__toast-container {
|
|
275
|
+
z-index: var(--toastify-z-index);
|
|
276
|
+
-webkit-transform: translate3d(0, 0, var(--toastify-z-index));
|
|
277
|
+
position: fixed;
|
|
278
|
+
width: var(--toastify-container-width);
|
|
279
|
+
box-sizing: border-box;
|
|
280
|
+
color: #fff;
|
|
281
|
+
display: flex;
|
|
282
|
+
flex-direction: column;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.Toastify__toast-container--top-left {
|
|
286
|
+
top: var(--toastify-toast-top);
|
|
287
|
+
left: var(--toastify-toast-left);
|
|
288
|
+
}
|
|
289
|
+
.Toastify__toast-container--top-center {
|
|
290
|
+
top: var(--toastify-toast-top);
|
|
291
|
+
left: 50%;
|
|
292
|
+
transform: translateX(-50%);
|
|
293
|
+
align-items: center;
|
|
294
|
+
}
|
|
295
|
+
.Toastify__toast-container--top-right {
|
|
296
|
+
top: var(--toastify-toast-top);
|
|
297
|
+
right: var(--toastify-toast-right);
|
|
298
|
+
align-items: end;
|
|
299
|
+
}
|
|
300
|
+
.Toastify__toast-container--bottom-left {
|
|
301
|
+
bottom: var(--toastify-toast-bottom);
|
|
302
|
+
left: var(--toastify-toast-left);
|
|
303
|
+
}
|
|
304
|
+
.Toastify__toast-container--bottom-center {
|
|
305
|
+
bottom: var(--toastify-toast-bottom);
|
|
306
|
+
left: 50%;
|
|
307
|
+
transform: translateX(-50%);
|
|
308
|
+
align-items: center;
|
|
309
|
+
}
|
|
310
|
+
.Toastify__toast-container--bottom-right {
|
|
311
|
+
bottom: var(--toastify-toast-bottom);
|
|
312
|
+
right: var(--toastify-toast-right);
|
|
313
|
+
align-items: end;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.Toastify__toast {
|
|
317
|
+
--y: 0px;
|
|
318
|
+
position: relative;
|
|
319
|
+
touch-action: none;
|
|
320
|
+
width: var(--toastify-toast-width);
|
|
321
|
+
min-height: var(--toastify-toast-min-height);
|
|
322
|
+
box-sizing: border-box;
|
|
323
|
+
margin-bottom: 1rem;
|
|
324
|
+
padding: var(--toastify-toast-padding);
|
|
325
|
+
border-radius: var(--toastify-toast-bd-radius);
|
|
326
|
+
box-shadow: var(--toastify-toast-shadow);
|
|
327
|
+
max-height: var(--toastify-toast-max-height);
|
|
328
|
+
font-family: var(--toastify-font-family);
|
|
329
|
+
/* webkit only issue #791 */
|
|
330
|
+
z-index: 0;
|
|
331
|
+
/* inner swag */
|
|
332
|
+
display: flex;
|
|
333
|
+
flex: 1 auto;
|
|
334
|
+
align-items: center;
|
|
335
|
+
word-break: break-word;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
@media only screen and (max-width: 480px) {
|
|
339
|
+
.Toastify__toast-container {
|
|
340
|
+
width: 100vw;
|
|
341
|
+
left: env(safe-area-inset-left);
|
|
342
|
+
margin: 0;
|
|
343
|
+
}
|
|
344
|
+
.Toastify__toast-container--top-left,
|
|
345
|
+
.Toastify__toast-container--top-center,
|
|
346
|
+
.Toastify__toast-container--top-right {
|
|
347
|
+
top: env(safe-area-inset-top);
|
|
348
|
+
transform: translateX(0);
|
|
349
|
+
}
|
|
350
|
+
.Toastify__toast-container--bottom-left,
|
|
351
|
+
.Toastify__toast-container--bottom-center,
|
|
352
|
+
.Toastify__toast-container--bottom-right {
|
|
353
|
+
bottom: env(safe-area-inset-bottom);
|
|
354
|
+
transform: translateX(0);
|
|
355
|
+
}
|
|
356
|
+
.Toastify__toast-container--rtl {
|
|
357
|
+
right: env(safe-area-inset-right);
|
|
358
|
+
left: initial;
|
|
359
|
+
}
|
|
360
|
+
.Toastify__toast {
|
|
361
|
+
--toastify-toast-width: 100%;
|
|
362
|
+
margin-bottom: 0;
|
|
363
|
+
border-radius: 0;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.Toastify__toast-container[data-stacked='true'] {
|
|
368
|
+
width: var(--toastify-toast-width);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
@media only screen and (max-width: 480px) {
|
|
372
|
+
.Toastify__toast-container[data-stacked='true'] {
|
|
373
|
+
width: 100vw;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.Toastify__toast--stacked {
|
|
378
|
+
position: absolute;
|
|
379
|
+
width: 100%;
|
|
380
|
+
transform: translate3d(0, var(--y), 0) scale(var(--s));
|
|
381
|
+
transition: transform 0.3s;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,
|
|
385
|
+
.Toastify__toast--stacked[data-collapsed] .Toastify__close-button {
|
|
386
|
+
transition: opacity 0.1s;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.Toastify__toast--stacked[data-collapsed='false'] {
|
|
390
|
+
overflow: visible;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.Toastify__toast--stacked[data-collapsed='true']:not(:last-child) > * {
|
|
394
|
+
opacity: 0;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.Toastify__toast--stacked:after {
|
|
398
|
+
content: '';
|
|
399
|
+
position: absolute;
|
|
400
|
+
left: 0;
|
|
401
|
+
right: 0;
|
|
402
|
+
height: calc(var(--g) * 1px);
|
|
403
|
+
bottom: 100%;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.Toastify__toast--stacked[data-pos='top'] {
|
|
407
|
+
top: 0;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.Toastify__toast--stacked[data-pos='bot'] {
|
|
411
|
+
bottom: 0;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.Toastify__toast--stacked[data-pos='bot'].Toastify__toast--stacked:before {
|
|
415
|
+
transform-origin: top;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.Toastify__toast--stacked[data-pos='top'].Toastify__toast--stacked:before {
|
|
419
|
+
transform-origin: bottom;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.Toastify__toast--stacked:before {
|
|
423
|
+
content: '';
|
|
424
|
+
position: absolute;
|
|
425
|
+
left: 0;
|
|
426
|
+
right: 0;
|
|
427
|
+
bottom: 0;
|
|
428
|
+
height: 100%;
|
|
429
|
+
transform: scaleY(3);
|
|
430
|
+
z-index: -1;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.Toastify__toast--rtl {
|
|
434
|
+
direction: rtl;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.Toastify__toast--close-on-click {
|
|
438
|
+
cursor: pointer;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.Toastify__toast-icon {
|
|
442
|
+
margin-inline-end: 10px;
|
|
443
|
+
width: 22px;
|
|
444
|
+
flex-shrink: 0;
|
|
445
|
+
display: flex;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.Toastify--animate {
|
|
449
|
+
animation-fill-mode: both;
|
|
450
|
+
animation-duration: 0.5s;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.Toastify--animate-icon {
|
|
454
|
+
animation-fill-mode: both;
|
|
455
|
+
animation-duration: 0.3s;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.Toastify__toast-theme--dark {
|
|
459
|
+
background: var(--toastify-color-dark);
|
|
460
|
+
color: var(--toastify-text-color-dark);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.Toastify__toast-theme--light {
|
|
464
|
+
background: var(--toastify-color-light);
|
|
465
|
+
color: var(--toastify-text-color-light);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.Toastify__toast-theme--colored.Toastify__toast--default {
|
|
469
|
+
background: var(--toastify-color-light);
|
|
470
|
+
color: var(--toastify-text-color-light);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.Toastify__toast-theme--colored.Toastify__toast--info {
|
|
474
|
+
color: var(--toastify-text-color-info);
|
|
475
|
+
background: var(--toastify-color-info);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.Toastify__toast-theme--colored.Toastify__toast--success {
|
|
479
|
+
color: var(--toastify-text-color-success);
|
|
480
|
+
background: var(--toastify-color-success);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.Toastify__toast-theme--colored.Toastify__toast--warning {
|
|
484
|
+
color: var(--toastify-text-color-warning);
|
|
485
|
+
background: var(--toastify-color-warning);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.Toastify__toast-theme--colored.Toastify__toast--error {
|
|
489
|
+
color: var(--toastify-text-color-error);
|
|
490
|
+
background: var(--toastify-color-error);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.Toastify__progress-bar-theme--light {
|
|
494
|
+
background: var(--toastify-color-progress-light);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.Toastify__progress-bar-theme--dark {
|
|
498
|
+
background: var(--toastify-color-progress-dark);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.Toastify__progress-bar--info {
|
|
502
|
+
background: var(--toastify-color-progress-info);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.Toastify__progress-bar--success {
|
|
506
|
+
background: var(--toastify-color-progress-success);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.Toastify__progress-bar--warning {
|
|
510
|
+
background: var(--toastify-color-progress-warning);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.Toastify__progress-bar--error {
|
|
514
|
+
background: var(--toastify-color-progress-error);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,
|
|
518
|
+
.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,
|
|
519
|
+
.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,
|
|
520
|
+
.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error {
|
|
521
|
+
background: var(--toastify-color-transparent);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
.Toastify__close-button {
|
|
525
|
+
color: #fff;
|
|
526
|
+
position: absolute;
|
|
527
|
+
top: 6px;
|
|
528
|
+
right: 6px;
|
|
529
|
+
background: transparent;
|
|
530
|
+
outline: none;
|
|
531
|
+
border: none;
|
|
532
|
+
padding: 0;
|
|
533
|
+
cursor: pointer;
|
|
534
|
+
opacity: 0.7;
|
|
535
|
+
transition: 0.3s ease;
|
|
536
|
+
z-index: 1;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.Toastify__toast--rtl .Toastify__close-button {
|
|
540
|
+
left: 6px;
|
|
541
|
+
right: unset;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
.Toastify__close-button--light {
|
|
545
|
+
color: #000;
|
|
546
|
+
opacity: 0.3;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
.Toastify__close-button > svg {
|
|
550
|
+
fill: currentColor;
|
|
551
|
+
height: 16px;
|
|
552
|
+
width: 14px;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
.Toastify__close-button:hover,
|
|
556
|
+
.Toastify__close-button:focus {
|
|
557
|
+
opacity: 1;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
@keyframes Toastify__trackProgress {
|
|
561
|
+
0% {
|
|
562
|
+
transform: scaleX(1);
|
|
563
|
+
}
|
|
564
|
+
100% {
|
|
565
|
+
transform: scaleX(0);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
.Toastify__progress-bar {
|
|
570
|
+
position: absolute;
|
|
571
|
+
bottom: 0;
|
|
572
|
+
left: 0;
|
|
573
|
+
width: 100%;
|
|
574
|
+
height: 100%;
|
|
575
|
+
z-index: 1;
|
|
576
|
+
opacity: 0.7;
|
|
577
|
+
transform-origin: left;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.Toastify__progress-bar--animated {
|
|
581
|
+
animation: Toastify__trackProgress linear 1 forwards;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.Toastify__progress-bar--controlled {
|
|
585
|
+
transition: transform 0.2s;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.Toastify__progress-bar--rtl {
|
|
589
|
+
right: 0;
|
|
590
|
+
left: initial;
|
|
591
|
+
transform-origin: right;
|
|
592
|
+
border-bottom-left-radius: initial;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
.Toastify__progress-bar--wrp {
|
|
596
|
+
position: absolute;
|
|
597
|
+
overflow: hidden;
|
|
598
|
+
bottom: 0;
|
|
599
|
+
left: 0;
|
|
600
|
+
width: 100%;
|
|
601
|
+
height: 5px;
|
|
602
|
+
border-bottom-left-radius: var(--toastify-toast-bd-radius);
|
|
603
|
+
border-bottom-right-radius: var(--toastify-toast-bd-radius);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
.Toastify__progress-bar--wrp[data-hidden='true'] {
|
|
607
|
+
opacity: 0;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
.Toastify__progress-bar--bg {
|
|
611
|
+
opacity: var(--toastify-color-progress-bgo);
|
|
612
|
+
width: 100%;
|
|
613
|
+
height: 100%;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
.Toastify__spinner {
|
|
617
|
+
width: 20px;
|
|
618
|
+
height: 20px;
|
|
619
|
+
box-sizing: border-box;
|
|
620
|
+
border: 2px solid;
|
|
621
|
+
border-radius: 100%;
|
|
622
|
+
border-color: var(--toastify-spinner-color-empty-area);
|
|
623
|
+
border-right-color: var(--toastify-spinner-color);
|
|
624
|
+
animation: Toastify__spin 0.65s linear infinite;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
@keyframes Toastify__bounceInRight {
|
|
628
|
+
from,
|
|
629
|
+
60%,
|
|
630
|
+
75%,
|
|
631
|
+
90%,
|
|
632
|
+
to {
|
|
633
|
+
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
634
|
+
}
|
|
635
|
+
from {
|
|
636
|
+
opacity: 0;
|
|
637
|
+
transform: translate3d(3000px, 0, 0);
|
|
638
|
+
}
|
|
639
|
+
60% {
|
|
640
|
+
opacity: 1;
|
|
641
|
+
transform: translate3d(-25px, 0, 0);
|
|
642
|
+
}
|
|
643
|
+
75% {
|
|
644
|
+
transform: translate3d(10px, 0, 0);
|
|
645
|
+
}
|
|
646
|
+
90% {
|
|
647
|
+
transform: translate3d(-5px, 0, 0);
|
|
648
|
+
}
|
|
649
|
+
to {
|
|
650
|
+
transform: none;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
@keyframes Toastify__bounceOutRight {
|
|
655
|
+
20% {
|
|
656
|
+
opacity: 1;
|
|
657
|
+
transform: translate3d(-20px, var(--y), 0);
|
|
658
|
+
}
|
|
659
|
+
to {
|
|
660
|
+
opacity: 0;
|
|
661
|
+
transform: translate3d(2000px, var(--y), 0);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
@keyframes Toastify__bounceInLeft {
|
|
666
|
+
from,
|
|
667
|
+
60%,
|
|
668
|
+
75%,
|
|
669
|
+
90%,
|
|
670
|
+
to {
|
|
671
|
+
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
672
|
+
}
|
|
673
|
+
0% {
|
|
674
|
+
opacity: 0;
|
|
675
|
+
transform: translate3d(-3000px, 0, 0);
|
|
676
|
+
}
|
|
677
|
+
60% {
|
|
678
|
+
opacity: 1;
|
|
679
|
+
transform: translate3d(25px, 0, 0);
|
|
680
|
+
}
|
|
681
|
+
75% {
|
|
682
|
+
transform: translate3d(-10px, 0, 0);
|
|
683
|
+
}
|
|
684
|
+
90% {
|
|
685
|
+
transform: translate3d(5px, 0, 0);
|
|
686
|
+
}
|
|
687
|
+
to {
|
|
688
|
+
transform: none;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
@keyframes Toastify__bounceOutLeft {
|
|
693
|
+
20% {
|
|
694
|
+
opacity: 1;
|
|
695
|
+
transform: translate3d(20px, var(--y), 0);
|
|
696
|
+
}
|
|
697
|
+
to {
|
|
698
|
+
opacity: 0;
|
|
699
|
+
transform: translate3d(-2000px, var(--y), 0);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
@keyframes Toastify__bounceInUp {
|
|
704
|
+
from,
|
|
705
|
+
60%,
|
|
706
|
+
75%,
|
|
707
|
+
90%,
|
|
708
|
+
to {
|
|
709
|
+
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
710
|
+
}
|
|
711
|
+
from {
|
|
712
|
+
opacity: 0;
|
|
713
|
+
transform: translate3d(0, 3000px, 0);
|
|
714
|
+
}
|
|
715
|
+
60% {
|
|
716
|
+
opacity: 1;
|
|
717
|
+
transform: translate3d(0, -20px, 0);
|
|
718
|
+
}
|
|
719
|
+
75% {
|
|
720
|
+
transform: translate3d(0, 10px, 0);
|
|
721
|
+
}
|
|
722
|
+
90% {
|
|
723
|
+
transform: translate3d(0, -5px, 0);
|
|
724
|
+
}
|
|
725
|
+
to {
|
|
726
|
+
transform: translate3d(0, 0, 0);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
@keyframes Toastify__bounceOutUp {
|
|
731
|
+
20% {
|
|
732
|
+
transform: translate3d(0, calc(var(--y) - 10px), 0);
|
|
733
|
+
}
|
|
734
|
+
40%,
|
|
735
|
+
45% {
|
|
736
|
+
opacity: 1;
|
|
737
|
+
transform: translate3d(0, calc(var(--y) + 20px), 0);
|
|
738
|
+
}
|
|
739
|
+
to {
|
|
740
|
+
opacity: 0;
|
|
741
|
+
transform: translate3d(0, -2000px, 0);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
@keyframes Toastify__bounceInDown {
|
|
746
|
+
from,
|
|
747
|
+
60%,
|
|
748
|
+
75%,
|
|
749
|
+
90%,
|
|
750
|
+
to {
|
|
751
|
+
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
752
|
+
}
|
|
753
|
+
0% {
|
|
754
|
+
opacity: 0;
|
|
755
|
+
transform: translate3d(0, -3000px, 0);
|
|
756
|
+
}
|
|
757
|
+
60% {
|
|
758
|
+
opacity: 1;
|
|
759
|
+
transform: translate3d(0, 25px, 0);
|
|
760
|
+
}
|
|
761
|
+
75% {
|
|
762
|
+
transform: translate3d(0, -10px, 0);
|
|
763
|
+
}
|
|
764
|
+
90% {
|
|
765
|
+
transform: translate3d(0, 5px, 0);
|
|
766
|
+
}
|
|
767
|
+
to {
|
|
768
|
+
transform: none;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
@keyframes Toastify__bounceOutDown {
|
|
773
|
+
20% {
|
|
774
|
+
transform: translate3d(0, calc(var(--y) - 10px), 0);
|
|
775
|
+
}
|
|
776
|
+
40%,
|
|
777
|
+
45% {
|
|
778
|
+
opacity: 1;
|
|
779
|
+
transform: translate3d(0, calc(var(--y) + 20px), 0);
|
|
780
|
+
}
|
|
781
|
+
to {
|
|
782
|
+
opacity: 0;
|
|
783
|
+
transform: translate3d(0, 2000px, 0);
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
.Toastify__bounce-enter--top-left,
|
|
788
|
+
.Toastify__bounce-enter--bottom-left {
|
|
789
|
+
animation-name: Toastify__bounceInLeft;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
.Toastify__bounce-enter--top-right,
|
|
793
|
+
.Toastify__bounce-enter--bottom-right {
|
|
794
|
+
animation-name: Toastify__bounceInRight;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.Toastify__bounce-enter--top-center {
|
|
798
|
+
animation-name: Toastify__bounceInDown;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
.Toastify__bounce-enter--bottom-center {
|
|
802
|
+
animation-name: Toastify__bounceInUp;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
.Toastify__bounce-exit--top-left,
|
|
806
|
+
.Toastify__bounce-exit--bottom-left {
|
|
807
|
+
animation-name: Toastify__bounceOutLeft;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
.Toastify__bounce-exit--top-right,
|
|
811
|
+
.Toastify__bounce-exit--bottom-right {
|
|
812
|
+
animation-name: Toastify__bounceOutRight;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
.Toastify__bounce-exit--top-center {
|
|
816
|
+
animation-name: Toastify__bounceOutUp;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
.Toastify__bounce-exit--bottom-center {
|
|
820
|
+
animation-name: Toastify__bounceOutDown;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
@keyframes Toastify__zoomIn {
|
|
824
|
+
from {
|
|
825
|
+
opacity: 0;
|
|
826
|
+
transform: scale3d(0.3, 0.3, 0.3);
|
|
827
|
+
}
|
|
828
|
+
50% {
|
|
829
|
+
opacity: 1;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
@keyframes Toastify__zoomOut {
|
|
834
|
+
from {
|
|
835
|
+
opacity: 1;
|
|
836
|
+
}
|
|
837
|
+
50% {
|
|
838
|
+
opacity: 0;
|
|
839
|
+
transform: translate3d(0, var(--y), 0) scale3d(0.3, 0.3, 0.3);
|
|
840
|
+
}
|
|
841
|
+
to {
|
|
842
|
+
opacity: 0;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
.Toastify__zoom-enter {
|
|
847
|
+
animation-name: Toastify__zoomIn;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
.Toastify__zoom-exit {
|
|
851
|
+
animation-name: Toastify__zoomOut;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
@keyframes Toastify__flipIn {
|
|
855
|
+
from {
|
|
856
|
+
transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
|
|
857
|
+
animation-timing-function: ease-in;
|
|
858
|
+
opacity: 0;
|
|
859
|
+
}
|
|
860
|
+
40% {
|
|
861
|
+
transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
|
|
862
|
+
animation-timing-function: ease-in;
|
|
863
|
+
}
|
|
864
|
+
60% {
|
|
865
|
+
transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
|
|
866
|
+
opacity: 1;
|
|
867
|
+
}
|
|
868
|
+
80% {
|
|
869
|
+
transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
|
|
870
|
+
}
|
|
871
|
+
to {
|
|
872
|
+
transform: perspective(400px);
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
@keyframes Toastify__flipOut {
|
|
877
|
+
from {
|
|
878
|
+
transform: translate3d(0, var(--y), 0) perspective(400px);
|
|
879
|
+
}
|
|
880
|
+
30% {
|
|
881
|
+
transform: translate3d(0, var(--y), 0) perspective(400px) rotate3d(1, 0, 0, -20deg);
|
|
882
|
+
opacity: 1;
|
|
883
|
+
}
|
|
884
|
+
to {
|
|
885
|
+
transform: translate3d(0, var(--y), 0) perspective(400px) rotate3d(1, 0, 0, 90deg);
|
|
886
|
+
opacity: 0;
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
.Toastify__flip-enter {
|
|
891
|
+
animation-name: Toastify__flipIn;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
.Toastify__flip-exit {
|
|
895
|
+
animation-name: Toastify__flipOut;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
@keyframes Toastify__slideInRight {
|
|
899
|
+
from {
|
|
900
|
+
transform: translate3d(110%, 0, 0);
|
|
901
|
+
visibility: visible;
|
|
902
|
+
}
|
|
903
|
+
to {
|
|
904
|
+
transform: translate3d(0, var(--y), 0);
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
@keyframes Toastify__slideInLeft {
|
|
909
|
+
from {
|
|
910
|
+
transform: translate3d(-110%, 0, 0);
|
|
911
|
+
visibility: visible;
|
|
912
|
+
}
|
|
913
|
+
to {
|
|
914
|
+
transform: translate3d(0, var(--y), 0);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
@keyframes Toastify__slideInUp {
|
|
919
|
+
from {
|
|
920
|
+
transform: translate3d(0, 110%, 0);
|
|
921
|
+
visibility: visible;
|
|
922
|
+
}
|
|
923
|
+
to {
|
|
924
|
+
transform: translate3d(0, var(--y), 0);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
@keyframes Toastify__slideInDown {
|
|
929
|
+
from {
|
|
930
|
+
transform: translate3d(0, -110%, 0);
|
|
931
|
+
visibility: visible;
|
|
932
|
+
}
|
|
933
|
+
to {
|
|
934
|
+
transform: translate3d(0, var(--y), 0);
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
@keyframes Toastify__slideOutRight {
|
|
939
|
+
from {
|
|
940
|
+
transform: translate3d(0, var(--y), 0);
|
|
941
|
+
}
|
|
942
|
+
to {
|
|
943
|
+
visibility: hidden;
|
|
944
|
+
transform: translate3d(110%, var(--y), 0);
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
@keyframes Toastify__slideOutLeft {
|
|
949
|
+
from {
|
|
950
|
+
transform: translate3d(0, var(--y), 0);
|
|
951
|
+
}
|
|
952
|
+
to {
|
|
953
|
+
visibility: hidden;
|
|
954
|
+
transform: translate3d(-110%, var(--y), 0);
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
@keyframes Toastify__slideOutDown {
|
|
959
|
+
from {
|
|
960
|
+
transform: translate3d(0, var(--y), 0);
|
|
961
|
+
}
|
|
962
|
+
to {
|
|
963
|
+
visibility: hidden;
|
|
964
|
+
transform: translate3d(0, 500px, 0);
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
@keyframes Toastify__slideOutUp {
|
|
969
|
+
from {
|
|
970
|
+
transform: translate3d(0, var(--y), 0);
|
|
971
|
+
}
|
|
972
|
+
to {
|
|
973
|
+
visibility: hidden;
|
|
974
|
+
transform: translate3d(0, -500px, 0);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
.Toastify__slide-enter--top-left,
|
|
979
|
+
.Toastify__slide-enter--bottom-left {
|
|
980
|
+
animation-name: Toastify__slideInLeft;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
.Toastify__slide-enter--top-right,
|
|
984
|
+
.Toastify__slide-enter--bottom-right {
|
|
985
|
+
animation-name: Toastify__slideInRight;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
.Toastify__slide-enter--top-center {
|
|
989
|
+
animation-name: Toastify__slideInDown;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
.Toastify__slide-enter--bottom-center {
|
|
993
|
+
animation-name: Toastify__slideInUp;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
.Toastify__slide-exit--top-left,
|
|
997
|
+
.Toastify__slide-exit--bottom-left {
|
|
998
|
+
animation-name: Toastify__slideOutLeft;
|
|
999
|
+
animation-timing-function: ease-in;
|
|
1000
|
+
animation-duration: 0.3s;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
.Toastify__slide-exit--top-right,
|
|
1004
|
+
.Toastify__slide-exit--bottom-right {
|
|
1005
|
+
animation-name: Toastify__slideOutRight;
|
|
1006
|
+
animation-timing-function: ease-in;
|
|
1007
|
+
animation-duration: 0.3s;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
.Toastify__slide-exit--top-center {
|
|
1011
|
+
animation-name: Toastify__slideOutUp;
|
|
1012
|
+
animation-timing-function: ease-in;
|
|
1013
|
+
animation-duration: 0.3s;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
.Toastify__slide-exit--bottom-center {
|
|
1017
|
+
animation-name: Toastify__slideOutDown;
|
|
1018
|
+
animation-timing-function: ease-in;
|
|
1019
|
+
animation-duration: 0.3s;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
@keyframes Toastify__spin {
|
|
1023
|
+
from {
|
|
1024
|
+
transform: rotate(0deg);
|
|
1025
|
+
}
|
|
1026
|
+
to {
|
|
1027
|
+
transform: rotate(360deg);
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
`,k0=new Map,p2=(t,e)=>{I0(()=>{if(typeof document>"u")return;let n=document,r=k0.get(n);if(r){e&&r.setAttribute("nonce",e);return}let o=n.createElement("style");o.textContent=t,e&&o.setAttribute("nonce",e),n.head.appendChild(o),k0.set(n,o)},[e])};function g2(t){return p2(h2,t.nonce),D.createElement(f2,{...t})}const m2={category:"Thư mục gốc",fileName:"Tên tệp",fullPath:"Đường dẫn đầy đủ",createAt:"Ngày tạo",creator:"Người tạo",creatorId:"ID người tạo",DataSource:"Nguồn dữ liệu",SuggestedAICategories:"Danh mục AI gợi ý",KeywordAISuggestion:"Từ khóa AI gợi ý",SummaryOfSuggestedAI:"Tóm tắt AI gợi ý",AccessLevel:"Cấp độ truy cập"},v2=t=>t==="SummaryOfSuggestedAI"||t==="KeywordAISuggestion"||t==="SuggestedAICategories",Km=t=>t==="fullPath"||t==="createAt"||t==="creator"||t==="creatorId"||t==="DataSource"||t==="AccessLevel"||t==="category"||t==="fileName",y2={STARTING:"Đang bắt đầu",IN_PROGRESS:"Đang đồng bộ",COMPLETE:"Đồng bộ thành công",FAILED:"Đồng bộ thất bại",STOPPING:"Đang dừng",STOPPED:"Đã dừng"},w2=t=>y2[t]||t;function P0({enabled:t,onChange:e}){const[n,r]=D.useState(t),o=async()=>{e(),r(i=>!i)};return d.jsx("button",{type:"button",onClick:o,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors duration-300 ${n?"bg-green-500":"bg-gray-300 dark:bg-gray-600"}`,children:d.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform duration-300 ${n?"translate-x-5":"translate-x-1"}`})})}const Gm="-",b2=t=>{const e=x2(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const c=a.split(Gm);return c[0]===""&&c.length!==1&&c.shift(),O0(c,e)||C2(a)},getConflictingClassGroupIds:(a,c)=>{const u=n[a]||[];return c&&r[a]?[...u,...r[a]]:u}}},O0=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),o=r?O0(t.slice(1),r):void 0;if(o)return o;if(e.validators.length===0)return;const i=t.join(Gm);return(a=e.validators.find(({validator:c})=>c(i)))==null?void 0:a.classGroupId},N0=/^\[(.+)\]$/,C2=t=>{if(N0.test(t)){const e=N0.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},x2=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return S2(Object.entries(t.classGroups),n).forEach(([i,a])=>{jm(a,r,i,e)}),r},jm=(t,e,n,r)=>{t.forEach(o=>{if(typeof o=="string"){const i=o===""?e:D0(e,o);i.classGroupId=n;return}if(typeof o=="function"){if(_2(o)){jm(o(r),e,n,r);return}e.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{jm(a,D0(e,i),n,r)})})},D0=(t,e)=>{let n=t;return e.split(Gm).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},_2=t=>t.isThemeGetter,S2=(t,e)=>e?t.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,c])=>[e+a,c])):i);return[n,o]}):t,T2=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const o=(i,a)=>{n.set(i,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return o(i,a),a},set(i,a){n.has(i)?n.set(i,a):o(i,a)}}},M0="!",E2=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,o=e[0],i=e.length,a=c=>{const u=[];let h=0,p=0,g;for(let w=0;w<c.length;w++){let _=c[w];if(h===0){if(_===o&&(r||c.slice(w,w+i)===e)){u.push(c.slice(p,w)),p=w+i;continue}if(_==="/"){g=w;continue}}_==="["?h++:_==="]"&&h--}const v=u.length===0?c:c.substring(p),m=v.startsWith(M0),C=m?v.substring(1):v,b=g&&g>p?g-p:void 0;return{modifiers:u,hasImportantModifier:m,baseClassName:C,maybePostfixModifierPosition:b}};return n?c=>n({className:c,parseClassName:a}):a},A2=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},I2=t=>({cache:T2(t.cacheSize),parseClassName:E2(t),...b2(t)}),k2=/\s+/,P2=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=e,i=[],a=t.trim().split(k2);let c="";for(let u=a.length-1;u>=0;u-=1){const h=a[u],{modifiers:p,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:m}=n(h);let C=!!m,b=r(C?v.substring(0,m):v);if(!b){if(!C){c=h+(c.length>0?" "+c:c);continue}if(b=r(v),!b){c=h+(c.length>0?" "+c:c);continue}C=!1}const w=A2(p).join(":"),_=g?w+M0:w,E=_+b;if(i.includes(E))continue;i.push(E);const I=o(b,C);for(let k=0;k<I.length;++k){const A=I[k];i.push(_+A)}c=h+(c.length>0?" "+c:c)}return c};function O2(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=R0(e))&&(r&&(r+=" "),r+=n);return r}const R0=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=R0(t[r]))&&(n&&(n+=" "),n+=e);return n};function N2(t,...e){let n,r,o,i=a;function a(u){const h=e.reduce((p,g)=>g(p),t());return n=I2(h),r=n.cache.get,o=n.cache.set,i=c,c(u)}function c(u){const h=r(u);if(h)return h;const p=P2(u,n);return o(u,p),p}return function(){return i(O2.apply(null,arguments))}}const nn=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},L0=/^\[(?:([a-z-]+):)?(.+)\]$/i,D2=/^\d+\/\d+$/,M2=new Set(["px","full","screen"]),R2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,L2=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,F2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,U2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_i=t=>yc(t)||M2.has(t)||D2.test(t),hs=t=>wc(t,"length",W2),yc=t=>!!t&&!Number.isNaN(Number(t)),Wm=t=>wc(t,"number",yc),Ul=t=>!!t&&Number.isInteger(Number(t)),H2=t=>t.endsWith("%")&&yc(t.slice(0,-1)),ut=t=>L0.test(t),ps=t=>R2.test(t),B2=new Set(["length","size","percentage"]),z2=t=>wc(t,B2,F0),V2=t=>wc(t,"position",F0),K2=new Set(["image","url"]),G2=t=>wc(t,K2,Y2),j2=t=>wc(t,"",q2),Hl=()=>!0,wc=(t,e,n)=>{const r=L0.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},W2=t=>L2.test(t)&&!F2.test(t),F0=()=>!1,q2=t=>$2.test(t),Y2=t=>U2.test(t),Q2=N2(()=>{const t=nn("colors"),e=nn("spacing"),n=nn("blur"),r=nn("brightness"),o=nn("borderColor"),i=nn("borderRadius"),a=nn("borderSpacing"),c=nn("borderWidth"),u=nn("contrast"),h=nn("grayscale"),p=nn("hueRotate"),g=nn("invert"),v=nn("gap"),m=nn("gradientColorStops"),C=nn("gradientColorStopPositions"),b=nn("inset"),w=nn("margin"),_=nn("opacity"),E=nn("padding"),I=nn("saturate"),k=nn("scale"),A=nn("sepia"),M=nn("skew"),B=nn("space"),W=nn("translate"),Y=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],de=()=>["auto",ut,e],ne=()=>[ut,e],ae=()=>["",_i,hs],Q=()=>["auto",yc,ut],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>["start","end","center","between","around","evenly","stretch"],ce=()=>["","0",ut],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>[yc,ut];return{cacheSize:500,separator:":",theme:{colors:[Hl],spacing:[_i,hs],blur:["none","",ps,ut],brightness:Z(),borderColor:[t],borderRadius:["none","","full",ps,ut],borderSpacing:ne(),borderWidth:ae(),contrast:Z(),grayscale:ce(),hueRotate:Z(),invert:ce(),gap:ne(),gradientColorStops:[t],gradientColorStopPositions:[H2,hs],inset:de(),margin:de(),opacity:Z(),padding:ne(),saturate:Z(),scale:Z(),sepia:ce(),skew:Z(),space:ne(),translate:ne()},classGroups:{aspect:[{aspect:["auto","square","video",ut]}],container:["container"],columns:[{columns:[ps]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...re(),ut]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:Y()}],"overscroll-x":[{"overscroll-x":Y()}],"overscroll-y":[{"overscroll-y":Y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ul,ut]}],basis:[{basis:de()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ut]}],grow:[{grow:ce()}],shrink:[{shrink:ce()}],order:[{order:["first","last","none",Ul,ut]}],"grid-cols":[{"grid-cols":[Hl]}],"col-start-end":[{col:["auto",{span:["full",Ul,ut]},ut]}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":[Hl]}],"row-start-end":[{row:["auto",{span:[Ul,ut]},ut]}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ut]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ut]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...ie()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ie(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ie(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[B]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[B]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ut,e]}],"min-w":[{"min-w":[ut,e,"min","max","fit"]}],"max-w":[{"max-w":[ut,e,"none","full","min","max","fit","prose",{screen:[ps]},ps]}],h:[{h:[ut,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ut,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ut,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ut,e,"auto","min","max","fit"]}],"font-size":[{text:["base",ps,hs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Wm]}],"font-family":[{font:[Hl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ut]}],"line-clamp":[{"line-clamp":["none",yc,Wm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",_i,ut]}],"list-image":[{"list-image":["none",ut]}],"list-style-type":[{list:["none","disc","decimal",ut]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",_i,hs]}],"underline-offset":[{"underline-offset":["auto",_i,ut]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ne()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ut]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ut]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),V2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",z2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},G2]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:j()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...j()]}],"outline-offset":[{"outline-offset":[_i,ut]}],"outline-w":[{outline:[_i,hs]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[_i,hs]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",ps,j2]}],"shadow-color":[{shadow:[Hl]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...se(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":se()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",ps,ut]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[g]}],saturate:[{saturate:[I]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[I]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ut]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",ut]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",ut]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Ul,ut]}],"translate-x":[{"translate-x":[W]}],"translate-y":[{"translate-y":[W]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ut]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ut]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ne()}],"scroll-mx":[{"scroll-mx":ne()}],"scroll-my":[{"scroll-my":ne()}],"scroll-ms":[{"scroll-ms":ne()}],"scroll-me":[{"scroll-me":ne()}],"scroll-mt":[{"scroll-mt":ne()}],"scroll-mr":[{"scroll-mr":ne()}],"scroll-mb":[{"scroll-mb":ne()}],"scroll-ml":[{"scroll-ml":ne()}],"scroll-p":[{"scroll-p":ne()}],"scroll-px":[{"scroll-px":ne()}],"scroll-py":[{"scroll-py":ne()}],"scroll-ps":[{"scroll-ps":ne()}],"scroll-pe":[{"scroll-pe":ne()}],"scroll-pt":[{"scroll-pt":ne()}],"scroll-pr":[{"scroll-pr":ne()}],"scroll-pb":[{"scroll-pb":ne()}],"scroll-pl":[{"scroll-pl":ne()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ut]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[_i,hs,Wm]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Xe(...t){return Q2(Ci(t))}function Xs(){let t=localStorage.getItem("dataLogin"),e;try{t&&(t=JSON.parse(t),e=t.user)}catch(n){console.error("Error parsing dataLogin from localStorage:",n),t=null}return e}const Bl=S.forwardRef(({className:t,...e},n)=>d.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:Xe("s3-explr-ui-breadcrumb",t),...e}));Bl.displayName="Breadcrumb";const zl=S.forwardRef(({className:t,...e},n)=>d.jsx("ol",{ref:n,className:Xe("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5","s3-explr-ui-breadcrumb-list",t),...e}));zl.displayName="BreadcrumbList";const bc=S.forwardRef(({className:t,...e},n)=>d.jsx("li",{ref:n,className:Xe("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",t),...e}));bc.displayName="BreadcrumbItem";const Cc=S.forwardRef(({asChild:t,className:e,...n},r)=>{const o=t?d_:"a";return d.jsx(o,{ref:r,className:Xe("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",e),...n})});Cc.displayName="BreadcrumbLink";const J2=S.forwardRef(({className:t,...e},n)=>d.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Xe("font-normal text-foreground","s3-explr-ui-breadcrumb-page",t),...e}));J2.displayName="BreadcrumbPage";const Vl=({children:t,className:e,...n})=>d.jsx("li",{role:"presentation","aria-hidden":"true",className:Xe("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",e),...n,children:t??d.jsx(w0,{})});Vl.displayName="BreadcrumbSeparator";const $0=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,U0=Ci,qm=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return U0(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=e,a=Object.keys(o).map(h=>{const p=n==null?void 0:n[h],g=i==null?void 0:i[h];if(p===null)return null;const v=$0(p)||$0(g);return o[h][v]}),c=n&&Object.entries(n).reduce((h,p)=>{let[g,v]=p;return v===void 0||(h[g]=v),h},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:g,className:v,...m}=p;return Object.entries(m).every(C=>{let[b,w]=C;return Array.isArray(w)?w.includes({...i,...c}[b]):{...i,...c}[b]===w})?[...h,g,v]:h},[]);return U0(t,a,u,n==null?void 0:n.class,n==null?void 0:n.className)},H0=qm("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 s3-explr-ui-button",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90 s3-explr-ui-button-default",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 s3-explr-ui-button-destructive",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-outline",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 s3-explr-ui-button-secondary",ghost:"hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-ghost",link:"text-primary underline-offset-4 hover:underline s3-explr-ui-button-link"},size:{default:"h-9 px-4 py-2 s3-explr-ui-button-size-default",sm:"h-8 rounded-md px-3 text-xs s3-explr-ui-button-size-sm",lg:"h-10 rounded-md px-8 s3-explr-ui-button-size-lg",icon:"h-9 w-9 s3-explr-ui-button-size-icon"}},defaultVariants:{variant:"default",size:"default"}}),je=S.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...o},i)=>{const a=r?d_:"button";return d.jsx(a,{className:Xe(H0({variant:e,size:n,className:t})),ref:i,...o})});je.displayName="Button";var X2=Object.defineProperty,Z2=(t,e)=>X2(t,"name",{value:e,configurable:!0});function Ym(t){const[e,n]=S.useState(void 0);return Tn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,c;if("borderBoxSize"in i){const u=i.borderBoxSize,h=Array.isArray(u)?u[0]:u;a=h.inlineSize,c=h.blockSize}else a=t.offsetWidth,c=t.offsetHeight;n({width:a,height:c})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}Z2(Ym,"useSize");var eL=Object.defineProperty,Si=(t,e)=>eL(t,"name",{value:e,configurable:!0}),Qm="Checkbox",[tL,uW]=Co(Qm),[nL,Jm]=tL(Qm);function B0(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:o,disabled:i,form:a,name:c,onCheckedChange:u,required:h,value:p="on",internal_do_not_use_render:g}=t,[v,m]=hi({prop:n,defaultProp:o??!1,onChange:u,caller:Qm}),[C,b]=S.useState(null),[w,_]=S.useState(null),E=S.useRef(!1),[I,k]=S.useReducer(B=>B+1,0),A=C?!!a||!!C.closest("form"):!0,M={checked:v,disabled:i,setChecked:m,control:C,setControl:b,name:c,form:a,value:p,hasConsumerStoppedPropagationRef:E,userInteractionCount:I,onUserInteraction:k,required:h,defaultChecked:Ti(o)?!1:o,isFormControl:A,bubbleInput:w,setBubbleInput:_};return d.jsx(nL,{scope:e,...M,children:V0(g)?g(M):r})}Si(B0,"CheckboxProvider");var rL="CheckboxTrigger",oL=S.forwardRef(Si(function({__scopeCheckbox:e,onKeyDown:n,onClick:r,...o},i){const{control:a,value:c,disabled:u,checked:h,required:p,setControl:g,setChecked:v,hasConsumerStoppedPropagationRef:m,onUserInteraction:C,isFormControl:b,bubbleInput:w}=Jm(rL,e),_=Rt(i,g),E=S.useRef(h);return S.useEffect(()=>{const I=a==null?void 0:a.form;if(I){const k=Si(()=>v(E.current),"reset");return I.addEventListener("reset",k),()=>I.removeEventListener("reset",k)}},[a,v]),d.jsx(pt.button,{type:"button",role:"checkbox","aria-checked":Ti(h)?"mixed":h,"aria-required":p,"data-state":Xm(h),"data-disabled":u?"":void 0,disabled:u,value:c,...o,ref:_,onKeyDown:nt(n,I=>{I.key==="Enter"&&I.preventDefault()}),onClick:nt(r,I=>{C(),v(k=>Ti(k)?!0:!k),w&&b&&(m.current=I.isPropagationStopped(),m.current||I.stopPropagation())})})},"CheckboxTrigger")),z0=S.forwardRef(Si(function(e,n){const{__scopeCheckbox:r,name:o,checked:i,defaultChecked:a,required:c,disabled:u,value:h,onCheckedChange:p,form:g,...v}=e;return d.jsx(B0,{__scopeCheckbox:r,checked:i,defaultChecked:a,disabled:u,required:c,onCheckedChange:p,name:o,form:g,value:h,internal_do_not_use_render:({isFormControl:m})=>d.jsxs(d.Fragment,{children:[d.jsx(oL,{...v,ref:n,__scopeCheckbox:r}),m&&d.jsx(cL,{__scopeCheckbox:r})]})})},"Checkbox")),iL="CheckboxIndicator",sL=S.forwardRef(Si(function(e,n){const{__scopeCheckbox:r,forceMount:o,...i}=e,a=Jm(iL,r);return d.jsx(vi,{present:o||Ti(a.checked)||a.checked===!0,children:d.jsx(pt.span,{"data-state":Xm(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:n,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),aL="CheckboxBubbleInput",cL=S.forwardRef(Si(function({__scopeCheckbox:e,onClick:n,...r},o){const{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:c,checked:u,defaultChecked:h,required:p,disabled:g,name:v,value:m,form:C,bubbleInput:b,setBubbleInput:w}=Jm(aL,e),_=Rt(o,w),E=Ym(i),I=S.useRef(!1),k=S.useRef(u),A=S.useRef(c);S.useEffect(()=>{const B=b;if(!B)return;const W=window.HTMLInputElement.prototype,z=Object.getOwnPropertyDescriptor(W,"checked").set,de=c!==A.current;A.current=c;const ne=k.current!==u;k.current=u;const ae=!(de&&a.current);if(ne&&z){I.current=!de;const Q=new Event("click",{bubbles:ae});B.indeterminate=Ti(u),z.call(B,Ti(u)?!1:u),B.dispatchEvent(Q),I.current=!1}},[b,u,a,c]);const M=S.useRef(Ti(u)?!1:u);return d.jsx(pt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:h??M.current,required:p,disabled:g,name:v,value:m,form:C,...r,tabIndex:-1,ref:_,onClick:nt(n,B=>{I.current&&B.stopPropagation()}),style:{...r.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function V0(t){return typeof t=="function"}Si(V0,"isFunction");function Ti(t){return t==="indeterminate"}Si(Ti,"isIndeterminate");function Xm(t){return Ti(t)?"indeterminate":t?"checked":"unchecked"}Si(Xm,"getState");const Zs=S.forwardRef(({className:t,checked:e,...n},r)=>d.jsx(z0,{ref:r,checked:e,className:Xe("s3-explr-ui-checkbox peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",t),...n,children:d.jsx(sL,{className:Xe("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:e==="indeterminate"?d.jsx(PR,{className:"s3-explr-ui-checkbox-minus h-4 w-4"}):d.jsx(y0,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));Zs.displayName=z0.displayName;const yr=ls,Kl=_M,lL=TM,K0=S.forwardRef(({className:t,...e},n)=>d.jsx(yi,{ref:n,className:Xe("s3-explr-ui-dialog-overlay fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));K0.displayName=yi.displayName;const Zn=S.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(lL,{children:[d.jsx(K0,{}),d.jsxs(wi,{ref:r,className:Xe("s3-explr-ui-dialog-content fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...n,children:[e,d.jsxs(vc,{className:Xe("s3-explr-ui-dialog-close absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"),children:[d.jsx(Um,{className:"s3-explr-ui-dialog-close-icon h-4 w-4"}),d.jsx("span",{className:"s3-explr-ui-dialog-close-text sr-only",children:"Close"})]})]})]}));Zn.displayName=wi.displayName;const er=({className:t,...e})=>d.jsx("div",{className:Xe("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",t),...e});er.displayName="DialogHeader";const io=({className:t,...e})=>d.jsx("div",{className:Xe("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});io.displayName="DialogFooter";const tr=S.forwardRef(({className:t,...e},n)=>d.jsx(e0,{ref:n,className:Xe("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",t),...e}));tr.displayName=e0.displayName;const Ei=S.forwardRef(({className:t,...e},n)=>d.jsx(t0,{ref:n,className:Xe("s3-explr-ui-dialog-description text-sm text-muted-foreground",t),...e}));Ei.displayName=t0.displayName;const nr=S.forwardRef(({className:t,type:e,...n},r)=>d.jsx("input",{type:e,className:Xe("s3-explr-ui-input","flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));nr.displayName="Input";var dL=Object.defineProperty,uL=(t,e)=>dL(t,"name",{value:e,configurable:!0}),fL=S.forwardRef(uL(function(e,n){return d.jsx(pt.label,{...e,ref:n,onMouseDown:r=>{var i;r.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label")),G0=fL;const hL=qm("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 s3-explr-ui-label",{variants:{variant:{default:"s3-explr-ui-label-default",required:"s3-explr-ui-label-required",disabled:"s3-explr-ui-label-disabled"},size:{default:"s3-explr-ui-label-size-default",sm:"s3-explr-ui-label-size-sm",lg:"s3-explr-ui-label-size-lg"}},defaultVariants:{variant:"default",size:"default"}}),Or=S.forwardRef(({className:t,variant:e,size:n,...r},o)=>d.jsx(G0,{ref:o,className:Xe(hL({variant:e,size:n}),t),...r}));Or.displayName=G0.displayName;const Gl=({className:t,...e})=>d.jsx("nav",{role:"navigation","aria-label":"pagination",className:Xe("mx-auto flex w-full justify-center",t),...e});Gl.displayName="Pagination";const jl=S.forwardRef(({className:t,...e},n)=>d.jsx("ul",{ref:n,className:Xe("flex flex-row items-center gap-1",t),...e}));jl.displayName="PaginationContent";const Nr=S.forwardRef(({className:t,...e},n)=>d.jsx("li",{ref:n,className:Xe("",t),...e}));Nr.displayName="PaginationItem";const ea=({className:t,isActive:e,size:n="icon",...r})=>d.jsx("a",{"aria-current":e?"page":void 0,className:Xe(H0({variant:e?"outline":"ghost",size:n}),t),...r});ea.displayName="PaginationLink";const Wl=({className:t,...e})=>d.jsxs(ea,{"aria-label":"Go to previous page",size:"default",className:Xe("gap-1 pl-2.5",t),...e,children:[d.jsx(xR,{className:"h-4 w-4"}),d.jsx("span",{children:"Previous"})]});Wl.displayName="PaginationPrevious";const ql=({className:t,...e})=>d.jsxs(ea,{"aria-label":"Go to next page",size:"default",className:Xe("gap-1 pr-2.5",t),...e,children:[d.jsx("span",{children:"Next"}),d.jsx(w0,{className:"h-4 w-4"})]});ql.displayName="PaginationNext";const Yl=({className:t,...e})=>d.jsxs("span",{"aria-hidden":!0,className:Xe("flex h-9 w-9 items-center justify-center",t),...e,children:[d.jsx(ER,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"More pages"})]});Yl.displayName="PaginationEllipsis";const Tf=S.forwardRef(({className:t,...e},n)=>d.jsx("div",{className:Xe("relative w-full overflow-auto","s3-explr-ui-table-container"),children:d.jsx("table",{ref:n,className:Xe("w-full caption-bottom text-sm","s3-explr-ui-table",t),...e})}));Tf.displayName="Table";const Ef=S.forwardRef(({className:t,...e},n)=>d.jsx("thead",{ref:n,className:Xe("[&_tr]:border-b","s3-explr-ui-table-header",t),...e}));Ef.displayName="TableHeader";const Af=S.forwardRef(({className:t,...e},n)=>d.jsx("tbody",{ref:n,className:Xe("[&_tr:last-child]:border-0","s3-explr-ui-table-body",t),...e}));Af.displayName="TableBody";const pL=S.forwardRef(({className:t,...e},n)=>d.jsx("tfoot",{ref:n,className:Xe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",t),...e}));pL.displayName="TableFooter";const To=S.forwardRef(({className:t,...e},n)=>d.jsx("tr",{ref:n,className:Xe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",t),...e}));To.displayName="TableRow";const Wo=S.forwardRef(({className:t,...e},n)=>d.jsx("th",{ref:n,className:Xe("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-head",t),...e}));Wo.displayName="TableHead";const Dr=S.forwardRef(({className:t,...e},n)=>d.jsx("td",{ref:n,className:Xe("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",t),...e}));Dr.displayName="TableCell";const gL=S.forwardRef(({className:t,...e},n)=>d.jsx("caption",{ref:n,className:Xe("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",t),...e}));gL.displayName="TableCaption";var mL=Object.defineProperty,Mn=(t,e)=>mL(t,"name",{value:e,configurable:!0});function If(t){const e=t+"CollectionProvider",[n,r]=Co(e),[o,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=Mn(b=>{const{scope:w,children:_}=b,E=S.useRef(null),I=S.useRef(new Map).current;return d.jsx(o,{scope:w,itemMap:I,collectionRef:E,children:_})},"CollectionProvider");a.displayName=e;const c=t+"CollectionSlot",u=pi(c),h=S.forwardRef((b,w)=>{const{scope:_,children:E}=b,I=i(c,_),k=Rt(w,I.collectionRef);return d.jsx(u,{ref:k,children:E})});h.displayName=c;const p=t+"CollectionItemSlot",g="data-radix-collection-item",v=pi(p),m=S.forwardRef((b,w)=>{const{scope:_,children:E,...I}=b,k=S.useRef(null),A=Rt(w,k),M=i(p,_);return S.useEffect(()=>(M.itemMap.set(k,{ref:k,...I}),()=>void M.itemMap.delete(k))),d.jsx(v,{[g]:"",ref:A,children:E})});m.displayName=p;function C(b){const w=i(t+"CollectionConsumer",b);return S.useCallback(()=>{const E=w.collectionRef.current;if(!E)return[];const I=Array.from(E.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((M,B)=>I.indexOf(M.ref.current)-I.indexOf(B.ref.current))},[w.collectionRef,w.itemMap])}return Mn(C,"useCollection"),[{Provider:a,Slot:h,ItemSlot:m},C,r]}Mn(If,"createCollection");var j0=new WeakMap,Zm=(Qr=class extends Map{constructor(n){super(n);Uk(this,En);tb(this,En,[...super.keys()]),j0.set(this,!0)}set(n,r){return j0.get(this)&&(this.has(n)?lr(this,En)[lr(this,En).indexOf(n)]=n:lr(this,En).push(n)),super.set(n,r),this}insert(n,r,o){const i=this.has(r),a=lr(this,En).length,c=ev(n);let u=c>=0?c:a+c;const h=u<0||u>=a?-1:u;if(h===this.size||i&&h===this.size-1||h===-1)return this.set(r,o),this;const p=this.size+(i?0:1);c<0&&u++;const g=[...lr(this,En)];let v,m=!1;for(let C=u;C<p;C++)if(u===C){let b=g[C];g[C]===r&&(b=g[C+1]),i&&this.delete(r),v=this.get(b),this.set(r,o)}else{!m&&g[C-1]===r&&(m=!0);const b=g[m?C:C-1],w=v;v=this.get(b),this.delete(b),this.set(b,w)}return this}with(n,r,o){const i=new Qr(this);return i.insert(n,r,o),i}before(n){const r=lr(this,En).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const i=lr(this,En).indexOf(n);return i===-1?this:this.insert(i,r,o)}after(n){let r=lr(this,En).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,o){const i=lr(this,En).indexOf(n);return i===-1?this:this.insert(i+1,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return tb(this,En,[]),super.clear()}delete(n){const r=super.delete(n);return r&&lr(this,En).splice(lr(this,En).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=kf(lr(this,En),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=kf(lr(this,En),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return lr(this,En).indexOf(n)}keyAt(n){return kf(lr(this,En),n)}from(n,r){const o=this.indexOf(n);if(o===-1)return;let i=o+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const o=this.indexOf(n);if(o===-1)return;let i=o+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let o=0;for(const i of this){if(Reflect.apply(n,r,[i,o,this]))return i;o++}}findIndex(n,r){let o=0;for(const i of this){if(Reflect.apply(n,r,[i,o,this]))return o;o++}return-1}filter(n,r){const o=[];let i=0;for(const a of this)Reflect.apply(n,r,[a,i,this])&&o.push(a),i++;return new Qr(o)}map(n,r){const o=[];let i=0;for(const a of this)o.push([a[0],Reflect.apply(n,r,[a,i,this])]),i++;return new Qr(o)}reduce(...n){const[r,o]=n;let i=0,a=o??this.at(0);for(const c of this)i===0&&n.length===1?a=c:a=Reflect.apply(r,this,[a,c,i,this]),i++;return a}reduceRight(...n){const[r,o]=n;let i=o??this.at(-1);for(let a=this.size-1;a>=0;a--){const c=this.at(a);a===this.size-1&&n.length===1?i=c:i=Reflect.apply(r,this,[i,c,a,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new Qr(r)}toReversed(){const n=new Qr;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),i=this.get(o);n.set(o,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new Qr(r)}slice(n,r){const o=new Qr;let i=this.size-1;if(n===void 0)return o;n<0&&(n=n+this.size),r!==void 0&&r>0&&(i=r-1);for(let a=n;a<=i;a++){const c=this.keyAt(a),u=this.get(c);o.set(c,u)}return o}every(n,r){let o=0;for(const i of this){if(!Reflect.apply(n,r,[i,o,this]))return!1;o++}return!0}some(n,r){let o=0;for(const i of this){if(Reflect.apply(n,r,[i,o,this]))return!0;o++}return!1}},En=new WeakMap,Mn(Qr,"OrderedDict"),Qr);function kf(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=W0(t,e);return n===-1?void 0:t[n]}Mn(kf,"at");function W0(t,e){const n=t.length,r=ev(e),o=r>=0?r:n+r;return o<0||o>=n?-1:o}Mn(W0,"toSafeIndex");function ev(t){return t!==t||t===0?0:Math.trunc(t)}Mn(ev,"toSafeInteger");function vL(t){const e=t+"CollectionProvider",[n,r]=Co(e),[o,i]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Zm,setItemMap:Mn(()=>{},"setItemMap")}),a=Mn(({state:I,...k})=>I?d.jsx(u,{...k,state:I}):d.jsx(c,{...k}),"CollectionProvider");a.displayName=e;const c=Mn(I=>{const k=w();return d.jsx(u,{...I,state:k})},"CollectionInit");c.displayName=e+"Init";const u=Mn(I=>{const{scope:k,children:A,state:M}=I,B=S.useRef(null),[W,Y]=S.useState(null),z=Rt(B,Y),[de,ne]=M;return S.useEffect(()=>{if(!W)return;const ae=Q0(()=>{});return ae.observe(W,{childList:!0,subtree:!0}),()=>{ae.disconnect()}},[W]),d.jsx(o,{scope:k,itemMap:de,setItemMap:ne,collectionRef:z,collectionRefObject:B,collectionElement:W,children:A})},"CollectionProviderImpl");u.displayName=e+"Impl";const h=t+"CollectionSlot",p=pi(h),g=S.forwardRef((I,k)=>{const{scope:A,children:M}=I,B=i(h,A),W=Rt(k,B.collectionRef);return d.jsx(p,{ref:W,children:M})});g.displayName=h;const v=t+"CollectionItemSlot",m="data-radix-collection-item",C=pi(v),b=S.forwardRef((I,k)=>{const{scope:A,children:M,...B}=I,W=S.useRef(null),[Y,z]=S.useState(null),de=Rt(k,W,z),ne=i(v,A),{setItemMap:ae}=ne,Q=S.useRef(B);q0(Q.current,B)||(Q.current=B);const re=Q.current;return S.useEffect(()=>{const j=re;return ae(se=>Y?se.has(Y)?se.set(Y,{...j,element:Y}).toSorted(tv):(se.set(Y,{...j,element:Y}),se.toSorted(tv)):se),()=>{ae(se=>!Y||!se.has(Y)?se:(se.delete(Y),new Zm(se)))}},[Y,re,ae]),d.jsx(C,{[m]:"",ref:de,children:M})});b.displayName=v;function w(){return S.useState(new Zm)}Mn(w,"useInitCollection");function _(I){const{itemMap:k}=i(t+"CollectionConsumer",I);return k}return Mn(_,"useCollection"),[{Provider:a,Slot:g,ItemSlot:b},{createCollectionScope:r,useCollection:_,useInitCollection:w}]}Mn(vL,"createCollection");function q0(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||t[o]!==e[o])return!1;return!0}Mn(q0,"shallowEqual");function Y0(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Mn(Y0,"isElementPreceding");function tv(t,e){return!t[1].element||!e[1].element?0:Y0(t[1].element,e[1].element)?-1:1}Mn(tv,"sortByDocumentPosition");function Q0(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}Mn(Q0,"getChildListObserver");var yL=Object.defineProperty,wL=(t,e)=>yL(t,"name",{value:e,configurable:!0}),bL=S.createContext(void 0);function Pf(t){const e=S.useContext(bL);return t||e||"ltr"}wL(Pf,"useDirection");var CL=Object.defineProperty,nv=(t,e)=>CL(t,"name",{value:e,configurable:!0}),rv=!1;function J0(){const[t,e]=S.useState(rv);return S.useEffect(()=>{rv||(rv=!0,e(!0))},[]),t}nv(J0,"useIsHydrated");var X0=S[" useSyncExternalStore ".trim().toString()];function Z0(){return()=>{}}nv(Z0,"subscribe");function eS(){return X0(Z0,()=>!0,()=>!1)}nv(eS,"useIsHydratedModern");var xL=typeof X0=="function"?eS:J0,_L=Object.defineProperty,ta=(t,e)=>_L(t,"name",{value:e,configurable:!0}),ov="rovingFocusGroup.onEntryFocus",SL={bubbles:!1,cancelable:!0},Of="RovingFocusGroup",[iv,tS,TL]=If(Of),[EL,nS]=Co(Of,[TL]),[AL,IL]=EL(Of),kL=S.forwardRef(ta(function(e,n){return d.jsx(iv.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(iv.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(PL,{...e,ref:n})})})},"RovingFocusGroup")),PL=S.forwardRef(ta(function(e,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:i=!1,dir:a,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:g=!1,...v}=e,m=S.useRef(null),C=Rt(n,m),b=Pf(a),[w,_]=hi({prop:c,defaultProp:u??null,onChange:h,caller:Of}),[E,I]=S.useState(!1),k=gr(p),A=tS(r),M=S.useRef(!1),[B,W]=S.useState(0);return S.useEffect(()=>{const Y=m.current;if(Y)return Y.addEventListener(ov,k),()=>Y.removeEventListener(ov,k)},[k]),d.jsx(AL,{scope:r,orientation:o,dir:b,loop:i,currentTabStopId:w,onItemFocus:S.useCallback(Y=>_(Y),[_]),onItemShiftTab:S.useCallback(()=>I(!0),[]),onFocusableItemAdd:S.useCallback(()=>W(Y=>Y+1),[]),onFocusableItemRemove:S.useCallback(()=>W(Y=>Y-1),[]),children:d.jsx(pt.div,{tabIndex:E||B===0?-1:0,"data-orientation":o,...v,ref:C,style:{outline:"none",...e.style},onMouseDown:nt(e.onMouseDown,()=>{M.current=!0}),onFocus:nt(e.onFocus,Y=>{const z=!M.current;if(Y.target===Y.currentTarget&&z&&!E){const de=new CustomEvent(ov,SL);if(Y.currentTarget.dispatchEvent(de),!de.defaultPrevented){const ne=A().filter(se=>se.focusable),ae=ne.find(se=>se.active),Q=ne.find(se=>se.id===w),j=[ae,Q,...ne].filter(Boolean).map(se=>se.ref.current);sv(j,g)}}M.current=!1}),onBlur:nt(e.onBlur,()=>I(!1))})})},"RovingFocusGroupImpl")),OL="RovingFocusGroupItem",NL=S.forwardRef(ta(function(e,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:i=!1,tabStopId:a,children:c,...u}=e,h=fi(),p=a||h,g=IL(OL,r),v=g.currentTabStopId===p,m=tS(r),{onFocusableItemAdd:C,onFocusableItemRemove:b,currentTabStopId:w}=g,_=xL();return Tn(()=>{if(!(!_||!o))return C(),()=>b()},[_,o,C,b]),S.useEffect(()=>{if(!(_||!o))return C(),()=>b()},[_,o,C,b]),d.jsx(iv.ItemSlot,{scope:r,id:p,focusable:o,active:i,children:d.jsx(pt.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...u,ref:n,onMouseDown:nt(e.onMouseDown,E=>{o?g.onItemFocus(p):E.preventDefault()}),onFocus:nt(e.onFocus,()=>g.onItemFocus(p)),onKeyDown:nt(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){g.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const I=oS(E,g.orientation,g.dir);if(I!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let A=m().filter(M=>M.focusable).map(M=>M.ref.current);if(I==="last")A.reverse();else if(I==="prev"||I==="next"){I==="prev"&&A.reverse();const M=A.indexOf(E.currentTarget);A=g.loop?iS(A,M+1):A.slice(M+1)}setTimeout(()=>sv(A))}}),children:typeof c=="function"?c({isCurrentTabStop:v,hasTabStop:w!=null}):c})})},"RovingFocusGroupItem")),DL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function rS(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}ta(rS,"getDirectionAwareKey");function oS(t,e,n){const r=rS(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return DL[r]}ta(oS,"getFocusIntent");function sv(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}ta(sv,"focusFirst");function iS(t,e){return t.map((n,r)=>t[(e+r)%t.length])}ta(iS,"wrapArray");var ML=kL,RL=NL,LL=Object.defineProperty,xc=(t,e)=>LL(t,"name",{value:e,configurable:!0}),av="Tabs",[FL,fW]=Co(av,[nS]),sS=nS(),[$L,cv]=FL(av),UL=S.forwardRef(xc(function(e,n){const{__scopeTabs:r,value:o,onValueChange:i,defaultValue:a,orientation:c="horizontal",dir:u,activationMode:h="automatic",...p}=e,g=Pf(u),[v,m]=hi({prop:o,onChange:i,defaultProp:a??"",caller:av});return d.jsx($L,{scope:r,baseId:fi(),value:v,onValueChange:m,orientation:c,dir:g,activationMode:h,children:d.jsx(pt.div,{dir:g,"data-orientation":c,...p,ref:n})})},"Tabs")),HL="TabsList",BL=S.forwardRef(xc(function(e,n){const{__scopeTabs:r,loop:o=!0,...i}=e,a=cv(HL,r),c=sS(r);return d.jsx(ML,{asChild:!0,...c,orientation:a.orientation,dir:a.dir,loop:o,children:d.jsx(pt.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:n})})},"TabsList")),zL="TabsTrigger",VL=S.forwardRef(xc(function(e,n){const{__scopeTabs:r,value:o,disabled:i=!1,...a}=e,c=cv(zL,r),u=sS(r),h=lv(c.baseId,o),p=dv(c.baseId,o),g=o===c.value;return d.jsx(RL,{asChild:!0,...u,focusable:!i,active:g,children:d.jsx(pt.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":p,"data-state":g?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:h,...a,ref:n,onMouseDown:nt(e.onMouseDown,v=>{!i&&v.button===0&&v.ctrlKey===!1?c.onValueChange(o):v.preventDefault()}),onKeyDown:nt(e.onKeyDown,v=>{i||v.target!==v.currentTarget||[" ","Enter"].includes(v.key)&&c.onValueChange(o)}),onFocus:nt(e.onFocus,()=>{const v=c.activationMode!=="manual";!g&&!i&&v&&c.onValueChange(o)})})})},"TabsTrigger")),KL="TabsContent",GL=S.forwardRef(xc(function(e,n){const{__scopeTabs:r,value:o,forceMount:i,children:a,...c}=e,u=cv(KL,r),h=lv(u.baseId,o),p=dv(u.baseId,o),g=o===u.value,v=S.useRef(g);return S.useEffect(()=>{const m=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(m)},[]),d.jsx(vi,{present:i||g,children:({present:m})=>d.jsx(pt.div,{"data-state":g?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":h,hidden:!m,id:p,tabIndex:0,...c,ref:n,style:{...e.style,animationDuration:v.current?"0s":void 0},children:m&&a})})},"TabsContent"));function lv(t,e){return`${t}-trigger-${e}`}xc(lv,"makeTriggerId");function dv(t,e){return`${t}-content-${e}`}xc(dv,"makeContentId");var jL=UL,aS=BL,cS=VL,lS=GL;const uv=jL,Nf=S.forwardRef(({className:t,...e},n)=>d.jsx(aS,{ref:n,className:Xe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...e}));Nf.displayName=aS.displayName;const na=S.forwardRef(({className:t,...e},n)=>d.jsx(cS,{ref:n,className:Xe("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t),...e}));na.displayName=cS.displayName;const gs=S.forwardRef(({className:t,...e},n)=>d.jsx(lS,{ref:n,className:Xe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));gs.displayName=lS.displayName;const Ql=S.forwardRef(({className:t,...e},n)=>d.jsx("textarea",{className:Xe("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:n,...e}));Ql.displayName="Textarea";var WL=Object.defineProperty,qL=(t,e)=>WL(t,"name",{value:e,configurable:!0}),dS=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),fv=S.forwardRef(qL(function(e,n){return d.jsx(pt.span,{...e,ref:n,style:{...dS,...e.style}})},"VisuallyHidden")),YL=fv,QL=Object.defineProperty,Qt=(t,e)=>QL(t,"name",{value:e,configurable:!0}),uS="ToastProvider",[hv,fS,JL]=If("Toast"),[hS,hW]=Co("Toast",[JL]),[XL,Df]=hS(uS),ZL=Qt(t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,announcerContainer:a,children:c}=t,[u,h]=S.useState(null),[p,g]=S.useState(0),v=S.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${uS}\`. Expected non-empty \`string\`.`),d.jsx(hv.Provider,{scope:e,children:d.jsx(XL,{scope:e,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:p,viewport:u,onViewportChange:h,onToastAdd:S.useCallback(()=>g(m=>m+1),[]),onToastRemove:S.useCallback(()=>g(m=>m-1),[]),isClosePausedRef:v,announcerContainer:a,children:c})})},"ToastProvider"),eF="ToastViewport",tF=["F8"],pv="toast.viewportPause",gv="toast.viewportResume",nF=S.forwardRef(Qt(function(e,n){const{__scopeToast:r,hotkey:o=tF,label:i="Notifications ({hotkey})",...a}=e,c=Df(eF,r),u=fS(r),h=S.useRef(null),p=S.useRef(null),g=S.useRef(null),v=S.useRef(null),m=Rt(n,v,c.onViewportChange),C=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=c.toastCount>0;S.useEffect(()=>{const _=Qt(E=>{var k;o.length!==0&&o.every(A=>E[A]||E.code===A)&&((k=v.current)==null||k.focus())},"handleKeyDown");return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[o]),S.useEffect(()=>{const _=h.current,E=v.current;if(b&&_&&E){const I=Qt(()=>{if(!c.isClosePausedRef.current){const B=new CustomEvent(pv);E.dispatchEvent(B),c.isClosePausedRef.current=!0}},"handlePause"),k=Qt(()=>{if(c.isClosePausedRef.current){const B=new CustomEvent(gv);E.dispatchEvent(B),c.isClosePausedRef.current=!1}},"handleResume"),A=Qt(B=>{!_.contains(B.relatedTarget)&&k()},"handleFocusOutResume"),M=Qt(()=>{_.contains(document.activeElement)||k()},"handlePointerLeaveResume");return _.addEventListener("focusin",I),_.addEventListener("focusout",A),_.addEventListener("pointermove",I),_.addEventListener("pointerleave",M),window.addEventListener("blur",I),window.addEventListener("focus",k),()=>{_.removeEventListener("focusin",I),_.removeEventListener("focusout",A),_.removeEventListener("pointermove",I),_.removeEventListener("pointerleave",M),window.removeEventListener("blur",I),window.removeEventListener("focus",k)}}},[b,c.isClosePausedRef]);const w=S.useCallback(({tabbingDirection:_})=>{const I=u().map(k=>{const A=k.ref.current,M=[A,...bS(A)];return _==="forwards"?M:M.reverse()});return(_==="forwards"?I.reverse():I).flat()},[u]);return S.useEffect(()=>{const _=v.current;if(_){const E=Qt(I=>{var M,B,W;const k=I.altKey||I.ctrlKey||I.metaKey;if(I.key==="Tab"&&!k){const Y=document.activeElement,z=I.shiftKey;if(I.target===_&&z){(M=p.current)==null||M.focus();return}const ae=w({tabbingDirection:z?"backwards":"forwards"}),Q=ae.findIndex(re=>re===Y);Rf(ae.slice(Q+1))?I.preventDefault():z?(B=p.current)==null||B.focus():(W=g.current)==null||W.focus()}},"handleKeyDown");return _.addEventListener("keydown",E),()=>_.removeEventListener("keydown",E)}},[u,w]),d.jsxs(kD,{ref:h,role:"region","aria-label":i.replace("{hotkey}",C),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&d.jsx(pS,{ref:p,onFocusFromOutsideViewport:()=>{const _=w({tabbingDirection:"forwards"});Rf(_)}}),d.jsx(hv.Slot,{scope:r,children:d.jsx(pt.ol,{tabIndex:-1,...a,ref:m})}),b&&d.jsx(pS,{ref:g,onFocusFromOutsideViewport:()=>{const _=w({tabbingDirection:"backwards"});Rf(_)}})]})},"ToastViewport")),rF="ToastFocusProxy",pS=S.forwardRef(Qt(function(e,n){const{__scopeToast:r,onFocusFromOutsideViewport:o,...i}=e,a=Df(rF,r);return d.jsx(fv,{tabIndex:0,...i,ref:n,style:{position:"fixed"},onFocus:c=>{var p;const u=c.relatedTarget;!((p=a.viewport)!=null&&p.contains(u))&&o()}})},"ToastFocusProxy")),Mf="Toast",oF="toast.swipeStart",iF="toast.swipeMove",sF="toast.swipeCancel",aF="toast.swipeEnd",cF=S.forwardRef(Qt(function(e,n){const{forceMount:r,open:o,defaultOpen:i,onOpenChange:a,...c}=e,[u,h]=hi({prop:o,defaultProp:i??!0,onChange:a,caller:Mf});return d.jsx(vi,{present:r||u,children:d.jsx(uF,{open:u,...c,ref:n,onClose:()=>h(!1),onPause:gr(e.onPause),onResume:gr(e.onResume),onSwipeStart:nt(e.onSwipeStart,p=>{p.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:nt(e.onSwipeMove,p=>{const{x:g,y:v}=p.detail.delta;p.currentTarget.setAttribute("data-swipe","move"),p.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${g}px`),p.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${v}px`)}),onSwipeCancel:nt(e.onSwipeCancel,p=>{p.currentTarget.setAttribute("data-swipe","cancel"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),p.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),p.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:nt(e.onSwipeEnd,p=>{const{x:g,y:v}=p.detail.delta;p.currentTarget.setAttribute("data-swipe","end"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),p.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),p.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${g}px`),p.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${v}px`),h(!1)})})})},"Toast")),[lF,dF]=hS(Mf,{onClose(){}}),uF=S.forwardRef(Qt(function(e,n){const{__scopeToast:r,type:o="foreground",duration:i,open:a,onClose:c,onEscapeKeyDown:u,onPause:h,onResume:p,onSwipeStart:g,onSwipeMove:v,onSwipeCancel:m,onSwipeEnd:C,...b}=e,w=Df(Mf,r),_=fS(r),[E,I]=S.useState(null),k=Rt(n,I),A=S.useRef(null),M=S.useRef(null),B=i||w.duration,W=S.useRef(0),Y=S.useRef(B),z=S.useRef(0),{onToastAdd:de,onToastRemove:ne}=w,ae=gr(()=>{var se;(E==null?void 0:E.contains(document.activeElement))&&((se=w.viewport)==null||se.focus()),c()}),Q=S.useCallback(j=>{!j||j===1/0||(window.clearTimeout(z.current),W.current=new Date().getTime(),z.current=window.setTimeout(ae,j))},[ae]);S.useEffect(()=>{const j=w.viewport;if(j){const se=Qt(()=>{Q(Y.current),p==null||p()},"handleResume"),ie=Qt(()=>{const ce=new Date().getTime()-W.current;Y.current=Y.current-ce,window.clearTimeout(z.current),h==null||h()},"handlePause");return j.addEventListener(pv,ie),j.addEventListener(gv,se),()=>{j.removeEventListener(pv,ie),j.removeEventListener(gv,se)}}},[w.viewport,B,h,p,Q]),S.useEffect(()=>{a&&!w.isClosePausedRef.current&&Q(B)},[a,B,w.isClosePausedRef,Q]),S.useEffect(()=>()=>{window.clearTimeout(z.current)},[]),S.useEffect(()=>(de(),()=>ne()),[de,ne]);const re=S.useMemo(()=>E?mv(E):null,[E]);return w.viewport?d.jsxs(d.Fragment,{children:[re&&d.jsx(fF,{__scopeToast:r,role:"status","aria-live":o==="foreground"?"assertive":"polite",children:re}),d.jsx(lF,{scope:r,onClose:ae,children:ja.createPortal(d.jsx(hv.ItemSlot,{scope:r,children:d.jsx(ID,{asChild:!0,onEscapeKeyDown:nt(u,j=>{_().some(ie=>{var ce;return(ce=ie.ref.current)==null?void 0:ce.contains(j.target)})||ae()}),children:d.jsx(pt.li,{tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":w.swipeDirection,...b,ref:k,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:nt(e.onKeyDown,j=>{j.key==="Escape"&&(u==null||u(j.nativeEvent),j.nativeEvent.defaultPrevented||ae())}),onPointerDown:nt(e.onPointerDown,j=>{j.button===0&&(A.current={x:j.clientX,y:j.clientY})}),onPointerMove:nt(e.onPointerMove,j=>{if(!A.current)return;const se=j.clientX-A.current.x,ie=j.clientY-A.current.y,ce=!!M.current,$=["left","right"].includes(w.swipeDirection),Z=["left","up"].includes(w.swipeDirection)?Math.min:Math.max,me=$?Z(0,se):0,_e=$?0:Z(0,ie),Ee=j.pointerType==="touch"?10:2,ke={x:me,y:_e},te={originalEvent:j,delta:ke};ce?(M.current=ke,Jl(iF,v,te,{discrete:!1})):vS(ke,w.swipeDirection,Ee)?(M.current=ke,Jl(oF,g,te,{discrete:!1}),j.target.setPointerCapture(j.pointerId)):(Math.abs(se)>Ee||Math.abs(ie)>Ee)&&(A.current=null)}),onPointerUp:nt(e.onPointerUp,j=>{const se=M.current,ie=j.target;if(ie.hasPointerCapture(j.pointerId)&&ie.releasePointerCapture(j.pointerId),M.current=null,A.current=null,se){const ce=j.currentTarget,$={originalEvent:j,delta:se};vS(se,w.swipeDirection,w.swipeThreshold)?Jl(aF,C,$,{discrete:!0}):Jl(sF,m,$,{discrete:!0}),ce.addEventListener("click",Z=>Z.preventDefault(),{once:!0})}})})})}),w.viewport)})]}):null},"ToastImpl")),fF=Qt(t=>{const{__scopeToast:e,children:n,...r}=t,o=Df(Mf,e),[i,a]=S.useState(!1),[c,u]=S.useState(!1);return yS(()=>a(!0)),S.useEffect(()=>{const h=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(h)},[]),c?null:d.jsx(nf,{asChild:!0,container:o.announcerContainer||void 0,children:d.jsx(fv,{...r,children:i&&d.jsxs(d.Fragment,{children:[o.label," ",n]})})})},"ToastAnnounce"),hF=S.forwardRef(Qt(function(e,n){const{__scopeToast:r,...o}=e;return d.jsx(pt.div,{...o,ref:n})},"ToastTitle")),pF=S.forwardRef(Qt(function(e,n){const{__scopeToast:r,...o}=e;return d.jsx(pt.div,{...o,ref:n})},"ToastDescription")),gF="ToastAction",mF=S.forwardRef(Qt(function(e,n){const{altText:r,...o}=e;return r.trim()?d.jsx(mS,{altText:r,asChild:!0,children:d.jsx(gS,{...o,ref:n})}):(console.error(`Invalid prop \`altText\` supplied to \`${gF}\`. Expected non-empty \`string\`.`),null)},"ToastAction")),vF="ToastClose",gS=S.forwardRef(Qt(function(e,n){const{__scopeToast:r,...o}=e,i=dF(vF,r);return d.jsx(mS,{asChild:!0,children:d.jsx(pt.button,{type:"button",...o,ref:n,onClick:nt(e.onClick,i.onClose)})})},"ToastClose")),mS=S.forwardRef(Qt(function(e,n){const{__scopeToast:r,altText:o,...i}=e;return d.jsx(pt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...i,ref:n})},"ToastAnnounceExclude"));function mv(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),wS(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...mv(r))}}),e}Qt(mv,"getAnnounceTextContent");function Jl(t,e,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?Zg(o,i):o.dispatchEvent(i)}Qt(Jl,"handleAndDispatchCustomEvent");var vS=Qt((t,e,n=0)=>{const r=Math.abs(t.x),o=Math.abs(t.y),i=r>o;return e==="left"||e==="right"?i&&r>n:!i&&o>n},"isDeltaInDirection");function yS(t=()=>{}){const e=gr(t);Tn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}Qt(yS,"useNextFrame");function wS(t){return t.nodeType===t.ELEMENT_NODE}Qt(wS,"isHTMLElement");function bS(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Qt(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}Qt(bS,"getTabbableCandidates");function Rf(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}Qt(Rf,"focusFirst");var yF=ZL,CS=nF,xS=cF,_S=hF,SS=pF,TS=mF,ES=gS;const wF=yF,AS=S.forwardRef(({className:t,...e},n)=>d.jsx(CS,{ref:n,className:Xe("s3-explr-ui-toast-viewport fixed top-0 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px] z-[10000]",t),...e}));AS.displayName=CS.displayName;const bF=qm("s3-explr-ui-toast group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"s3-explr-ui-toast-default border bg-background text-foreground",destructive:"s3-explr-ui-toast-destructive destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),IS=S.forwardRef(({className:t,variant:e,...n},r)=>d.jsx(xS,{ref:r,className:Xe(bF({variant:e}),t),...n}));IS.displayName=xS.displayName;const CF=S.forwardRef(({className:t,...e},n)=>d.jsx(TS,{ref:n,className:Xe("s3-explr-ui-toast-action inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));CF.displayName=TS.displayName;const kS=S.forwardRef(({className:t,...e},n)=>d.jsx(ES,{ref:n,className:Xe("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity duration-200 ease-in-out hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600 font-bold",t),"toast-close":"",...e,children:d.jsx(Um,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));kS.displayName=ES.displayName;const PS=S.forwardRef(({className:t,...e},n)=>d.jsx(_S,{ref:n,className:Xe("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",t),...e}));PS.displayName=_S.displayName;const OS=S.forwardRef(({className:t,...e},n)=>d.jsx(SS,{ref:n,className:Xe("text-sm opacity-90 font-bold",t),...e}));OS.displayName=SS.displayName;const xF=1,_F=1e6;let vv=0;function SF(){return vv=(vv+1)%Number.MAX_SAFE_INTEGER,vv.toString()}const yv=new Map,NS=t=>{if(yv.has(t))return;const e=setTimeout(()=>{yv.delete(t),Xl({type:"REMOVE_TOAST",toastId:t})},_F);yv.set(t,e)},TF=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,xF)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?NS(n):t.toasts.forEach(r=>{NS(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Lf=[];let Ff={toasts:[]};function Xl(t){Ff=TF(Ff,t),Lf.forEach(e=>{e(Ff)})}function EF({...t}){const e=SF(),n=o=>Xl({type:"UPDATE_TOAST",toast:{...o,id:e}}),r=()=>Xl({type:"DISMISS_TOAST",toastId:e});return Xl({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:o=>{o||r()}}}),{id:e,dismiss:r,update:n}}function Zl(){const[t,e]=S.useState(Ff);return S.useEffect(()=>(Lf.push(e),()=>{const n=Lf.indexOf(e);n>-1&&Lf.splice(n,1)}),[t]),{...t,toast:EF,dismiss:n=>Xl({type:"DISMISS_TOAST",toastId:n})}}function DS(){const{toasts:t}=Zl();return d.jsxs(wF,{children:[t.map(function({id:e,title:n,description:r,action:o,...i}){return d.jsxs(IS,{...i,className:`s3-explr-ui-toast ${i.className||""}`,children:[d.jsxs("div",{className:"s3-explr-ui-toast-content grid gap-1",children:[n&&d.jsx(PS,{className:"s3-explr-ui-toast-title",children:n}),r&&d.jsx(OS,{className:"s3-explr-ui-toast-description",style:{wordBreak:"break-all",whiteSpace:"pre-line",maxWidth:400,overflowWrap:"break-word"},children:r})]}),o&&d.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),d.jsx(kS,{className:"s3-explr-ui-toast-close"})]},e)}),d.jsx(AS,{className:"s3-explr-ui-toast-viewport"})]})}const AF=["top","right","bottom","left"],ms=Math.min,Ai=Math.max,$f=Math.round,Uf=Math.floor,Ii=t=>({x:t,y:t}),IF={left:"right",right:"left",bottom:"top",top:"bottom"};function MS(t,e,n){return Ai(t,ms(e,n))}function ki(t,e){return typeof t=="function"?t(e):t}function vs(t){return t.split("-")[0]}function _c(t){return t.split("-")[1]}function wv(t){return t==="x"?"y":"x"}function bv(t){return t==="y"?"height":"width"}function qo(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Cv(t){return wv(qo(t))}function kF(t,e,n){n===void 0&&(n=!1);const r=_c(t),o=Cv(t),i=bv(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=Hf(a)),[a,Hf(a)]}function PF(t){const e=Hf(t);return[xv(t),e,xv(e)]}function xv(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const RS=["left","right"],LS=["right","left"],OF=["top","bottom"],NF=["bottom","top"];function DF(t,e,n){switch(t){case"top":case"bottom":return n?e?LS:RS:e?RS:LS;case"left":case"right":return e?OF:NF;default:return[]}}function MF(t,e,n,r){const o=_c(t);let i=DF(vs(t),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),e&&(i=i.concat(i.map(xv)))),i}function Hf(t){const e=vs(t);return IF[e]+t.slice(e.length)}function RF(t){var e,n,r,o;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(o=t.left)!=null?o:0}}function FS(t){return typeof t!="number"?RF(t):{top:t,right:t,bottom:t,left:t}}function Bf(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function $S(t,e,n){let{reference:r,floating:o}=t;const i=qo(e),a=Cv(e),c=bv(a),u=vs(e),h=i==="y",p=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,v=r[c]/2-o[c]/2;let m;switch(u){case"top":m={x:p,y:r.y-o.height};break;case"bottom":m={x:p,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:g};break;case"left":m={x:r.x-o.width,y:g};break;default:m={x:r.x,y:r.y}}const C=_c(e);return C&&(m[a]+=v*(C==="end"?1:-1)*(n&&h?-1:1)),m}async function LF(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:i,rects:a,elements:c,strategy:u}=t,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:v=!1,padding:m=0}=ki(e,t),C=FS(m),w=c[v?g==="floating"?"reference":"floating":g],_=Bf(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:h,rootBoundary:p,strategy:u})),E=g==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,I=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),k=await(i.isElement==null?void 0:i.isElement(I))&&await(i.getScale==null?void 0:i.getScale(I))||{x:1,y:1},A=Bf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:I,strategy:u}):E);return{top:(_.top-A.top+C.top)/k.y,bottom:(A.bottom-_.bottom+C.bottom)/k.y,left:(_.left-A.left+C.left)/k.x,right:(A.right-_.right+C.right)/k.x}}const FF=50,$F=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,c=a.detectOverflow?a:{...a,detectOverflow:LF},u=await(a.isRTL==null?void 0:a.isRTL(e));let h=await a.getElementRects({reference:t,floating:e,strategy:o}),{x:p,y:g}=$S(h,r,u),v=r,m=0;const C={};for(let b=0;b<i.length;b++){const w=i[b];if(!w)continue;const{name:_,fn:E}=w,{x:I,y:k,data:A,reset:M}=await E({x:p,y:g,initialPlacement:r,placement:v,strategy:o,middlewareData:C,rects:h,platform:c,elements:{reference:t,floating:e}});p=I??p,g=k??g,C[_]={...C[_],...A},M&&m<FF&&(m++,typeof M=="object"&&(M.placement&&(v=M.placement),M.rects&&(h=M.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:o}):M.rects),{x:p,y:g}=$S(h,v,u)),b=-1)}return{x:p,y:g,placement:v,strategy:o,middlewareData:C}},UF=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:i,platform:a,elements:c,middlewareData:u}=e,{element:h,padding:p=0}=ki(t,e)||{};if(h==null)return{};const g=FS(p),v={x:n,y:r},m=Cv(o),C=bv(m),b=await a.getDimensions(h),w=m==="y",_=w?"top":"left",E=w?"bottom":"right",I=w?"clientHeight":"clientWidth",k=i.reference[C]+i.reference[m]-v[m]-i.floating[C],A=v[m]-i.reference[m],M=await(a.getOffsetParent==null?void 0:a.getOffsetParent(h));let B=M?M[I]:0;(!B||!await(a.isElement==null?void 0:a.isElement(M)))&&(B=c.floating[I]||i.floating[C]);const W=k/2-A/2,Y=B/2-b[C]/2-1,z=ms(g[_],Y),de=ms(g[E],Y),ne=B-b[C]-de,ae=B/2-b[C]/2+W,Q=MS(z,ae,ne),re=!u.arrow&&_c(o)!=null&&ae!==Q&&i.reference[C]/2-(ae<z?z:de)-b[C]/2<0,j=re?ae<z?ae-z:ae-ne:0;return{[m]:v[m]+j,data:{[m]:Q,centerOffset:ae-Q-j,...re&&{alignmentOffset:j}},reset:re}}}),HF=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:c,platform:u,elements:h}=e,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:b=!0,...w}=ki(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const _=vs(o),E=qo(c),I=vs(c)===c,k=await(u.isRTL==null?void 0:u.isRTL(h.floating)),A=v||(I||!b?[Hf(c)]:PF(c)),M=C!=="none";!v&&M&&A.push(...MF(c,b,C,k));const B=[c,...A],W=await u.detectOverflow(e,w),Y=[];let z=((r=i.flip)==null?void 0:r.overflows)||[];if(p&&Y.push(W[_]),g){const Q=kF(o,a,k);Y.push(W[Q[0]],W[Q[1]])}if(z=[...z,{placement:o,overflows:Y}],!Y.every(Q=>Q<=0)){var de,ne;const Q=(((de=i.flip)==null?void 0:de.index)||0)+1,re=B[Q];if(re&&(!(g==="alignment"?E!==qo(re):!1)||z.every(ie=>qo(ie.placement)===E?ie.overflows[0]>0:!0)))return{data:{index:Q,overflows:z},reset:{placement:re}};let j=(ne=z.filter(se=>se.overflows[0]<=0).sort((se,ie)=>se.overflows[1]-ie.overflows[1])[0])==null?void 0:ne.placement;if(!j)switch(m){case"bestFit":{var ae;const se=(ae=z.filter(ie=>{if(M){const ce=qo(ie.placement);return ce===E||ce==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(ce=>ce>0).reduce((ce,$)=>ce+$,0)]).sort((ie,ce)=>ie[1]-ce[1])[0])==null?void 0:ae[0];se&&(j=se);break}case"initialPlacement":j=c;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function US(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function HS(t){return AF.some(e=>t[e]>=0)}const BF=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...i}=ki(t,e);switch(o){case"referenceHidden":{const a=await r.detectOverflow(e,{...i,elementContext:"reference"}),c=US(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:HS(c)}}}case"escaped":{const a=await r.detectOverflow(e,{...i,altBoundary:!0}),c=US(a,n.floating);return{data:{escapedOffsets:c,escaped:HS(c)}}}default:return{}}}}},BS=new Set(["left","top"]);async function zF(t,e){const{placement:n,platform:r,elements:o}=t,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=vs(n),c=_c(n),u=qo(n)==="y",h=BS.has(a)?-1:1,p=i&&u?-1:1,g=ki(e,t);let{mainAxis:v,crossAxis:m,alignmentAxis:C}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return c&&typeof C=="number"&&(m=c==="end"?C*-1:C),u?{x:m*p,y:v*h}:{x:v*h,y:m*p}}const VF=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:i,placement:a,middlewareData:c}=e,u=await zF(e,t);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:a}}}}},KF=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:i}=e,{mainAxis:a=!0,crossAxis:c=!1,limiter:u={fn:E=>{let{x:I,y:k}=E;return{x:I,y:k}}},...h}=ki(t,e),p={x:n,y:r},g=await i.detectOverflow(e,h),v=qo(o),m=wv(v);let C=p[m],b=p[v];const w=(E,I)=>MS(I+g[E==="y"?"top":"left"],I,I-g[E==="y"?"bottom":"right"]);a&&(C=w(m,C)),c&&(b=w(v,b));const _=u.fn({...e,[m]:C,[v]:b});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[m]:a,[v]:c}}}}}},GF=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:o,y:i,placement:a,rects:c,middlewareData:u}=e,{offset:h=0,mainAxis:p=!0,crossAxis:g=!0}=ki(t,e),v={x:o,y:i},m=qo(a),C=wv(m);let b=v[C],w=v[m];const _=ki(h,e),E=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:(n=_.mainAxis)!=null?n:0,crossAxis:(r=_.crossAxis)!=null?r:0};if(p){const A=C==="y"?"height":"width",M=c.reference[C]-c.floating[A]+E.mainAxis,B=c.reference[C]+c.reference[A]-E.mainAxis;b<M?b=M:b>B&&(b=B)}if(g){var I,k;const A=C==="y"?"width":"height",M=BS.has(vs(a)),B=c.reference[m]-c.floating[A]+(M&&((I=u.offset)==null?void 0:I[m])||0)+(M?0:E.crossAxis),W=c.reference[m]+c.reference[A]+(M?0:((k=u.offset)==null?void 0:k[m])||0)-(M?E.crossAxis:0);w<B?w=B:w>W&&(w=W)}return{[C]:b,[m]:w}}}},jF=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:o,elements:i}=e,{apply:a=()=>{},...c}=ki(t,e),u=await o.detectOverflow(e,c),h=vs(n),p=_c(n),g=qo(n)==="y",{width:v,height:m}=r.floating;let C,b;h==="top"||h==="bottom"?(C=h,b=p===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(b=h,C=p==="end"?"top":"bottom");const w=m-u.top-u.bottom,_=v-u.left-u.right,E=ms(m-u[C],w),I=ms(v-u[b],_),k=e.middlewareData.shift,A=!k;let M=E,B=I;k!=null&&k.enabled.x&&(B=_),k!=null&&k.enabled.y&&(M=w),A&&!p&&(g?B=v-2*Ai(u.left,u.right):M=m-2*Ai(u.top,u.bottom)),await a({...e,availableWidth:B,availableHeight:M});const W=await o.getDimensions(i.floating);return v!==W.width||m!==W.height?{reset:{rects:!0}}:{}}}};function zf(){return typeof window<"u"}function Sc(t){return zS(t)?(t.nodeName||"").toLowerCase():"#document"}function Mr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Pi(t){var e;return(e=(zS(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function zS(t){return zf()?t instanceof Node||t instanceof Mr(t).Node:!1}function Yo(t){return zf()?t instanceof Element||t instanceof Mr(t).Element:!1}function ys(t){return zf()?t instanceof HTMLElement||t instanceof Mr(t).HTMLElement:!1}function VS(t){return!zf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Mr(t).ShadowRoot}function Vf(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=Qo(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function WF(t){return/^(table|td|th)$/.test(Sc(t))}function Kf(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const qF=/transform|translate|scale|rotate|perspective|filter/,YF=/paint|layout|strict|content/,ra=t=>!!t&&t!=="none";let _v;function Sv(t){const e=Yo(t)?Qo(t):t;return ra(e.transform)||ra(e.translate)||ra(e.scale)||ra(e.rotate)||ra(e.perspective)||!Tv()&&(ra(e.backdropFilter)||ra(e.filter))||qF.test(e.willChange||"")||YF.test(e.contain||"")}function QF(t){let e=oa(t);for(;ys(e)&&!ed(e);){if(Sv(e))return e;if(Kf(e))return null;e=oa(e)}return null}function Tv(){return _v==null&&(_v=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_v}function ed(t){return/^(html|body|#document)$/.test(Sc(t))}function Qo(t){return Mr(t).getComputedStyle(t)}function Gf(t){return Yo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function oa(t){if(Sc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||VS(t)&&t.host||Pi(t);return VS(e)?e.host:e}function KS(t){const e=oa(t);return ed(e)?(t.ownerDocument||t).body:ys(e)&&Vf(e)?e:KS(e)}function td(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=KS(t),i=o===((r=t.ownerDocument)==null?void 0:r.body),a=Mr(o);if(i){const c=Ev(a);return e.concat(a,a.visualViewport||[],Vf(o)?o:[],c&&n?td(c):[])}else return e.concat(o,td(o,[],n))}function Ev(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function GS(t){const e=Qo(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=ys(t),i=o?t.offsetWidth:n,a=o?t.offsetHeight:r,c=$f(n)!==i||$f(r)!==a;return c&&(n=i,r=a),{width:n,height:r,$:c}}function Av(t){return Yo(t)?t:t.contextElement}function Tc(t){const e=Av(t);if(!ys(e))return Ii(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:i}=GS(e);let a=(i?$f(n.width):n.width)/r,c=(i?$f(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const JF=Ii(0);function jS(t){const e=Mr(t);return!Tv()||!e.visualViewport?JF:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function XF(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Mr(t)}function ia(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=Av(t);let a=Ii(1);e&&(r?Yo(r)&&(a=Tc(r)):a=Tc(t));const c=XF(i,n,r)?jS(i):Ii(0);let u=(o.left+c.x)/a.x,h=(o.top+c.y)/a.y,p=o.width/a.x,g=o.height/a.y;if(i&&r){const v=Mr(i),m=Yo(r)?Mr(r):r;let C=v,b=Ev(C);for(;b&&m!==C;){const w=Tc(b),_=b.getBoundingClientRect(),E=Qo(b),I=_.left+(b.clientLeft+parseFloat(E.paddingLeft))*w.x,k=_.top+(b.clientTop+parseFloat(E.paddingTop))*w.y;u*=w.x,h*=w.y,p*=w.x,g*=w.y,u+=I,h+=k,C=Mr(b),b=Ev(C)}}return Bf({width:p,height:g,x:u,y:h})}function jf(t,e){const n=Gf(t).scrollLeft;return e?e.left+n:ia(Pi(t)).left+n}function WS(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-jf(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function ZF(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const i=o==="fixed",a=Pi(r),c=e?Kf(e.floating):!1;if(r===a||c&&i)return n;let u={scrollLeft:0,scrollTop:0},h=Ii(1);const p=Ii(0),g=ys(r);if((g||!i)&&((Sc(r)!=="body"||Vf(a))&&(u=Gf(r)),g)){const m=ia(r);h=Tc(r),p.x=m.x+r.clientLeft,p.y=m.y+r.clientTop}const v=a&&!g&&!i?WS(a,u):Ii(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-u.scrollLeft*h.x+p.x+v.x,y:n.y*h.y-u.scrollTop*h.y+p.y+v.y}}function e$(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function t$(t){const e=Gf(t),n=t.ownerDocument.body,r=Ai(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Ai(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+jf(t);const a=-e.scrollTop;return Qo(n).direction==="rtl"&&(i+=Ai(t.clientWidth,n.clientWidth)-r),{width:r,height:o,x:i,y:a}}const n$=25;function r$(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",o=Mr(t),i=Pi(t),a=o.visualViewport;let c=i.clientWidth,u=i.clientHeight,h=0,p=0;if(a){const v=!Tv()||e==="fixed";r?v||(h=-a.offsetLeft,p=-a.offsetTop):(c=a.width,u=a.height,v&&(h=a.offsetLeft,p=a.offsetTop))}if(jf(i)<=0){const v=i.ownerDocument,m=v.body,C=getComputedStyle(m),b=v.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,w=Math.abs(i.clientWidth-m.clientWidth-b),_=getComputedStyle(i).scrollbarGutter==="stable both-edges"?w/2:w;_<=n$&&(c-=_)}return{width:c,height:u,x:h,y:p}}function o$(t,e){const n=ia(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,i=Tc(t),a=t.clientWidth*i.x,c=t.clientHeight*i.y,u=o*i.x,h=r*i.y;return{width:a,height:c,x:u,y:h}}function qS(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=r$(t,n,e);else if(e==="document")r=t$(Pi(t));else if(Yo(e))r=o$(e,n);else{const o=jS(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Bf(r)}function i$(t,e){const n=e.get(t);if(n)return n;let r=td(t,[],!1).filter(c=>Yo(c)&&Sc(c)!=="body"),o=null;const i=Qo(t).position==="fixed";let a=i?oa(t):t;for(;Yo(a)&&!ed(a);){const c=Qo(a),u=Sv(a),h=o?o.position:i?"fixed":"";!u&&(h==="fixed"||h==="absolute"&&c.position==="static")?r=r.filter(g=>g!==a):o=c,a=oa(a)}return e.set(t,r),r}function s$(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const a=[...n==="clippingAncestors"?Kf(e)?[]:i$(e,this._c):[].concat(n),r],c=qS(e,a[0],o);let u=c.top,h=c.right,p=c.bottom,g=c.left;for(let v=1;v<a.length;v++){const m=qS(e,a[v],o);u=Ai(m.top,u),h=ms(m.right,h),p=ms(m.bottom,p),g=Ai(m.left,g)}return{width:h-g,height:p-u,x:g,y:u}}function a$(t){const{width:e,height:n}=GS(t);return{width:e,height:n}}function c$(t,e,n){const r=ys(e),o=Pi(e),i=n==="fixed",a=ia(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const u=Ii(0);if((r||!i)&&((Sc(e)!=="body"||Vf(o))&&(c=Gf(e)),r)){const v=ia(e,!0,i,e);u.x=v.x+e.clientLeft,u.y=v.y+e.clientTop}!r&&o&&(u.x=jf(o));const h=o&&!r&&!i?WS(o,c):Ii(0),p=a.left+c.scrollLeft-u.x-h.x,g=a.top+c.scrollTop-u.y-h.y;return{x:p,y:g,width:a.width,height:a.height}}function Iv(t){return Qo(t).position==="static"}function YS(t,e){if(!ys(t)||Qo(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Pi(t)===n&&(n=n.ownerDocument.body),n}function QS(t,e){const n=Mr(t);if(Kf(t))return n;if(!ys(t)){let o=oa(t);for(;o&&!ed(o);){if(Yo(o)&&!Iv(o))return o;o=oa(o)}return n}let r=YS(t,e);for(;r&&WF(r)&&Iv(r);)r=YS(r,e);return r&&ed(r)&&Iv(r)&&!Sv(r)?n:r||QF(t)||n}const l$=async function(t){const e=this.getOffsetParent||QS,n=this.getDimensions,r=await n(t.floating);return{reference:c$(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function d$(t){return Qo(t).direction==="rtl"}const u$={convertOffsetParentRelativeRectToViewportRelativeRect:ZF,getDocumentElement:Pi,getClippingRect:s$,getOffsetParent:QS,getElementRects:l$,getClientRects:e$,getDimensions:a$,getScale:Tc,isElement:Yo,isRTL:d$};function JS(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function f$(t,e,n){let r=null,o;const i=Pi(t);function a(){var p;clearTimeout(o),(p=r)==null||p.disconnect(),r=null}function c(p,g){p===void 0&&(p=!1),g===void 0&&(g=1),a();const v=t.getBoundingClientRect(),{left:m,top:C,width:b,height:w}=v;if(p||e(),!b||!w)return;const _=Uf(C),E=Uf(i.clientWidth-(m+b)),I=Uf(i.clientHeight-(C+w)),k=Uf(m),M={rootMargin:-_+"px "+-E+"px "+-I+"px "+-k+"px",threshold:Ai(0,ms(1,g))||1};let B=!0;function W(Y){const z=Y[0].intersectionRatio;if(!JS(v,t.getBoundingClientRect()))return c();if(z!==g){if(!B)return c();z?c(!1,z):o=setTimeout(()=>{c(!1,1e-7)},1e3)}B=!1}try{r=new IntersectionObserver(W,{...M,root:i.ownerDocument})}catch{r=new IntersectionObserver(W,M)}r.observe(t)}const u=Mr(t),h=()=>c(n);return u.addEventListener("resize",h),c(!0),()=>{u.removeEventListener("resize",h),a()}}function h$(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,h=Av(t),p=o||i?[...h?td(h):[],...e?td(e):[]]:[];p.forEach(_=>{o&&_.addEventListener("scroll",n),i&&_.addEventListener("resize",n)});const g=h&&c?f$(h,n,i):null;let v=-1,m=null;a&&(m=new ResizeObserver(_=>{let[E]=_;E&&E.target===h&&m&&e&&(m.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var I;(I=m)==null||I.observe(e)})),n()}),h&&!u&&m.observe(h),e&&m.observe(e));let C,b=u?ia(t):null;u&&w();function w(){const _=ia(t);b&&!JS(b,_)&&n(),b=_,C=requestAnimationFrame(w)}return n(),()=>{var _;p.forEach(E=>{o&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),g==null||g(),(_=m)==null||_.disconnect(),m=null,u&&cancelAnimationFrame(C)}}const p$=VF,g$=KF,m$=HF,v$=jF,y$=BF,XS=UF,w$=GF,b$=(t,e,n)=>{const r=new Map,o=n??{},i={...u$,...o.platform,_c:r};return $F(t,e,{...o,platform:i})};var C$=typeof document<"u",x$=function(){},Wf=C$?D.useLayoutEffect:x$;function qf(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!qf(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&t.$$typeof)&&!qf(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function ZS(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function eT(t,e){const n=ZS(t);return Math.round(e*n)/n}function kv(t){const e=S.useRef(t);return Wf(()=>{e.current=t}),e}function _$(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:c=!0,whileElementsMounted:u,open:h}=t,[p,g]=S.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[v,m]=S.useState(r);qf(v,r)||m(r);const[C,b]=S.useState(null),[w,_]=S.useState(null),E=S.useCallback(ie=>{ie!==M.current&&(M.current=ie,b(ie))},[]),I=S.useCallback(ie=>{ie!==B.current&&(B.current=ie,_(ie))},[]),k=i||C,A=a||w,M=S.useRef(null),B=S.useRef(null),W=S.useRef(p),Y=u!=null,z=kv(u),de=kv(o),ne=kv(h),ae=S.useCallback(()=>{if(!M.current||!B.current)return;const ie={placement:e,strategy:n,middleware:v};de.current&&(ie.platform=de.current),b$(M.current,B.current,ie).then(ce=>{const $={...ce,isPositioned:ne.current!==!1};Q.current&&!qf(W.current,$)&&(W.current=$,ja.flushSync(()=>{g($)}))})},[v,e,n,de,ne]);Wf(()=>{h===!1&&W.current.isPositioned&&(W.current.isPositioned=!1,g(ie=>({...ie,isPositioned:!1})))},[h]);const Q=S.useRef(!1);Wf(()=>(Q.current=!0,()=>{Q.current=!1}),[]),Wf(()=>{if(k&&(M.current=k),A&&(B.current=A),k&&A){if(z.current)return z.current(k,A,ae);ae()}},[k,A,ae,z,Y]);const re=S.useMemo(()=>({reference:M,floating:B,setReference:E,setFloating:I}),[E,I]),j=S.useMemo(()=>({reference:k,floating:A}),[k,A]),se=S.useMemo(()=>{const ie={position:n,left:0,top:0};if(!j.floating)return ie;const ce=eT(j.floating,p.x),$=eT(j.floating,p.y);return c?{...ie,transform:"translate("+ce+"px, "+$+"px)",...ZS(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ce,top:$}},[n,c,j.floating,p.x,p.y]);return S.useMemo(()=>({...p,update:ae,refs:re,elements:j,floatingStyles:se}),[p,ae,re,j,se])}const S$=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?XS({element:r.current,padding:o}).fn(n):{}:r?XS({element:r,padding:o}).fn(n):{}}}},T$=(t,e)=>{const n=p$(t);return{name:n.name,fn:n.fn,options:[t,e]}},E$=(t,e)=>{const n=g$(t);return{name:n.name,fn:n.fn,options:[t,e]}},A$=(t,e)=>({fn:w$(t).fn,options:[t,e]}),I$=(t,e)=>{const n=m$(t);return{name:n.name,fn:n.fn,options:[t,e]}},k$=(t,e)=>{const n=v$(t);return{name:n.name,fn:n.fn,options:[t,e]}},P$=(t,e)=>{const n=y$(t);return{name:n.name,fn:n.fn,options:[t,e]}},O$=(t,e)=>{const n=S$(t);return{name:n.name,fn:n.fn,options:[t,e]}};var N$=Object.defineProperty,ws=(t,e)=>N$(t,"name",{value:e,configurable:!0}),tT="Popper",[nT,Yf]=Co(tT),[D$,rT]=nT(tT),M$=ws(t=>{const{__scopePopper:e,children:n}=t,[r,o]=S.useState(null),[i,a]=S.useState(void 0);return d.jsx(D$,{scope:e,anchor:r,onAnchorChange:o,placementState:i,setPlacementState:a,children:n})},"Popper"),R$="PopperAnchor",L$=S.forwardRef(ws(function(e,n){const{__scopePopper:r,virtualRef:o,...i}=e,a=rT(R$,r),c=S.useRef(null),u=a.onAnchorChange,h=S.useCallback(b=>{c.current=b,b&&u(b)},[u]),p=Rt(n,h),g=S.useRef(null);S.useEffect(()=>{if(!o)return;const b=g.current;g.current=o.current,b!==g.current&&u(g.current)});const v=a.placementState&&Qf(a.placementState),m=v==null?void 0:v[0],C=v==null?void 0:v[1];return o?null:d.jsx(pt.div,{"data-radix-popper-side":m,"data-radix-popper-align":C,...i,ref:p})},"PopperAnchor")),oT="PopperContent",[F$,pW]=nT(oT),$$=S.forwardRef(ws(function(e,n){var Ie,Pe,Me,fe,He,Ut,ct;const{__scopePopper:r,side:o="bottom",sideOffset:i=0,align:a="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:m=!1,updatePositionStrategy:C="optimized",onPlaced:b,...w}=e,_=rT(oT,r),[E,I]=S.useState(null),k=Rt(n,I),[A,M]=S.useState(null),B=Ym(A),W=(B==null?void 0:B.width)??0,Y=(B==null?void 0:B.height)??0,z=o+(a!=="center"?"-"+a:""),de=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},ne=Array.isArray(p)?p:[p],ae=ne.length>0,Q={padding:de,boundary:ne.filter(iT),altBoundary:ae},{refs:re,floatingStyles:j,placement:se,isPositioned:ie,middlewareData:ce}=_$({strategy:"fixed",placement:z,whileElementsMounted:ws((...ze)=>h$(...ze,{animationFrame:C==="always"}),"whileElementsMounted"),elements:{reference:_.anchor},middleware:[T$({mainAxis:i+Y,alignmentAxis:c}),h&&E$({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?A$():void 0,...Q}),h&&I$({...Q}),k$({...Q,apply:ws(({elements:ze,rects:wt,availableWidth:vt,availableHeight:qt})=>{const{width:An,height:In}=wt.reference,At=ze.floating.style;At.setProperty("--radix-popper-available-width",`${vt}px`),At.setProperty("--radix-popper-available-height",`${qt}px`),At.setProperty("--radix-popper-anchor-width",`${An}px`),At.setProperty("--radix-popper-anchor-height",`${In}px`)},"apply")}),A&&O$({element:A,padding:u}),U$({arrowWidth:W,arrowHeight:Y}),m&&P$({strategy:"referenceHidden",...Q,boundary:ae?Q.boundary:void 0})]}),$=_.setPlacementState;Tn(()=>($(se),()=>{$(void 0)}),[se,$]);const[Z,me]=Qf(se),_e=gr(b);Tn(()=>{ie&&(_e==null||_e())},[ie,_e]);const Ee=(Ie=ce.arrow)==null?void 0:Ie.x,ke=(Pe=ce.arrow)==null?void 0:Pe.y,te=((Me=ce.arrow)==null?void 0:Me.centerOffset)!==0,[pe,be]=S.useState();return Tn(()=>{E&&be(window.getComputedStyle(E).zIndex)},[E]),d.jsx("div",{ref:re.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:ie?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[(fe=ce.transformOrigin)==null?void 0:fe.x,(He=ce.transformOrigin)==null?void 0:He.y].join(" "),...((Ut=ce.hide)==null?void 0:Ut.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(F$,{scope:r,placedSide:Z,placedAlign:me,onArrowChange:M,arrowX:Ee,arrowY:ke,shouldHideArrow:te,children:d.jsx(pt.div,{"data-side":Z,"data-align":me,...w,ref:k,style:{...w.style,animation:ie?(ct=w.style)==null?void 0:ct.animation:"none"}})})})},"PopperContent"));function iT(t){return t!==null}ws(iT,"isNotNull");var U$=ws(t=>({name:"transformOrigin",options:t,fn(e){var w,_,E;const{placement:n,rects:r,middlewareData:o}=e,a=((w=o.arrow)==null?void 0:w.centerOffset)!==0,c=a?0:t.arrowWidth,u=a?0:t.arrowHeight,[h,p]=Qf(n),g={start:"0%",center:"50%",end:"100%"}[p],v=(((_=o.arrow)==null?void 0:_.x)??0)+c/2,m=(((E=o.arrow)==null?void 0:E.y)??0)+u/2;let C="",b="";return h==="bottom"?(C=a?g:`${v}px`,b=`${-u}px`):h==="top"?(C=a?g:`${v}px`,b=`${r.floating.height+u}px`):h==="right"?(C=`${-u}px`,b=a?g:`${m}px`):h==="left"&&(C=`${r.floating.width+u}px`,b=a?g:`${m}px`),{data:{x:C,y:b}}}}),"transformOrigin");function Qf(t){const[e,n="center"]=t.split("-");return[e,n]}ws(Qf,"getSideAndAlignFromPlacement");var sT=M$,aT=L$,cT=$$,H$=Object.defineProperty,Rn=(t,e)=>H$(t,"name",{value:e,configurable:!0}),[Pv,gW]=Co("Tooltip",[Yf]),Ov=Yf(),B$="TooltipProvider",z$=700,Nv="tooltip.open",[V$,Dv]=Pv(B$),K$=Rn(t=>{const{__scopeTooltip:e,delayDuration:n=z$,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=t,a=S.useRef(!0),c=S.useRef(!1),u=S.useRef(0);return S.useEffect(()=>{const h=u.current;return()=>window.clearTimeout(h)},[]),d.jsx(V$,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:S.useCallback(()=>{r<=0||(window.clearTimeout(u.current),a.current=!1)},[r]),onClose:S.useCallback(()=>{r<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:c,onPointerInTransitChange:S.useCallback(h=>{c.current=h},[]),disableHoverableContent:o,children:i})},"TooltipProvider"),Mv="Tooltip",[G$,nd]=Pv(Mv),j$=Rn(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:a,delayDuration:c}=t,u=Dv(Mv,t.__scopeTooltip),h=Ov(e),[p,g]=S.useState(null),[v,m]=S.useState(void 0),C=fi(),b=S.useRef(0),w=a??u.disableHoverableContent,_=c??u.delayDuration,E=S.useRef(!1),[I,k]=hi({prop:r,defaultProp:o??!1,onChange:Rn(z=>{z?(u.onOpen(),document.dispatchEvent(new CustomEvent(Nv))):u.onClose(),i==null||i(z)},"onChange"),caller:Mv}),A=S.useMemo(()=>I?E.current?"delayed-open":"instant-open":"closed",[I]),M=S.useCallback(()=>{window.clearTimeout(b.current),b.current=0,E.current=!1,k(!0)},[k]),B=S.useCallback(()=>{window.clearTimeout(b.current),b.current=0,k(!1)},[k]),W=S.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{E.current=!0,k(!0),b.current=0},_)},[_,k]);S.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const Y=v??C;return d.jsx(sT,{...h,children:d.jsx(G$,{scope:e,contentId:Y,setContentId:m,open:I,stateAttribute:A,trigger:p,onTriggerChange:g,onTriggerEnter:S.useCallback(()=>{u.isOpenDelayedRef.current?W():M()},[u.isOpenDelayedRef,W,M]),onTriggerLeave:S.useCallback(()=>{w?B():(window.clearTimeout(b.current),b.current=0)},[B,w]),onOpen:M,onClose:B,disableHoverableContent:w,children:n})})},"Tooltip"),lT="TooltipTrigger",W$=S.forwardRef(Rn(function(e,n){const{__scopeTooltip:r,...o}=e,i=nd(lT,r),a=Dv(lT,r),c=Ov(r),u=S.useRef(null),h=Rt(n,u,i.onTriggerChange),p=S.useRef(!1),g=S.useRef(!1),v=S.useCallback(()=>p.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),d.jsx(aT,{asChild:!0,...c,children:d.jsx(pt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...o,ref:h,onPointerMove:nt(e.onPointerMove,m=>{m.pointerType!=="touch"&&!g.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),g.current=!0)}),onPointerLeave:nt(e.onPointerLeave,()=>{i.onTriggerLeave(),g.current=!1}),onPointerDown:nt(e.onPointerDown,()=>{i.open&&i.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:nt(e.onFocus,()=>{p.current||i.onOpen()}),onBlur:nt(e.onBlur,i.onClose),onClick:nt(e.onClick,i.onClose)})})},"TooltipTrigger")),dT="TooltipPortal",[q$,Y$]=Pv(dT,{forceMount:void 0}),Q$=Rn(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,i=nd(dT,e);return d.jsx(q$,{scope:e,forceMount:n,children:d.jsx(vi,{present:n||i.open,children:d.jsx(nf,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),rd="TooltipContent",J$=S.forwardRef(Rn(function(e,n){const r=Y$(rd,e.__scopeTooltip),{forceMount:o=r.forceMount,side:i="top",...a}=e,c=nd(rd,e.__scopeTooltip);return d.jsx(vi,{present:o||c.open,children:c.disableHoverableContent?d.jsx(uT,{side:i,...a,ref:n}):d.jsx(X$,{side:i,...a,ref:n})})},"TooltipContent")),X$=S.forwardRef(Rn(function(e,n){const r=nd(rd,e.__scopeTooltip),o=Dv(rd,e.__scopeTooltip),i=S.useRef(null),a=Rt(n,i),[c,u]=S.useState(null),{trigger:h,onClose:p}=r,g=i.current,{onPointerInTransitChange:v}=o,m=S.useCallback(()=>{u(null),v(!1)},[v]),C=S.useCallback((b,w)=>{const _=b.currentTarget,E={x:b.clientX,y:b.clientY},I=fT(E,_.getBoundingClientRect()),k=hT(E,I),A=pT(w.getBoundingClientRect()),M=mT([...k,...A]);u(M),v(!0)},[v]);return S.useEffect(()=>()=>m(),[m]),S.useEffect(()=>{if(h&&g){const b=Rn(_=>C(_,g),"handleTriggerLeave"),w=Rn(_=>C(_,h),"handleContentLeave");return h.addEventListener("pointerleave",b),g.addEventListener("pointerleave",w),()=>{h.removeEventListener("pointerleave",b),g.removeEventListener("pointerleave",w)}}},[h,g,C,m]),S.useEffect(()=>{if(c){const b=Rn(w=>{const _=w.target,E={x:w.clientX,y:w.clientY},I=(h==null?void 0:h.contains(_))||(g==null?void 0:g.contains(_)),k=!gT(E,c);I?m():k&&(m(),p())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[h,g,c,p,m]),d.jsx(uT,{...e,ref:a})},"TooltipContentHoverable")),Z$=f_("TooltipContent"),uT=S.forwardRef(Rn(function(e,n){const{__scopeTooltip:r,children:o,"aria-label":i,id:a,onEscapeKeyDown:c,onPointerDownOutside:u,...h}=e,p=nd(rd,r),g=Ov(r),{onClose:v}=p;S.useEffect(()=>(document.addEventListener(Nv,v),()=>document.removeEventListener(Nv,v)),[v]),S.useEffect(()=>{if(p.trigger){const C=Rn(b=>{b.target instanceof Node&&b.target.contains(p.trigger)&&v()},"handleScroll");return window.addEventListener("scroll",C,{capture:!0}),()=>window.removeEventListener("scroll",C,{capture:!0})}},[p.trigger,v]);const{setContentId:m}=p;return Tn(()=>(m(a),()=>{m(void 0)}),[a,m]),d.jsx(tf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:C=>C.preventDefault(),onDismiss:v,children:d.jsxs(cT,{"data-state":p.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:p.contentId,...g,...h,ref:n,style:{...h.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(Z$,{children:o}),i?d.jsx(YL,{id:p.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function fT(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Rn(fT,"getExitSideFromRect");function hT(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}Rn(hT,"getPaddedExitPoints");function pT(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}Rn(pT,"getPointsFromRect");function gT(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const c=e[i],u=e[a],h=c.x,p=c.y,g=u.x,v=u.y;p>r!=v>r&&n<(g-h)*(r-p)/(v-p)+h&&(o=!o)}return o}Rn(gT,"isPointInPolygon");function mT(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),vT(e)}Rn(mT,"getHull");function vT(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}Rn(vT,"getHullPresorted");var eU=K$,tU=j$,nU=W$,rU=Q$,yT=J$;const wr=eU,br=tU,Cr=nU,rr=S.forwardRef(({className:t,sideOffset:e=4,...n},r)=>d.jsx(rU,{children:d.jsx(yT,{ref:r,sideOffset:e,className:Xe("z-[100001] overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));rr.displayName=yT.displayName;function oU({title:t,titleId:e,...n},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?S.createElement("title",{id:e},t):null,S.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const iU=S.forwardRef(oU);var sU=function(t){return function(e,n){var r=D.useRef(!1);t(function(){return function(){r.current=!1}},[]),t(function(){if(!r.current)r.current=!0;else return e()},n)}},wT=function(t){return typeof t=="function"},bT=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const aU=sU(D.useEffect);function CT(t){var e=D.useRef(t);return e.current=t,e}var cU=function(t){bT&&(wT(t)||console.error("useUnmount expected parameter is a function, got ".concat(typeof t)));var e=CT(t);D.useEffect(function(){return function(){e.current()}},[])};function lU(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var xT=lU,dU=typeof jo=="object"&&jo&&jo.Object===Object&&jo,uU=dU,fU=uU,hU=typeof self=="object"&&self&&self.Object===Object&&self,pU=fU||hU||Function("return this")(),_T=pU,gU=_T,mU=function(){return gU.Date.now()},vU=mU,yU=/\s/;function wU(t){for(var e=t.length;e--&&yU.test(t.charAt(e)););return e}var bU=wU,CU=bU,xU=/^\s+/;function _U(t){return t&&t.slice(0,CU(t)+1).replace(xU,"")}var SU=_U,TU=_T,EU=TU.Symbol,ST=EU,TT=ST,ET=Object.prototype,AU=ET.hasOwnProperty,IU=ET.toString,od=TT?TT.toStringTag:void 0;function kU(t){var e=AU.call(t,od),n=t[od];try{t[od]=void 0;var r=!0}catch{}var o=IU.call(t);return r&&(e?t[od]=n:delete t[od]),o}var PU=kU,OU=Object.prototype,NU=OU.toString;function DU(t){return NU.call(t)}var MU=DU,AT=ST,RU=PU,LU=MU,FU="[object Null]",$U="[object Undefined]",IT=AT?AT.toStringTag:void 0;function UU(t){return t==null?t===void 0?$U:FU:IT&&IT in Object(t)?RU(t):LU(t)}var HU=UU;function BU(t){return t!=null&&typeof t=="object"}var zU=BU,VU=HU,KU=zU,GU="[object Symbol]";function jU(t){return typeof t=="symbol"||KU(t)&&VU(t)==GU}var WU=jU,qU=SU,kT=xT,YU=WU,PT=NaN,QU=/^[-+]0x[0-9a-f]+$/i,JU=/^0b[01]+$/i,XU=/^0o[0-7]+$/i,ZU=parseInt;function eH(t){if(typeof t=="number")return t;if(YU(t))return PT;if(kT(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=kT(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=qU(t);var n=JU.test(t);return n||XU.test(t)?ZU(t.slice(2),n?2:8):QU.test(t)?PT:+t}var tH=eH,nH=xT,Rv=vU,OT=tH,rH="Expected a function",oH=Math.max,iH=Math.min;function sH(t,e,n){var r,o,i,a,c,u,h=0,p=!1,g=!1,v=!0;if(typeof t!="function")throw new TypeError(rH);e=OT(e)||0,nH(n)&&(p=!!n.leading,g="maxWait"in n,i=g?oH(OT(n.maxWait)||0,e):i,v="trailing"in n?!!n.trailing:v);function m(M){var B=r,W=o;return r=o=void 0,h=M,a=t.apply(W,B),a}function C(M){return h=M,c=setTimeout(_,e),p?m(M):a}function b(M){var B=M-u,W=M-h,Y=e-B;return g?iH(Y,i-W):Y}function w(M){var B=M-u,W=M-h;return u===void 0||B>=e||B<0||g&&W>=i}function _(){var M=Rv();if(w(M))return E(M);c=setTimeout(_,b(M))}function E(M){return c=void 0,v&&r?m(M):(r=o=void 0,a)}function I(){c!==void 0&&clearTimeout(c),h=0,r=u=o=c=void 0}function k(){return c===void 0?a:E(Rv())}function A(){var M=Rv(),B=w(M);if(r=arguments,o=this,u=M,B){if(c===void 0)return C(u);if(g)return clearTimeout(c),c=setTimeout(_,e),m(u)}return c===void 0&&(c=setTimeout(_,e)),a}return A.cancel=I,A.flush=k,A}var aH=sH;const cH=wf(aH);function lH(){var t=(typeof global>"u"?"undefined":typeof global)=="object"&&global&&global.Object===Object&&global,e=typeof self=="object"&&self&&self.Object===Object&&self;return t||e}lH()||(global.Date=Date);function dH(t,e){var n;bT&&(wT(t)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof t)));var r=CT(t),o=(n=e==null?void 0:e.wait)!==null&&n!==void 0?n:1e3,i=D.useMemo(function(){return cH(function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return r.current.apply(r,L_([],R_(a),!1))},o,e)},[]);return cU(function(){i.cancel()}),{run:i,cancel:i.cancel,flush:i.flush}}function uH(t,e,n){var r=R_(D.useState({}),2),o=r[0],i=r[1],a=dH(function(){i({})},n).run;D.useEffect(function(){return a()},e),aU(t,[o])}const fH=D.forwardRef(({onChange:t},e)=>{const n=D.useRef(null),[r,o]=D.useState("");return D.useImperativeHandle(e,()=>({setValue:i=>{var a;o(i),(a=n.current)==null||a.focus()}})),uH(()=>{t==null||t(r)},[r],{wait:300}),d.jsxs(d.Fragment,{children:[d.jsx(nr,{ref:n,type:"text",placeholder:"Search files...",value:r,onChange:i=>o(i.target.value),className:"pr-8"}),r&&d.jsx("button",{onClick:()=>{var i;o(""),(i=n.current)==null||i.focus()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:d.jsx(iU,{className:"h-5 w-5"})})]})});function NT(t,e){return function(){return t.apply(e,arguments)}}const{toString:hH}=Object.prototype,{getPrototypeOf:Ec}=Object,{iterator:id,toStringTag:DT}=Symbol,Jf=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),sd=(t,e)=>{let n=t;const r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),Jf(n,e))return!0;n=Ec(n)}return!1},pH=(t,e)=>t!=null&&sd(t,e)?t[e]:void 0,Lv=(t=>e=>{const n=hH.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),so=t=>(t=t.toLowerCase(),e=>Lv(e)===t),Xf=t=>e=>typeof e===t,{isArray:sa}=Array,aa=Xf("undefined");function Ac(t){return t!==null&&!aa(t)&&t.constructor!==null&&!aa(t.constructor)&&Rr(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const MT=so("ArrayBuffer");function gH(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&MT(t.buffer),e}const mH=Xf("string"),Rr=Xf("function"),RT=Xf("number"),Ic=t=>t!==null&&typeof t=="object",vH=t=>t===!0||t===!1,Zf=t=>{if(!Ic(t))return!1;const e=Ec(t);return(e===null||e===Object.prototype||Ec(e)===null)&&!sd(t,DT)&&!sd(t,id)},yH=t=>{if(!Ic(t)||Ac(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},wH=so("Date"),bH=so("File"),CH=t=>!!(t&&typeof t.uri<"u"),xH=t=>t&&typeof t.getParts<"u",_H=so("Blob"),SH=so("FileList"),TH=so("Set"),EH=t=>Ic(t)&&Rr(t.pipe);function AH(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const LT=AH(),FT=typeof LT.FormData<"u"?LT.FormData:void 0,IH=t=>{if(!t)return!1;if(FT&&t instanceof FT)return!0;const e=Ec(t);if(!e||e===Object.prototype||!Rr(t.append))return!1;const n=Lv(t);return n==="formdata"||n==="object"&&Rr(t.toString)&&t.toString()==="[object FormData]"},kH=so("URLSearchParams"),[PH,OH,NH,DH]=["ReadableStream","Request","Response","Headers"].map(so),MH=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ad(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),sa(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{if(Ac(t))return;const i=n?Object.getOwnPropertyNames(t):Object.keys(t),a=i.length;let c;for(r=0;r<a;r++)c=i[r],e.call(null,t[c],c,t)}}function $T(t,e){if(Ac(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,o;for(;r-- >0;)if(o=n[r],e===o.toLowerCase())return o;return null}const ca=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,UT=t=>!aa(t)&&t!==ca;function Fv(...t){const{caseless:e,skipUndefined:n}=UT(this)&&this||{},r={},o=(i,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const c=e&&typeof a=="string"&&$T(r,a)||a,u=Jf(r,c)?r[c]:void 0;Zf(u)&&Zf(i)?r[c]=Fv(u,i):Zf(i)?r[c]=Fv({},i):sa(i)?r[c]=i.slice():(!n||!aa(i))&&(r[c]=i)};for(let i=0,a=t.length;i<a;i++){const c=t[i];if(!c||Ac(c)||(ad(c,o),typeof c!="object"||sa(c)))continue;const u=Object.getOwnPropertySymbols(c);for(let h=0;h<u.length;h++){const p=u[h];jH.call(c,p)&&o(c[p],p)}}return r}const RH=(t,e,n,{allOwnKeys:r}={})=>(ad(e,(o,i)=>{n&&Rr(o)?Object.defineProperty(t,i,{__proto__:null,value:NT(o,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,i,{__proto__:null,value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),LH=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),FH=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),Object.defineProperty(t.prototype,"constructor",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{__proto__:null,value:e.prototype}),n&&Object.assign(t.prototype,n)},$H=(t,e,n,r)=>{let o,i,a;const c={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)a=o[i],(!r||r(a,t,e))&&!c[a]&&(e[a]=t[a],c[a]=!0);t=n!==!1&&Ec(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},UH=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},HH=t=>{if(!t)return null;if(sa(t))return t;let e=t.length;if(!RT(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},BH=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ec(Uint8Array)),zH=(t,e)=>{const r=(t&&t[id]).call(t);let o;for(;(o=r.next())&&!o.done;){const i=o.value;e.call(t,i[0],i[1])}},VH=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},KH=so("HTMLFormElement"),GH=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),{propertyIsEnumerable:jH}=Object.prototype,WH=so("RegExp"),HT=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};ad(n,(o,i)=>{let a;(a=e(o,i,t))!==!1&&(r[i]=a||o)}),Object.defineProperties(t,r)},qH=t=>{HT(t,(e,n)=>{if(Rr(t)&&["arguments","caller","callee"].includes(n))return!1;const r=t[n];if(Rr(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},YH=(t,e)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return sa(t)?r(t):r(String(t).split(e)),n},QH=()=>{},JH=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function XH(t){return!!(t&&Rr(t.append)&&t[DT]==="FormData"&&t[id])}const ZH=t=>{const e=new WeakSet,n=r=>{if(Ic(r)){if(e.has(r))return;if(Ac(r))return r;if(!("toJSON"in r)){e.add(r);let o;if(TH(r)){o=[];for(const i of r){const a=n(i);!aa(a)&&o.push(a)}}else o=sa(r)?[]:{},ad(r,(i,a)=>{const c=n(i);!aa(c)&&(o[a]=c)});return e.delete(r),o}}return r};return n(t)},e3=so("AsyncFunction"),t3=t=>t&&(Ic(t)||Rr(t))&&Rr(t.then)&&Rr(t.catch),BT=((t,e)=>t?setImmediate:e?((n,r)=>(ca.addEventListener("message",({source:o,data:i})=>{o===ca&&i===n&&r.length&&r.shift()()},!1),o=>{r.push(o),ca.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Rr(ca.postMessage)),n3=typeof queueMicrotask<"u"?queueMicrotask.bind(ca):typeof process<"u"&&process.nextTick||BT,zT=t=>t!=null&&Rr(t[id]),q={isArray:sa,isArrayBuffer:MT,isBuffer:Ac,isFormData:IH,isArrayBufferView:gH,isString:mH,isNumber:RT,isBoolean:vH,isObject:Ic,isPlainObject:Zf,isEmptyObject:yH,isReadableStream:PH,isRequest:OH,isResponse:NH,isHeaders:DH,isUndefined:aa,isDate:wH,isFile:bH,isReactNativeBlob:CH,isReactNative:xH,isBlob:_H,isRegExp:WH,isFunction:Rr,isStream:EH,isURLSearchParams:kH,isTypedArray:BH,isFileList:SH,forEach:ad,merge:Fv,extend:RH,trim:MH,stripBOM:LH,inherits:FH,toFlatObject:$H,kindOf:Lv,kindOfTest:so,endsWith:UH,toArray:HH,forEachEntry:zH,matchAll:VH,isHTMLForm:KH,hasOwnProperty:Jf,hasOwnProp:Jf,hasOwnInPrototypeChain:sd,getSafeProp:pH,reduceDescriptors:HT,freezeMethods:qH,toObjectSet:YH,toCamelCase:GH,noop:QH,toFiniteNumber:JH,findKey:$T,global:ca,isContextDefined:UT,isSpecCompliantForm:XH,toJSONObject:ZH,isAsyncFn:e3,isThenable:t3,setImmediate:BT,asap:n3,isIterable:zT,isSafeIterable:t=>t!=null&&sd(t,id)&&zT(t)},r3=q.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),o3=t=>{const e={};let n,r,o;return t&&t.split(`
|
|
1031
|
+
`).forEach(function(a){o=a.indexOf(":"),n=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim();const c=q.hasOwnProp(e,n);!n||c&&q.hasOwnProp(r3,n)||(n==="set-cookie"?c?e[n].push(r):e[n]=[r]:e[n]=c?e[n]+", "+r:r)}),e};function i3(t){let e=0,n=t.length;for(;e<n;){const r=t.charCodeAt(e);if(r!==9&&r!==32)break;e+=1}for(;n>e;){const r=t.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return e===0&&n===t.length?t:t.slice(e,n)}const s3=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),a3=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function $v(t,e){return q.isArray(t)?t.map(n=>$v(n,e)):i3(String(t).replace(e,""))}const c3=t=>$v(t,s3),l3=t=>$v(t,a3);function VT(t){const e=Object.create(null);return q.forEach(t.toJSON(),(n,r)=>{e[r]=l3(n)}),e}const KT=Symbol("internals");function cd(t){return t&&String(t).trim().toLowerCase()}function eh(t){return t===!1||t==null?t:q.isArray(t)?t.map(eh):c3(String(t))}function d3(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const u3=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Uv(t){let e=0,n=t.length;for(;e<n;){const r=t.charCodeAt(e);if(r!==9&&r!==32)break;e+=1}for(;n>e;){const r=t.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return e===0&&n===t.length?t:t.slice(e,n)}function f3(t){const e=t.length-1;if(e<1||t.charCodeAt(0)!==34||t.charCodeAt(e)!==34)return t;let n="";for(let r=1;r<e;r++){const o=t.charCodeAt(r);if(o===34||o===92&&(r+=1,r>=e))return t;n+=t[r]}return n}function h3(t){const e=Object.create(null),n=String(t);let r=0,o=!1,i=!1;function a(c){const u=Uv(n.slice(r,c)),h=u.indexOf("=");if(h<1)return;const p=Uv(u.slice(0,h));if(!u3.test(p))return;const g=p.toLowerCase();if(g==="__proto__"||g==="constructor"||g==="prototype")return;const v=Uv(u.slice(h+1));e[g]=f3(v)}for(let c=0;c<n.length;c++){const u=n.charCodeAt(c);o?i?i=!1:u===92?i=!0:u===34&&(o=!1):u===34?o=!0:(u===44||u===59)&&(a(c),r=c+1)}return a(n.length),e}const p3=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Hv(t,e,n,r,o){if(q.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!q.isString(e)){if(q.isString(r))return e.indexOf(r)!==-1;if(q.isRegExp(r))return r.test(e)}}function g3(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function m3(t,e){const n=q.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{__proto__:null,value:function(o,i,a){return this[r].call(this,e,o,i,a)},configurable:!0})})}let or=class{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function i(c,u,h){const p=cd(u);if(!p)return;const g=q.findKey(o,p);(!g||o[g]===void 0||h===!0||h===void 0&&o[g]!==!1)&&(o[g||u]=eh(c))}const a=(c,u)=>q.forEach(c,(h,p)=>i(h,p,u));if(q.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(q.isString(e)&&(e=e.trim())&&!p3(e))a(o3(e),n);else if(q.isObject(e)&&q.isSafeIterable(e)){let c=Object.create(null),u,h;for(const p of e){if(!q.isArray(p))throw new TypeError("Object iterator must return a key-value pair");h=p[0],q.hasOwnProp(c,h)?(u=c[h],c[h]=q.isArray(u)?[...u,p[1]]:[u,p[1]]):c[h]=p[1]}a(c,n)}else e!=null&&i(n,e,r);return this}get(e,n){if(e=cd(e),e){const r=q.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return d3(o);if(q.isFunction(n))return n.call(this,o,r);if(q.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=cd(e),e){const r=q.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||Hv(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function i(a){if(a=cd(a),a){const c=q.findKey(r,a);c&&(!n||Hv(r,r[c],c,n))&&(delete r[c],o=!0)}}return q.isArray(e)?e.forEach(i):i(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!e||Hv(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){const n=this,r={};return q.forEach(this,(o,i)=>{const a=q.findKey(r,i);if(a){n[a]=eh(o),delete n[i];return}const c=e?g3(i):String(i).trim();c!==i&&delete n[i],n[c]=eh(o),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return q.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&q.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
|
1032
|
+
`)}getSetCookie(){const e=this.get("set-cookie");return q.isArray(e)?e:e==null||e===!1?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return h3(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[KT]=this[KT]={accessors:{}}).accessors,o=this.prototype;function i(a){const c=cd(a);r[c]||(m3(o,a),r[c]=!0)}return q.isArray(e)?e.forEach(i):i(e),this}};or.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),q.reduceDescriptors(or.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),q.freezeMethods(or);const th="[REDACTED ****]";function v3(t){if(q.hasOwnProp(t,"toJSON"))return!0;let e=Object.getPrototypeOf(t);for(;e&&e!==Object.prototype;){if(q.hasOwnProp(e,"toJSON"))return!0;e=Object.getPrototypeOf(e)}return!1}function y3(t,e){const n=new Set(e.map(i=>String(i).toLowerCase())),r=[],o=i=>{if(i===null||typeof i!="object"||q.isBuffer(i))return i;if(r.indexOf(i)!==-1)return;i instanceof or&&(i=i.toJSON()),r.push(i);let a;if(q.isArray(i))a=[],i.forEach((c,u)=>{const h=o(c);q.isUndefined(h)||(a[u]=h)});else{if(!q.isPlainObject(i)&&v3(i))return r.pop(),i;a=Object.create(null);for(const[c,u]of Object.entries(i)){const h=n.has(c.toLowerCase())?th:o(u);q.isUndefined(h)||(a[c]=h)}}return r.pop(),a};return o(t)}function GT(t){try{return String(t)}catch{return""}}function w3(t){return t.errors.map(n=>{try{return n&&n.message?GT(n.message):GT(n)}catch{return""}}).filter(Boolean).join("; ")||t.name||"AggregateError"}let Fe=class Hk extends Error{static from(e,n,r,o,i,a){let c=e.message;!c&&q.isArray(e.errors)&&e.errors.length&&(c=w3(e));const u=new Hk(c,n||e.code,r,o,i);return Object.defineProperty(u,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),u.name=e.name,e.status!=null&&u.status==null&&(u.status=e.status),a&&Object.assign(u,a),u}constructor(e,n,r,o,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),o&&(this.request=o),i&&(this.response=i,this.status=i.status)}toJSON(){const e=this.config,n=e&&q.hasOwnProp(e,"redact")?e.redact:void 0,r=q.isArray(n)&&n.length>0?y3(e,n):q.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};Fe.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Fe.ERR_BAD_OPTION="ERR_BAD_OPTION",Fe.ECONNABORTED="ECONNABORTED",Fe.ETIMEDOUT="ETIMEDOUT",Fe.ECONNREFUSED="ECONNREFUSED",Fe.ERR_NETWORK="ERR_NETWORK",Fe.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Fe.ERR_DEPRECATED="ERR_DEPRECATED",Fe.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Fe.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Fe.ERR_CANCELED="ERR_CANCELED",Fe.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Fe.ERR_INVALID_URL="ERR_INVALID_URL",Fe.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const b3=null,jT=100;function Bv(t){return q.isPlainObject(t)||q.isArray(t)}function WT(t){return q.endsWith(t,"[]")?t.slice(0,-2):t}function zv(t,e,n){return t?t.concat(e).map(function(o,i){return o=WT(o),!n&&i?"["+o+"]":o}).join(n?".":""):e}function C3(t){return q.isArray(t)&&!t.some(Bv)}const x3=q.toFlatObject(q,{},null,function(e){return/^is[A-Z]/.test(e)});function nh(t,e,n){if(!q.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=q.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,I){return!q.isUndefined(I[E])});const r=n.metaTokens,o=n.visitor||C,i=n.dots,a=n.indexes,c=n.Blob||typeof Blob<"u"&&Blob,u=n.maxDepth===void 0?jT:n.maxDepth,h=c&&q.isSpecCompliantForm(e),p=[];if(!q.isFunction(o))throw new TypeError("visitor must be a function");function g(_){if(_===null)return"";if(q.isDate(_))return _.toISOString();if(q.isBoolean(_))return _.toString();if(!h&&q.isBlob(_))throw new Fe("Blob is not supported. Use a Buffer instead.");if(q.isArrayBuffer(_)||q.isTypedArray(_)){if(h&&typeof c=="function")return new c([_]);throw new Fe("Blob is not supported. Use a Buffer instead.",Fe.ERR_NOT_SUPPORT)}return _}function v(_){if(_>u)throw new Fe("Object is too deeply nested ("+_+" levels). Max depth: "+u,Fe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function m(_,E){if(u===1/0)return JSON.stringify(_);const I=[];return JSON.stringify(_,function(A,M){if(!q.isObject(M))return M;for(;I.length&&I[I.length-1]!==this;)I.pop();return I.push(M),v(E+I.length-1),M})}function C(_,E,I){let k=_;if(q.isReactNative(e)&&q.isReactNativeBlob(_))return e.append(zv(I,E,i),g(_)),!1;if(_&&!I&&typeof _=="object"){if(q.endsWith(E,"{}"))E=r?E:E.slice(0,-2),_=m(_,1);else if(q.isArray(_)&&C3(_)||(q.isFileList(_)||q.endsWith(E,"[]"))&&(k=q.toArray(_)))return E=WT(E),k.forEach(function(M,B){!(q.isUndefined(M)||M===null)&&e.append(a===!0?zv([E],B,i):a===null?E:E+"[]",g(M))}),!1}return Bv(_)?!0:(e.append(zv(I,E,i),g(_)),!1)}const b=Object.assign(x3,{defaultVisitor:C,convertValue:g,isVisitable:Bv});function w(_,E,I=0){if(!q.isUndefined(_)){if(v(I),p.indexOf(_)!==-1)throw new Error("Circular reference detected in "+E.join("."));p.push(_),q.forEach(_,function(A,M){(!(q.isUndefined(A)||A===null)&&o.call(e,A,q.isString(M)?M.trim():M,E,b))===!0&&w(A,E?E.concat(M):[M],I+1)}),p.pop()}}if(!q.isObject(t))throw new TypeError("data must be an object");return w(t),e}function qT(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(t).replace(/[!'()~]|%20/g,function(r){return e[r]})}function Vv(t,e){this._pairs=[],t&&nh(t,this,e)}const YT=Vv.prototype;YT.append=function(e,n){this._pairs.push([e,n])},YT.toString=function(e){const n=e?r=>e.call(this,r,qT):qT;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function _3(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function QT(t,e,n){if(!e)return t;t=t||"";const r=q.isFunction(n)?{serialize:n}:n,o=q.getSafeProp(r,"encode")||_3,i=q.getSafeProp(r,"serialize");let a;if(i?a=i(e,r):a=q.isURLSearchParams(e)?e.toString():new Vv(e,r).toString(o),a){const c=t.indexOf("#");c!==-1&&(t=t.slice(0,c)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}class JT{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){q.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Kv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},S3={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Vv,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Gv=typeof window<"u"&&typeof document<"u",jv=typeof navigator=="object"&&navigator||void 0,T3=Gv&&(!jv||["ReactNative","NativeScript","NS"].indexOf(jv.product)<0),E3=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",A3=Gv&&window.location.href||"http://localhost",Bn={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Gv,hasStandardBrowserEnv:T3,hasStandardBrowserWebWorkerEnv:E3,navigator:jv,origin:A3},Symbol.toStringTag,{value:"Module"})),...S3};function I3(t,e){return nh(t,new Bn.classes.URLSearchParams,{visitor:function(n,r,o,i){return Bn.isNode&&q.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}const XT=jT;function ZT(t){if(t>XT)throw new Fe("FormData field is too deeply nested ("+t+" levels). Max depth: "+XT,Fe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function k3(t){const e=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;(r=n.exec(t))!==null;)ZT(e.length),e.push(r[0]==="[]"?"":r[1]||r[0]);return e}function P3(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],e[i]=t[i];return e}function eE(t){function e(n,r,o,i){ZT(i);let a=n[i++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),u=i>=n.length;return a=!a&&q.isArray(o)?o.length:a,u?(q.hasOwnProp(o,a)?o[a]=q.isArray(o[a])?o[a].concat(r):[o[a],r]:o[a]=r,!c):((!q.hasOwnProp(o,a)||!q.isObject(o[a]))&&(o[a]=[]),e(n,r,o[a],i)&&q.isArray(o[a])&&(o[a]=P3(o[a])),!c)}if(q.isFormData(t)&&q.isFunction(t.entries)){const n={};return q.forEachEntry(t,(r,o)=>{e(k3(r),o,n,0)}),n}return null}const kc=(t,e)=>t!=null&&q.hasOwnProp(t,e)?t[e]:void 0;function O3(t,e,n){if(q.isString(t))try{return(e||JSON.parse)(t),q.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const ld={transitional:Kv,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=q.isObject(e);if(i&&q.isHTMLForm(e)&&(e=new FormData(e)),q.isFormData(e))return o?JSON.stringify(eE(e)):e;if(q.isArrayBuffer(e)||q.isBuffer(e)||q.isStream(e)||q.isFile(e)||q.isBlob(e)||q.isReadableStream(e))return e;if(q.isArrayBufferView(e))return e.buffer;if(q.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(i){const u=kc(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return I3(e,u).toString();if((c=q.isFileList(e))||r.indexOf("multipart/form-data")>-1){const h=kc(this,"env"),p=h&&h.FormData;return nh(c?{"files[]":e}:e,p&&new p,u)}}return i||o?(n.setContentType("application/json",!1),O3(e)):e}],transformResponse:[function(e){const n=kc(this,"transitional")||ld.transitional,r=n&&n.forcedJSONParsing,o=kc(this,"responseType"),i=o==="json";if(q.isResponse(e)||q.isReadableStream(e))return e;if(e&&q.isString(e)&&(r&&!o||i)){const c=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e,kc(this,"parseReviver"))}catch(u){if(c)throw u.name==="SyntaxError"?Fe.from(u,Fe.ERR_BAD_RESPONSE,this,null,kc(this,"response")):u}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bn.classes.FormData,Blob:Bn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};q.forEach(["delete","get","head","post","put","patch","query"],t=>{ld.headers[t]={}});function Wv(t,e){const n=this||ld,r=e||n,o=or.from(r.headers);let i=r.data;return q.forEach(t,function(c){i=c.call(n,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function tE(t){return!!(t&&t.__CANCEL__)}let dd=class extends Fe{constructor(e,n,r){super(e??"canceled",Fe.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function nE(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Fe("Request failed with status code "+n.status,n.status>=400&&n.status<500?Fe.ERR_BAD_REQUEST:Fe.ERR_BAD_RESPONSE,n.config,n.request,n))}function N3(t){const e=/^([-+\w]{1,25}):(?:\/\/)?/.exec(t);return e&&e[1]||""}function D3(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,i=0,a;return e=e!==void 0?e:1e3,function(u){const h=Date.now(),p=r[i];a||(a=h),n[o]=u,r[o]=h;let g=i,v=0;for(;g!==o;)v+=n[g++],g=g%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),h-a<e)return;const m=p&&h-p;return m?Math.round(v*1e3/m):void 0}}function M3(t,e){let n=0,r=1e3/e,o,i;const a=(h,p=Date.now())=>{n=p,o=null,i&&(clearTimeout(i),i=null),t(...h)};return[(...h)=>{const p=Date.now(),g=p-n;g>=r?a(h,p):(o=h,i||(i=setTimeout(()=>{i=null,a(o)},r-g)))},()=>o&&a(o)]}const rh=(t,e,n=3)=>{let r=0;const o=D3(50,250);return M3(i=>{if(!i||typeof i.loaded!="number")return;const a=i.loaded,c=i.lengthComputable?i.total:void 0,u=Math.max(0,c!=null?Math.min(a,c):a),h=Math.max(0,u-r),p=o(h);r=Math.max(r,u);const g={loaded:u,total:c,progress:c?u/c:void 0,bytes:h,rate:p||void 0,estimated:p&&c?(c-u)/p:void 0,event:i,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(g)},n)},rE=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},oE=(t,e=q.asap)=>(...n)=>e(()=>t(...n)),R3=Bn.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Bn.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Bn.origin),Bn.navigator&&/(msie|trident)/i.test(Bn.navigator.userAgent)):()=>!0,L3=Bn.hasStandardBrowserEnv?{write(t,e,n,r,o,i,a){if(typeof document>"u")return;const c=[`${t}=${encodeURIComponent(e)}`];q.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),q.isString(r)&&c.push(`path=${r}`),q.isString(o)&&c.push(`domain=${o}`),i===!0&&c.push("secure"),q.isString(a)&&c.push(`SameSite=${a}`),document.cookie=c.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.split(";");for(let n=0;n<e.length;n++){const r=e[n].replace(/^\s+/,""),o=r.indexOf("=");if(o!==-1&&r.slice(0,o)===t)try{return decodeURIComponent(r.slice(o+1))}catch{return r.slice(o+1)}}return null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function F3(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function $3(t,e){if(!e)return t;let n=t.length;for(;n>0&&t.charCodeAt(n-1)===47;)n--;return t.slice(0,n)+"/"+e.replace(/^\/+/,"")}const U3=/^https?:(?!\/\/)/i,H3=/[\t\n\r]/g;function B3(t){let e=0;for(;e<t.length&&t.charCodeAt(e)<=32;)e++;return t.slice(e)}function z3(t){return B3(t).replace(H3,"")}function V3(t){return t&&t.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,n,r="")=>`${n}${r}${th}`)}function K3(t){const e=t.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${th}@`),n=e.indexOf("#"),o=(n===-1?e:e.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${th}`);return n===-1?o:`${o}#${V3(e.slice(n+1))}`}function iE(t,e){if(typeof t=="string"){const n=z3(t);if(U3.test(n))throw new Fe(`Invalid URL ${JSON.stringify(K3(n))}: missing "//" after protocol`,Fe.ERR_INVALID_URL,e)}}function sE(t,e,n,r){iE(e,r);let o=!F3(e);return t&&(o||n===!1)?(iE(t,r),$3(t,e)):e}const aE=t=>t instanceof or?{...t}:t,G3=t=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(t).concat(Object.getOwnPropertySymbols(t).filter(e=>Object.getOwnPropertyDescriptor(t,e).enumerable)):Object.keys(t);function la(t,e){t=t||{},e=e||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(p,g,v,m){return q.isPlainObject(p)&&q.isPlainObject(g)?q.merge.call({caseless:m},p,g):q.isPlainObject(g)?q.merge({},g):q.isArray(g)?g.slice():g}function o(p,g,v,m){if(q.isUndefined(g)){if(!q.isUndefined(p))return r(void 0,p,v,m)}else return r(p,g,v,m)}function i(p,g){if(!q.isUndefined(g))return r(void 0,g)}function a(p,g){if(q.isUndefined(g)){if(!q.isUndefined(p))return r(void 0,p)}else return r(void 0,g)}function c(p){const g=q.hasOwnProp(e,"transitional")?e.transitional:void 0;if(!q.isUndefined(g))if(q.isPlainObject(g)){if(q.hasOwnProp(g,p))return g[p]}else return;const v=q.hasOwnProp(t,"transitional")?t.transitional:void 0;if(q.isPlainObject(v)&&q.hasOwnProp(v,p))return v[p]}function u(p,g,v){if(q.hasOwnProp(e,v))return r(p,g);if(q.hasOwnProp(t,v))return r(void 0,p)}const h={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:u,headers:(p,g,v)=>o(aE(p),aE(g),v,!0)};return q.forEach(G3({...t,...e}),function(g){if(g==="__proto__"||g==="constructor"||g==="prototype")return;const v=q.hasOwnProp(h,g)?h[g]:o,m=q.hasOwnProp(t,g)?t[g]:void 0,C=q.hasOwnProp(e,g)?e[g]:void 0,b=v(m,C,g);q.isUndefined(b)&&v!==u||(n[g]=b)}),q.hasOwnProp(e,"validateStatus")&&q.isUndefined(e.validateStatus)&&c("validateStatusUndefinedResolves")===!1&&(q.hasOwnProp(t,"validateStatus")?n.validateStatus=r(void 0,t.validateStatus):delete n.validateStatus),n}const j3=["content-type","content-length"];function W3(t,e,n){if(n!=="content-only"){t.set(e);return}Object.entries(e||{}).forEach(([r,o])=>{j3.includes(r.toLowerCase())&&t.set(r,o)})}const q3=t=>encodeURIComponent(t).replace(/%([0-9A-F]{2})/gi,(e,n)=>String.fromCharCode(parseInt(n,16)));function cE(t){const e=la({},t),n=v=>q.hasOwnProp(e,v)?e[v]:void 0,r=n("data");let o=n("withXSRFToken");const i=n("xsrfHeaderName"),a=n("xsrfCookieName");let c=n("headers");const u=n("auth"),h=n("baseURL"),p=n("allowAbsoluteUrls"),g=n("url");if(e.headers=c=or.from(c),e.url=QT(sE(h,g,p,e),n("params"),n("paramsSerializer")),u){const v=q.getSafeProp(u,"username")||"",m=q.getSafeProp(u,"password")||"";try{c.set("Authorization","Basic "+btoa(v+":"+(m?q3(m):"")))}catch(C){throw Fe.from(C,Fe.ERR_BAD_OPTION_VALUE,t)}}if(q.isFormData(r)&&(Bn.hasStandardBrowserEnv||Bn.hasStandardBrowserWebWorkerEnv||q.isReactNative(r)?c.setContentType(void 0):q.isFunction(r.getHeaders)&&W3(c,r.getHeaders(),n("formDataHeaderPolicy"))),Bn.hasStandardBrowserEnv&&(q.isFunction(o)&&(o=o(e)),o===!0||o==null&&R3(e.url))){const m=i&&a&&L3.read(a);m&&c.set(i,m)}return e}const Y3=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=cE(t);let i=o.data;const a=or.from(o.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:h}=o,p,g,v,m,C;function b(){m&&m(),C&&C(),o.cancelToken&&o.cancelToken.unsubscribe(p),o.signal&&o.signal.removeEventListener("abort",p)}let w=new XMLHttpRequest;w.open(o.method.toUpperCase(),o.url,!0),w.timeout=o.timeout;function _(){if(!w)return;const I=or.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),A={data:!c||c==="text"||c==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:I,config:t,request:w};nE(function(B){n(B),b()},function(B){r(B),b()},A),w=null}"onloadend"in w?w.onloadend=_:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.startsWith("file:"))||setTimeout(_)},w.onabort=function(){w&&(r(new Fe("Request aborted",Fe.ECONNABORTED,t,w)),b(),w=null)},w.onerror=function(k){const A=k&&k.message?k.message:"Network Error",M=new Fe(A,Fe.ERR_NETWORK,t,w);M.event=k||null,r(M),b(),w=null},w.ontimeout=function(){let k=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const A=o.transitional||Kv;o.timeoutErrorMessage&&(k=o.timeoutErrorMessage),r(new Fe(k,A.clarifyTimeoutError?Fe.ETIMEDOUT:Fe.ECONNABORTED,t,w)),b(),w=null},i===void 0&&a.setContentType(null),"setRequestHeader"in w&&q.forEach(VT(a),function(k,A){w.setRequestHeader(A,k)}),q.isUndefined(o.withCredentials)||(w.withCredentials=!!o.withCredentials),c&&c!=="json"&&(w.responseType=o.responseType),h&&([v,C]=rh(h,!0),w.addEventListener("progress",v)),u&&w.upload&&([g,m]=rh(u),w.upload.addEventListener("progress",g),w.upload.addEventListener("loadend",m)),(o.cancelToken||o.signal)&&(p=I=>{w&&(r(!I||I.type?new dd(null,t,w):I),w.abort(),b(),w=null)},o.cancelToken&&o.cancelToken.subscribe(p),o.signal&&(o.signal.aborted?p():o.signal.addEventListener("abort",p)));const E=N3(o.url);if(E&&!Bn.protocols.includes(E)){r(new Fe("Unsupported protocol "+E+":",Fe.ERR_BAD_REQUEST,t)),b();return}w.send(i||null)})},Q3=(t,e)=>{if(t=t?t.filter(Boolean):[],!e&&!t.length)return;const n=new AbortController;let r=!1;const o=function(u){if(!r){r=!0,a();const h=u instanceof Error?u:this.reason;n.abort(h instanceof Fe?h:new dd(h instanceof Error?h.message:h))}};let i=e&&setTimeout(()=>{i=null,o(new Fe(`timeout of ${e}ms exceeded`,Fe.ETIMEDOUT))},e);const a=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),t=null)};t.forEach(u=>{if(!r){if(u.aborted){o.call(u);return}u.addEventListener("abort",o,{once:!0})}});const{signal:c}=n;return c.unsubscribe=()=>q.asap(a),c},J3=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,o;for(;r<n;)o=r+e,yield t.slice(r,o),r=o},X3=async function*(t,e){for await(const n of Z3(t))yield*J3(n,e)},Z3=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},lE=(t,e,n,r)=>{const o=X3(t,e);let i=0,a,c=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:h,value:p}=await o.next();if(h){c(),u.close();return}let g=p.byteLength;if(n){let v=i+=g;n(v)}u.enqueue(new Uint8Array(p))}catch(h){throw c(h),h}},cancel(u){return c(u),o.return()}},{highWaterMark:2})},dE=t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102,uE=(t,e,n)=>e+2<n&&dE(t.charCodeAt(e+1))&&dE(t.charCodeAt(e+2)),fE=t=>t<=57?t-48:(t&223)-55,e5=t=>t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t===43||t===47||t===45||t===95,t5=t=>t===9||t===10||t===12||t===13||t===32,n5=t=>{const e=Math.floor(t/4),n=t%4;return e*3+(n===2?1:n===3?2:0)},r5=t=>{const e=t.length;let n=0;return e>0&&t.charCodeAt(e-1)===61&&(n++,e>1&&t.charCodeAt(e-2)===61&&n++),Math.floor((e-n)*3/4)},o5=t=>{const e=t.length;let n=0,r=0,o=!1;for(let i=0;i<e;i++){let a=t.charCodeAt(i);if(a===37&&uE(t,i,e)&&(a=fE(t.charCodeAt(i+1))*16+fE(t.charCodeAt(i+2)),i+=2),!t5(a)){if(a===61){r++;continue}if(!e5(a)||r>0){o=!0;continue}n++}}return o||r>2||r>0&&(n+r)%4!==0||n%4===1?r5(t):n5(n)},i5=(t,e)=>{if(!t||typeof t!="string"||!t.startsWith("data:"))return 0;const n=t.indexOf(",");if(n<0)return 0;const r=t.slice(5,n),o=t.slice(n+1);if(/;base64/i.test(r))return e(o);let a=0;for(let c=0,u=o.length;c<u;c++){const h=o.charCodeAt(c);if(h===37&&uE(o,c,u))a+=1,c+=2;else if(h<128)a+=1;else if(h<2048)a+=2;else if(h>=55296&&h<=56319&&c+1<u){const p=o.charCodeAt(c+1);p>=56320&&p<=57343?(a+=4,c++):a+=3}else a+=3}return a};function s5(t){const e=typeof t=="string"?t.indexOf("#"):-1;return i5(e===-1?t:t.slice(0,e),o5)}const qv="1.19.0",hE=64*1024,{isFunction:oh}=q,a5=t=>encodeURIComponent(t).replace(/%([0-9A-F]{2})/gi,(e,n)=>String.fromCharCode(parseInt(n,16))),pE=t=>{if(!q.isString(t))return t;try{return decodeURIComponent(t)}catch{return t}},gE=(t,...e)=>{try{return!!t(...e)}catch{return!1}},c5=t=>{const e=t.indexOf("://");let n=t;return e!==-1&&(n=n.slice(e+3)),n.includes("@")||n.includes(":")},l5=t=>{const e=q.global!==void 0&&q.global!==null?q.global:globalThis,{ReadableStream:n,TextEncoder:r}=e;t=q.merge.call({skipUndefined:!0},{Request:e.Request,Response:e.Response},t);const{fetch:o,Request:i,Response:a}=t,c=o?oh(o):typeof fetch=="function",u=oh(i),h=oh(a);if(!c)return!1;const p=c&&oh(n),g=c&&(typeof r=="function"?(_=>E=>_.encode(E))(new r):async _=>new Uint8Array(await new i(_).arrayBuffer())),v=u&&p&&gE(()=>{let _=!1;const E=new i(Bn.origin,{body:new n,method:"POST",get duplex(){return _=!0,"half"}}),I=E.headers.has("Content-Type");return E.body!=null&&E.body.cancel(),_&&!I}),m=h&&p&&gE(()=>q.isReadableStream(new a("").body)),C={stream:m&&(_=>_.body)};c&&["text","arrayBuffer","blob","formData","stream"].forEach(_=>{!C[_]&&(C[_]=(E,I)=>{let k=E&&E[_];if(k)return k.call(E);throw new Fe(`Response type '${_}' is not supported`,Fe.ERR_NOT_SUPPORT,I)})});const b=async _=>{if(_==null)return 0;if(q.isBlob(_))return _.size;if(q.isSpecCompliantForm(_))return(await new i(Bn.origin,{method:"POST",body:_}).arrayBuffer()).byteLength;if(q.isArrayBufferView(_)||q.isArrayBuffer(_))return _.byteLength;if(q.isURLSearchParams(_)&&(_=_+""),q.isString(_))return(await g(_)).byteLength},w=async(_,E)=>{const I=q.toFiniteNumber(_.getContentLength());return I??b(E)};return async _=>{let{url:E,method:I,data:k,signal:A,cancelToken:M,timeout:B,onDownloadProgress:W,onUploadProgress:Y,responseType:z,headers:de,withCredentials:ne="same-origin",fetchOptions:ae,maxContentLength:Q,maxBodyLength:re}=cE(_);const j=q.isNumber(Q)&&Q>-1,se=q.isNumber(re)&&re>-1,ie=te=>q.hasOwnProp(_,te)?_[te]:void 0;let ce=o||fetch;z=z?(z+"").toLowerCase():"text";let $=Q3([A,M&&M.toAbortSignal()],B),Z=null;const me=$&&$.unsubscribe&&(()=>{$.unsubscribe()});let _e,Ee=null;const ke=()=>new Fe("Request body larger than maxBodyLength limit",Fe.ERR_BAD_REQUEST,_,Z);try{let te;const pe=ie("auth");if(pe){const ze=q.getSafeProp(pe,"username")||"",wt=q.getSafeProp(pe,"password")||"";te={username:ze,password:wt}}if(c5(E)){const ze=new URL(E,Bn.origin);if(!te&&(ze.username||ze.password)){const wt=pE(ze.username),vt=pE(ze.password);te={username:wt,password:vt}}(ze.username||ze.password)&&(ze.username="",ze.password="",E=ze.href)}if(te&&(de.delete("authorization"),de.set("Authorization","Basic "+btoa(a5((te.username||"")+":"+(te.password||""))))),j&&typeof E=="string"&&E.startsWith("data:")&&s5(E)>Q)throw new Fe("maxContentLength size of "+Q+" exceeded",Fe.ERR_BAD_RESPONSE,_,Z);if(se&&I!=="get"&&I!=="head"){const ze=await b(k);if(typeof ze=="number"&&isFinite(ze)&&(_e=ze,ze>re))throw ke()}const be=se&&(q.isReadableStream(k)||q.isStream(k)),Ie=(ze,wt,vt)=>lE(ze,hE,qt=>{if(se&&qt>re)throw Ee=ke();wt&&wt(qt)},vt);if(v&&I!=="get"&&I!=="head"&&(Y||be)){if(_e=_e??await w(de,k),_e!==0||be){let ze=new i(E,{method:"POST",body:k,duplex:"half"}),wt;if(q.isFormData(k)&&(wt=ze.headers.get("content-type"))&&de.setContentType(wt),ze.body){const[vt,qt]=Y&&rE(_e,rh(oE(Y)))||[];k=Ie(ze.body,vt,qt)}}}else if(be&&!u&&p&&I!=="get"&&I!=="head")k=Ie(k);else if(be&&u&&!v&&I!=="get"&&I!=="head")throw new Fe("Stream request bodies are not supported by the current fetch implementation",Fe.ERR_NOT_SUPPORT,_,Z);q.isString(ne)||(ne=ne?"include":"omit");const Pe=u&&"credentials"in i.prototype;if(q.isFormData(k)){const ze=de.getContentType();ze&&/^multipart\/form-data/i.test(ze)&&!/boundary=/i.test(ze)&&de.delete("content-type")}de.set("User-Agent","axios/"+qv,!1);const Me={...ae,signal:$,method:I.toUpperCase(),headers:VT(de.normalize()),body:k,duplex:"half",credentials:Pe?ne:void 0};Z=u&&new i(E,Me);let fe=await(u?ce(Z,ae):ce(E,Me));const He=or.from(fe.headers);if(j){const ze=q.toFiniteNumber(He.getContentLength());if(ze!=null&&ze>Q)throw new Fe("maxContentLength size of "+Q+" exceeded",Fe.ERR_BAD_RESPONSE,_,Z)}const Ut=m&&(z==="stream"||z==="response");if(m&&fe.body&&(W||j||Ut&&me)){const ze={};["status","statusText","headers"].forEach(At=>{ze[At]=fe[At]});const wt=q.toFiniteNumber(He.getContentLength()),[vt,qt]=W&&rE(wt,rh(oE(W),!0))||[];let An=0;const In=At=>{if(j&&(An=At,An>Q))throw new Fe("maxContentLength size of "+Q+" exceeded",Fe.ERR_BAD_RESPONSE,_,Z);vt&&vt(At)};fe=new a(lE(fe.body,hE,In,()=>{qt&&qt(),me&&me()}),ze)}z=z||"text";let ct=await C[q.findKey(C,z)||"text"](fe,_);if(j&&!m&&!Ut){let ze;if(ct!=null&&(typeof ct.byteLength=="number"?ze=ct.byteLength:typeof ct.size=="number"?ze=ct.size:typeof ct=="string"&&(ze=typeof r=="function"?new r().encode(ct).byteLength:ct.length)),typeof ze=="number"&&ze>Q)throw new Fe("maxContentLength size of "+Q+" exceeded",Fe.ERR_BAD_RESPONSE,_,Z)}return!Ut&&me&&me(),await new Promise((ze,wt)=>{nE(ze,wt,{data:ct,headers:or.from(fe.headers),status:fe.status,statusText:fe.statusText,config:_,request:Z})})}catch(te){if(me&&me(),$&&$.aborted&&$.reason instanceof Fe){const pe=$.reason;throw pe.config=_,Z&&(pe.request=Z),te!==pe&&Object.defineProperty(pe,"cause",{__proto__:null,value:te,writable:!0,enumerable:!1,configurable:!0}),pe}if(Ee)throw Z&&!Ee.request&&(Ee.request=Z),Ee;if(te instanceof Fe)throw Z&&!te.request&&(te.request=Z),te;if(te&&te.name==="TypeError"&&/Load failed|fetch/i.test(te.message)){const pe=new Fe("Network Error",Fe.ERR_NETWORK,_,Z,te&&te.response);throw Object.defineProperty(pe,"cause",{__proto__:null,value:te.cause||te,writable:!0,enumerable:!1,configurable:!0}),pe}throw Fe.from(te,te&&te.code,_,Z,te&&te.response)}}},d5=new Map,mE=t=>{let e=t&&t.env||{};const{fetch:n,Request:r,Response:o}=e,i=[r,o,n];let a=i.length,c=a,u,h,p=d5;for(;c--;)u=i[c],h=p.get(u),h===void 0&&p.set(u,h=c?new Map:l5(e)),p=h;return h};mE();const Yv={http:b3,xhr:Y3,fetch:{get:mE}};q.forEach(Yv,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{__proto__:null,value:e})}catch{}Object.defineProperty(t,"adapterName",{__proto__:null,value:e})}});const vE=t=>`- ${t}`,u5=t=>q.isFunction(t)||t===null||t===!1;function f5(t,e){t=q.isArray(t)?t:[t];const{length:n}=t;let r,o;const i={};for(let a=0;a<n;a++){r=t[a];let c;if(o=r,!u5(r)&&(o=Yv[(c=String(r)).toLowerCase()],o===void 0))throw new Fe(`Unknown adapter '${c}'`);if(o&&(q.isFunction(o)||(o=o.get(e))))break;i[c||"#"+a]=o}if(!o){const a=Object.entries(i).map(([u,h])=>`adapter ${u} `+(h===!1?"is not supported by the environment":"is not available in the build"));let c=n?a.length>1?`since :
|
|
1033
|
+
`+a.map(vE).join(`
|
|
1034
|
+
`):" "+vE(a[0]):"as no adapter specified";throw new Fe("There is no suitable adapter to dispatch the request "+c,Fe.ERR_NOT_SUPPORT)}return o}const yE={getAdapter:f5,adapters:Yv};function Qv(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new dd(null,t)}function Jv(t){return Qv(t),t.headers=or.from(t.headers),t.data=Wv.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),yE.getAdapter(t.adapter||ld.adapter,t)(t).then(function(r){Qv(t),t.response=r;try{r.data=Wv.call(t,t.transformResponse,r)}finally{delete t.response}return r.headers=or.from(r.headers),r},function(r){if(!tE(r)&&(Qv(t),r&&r.response)){t.response=r.response;try{r.response.data=Wv.call(t,t.transformResponse,r.response)}finally{delete t.response}r.response.headers=or.from(r.response.headers)}return Promise.reject(r)})}const ih={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ih[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const wE={};ih.transitional=function(e,n,r){function o(i,a){return"[Axios v"+qv+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,c)=>{if(e===!1)throw new Fe(o(a," has been removed"+(n?" in "+n:"")),Fe.ERR_DEPRECATED);return n&&!wE[a]&&(wE[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,a,c):!0}},ih.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function h5(t,e,n){if(typeof t!="object"||t===null)throw new Fe("options must be an object",Fe.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],a=Object.prototype.hasOwnProperty.call(e,i)?e[i]:void 0;if(a){const c=t[i],u=c===void 0||a(c,i,t);if(u!==!0)throw new Fe("option "+i+" must be "+u,Fe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Fe("Unknown option "+i,Fe.ERR_BAD_OPTION)}}const sh={assertOptions:h5,validators:ih},ir=sh.validators;let da=class{constructor(e){this.defaults=e||{},this.interceptors={request:new JT,response:new JT}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=(()=>{if(!o.stack)return"";const a=o.stack.indexOf(`
|
|
1035
|
+
`);return a===-1?"":o.stack.slice(a+1)})();try{if(!r.stack)r.stack=i;else if(i){const a=i.indexOf(`
|
|
1036
|
+
`),c=a===-1?-1:i.indexOf(`
|
|
1037
|
+
`,a+1),u=c===-1?"":i.slice(c+1);String(r.stack).endsWith(u)||(r.stack+=`
|
|
1038
|
+
`+i)}}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=la(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&sh.assertOptions(r,{silentJSONParsing:ir.transitional(ir.boolean),forcedJSONParsing:ir.transitional(ir.boolean),clarifyTimeoutError:ir.transitional(ir.boolean),legacyInterceptorReqResOrdering:ir.transitional(ir.boolean),advertiseZstdAcceptEncoding:ir.transitional(ir.boolean),validateStatusUndefinedResolves:ir.transitional(ir.boolean)},!1),o!=null&&(q.isFunction(o)?n.paramsSerializer={serialize:o}:sh.assertOptions(o,{encode:ir.function,serialize:ir.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),sh.assertOptions(n,{baseUrl:ir.spelling("baseURL"),withXsrfToken:ir.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&q.merge(i.common,i[n.method]);i&&q.forEach(["delete","get","head","post","put","patch","query","common"],C=>{delete i[C]}),n.headers=or.concat(a,i);const c=[];let u=!0;this.interceptors.request.forEach(function(b){if(typeof b.runWhen=="function"&&b.runWhen(n)===!1)return;u=u&&b.synchronous;const w=n.transitional||Kv;w&&w.legacyInterceptorReqResOrdering?c.unshift(b.fulfilled,b.rejected):c.push(b.fulfilled,b.rejected)});const h=[];this.interceptors.response.forEach(function(b){h.push(b.fulfilled,b.rejected)});let p,g=0,v;if(!u){const C=[Jv.bind(this),void 0];for(C.unshift(...c),C.push(...h),v=C.length,p=Promise.resolve(n);g<v;)p=p.then(C[g++],C[g++]);return p}v=c.length;let m=n;for(;g<v;){const C=c[g++],b=c[g++];try{m=C?C(m):m}catch(w){if(!b){p=Promise.reject(w);break}try{const _=b.call(this,w);q.isThenable(_)&&(p=Promise.resolve(_).then(()=>Jv.call(this,m)))}catch(_){p=Promise.reject(_)}break}}if(!p)try{p=Jv.call(this,m)}catch(C){p=Promise.reject(C)}for(g=0,v=h.length;g<v;)p=p.then(h[g++],h[g++]);return p}getUri(e){e=la(this.defaults,e);const n=sE(e.baseURL,e.url,e.allowAbsoluteUrls,e);return QT(n,e.params,e.paramsSerializer)}};q.forEach(["delete","get","head","options"],function(e){da.prototype[e]=function(n,r){return this.request(la(r||{},{method:e,url:n,data:r&&q.hasOwnProp(r,"data")?r.data:void 0}))}}),q.forEach(["post","put","patch","query"],function(e){function n(r){return function(i,a,c){return this.request(la(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}da.prototype[e]=n(),e!=="query"&&(da.prototype[e+"Form"]=n(!0))});let p5=class Bk{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(c=>{r.subscribe(c),i=c}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},e(function(i,a,c){r.reason||(r.reason=new dd(i,a,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new Bk(function(o){e=o}),cancel:e}}};function g5(t){return function(n){return t.apply(null,n)}}function m5(t){return q.isObject(t)&&t.isAxiosError===!0}const Xv={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Xv).forEach(([t,e])=>{Xv[e]=t});function bE(t){const e=new da(t),n=NT(da.prototype.request,e);return q.extend(n,da.prototype,e,{allOwnKeys:!0}),q.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return bE(la(t,o))},n}const $e=bE(ld);$e.Axios=da,$e.CanceledError=dd,$e.CancelToken=p5,$e.isCancel=tE,$e.VERSION=qv,$e.toFormData=nh,$e.AxiosError=Fe,$e.Cancel=$e.CanceledError,$e.all=function(e){return Promise.all(e)},$e.spread=g5,$e.isAxiosError=m5,$e.mergeConfig=la,$e.AxiosHeaders=or,$e.formToJSON=t=>eE(q.isHTMLForm(t)?new FormData(t):t),$e.getAdapter=yE.getAdapter,$e.HttpStatusCode=Xv,$e.default=$e;const{Axios:xW,AxiosError:_W,CanceledError:SW,isCancel:TW,CancelToken:EW,VERSION:AW,all:IW,Cancel:kW,isAxiosError:PW,spread:OW,toFormData:NW,AxiosHeaders:DW,HttpStatusCode:MW,formToJSON:RW,getAdapter:LW,mergeConfig:FW,create:$W}=$e,v5=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);var y5=t=>!v5.has(t&&t.code);const w5=wf(y5),Zv="axios-retry";function CE(t){const e=["ERR_CANCELED","ECONNABORTED"];return t.response||!t.code||e.includes(t.code)?!1:w5(t)}const xE=["get","head","options"],b5=xE.concat(["put","delete"]);function ey(t){return t.code!=="ECONNABORTED"&&(!t.response||t.response.status===429||t.response.status>=500&&t.response.status<=599)}function C5(t){var e;return(e=t.config)!=null&&e.method?ey(t)&&xE.indexOf(t.config.method)!==-1:!1}function _E(t){var e;return(e=t.config)!=null&&e.method?ey(t)&&b5.indexOf(t.config.method)!==-1:!1}function SE(t){return CE(t)||_E(t)}function ty(t=void 0){var r;const e=(r=t==null?void 0:t.response)==null?void 0:r.headers["retry-after"];if(!e)return 0;let n=(Number(e)||0)*1e3;return n===0&&(n=(new Date(e).valueOf()||0)-Date.now()),Math.max(0,n)}function x5(t=0,e=void 0){return Math.max(0,ty(e))}function _5(t=0,e=void 0,n=100){const r=2**t*n,o=Math.max(r,ty(e)),i=o*.2*Math.random();return o+i}function S5(t=100){return(e=0,n=void 0)=>{const r=e*t;return Math.max(r,ty(n))}}const T5={retries:3,retryCondition:SE,retryDelay:x5,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function E5(t,e){return{...T5,...e,...t[Zv]}}function TE(t,e,n=!1){const r=E5(t,e||{});return r.retryCount=r.retryCount||0,(!r.lastRequestTime||n)&&(r.lastRequestTime=Date.now()),t[Zv]=r,r}function A5(t,e){t.defaults.agent===e.agent&&delete e.agent,t.defaults.httpAgent===e.httpAgent&&delete e.httpAgent,t.defaults.httpsAgent===e.httpsAgent&&delete e.httpsAgent}async function I5(t,e){const{retries:n,retryCondition:r}=t,o=(t.retryCount||0)<n&&r(e);if(typeof o=="object")try{return await o!==!1}catch{return!1}return o}async function k5(t,e,n,r){var u;e.retryCount+=1;const{retryDelay:o,shouldResetTimeout:i,onRetry:a}=e,c=o(e.retryCount,n);if(A5(t,r),!i&&r.timeout&&e.lastRequestTime){const h=Date.now()-e.lastRequestTime,p=r.timeout-h-c;if(p<=0)return Promise.reject(n);r.timeout=p}return r.transformRequest=[h=>h],await a(e.retryCount,n,r),(u=r.signal)!=null&&u.aborted?Promise.resolve(t(r)):new Promise(h=>{var v;const p=()=>{clearTimeout(g),h(t(r))},g=setTimeout(()=>{var m;h(t(r)),(m=r.signal)!=null&&m.removeEventListener&&r.signal.removeEventListener("abort",p)},c);(v=r.signal)!=null&&v.addEventListener&&r.signal.addEventListener("abort",p,{once:!0})})}async function P5(t,e){t.retryCount>=t.retries&&await t.onMaxRetryTimesExceeded(e,t.retryCount)}const Oi=(t,e)=>{const n=t.interceptors.request.use(o=>{var i;return TE(o,e,!0),(i=o[Zv])!=null&&i.validateResponse&&(o.validateStatus=()=>!1),o}),r=t.interceptors.response.use(null,async o=>{var c;const{config:i}=o;if(!i)return Promise.reject(o);const a=TE(i,e);return o.response&&((c=a.validateResponse)!=null&&c.call(a,o.response))?o.response:await I5(a,o)?k5(t,a,o,i):(await P5(a,o),Promise.reject(o))});return{requestInterceptorId:n,responseInterceptorId:r}};Oi.isNetworkError=CE,Oi.isSafeRequestError=C5,Oi.isIdempotentRequestError=_E,Oi.isNetworkOrIdempotentRequestError=SE,Oi.exponentialDelay=_5,Oi.linearDelay=S5,Oi.isRetryableError=ey;function O5(){return"http://localhost:3003"}const ud=O5();$e.defaults.baseURL=ud,Oi($e,{retries:3,shouldResetTimeout:!0,retryCondition:t=>Oi.isRetryableError(t)&&t.config.method==="get"}),$e.interceptors.request.use(t=>{try{const e=localStorage.getItem("dataLogin");if(e){let n;try{n=JSON.parse(e)}catch(o){console.log("🚀 ~ axios.ts:27 ~ error:",o)}const r=n==null?void 0:n.user;r&&(t.headers["x-username"]=r.username||"unknown",t.headers["x-user-id"]=r.id||"")}}catch(e){console.error("Error adding user info to request headers:",e)}return t},t=>Promise.reject(t));var Eo=(t=>(t.VIEW_DOCUMENT="VIEW_DOCUMENT",t.DOWNLOAD_DOCUMENT="DOWNLOAD_DOCUMENT",t.EDIT_DOCUMENT="EDIT_DOCUMENT",t.OWNER_DOCUMENT="OWNER_DOCUMENT",t))(Eo||{});const N5=(t,e)=>{const[n,r]=D.useState([]),[o,i]=D.useState([]),[a,c]=D.useState([]),[u,h]=D.useState([]),{toast:p}=Zl(),[g,v]=D.useState(!1),[m,C]=D.useState(!1),b=D.useCallback(async(k,A,M)=>{if(!m){C(!0);try{const B=await $e.post(t+"/document-permission/grandted",{path:k,grandtedBy:A,data:M});return B.status===200&&(p({title:"Phân quyền tài liệu thành công."}),await I(k)),B}catch{return null}finally{C(!1)}}},[]),w=D.useCallback(async()=>{var k;try{return(k=(await $e.get(e+"admin/users/get-all",{params:{limit:1e4}})).data||[])==null?void 0:k.filter(W=>W.role!=="MASTER_ADMIN")}catch(A){return console.error("Error fetchAllUsers",A),[]}},[]),_=D.useCallback(async()=>{try{return(await $e.get(e+"admin/group-users")).data.filter(A=>`${A.groupname}`.toUpperCase()!=="MASTER_ADMIN").map(A=>{var M;return{...A,users:((M=A.users)==null?void 0:M.length)||0}})}catch(k){return console.error("Error fetchAllGroups",k),[]}},[]),E=D.useCallback(async k=>{try{const M=(await $e.get(t+"/document-permission/grandted",{params:{path:k}})).data;return{usersShared:(M==null?void 0:M.users)||[],groupsShared:(M==null?void 0:M.groups)||[]}}catch(A){return console.error("Error fetchShared",A),{usersShared:[],groupsShared:[]}}},[]),I=D.useCallback(async k=>{if(g)return;v(!0);let[A,M,{usersShared:B,groupsShared:W}]=await Promise.all([w(),_(),E(k)]);A=A==null?void 0:A.filter(Y=>!(B!=null&&B.find(z=>z.userId===Y.id))),M=M==null?void 0:M.filter(Y=>!(W!=null&&W.find(z=>z.groupname===Y.groupname))),Array.isArray(A)&&r(A),Array.isArray(M)&&i(M),Array.isArray(B)&&c(B),Array.isArray(W)&&h(W),v(!1)},[]);return{users:n,groups:o,sharedUsers:a,sharedGroups:u,setUsers:r,setGroups:i,setSharedUsers:c,setSharedGroups:h,fetchData:I,loading:g,postGranted:b,loadingGrandted:m}},D5=({failureReasons:t,onNavigateToFile:e})=>{const n=u=>{if(e){const h=u.replace("s3://cts-llm-docs-bucket/","");e(h)}},r=u=>{const h=[];return u.forEach(p=>{try{JSON.parse(p).forEach(v=>{const m=v.match(/\[Files: ([^\]]+)\]/),C=v.match(/^([^[]+)/);if(m&&C&&m[1]&&C[1]){const b=m[1].split(", ").map(E=>E.trim()),w=C[1].trim().replace("Encountered error: ","");let _="unknown";w.includes("invalid metadata attributes")||w.includes("metadata quota")?_="metadata":w.includes("No metadata was provided")||w.includes("metadata file")?_="missing_metadata":w.includes("file size")||w.includes("exceeds")||w.includes("50 MB")?_="file_size":w.includes("format not supported")||w.includes("unsupported format")||w.includes("file type")?_="file_format":w.includes("embedding failed")||w.includes("EMBEDDING_FAILED")?_="embedding_failed":w.includes("indexing failed")||w.includes("INDEXING_FAILED")?_="indexing_failed":w.includes("access denied")||w.includes("AccessDeniedException")||w.includes("permission")?_="access_denied":(w.includes("quota")||w.includes("limit")||w.includes("ServiceQuotaExceededException"))&&(_="quota_exceeded"),h.push({errorMessage:w,files:b,errorType:_})}})}catch{h.push({errorMessage:p,files:[],errorType:"unknown"})}}),h},o=u=>{switch(u){case"metadata":return d.jsx(fs,{className:"h-4 w-4 text-orange-500"});case"missing_metadata":return d.jsx($m,{className:"h-4 w-4 text-red-500"});case"file_size":return d.jsx(fs,{className:"h-4 w-4 text-yellow-500"});case"file_format":return d.jsx($m,{className:"h-4 w-4 text-purple-500"});case"embedding_failed":return d.jsx(fs,{className:"h-4 w-4 text-red-600"});case"indexing_failed":return d.jsx(fs,{className:"h-4 w-4 text-red-600"});case"access_denied":return d.jsx(fs,{className:"h-4 w-4 text-red-700"});case"quota_exceeded":return d.jsx(fs,{className:"h-4 w-4 text-orange-600"});default:return d.jsx(fs,{className:"h-4 w-4 text-red-500"})}},i=u=>{switch(u){case"metadata":return"border-orange-200 bg-orange-50";case"missing_metadata":return"border-red-200 bg-red-50";case"file_size":return"border-yellow-200 bg-yellow-50";case"file_format":return"border-purple-200 bg-purple-50";case"embedding_failed":return"border-red-300 bg-red-100";case"indexing_failed":return"border-red-300 bg-red-100";case"access_denied":return"border-red-400 bg-red-100";case"quota_exceeded":return"border-orange-300 bg-orange-100";default:return"border-red-200 bg-red-50"}},a=u=>{switch(u){case"metadata":return"text-orange-800";case"missing_metadata":return"text-red-800";case"file_size":return"text-yellow-800";case"file_format":return"text-purple-800";case"embedding_failed":return"text-red-900";case"indexing_failed":return"text-red-900";case"access_denied":return"text-red-900";case"quota_exceeded":return"text-orange-900";default:return"text-red-800"}},c=r(t);return c.length===0?null:d.jsxs("div",{className:"border-t pt-2",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(fs,{className:"h-4 w-4 text-red-500"}),d.jsxs("p",{className:"text-red-600 font-medium",children:["Các file lỗi (",c.reduce((u,h)=>u+h.files.length,0)," file)"]})]}),d.jsx("div",{className:"space-y-3 max-h-80 overflow-y-auto",children:c.map((u,h)=>d.jsxs("div",{className:`p-3 rounded-lg border ${i(u.errorType)}`,children:[d.jsx("div",{className:"flex items-start justify-between",children:d.jsxs("div",{className:"flex items-start gap-2 flex-1",children:[o(u.errorType),d.jsxs("div",{className:"flex-1",children:[d.jsx("p",{className:`font-medium text-sm ${a(u.errorType)}`,children:u.errorMessage}),u.files.length>0&&d.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:[u.files.length," file bị ảnh hưởng"]})]})]})}),u.files.length>0&&d.jsxs("div",{className:"mt-3 pt-2 border-t border-gray-200",children:[d.jsx("p",{className:"text-xs font-medium text-gray-700 mb-2",children:"Danh sách file lỗi:"}),d.jsx("div",{className:"max-h-32 overflow-y-auto space-y-1",children:u.files.map((p,g)=>d.jsxs("div",{className:"flex items-center gap-2 text-xs p-2 bg-white/50 rounded hover:bg-white/80 transition-colors",children:[d.jsx($m,{className:"h-3 w-3 text-red-400 flex-shrink-0"}),e?d.jsxs("button",{onClick:()=>n(p),className:"text-blue-600 hover:text-blue-800 underline break-all font-mono text-left flex-1 flex items-center gap-1",title:"Nhấp để điều hướng đến file",children:[d.jsx("span",{children:p.replace("s3://cts-llm-docs-bucket/","")}),d.jsx(AR,{className:"h-3 w-3 flex-shrink-0"})]}):d.jsx("span",{className:"text-gray-700 break-all font-mono",children:p.replace("s3://cts-llm-docs-bucket/","")})]},g))})]})]},h))})]})};var ny={exports:{}},ah={exports:{}},Lt={};/** @license React v16.13.1
|
|
1039
|
+
* react-is.production.min.js
|
|
1040
|
+
*
|
|
1041
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1042
|
+
*
|
|
1043
|
+
* This source code is licensed under the MIT license found in the
|
|
1044
|
+
* LICENSE file in the root directory of this source tree.
|
|
1045
|
+
*/var EE;function M5(){if(EE)return Lt;EE=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,c=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,h=t?Symbol.for("react.concurrent_mode"):60111,p=t?Symbol.for("react.forward_ref"):60112,g=t?Symbol.for("react.suspense"):60113,v=t?Symbol.for("react.suspense_list"):60120,m=t?Symbol.for("react.memo"):60115,C=t?Symbol.for("react.lazy"):60116,b=t?Symbol.for("react.block"):60121,w=t?Symbol.for("react.fundamental"):60117,_=t?Symbol.for("react.responder"):60118,E=t?Symbol.for("react.scope"):60119;function I(A){if(typeof A=="object"&&A!==null){var M=A.$$typeof;switch(M){case e:switch(A=A.type,A){case u:case h:case r:case i:case o:case g:return A;default:switch(A=A&&A.$$typeof,A){case c:case p:case C:case m:case a:return A;default:return M}}case n:return M}}}function k(A){return I(A)===h}return Lt.AsyncMode=u,Lt.ConcurrentMode=h,Lt.ContextConsumer=c,Lt.ContextProvider=a,Lt.Element=e,Lt.ForwardRef=p,Lt.Fragment=r,Lt.Lazy=C,Lt.Memo=m,Lt.Portal=n,Lt.Profiler=i,Lt.StrictMode=o,Lt.Suspense=g,Lt.isAsyncMode=function(A){return k(A)||I(A)===u},Lt.isConcurrentMode=k,Lt.isContextConsumer=function(A){return I(A)===c},Lt.isContextProvider=function(A){return I(A)===a},Lt.isElement=function(A){return typeof A=="object"&&A!==null&&A.$$typeof===e},Lt.isForwardRef=function(A){return I(A)===p},Lt.isFragment=function(A){return I(A)===r},Lt.isLazy=function(A){return I(A)===C},Lt.isMemo=function(A){return I(A)===m},Lt.isPortal=function(A){return I(A)===n},Lt.isProfiler=function(A){return I(A)===i},Lt.isStrictMode=function(A){return I(A)===o},Lt.isSuspense=function(A){return I(A)===g},Lt.isValidElementType=function(A){return typeof A=="string"||typeof A=="function"||A===r||A===h||A===i||A===o||A===g||A===v||typeof A=="object"&&A!==null&&(A.$$typeof===C||A.$$typeof===m||A.$$typeof===a||A.$$typeof===c||A.$$typeof===p||A.$$typeof===w||A.$$typeof===_||A.$$typeof===E||A.$$typeof===b)},Lt.typeOf=I,Lt}var Ft={};/** @license React v16.13.1
|
|
1046
|
+
* react-is.development.js
|
|
1047
|
+
*
|
|
1048
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1049
|
+
*
|
|
1050
|
+
* This source code is licensed under the MIT license found in the
|
|
1051
|
+
* LICENSE file in the root directory of this source tree.
|
|
1052
|
+
*/var AE;function R5(){return AE||(AE=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,c=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,h=t?Symbol.for("react.concurrent_mode"):60111,p=t?Symbol.for("react.forward_ref"):60112,g=t?Symbol.for("react.suspense"):60113,v=t?Symbol.for("react.suspense_list"):60120,m=t?Symbol.for("react.memo"):60115,C=t?Symbol.for("react.lazy"):60116,b=t?Symbol.for("react.block"):60121,w=t?Symbol.for("react.fundamental"):60117,_=t?Symbol.for("react.responder"):60118,E=t?Symbol.for("react.scope"):60119;function I(fe){return typeof fe=="string"||typeof fe=="function"||fe===r||fe===h||fe===i||fe===o||fe===g||fe===v||typeof fe=="object"&&fe!==null&&(fe.$$typeof===C||fe.$$typeof===m||fe.$$typeof===a||fe.$$typeof===c||fe.$$typeof===p||fe.$$typeof===w||fe.$$typeof===_||fe.$$typeof===E||fe.$$typeof===b)}function k(fe){if(typeof fe=="object"&&fe!==null){var He=fe.$$typeof;switch(He){case e:var Ut=fe.type;switch(Ut){case u:case h:case r:case i:case o:case g:return Ut;default:var ct=Ut&&Ut.$$typeof;switch(ct){case c:case p:case C:case m:case a:return ct;default:return He}}case n:return He}}}var A=u,M=h,B=c,W=a,Y=e,z=p,de=r,ne=C,ae=m,Q=n,re=i,j=o,se=g,ie=!1;function ce(fe){return ie||(ie=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),$(fe)||k(fe)===u}function $(fe){return k(fe)===h}function Z(fe){return k(fe)===c}function me(fe){return k(fe)===a}function _e(fe){return typeof fe=="object"&&fe!==null&&fe.$$typeof===e}function Ee(fe){return k(fe)===p}function ke(fe){return k(fe)===r}function te(fe){return k(fe)===C}function pe(fe){return k(fe)===m}function be(fe){return k(fe)===n}function Ie(fe){return k(fe)===i}function Pe(fe){return k(fe)===o}function Me(fe){return k(fe)===g}Ft.AsyncMode=A,Ft.ConcurrentMode=M,Ft.ContextConsumer=B,Ft.ContextProvider=W,Ft.Element=Y,Ft.ForwardRef=z,Ft.Fragment=de,Ft.Lazy=ne,Ft.Memo=ae,Ft.Portal=Q,Ft.Profiler=re,Ft.StrictMode=j,Ft.Suspense=se,Ft.isAsyncMode=ce,Ft.isConcurrentMode=$,Ft.isContextConsumer=Z,Ft.isContextProvider=me,Ft.isElement=_e,Ft.isForwardRef=Ee,Ft.isFragment=ke,Ft.isLazy=te,Ft.isMemo=pe,Ft.isPortal=be,Ft.isProfiler=Ie,Ft.isStrictMode=Pe,Ft.isSuspense=Me,Ft.isValidElementType=I,Ft.typeOf=k}()),Ft}var IE;function kE(){return IE||(IE=1,process.env.NODE_ENV==="production"?ah.exports=M5():ah.exports=R5()),ah.exports}/*
|
|
1053
|
+
object-assign
|
|
1054
|
+
(c) Sindre Sorhus
|
|
1055
|
+
@license MIT
|
|
1056
|
+
*/var ry,PE;function L5(){if(PE)return ry;PE=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var a={},c=0;c<10;c++)a["_"+String.fromCharCode(c)]=c;var u=Object.getOwnPropertyNames(a).map(function(p){return a[p]});if(u.join("")!=="0123456789")return!1;var h={};return"abcdefghijklmnopqrst".split("").forEach(function(p){h[p]=p}),Object.keys(Object.assign({},h)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ry=o()?Object.assign:function(i,a){for(var c,u=r(i),h,p=1;p<arguments.length;p++){c=Object(arguments[p]);for(var g in c)e.call(c,g)&&(u[g]=c[g]);if(t){h=t(c);for(var v=0;v<h.length;v++)n.call(c,h[v])&&(u[h[v]]=c[h[v]])}}return u},ry}var oy,OE;function iy(){if(OE)return oy;OE=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return oy=t,oy}var sy,NE;function DE(){return NE||(NE=1,sy=Function.call.bind(Object.prototype.hasOwnProperty)),sy}var ay,ME;function F5(){if(ME)return ay;ME=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=iy(),n={},r=DE();t=function(i){var a="Warning: "+i;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function o(i,a,c,u,h){if(process.env.NODE_ENV!=="production"){for(var p in i)if(r(i,p)){var g;try{if(typeof i[p]!="function"){var v=Error((u||"React class")+": "+c+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw v.name="Invariant Violation",v}g=i[p](a,p,u,c,null,e)}catch(C){g=C}if(g&&!(g instanceof Error)&&t((u||"React class")+": type specification of "+c+" `"+p+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof g+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),g instanceof Error&&!(g.message in n)){n[g.message]=!0;var m=h?h():"";t("Failed "+c+" type: "+g.message+(m??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},ay=o,ay}var cy,RE;function $5(){if(RE)return cy;RE=1;var t=kE(),e=L5(),n=iy(),r=DE(),o=F5(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(c){var u="Warning: "+c;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function a(){return null}return cy=function(c,u){var h=typeof Symbol=="function"&&Symbol.iterator,p="@@iterator";function g($){var Z=$&&(h&&$[h]||$[p]);if(typeof Z=="function")return Z}var v="<<anonymous>>",m={array:_("array"),bigint:_("bigint"),bool:_("boolean"),func:_("function"),number:_("number"),object:_("object"),string:_("string"),symbol:_("symbol"),any:E(),arrayOf:I,element:k(),elementType:A(),instanceOf:M,node:z(),objectOf:W,oneOf:B,oneOfType:Y,shape:ne,exact:ae};function C($,Z){return $===Z?$!==0||1/$===1/Z:$!==$&&Z!==Z}function b($,Z){this.message=$,this.data=Z&&typeof Z=="object"?Z:{},this.stack=""}b.prototype=Error.prototype;function w($){if(process.env.NODE_ENV!=="production")var Z={},me=0;function _e(ke,te,pe,be,Ie,Pe,Me){if(be=be||v,Pe=Pe||pe,Me!==n){if(u){var fe=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw fe.name="Invariant Violation",fe}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var He=be+":"+pe;!Z[He]&&me<3&&(i("You are manually calling a React.PropTypes validation function for the `"+Pe+"` prop on `"+be+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),Z[He]=!0,me++)}}return te[pe]==null?ke?te[pe]===null?new b("The "+Ie+" `"+Pe+"` is marked as required "+("in `"+be+"`, but its value is `null`.")):new b("The "+Ie+" `"+Pe+"` is marked as required in "+("`"+be+"`, but its value is `undefined`.")):null:$(te,pe,be,Ie,Pe)}var Ee=_e.bind(null,!1);return Ee.isRequired=_e.bind(null,!0),Ee}function _($){function Z(me,_e,Ee,ke,te,pe){var be=me[_e],Ie=j(be);if(Ie!==$){var Pe=se(be);return new b("Invalid "+ke+" `"+te+"` of type "+("`"+Pe+"` supplied to `"+Ee+"`, expected ")+("`"+$+"`."),{expectedType:$})}return null}return w(Z)}function E(){return w(a)}function I($){function Z(me,_e,Ee,ke,te){if(typeof $!="function")return new b("Property `"+te+"` of component `"+Ee+"` has invalid PropType notation inside arrayOf.");var pe=me[_e];if(!Array.isArray(pe)){var be=j(pe);return new b("Invalid "+ke+" `"+te+"` of type "+("`"+be+"` supplied to `"+Ee+"`, expected an array."))}for(var Ie=0;Ie<pe.length;Ie++){var Pe=$(pe,Ie,Ee,ke,te+"["+Ie+"]",n);if(Pe instanceof Error)return Pe}return null}return w(Z)}function k(){function $(Z,me,_e,Ee,ke){var te=Z[me];if(!c(te)){var pe=j(te);return new b("Invalid "+Ee+" `"+ke+"` of type "+("`"+pe+"` supplied to `"+_e+"`, expected a single ReactElement."))}return null}return w($)}function A(){function $(Z,me,_e,Ee,ke){var te=Z[me];if(!t.isValidElementType(te)){var pe=j(te);return new b("Invalid "+Ee+" `"+ke+"` of type "+("`"+pe+"` supplied to `"+_e+"`, expected a single ReactElement type."))}return null}return w($)}function M($){function Z(me,_e,Ee,ke,te){if(!(me[_e]instanceof $)){var pe=$.name||v,be=ce(me[_e]);return new b("Invalid "+ke+" `"+te+"` of type "+("`"+be+"` supplied to `"+Ee+"`, expected ")+("instance of `"+pe+"`."))}return null}return w(Z)}function B($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),a;function Z(me,_e,Ee,ke,te){for(var pe=me[_e],be=0;be<$.length;be++)if(C(pe,$[be]))return null;var Ie=JSON.stringify($,function(Me,fe){var He=se(fe);return He==="symbol"?String(fe):fe});return new b("Invalid "+ke+" `"+te+"` of value `"+String(pe)+"` "+("supplied to `"+Ee+"`, expected one of "+Ie+"."))}return w(Z)}function W($){function Z(me,_e,Ee,ke,te){if(typeof $!="function")return new b("Property `"+te+"` of component `"+Ee+"` has invalid PropType notation inside objectOf.");var pe=me[_e],be=j(pe);if(be!=="object")return new b("Invalid "+ke+" `"+te+"` of type "+("`"+be+"` supplied to `"+Ee+"`, expected an object."));for(var Ie in pe)if(r(pe,Ie)){var Pe=$(pe,Ie,Ee,ke,te+"."+Ie,n);if(Pe instanceof Error)return Pe}return null}return w(Z)}function Y($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var Z=0;Z<$.length;Z++){var me=$[Z];if(typeof me!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ie(me)+" at index "+Z+"."),a}function _e(Ee,ke,te,pe,be){for(var Ie=[],Pe=0;Pe<$.length;Pe++){var Me=$[Pe],fe=Me(Ee,ke,te,pe,be,n);if(fe==null)return null;fe.data&&r(fe.data,"expectedType")&&Ie.push(fe.data.expectedType)}var He=Ie.length>0?", expected one of type ["+Ie.join(", ")+"]":"";return new b("Invalid "+pe+" `"+be+"` supplied to "+("`"+te+"`"+He+"."))}return w(_e)}function z(){function $(Z,me,_e,Ee,ke){return Q(Z[me])?null:new b("Invalid "+Ee+" `"+ke+"` supplied to "+("`"+_e+"`, expected a ReactNode."))}return w($)}function de($,Z,me,_e,Ee){return new b(($||"React class")+": "+Z+" type `"+me+"."+_e+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+Ee+"`.")}function ne($){function Z(me,_e,Ee,ke,te){var pe=me[_e],be=j(pe);if(be!=="object")return new b("Invalid "+ke+" `"+te+"` of type `"+be+"` "+("supplied to `"+Ee+"`, expected `object`."));for(var Ie in $){var Pe=$[Ie];if(typeof Pe!="function")return de(Ee,ke,te,Ie,se(Pe));var Me=Pe(pe,Ie,Ee,ke,te+"."+Ie,n);if(Me)return Me}return null}return w(Z)}function ae($){function Z(me,_e,Ee,ke,te){var pe=me[_e],be=j(pe);if(be!=="object")return new b("Invalid "+ke+" `"+te+"` of type `"+be+"` "+("supplied to `"+Ee+"`, expected `object`."));var Ie=e({},me[_e],$);for(var Pe in Ie){var Me=$[Pe];if(r($,Pe)&&typeof Me!="function")return de(Ee,ke,te,Pe,se(Me));if(!Me)return new b("Invalid "+ke+" `"+te+"` key `"+Pe+"` supplied to `"+Ee+"`.\nBad object: "+JSON.stringify(me[_e],null," ")+`
|
|
1057
|
+
Valid keys: `+JSON.stringify(Object.keys($),null," "));var fe=Me(pe,Pe,Ee,ke,te+"."+Pe,n);if(fe)return fe}return null}return w(Z)}function Q($){switch(typeof $){case"number":case"string":case"undefined":return!0;case"boolean":return!$;case"object":if(Array.isArray($))return $.every(Q);if($===null||c($))return!0;var Z=g($);if(Z){var me=Z.call($),_e;if(Z!==$.entries){for(;!(_e=me.next()).done;)if(!Q(_e.value))return!1}else for(;!(_e=me.next()).done;){var Ee=_e.value;if(Ee&&!Q(Ee[1]))return!1}}else return!1;return!0;default:return!1}}function re($,Z){return $==="symbol"?!0:Z?Z["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Z instanceof Symbol:!1}function j($){var Z=typeof $;return Array.isArray($)?"array":$ instanceof RegExp?"object":re(Z,$)?"symbol":Z}function se($){if(typeof $>"u"||$===null)return""+$;var Z=j($);if(Z==="object"){if($ instanceof Date)return"date";if($ instanceof RegExp)return"regexp"}return Z}function ie($){var Z=se($);switch(Z){case"array":case"object":return"an "+Z;case"boolean":case"date":case"regexp":return"a "+Z;default:return Z}}function ce($){return!$.constructor||!$.constructor.name?v:$.constructor.name}return m.checkPropTypes=o,m.resetWarningCache=o.resetWarningCache,m.PropTypes=m,m},cy}var ly,LE;function U5(){if(LE)return ly;LE=1;var t=iy();function e(){}function n(){}return n.resetWarningCache=e,ly=function(){function r(a,c,u,h,p,g){if(g!==t){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:e};return i.PropTypes=i,i},ly}if(process.env.NODE_ENV!=="production"){var H5=kE(),B5=!0;ny.exports=$5()(H5.isElement,B5)}else ny.exports=U5()();var z5=ny.exports;const Jt=wf(z5),V5=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function Pc(t,e,n){const r=K5(t),{webkitRelativePath:o}=t,i=typeof e=="string"?e:typeof o=="string"&&o.length>0?o:`./${t.name}`;return typeof r.path!="string"&&FE(r,"path",i),FE(r,"relativePath",i),r}function K5(t){const{name:e}=t;if(e&&e.lastIndexOf(".")!==-1&&!t.type){const r=e.split(".").pop().toLowerCase(),o=V5.get(r);o&&Object.defineProperty(t,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return t}function FE(t,e,n){Object.defineProperty(t,e,{value:n,writable:!1,configurable:!1,enumerable:!0})}const G5=[".DS_Store","Thumbs.db"];function j5(t){return Qs(this,void 0,void 0,function*(){return ch(t)&&W5(t.dataTransfer)?J5(t.dataTransfer,t.type):q5(t)?Y5(t):Array.isArray(t)&&t.every(e=>"getFile"in e&&typeof e.getFile=="function")?Q5(t):[]})}function W5(t){return ch(t)}function q5(t){return ch(t)&&ch(t.target)}function ch(t){return typeof t=="object"&&t!==null}function Y5(t){return dy(t.target.files).map(e=>Pc(e))}function Q5(t){return Qs(this,void 0,void 0,function*(){return(yield Promise.all(t.map(n=>n.getFile()))).map(n=>Pc(n))})}function J5(t,e){return Qs(this,void 0,void 0,function*(){if(t.items){const n=dy(t.items).filter(o=>o.kind==="file");if(e!=="drop")return n;const r=yield Promise.all(n.map(X5));return $E(UE(r))}return $E(dy(t.files).map(n=>Pc(n)))})}function $E(t){return t.filter(e=>G5.indexOf(e.name)===-1)}function dy(t){if(t===null)return[];const e=[];for(let n=0;n<t.length;n++){const r=t[n];e.push(r)}return e}function X5(t){if(typeof t.webkitGetAsEntry!="function")return HE(t);const e=t.webkitGetAsEntry();return e&&e.isDirectory?BE(e):HE(t,e)}function UE(t){return t.reduce((e,n)=>[...e,...Array.isArray(n)?UE(n):[n]],[])}function HE(t,e){return Qs(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof t.getAsFileSystemHandle=="function"){const i=yield t.getAsFileSystemHandle();if(i===null)throw new Error(`${t} is not a File`);if(i!==void 0){const a=yield i.getFile();return a.handle=i,Pc(a)}}const r=t.getAsFile();if(!r)throw new Error(`${t} is not a File`);return Pc(r,(n=e==null?void 0:e.fullPath)!==null&&n!==void 0?n:void 0)})}function Z5(t){return Qs(this,void 0,void 0,function*(){return t.isDirectory?BE(t):eB(t)})}function BE(t){const e=t.createReader();return new Promise((n,r)=>{const o=[];function i(){e.readEntries(a=>Qs(this,void 0,void 0,function*(){if(a.length){const c=Promise.all(a.map(Z5));o.push(c),i()}else try{const c=yield Promise.all(o);n(c)}catch(c){r(c)}}),a=>{r(a)})}i()})}function eB(t){return Qs(this,void 0,void 0,function*(){return new Promise((e,n)=>{t.file(r=>{const o=Pc(r,t.fullPath);e(o)},r=>{n(r)})})})}var uy=function(t,e){if(t&&e){var n=Array.isArray(e)?e:e.split(",");if(n.length===0)return!0;var r=t.name||"",o=(t.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return n.some(function(a){var c=a.trim().toLowerCase();return c.charAt(0)==="."?r.toLowerCase().endsWith(c):c.endsWith("/*")?i===c.replace(/\/.*$/,""):o===c})}return!0};function zE(t){return rB(t)||nB(t)||jE(t)||tB()}function tB(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1058
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nB(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function rB(t){if(Array.isArray(t))return fy(t)}function VE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function KE(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?VE(Object(n),!0).forEach(function(r){GE(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):VE(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function GE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fd(t,e){return sB(t)||iB(t,e)||jE(t,e)||oB()}function oB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1059
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jE(t,e){if(t){if(typeof t=="string")return fy(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fy(t,e)}}function fy(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function iB(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,a,c;try{for(n=n.call(t);!(o=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));o=!0);}catch(u){i=!0,c=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw c}}return r}}function sB(t){if(Array.isArray(t))return t}var aB=typeof uy=="function"?uy:uy.default,cB="file-invalid-type",lB="file-too-large",dB="file-too-small",uB="too-many-files",fB=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=e.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:cB,message:"File type must be ".concat(r)}},WE=function(e){return{code:lB,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},qE=function(e){return{code:dB,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},hB={code:uB,message:"Too many files"};function pB(t){return t.type===""&&typeof t.getAsFile=="function"}function YE(t,e){var n=t.type==="application/x-moz-file"||aB(t,e)||pB(t);return[n,n?null:fB(e)]}function QE(t,e,n){if(ua(t.size))if(ua(e)&&ua(n)){if(t.size>n)return[!1,WE(n)];if(t.size<e)return[!1,qE(e)]}else{if(ua(e)&&t.size<e)return[!1,qE(e)];if(ua(n)&&t.size>n)return[!1,WE(n)]}return[!0,null]}function ua(t){return t!=null}function gB(t){var e=t.files,n=t.accept,r=t.minSize,o=t.maxSize,i=t.multiple,a=t.maxFiles,c=t.validator;return!i&&e.length>1||i&&a>=1&&e.length>a?!1:e.every(function(u){var h=YE(u,n),p=fd(h,1),g=p[0],v=QE(u,r,o),m=fd(v,1),C=m[0],b=c?c(u):null;return g&&C&&!b})}function lh(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():typeof t.cancelBubble<"u"?t.cancelBubble:!1}function hd(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!t.target&&!!t.target.files}function JE(t){t.preventDefault()}function mB(t){return t.indexOf("MSIE")!==-1||t.indexOf("Trident/")!==-1}function vB(t){return t.indexOf("Edge/")!==-1}function yB(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return mB(t)||vB(t)}function Jo(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return e.some(function(c){return!lh(r)&&c&&c.apply(void 0,[r].concat(i)),lh(r)})}}function wB(){return"showOpenFilePicker"in window}function bB(t){if(ua(t)){var e=Object.entries(t).filter(function(n){var r=fd(n,2),o=r[0],i=r[1],a=!0;return XE(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),a=!1),(!Array.isArray(i)||!i.every(ZE))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(n,r){var o=fd(r,2),i=o[0],a=o[1];return KE(KE({},n),{},GE({},i,a))},{});return[{description:"Files",accept:e}]}return t}function CB(t){if(ua(t))return Object.entries(t).reduce(function(e,n){var r=fd(n,2),o=r[0],i=r[1];return[].concat(zE(e),[o],zE(i))},[]).filter(function(e){return XE(e)||ZE(e)}).join(",")}function xB(t){return t instanceof DOMException&&(t.name==="AbortError"||t.code===t.ABORT_ERR)}function _B(t){return t instanceof DOMException&&(t.name==="SecurityError"||t.code===t.SECURITY_ERR)}function XE(t){return t==="audio/*"||t==="video/*"||t==="image/*"||t==="text/*"||t==="application/*"||/\w+\/[-+.\w]+/g.test(t)}function ZE(t){return/^.*\.[\w]+$/.test(t)}var SB=["children"],TB=["open"],EB=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],AB=["refKey","onChange","onClick"];function eA(t){return PB(t)||kB(t)||tA(t)||IB()}function IB(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1060
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kB(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function PB(t){if(Array.isArray(t))return py(t)}function hy(t,e){return DB(t)||NB(t,e)||tA(t,e)||OB()}function OB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1061
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tA(t,e){if(t){if(typeof t=="string")return py(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return py(t,e)}}function py(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function NB(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,a,c;try{for(n=n.call(t);!(o=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));o=!0);}catch(u){i=!0,c=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw c}}return r}}function DB(t){if(Array.isArray(t))return t}function nA(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function rn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?nA(Object(n),!0).forEach(function(r){gy(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nA(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function gy(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dh(t,e){if(t==null)return{};var n=MB(t,e),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function MB(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i<r.length;i++)o=r[i],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}var my=D.forwardRef(function(t,e){var n=t.children,r=dh(t,SB),o=oA(r),i=o.open,a=dh(o,TB);return D.useImperativeHandle(e,function(){return{open:i}},[i]),D.createElement(D.Fragment,null,n(rn(rn({},a),{},{open:i})))});my.displayName="Dropzone";var rA={disabled:!1,getFilesFromEvent:j5,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};my.defaultProps=rA,my.propTypes={children:Jt.func,accept:Jt.objectOf(Jt.arrayOf(Jt.string)),multiple:Jt.bool,preventDropOnDocument:Jt.bool,noClick:Jt.bool,noKeyboard:Jt.bool,noDrag:Jt.bool,noDragEventsBubbling:Jt.bool,minSize:Jt.number,maxSize:Jt.number,maxFiles:Jt.number,disabled:Jt.bool,getFilesFromEvent:Jt.func,onFileDialogCancel:Jt.func,onFileDialogOpen:Jt.func,useFsAccessApi:Jt.bool,autoFocus:Jt.bool,onDragEnter:Jt.func,onDragLeave:Jt.func,onDragOver:Jt.func,onDrop:Jt.func,onDropAccepted:Jt.func,onDropRejected:Jt.func,onError:Jt.func,validator:Jt.func};var vy={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragGlobal:!1,acceptedFiles:[],fileRejections:[]};function oA(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=rn(rn({},rA),t),n=e.accept,r=e.disabled,o=e.getFilesFromEvent,i=e.maxSize,a=e.minSize,c=e.multiple,u=e.maxFiles,h=e.onDragEnter,p=e.onDragLeave,g=e.onDragOver,v=e.onDrop,m=e.onDropAccepted,C=e.onDropRejected,b=e.onFileDialogCancel,w=e.onFileDialogOpen,_=e.useFsAccessApi,E=e.autoFocus,I=e.preventDropOnDocument,k=e.noClick,A=e.noKeyboard,M=e.noDrag,B=e.noDragEventsBubbling,W=e.onError,Y=e.validator,z=D.useMemo(function(){return CB(n)},[n]),de=D.useMemo(function(){return bB(n)},[n]),ne=D.useMemo(function(){return typeof w=="function"?w:iA},[w]),ae=D.useMemo(function(){return typeof b=="function"?b:iA},[b]),Q=D.useRef(null),re=D.useRef(null),j=D.useReducer(RB,vy),se=hy(j,2),ie=se[0],ce=se[1],$=ie.isFocused,Z=ie.isFileDialogActive,me=D.useRef(typeof window<"u"&&window.isSecureContext&&_&&wB()),_e=function(){!me.current&&Z&&setTimeout(function(){if(re.current){var qe=re.current.files;qe.length||(ce({type:"closeDialog"}),ae())}},300)};D.useEffect(function(){return window.addEventListener("focus",_e,!1),function(){window.removeEventListener("focus",_e,!1)}},[re,Z,ae,me]);var Ee=D.useRef([]),ke=D.useRef([]),te=function(qe){Q.current&&Q.current.contains(qe.target)||(qe.preventDefault(),Ee.current=[])};D.useEffect(function(){return I&&(document.addEventListener("dragover",JE,!1),document.addEventListener("drop",te,!1)),function(){I&&(document.removeEventListener("dragover",JE),document.removeEventListener("drop",te))}},[Q,I]),D.useEffect(function(){var De=function(dn){ke.current=[].concat(eA(ke.current),[dn.target]),hd(dn)&&ce({isDragGlobal:!0,type:"setDragGlobal"})},qe=function(dn){ke.current=ke.current.filter(function(L){return L!==dn.target&&L!==null}),!(ke.current.length>0)&&ce({isDragGlobal:!1,type:"setDragGlobal"})},kt=function(){ke.current=[],ce({isDragGlobal:!1,type:"setDragGlobal"})},Et=function(){ke.current=[],ce({isDragGlobal:!1,type:"setDragGlobal"})};return document.addEventListener("dragenter",De,!1),document.addEventListener("dragleave",qe,!1),document.addEventListener("dragend",kt,!1),document.addEventListener("drop",Et,!1),function(){document.removeEventListener("dragenter",De),document.removeEventListener("dragleave",qe),document.removeEventListener("dragend",kt),document.removeEventListener("drop",Et)}},[Q]),D.useEffect(function(){return!r&&E&&Q.current&&Q.current.focus(),function(){}},[Q,E,r]);var pe=D.useCallback(function(De){W?W(De):console.error(De)},[W]),be=D.useCallback(function(De){De.preventDefault(),De.persist(),In(De),Ee.current=[].concat(eA(Ee.current),[De.target]),hd(De)&&Promise.resolve(o(De)).then(function(qe){if(!(lh(De)&&!B)){var kt=qe.length,Et=kt>0&&gB({files:qe,accept:z,minSize:a,maxSize:i,multiple:c,maxFiles:u,validator:Y}),Ht=kt>0&&!Et;ce({isDragAccept:Et,isDragReject:Ht,isDragActive:!0,type:"setDraggedFiles"}),h&&h(De)}}).catch(function(qe){return pe(qe)})},[o,h,pe,B,z,a,i,c,u,Y]),Ie=D.useCallback(function(De){De.preventDefault(),De.persist(),In(De);var qe=hd(De);if(qe&&De.dataTransfer)try{De.dataTransfer.dropEffect="copy"}catch{}return qe&&g&&g(De),!1},[g,B]),Pe=D.useCallback(function(De){De.preventDefault(),De.persist(),In(De);var qe=Ee.current.filter(function(Et){return Q.current&&Q.current.contains(Et)}),kt=qe.indexOf(De.target);kt!==-1&&qe.splice(kt,1),Ee.current=qe,!(qe.length>0)&&(ce({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),hd(De)&&p&&p(De))},[Q,p,B]),Me=D.useCallback(function(De,qe){var kt=[],Et=[];De.forEach(function(Ht){var dn=YE(Ht,z),L=hy(dn,2),X=L[0],ee=L[1],Ce=QE(Ht,a,i),Se=hy(Ce,2),Oe=Se[0],Ne=Se[1],Re=Y?Y(Ht):null;if(X&&Oe&&!Re)kt.push(Ht);else{var Ge=[ee,Ne];Re&&(Ge=Ge.concat(Re)),Et.push({file:Ht,errors:Ge.filter(function(bt){return bt})})}}),(!c&&kt.length>1||c&&u>=1&&kt.length>u)&&(kt.forEach(function(Ht){Et.push({file:Ht,errors:[hB]})}),kt.splice(0)),ce({acceptedFiles:kt,fileRejections:Et,isDragReject:Et.length>0,type:"setFiles"}),v&&v(kt,Et,qe),Et.length>0&&C&&C(Et,qe),kt.length>0&&m&&m(kt,qe)},[ce,c,z,a,i,u,v,m,C,Y]),fe=D.useCallback(function(De){De.preventDefault(),De.persist(),In(De),Ee.current=[],hd(De)&&Promise.resolve(o(De)).then(function(qe){lh(De)&&!B||Me(qe,De)}).catch(function(qe){return pe(qe)}),ce({type:"reset"})},[o,Me,pe,B]),He=D.useCallback(function(){if(me.current){ce({type:"openDialog"}),ne();var De={multiple:c,types:de};window.showOpenFilePicker(De).then(function(qe){return o(qe)}).then(function(qe){Me(qe,null),ce({type:"closeDialog"})}).catch(function(qe){xB(qe)?(ae(qe),ce({type:"closeDialog"})):_B(qe)?(me.current=!1,re.current?(re.current.value=null,re.current.click()):pe(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):pe(qe)});return}re.current&&(ce({type:"openDialog"}),ne(),re.current.value=null,re.current.click())},[ce,ne,ae,_,Me,pe,de,c]),Ut=D.useCallback(function(De){!Q.current||!Q.current.isEqualNode(De.target)||(De.key===" "||De.key==="Enter"||De.keyCode===32||De.keyCode===13)&&(De.preventDefault(),He())},[Q,He]),ct=D.useCallback(function(){ce({type:"focus"})},[]),ze=D.useCallback(function(){ce({type:"blur"})},[]),wt=D.useCallback(function(){k||(yB()?setTimeout(He,0):He())},[k,He]),vt=function(qe){return r?null:qe},qt=function(qe){return A?null:vt(qe)},An=function(qe){return M?null:vt(qe)},In=function(qe){B&&qe.stopPropagation()},At=D.useMemo(function(){return function(){var De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},qe=De.refKey,kt=qe===void 0?"ref":qe,Et=De.role,Ht=De.onKeyDown,dn=De.onFocus,L=De.onBlur,X=De.onClick,ee=De.onDragEnter,Ce=De.onDragOver,Se=De.onDragLeave,Oe=De.onDrop,Ne=dh(De,EB);return rn(rn(gy({onKeyDown:qt(Jo(Ht,Ut)),onFocus:qt(Jo(dn,ct)),onBlur:qt(Jo(L,ze)),onClick:vt(Jo(X,wt)),onDragEnter:An(Jo(ee,be)),onDragOver:An(Jo(Ce,Ie)),onDragLeave:An(Jo(Se,Pe)),onDrop:An(Jo(Oe,fe)),role:typeof Et=="string"&&Et!==""?Et:"presentation"},kt,Q),!r&&!A?{tabIndex:0}:{}),Ne)}},[Q,Ut,ct,ze,wt,be,Ie,Pe,fe,A,M,r]),co=D.useCallback(function(De){De.stopPropagation()},[]),sr=D.useMemo(function(){return function(){var De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},qe=De.refKey,kt=qe===void 0?"ref":qe,Et=De.onChange,Ht=De.onClick,dn=dh(De,AB),L=gy({accept:z,multiple:c,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:vt(Jo(Et,fe)),onClick:vt(Jo(Ht,co)),tabIndex:-1},kt,re);return rn(rn({},L),dn)}},[re,n,c,fe,r]);return rn(rn({},ie),{},{isFocused:$&&!r,getRootProps:At,getInputProps:sr,rootRef:Q,inputRef:re,open:vt(He)})}function RB(t,e){switch(e.type){case"focus":return rn(rn({},t),{},{isFocused:!0});case"blur":return rn(rn({},t),{},{isFocused:!1});case"openDialog":return rn(rn({},vy),{},{isFileDialogActive:!0});case"closeDialog":return rn(rn({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return rn(rn({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return rn(rn({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections,isDragReject:e.isDragReject});case"setDragGlobal":return rn(rn({},t),{},{isDragGlobal:e.isDragGlobal});case"reset":return rn({},vy);default:return t}}function iA(){}const LB=({onFilesSelected:t,children:e})=>{const[n,r]=D.useState(!1),{getRootProps:o,getInputProps:i}=oA({noClick:!0,onDrop:a=>{if(a&&a.length>0)if(a[0].path.split("/").length>2){const u=a.map(h=>{const g=(h.path||h.relativePath||"").split("/").slice(1).join("/");return(!h.webkitRelativePath||h.webkitRelativePath==="")&&Object.defineProperty(h,"webkitRelativePath",{writable:!0,value:g,enumerable:!0,configurable:!0}),h});t(u,"folder")}else t(a,"files");r(!1)},onDragOver:a=>{a.preventDefault(),n||r(!0)},multiple:!0});return D.useEffect(()=>{const a=c=>{c.clientX===0&&c.clientY===0&&r(!1)};return document.addEventListener("dragleave",a),()=>{document.removeEventListener("dragleave",a)}},[]),d.jsxs("div",{...o(),className:"transition-opacity min-h-[600px]",children:[n?d.jsx("div",{className:"flex flex-col items-center justify-center p-4 border-2 border-dashed border-gray-300 rounded-lg bg-gray-50 h-screen"}):e,d.jsx("input",{...i()})]})};function FB({open:t,onClose:e,currentJob:n,elapsedTime:r,onStop:o}){var ne,ae;if(!n)return null;const[i,a]=D.useState(!1),[c,u]=D.useState(!1),[h,p]=D.useState(0),[g,v]=D.useState(0);D.useEffect(()=>{var Q,re;if(((Q=n==null?void 0:n.status)==null?void 0:Q.status)==="completed"&&!((re=n==null?void 0:n.status)!=null&&re.isProcessing)){const j=setTimeout(()=>{e()},5e3);return()=>clearTimeout(j)}},[(ne=n==null?void 0:n.status)==null?void 0:ne.status,(ae=n==null?void 0:n.status)==null?void 0:ae.isProcessing,e]);const m=n.status,C=(m==null?void 0:m.completed)||0,b=(m==null?void 0:m.total)||0,w=!m||b===0&&C===0,_=(m==null?void 0:m.status)==="completed"&&(m==null?void 0:m.isProcessing),E=b>0?Math.round(C/b*100):0,I=w?h:_?Math.max(E,g):(m==null?void 0:m.status)==="completed"&&!(m!=null&&m.isProcessing)?100:Math.max(E,h);D.useEffect(()=>{if(!t){p(0);return}const Q=setInterval(()=>{p(re=>{const j=w?30:90;if(re>=j)return re;const se=re<20?.5:re<50?.3:.1;return Math.min(re+se,j)})},200);return()=>clearInterval(Q)},[t,w]),D.useEffect(()=>{if(!t||!_){v(0);return}g===0&&E>0&&v(E);const Q=setInterval(()=>{v(re=>{if(re>=95)return re;const se=(95-re)*.05;return Math.min(re+Math.max(se,.1),95)})},200);return()=>clearInterval(Q)},[t,_,E,g]);const k=r>0?C/(r/60):0,A=k>0?Math.ceil((b-C)/k):null,M=Q=>{const re=Math.floor(Q/3600),j=Math.floor(Q%3600/60),se=Q%60;return re>0?`${re}h${j}m${se}s`:j>0?`${j}m${se}s`:`${se}s`},B=()=>{const Q=b>0?Math.round(C/b*100):0,re=b>0?` ${Q}%`:"";if(!m||m.total===0&&m.completed===0)return{text:"Đang khởi tạo và phân tích website...",icon:d.jsx(Tt,{className:"h-5 w-5 animate-spin text-blue-500"}),color:"text-blue-600"};if(m.status==="completed"&&m.isProcessing)return{text:`Đang lưu dữ liệu...${m.completed&&m.total?` (${m.completed}/${m.total} tệp)`:""}${re}`,icon:d.jsx(Tt,{className:"h-5 w-5 animate-spin text-blue-500"}),color:"text-blue-600"};switch(m.status){case"scraping":return{text:m.isProcessing?`Đang thu thập nội dung trang...${re}`:`Đang quét cấu trúc website...${re}`,icon:d.jsx(Tt,{className:"h-5 w-5 animate-spin text-blue-500"}),color:"text-blue-600"};case"completed":return{text:"Hoàn thành!",icon:d.jsx(SR,{className:"h-5 w-5 text-green-500"}),color:"text-green-600"};case"failed":return{text:`Đã xảy ra lỗi${m.error?`: ${m.error}`:""}`,icon:d.jsx(TR,{className:"h-5 w-5 text-red-500"}),color:"text-red-600"};case"blocked":return{text:"Website đã chặn truy cập",icon:d.jsx(_R,{className:"h-5 w-5 text-orange-500"}),color:"text-orange-600"};default:return{text:`Đang xử lý...${re}`,icon:d.jsx(Tt,{className:"h-5 w-5 animate-spin text-blue-500"}),color:"text-blue-600"}}},W=async()=>{u(!0);try{await o(),e()}finally{u(!1),a(!1)}},Y=B(),z=(m==null?void 0:m.status)==="scraping"||!m||(m==null?void 0:m.status)==="completed"&&(m==null?void 0:m.isProcessing),de=(m==null?void 0:m.status)==="completed"&&!(m!=null&&m.isProcessing)||(m==null?void 0:m.status)==="failed"||(m==null?void 0:m.status)==="blocked";return d.jsx(yr,{open:t,onOpenChange:Q=>!Q&&e(),children:d.jsxs(Zn,{className:"sm:max-w-[480px] s3-explr-crawl-progress-dialog",children:[d.jsx(er,{className:"flex flex-row items-center justify-between",children:d.jsx(tr,{children:"Thu thập website"})}),d.jsxs("div",{className:"space-y-4 py-4",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[Y.icon,d.jsx("span",{className:Xe("font-medium",Y.color),children:Y.text})]}),d.jsxs("div",{className:"space-y-2 s3-explr-crawl-progress-bar",children:[d.jsx("div",{className:"w-full bg-gray-200 rounded-full h-3 overflow-hidden",children:d.jsx("div",{className:Xe("h-3 rounded-full transition-all duration-300 s3-explr-crawl-progress-fill",(m==null?void 0:m.status)==="completed"?"bg-green-500":(m==null?void 0:m.status)==="failed"?"bg-red-500":(m==null?void 0:m.status)==="blocked"?"bg-orange-500":"bg-blue-600",w&&"s3-explr-crawl-progress-indeterminate"),style:{width:`${I}%`}})}),d.jsxs("div",{className:"text-right text-sm text-gray-600",children:[I,"%"]})]}),d.jsxs("div",{className:"space-y-2 text-sm text-gray-700",children:[d.jsxs("p",{className:"break-all",children:[d.jsx("span",{className:"font-medium",children:"URL:"})," ",n.url]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Đã thu thập:"})," ",b===0?"Đang khởi tạo...":`${C}/${b} trang`]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Thời gian:"})," ",M(r)]}),A!==null&&z&&d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Còn lại:"})," ~",A," phút"]})]})]}),d.jsxs(io,{children:[i?d.jsxs("div",{className:"flex items-center gap-2 w-full justify-end",children:[d.jsx("span",{className:"text-sm text-gray-600 mr-2",children:"Xác nhận dừng?"}),d.jsx(je,{variant:"outline",size:"sm",onClick:()=>a(!1),disabled:c,children:"Hủy"}),d.jsx(je,{variant:"destructive",size:"sm",onClick:W,disabled:c,children:c?d.jsxs(d.Fragment,{children:[d.jsx(Tt,{className:"h-4 w-4 animate-spin mr-2"}),"Đang dừng..."]}):"Xác nhận"})]}):z&&d.jsx(je,{variant:"destructive",onClick:()=>a(!0),children:"Dừng thu thập"}),de&&d.jsx(je,{variant:"outline",onClick:e,children:"Đóng"})]})]})})}const $B=({openDialogRename:t,setOpenDialogRename:e,apiBaseUrl:n,setFileToMove:r,fileToMove:o,refreshFiles:i,ignoreCache:a,autoSyncAfterFileOperation:c})=>{var I;const[u,h]=D.useState({}),[p,g]=D.useState(!1),[v,m]=D.useState(!1),[C,b]=D.useState(""),{toast:w}=Zl();D.useEffect(()=>{t&&_(C)},[C,t]);const _=async k=>{try{m(!0);const A=await $e.get(`${n}/api/list-s3-folders?prefix=${k}`);h(A==null?void 0:A.data)}catch{w({title:"Error",description:"Unable to load S3 folder list",variant:"destructive"})}finally{m(!1)}},E=async()=>{g(!0);try{const k=o.key,A=k.endsWith("/")?k:`${k}/`,M=C.endsWith("/")?C:`${C}/`;if(A===M||k===C){w({title:"Lỗi",description:"Không thể di chuyển file đến cùng vị trí",variant:"destructive"}),g(!1);return}await $e.post(`${n}/api/move`,{oldPath:k,newPath:C}),a.current=!0,await i(),w({title:"Đã di chuyển",description:`Đã di chuyển thành công "${o.name}" đến "${C}"`}),e(!1),r(null),b(""),c&&await c("move")}catch(k){console.error("Error renaming item:",k),w({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{g(!1)}};return d.jsx(yr,{open:t,onOpenChange:k=>{k||(e(!1),r(null),b(""))},children:d.jsxs(Zn,{className:"max-h-[700px] pb-3 px-1 s3-explr-input-group max-w-5xl w-[90%] p-6 bg-white rounded-lg shadow-lg",children:[d.jsxs(er,{className:"mb-4 w-full h-full",children:[d.jsx("nav",{className:"mb-4",children:d.jsxs("ul",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[d.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>b(""),children:"Root"}),C.split("/").map((k,A,M)=>d.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>b(k==="Root"?"":M.slice(0,A+1).join("/")+"/"),children:k.length>50?`${k.slice(0,50)}...`:k},A))]})}),d.jsxs(tr,{className:"text-xl font-semibold text-gray-800",children:["Di chuyển"," ",d.jsxs("span",{className:"text-sm text-gray-500",children:["( file hoặc folder sẽ được di chuyển đến thư mục"," ",C===""?"Root":C," )"]})]}),d.jsx(Ei,{className:"text-gray-600 w-full h-[50dvh] max-h-[500px] overflow-hidden overflow-y-auto",children:v?d.jsx("div",{className:"flex justify-center items-center py-4",children:d.jsx("div",{className:"loader ease-linear rounded-full border-4 border-t-4 border-gray-200 h-12 w-12"})}):d.jsx("ul",{className:"space-y-2",children:(I=Object.keys(u))==null?void 0:I.map(k=>d.jsx("li",{className:"cursor-pointer hover:bg-gray-100 p-2 rounded transition-colors",onClick:()=>b(k),children:k.length>50?`${k.slice(0,50)}...`:k},k))})})]}),d.jsxs(io,{className:"flex justify-end space-x-2",children:[d.jsx(je,{variant:"outline",onClick:()=>e(!1),className:"px-4 py-2 rounded border border-gray-300 text-gray-700 hover:bg-gray-100 transition-colors",children:"Cancel"}),d.jsx(je,{onClick:E,disabled:p,className:"s3-explr-crawl-btn",children:"Move"})]})]})})};var UB=Object.defineProperty,HB=(t,e)=>UB(t,"name",{value:e,configurable:!0});function yy(t,[e,n]){return Math.min(n,Math.max(e,t))}HB(yy,"clamp");var BB=Object.defineProperty,zB=(t,e)=>BB(t,"name",{value:e,configurable:!0});function sA(t){const e=S.useRef({value:t,previous:t});return S.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}zB(sA,"usePrevious");var VB=Object.defineProperty,$t=(t,e)=>VB(t,"name",{value:e,configurable:!0}),KB=[" ","Enter","ArrowUp","ArrowDown"],GB=[" ","Enter"],Oc="Select",[uh,wy,jB]=If(Oc),[fa,UW]=Co(Oc,[jB,Yf]),by=Yf(),[WB,bs]=fa(Oc),[qB,YB]=fa(Oc);function aA(t){const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:c,onValueChange:u,dir:h,name:p,autoComplete:g,disabled:v,required:m,form:C,internal_do_not_use_render:b}=t,w=by(e),[_,E]=S.useState(null),[I,k]=S.useState(null),[A,M]=S.useState(!1),B=Pf(h),[W,Y]=hi({prop:r,defaultProp:o??!1,onChange:i,caller:Oc}),[z,de]=hi({prop:a,defaultProp:c,onChange:u,caller:Oc}),ne=S.useRef(null),ae=S.useRef(z);S.useEffect(()=>{const me=C?_==null?void 0:_.ownerDocument.getElementById(C):_==null?void 0:_.form;if(me instanceof HTMLFormElement){const _e=$t(()=>de(ae.current),"reset");return me.addEventListener("reset",_e),()=>me.removeEventListener("reset",_e)}},[C,_,de]);const Q=_?!!C||!!_.closest("form"):!0,[re,j]=S.useState(new Set),se=fi(),ie=Array.from(re).map(me=>me.props.value).join(";"),ce=S.useCallback(me=>{j(_e=>new Set(_e).add(me))},[]),$=S.useCallback(me=>{j(_e=>{const Ee=new Set(_e);return Ee.delete(me),Ee})},[]),Z={required:m,trigger:_,onTriggerChange:E,valueNode:I,onValueNodeChange:k,valueNodeHasChildren:A,onValueNodeHasChildrenChange:M,contentId:se,value:z,onValueChange:de,open:W,onOpenChange:Y,dir:B,triggerPointerDownPosRef:ne,disabled:v,name:p,autoComplete:g,form:C,nativeOptions:re,nativeSelectKey:ie,isFormControl:Q};return d.jsx(sT,{...w,children:d.jsx(WB,{scope:e,...Z,children:d.jsx(uh.Provider,{scope:e,children:d.jsx(qB,{scope:e,onNativeOptionAdd:ce,onNativeOptionRemove:$,children:vA(b)?b(Z):n})})})})}$t(aA,"SelectProvider");var QB=$t(t=>{const{__scopeSelect:e,children:n,...r}=t;return d.jsx(aA,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>d.jsxs(d.Fragment,{children:[n,o?d.jsx(b4,{__scopeSelect:e}):null]})})},"Select"),JB="SelectTrigger",cA=S.forwardRef($t(function(e,n){const{__scopeSelect:r,disabled:o=!1,...i}=e,a=by(r),c=bs(JB,r),u=c.disabled||o,h=Rt(n,c.onTriggerChange),p=wy(r),g=S.useRef("touch"),[v,m,C]=xy(w=>{const _=p().filter(k=>!k.disabled),E=_.find(k=>k.value===c.value),I=_y(_,w,E);I!==void 0&&c.onValueChange(I.value)}),b=$t(w=>{u||(c.onOpenChange(!0),C()),w&&(c.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})},"handleOpen");return d.jsx(aT,{asChild:!0,...a,children:d.jsx(pt.button,{type:"button",role:"combobox","aria-controls":c.open?c.contentId:void 0,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":pd(c.value)?"":void 0,...i,ref:h,onClick:nt(i.onClick,w=>{w.currentTarget.focus(),g.current!=="mouse"&&b(w)}),onPointerDown:nt(i.onPointerDown,w=>{g.current=w.pointerType;const _=w.target;_.hasPointerCapture(w.pointerId)&&_.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(b(w),w.preventDefault())}),onKeyDown:nt(i.onKeyDown,w=>{const _=v.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&m(w.key),!(_&&w.key===" ")&&KB.includes(w.key)&&(b(),w.preventDefault())})})})},"SelectTrigger")),XB="SelectValue",ZB=S.forwardRef($t(function(e,n){const{__scopeSelect:r,className:o,style:i,children:a,placeholder:c="",...u}=e,h=bs(XB,r),{onValueNodeHasChildrenChange:p}=h,g=a!==void 0,v=Rt(n,h.onValueNodeChange);Tn(()=>{p(g)},[p,g]);const m=pd(h.value);return d.jsx(pt.span,{...u,asChild:m?!1:u.asChild,ref:v,style:{pointerEvents:"none"},children:d.jsx(S.Fragment,{children:m?c:a},m?"placeholder":"value")})},"SelectValue")),e4=S.forwardRef($t(function(e,n){const{__scopeSelect:r,children:o,...i}=e;return d.jsx(pt.span,{"aria-hidden":!0,...i,ref:n,children:o||"▼"})},"SelectIcon")),t4="SelectPortal",[n4,r4]=fa(t4,{forceMount:void 0}),o4=$t(t=>{const{__scopeSelect:e,forceMount:n,...r}=t;return d.jsx(n4,{scope:t.__scopeSelect,forceMount:n,children:d.jsx(nf,{asChild:!0,...r})})},"SelectPortal"),ha="SelectContent",lA=S.forwardRef($t(function(e,n){const r=r4(ha,e.__scopeSelect),{forceMount:o=r.forceMount,...i}=e,a=bs(ha,e.__scopeSelect),[c,u]=S.useState();return Tn(()=>{u(new DocumentFragment)},[]),d.jsx(vi,{present:o||a.open,children:({present:h})=>h?d.jsx(a4,{...i,ref:n}):d.jsx(i4,{...i,fragment:c})})},"SelectContent")),i4=S.forwardRef($t(function(e,n){const{__scopeSelect:r,children:o,fragment:i}=e;return i?ja.createPortal(d.jsx(dA,{scope:r,children:d.jsx(uh.Slot,{scope:r,children:d.jsx("div",{ref:n,children:o})})}),i):null},"SelectContentFragment")),Ao=10,[dA,fh]=fa(ha),s4=pi("SelectContent.RemoveScroll"),a4=S.forwardRef($t(function(e,n){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:c,side:u,sideOffset:h,align:p,alignOffset:g,arrowPadding:v,collisionBoundary:m,collisionPadding:C,sticky:b,hideWhenDetached:w,avoidCollisions:_,...E}=e,I=bs(ha,r),[k,A]=S.useState(null),[M,B]=S.useState(null),W=Rt(n,A),[Y,z]=S.useState(null),[de,ne]=S.useState(null),ae=wy(r),[Q,re]=S.useState(!1),j=S.useRef(!1);S.useEffect(()=>{if(k)return Y_(k)},[k]),of();const se=S.useCallback(be=>{const[Ie,...Pe]=ae().map(He=>He.ref.current),[Me]=Pe.slice(-1),fe=document.activeElement;for(const He of be)if(He===fe||(He==null||He.scrollIntoView({block:"nearest"}),He===Ie&&M&&(M.scrollTop=0),He===Me&&M&&(M.scrollTop=M.scrollHeight),He==null||He.focus(),document.activeElement!==fe))return},[ae,M]),ie=S.useCallback(()=>se([Y,k]),[se,Y,k]);S.useEffect(()=>{Q&&ie()},[Q,ie]);const{onOpenChange:ce,triggerPointerDownPosRef:$}=I;S.useEffect(()=>{if(k){let be={x:0,y:0};const Ie=$t(Me=>{var fe,He;be={x:Math.abs(Math.round(Me.pageX)-(((fe=$.current)==null?void 0:fe.x)??0)),y:Math.abs(Math.round(Me.pageY)-(((He=$.current)==null?void 0:He.y)??0))}},"handlePointerMove"),Pe=$t(Me=>{be.x<=10&&be.y<=10?Me.preventDefault():Me.composedPath().includes(k)||ce(!1),document.removeEventListener("pointermove",Ie),$.current=null},"handlePointerUp");return $.current!==null&&(document.addEventListener("pointermove",Ie),document.addEventListener("pointerup",Pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ie),document.removeEventListener("pointerup",Pe,{capture:!0})}}},[k,ce,$]),S.useEffect(()=>{const be=$t(()=>ce(!1),"close");return window.addEventListener("blur",be),window.addEventListener("resize",be),()=>{window.removeEventListener("blur",be),window.removeEventListener("resize",be)}},[ce]);const[Z,me]=xy(be=>{const Ie=ae().filter(fe=>!fe.disabled),Pe=Ie.find(fe=>fe.ref.current===document.activeElement),Me=_y(Ie,be,Pe);Me&&setTimeout(()=>{var fe;return(fe=Me.ref.current)==null?void 0:fe.focus()})}),_e=S.useCallback((be,Ie,Pe)=>{const Me=!j.current&&!Pe;(I.value!==void 0&&I.value===Ie||Me)&&(z(be),Me&&(j.current=!0))},[I.value]),Ee=S.useCallback(()=>k==null?void 0:k.focus(),[k]),ke=S.useCallback((be,Ie,Pe)=>{const Me=!j.current&&!Pe;(I.value!==void 0&&I.value===Ie||Me)&&ne(be)},[I.value]),te=o==="popper"?uA:c4,pe=te===uA?{side:u,sideOffset:h,align:p,alignOffset:g,arrowPadding:v,collisionBoundary:m,collisionPadding:C,sticky:b,hideWhenDetached:w,avoidCollisions:_}:{};return d.jsx(dA,{scope:r,content:k,viewport:M,onViewportChange:B,itemRefCallback:_e,selectedItem:Y,onItemLeave:Ee,itemTextRefCallback:ke,focusSelectedItem:ie,selectedItemText:de,position:o,isPositioned:Q,searchRef:Z,children:d.jsx(mm,{as:s4,allowPinchZoom:!0,children:d.jsx(x_,{asChild:!0,trapped:I.open,onMountAutoFocus:be=>{be.preventDefault()},onUnmountAutoFocus:nt(i,be=>{var Ie;(Ie=I.trigger)==null||Ie.focus({preventScroll:!0}),be.preventDefault()}),children:d.jsx(tf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:be=>be.preventDefault(),onDismiss:()=>I.onOpenChange(!1),children:d.jsx(te,{role:"listbox",id:I.contentId,"data-state":I.open?"open":"closed",dir:I.dir,onContextMenu:be=>be.preventDefault(),...E,...pe,onPlaced:()=>re(!0),ref:W,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:nt(E.onKeyDown,be=>{const Ie=be.ctrlKey||be.altKey||be.metaKey;if(be.key==="Tab"&&be.preventDefault(),!Ie&&be.key.length===1&&me(be.key),["ArrowUp","ArrowDown","Home","End"].includes(be.key)){let Me=ae().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(be.key)&&(Me=Me.slice().reverse()),["ArrowUp","ArrowDown"].includes(be.key)){const fe=be.target,He=Me.indexOf(fe);Me=Me.slice(He+1)}setTimeout(()=>se(Me)),be.preventDefault()}})})})})})})},"SelectContentImpl")),c4=S.forwardRef($t(function(e,n){const{__scopeSelect:r,onPlaced:o,...i}=e,a=bs(ha,r),c=fh(ha,r),[u,h]=S.useState(null),[p,g]=S.useState(null),v=Rt(n,g),m=wy(r),C=S.useRef(!1),b=S.useRef(!0),{viewport:w,selectedItem:_,selectedItemText:E,focusSelectedItem:I}=c,k=S.useCallback(()=>{if(a.trigger&&a.valueNode&&u&&p&&w&&_&&E){const W=a.trigger.getBoundingClientRect(),Y=p.getBoundingClientRect(),z=a.valueNode.getBoundingClientRect(),de=E.getBoundingClientRect();if(a.dir!=="rtl"){const fe=de.left-Y.left,He=z.left-fe,Ut=W.left-He,ct=W.width+Ut,ze=Math.max(ct,Y.width),wt=window.innerWidth-Ao,vt=yy(He,[Ao,Math.max(Ao,wt-ze)]);u.style.minWidth=ct+"px",u.style.left=vt+"px"}else{const fe=Y.right-de.right,He=window.innerWidth-z.right-fe,Ut=window.innerWidth-W.right-He,ct=W.width+Ut,ze=Math.max(ct,Y.width),wt=window.innerWidth-Ao,vt=yy(He,[Ao,Math.max(Ao,wt-ze)]);u.style.minWidth=ct+"px",u.style.right=vt+"px"}const ne=m(),ae=window.innerHeight-Ao*2,Q=w.scrollHeight,re=window.getComputedStyle(p),j=parseInt(re.borderTopWidth,10),se=parseInt(re.paddingTop,10),ie=parseInt(re.borderBottomWidth,10),ce=parseInt(re.paddingBottom,10),$=j+se+Q+ce+ie,Z=Math.min(_.offsetHeight*5,$),me=window.getComputedStyle(w),_e=parseInt(me.paddingTop,10),Ee=parseInt(me.paddingBottom,10),ke=W.top+W.height/2-Ao,te=ae-ke,pe=_.offsetHeight/2,be=_.offsetTop+pe,Ie=j+se+be,Pe=$-Ie;if(Ie<=ke){const fe=ne.length>0&&_===ne[ne.length-1].ref.current;u.style.bottom="0px";const He=p.clientHeight-w.offsetTop-w.offsetHeight,Ut=Math.max(te,pe+(fe?Ee:0)+He+ie),ct=Ie+Ut;u.style.height=ct+"px"}else{const fe=ne.length>0&&_===ne[0].ref.current;u.style.top="0px";const Ut=Math.max(ke,j+w.offsetTop+(fe?_e:0)+pe)+Pe;u.style.height=Ut+"px",w.scrollTop=Ie-ke+w.offsetTop}u.style.margin=`${Ao}px 0`,u.style.minHeight=Z+"px",u.style.maxHeight=ae+"px",o==null||o(),requestAnimationFrame(()=>C.current=!0)}},[m,a.trigger,a.valueNode,u,p,w,_,E,a.dir,o]);Tn(()=>k(),[k]);const[A,M]=S.useState();Tn(()=>{p&&M(window.getComputedStyle(p).zIndex)},[p]);const B=S.useCallback(W=>{W&&b.current===!0&&(k(),I==null||I(),b.current=!1)},[k,I]);return d.jsx(l4,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:C,onScrollButtonChange:B,children:d.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:d.jsx(pt.div,{...i,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),uA=S.forwardRef($t(function(e,n){const{__scopeSelect:r,align:o="start",collisionPadding:i=Ao,...a}=e,c=by(r);return d.jsx(cT,{...c,...a,ref:n,align:o,collisionPadding:i,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[l4,d4]=fa(ha,{}),fA="SelectViewport",u4=S.forwardRef($t(function(e,n){const{__scopeSelect:r,nonce:o,...i}=e,a=fh(fA,r),c=d4(fA,r),u=Rt(n,a.onViewportChange),h=S.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(uh.Slot,{scope:r,children:d.jsx(pt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:nt(i.onScroll,p=>{const g=p.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:m}=c;if(m!=null&&m.current&&v){const C=Math.abs(h.current-g.scrollTop);if(C>0){const b=window.innerHeight-Ao*2,w=parseFloat(v.style.minHeight),_=parseFloat(v.style.height),E=Math.max(w,_);if(E<b){const I=E+C,k=Math.min(b,I),A=I-k;v.style.height=k+"px",v.style.bottom==="0px"&&(g.scrollTop=A>0?A:0,v.style.justifyContent="flex-end")}}}h.current=g.scrollTop})})})]})},"SelectViewport")),f4="SelectGroup",[HW,h4]=fa(f4),p4="SelectLabel",hA=S.forwardRef($t(function(e,n){const{__scopeSelect:r,...o}=e,i=h4(p4,r);return d.jsx(pt.div,{id:i.id,...o,ref:n})},"SelectLabel")),Cy="SelectItem",[g4,pA]=fa(Cy),gA=S.forwardRef($t(function(e,n){const{__scopeSelect:r,value:o,disabled:i=!1,textValue:a,...c}=e,u=bs(Cy,r),h=fh(Cy,r),p=u.value===o,[g,v]=S.useState(a??""),[m,C]=S.useState(!1),b=gr(k=>{var A;return(A=h.itemRefCallback)==null?void 0:A.call(h,k,o,i)}),w=Rt(n,b),_=fi(),E=S.useRef("touch"),I=$t(()=>{i||(u.onValueChange(o),u.onOpenChange(!1))},"handleSelect");return d.jsx(g4,{scope:r,value:o,disabled:i,textId:_,isSelected:p,onItemTextChange:S.useCallback(k=>{v(A=>A||((k==null?void 0:k.textContent)??"").trim())},[]),children:d.jsx(uh.ItemSlot,{scope:r,value:o,disabled:i,textValue:g,children:d.jsx(pt.div,{role:"option","aria-labelledby":_,"data-highlighted":m?"":void 0,"aria-selected":p&&m,"data-state":p?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...c,ref:w,onFocus:nt(c.onFocus,()=>C(!0)),onBlur:nt(c.onBlur,()=>C(!1)),onClick:nt(c.onClick,()=>{E.current!=="mouse"&&I()}),onPointerUp:nt(c.onPointerUp,()=>{E.current==="mouse"&&I()}),onPointerDown:nt(c.onPointerDown,k=>{E.current=k.pointerType}),onPointerMove:nt(c.onPointerMove,k=>{var A;E.current=k.pointerType,i?(A=h.onItemLeave)==null||A.call(h):E.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:nt(c.onPointerLeave,k=>{var A;k.currentTarget===document.activeElement&&((A=h.onItemLeave)==null||A.call(h))}),onKeyDown:nt(c.onKeyDown,k=>{var M;i||k.target!==k.currentTarget||((M=h.searchRef)==null?void 0:M.current)!==""&&k.key===" "||(GB.includes(k.key)&&I(),k.key===" "&&k.preventDefault())})})})})},"SelectItem")),hh="SelectItemText",m4=S.forwardRef($t(function(e,n){const{__scopeSelect:r,className:o,style:i,...a}=e,c=bs(hh,r),u=fh(hh,r),h=pA(hh,r),p=YB(hh,r),[g,v]=S.useState(null),m=gr(I=>{var k;return(k=u.itemTextRefCallback)==null?void 0:k.call(u,I,h.value,h.disabled)}),C=Rt(n,v,h.onItemTextChange,m),b=g==null?void 0:g.textContent,w=S.useMemo(()=>d.jsx("option",{value:h.value,disabled:h.disabled,children:b},h.value),[h.disabled,h.value,b]),{onNativeOptionAdd:_,onNativeOptionRemove:E}=p;return Tn(()=>(_(w),()=>E(w)),[_,E,w]),d.jsxs(d.Fragment,{children:[d.jsx(pt.span,{id:h.textId,...a,ref:C}),h.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!pd(c.value)?ja.createPortal(a.children,c.valueNode):null]})},"SelectItemText")),v4="SelectItemIndicator",y4=S.forwardRef($t(function(e,n){const{__scopeSelect:r,...o}=e;return pA(v4,r).isSelected?d.jsx(pt.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),mA=S.forwardRef($t(function(e,n){const{__scopeSelect:r,...o}=e;return d.jsx(pt.div,{"aria-hidden":!0,...o,ref:n})},"SelectSeparator")),w4="SelectBubbleInput",b4=S.forwardRef($t(function({__scopeSelect:e,...n},r){const o=bs(w4,e),{value:i,onValueChange:a,required:c,disabled:u,name:h,autoComplete:p,form:g}=o,{nativeOptions:v,nativeSelectKey:m}=o,C=S.useRef(null),b=Rt(r,C),w=i??"",_=sA(w),E=Array.from(v).some(I=>(I.props.value??"")==="");return S.useEffect(()=>{const I=C.current;if(!I)return;const k=window.HTMLSelectElement.prototype,M=Object.getOwnPropertyDescriptor(k,"value").set;if(_!==w&&M){const B=new Event("change",{bubbles:!0});M.call(I,w),I.dispatchEvent(B)}},[_,w]),d.jsxs(pt.select,{"aria-hidden":!0,required:c,tabIndex:-1,name:h,autoComplete:p,disabled:u,form:g,onChange:I=>a(I.target.value),...n,style:{...dS,...n.style},ref:b,defaultValue:w,children:[pd(i)&&!E?d.jsx("option",{value:""}):null,Array.from(v)]},m)},"SelectBubbleInput"));function vA(t){return typeof t=="function"}$t(vA,"isFunction");function pd(t){return t===""||t===void 0}$t(pd,"shouldShowPlaceholder");function xy(t){const e=gr(t),n=S.useRef(""),r=S.useRef(0),o=S.useCallback(a=>{const c=n.current+a;e(c),$t(function u(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>u(""),1e3))},"updateSearch")(c)},[e]),i=S.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}$t(xy,"useTypeaheadSearch");function _y(t,e,n){const o=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=yA(t,Math.max(i,0));o.length===1&&(a=a.filter(h=>h!==n));const u=a.find(h=>h.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}$t(_y,"findNextItem");function yA(t,e){return t.map((n,r)=>t[(e+r)%t.length])}$t(yA,"wrapArray");const wA=QB,bA=ZB,Sy=S.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(cA,{ref:r,className:Xe("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[e,d.jsx(e4,{asChild:!0,children:d.jsx(CR,{className:"h-4 w-4 opacity-50"})})]}));Sy.displayName=cA.displayName;const Ty=S.forwardRef(({className:t,children:e,position:n="popper",...r},o)=>d.jsx(o4,{children:d.jsx(lA,{ref:o,className:Xe("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:d.jsx(u4,{className:Xe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));Ty.displayName=lA.displayName;const C4=S.forwardRef(({className:t,...e},n)=>d.jsx(hA,{ref:n,className:Xe("px-2 py-1.5 text-sm font-semibold",t),...e}));C4.displayName=hA.displayName;const Nc=S.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(gA,{ref:r,className:Xe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[d.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(y4,{children:d.jsx(y0,{className:"h-4 w-4"})})}),d.jsx(m4,{children:e})]}));Nc.displayName=gA.displayName;const x4=S.forwardRef(({className:t,...e},n)=>d.jsx(mA,{ref:n,className:Xe("-mx-1 my-1 h-px bg-muted",t),...e}));x4.displayName=mA.displayName;const CA=[{value:"EDIT_DOCUMENT",label:"Chỉnh sửa"}];function _4({onClose:t,open:e,file:n,apiBaseUrl:r,rootUrlHostApi:o}){const[i,a]=D.useState("users"),[c,u]=D.useState(""),[h,p]=D.useState(""),[g,v]=D.useState(""),[m,C]=D.useState(""),[b,w]=D.useState(Eo.VIEW_DOCUMENT),[_,E]=D.useState([]),{users:I,groups:k,sharedUsers:A,sharedGroups:M,fetchData:B,loading:W,postGranted:Y,loadingGrandted:z,setSharedGroups:de,setSharedUsers:ne}=N5(r,o),ae=Xs(),Q=n?n.key:"",re=I.filter(te=>{var pe;return(ae==null?void 0:ae.id)!==te.id&&(te.username.toLowerCase().includes(c.toLowerCase())||((pe=te.email)==null?void 0:pe.toLowerCase().includes(c.toLowerCase())))}),j=k.filter(te=>te.groupname.toLowerCase().includes(h.toLowerCase())),se=A.filter(te=>{var pe,be;return((pe=te.username)==null?void 0:pe.toLowerCase().includes(g.toLowerCase()))||((be=te.email)==null?void 0:be.toLowerCase().includes(g.toLowerCase()))}),ie=M.filter(te=>{var pe;return(pe=te.groupname)==null?void 0:pe.toLowerCase().includes(m.toLowerCase())}),ce=()=>{i==="users"?(u(""),v("")):(p(""),C(""),a("users")),E([]),w(Eo.EDIT_DOCUMENT)};D.useEffect(()=>{e?B(Q):ce()},[e,Q]);const $=te=>{te!==i&&(i==="users"?(u(""),v("")):(p(""),C(""))),a(te)},Z=te=>{n&&E(pe=>{if(pe.find(Me=>Me.userId===te))return pe.filter(Me=>Me.userId!==te);const Pe={path:n.key+n.name,permissions:b,userId:te,grandtedBy:ae==null?void 0:ae.id};return[...pe,Pe]})},me=te=>{if(!n)return;const pe=te.groupname;E(be=>{if(be.find(fe=>fe.groupname===pe))return be.filter(fe=>fe.groupname!==pe);const Me={path:n.key+n.name,permissions:b,groupname:pe,groupId:te.id,grandtedBy:ae==null?void 0:ae.id,users:te.users};return[...be,Me]})},_e=async(te,pe,be)=>{const Ie={...te,permissions:pe};E(Pe=>{const Me=Pe.map(He=>He.id===Ie.id?Ie:He);return Pe.some(He=>He.id===Ie.id)||Me.push(Ie),Me}),be==="users"?ne(Pe=>Pe.map(Me=>Me.id===te.id?Ie:Me)):de(Pe=>Pe.map(Me=>Me.id===te.id?Ie:Me))},Ee=async()=>{if(n){const te=(n==null?void 0:n.key)||""+(n==null?void 0:n.name),pe=await Y(te,ae==null?void 0:ae.id,_);(pe==null?void 0:pe.status)==200&&E([])}},ke="flex-1 min-h-0 overflow-y-auto border rounded-lg px-3 py-2 bg-background shadow-sm";return n?d.jsx(yr,{open:e,onOpenChange:t,children:d.jsxs(Zn,{className:"max-w-5xl h-[80vh] flex flex-col overflow-hidden",children:[d.jsx(er,{children:d.jsxs(tr,{className:"text-lg font-semibold",children:["Chia sẻ tài liệu: ",n.name]})}),d.jsxs(uv,{defaultValue:"users",className:"flex-1 flex flex-col overflow-hidden",children:[d.jsxs(Nf,{className:"grid grid-cols-2 w-1/2 mx-auto mb-4 bg-muted rounded-lg",children:[d.jsx(na,{value:"users",className:"py-2",onClick:()=>$("users"),children:"Người dùng"}),d.jsx(na,{value:"groups",className:"py-2",onClick:()=>$("groups"),children:"Nhóm"})]}),d.jsx(gs,{value:"users",className:"flex-1 h-full min-h-0 overflow-hidden",children:d.jsxs("div",{className:"grid grid-cols-2 gap-6 h-full",children:[d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Chia sẻ với người dùng:"}),d.jsx(nr,{placeholder:"Tìm người dùng...",className:"mb-3 border-input bg-background shadow-sm",value:c,onChange:te=>u(te.target.value)}),d.jsx("div",{className:ke,children:W?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(Tt,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):re.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Không tìm thấy người dùng."}):d.jsx("ul",{className:"space-y-2",children:re.map(te=>d.jsx("li",{onClick:()=>Z(te.id),className:"flex flex-col space-y-1 cursor-pointer hover:bg-accent p-2 rounded-md transition-colors",children:d.jsxs("div",{className:"flex items-center space-x-3",children:[d.jsx(Zs,{id:`user-${te.id}`,checked:!!_.find(pe=>pe.userId===te.id)}),d.jsxs(Or,{className:"flex-1",children:[d.jsx("p",{className:"font-medium",children:te.username}),d.jsx("p",{className:"text-xs text-muted-foreground",children:te.email}),d.jsx("p",{className:"text-xs text-muted-foreground",children:te.groupname})]})]})},te.id))})})]}),d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Đã chia sẻ với người dùng:"}),d.jsx(nr,{placeholder:"Tìm người dùng đã chia sẻ...",className:"mb-3 border-input bg-background shadow-sm",value:g,onChange:te=>v(te.target.value)}),d.jsx("div",{className:ke,children:W?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(Tt,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):se.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Chưa chia sẻ với người dùng nào."}):d.jsx("ul",{className:"space-y-2",children:se.map(te=>d.jsxs("li",{className:"flex items-center justify-between gap-4 hover:bg-accent p-2 rounded-md transition-colors",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx("p",{className:"font-medium",children:te.username}),d.jsx("p",{className:"text-xs text-muted-foreground",children:te.email}),d.jsx("p",{className:"text-xs text-muted-foreground",children:te.groupname})]}),d.jsxs(wA,{value:te.permissions,onValueChange:pe=>_e(te,pe,"users"),disabled:te.permissions===Eo.OWNER_DOCUMENT,children:[d.jsx(Sy,{className:"w-[120px]",children:d.jsx(bA,{placeholder:"Chọn quyền"})}),d.jsxs(Ty,{children:[CA.map(pe=>d.jsx(Nc,{value:pe.value,children:pe.label},pe.value)),te.permissions===Eo.OWNER_DOCUMENT&&d.jsx(Nc,{value:Eo.OWNER_DOCUMENT,children:"Chủ sở hữu"},Eo.OWNER_DOCUMENT),d.jsx(Nc,{value:"None",children:"Thu hồi"},"None")]})]})]},te.id))})})]})]})}),d.jsx(gs,{value:"groups",className:"flex-1 h-full min-h-0 overflow-hidden",children:d.jsxs("div",{className:"grid grid-cols-2 gap-6 h-full",children:[d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Chia sẻ với nhóm:"}),d.jsx(nr,{placeholder:"Tìm nhóm...",className:"mb-3 border-input bg-background shadow-sm",value:h,onChange:te=>p(te.target.value)}),d.jsx("div",{className:ke,children:W?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(Tt,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):j.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Không tìm thấy nhóm."}):d.jsx("ul",{className:"space-y-2",children:j.map(te=>d.jsxs("li",{onClick:()=>me(te),className:"flex items-center space-x-3 cursor-pointer hover:bg-accent p-2 rounded-md transition-colors",children:[d.jsx(Zs,{id:`group-${te.groupname}`,checked:!!_.find(pe=>pe.groupname===te.groupname)}),d.jsxs(Or,{className:"font-medium",children:[d.jsx("p",{className:"font-medium",children:te.groupname}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["Số lượng: ",te.users||0]})]})]},te.groupname))})})]}),d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Đã chia sẻ với nhóm:"}),d.jsx(nr,{placeholder:"Tìm nhóm đã chia sẻ...",className:"mb-3 border-input bg-background shadow-sm",value:m,onChange:te=>C(te.target.value)}),d.jsx("div",{className:ke,children:W?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(Tt,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):ie.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Chưa chia sẻ với nhóm nào."}):d.jsx("ul",{className:"space-y-2",children:ie.map(te=>d.jsxs("li",{className:"flex items-center justify-between gap-4 hover:bg-accent p-2 rounded-md transition-colors",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx("p",{className:"font-medium",children:te.groupname}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["Số lượng: ",te.users||0]})]}),d.jsxs(wA,{value:te.permissions,onValueChange:pe=>_e(te,pe,"groups"),children:[d.jsx(Sy,{className:"w-[120px]",children:d.jsx(bA,{placeholder:"Chọn quyền"})}),d.jsxs(Ty,{children:[CA.map(pe=>d.jsx(Nc,{value:pe.value,children:pe.label},pe.value)),d.jsx(Nc,{value:"None",children:"Thu hồi"},"None")]})]})]},te.groupname))})})]})]})})]}),d.jsxs(io,{children:[d.jsx(je,{variant:"outline",onClick:t,children:"Huỷ"}),d.jsx(je,{variant:"default",onClick:Ee,disabled:_.length===0||z,className:"w-[120px] justify-center",children:z?d.jsx(Tt,{className:"h-4 w-4 animate-spin"}):"Lưu thay đổi"})]})]})}):null}function S4({open:t,onClose:e,onSave:n,file:r}){const[o,i]=D.useState(!!(r!=null&&r.isPublic));D.useEffect(()=>{i(!!(r!=null&&r.isPublic))},[r==null?void 0:r.isPublic]);const a=async()=>{n((r==null?void 0:r.key)||"",o),e()};return r?d.jsx(yr,{open:t,onOpenChange:e,children:d.jsxs(Zn,{className:"sm:max-w-[400px]",children:[d.jsx(er,{children:d.jsx(tr,{children:"Chỉnh sửa quyền riêng tư"})}),d.jsxs(Ei,{className:"s3-explr-dialog-description break-all whitespace-normal",children:["Tài liệu: ",r.key]}),d.jsxs("div",{className:"flex items-center justify-between py-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[o?d.jsx(IR,{className:"text-green-500",size:20}):d.jsx(kR,{className:"text-gray-500",size:20}),d.jsx(Or,{children:o?"Công khai":"Riêng tư"})]}),d.jsx(P0,{enabled:o,onChange:()=>i(c=>!c)})]}),d.jsxs(io,{children:[d.jsx(je,{variant:"outline",onClick:e,children:"Hủy"}),d.jsx(je,{onClick:a,children:"Lưu thay đổi"})]})]})}):null}const T4={},E4="AIzaSyDCtiG2RJwhgbsW_nsFd-XGm3GzuL_eYhQ",xA="345764457870-dgceeqdphprufcf4bhggs91aguk0as2n.apps.googleusercontent.com",Lr={current:!1},_A="crawl:jobs",Dc="crawl:current_job",A4=t=>{const[e,n]=D.useState(null),[r,o]=D.useState(0);return D.useEffect(()=>{const i=localStorage.getItem(Dc);if(i){const a=JSON.parse(i);n(a),a!=null&&a.startTime&&o(Math.floor((Date.now()-a.startTime)/1e3))}},[]),D.useEffect(()=>{if(!(e!=null&&e.startTime))return;const i=setInterval(()=>{o(Math.floor((Date.now()-e.startTime)/1e3))},1e3);return()=>clearInterval(i)},[e==null?void 0:e.startTime]),D.useEffect(()=>{if(!(e!=null&&e.id))return;const i=async()=>{try{const u=(await $e.get(`${t}/api/crawl/${e.id}?taskId=${e.taskId}`)).data;n(h=>{if(!h)return null;const p={...h,status:u};return localStorage.setItem(Dc,JSON.stringify(p)),(u.status==="completed"&&!u.isProcessing||u.status==="failed"||u.status==="blocked")&&setTimeout(()=>{n(null),localStorage.removeItem(Dc)},100),p})}catch(c){console.error("Error polling job status:",c)}},a=setInterval(i,1e4);return i(),()=>clearInterval(a)},[e==null?void 0:e.id,t]),{currentJob:e,elapsedTime:r,setCurrentJob:i=>{i&&!i.startTime&&(i.startTime=Date.now()),n(i),i?localStorage.setItem(Dc,JSON.stringify(i)):localStorage.removeItem(Dc)}}},ph=(t,e)=>{const n=[],r=o=>{(t[o]||[]).forEach(a=>{n.push(a.key),a.isFolder&&r(a.key)})};return r(e),n},I4=(t,e)=>{const n=[];return(t[e]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...ph(t,o.key))}),n},k4=(t,e,n=[],r,o,i,a,c,u,h,p)=>{const[g,v]=D.useState({}),[m,C]=D.useState(!1),[b,w]=D.useState(null),[_,E]=D.useState(!1),[I,k]=D.useState(0),[A,M]=D.useState(null),B=D.useRef(e);D.useEffect(()=>{B.current=e},[e]);const W=async()=>{var z,de;C(!0);try{const ne=Xs(),ae=await $e.get(`${t}/api/files`,{params:{cache:!1,displayPrefixes:JSON.stringify(n),prefix:B.current,userId:(ne==null?void 0:ne.id)||"",groupId:((z=ne==null?void 0:ne.group)==null?void 0:z.id)||"",groupname:(ne==null?void 0:ne.groupname)||"",page:i,limit:100},timeout:3e5}),Q=[],{pagination:re,workspaceRole:j,...se}=ae.data;j!==void 0&&(Ay=j||null),M(re||null),Cf.forEach(se,(ie,ce)=>{u!=null&&u.has(ce)&&Cf.forEach(ie,$=>{(h==null?void 0:h.current[$.key])!==!1&&Q.push($.key)})}),Q.length&&(p==null||p(ie=>{const ce=new Set(ie);return Q.forEach($=>ce.add($)),ce})),v(se),w(null),E(!1)}catch(ne){((de=ne==null?void 0:ne.response)==null?void 0:de.status)===404?(E(!0),w(null),v({})):(E(!1),w(ne instanceof Error?ne:new Error("Failed to fetch files")))}finally{C(!1),k(0),a("")}},Y=async z=>{var de,ne;try{if(!z)return;C(!0);const ae=await $e.get(`${t}/api/search-db?query=${z}&rootPrefix=${e}&offset=${(o-1)*20}&limit=20`,{timeout:3e5});return v({[e]:((de=ae==null?void 0:ae.data)==null?void 0:de.result)||[]}),k(((ne=ae==null?void 0:ae.data)==null?void 0:ne.estimatedTotalHits)||0),M(null),ae}catch(ae){w(ae instanceof Error?ae:new Error("Failed to fetch files"))}finally{C(!1)}};return D.useEffect(()=>{!r&&!m&&W(),r&&!m&&Y(r)},[r,o,i]),{data:g,isLoading:m,error:b,isolated:_,estimatedTotalHits:I,pagination:A,refetch:W}},pa=t=>{var r,o,i;const e=((i=(o=(r=t==null?void 0:t.name)==null?void 0:r.split("."))==null?void 0:o.pop())==null?void 0:i.toLowerCase())??"";return["txt","md","json","js","ts","jsx","tsx","css","html","xml","yaml","yml"].includes(e||"")},Fr=t=>{var r,o,i;if(!t)return!1;const e=((i=(o=(r=t==null?void 0:t.name)==null?void 0:r.split("."))==null?void 0:o.pop())==null?void 0:i.toLowerCase())??"";return["png","jpg","jpeg","gif","webp","bmp"].includes(e||"")},SA=t=>`${t.key}.ocr.txt`,P4={auth:{clientId:"584d5fa9-5123-4602-a1a5-a3746a83745f",authority:"https://login.microsoftonline.com/consumers",redirectUri:T4.VITE_ONE_DRIVE_REDIRECT_URI||"https://s3-explorer.cmcts1.studio.ai.vn/sharepoint/redirect"}},O4=new Gg(P4),Ey={[Eo.VIEW_DOCUMENT]:1,[Eo.DOWNLOAD_DOCUMENT]:2,[Eo.EDIT_DOCUMENT]:10,[Eo.OWNER_DOCUMENT]:100};let Ay=null;function N4(t){if(Ay)return Ay;const e=t||Xs();if(e!=null&&e.workspaceRole)return e.workspaceRole;const n=e==null?void 0:e.activeWorkspaceId,o=((e==null?void 0:e.assignedWorkspaces)||[]).find(i=>(i==null?void 0:i.id)===n);return(o==null?void 0:o.role)||null}const gd=()=>{const t=Xs();if(`${t==null?void 0:t.groupname}`.toUpperCase()==="MASTER_ADMIN")return!0;const e=`${t==null?void 0:t.role}`.toUpperCase();if(e==="ADMIN"||e==="SITE_ADMIN"||e==="MASTER_ADMIN")return!0;const n=`${N4(t)||""}`.toUpperCase();return n==="OWNER"||n==="ADMIN"},Ni=t=>gd()?!0:t?Ey[t]>=10:!1,D4=t=>gd()?!0:t?Ey[t]>=2:!1,M4=t=>gd()?!0:t?Ey[t]>=1:!1,TA="s3-explorer-active-workspace-id";function R4(){const t=new URL(window.location.href);if(!t.searchParams.has("prefix"))return;t.searchParams.delete("prefix");const e=t.searchParams.toString();window.history.replaceState({},"",`${t.pathname}${e?`?${e}`:""}${t.hash}`)}function L4(t){var o;const e=new URL(window.location.href).searchParams.get("prefix")||"",n=(o=Xs())==null?void 0:o.activeWorkspaceId,r=sessionStorage.getItem(TA);return n&&(sessionStorage.setItem(TA,n),r&&r!==n)?(R4(),t):e||t}const F4=D.memo(({homeLabel:t="Kho tài liệu",apiBaseUrl:e=ud,rootPrefix:n="",rootUrlHostApi:r="http://localhost:3003/api/v1/",hiddenSynchronization:o=!1,asSelector:i=!1,onSelected:a=p=>console.log("Đã chọn:",p),displayPrefixes:c,preSelectedFiles:u,idCreator:h})=>{var Yh,qd;const[p,g]=D.useState([]),[v,m]=D.useState(""),[C,b]=D.useState(new Set(u)),[w,_]=D.useState(()=>L4(n)),[E,I]=D.useState(""),[k,A]=D.useState(!1),[M,B]=D.useState(""),[W,Y]=D.useState(!1),[z,de]=D.useState(null),[ne,ae]=D.useState(null),[Q,re]=D.useState(!1),[j,se]=D.useState(!1),[,ie]=D.useState(null),ce=D.useRef(null),{toast:$}=Zl(),[Z,me]=D.useState(null),[_e,Ee]=D.useState(null),[ke,te]=D.useState(null),[pe,be]=D.useState(""),[Ie,Pe]=D.useState(!1),[Me,fe]=D.useState(!1),[He,Ut]=D.useState(new Set),[ct,ze]=D.useState(""),[wt,vt]=D.useState(!1),[qt,An]=D.useState(!1),[In,At]=D.useState("rename"),[co,sr]=D.useState(!1),[De,qe]=D.useState(""),[kt,Et]=D.useState("1"),[Ht,dn]=D.useState("10"),[L,X]=D.useState(!1),[ee,Ce]=D.useState(!1),[Se,Oe]=D.useState(!1),[Ne,Re]=D.useState(!1),[Ge,bt]=D.useState(1),[Pt,Gn]=D.useState(1),[xr,Po]=D.useState(!1),{currentJob:Ye,elapsedTime:Ln,setCurrentJob:Lc}=A4(e),[$r,ma]=D.useState(null),[va,Fc]=D.useState(""),[bd,ya]=D.useState(!1),[xs,xh]=D.useState(""),[Fy,_h]=D.useState(!1),[$y,Sh]=D.useState(!1),[wa,Th]=D.useState([]),[ba,Cd]=D.useState(!1),[$c,Uy]=D.useState(""),Di=D.useRef({}),[Eh,Uc]=D.useState(null),[Hc,_s]=D.useState(null),[Hy,Ss]=D.useState(!1);D.useEffect(()=>{Ye&&Ye.status&&Ss(!0)},[Ye==null?void 0:Ye.id]);const By=async x=>{Sh(!0);try{const R=await $e.get(`${r}get-knowledge-base/knowledge-base-name/${x}`,{headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjAyOTliMmIwLTk4MGEtNGQ1Yy04NjkyLWJjNjllM2I1NzZlMiIsInVzZXJuYW1lIjoiY21jX3RzX2FkbWluIiwiaWF0IjoxNzQ3MTk0MTg3fQ.7LB2rgd0fQnhZP_cFgTTCPMSYl0_apwffcNEd7oqjeM"}});R.status===200&&Th(R.data.knowledgeBase.chatflows.map(N=>({...N,KnowledgeBaseId:R.data.knowledgeBase.knowledge_base_id})))}catch{}finally{Sh(!1)}};D.useEffect(()=>{xs&&r&&By(xs)},[xs]),D.useEffect(()=>{console.log("pre selected files",u)},[u]);const[Ot,xd]=D.useState(null),[zy,Ah]=D.useState(!1),[Vy,_d]=D.useState(!1),[Ih,Bc]=D.useState(!1),[Sd,Td]=D.useState([]),[zc,Ed]=D.useState([]),[lo,Ad]=D.useState([{id:"root",name:"OneDrive"}]),[kh,Mi]=D.useState(!1),[Ri,Ca]=D.useState([]),[xa,ei]=D.useState(new Set),[Id,Ts]=D.useState(!1),[kd,_a]=D.useState([]),[Vc,ti]=D.useState([]),[Li,Fi]=D.useState([]),[Kc,$i]=D.useState(new Set),[Es,Sa]=D.useState([{id:"root",name:"SharePoint"}]),[Ta,Pd]=D.useState(new Map),[As,Ea]=D.useState(!1),[Od,Ky]=D.useState([]),[Dt,Gc]=D.useState(null),[Gy,Aa]=D.useState(!1),[jy,jc]=D.useState(!1),[Oo,Nd]=D.useState(!1),Mt=new URL(window.location.href).searchParams.get("prefix")||""||E||w||n,{data:Ur,isLoading:No,error:Wy,isolated:Ph,estimatedTotalHits:Ia,pagination:Is,refetch:kn}=k4(e,Mt,c,v,Ge,Pt,m,h,C,Di,b),[Dd,Xt]=D.useState(!1),ka=D.useRef(null),Hr=Xs(),jn=(()=>{const x=localStorage.getItem("dataLogin");try{if(x){const R=JSON.parse(x);return(R==null?void 0:R.user)??null}}catch{return null}return null})(),un=(jn==null?void 0:jn.id)||"0299b2b0-980a-4d5c-8692-bc69e3b576e2",ks={id:"root",name:"My Drive"},[Nh,Ui]=D.useState(!1),[Pa,Oa]=D.useState(!1),[Ps,Wn]=D.useState([ks]),[Dh,ar]=D.useState([]),[Mh,Md]=D.useState(!1),[uo,Na]=D.useState(!1),[Do,Zt]=D.useState([]),[tn,Da]=D.useState(null),[Wc,qc]=D.useState(!1),[Rh,Ma]=D.useState(!1),[qy,Rd]=D.useState(null),[Yc,Hi]=D.useState(null),[Lh,Ld]=D.useState(null),[Fd,Ra]=D.useState(!1),[,Qc]=D.useState(!1),[$d,Ud]=D.useState(!1),[Jc,Hd]=D.useState(null),Bd=Do.find(x=>x.id===tn)??null,Xc=(Bd==null?void 0:Bd.syncedFolders)??[];D.useEffect(()=>{if(!Dd)return;function x(R){ka.current&&!ka.current.contains(R.target)&&Xt(!1)}return document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}},[Dd]);const _r=async()=>{try{const x=await $e.get(`${e}/api/login-sharepoint`),{loginUrl:R}=x.data,N=window.open(R,"SharePoint Login","width=600,height=600");if(!N)throw new Error("Không thể mở cửa sổ pop-up");N.focus();const G=setInterval(()=>{try{if(N.closed){clearInterval(G);return}const U=N.location.href;if(U.includes("code=")){const V=new URL(U).searchParams.get("code");V&&(Os(V),N.close(),clearInterval(G))}}catch(U){U instanceof Error&&!U.message.includes("cross-origin")&&console.error("SharePoint login error:",U)}},1e3)}catch(x){Ve.error("Lỗi khi đăng nhập SharePoint: "+(x instanceof Error?x.message:"Lỗi không xác định"))}},zd=async()=>{try{_a([]),ti([]),Fi([]),$i(new Set),Sa([{id:"root",name:"SharePoint"}]),Pd(new Map),window.location.href="https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri="+encodeURIComponent(window.location.origin),$({title:"Success",description:"Logged out from SharePoint"})}catch(x){console.error("Error logging out from SharePoint:",x),$({title:"Error",description:"Failed to logout from SharePoint",variant:"destructive"})}},Os=async x=>{try{const R=await $e.post(`${e}/api/get-sharepoint-access-token`,{code:x,userId:"1"}),{accessToken:N,refreshToken:G}=R.data;localStorage.setItem("sharepoint_access_token",N),localStorage.setItem("refresh_sharepoint_access_token",G),_d(!0),Ea(!0)}catch(R){console.error("❌ Error fetching SharePoint access token:",R),$({title:"Error",description:"Failed to connect to SharePoint",variant:"destructive"})}},Fh=async()=>{try{Ts(!0);const R=(await $e.post(`${e}/api/list-site-sharepoint`,{userId:"1"})).data.sites.map(N=>{const G=new URL(N.webUrl);return{id:N.id,name:N.name,description:N.description,hostname:N.hostname||G.hostname,sitePath:N.sitePath||G.pathname.replace(/^\/+/,"")}});console.log("data",R),Ky(R),Ts(!1)}catch(x){console.error("❌ Error fetching SharePoint sites:",x),$({title:"Error",description:"Failed to fetch SharePoint sites",variant:"destructive"}),Ts(!1)}},$h=async x=>{Gc(x),console.log(x),await Zc("root",x.name,x.hostname||"",x.sitePath||"")},Zc=async(x,R,N,G)=>{try{Ts(!0);const V=(await $e.post(`${e}/api/list-file-sharepoint`,{folderId:x,userId:"1",hostname:N,sitePath:G})).data.files.map(xe=>({id:xe.id,name:xe.name,size:xe.size??0,lastModified:xe.lastModifiedDateTime?new Date(xe.lastModifiedDateTime):new Date,contentType:xe.mimeType??void 0,isFolder:xe.type==="folder",parentId:xe.parentId??""})),le=V.map(xe=>({id:xe.id,name:xe.name,isFolder:xe.isFolder,parentId:xe.parentId??""}));Pd(xe=>{const Le=new Map(xe);return Le.set(x,le),Le}),ti(V.filter(xe=>xe.isFolder)),_a(V.filter(xe=>!xe.isFolder)),Ea(!0),Sa(xe=>xe.some(Le=>Le.id===x)?xe:[...xe,{id:x,name:R==="root"?"SharePoint":R}]),Ts(!1)}catch(U){console.error("❌ Error fetching SharePoint files:",U),$({title:"Error",description:"Failed to fetch SharePoint files",variant:"destructive"}),Ts(!1)}},Uh=(x,R,N)=>{const G=N.slice(1).map(U=>U.id);return R.some(U=>U.isFolder?G.includes(U.id):!1)},La=(x,R,N=new Set)=>{if(N.has(x))return new Set;N.add(x);const G=new Set,U=R.get(x);if(!U)return G;for(const V of U)G.add(V.id),V.isFolder&&La(V.id,R,N).forEach(xe=>G.add(xe));return G},Yy=(x,R,N)=>{const G=La(x,N);return Array.from(R).some(U=>G.has(U))},Hh=(x,R,N,G)=>{const U=G.get(x);if(!U||U.length===0)return!1;for(const V of U){const le=R.has(V.id);if(N.some(Le=>Le.id===V.id))return!1;if(!le)if(V.isFolder){if(!Hh(V.id,R,N,G))return!1}else return!1}return!0},Ns=(x,R,N,G,U)=>{const V=R.some(Le=>Le.id===x.id),le=Uh(x,R,G),xe=N.has(x.id);return V&&x.isFolder?Yy(x.id,N,U)?"indeterminate":!0:!!(V||le&&!xe)},Qy=(x,R,N)=>{let G=[...R],U=new Set(x),V=!0;for(;V;){V=!1;for(const le of G){if(!le.isFolder)continue;if(Hh(le.id,U,G,N)){G=G.filter(Je=>Je.id!==le.id),La(le.id,N).forEach(Je=>U.delete(Je)),V=!0;break}}}return{updatedSelected:G,updatedExcluded:U}},Jy=x=>{const R=Li.some(U=>U.id===x.id),N=Uh(x,Li,Es),G=Kc.has(x.id);if(R){if(Fi(U=>U.filter(V=>V.id!==x.id)),x.isFolder){const U=La(x.id,Ta);$i(V=>{const le=new Set(V);return U.forEach(xe=>le.delete(xe)),le})}}else if(N&&!G){const U=new Set(Kc).add(x.id),{updatedSelected:V,updatedExcluded:le}=Qy(U,Li,Ta);Fi(V),$i(le)}else if(N&&G)$i(U=>{const V=new Set(U);return V.delete(x.id),V});else{const U=Es.slice(1).map(V=>V.id);if(Fi(V=>V.some(le=>le.id===x.id)?V:[...V,{id:x.id,name:x.name,size:x.size,lastModified:x.lastModified,contentType:x.contentType,isFolder:x.isFolder,parentId:x.parentId,ancestorIds:U}]),x.isFolder){Fi(le=>le.filter(xe=>xe.id===x.id?!0:!xe.ancestorIds.includes(x.id)));const V=La(x.id,Ta);$i(le=>{const xe=new Set(le);return V.forEach(Le=>xe.delete(Le)),xe})}}},Vd=x=>{var N;Sa(G=>G.slice(0,x+1));const R=(N=Es[x])==null?void 0:N.id;R&&Zc(R,"SharePoint",(Dt==null?void 0:Dt.hostname)||"",(Dt==null?void 0:Dt.sitePath)||"")},Bh=async(x,R,N)=>{const G=localStorage.getItem("sharepoint_access_token");if(!G){Ve.error("Không tìm thấy access token. Vui lòng đăng nhập lại.");return}const U=Ve.loading("Đang đồng bộ SharePoint...",{position:"bottom-right",autoClose:!1});try{const V={prefix:R,folders:[],files:[],hostname:(Dt==null?void 0:Dt.hostname)||"",sitePath:(Dt==null?void 0:Dt.sitePath)||"",isAutoUpdateKB:Oo,refreshAccessToken:localStorage.getItem("refresh_sharepoint_access_token")||"",excludedIds:Array.from(N)},le=new Set(x.filter(Je=>Je.isFolder).map(Je=>Je.id)),xe=new Set;x.forEach(Je=>{xe.has(Je.id)||Je.ancestorIds.some(mn=>le.has(mn))||(xe.add(Je.id),Je.isFolder?V.folders.push({id:Je.id,name:Je.name}):V.files.push({id:Je.id,name:Je.name}))});const Le=await $e.post(`${e}/api/sync-sharepoint-to-s3`,V,{headers:{Authorization:`Bearer ${G}`}});kn(),Ve.update(U,{render:`Đồng bộ thành công! Đã tải lên ${Le.data.uploadedKeys.length} file.`,type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"}),Ea(!1)}catch(V){console.error("Lỗi khi đồng bộ file từ SharePoint:",V),Ve.update(U,{render:"Không thể đồng bộ file từ SharePoint.",type:"error",isLoading:!1,autoClose:3e3,position:"bottom-right"})}},Mo=()=>{Ea(!1),_a([]),ti([]),Fi([]),$i(new Set),Sa([{id:"root",name:"SharePoint"}]),Pd(new Map)};D.useEffect(()=>{if(As){const R=new URLSearchParams(window.location.search).get("code");R&&(Os(R),window.history.replaceState({},document.title,window.location.pathname))}},[As]),D.useEffect(()=>{O4.initialize().then(()=>{Ah(!0)}).catch(x=>console.error("❌ Lỗi khởi tạo MSAL:",x))},[]),D.useEffect(()=>{el()},[]);async function el(){localStorage.getItem("onedrive_access_token")&&_d(!0)}const zh=(x,R,N)=>{const G=N.slice(1).map(U=>U.id);return R.some(U=>U.isFolder?G.includes(U.id):!1)},Xy=(x,R)=>{const N=R.slice(1).map(G=>G.id);for(let G=N.length-1;G>=0;G--){const U=N[G],V=x.find(le=>le.isFolder&&le.id===U);if(V)return V}return null},Zy=(x,R,N,G)=>{const U=R.some(xe=>xe.id===x.id),V=zh(x,R,G),le=N.has(x.id);return U&&x.isFolder?Array.from(N).some(Le=>{const Je=R.find(lt=>lt.id===Le);return Je?Je.ancestorIds.includes(x.id):G.slice(1).some(lt=>lt.id===x.id)})?"indeterminate":!0:!!(U||V&&!le)},Bi=x=>{const R=Ri.some(V=>V.id===x.id),N=zh(x,Ri,lo),G=xa.has(x.id),U=[...Sd,...zc];if(R)Ca(V=>V.filter(le=>le.id!==x.id)),x.isFolder&&ei(V=>{const le=new Set(V);return V.forEach(xe=>{U.forEach(Le=>{Le.id===xe&&Le.parentId===x.id&&le.delete(xe)})}),le});else if(N&&!G){const V=new Set(xa).add(x.id),le=Xy(Ri,lo);le&&U.every(Le=>V.has(Le.id))&&U.length>0?(Ca(Le=>Le.filter(Je=>Je.id!==le.id)),ei(Le=>{const Je=new Set(Le);return U.forEach(lt=>Je.delete(lt.id)),Je})):ei(V)}else if(N&&G)ei(V=>{const le=new Set(V);return le.delete(x.id),le});else{const V=lo.slice(1).map(le=>le.id);Ca(le=>le.some(xe=>xe.id===x.id)?le:[...le,{id:x.id,name:x.name,size:x.size,lastModified:x.lastModified,contentType:x.contentType,isFolder:x.isFolder,parentId:x.parentId,ancestorIds:V}]),x.isFolder&&(Ca(le=>le.filter(xe=>xe.id===x.id?!0:!xe.ancestorIds.includes(x.id))),ei(le=>{const xe=new Set(le);return U.forEach(Le=>{Le.parentId===x.id&&xe.delete(Le.id)}),xe}))}};function Sr(x){if(x===0)return"0 B";const R=1024,N=["B","KB","MB","GB","TB"],G=Math.floor(Math.log(x)/Math.log(R));return parseFloat((x/Math.pow(R,G)).toFixed(1))+" "+N[G]}function Vh(x){const R=new Date(x);return R.toLocaleDateString()+" "+R.toLocaleTimeString()}const ew=async()=>{try{const x=await $e.get(`${e}/api/login-one-drive`),{loginUrl:R}=x.data,N=window.open(R,"OneDrive Login","width=600,height=600");if(!N)throw new Error("Không thể mở cửa sổ pop-up");N.focus();const G=setInterval(()=>{try{if(N.closed){clearInterval(G);return}const U=N.location.href;if(U.includes("code=")){const V=new URL(U).searchParams.get("code");V&&(nw(V),N.close(),clearInterval(G))}}catch(U){U instanceof Error&&!U.message.includes("cross-origin")&&console.error("OneDrive login error:",U)}},1e3)}catch(x){Ve.error("Lỗi khi đăng nhập OneDrive: "+(x instanceof Error?x.message:"Lỗi không xác định"))}},tw=async()=>{try{await $e.post(`${e}/api/logout-one-drive`),localStorage.removeItem("onedrive_access_token"),localStorage.removeItem("onedrive_refresh_access_token"),Ve.success("Đã đăng xuất khỏi OneDrive"),window.location.href="https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri="+encodeURIComponent(window.location.origin)}catch(x){Ve.error("Lỗi khi đăng xuất OneDrive: "+(x instanceof Error?x.message:"Lỗi không xác định"))}},nw=async x=>{try{const R=jn==null?void 0:jn.id,N=await $e.post(`${e}/api/get-one-drive-access-token`,{authorizationCode:x,userId:R}),{accessToken:G,refreshToken:U}=N.data;localStorage.setItem("onedrive_access_token",G),localStorage.setItem("onedrive_refresh_access_token",U),_d(!0),Bc(!0),await tl("root","One Drive")}catch(R){console.error("❌ Lỗi khi lấy Access Token:",R)}},tl=async(x,R)=>{try{Mi(!0);const N=jn==null?void 0:jn.id,U=(await $e.post(`${e}/api/list-file-one-drive`,{folderId:x,userId:N})).data.map(V=>({id:V.id,name:V.name,size:V.size??0,lastModified:V.lastModifiedDateTime?new Date(V.lastModifiedDateTime):new Date,contentType:V.mimeType??void 0,isFolder:V.type==="folder",parentId:V.parentId??""}));Td(U.filter(V=>V.isFolder)),Ed(U.filter(V=>!V.isFolder)),Bc(!0),Ad(V=>V.some(le=>le.id===x)?V:[...V,{id:x,name:R==="root"?"OneDrive":R}]),Mi(!1)}catch(N){console.error("Lỗi lấy danh sách file:",N),Mi(!1)}},rw=x=>{if(x===lo.length-1)return;const R=lo[x];R&&(Ad(lo.slice(0,x+1)),tl(R.id,R.name))},Ds=async(x,R,N)=>{const G=localStorage.getItem("onedrive_access_token"),U=localStorage.getItem("onedrive_refresh_access_token");if(!G){Ve.error("Không tìm thấy access token. Vui lòng đăng nhập lại.");return}const V=Ve.loading("Đang đồng bộ OneDrive...",{position:"bottom-right",autoClose:!1});try{const le={prefix:R,folders:[],files:[],isAutoUpdateKB:Oo,refreshAccessToken:U,excludedIds:Array.from(N)},xe=new Set(x.filter(lt=>lt.isFolder).map(lt=>lt.id)),Le=new Set;x.forEach(lt=>{Le.has(lt.id)||lt.ancestorIds.some(fn=>xe.has(fn))||(Le.add(lt.id),lt.isFolder?le.folders.push({id:lt.id,name:lt.name}):le.files.push({id:lt.id,name:lt.name}))});const Je=await $e.post(`${e}/api/sync-one-drive-to-s3`,le,{headers:{Authorization:`Bearer ${G}`}});kn(),Ve.update(V,{render:`Đồng bộ thành công! Đã tải lên ${Je.data.uploadedKeys.length} file.`,type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"})}catch(le){console.error("Lỗi khi đồng bộ file từ OneDrive:",le),Ve.update(V,{render:"Không thể đồng bộ file từ OneDrive.",type:"error",isLoading:!1,autoClose:3e3,position:"bottom-right"})}},J=()=>{Bc(!1),Ad([{id:"root",name:"OneDrive"}]),Td([]),Ed([]),Ca([]),ei(new Set),Mi(!1)},ge=()=>new Promise((x,R)=>{var V;if((V=window.google)!=null&&V.picker){x();return}const N=()=>window.gapi.load("picker",()=>x()),G=document.querySelector('script[data-google-api="1"]');if(G){window.gapi?N():G.addEventListener("load",N);return}const U=document.createElement("script");U.src="https://apis.google.com/js/api.js",U.dataset.googleApi="1",U.onload=N,U.onerror=()=>R(new Error("Không tải được Google Picker API")),document.body.appendChild(U)}),ue=()=>new Promise((x,R)=>{var U,V;if((V=(U=window.google)==null?void 0:U.accounts)!=null&&V.oauth2){x();return}const N=document.querySelector('script[data-gsi="1"]');if(N){N.addEventListener("load",()=>x());return}const G=document.createElement("script");G.src="https://accounts.google.com/gsi/client",G.dataset.gsi="1",G.onload=()=>x(),G.onerror=()=>R(new Error("Không tải được Google Identity Services")),document.body.appendChild(G)}),Ke=async(x,R)=>{var G,U,V,le,xe;const N=Ve.loading("Đang đồng bộ...",{position:"bottom-right",autoClose:!1});try{const Le={prefix:w,userId:un,googleAccountId:x,enableRealtime:!0,folders:[],files:[]};R.forEach(vn=>{vn.mimeType==="application/vnd.google-apps.folder"?Le.folders.push({id:vn.id,name:vn.name}):Le.files.push({id:vn.id,name:vn.name})});const Je=await $e.post(`${e}/api/sync-drive-to-s3`,Le);Lr.current=!0,kn(),Vt();const lt=((G=Je.data)==null?void 0:G.watch)??[],mn=lt.filter(vn=>!vn.error),fn=lt.filter(vn=>vn.error);let qn=`Đồng bộ thành công! Đã tải lên ${((V=(U=Je.data)==null?void 0:U.uploadedKeys)==null?void 0:V.length)??0} file.`;mn.length>0&&(qn+=` Đã bật đồng bộ tự động cho ${mn.length} thư mục.`),Le.files.length>0&&(qn+=` ${Le.files.length} file lẻ chỉ đồng bộ một lần (chọn cả thư mục để theo dõi tự động).`),fn.length>0&&(qn+=` Không bật được đồng bộ tự động: ${fn[0].error}`),Ve.update(N,{render:qn,type:fn.length>0&&mn.length===0?"warning":"success",isLoading:!1,autoClose:5e3,position:"bottom-right"})}catch(Le){console.error("❌ Lỗi khi đồng bộ file từ Google Drive:",Le),Ve.update(N,{render:`Không thể đồng bộ file từ Google Drive: ${((xe=(le=Le==null?void 0:Le.response)==null?void 0:le.data)==null?void 0:xe.error)||Le.message}`,type:"error",isLoading:!1,autoClose:5e3,position:"bottom-right"})}},at=async(x,R)=>{var G,U;Qc(!0);const N=performance.now();console.log("[Picker] start — account:",R,"id:",x);try{await ge(),console.log(`[Picker] scripts ready — ${(performance.now()-N).toFixed(0)}ms`);const{data:V}=await $e.get(`${e}/api/google-drive-picker-token`,{params:{userId:un,googleAccountId:x}}),le=(V==null?void 0:V.accessToken)??null;if(le&&console.log(`[Picker] server token received — ${(performance.now()-N).toFixed(0)}ms`),!le)throw new Error("Không nhận được access token");console.log(`[Picker] building picker — ${(performance.now()-N).toFixed(0)}ms`);const xe=new window.google.picker.DocsView(window.google.picker.ViewId.DOCS).setIncludeFolders(!0).setSelectFolderEnabled(!0);Jc&&xe.setParent(Jc);const Le=new window.google.picker.PickerBuilder().setDeveloperKey(E4).setOAuthToken(le).enableFeature(window.google.picker.Feature.MULTISELECT_ENABLED).setLocale("vi").addView(xe).setCallback(async Je=>{var lt;if(Je.action===window.google.picker.Action.PICKED){const mn=(lt=Je.docs[0])==null?void 0:lt.parentId;mn&&Hd(mn);const fn=Je.docs.map(qn=>({id:qn.id,name:qn.name,mimeType:qn.mimeType}));await Ke(x,fn)}}).build();console.log(`[Picker] setVisible — ${(performance.now()-N).toFixed(0)}ms`),Le.setVisible(!0)}catch(V){Ve.error(`Không thể mở Google Picker: ${((U=(G=V==null?void 0:V.response)==null?void 0:G.data)==null?void 0:U.error)||V.message}`,{position:"bottom-right"})}finally{Qc(!1)}},_t=async(x,R)=>{var N,G;if(R!=null){Md(!0);try{const{data:U}=await $e.post(`${e}/api/list-file-google-drive`,{folderId:x,userId:un,googleAccountId:R}),V=Array.isArray(U)?U:[];ar(V.filter(le=>le.mimeType==="application/vnd.google-apps.folder"))}catch(U){Ve.error(`Không thể tải danh sách thư mục Drive: ${((G=(N=U==null?void 0:U.response)==null?void 0:N.data)==null?void 0:G.error)||U.message}`,{position:"bottom-right"}),ar([])}finally{Md(!1)}}},Vt=async()=>{var x,R;qc(!0);try{const{data:N}=await $e.get(`${e}/api/google-drive-sync-status`,{params:{userId:un}}),G=(N==null?void 0:N.accounts)||[];return Zt(G),G}catch(N){return Ve.error(`Không thể tải danh sách tài khoản Google Drive: ${((R=(x=N==null?void 0:N.response)==null?void 0:x.data)==null?void 0:R.error)||N.message}`,{position:"bottom-right"}),Zt([]),[]}finally{qc(!1)}},Kt=()=>{Ra(!0),Vt()},nl=async(x,R,N)=>{var G,U;Ld(`${x}:${R}`);try{await $e.post(`${e}/api/unwatch-google-drive-folder`,{userId:un,googleAccountId:x,folderId:R}),Ve.success(`Đã ngừng đồng bộ realtime cho "${N}".`,{position:"bottom-right"}),await Vt()}catch(V){Ve.error(`Không thể ngừng đồng bộ "${N}": ${((U=(G=V==null?void 0:V.response)==null?void 0:G.data)==null?void 0:U.error)||V.message}`,{position:"bottom-right"})}finally{Ld(null)}},ow=async(x,R)=>{var N,G;Rd(x);try{await $e.post(`${e}/api/disconnect-google-drive-account`,{userId:un,googleAccountId:x}),Ve.success(`Đã ngắt kết nối ${R||"tài khoản Google"}.`,{position:"bottom-right"});const U=await Vt();Da(V=>{var le;return V===x?((le=U[0])==null?void 0:le.id)??null:V})}catch(U){Ve.error(`Không thể ngắt kết nối tài khoản: ${((G=(N=U==null?void 0:U.response)==null?void 0:N.data)==null?void 0:G.error)||U.message}`,{position:"bottom-right"})}finally{Rd(null)}},Br=async(x,R)=>{var N,G;Hi(x);try{await $e.post(`${e}/api/stop-watch-google-drive`,{userId:un,googleAccountId:x}),Ve.success(`Đã dừng đồng bộ realtime cho ${R||"tài khoản Google"}.`,{position:"bottom-right"}),await Vt()}catch(U){Ve.error(`Không thể dừng đồng bộ: ${((G=(N=U==null?void 0:U.response)==null?void 0:N.data)==null?void 0:G.error)||U.message}`,{position:"bottom-right"})}finally{Hi(null)}},Jr=D.useRef(null);D.useEffect(()=>{ue().catch(()=>{}),ge().catch(()=>{})},[]),D.useEffect(()=>{!Pa||tn==null||(Wn([ks]),_t("root",tn))},[tn,Pa]);const iw=x=>{Wn(R=>[...R,{id:x.id,name:x.name}]),_t(x.id,tn)},Ms=x=>{Wn(R=>{const N=R.slice(0,x+1);return _t((N[N.length-1]??ks).id,tn),N})},rl=async x=>{var R,N,G,U;Ui(!0);try{const V=await $e.post(`${e}/api/get-google-drive-access-token`,{authorizationCode:x,userId:un,redirectUri:"postmessage"});Ve.success("Đã kết nối Google Drive. Đang mở chọn thư mục...",{position:"bottom-right"});const le=await Vt(),Le=((R=V.data)!=null&&R.googleAccountId?le.find(Je=>Je.id===V.data.googleAccountId):(N=V.data)!=null&&N.email?le.find(Je=>Je.email===V.data.email):null)??le[le.length-1];Le&&at(Le.id,Le.email)}catch(V){Ve.error(`Không thể kết nối Google Drive: ${((U=(G=V==null?void 0:V.response)==null?void 0:G.data)==null?void 0:U.error)||V.message}`,{position:"bottom-right"})}finally{Ui(!1)}},ol=async()=>{var x,R,N,G;Ui(!0);try{(R=(x=window.google)==null?void 0:x.accounts)!=null&&R.oauth2||await ue(),window.google.accounts.oauth2.initCodeClient({client_id:xA,scope:"https://www.googleapis.com/auth/drive.readonly openid email",redirect_uri:"postmessage",ux_mode:"popup",callback:V=>{Jr.current&&(clearTimeout(Jr.current),Jr.current=null),V!=null&&V.code?rl(V.code):(Ui(!1),Ve.error(`Đăng nhập Google Drive thất bại: ${(V==null?void 0:V.error_description)||(V==null?void 0:V.error)||"không có mã xác thực"}`,{position:"bottom-right"}))}}).requestCode(),Jr.current=window.setTimeout(()=>{Ui(!1),Ve.error("Đăng nhập Google Drive không phản hồi. Vui lòng thử lại.",{position:"bottom-right"})},6e4)}catch(U){Ui(!1),Ve.error(`Không thể bắt đầu đăng nhập Google Drive: ${((G=(N=U==null?void 0:U.response)==null?void 0:N.data)==null?void 0:G.error)||U.message}`,{position:"bottom-right"})}},Nt=async()=>{var x,R,N,G;Ma(!0);try{(R=(x=window.google)==null?void 0:x.accounts)!=null&&R.oauth2||await ue(),window.google.accounts.oauth2.initCodeClient({client_id:xA,scope:"https://www.googleapis.com/auth/drive.readonly openid email",redirect_uri:"postmessage",ux_mode:"popup",callback:V=>{if(Jr.current&&(clearTimeout(Jr.current),Jr.current=null),!(V!=null&&V.code)){Ma(!1),Ve.error(`Đăng nhập Google Drive thất bại: ${(V==null?void 0:V.error_description)||(V==null?void 0:V.error)||"không có mã xác thực"}`,{position:"bottom-right"});return}(async()=>{var le,xe,Le,Je;try{const lt=await $e.post(`${e}/api/get-google-drive-access-token`,{authorizationCode:V.code,userId:un,redirectUri:"postmessage"});Ve.success(`Đã kết nối thêm tài khoản Google${(le=lt.data)!=null&&le.email?`: ${lt.data.email}`:""}.`,{position:"bottom-right"});const mn=await Vt(),fn=(xe=lt.data)==null?void 0:xe.googleAccountId;fn!=null&&mn.some(qn=>qn.id===fn)&&Da(fn)}catch(lt){Ve.error(`Không thể kết nối thêm tài khoản Google: ${((Je=(Le=lt==null?void 0:lt.response)==null?void 0:Le.data)==null?void 0:Je.error)||lt.message}`,{position:"bottom-right"})}finally{Ma(!1)}})()}}).requestCode(),Jr.current=window.setTimeout(()=>{Ma(!1),Ve.error("Đăng nhập Google Drive không phản hồi. Vui lòng thử lại.",{position:"bottom-right"})},6e4)}catch(U){Ma(!1),Ve.error(`Không thể bắt đầu đăng nhập Google Drive: ${((G=(N=U==null?void 0:U.response)==null?void 0:N.data)==null?void 0:G.error)||U.message}`,{position:"bottom-right"})}},sw=async()=>{var R,N,G,U,V;if(tn==null){Ve.error("Chưa chọn tài khoản Google Drive để đồng bộ.",{position:"bottom-right"});return}const x=Ps[Ps.length-1]??ks;Na(!0);try{const le=await $e.post(`${e}/api/sync-drive-to-s3`,{prefix:w,folders:[{id:x.id,name:x.id==="root"?"My Drive":x.name}],files:[],enableRealtime:!0,userId:un,googleAccountId:tn}),xe=((N=(R=le.data)==null?void 0:R.uploadedKeys)==null?void 0:N.length)??0,Le=((G=le.data)==null?void 0:G.watch)??[],Je=Le.filter(fn=>!fn.error),lt=Le.filter(fn=>fn.error);let mn=`Đã đồng bộ ${xe} file.`;Je.length>0&&(mn+=` Đã bật đồng bộ tự động cho "${x.name}".`),lt.length>0&&(mn+=` Không thể bật đồng bộ tự động: ${lt[0].error}`),x.id==="root"&&(mn+=" (Chọn một thư mục con cụ thể để bật đồng bộ tự động.)"),lt.length>0&&Je.length===0?Ve.error(mn,{position:"bottom-right"}):Ve.success(mn,{position:"bottom-right"}),Lr.current=!0,kn(),Vt(),Oa(!1)}catch(le){Ve.error(`Không thể đồng bộ Google Drive: ${((V=(U=le==null?void 0:le.response)==null?void 0:U.data)==null?void 0:V.error)||le.message}`,{position:"bottom-right"})}finally{Na(!1)}};D.useEffect(()=>{const x=R=>{if(R.data.action==="logout"){const N=document.createElement("iframe");N.style.display="none",N.src="https://accounts.google.com/Logout",document.body.appendChild(N),setTimeout(()=>document.body.removeChild(N),2e3)}};return window.addEventListener("message",x),()=>window.removeEventListener("message",x)},[]),D.useEffect(()=>{const x=new Set(u);b(x)},[]),D.useEffect(()=>{Ye!=null&&Ye.status&&(Ye.status.status==="completed"?Ye.status.isProcessing?$({title:"Đang xử lý dữ liệu thu thập...",description:`Đã thu thập xong ${Ye.status.completed} trang từ ${Ye.url}. Đang lưu dữ liệu...`}):($({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${Ye.url} với ${Ye.status.completed} trang`}),Lr.current=!0,kn()):Ye.status.status==="failed"?$({title:"Thu thập website thất bại",description:`Không thể thu thập ${Ye.url}. Vui lòng thử lại.`,variant:"destructive"}):Ye.status.status==="blocked"&&$({title:"Website chặn thu thập dữ liệu",description:Ye.status.message||`Website ${Ye.url} đang chặn yêu cầu thu thập. Điều này có thể do website có bảo vệ chống bot hoặc hạn chế truy cập.`,variant:"destructive"}))},[(Yh=Ye==null?void 0:Ye.status)==null?void 0:Yh.status,(qd=Ye==null?void 0:Ye.status)==null?void 0:qd.isProcessing]);const Kd=D.useMemo(()=>Ur[w]||[],[Ur,w]),Xr=D.useMemo(()=>Kd.filter(x=>M4(x.permission)),[Kd,w,Ur]),Fa=D.useMemo(()=>{const x={};return Xr.forEach((R,N)=>{C.has(R.key)&&(x[N]=!0)}),x},[C,Xr]),aw=x=>{const R=ph(Ur,x);if(R.length===0)return C.has(x)?"all":"none";const N=R.filter(G=>C.has(G)).length;return N===0?"none":N===R.length?"all":"partial"},ni=(x,R=!0)=>{if(w!==x){if(Gn(1),h&&!w)Po(!0),I(x+h),_(x+h);else if(Po(!0),I(x),_(x),R&&!i){const N=window.location.pathname==="/"?"":window.location.pathname,G=x?`${window.location.origin}${N}?prefix=${encodeURIComponent(x)}`:`${window.location.origin}${N}`;window.history.pushState({path:G},"",G)}}},il=x=>{const R=x.lastIndexOf("/"),N=R>0?x.substring(0,R+1):"";N?(ni(N),setTimeout(()=>{b(new Set([x]))},500)):b(new Set([x]))};D.useEffect(()=>{xr&&(Lr.current=!0,kn().finally(()=>Po(!1)))},[xr]),D.useEffect(()=>{Ph&&Mt&&Mt!==n&&ni(n)},[Ph,Mt,n]);const ri=async(x,R)=>{var N,G;Y(!0);try{if(Xr.some(xe=>xe.isFolder&&xe.name.toLowerCase()===x.toLowerCase())){$({title:"Lỗi",description:`Thư mục "${x}" đã tồn tại trong thư mục hiện tại.`,variant:"destructive"}),Y(!1);return}const V=`${R}${x}/`;if((await $e.post(`${e}/api/create-folder`,{prefix:V,userId:(Hr==null?void 0:Hr.id)||""})).status!==200){$({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}Lr.current=!0,await kn(),$({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${x}"`}),B(""),A(!1)}catch(U){console.error("Error creating folder:",U);const V=((G=(N=U==null?void 0:U.response)==null?void 0:N.data)==null?void 0:G.error)||"Không thể tạo thư mục";$({title:"Lỗi",description:V,variant:"destructive"})}finally{Y(!1)}},Rs=async(x,R,N)=>{var G,U,V,le,xe,Le,Je,lt,mn;ie(N),Oe(!0);try{if(Array.from(x).reduce((Nn,P)=>Nn+P.size,0)>=100*1024*1024){$({title:"Lỗi",description:"Tổng kích thước các tập tin vượt quá 100 MB",variant:"destructive"}),ie(null),Oe(!1);return}const qn=Array.from(x).filter(Nn=>Nn.size===0);if(qn.length>0){const Nn=qn.map(P=>P.name).join(", ");$({title:"Lỗi tải lên",description:`Không thể tải lên tập tin rỗng: ${Nn}`,variant:"destructive"}),Oe(!1),ie(null);return}const vn=new FormData;if(jn!=null&&jn.id&&vn.append("metadata",JSON.stringify({creator:jn.username,creatorId:jn.id,DataSource:"Tệp tải lên"})),N==="folder"&&x[0]){const Nn=x[0].webkitRelativePath.split("/")[0];Nn&&vn.append("folderName",Nn)}vn.append("prefix",R),Array.from(x).forEach(Nn=>N==="folder"?vn.append("files",Nn,Nn.webkitRelativePath):vn.append("files",Nn)),Lr.current=!0;const sn=await $e.post(`${e}/api/check-files-existed`,vn,{headers:{"Content-Type":"multipart/form-data"}});if(((G=sn==null?void 0:sn.data)==null?void 0:G.status)===200){const Nn=Ve.loading("Đang tải lên",{position:"bottom-right",autoClose:3e3});await $e.post(`${e}/api/upload`,vn,{headers:{"Content-Type":"multipart/form-data"},timeout:0}),Ve.update(Nn,{render:"Tải lên thành công",type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"}),m(""),I(R),setTimeout(async()=>{ie(null),await kn(),Oe(!1),await zi("upload")},500)}else{if(((V=(U=sn==null?void 0:sn.data)==null?void 0:U.names)==null?void 0:V.length)>0&&!((le=sn==null?void 0:sn.data)!=null&&le.isFolder)){const Nn=Array.from(x).filter(P=>sn.data.names.includes(P.name));ma(Nn),ya(!0)}(xe=sn==null?void 0:sn.data)!=null&&xe.isFolder&&((Le=sn==null?void 0:sn.data)!=null&&Le.name)&&(Fc((Je=sn==null?void 0:sn.data)==null?void 0:Je.name),ma(x),ya(!0))}}catch(fn){console.error("Lỗi tải lên:",fn);const qn=((mn=(lt=fn==null?void 0:fn.response)==null?void 0:lt.data)==null?void 0:mn.error)||"Không thể tải lên tập tin";$({title:"Lỗi",description:qn,variant:"destructive"}),ie(null),Oe(!1)}},Kh=async()=>{var x,R;try{Oe(!0);const N=new FormData;if($r){ie(va?"folder":"files"),ya(!1);let G=localStorage.getItem("dataLogin"),U;try{G&&(G=JSON.parse(G),U=G.user)}catch{G=null}if(va&&$r[0]){const le=$r[0].webkitRelativePath.split("/")[0];le&&N.append("folderName",le)}N.append("prefix",w),Array.from($r).forEach(le=>va&&$r[0]?N.append("files",le,le.webkitRelativePath):N.append("files",le)),U!=null&&U.id&&N.append("metadata",JSON.stringify({creator:U.username,creatorId:U.id,DataSource:"Tệp tải lên"}));const V=Ve.loading("Đang tải lên",{position:"bottom-right",autoClose:3e3});await $e.post(`${e}/api/upload`,N,{headers:{"Content-Type":"multipart/form-data"},timeout:0}),Ve.update(V,{render:"Tải lên thành công",type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"}),m(""),I(w),Lr.current=!0}}catch(N){console.error("Lỗi tải lên:",N);const G=((R=(x=N==null?void 0:N.response)==null?void 0:x.data)==null?void 0:R.error)||"Không thể tải lên tập tin";$({title:"Lỗi",description:G,variant:"destructive"})}finally{setTimeout(async()=>{ie(null),await kn(),Oe(!1),Fc(""),ma(null),await zi("overwrite")},500)}},sl=async x=>{var R;try{if(await $e.delete(`${e}/api/files`,{data:{paths:[x.key]}}),C.has(x.key)){const G=new Set(C);G.delete(x.key),b(G)}const N=((R=x.key)==null?void 0:R.replace(/^(.*?)(\/.*)?$/,(G,U,V)=>!V||V==="/"?"":U+"/"))||"";I(N),Lr.current=!0,$({title:"Đã xóa tập tin",description:`Đã xóa thành công "${x.name}"`}),de(null),await zi("delete")}catch(N){console.error("Error deleting file:",N),$({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{Re(!1),await kn()}},$a=x=>{const R=new Set(C),N=typeof x=="function"?x(Fa):x;new Set(Object.keys(Fa).map(Number)).forEach(U=>{const V=Xr[U];V&&(N[U]||(R.delete(V.key),V.isFolder&&ph(Ur,V.key).forEach(le=>R.delete(le))))}),Object.entries(N).forEach(([U,V])=>{const le=parseInt(U),xe=Xr[le];xe&&V&&(R.add(xe.key),xe.isFolder&&ph(Ur,xe.key).forEach(Le=>R.add(Le)))}),b(R)},Gh=async()=>{var x;re(!0);try{const R=Array.from(C),N=R.map(U=>Object.values(Ur).flat().find(V=>V.key===U)).filter(U=>U!==void 0);if(N.length===0){$({title:"Lỗi",description:"Không có tập tin nào được chọn để xóa",variant:"destructive"});return}await $e.delete(`${e}/api/files`,{data:{paths:R}});const G=((x=N[0])==null?void 0:x.key.replace(/^(.*?)(\/.*)?$/,(U,V,le)=>!le||le==="/"?"":V+"/"))||"";I(G),Lr.current=!0,kn(),$({title:"Đã xóa tập tin",description:`Đã xóa thành công ${N.length} mục`}),se(!1),b(new Set),await zi("bulk-delete")}catch(R){console.error("Error deleting files:",R),$({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{re(!1)}},al=async(x,R)=>{if(!w.trim()){$({title:"Lỗi",description:"Không thể đổi tên tập tin hoặc thư mục ở thư mục gốc. Chỉ có thể xóa.",variant:"destructive"});return}fe(!0);try{const N=x.key;let G;x.isFolder?G=N.split("/").slice(0,-2).join("/")+"/":G=N.substring(0,N.lastIndexOf("/")+1);const U=G+R+(x.isFolder?"/":"");await $e.post(`${e}/api/rename`,{oldPath:N,newPath:U}),Lr.current=!0,await kn(),$({title:"Đã đổi tên",description:`Đã đổi tên thành công "${x.name}" thành "${R}"`}),me(null),be(""),te(null),await zi("rename")}catch(N){console.error("Error renaming item:",N),$({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{fe(!1)}},jh=async x=>{Ut(R=>new Set([...R,...x]));try{const R=await $e.post(`${e}/api/download`,{paths:x},{responseType:"blob"}),N=window.URL.createObjectURL(R.data),G=document.createElement("a");G.href=N;const U=R.headers["Content-Disposition"]||R.headers["content-disposition"],V=U==null?void 0:U.match(/filename="(.+)"/),le=V?decodeURIComponent(V[1]):"download.zip";G.setAttribute("download",le),document.body.appendChild(G),G.click(),document.body.removeChild(G),window.URL.revokeObjectURL(N),$({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${x.length} mục${x.length>1,""}`})}catch(R){console.error("Error downloading files:",R),$({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{Ut(R=>{const N=new Set(R);return x.forEach(G=>N.delete(G)),N})}},Ls=async(x,R)=>{var N;try{const G=await $e.post(`${e}/document-permission/public`,{path:x,isPublic:R,grandtedBy:Hr==null?void 0:Hr.id});$({title:(N=G.data)!=null&&N.isPublic?"Chỉnh sửa tài liệu công khai thành công":"Chỉnh sửa tài liệu riêng tư thành công",description:`Chuyển trạng thái thành công tài liệu "${x}".`}),await kn()}catch(G){console.log("error",G)}finally{}},oi=w?w.replace(n,"").split("/").filter(Boolean):[],cl=()=>{let x=Array.from(C).map(N=>({key:N}));x.length>1&&(x=x.filter(N=>N.key!==n));const R=N=>Cf.findIndex(x,G=>!G.key.endsWith("/")&&G.key.startsWith(N))!==-1;return x=x.filter(N=>N.key.endsWith("/")?!R(N.key):!0),x},Wh=D.useMemo(()=>{const R=[...gd()||!(w===""||w==="/")?[{id:"select",header:()=>{const N=I4(Ur,w),G=N.length>0&&N.every(V=>C.has(V)),U=N.some(V=>C.has(V));return d.jsx(Zs,{checked:G?!0:U?"indeterminate":!1,onCheckedChange:V=>{if(V){const le=Xr.reduce((xe,Le,Je)=>(xe[Je]=!0,xe),{});$a(le)}else{for(const le of Array.from(C))le.startsWith(w)&&(C.delete(le),Di.current[le]=!1);Cf.forEach(Di.current,(le,xe)=>{xe.startsWith(w)&&(Di.current[xe]=!1)}),$a({})}},"aria-label":"Chọn tất cả"})},cell:({row:N})=>{const G=N.original;let V=G.isFolder?aw(G.key):C.has(G.key)?"all":"none";if(V==="none"&&G.key.endsWith("/")){for(const le of Array.from(C))if(le.startsWith(G.key)){V="all";break}}return d.jsx("div",{className:"flex items-center",children:d.jsx(Zs,{checked:V==="partial"?"indeterminate":V==="all",onCheckedChange:le=>{var Le,Je;const xe={...Fa};if(le?xe[N.index]=!0:delete xe[N.index],Di.current[((Le=N.original)==null?void 0:Le.key)||"_"]=!!le,(Je=N.original)!=null&&Je.key.endsWith("/"))for(const lt of Array.from(C))lt.startsWith(N.original.key)&&(Di.current[N.original.key]=!1,C.delete(lt));$a(xe)},"aria-label":"Chọn dòng"})})},enableSorting:!1}]:[],{id:"fileName",header:({column:N})=>d.jsxs(je,{variant:"ghost",onClick:()=>N.toggleSorting(N.getIsSorted()==="asc"),children:["Tên tập tin",d.jsx(Lm,{})]}),accessorKey:"name",cell:({row:N})=>{const G=N.original,U=G.key.substring(0,G.key.lastIndexOf("/"))||"/",V=v.trim()!==""&&U!==w,le=U.split("/").filter(Boolean);return d.jsxs("div",{className:"flex flex-col group",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsxs("div",{className:`flex items-center gap-2 ${G.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{G.isFolder&&ni(G.key)},children:[G.isFolder?d.jsx(cs,{className:"h-5 w-5 text-blue-500"}):null,G.name]}),d.jsx("button",{className:"ml-2 opacity-0 group-hover:opacity-100 transition-opacity",onClick:xe=>{xe.stopPropagation(),navigator.clipboard.writeText(G.key),$({title:"Copied to clipboard",description:`Path: ${G.key}`,duration:2e3})},title:"Copy path to clipboard",children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),d.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),V&&d.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[d.jsx(cs,{className:"h-4 w-4 text-gray-500 my-auto"}),d.jsxs("span",{className:"flex items-center ml-1",children:[d.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{ni("")},children:"/"}),le.map((xe,Le)=>d.jsxs("span",{className:"flex items-center",children:[d.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{ni(le.slice(0,Le+1).join("/")+"/")},children:xe}),Le<le.length-1&&d.jsx("span",{children:"/"})]},Le))]})]})]})}}];return i?R.push({id:"actions",header:()=>d.jsx("span",{children:"Hành động"}),accessorKey:"key",cell:({row:N})=>d.jsxs("div",{className:"flex items-center gap-2",children:[Ni(N.original.permission)&&d.jsx(wr,{children:d.jsxs(br,{children:[d.jsx(Cr,{asChild:!0,children:d.jsx(je,{variant:"ghost",size:"icon",onClick:()=>Uc(N.original),className:"h-8 w-8 p-0",children:d.jsx(qg,{className:"h-4 w-4"})})}),d.jsx(rr,{children:"Chia sẻ"})]})}),Ni(N.original.permission)&&d.jsxs(d.Fragment,{children:[d.jsx(P0,{enabled:!!N.original.isPublic,onChange:()=>Ls(N.original.key,!N.original.isPublic)}),d.jsx("span",{className:`inline-flex items-center gap-1 rounded-full ${N.original.isPublic?"bg-green-100 text-green-700":"bg-red-100 text-red-700"} px-3 py-1 text-sm font-medium cursor-pointer`,onClick:()=>_s(N.original),children:N.original.isPublic?"Công khai":"Riêng tư"})]})]})}):R.push({id:"size",header:({column:N})=>d.jsxs(je,{variant:"ghost",onClick:()=>N.toggleSorting(N.getIsSorted()==="asc"),children:["Kích thước",d.jsx(Lm,{})]}),accessorKey:"size",cell:({getValue:N,row:G})=>{const U=N();return d.jsx("span",{children:G.original.isFolder?"-":Sr(U)})}},{id:"lastModified",header:({column:N})=>d.jsxs(je,{variant:"ghost",onClick:()=>N.toggleSorting(N.getIsSorted()==="asc"),className:"px-0 w-full flex-row justify-end",children:["Sửa đổi lần cuối",d.jsx(Lm,{})]}),accessorKey:"lastModified",cell:({row:N})=>{const G=N.original.lastModified;return d.jsx("div",{className:"w-full flex-row justify-end items-center text-right",children:d.jsx("span",{children:G&&m0(G).isValid()?m0(G).format("DD/MM/YYYY HH:mm"):"-"})})},size:200},{id:"actions",header:()=>d.jsx("span",{children:"Hành động"}),accessorKey:"key",cell:({row:N})=>d.jsxs("div",{className:"flex items-center gap-2",children:[w===""&&r&&d.jsx(wr,{children:d.jsxs(br,{children:[d.jsx(Cr,{asChild:!0,children:d.jsx(je,{variant:"ghost",size:"icon",onClick:()=>{xh(N.original.key),_h(!0)},className:"h-8 w-8 p-0",children:d.jsx(U1,{className:"h-4 w-4"})})}),d.jsx(rr,{children:"Những Flow sử dụng Folder này làm Data"})]})}),d.jsx(wr,{children:d.jsxs(br,{children:[d.jsx(Cr,{asChild:!0,children:d.jsx(je,{variant:"ghost",size:"icon",onClick:()=>jh([N.original.key]),className:"h-8 w-8 p-0",disabled:!D4(N.original.permission)||He.has(N.original.key),children:He.has(N.original.key)?d.jsx(Tt,{className:"h-4 w-4 animate-spin"}):d.jsx(R1,{className:"h-4 w-4"})})}),d.jsx(rr,{children:"Tải xuống"})]})}),w.trim()!==""&&(Ni(N.original.permission)?d.jsx(wr,{children:d.jsxs(br,{children:[d.jsx(Cr,{asChild:!0,children:d.jsx(je,{variant:"ghost",size:"icon",onClick:()=>{me(N.original),be(N.original.name)},className:"h-8 w-8 p-0",children:d.jsx(j1,{className:"h-4 w-4"})})}),d.jsx(rr,{children:"Đổi tên"})]})}):d.jsx(wr,{children:d.jsxs(br,{children:[d.jsx(Cr,{asChild:!0,children:d.jsx(je,{variant:"ghost",size:"icon",onClick:()=>{console.log("call"),Ee(N.original)},className:"h-8 w-8 p-0",disabled:N.original.isFolder,children:d.jsx(Fm,{className:"h-4 w-4"})})}),d.jsx(rr,{children:"Xem"})]})})),d.jsx(wr,{children:d.jsxs(br,{children:[d.jsx(Cr,{asChild:!0,children:d.jsx(je,{variant:"ghost",size:"icon",onClick:()=>{Pe(!0),ae(N.original)},className:"h-8 w-8 p-0",disabled:!Ni(N.original.permission),children:d.jsx(OR,{className:"h-4 w-4"})})}),d.jsx(rr,{children:"Di chuyển"})]})}),!(w===""||w==="/")&&d.jsx(wr,{children:d.jsxs(br,{children:[d.jsx(Cr,{asChild:!0,children:d.jsx(je,{variant:"ghost",size:"icon",onClick:()=>de(N.original),className:"h-8 w-8 p-0",disabled:!Ni(N.original.permission),children:d.jsx(dc,{className:"h-4 w-4"})})}),d.jsx(rr,{children:"Xóa"})]})}),Ni(N.original.permission)&&d.jsx(wr,{children:d.jsxs(br,{children:[d.jsx(Cr,{asChild:!0,children:d.jsx(je,{variant:"ghost",size:"icon",onClick:()=>Uc(N.original),className:"h-8 w-8 p-0",children:d.jsx(qg,{className:"h-4 w-4"})})}),d.jsx(rr,{children:"Chia sẻ"})]})}),w!==""&&w!=="/"&&Ni(N.original.permission)&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:`inline-flex items-center gap-1 rounded-full
|
|
1062
|
+
${N.original.isPublic?"bg-green-100 text-green-700":"bg-red-100 text-red-700"}
|
|
1063
|
+
px-3 py-1 text-sm font-medium cursor-pointer
|
|
1064
|
+
whitespace-nowrap overflow-hidden text-ellipsis
|
|
1065
|
+
`,onClick:()=>_s(N.original),children:N.original.isPublic?"Công khai":"Riêng tư"}),d.jsx(S4,{file:Hc,open:!!Hc&&Hc.key===N.original.key,onClose:()=>_s(null),onSave:Ls})]})]})}),R},[C,Xr,Fa,He,i,Hc]),Gd=p0({data:Xr,columns:Wh,state:{rowSelection:Fa,sorting:p},onSortingChange:g,enableRowSelection:!0,onRowSelectionChange:$a,getCoreRowModel:h0(),getSortedRowModel:fR()}),qh=async x=>{var R,N;vt(!0);try{let G=x.key;if(Fr(x)&&(G=SA(x)),pa(x)||Fr(x))try{const U=await $e.get(`${e}/api/read-text`,{params:{path:G}});ze(U.data.content||"")}catch(U){if(Fr(x))ze("");else throw U}try{const U=await $e.get(`${e}/api/read-json`,{params:{path:x.key+".metadata.json"}}),V=((N=(R=U==null?void 0:U.data)==null?void 0:R.content)==null?void 0:N.metadataAttributes)||null;return te({fullPath:Z==null?void 0:Z.key,...V})}catch{return te("Lỗi phân tích siêu dữ liệu")}}catch(G){console.error("Error loading file content:",G),$({title:"Lỗi",description:Fr(x)?"Không thể tải nội dung OCR":"Không thể tải nội dung tập tin",variant:"destructive"})}finally{vt(!1)}},ll=async(x,R)=>{An(!0);try{let N=x.key;Fr(x)&&(N=SA(x)),await $e.post(`${e}/api/modify-text`,{path:N,content:R}),$({title:"Đã lưu tập tin",description:Fr(x)?"Nội dung OCR đã được cập nhật thành công":"Nội dung tập tin đã được cập nhật thành công"}),Lr.current=!0,await kn(),me(null),ze(""),At("rename"),await zi("edit-content")}catch(N){console.error("Error saving file content:",N),$({title:"Lỗi",description:Fr(x)?"Không thể lưu nội dung OCR":"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{An(!1)}},dl=async x=>{An(!0);try{await $e.post(`${e}/api/modify-json`,{path:x.key+".metadata.json",content:{metadataAttributes:ke}}),$({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),Lr.current=!0,await kn(),me(null),ze(""),At("rename")}catch(R){console.error("Error saving file content:",R),$({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{An(!1)}};D.useEffect(()=>{Z&&(Z.isFolder||qh(Z),At("rename"))},[Z]),D.useEffect(()=>{_e&&!_e.isFolder&&qh(_e)},[_e]);const ul=async(x,R,N)=>{var G;if(Ye){$({title:"Đang thu thập website",description:"Vui lòng đợi cho công việc thu thập hiện tại hoàn thành.",variant:"destructive"});return}X(!0);try{const{data:U}=await $e.post(`${e}/api/crawl`,{url:x,limit:R,max_depth:N||10,prefix:w,isAutoUpdateKB:Oo});if(U.id){Lc({id:U.id,url:x,limit:R,prefix:w,taskId:((G=U.task)==null?void 0:G.id)||""});const V=localStorage.getItem(_A),le=V?JSON.parse(V):[];le.some(xe=>xe.id===U.id)||(le.unshift({url:x,id:U.id,limit:R,prefix:w,timestamp:Date.now()}),le.length>20&&(le.length=20),localStorage.setItem(_A,JSON.stringify(le))),$({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${x} với giới hạn ${R}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),sr(!1),qe(""),Et("1"),dn("10")}}catch(U){console.error("Error crawling website:",U),$({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{X(!1)}},jd=async()=>{try{if(!(Ye!=null&&Ye.id))return;Lc(null),localStorage.removeItem(Dc),$({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${Ye.url}`})}catch(x){console.error("Error stopping job:",x),$({title:"Lỗi",description:"Không thể dừng thu thập website",variant:"destructive"})}};D.useEffect(()=>{if(i)return;const x=(R=!0)=>{const G=new URL(window.location.href).searchParams.get("prefix")||"";G?ni(G,!1):(R&&!u&&b(new Set),I(n),_(n),Lr.current=!0,setTimeout(()=>{kn()},0))};return x(!1),window.addEventListener("popstate",()=>x(!0)),()=>{window.removeEventListener("popstate",()=>x(!0))}},[]);const Wd=async()=>{Cd(!0);try{await $e.post(`${e}/api/prediction-report`),$({title:"Xuất báo cáo thành công",description:"Báo cáo dự đoán đã được xuất"})}catch(x){console.error("Error exporting report:",x),$({title:"Lỗi",description:"Không thể xuất báo cáo dự đoán",variant:"destructive"})}finally{Cd(!1)}},cw=async()=>{try{const x=Xs();x&&(await $e.post(`${e}/api/start-ingestion-job`,{prefix:w,user_id:x.id,userName:x.username})).status===200&&await Cn()}catch(x){Ce(!1),console.log(x)}},zi=async x=>{try{$c&&w.includes($c)&&(console.log(`Auto syncing knowledge base after ${x} operation`),await Cn())}catch(R){console.log(`Error auto syncing after ${x}:`,R)}},Yt=D.useRef(),Cn=async()=>{try{Ce(!0);const x=await $e.post(`${e}/api/get-ingestion-job-status`,{prefix:w}),{status:R}=x==null?void 0:x.data;R==="FAILED"||R==="COMPLETE"||R==="STOPPED"||R==="STOPPING"||!R?(Ce(!1),Yt.current&&(clearInterval(Yt.current),Yt.current=null),xd(x==null?void 0:x.data)):(Yt.current||(Yt.current=setInterval(()=>Cn(),5e3)),xd(x==null?void 0:x.data))}catch(x){console.log(x)}},lw=()=>{const x=Array.from(C);let R;return w?R=x.filter(N=>N.startsWith(w)&&N!==w).length:R=new Set(x.filter(N=>N.split("/").shift())).size,`Đang chọn: ${R}`};return D.useEffect(()=>{const x=w==null?void 0:w.split("/")[0];return x!==$c&&(Ce(!1),Yt.current&&(clearInterval(Yt.current),Yt.current=null),Uy(x||""),xd(null),x&&Cn()),()=>{}},[$c,w]),D.useEffect(()=>{As&&Od.length===0&&(Fh(),Gc(null))},[As]),D.useEffect(()=>{if(u)for(const x of Array.from(u))Di.current[x]=!0},[]),d.jsxs("div",{className:"space-y-4 s3-explr-container",children:[d.jsx(DS,{}),d.jsx(yr,{open:bd,onOpenChange:x=>{ya(x),x||(Fc(""),ma(null),Oe(!1),ie(null))},children:d.jsxs(Zn,{children:[d.jsxs(er,{children:[d.jsx(tr,{children:"Cảnh báo trùng lặp"}),d.jsxs(Ei,{children:[va&&d.jsxs(d.Fragment,{children:["Folder $",va," đã có."]}),$r&&$r.length>0&&d.jsxs(d.Fragment,{children:["Những tệp sau bị lặp:",d.jsx("ul",{className:"mt-2 list-disc pl-5 text-sm text-red-600",children:Array.from($r).map((x,R)=>d.jsx("li",{children:x.name},R))})]})]})]}),d.jsxs(io,{children:[d.jsx(je,{variant:"outline",onClick:()=>{ya(!1),Fc(""),ma(null),Oe(!1),ie(null)},children:"Bỏ qua"}),d.jsx(je,{variant:"destructive",onClick:()=>Kh(),children:"Ghi đè"})]})]})}),d.jsx(Bl,{className:"s3-explr-breadcrumb",children:d.jsxs(zl,{className:"s3-explr-breadcrumb-list",children:[d.jsx(bc,{className:"s3-explr-breadcrumb-item",children:d.jsx(Cc,{onClick:()=>ni(n),className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:t})}),!h&&oi.map((x,R)=>d.jsxs("div",{className:"flex items-center",children:[d.jsx(Vl,{className:"s3-explr-breadcrumb-separator"},`sep-${R}`),d.jsx(bc,{className:"s3-explr-breadcrumb-item",children:d.jsx(Cc,{onClick:()=>ni(n+oi.slice(0,R+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:x})},`item-${x}`)]},R))]})}),d.jsxs("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:[d.jsx("div",{className:"relative max-w-sm w-full s3-explr-search-container",children:d.jsx(fH,{ref:ce,onChange:x=>m(x)})}),w&&w!=="/"&&d.jsx(wr,{delayDuration:0,children:d.jsxs(br,{children:[d.jsx(Cr,{asChild:!0,children:d.jsxs(je,{variant:"outline",size:"sm",onClick:()=>{No||ee||(Ce(!0),cw())},"aria-disabled":No||ee,className:"flex items-center gap-2 s3-explr-refresh-btn aria-disabled:opacity-50",children:[d.jsx(jg,{className:`h-4 w-4 s3-explr-refresh-icon ${No||ee?"animate-spin":""}`}),"Đồng bộ KB"]})}),Ot&&d.jsx(rr,{side:"right",sideOffset:5,children:d.jsxs("div",{className:"space-y-2 p-3 max-w-md",children:[d.jsx("p",{className:"font-semibold text-lg border-b pb-1",children:"Thông tin đồng bộ"}),d.jsx("div",{className:"space-y-1",children:d.jsxs("p",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-medium",children:"Trạng thái:"}),d.jsxs("span",{className:`flex items-center gap-1 font-semibold ${Ot.status==="COMPLETE"?"text-green-600":Ot.status==="FAILED"?"text-red-600":"text-yellow-600"}`,children:[Ot.status==="COMPLETE"&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),Ot.status==="FAILED"&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),Ot.status!=="COMPLETE"&&Ot.status!=="FAILED"&&Ot.status!=="STOPPED"&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 animate-spin",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),w2(Ot.status)]})]})}),Ot.statistics&&d.jsxs("div",{className:"space-y-1 border-t pt-2",children:[d.jsx("p",{className:"font-medium text-gray-50",children:"Thống kê xử lý:"}),d.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu quét:"}),d.jsx("span",{className:"font-medium",children:Ot.statistics.numberOfDocumentsScanned})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Metadata quét:"}),d.jsx("span",{className:"font-medium",children:Ot.statistics.numberOfMetadataDocumentsScanned})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu mới:"}),d.jsx("span",{className:"font-medium text-green-600",children:Ot.statistics.numberOfNewDocumentsIndexed})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu sửa:"}),d.jsx("span",{className:"font-medium text-blue-600",children:Ot.statistics.numberOfModifiedDocumentsIndexed})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Metadata sửa:"}),d.jsx("span",{className:"font-medium text-blue-600",children:Ot.statistics.numberOfMetadataDocumentsModified})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu xóa:"}),d.jsx("span",{className:"font-medium text-orange-600",children:Ot.statistics.numberOfDocumentsDeleted})]}),d.jsxs("div",{className:"flex justify-between col-span-2",children:[d.jsx("span",{children:"Tài liệu lỗi:"}),d.jsx("span",{className:"font-medium text-red-600",children:Ot.statistics.numberOfDocumentsFailed})]})]})]}),d.jsxs("div",{className:"space-y-1 border-t pt-2 text-sm text-gray-200",children:[d.jsx("p",{className:"font-medium text-gray-50",children:"Chi tiết Job:"}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"DataSource ID:"})," ",Ot.dataSourceId]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Ingestion Job ID:"})," ",Ot.ingestionJobId]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Knowledge Base ID:"})," ",Ot.knowledgeBaseId]}),d.jsxs("p",{className:"break-all",children:[d.jsx("span",{className:"font-medium",children:"OpenSearch Node:"})," ",Ot.node?d.jsx("span",{className:"text-gray-100",children:Ot.node}):d.jsx("span",{className:"italic text-gray-400",children:"Chưa có"})]}),d.jsxs("p",{className:"break-all",children:[d.jsx("span",{className:"font-medium",children:"Index Name:"})," ",Ot.index_name?d.jsx("span",{className:"text-gray-100",children:Ot.index_name}):d.jsx("span",{className:"italic text-gray-400",children:"Chưa có"})]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Job trong queue:"})," ",Ot.is_still_in_stock?"Còn":"Không"]})]}),Ot.errorMessage&&d.jsxs("div",{className:"border-t pt-2",children:[d.jsx("p",{className:"text-red-600 font-medium",children:"Lỗi:"}),d.jsx("p",{className:"text-red-600 text-sm bg-red-50 p-2 rounded",children:Ot.errorMessage})]}),Ot.failureReasons&&Ot.failureReasons.length>0&&d.jsx(D5,{failureReasons:Ot.failureReasons,onNavigateToFile:il})]})})]})}),gd()&&d.jsxs("div",{className:"relative",ref:ka,children:[d.jsxs(je,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-file-btn bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors",onClick:()=>Xt(x=>!x),children:[d.jsx(q1,{className:"w-4 h-4"}),"Add file"]}),Dd&&d.jsxs("div",{className:"absolute z-50 mt-2 right-0 w-56 bg-white border rounded-lg shadow-lg py-2 flex flex-col",children:[d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{Xt(!1);const x=document.createElement("input");x.type="file",x.multiple=!0,x.onchange=R=>{const N=R.target.files;N&&Rs(N,w,"files")},x.click()},children:[d.jsx(Wg,{className:"h-4 w-4 mr-2"})," Tải tệp tin"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{Xt(!1);const x=document.createElement("input");x.type="file",x.multiple=!0,x.webkitdirectory=!0,x.onchange=R=>{const N=R.target.files;N&&Rs(N,w,"folder")},x.click()},children:[d.jsx(cs,{className:"h-4 w-4 mr-2"})," Tải lên thư mục"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",disabled:!!c&&!w,onClick:()=>A(!0),children:[d.jsx(B1,{className:"h-4 w-4 mr-2 s3-explr-folder-plus-icon"}),"Thư mục mới"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{Xt(!1),sr(!0)},children:[d.jsx(K1,{className:"h-4 w-4 mr-2"})," Thêm Website"]}),d.jsxs("button",{className:`flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left ${o?"hidden":""}`,onClick:()=>{Xt(!1),ol()},children:[d.jsxs("svg",{viewBox:"0 0 87.3 78",xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",children:[d.jsx("path",{d:"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z",fill:"#0066da"}),d.jsx("path",{d:"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z",fill:"#00ac47"}),d.jsx("path",{d:"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z",fill:"#ea4335"}),d.jsx("path",{d:"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z",fill:"#00832d"}),d.jsx("path",{d:"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z",fill:"#2684fc"}),d.jsx("path",{d:"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z",fill:"#ffba00"})]})," ",Nh?"Đang kết nối...":"Đồng bộ Drive"]}),d.jsxs("button",{className:`flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left ${o?"hidden":""}`,onClick:()=>{Xt(!1),Kt()},children:[d.jsx(Fm,{className:"h-4 w-4 mr-2"})," Trạng thái đồng bộ"]}),d.jsxs("button",{className:`flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left ${o?"hidden":""}`,onClick:()=>{Xt(!1),ew()},children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",className:"h-4 w-4 mr-2",children:[d.jsx("path",{fill:"#094ab2",d:"M47.3 28.2C45.3 18.6 37.1 12 28 12c-8.5 0-15.9 5.6-18.4 13.5C4.2 27.2 0 32.2 0 38c0 6.6 5.4 12 12 12h36c8.3 0 16-6.6 16-15.5 0-6.8-4.9-12.4-11.7-13.3z"}),d.jsx("path",{fill:"#0067c5",d:"M44.9 30.1c-.2 0-.4-.1-.6-.1H26c-3.3 0-6 2.7-6 6 0 .9.2 1.8.6 2.6-1.7-.7-3.5-1.1-5.5-1.1C7.6 37.5 4 41.5 4 46s3.6 8.5 8.1 8.5h34.3c6.8 0 12.6-5.4 12.6-12s-5.5-11.6-11.1-12.4z"})]})," ","Đồng bộ OneDrive"]}),d.jsxs("button",{className:`flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left ${o?"hidden":""}`,onClick:()=>{Xt(!1),_r()},children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"h-4 w-4 mr-2",children:[d.jsx("path",{fill:"#036C70",d:"M19 14.5v-9c0-.28-.22-.5-.5-.5h-13c-.28 0-.5.22-.5.5v9c0 .28.22.5.5.5h13c.28 0 .5-.22.5-.5z"}),d.jsx("path",{fill:"#17828F",d:"M16 17.5v-9c0-.28-.22-.5-.5-.5h-13c-.28 0-.5.22-.5.5v9c0 .28.22.5.5.5h13c.28 0 .5-.22.5-.5z"}),d.jsx("path",{fill:"#4DB6AC",d:"M13 20.5v-9c0-.28-.22-.5-.5-.5h-13c-.28 0-.5.22-.5.5v9c0 .28.22.5.5.5h13c.28 0 .5-.22.5-.5z"}),d.jsx("path",{fill:"#fff",d:"M4.5 15.5v-3c0-.28.22-.5.5-.5h3c.28 0 .5.22.5.5v3c0 .28-.22.5-.5.5H5c-.28 0-.5-.22-.5-.5z"})]})," ","Đồng bộ SharePoint"]})]})]}),Ni(Ur.prefixPermission)&&w.split("/").length>=2&&d.jsxs(je,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-file-btn bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors aria-disabled:hidden",onClick:()=>Uc({contentType:"application/x-directory",isFolder:!0,key:w||"/",lastModified:"-",name:"",size:0}),children:[d.jsx(qg,{className:"w-4 h-4"}),"Chia sẻ"]}),!i&&d.jsxs(d.Fragment,{children:[C.size>0&&Ni(Ur==null?void 0:Ur.prefixPermission)&&d.jsx(d.Fragment,{children:d.jsxs(yr,{open:j,onOpenChange:se,children:[d.jsx(Kl,{asChild:!0,children:d.jsxs(je,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[d.jsx(dc,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",C.size,")"]})}),d.jsxs(Zn,{className:"s3-explr-dialog-content",children:[d.jsxs(er,{className:"s3-explr-dialog-header",children:[d.jsx(tr,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),d.jsxs(Ei,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",C.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),d.jsxs(io,{className:"s3-explr-dialog-footer",children:[d.jsx(je,{variant:"outline",onClick:()=>se(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),d.jsx(je,{variant:"destructive",onClick:Gh,disabled:Q,className:"s3-explr-confirm-delete-btn",children:Q?d.jsxs(d.Fragment,{children:[d.jsx(Tt,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})}),!h&&d.jsxs(yr,{open:k,onOpenChange:A,children:[d.jsx(Kl,{asChild:!0}),d.jsxs(Zn,{className:"s3-explr-dialog-content",children:[d.jsx(er,{className:"s3-explr-dialog-header",children:d.jsx(tr,{className:"s3-explr-dialog-title",children:"Tạo thư mục mới"})}),d.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(Or,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),d.jsx(nr,{disabled:W,id:"name",value:M,onChange:x=>B(x.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),d.jsxs(je,{onClick:()=>{M.trim()&&ri(M,w)},disabled:W,className:"s3-explr-create-btn",children:[W&&d.jsx(Tt,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),W?"Đang tạo...":"Tạo"]})]})]})]}),h&&!w?d.jsx(d.Fragment,{}):d.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[Ye?d.jsx(wr,{delayDuration:0,children:d.jsxs(br,{children:[d.jsx(Cr,{asChild:!0,children:d.jsxs(je,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn cursor-pointer",onClick:x=>{x.target.closest(".stop-icon-wrapper")?(x.stopPropagation(),jd()):Ss(!0)},children:[d.jsx(Tt,{className:"h-4 w-4 animate-spin s3-explr-loader"}),(()=>{const x=Math.floor(Ln/3600),R=Math.floor(Ln%3600/60),N=Ln%60,G=x>0?`${x}h${R}m${N}s`:R>0?`${R}m${N}s`:`${N}s`,U=Ye==null?void 0:Ye.status;let V="Đang xử lý";!U||U.total===0&&U.completed===0?V="Đang khởi tạo":U.status==="completed"&&U.isProcessing?V="Đang lưu dữ liệu":U.status==="scraping"&&(V=U.isProcessing?"Đang thu thập":"Đang quét website");const le=(U==null?void 0:U.completed)||0,xe=(U==null?void 0:U.total)||0,Le=xe>0?Math.round(le/xe*100):0,Je=xe>0?` ${Le}%`:"";return`${V} (${G})${Je}`})(),d.jsx("span",{className:"stop-icon-wrapper ml-1 hover:bg-red-100 rounded p-1 transition-colors",onClick:x=>{x.stopPropagation(),jd()},children:d.jsx(J1,{className:"h-4 w-4 text-red-600"})})]})}),Ye.status&&d.jsx(rr,{side:"right",sideOffset:5,children:d.jsxs("div",{className:"space-y-1 p-2 max-w-md break-words",children:[d.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",Ye==null?void 0:Ye.url]}),d.jsxs("p",{children:["Tiến độ: ",Ye==null?void 0:Ye.status.completed,"/",Ye==null?void 0:Ye.status.total," ","trang"]}),d.jsxs("p",{children:["Thời gian:"," ",(()=>{const x=Math.floor(Ln/3600),R=Math.floor(Ln%3600/60),N=Ln%60;return x>0?`${x}h${R}m${N}s`:R>0?`${R}m${N}s`:`${N}s`})()]}),d.jsxs("p",{children:["Trạng thái:"," ",(Ye==null?void 0:Ye.status.status)==="scraping"?"Đang thu thập":(Ye==null?void 0:Ye.status.status)==="completed"?"Hoàn thành":"Thất bại"]}),d.jsx("p",{className:"text-xs text-gray-400 mt-2",children:"Nhấn để xem chi tiết"})]})})]})}):!h&&d.jsxs(yr,{open:co,onOpenChange:sr,children:[d.jsx(Kl,{asChild:!0}),d.jsxs(Zn,{className:"s3-explr-dialog-content",children:[d.jsxs(er,{className:"s3-explr-dialog-header",children:[d.jsx(tr,{className:"s3-explr-dialog-title",children:"Thêm website"}),d.jsx(Ei,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và lưu trữ."})]}),d.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(Or,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),d.jsx(nr,{id:"websiteUrl",value:De,onChange:x=>qe(x.target.value),placeholder:"https://example.com",type:"url",disabled:L,className:"s3-explr-input"})]}),d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(Or,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Số trang đồng bộ"}),d.jsx(nr,{id:"crawlLimit",value:kt,onChange:x=>{const R=x.target.value;/^\d*$/.test(R)&&Et(R)},placeholder:"1",type:"text",disabled:L,className:"s3-explr-input"}),d.jsx("p",{className:"text-sm text-gray-500",children:"Số lượng liên kết cần thu thập (mặc định: 1)"})]}),d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(Or,{htmlFor:"maxDepth",className:"s3-explr-label",children:"Độ sâu thu thập"}),d.jsx(nr,{id:"maxDepth",value:Ht,onChange:x=>{const R=x.target.value;/^\d*$/.test(R)&&dn(R)},placeholder:"10",type:"text",disabled:L,className:"s3-explr-input"}),d.jsx("p",{className:"text-sm text-gray-500",children:"Độ sâu tối đa khi thu thập (mặc định: 10)"})]})]}),d.jsxs(io,{className:"s3-explr-dialog-footer",children:[d.jsx(je,{variant:"outline",onClick:()=>{sr(!1),qe(""),Et("1"),dn("10")},disabled:L,className:"s3-explr-cancel-btn",children:"Hủy"}),Ye?d.jsx(wr,{delayDuration:0,children:d.jsxs(br,{children:[d.jsx(Cr,{asChild:!0,children:d.jsx("span",{children:d.jsxs(je,{disabled:!0,className:"s3-explr-crawl-btn",children:[d.jsx(Tt,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]})})}),d.jsx(rr,{side:"top",sideOffset:5,children:"Đang có một tiến trình thu thập đang chạy. Vui lòng chờ hoàn thành trước khi bắt đầu mới."})]})}):d.jsx(je,{onClick:()=>{De.trim()&&ul(De.trim(),parseInt(kt)||1,parseInt(Ht)||10)},disabled:L||!De.trim(),className:"s3-explr-crawl-btn",children:L?d.jsxs(d.Fragment,{children:[d.jsx(Tt,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]}),w.startsWith("BKTTW/")&&d.jsx(wr,{delayDuration:0,children:d.jsxs(br,{children:[d.jsx(Cr,{asChild:!0,children:d.jsxs(je,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!c&&!w,onClick:Wd,children:[ba&&d.jsx(jg,{className:`h-4 w-4 s3-explr-refresh-icon ${ba?"animate-spin":""}`}),"Xuất báo cáo"]})}),(Ye==null?void 0:Ye.status)&&d.jsx(rr,{side:"right",sideOffset:5,children:d.jsxs("div",{className:"space-y-1 p-2",children:[d.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",Ye.url]}),d.jsxs("p",{children:["Tiến độ: ",Ye.status.completed,"/",Ye.status.total," ","trang"]}),d.jsxs("p",{children:["Thời gian:"," ",(()=>{const x=Math.floor(Ln/3600),R=Math.floor(Ln%3600/60),N=Ln%60;return x>0?`${x}h${R}m${N}s`:R>0?`${R}m${N}s`:`${N}s`})()]}),d.jsxs("p",{children:["Trạng thái:"," ",Ye.status.status==="scraping"?"Đang thu thập":Ye.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}),d.jsxs(yr,{open:co,onOpenChange:sr,children:[d.jsx(Kl,{asChild:!0}),d.jsxs(Zn,{className:"s3-explr-dialog-content",children:[d.jsxs(er,{className:"s3-explr-dialog-header",children:[d.jsx(tr,{className:"s3-explr-dialog-title",children:"Thêm website"}),d.jsx(Ei,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và lưu trữ."})]}),d.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(Or,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),d.jsx(nr,{id:"websiteUrl",value:De,onChange:x=>qe(x.target.value),placeholder:"https://example.com",type:"url",disabled:L,className:"s3-explr-input"})]}),d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(Or,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Số trang đồng bộ"}),d.jsx(nr,{id:"crawlLimit",value:kt,onChange:x=>{const R=x.target.value;/^\d*$/.test(R)&&Et(R)},placeholder:"1",type:"text",disabled:L,className:"s3-explr-input"}),d.jsx("p",{className:"text-sm text-gray-500",children:"Số lượng liên kết cần thu thập (mặc định: 1)"})]}),d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(Or,{htmlFor:"maxDepth",className:"s3-explr-label",children:"Độ sâu thu thập"}),d.jsx(nr,{id:"maxDepth",value:Ht,onChange:x=>{const R=x.target.value;/^\d*$/.test(R)&&dn(R)},placeholder:"10",type:"text",disabled:L,className:"s3-explr-input"}),d.jsx("p",{className:"text-sm text-gray-500",children:"Độ sâu tối đa khi thu thập (mặc định: 10)"})]})]}),d.jsxs(io,{className:"s3-explr-dialog-footer",children:[d.jsxs(je,{className:`absolute left-4 flex items-center gap-2 px-3 py-2 rounded-md text-white transition-colors ${Oo?"bg-green-500 hover:bg-green-600":"bg-gray-400 hover:bg-gray-500"}`,onClick:()=>Nd(x=>!x),children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"6",ry:"6"}),d.jsx("circle",{cx:Oo?"16":"8",cy:"12",r:"2",fill:"currentColor"})]}),d.jsx("span",{className:"text-sm",children:"Tự động cập nhật KB"})]}),d.jsx(je,{variant:"outline",onClick:()=>{sr(!1),qe(""),Et("1"),dn("10")},disabled:L,className:"s3-explr-cancel-btn",children:"Hủy"}),Ye?d.jsx(wr,{delayDuration:0,children:d.jsxs(br,{children:[d.jsx(Cr,{asChild:!0,children:d.jsx("span",{children:d.jsxs(je,{disabled:!0,className:"s3-explr-crawl-btn",children:[d.jsx(Tt,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]})})}),d.jsx(rr,{side:"top",sideOffset:5,children:"Đang có một tiến trình thu thập đang chạy. Vui lòng chờ hoàn thành trước khi bắt đầu mới."})]})}):d.jsx(je,{onClick:()=>{De.trim()&&ul(De.trim(),parseInt(kt)||1,parseInt(Ht)||10)},disabled:L||!De.trim(),className:"s3-explr-crawl-btn",children:L?d.jsxs(d.Fragment,{children:[d.jsx(Tt,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),w.startsWith("BKTTW/")&&d.jsx(wr,{delayDuration:0,children:d.jsxs(br,{children:[d.jsx(Cr,{asChild:!0,children:d.jsxs(je,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!c&&!w,onClick:Wd,children:[ba&&d.jsx(jg,{className:`h-4 w-4 s3-explr-refresh-icon ${ba?"animate-spin":""}`}),"Xuất báo cáo"]})}),ba&&d.jsx(rr,{sideOffset:5,children:"Đang xuất báo cáo"})]})}),d.jsxs("div",{className:"flex items-center gap-4",children:[Ih&&d.jsxs(ls,{open:Ih,onOpenChange:Bc,children:[d.jsx(yi,{className:"fixed inset-0 bg-black bg-opacity-50 z-50"}),d.jsxs(wi,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[700px] max-w-[90vw] max-h-[80vh] z-50 flex flex-col",children:[d.jsxs("div",{className:"relative",children:[d.jsx(vc,{asChild:!0,children:d.jsx("button",{className:"absolute top-2 right-2 text-gray-600",onClick:J,children:"✖"})}),d.jsx("h2",{className:"text-lg font-semibold",children:"My OneDrive"}),d.jsx(Bl,{className:"onedrive-breadcrumb",children:d.jsx(zl,{className:"onedrive-breadcrumb-list",children:lo.map((x,R)=>d.jsxs("div",{className:"flex items-center",children:[R>0&&d.jsx(Vl,{className:"onedrive-breadcrumb-separator"}),d.jsx(bc,{className:"onedrive-breadcrumb-item",children:d.jsx(Cc,{onClick:()=>rw(R),className:"cursor-pointer onedrive-breadcrumb-link",children:x.name})})]},R))})})]}),d.jsx("div",{className:"space-y-2 mt-4 flex-1 overflow-y-auto",children:kh?d.jsx("div",{className:"text-sm text-gray-500",children:"Đang tải nội dung thư mục... Vui lòng đợi."}):d.jsx(d.Fragment,{children:[...Sd,...zc].length>0?[...Sd,...zc].map(x=>{const R=Zy(x,Ri,xa,lo);return d.jsxs("div",{className:`flex items-center gap-3 p-2 rounded-lg hover:bg-gray-100 ${R===!0||R==="indeterminate"?"bg-blue-100":""}`,children:[d.jsx(Zs,{checked:R,onCheckedChange:()=>Bi(x),className:"cursor-pointer"}),x.isFolder?d.jsx(cs,{className:"text-blue-500 w-5 h-5 cursor-pointer",onClick:()=>tl(x.id,x.name)}):d.jsx(Wg,{className:"text-gray-500 w-5 h-5"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("div",{className:`font-medium ${x.isFolder?"cursor-pointer text-blue-600":""}`,onClick:()=>{x.isFolder?tl(x.id,x.name):Bi(x)},children:x.name}),!x.isFolder&&d.jsxs("div",{className:"text-xs text-gray-500",children:[Sr(x.size)," •"," ",Vh(x.lastModified.toISOString())]})]})]},x.id)}):d.jsx("div",{className:"text-sm text-gray-500",children:"Không có thư mục hoặc tệp nào."})})}),d.jsxs("div",{className:"mt-4 flex flex-wrap justify-end gap-2",children:[d.jsxs("div",{className:"flex justify-end",children:[d.jsx("button",{onClick:()=>jc(!0),className:"bottom-4 left-4 text-gray-600 hover:text-gray-800",title:"Đăng xuất OneDrive",children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),d.jsx("polyline",{points:"16 17 21 12 16 7"}),d.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})}),d.jsxs(je,{className:`absolute left-4 flex items-center gap-2 px-3 py-2 rounded-md text-white transition-colors ${Oo?"bg-green-500 hover:bg-green-600":"bg-gray-400 hover:bg-gray-500"}`,onClick:()=>Nd(x=>!x),children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"6",ry:"6"}),d.jsx("circle",{cx:Oo?"16":"8",cy:"12",r:"2",fill:"currentColor"})]}),d.jsx("span",{className:"text-sm",children:"Tự động cập nhật KB"})]})]}),d.jsx(je,{onClick:()=>{Ds(Ri,w,xa),J()},className:"bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors",disabled:Ri.length===0,children:"Đồng bộ"})]})]})]}),d.jsxs(ls,{open:jy,onOpenChange:jc,children:[d.jsx(yi,{className:"fixed inset-0 bg-black bg-opacity-50 z-[90]"}),d.jsxs(wi,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[400px] max-w-[90vw] z-[100]",children:[d.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Xác nhận đăng xuất"}),d.jsx("p",{className:"text-gray-600 mb-6",children:"Bạn có chắc chắn muốn đăng xuất khỏi OneDrive?"}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(je,{variant:"outline",onClick:()=>jc(!1),children:"Hủy"}),d.jsx(je,{variant:"destructive",onClick:()=>{tw(),jc(!1)},children:"Đăng xuất"})]})]})]}),Pa&&d.jsxs(ls,{open:Pa,onOpenChange:Oa,children:[d.jsx(yi,{className:"fixed inset-0 bg-black bg-opacity-50 z-50"}),d.jsxs(wi,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[700px] max-w-[90vw] max-h-[80vh] z-50 flex flex-col",children:[d.jsxs("div",{className:"relative",children:[d.jsx(vc,{asChild:!0,children:d.jsx("button",{className:"absolute top-2 right-2 text-gray-600",onClick:()=>Oa(!1),children:"✖"})}),d.jsx("h2",{className:"text-lg font-semibold",children:"Chọn thư mục Google Drive để đồng bộ tự động"}),d.jsxs("div",{className:"flex items-center gap-2 mt-2 mb-1",children:[d.jsx("span",{className:"text-sm text-gray-500 shrink-0",children:"Tài khoản:"}),Wc?d.jsx("span",{className:"text-sm text-gray-500",children:"Đang tải..."}):Do.length===0?d.jsx("span",{className:"text-sm text-gray-500",children:"Chưa có tài khoản nào"}):d.jsx("select",{className:"text-sm border rounded-md px-2 py-1 flex-1 min-w-0",value:tn??"",onChange:x=>Da(Number(x.target.value)),children:Do.map(x=>d.jsx("option",{value:x.id,children:x.email||x.google_user_id},x.id))}),tn!=null&&d.jsx("button",{title:"Ngắt kết nối tài khoản này",disabled:qy===tn,onClick:()=>{const x=Do.find(R=>R.id===tn);ow(tn,(x==null?void 0:x.email)??null)},className:"text-gray-500 hover:text-red-600 disabled:opacity-50 shrink-0",children:d.jsx(dc,{className:"h-4 w-4"})}),d.jsx("button",{title:"Kết nối thêm một tài khoản Google khác",disabled:Rh,onClick:()=>void Nt(),className:"text-sm text-blue-600 hover:text-blue-800 disabled:opacity-50 shrink-0 whitespace-nowrap",children:Rh?"Đang kết nối...":"+ Thêm tài khoản"})]}),d.jsx(Bl,{className:"onedrive-breadcrumb",children:d.jsx(zl,{className:"onedrive-breadcrumb-list",children:Ps.map((x,R)=>d.jsxs("div",{className:"flex items-center",children:[R>0&&d.jsx(Vl,{className:"onedrive-breadcrumb-separator"}),d.jsx(bc,{className:"onedrive-breadcrumb-item",children:d.jsx(Cc,{onClick:()=>Ms(R),className:"cursor-pointer onedrive-breadcrumb-link",children:x.name})})]},x.id))})})]}),d.jsxs("div",{className:"space-y-2 mt-4 flex-1 overflow-y-auto",children:[Wc?d.jsx("div",{className:"text-sm text-gray-500 mb-2",children:"Đang tải danh sách thư mục đang đồng bộ..."}):Xc.length>0?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"text-sm font-semibold mb-1",children:["Đang đồng bộ realtime (",Xc.length,")"]}),d.jsx("div",{className:"space-y-1 mb-3",children:Xc.map(x=>d.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-blue-50",children:[d.jsx(cs,{className:"text-blue-500 w-5 h-5"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("div",{className:"font-medium",children:x.folder_name||x.prefix}),d.jsx("div",{className:"text-xs text-gray-500",children:x.prefix})]}),d.jsx("button",{title:"Ngừng đồng bộ realtime cho thư mục này",disabled:Lh===`${tn}:${x.folder_id}`,onClick:()=>tn!=null&&void nl(tn,x.folder_id,x.folder_name||x.prefix),className:"text-gray-500 hover:text-red-600 disabled:opacity-50",children:d.jsx(dc,{className:"h-4 w-4"})})]},x.folder_id))}),d.jsx("div",{className:"border-t mb-3"})]}):null,Mh?d.jsx("div",{className:"text-sm text-gray-500",children:"Đang tải danh sách thư mục..."}):Dh.length===0?d.jsx("div",{className:"text-sm text-gray-500",children:"Không có thư mục con nào."}):Dh.map(x=>d.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg hover:bg-gray-100 cursor-pointer",onClick:()=>iw(x),children:[d.jsx(cs,{className:"text-blue-500 w-5 h-5"}),d.jsx("div",{className:"font-medium text-blue-600",children:x.name})]},x.id))]}),d.jsxs("div",{className:"mt-4 flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"text-sm text-gray-500",children:["Đang chọn:"," ",(Ps[Ps.length-1]??ks).name]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(je,{variant:"outline",onClick:()=>Oa(!1),disabled:uo,children:"Hủy"}),d.jsx(je,{onClick:sw,disabled:uo||Mh||tn==null,className:"bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors",children:uo?"Đang đồng bộ...":"Đồng bộ + bật tự động cho thư mục này"})]})]})]})]}),$d&&d.jsxs(ls,{open:$d,onOpenChange:Ud,children:[d.jsx(yi,{className:"fixed inset-0 bg-black bg-opacity-50 z-50"}),d.jsxs(wi,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[460px] max-w-[90vw] z-50",children:[d.jsxs("div",{className:"relative",children:[d.jsx(vc,{asChild:!0,children:d.jsx("button",{className:"absolute top-2 right-2 text-gray-600",onClick:()=>Ud(!1),children:"✖"})}),d.jsx("h2",{className:"text-lg font-semibold",children:"Chọn tài khoản Google Drive"}),d.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Google Picker chỉ mở được một tài khoản mỗi lần."})]}),d.jsx("div",{className:"space-y-1 mt-4 max-h-[50vh] overflow-y-auto",children:Do.map(x=>d.jsxs("button",{className:"w-full flex items-center gap-3 p-2 rounded-lg hover:bg-gray-100 text-left",onClick:()=>{Ud(!1),at(x.id,x.email)},children:[d.jsxs("svg",{viewBox:"0 0 87.3 78",xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 shrink-0",children:[d.jsx("path",{d:"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z",fill:"#0066da"}),d.jsx("path",{d:"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z",fill:"#00ac47"}),d.jsx("path",{d:"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z",fill:"#ea4335"}),d.jsx("path",{d:"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z",fill:"#00832d"}),d.jsx("path",{d:"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z",fill:"#2684fc"}),d.jsx("path",{d:"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z",fill:"#ffba00"})]}),d.jsx("span",{className:"flex-1 font-medium",children:x.email||x.google_user_id})]},x.id))})]})]}),Fd&&d.jsxs(ls,{open:Fd,onOpenChange:Ra,children:[d.jsx(yi,{className:"fixed inset-0 bg-black bg-opacity-50 z-50"}),d.jsxs(wi,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[700px] max-w-[90vw] max-h-[80vh] z-50 flex flex-col",children:[d.jsxs("div",{className:"relative",children:[d.jsx(vc,{asChild:!0,children:d.jsx("button",{className:"absolute top-2 right-2 text-gray-600",onClick:()=>Ra(!1),children:"✖"})}),d.jsx("h2",{className:"text-lg font-semibold",children:"Trạng thái đồng bộ Google Drive"})]}),d.jsx("div",{className:"space-y-3 mt-4 flex-1 overflow-y-auto",children:Wc?d.jsx("div",{className:"text-sm text-gray-500",children:"Đang tải..."}):Do.length===0?d.jsx("div",{className:"text-sm text-gray-500",children:"Chưa có tài khoản Google Drive nào được kết nối."}):Do.map(x=>{var V;const R=x.channel,N=(R==null?void 0:R.expiration)??null,G=N!=null&&N<Date.now(),U=R!=null;return d.jsxs("div",{className:"border rounded-lg p-3",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("div",{className:"font-medium",children:x.email||"Tài khoản Google"}),d.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${U&&!G?"bg-green-100 text-green-700":"bg-yellow-100 text-yellow-700"}`,children:U?G?"Hết hạn":"Đang đồng bộ":"Chưa kết nối"})]}),d.jsxs("div",{className:"text-xs text-gray-500 mt-1 flex items-center gap-2",children:[d.jsx("div",{className:"flex-1",children:U?d.jsxs(d.Fragment,{children:["Channel:"," ",d.jsx("span",{className:"font-mono",children:R.channel_id}),N!=null&&d.jsxs(d.Fragment,{children:[" ","— hết hạn ",new Date(N).toLocaleString("vi-VN"),G&&d.jsxs("span",{className:"text-red-600 font-medium",children:[" ","(đã hết hạn)"]})]})]}):"Chưa bật đồng bộ realtime cho tài khoản này"}),U&&d.jsx("button",{title:"Dừng đồng bộ realtime cho toàn bộ tài khoản này",disabled:Yc===x.id,onClick:()=>void Br(x.id,x.email),className:"text-gray-500 hover:text-red-600 disabled:opacity-50 shrink-0",children:d.jsx(dc,{className:"h-3.5 w-3.5"})})]}),((V=x.syncedFolders)==null?void 0:V.length)>0?d.jsx("div",{className:"mt-2 space-y-1",children:x.syncedFolders.map(le=>d.jsxs("div",{className:"flex items-center gap-2 text-sm bg-blue-50 rounded px-2 py-1",children:[d.jsx(cs,{className:"text-blue-500 w-4 h-4 shrink-0"}),d.jsx("span",{className:"font-medium",children:le.folder_name||le.prefix}),d.jsx("span",{className:"text-xs text-gray-500 flex-1",children:le.prefix}),d.jsx("button",{title:"Ngừng đồng bộ realtime cho thư mục này",disabled:Lh===`${x.id}:${le.folder_id}`,onClick:()=>void nl(x.id,le.folder_id,le.folder_name||le.prefix),className:"text-gray-500 hover:text-red-600 disabled:opacity-50 shrink-0",children:d.jsx(dc,{className:"h-3.5 w-3.5"})})]},le.folder_id))}):d.jsx("div",{className:"mt-2 text-sm text-gray-400",children:"Chưa có folder nào đang đồng bộ realtime."})]},x.id)})}),d.jsx("div",{className:"mt-4 flex justify-end",children:d.jsx(je,{variant:"outline",onClick:()=>void Vt(),disabled:Wc,children:"Làm mới"})})]})]}),As&&d.jsxs(ls,{open:As,onOpenChange:Ea,children:[d.jsx(yi,{className:"fixed inset-0 bg-black bg-opacity-50 z-50"}),d.jsxs(wi,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[700px] max-w-[90vw] max-h-[80vh] z-50 flex flex-col",children:[d.jsxs("div",{className:"relative",children:[d.jsx(vc,{asChild:!0,children:d.jsx("button",{className:"absolute top-2 right-2 text-gray-600",onClick:Mo,children:"✖"})}),d.jsxs("div",{className:"flex items-center gap-2",children:[Dt&&d.jsx("button",{onClick:()=>Gc(null),className:"text-gray-600 hover:text-gray-800",children:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})})}),d.jsx("h2",{className:"text-lg font-semibold",children:"My SharePoint"})]}),Dt&&d.jsx(Bl,{className:"sharepoint-breadcrumb",children:d.jsx(zl,{className:"sharepoint-breadcrumb-list",children:Es.map((x,R)=>d.jsxs("div",{className:"flex items-center",children:[R>0&&d.jsx(Vl,{className:"sharepoint-breadcrumb-separator"}),d.jsx(bc,{className:"sharepoint-breadcrumb-item",children:d.jsx(Cc,{onClick:()=>Vd(R),className:"cursor-pointer sharepoint-breadcrumb-link",children:x.name})})]},R))})})]}),d.jsx("div",{className:"space-y-2 mt-4 flex-1 overflow-y-auto",children:Id?d.jsx("div",{className:"text-sm text-gray-500",children:"Đang tải nội dung thư mục... Vui lòng đợi."}):Dt?[...Vc,...kd].length===0?d.jsx("div",{className:"text-sm text-gray-500",children:"Không có thư mục hoặc tệp nào."}):[...Vc,...kd].map(x=>{const R=Ns(x,Li,Kc,Es,Ta);return d.jsxs("div",{className:`flex items-center gap-3 p-2 rounded-lg hover:bg-gray-100 ${R===!0||R==="indeterminate"?"bg-blue-100":""}`,children:[d.jsx(Zs,{checked:R,onCheckedChange:()=>Jy(x),className:"cursor-pointer"}),x.isFolder?d.jsx(cs,{className:"text-blue-500 w-5 h-5 cursor-pointer",onClick:()=>Zc(x.id,x.name,(Dt==null?void 0:Dt.hostname)||"",(Dt==null?void 0:Dt.sitePath)||"")}):d.jsx(Wg,{className:"text-gray-500 w-5 h-5"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("div",{className:`font-medium ${x.isFolder?"cursor-pointer text-blue-600":""}`,onClick:()=>{x.isFolder&&Zc(x.id,x.name,(Dt==null?void 0:Dt.hostname)||"",(Dt==null?void 0:Dt.sitePath)||"")},children:x.name}),!x.isFolder&&d.jsxs("div",{className:"text-xs text-gray-500",children:[Sr(x.size)," •"," ",x.lastModified.toLocaleString()]})]})]},x.id)}):d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6",children:Od.map(x=>d.jsxs("div",{className:"cursor-pointer bg-white shadow-md rounded-xl p-5 flex flex-col justify-center items-start transition-shadow duration-200 hover:shadow-lg border border-gray-100 min-h-[120px]",style:{overflow:"hidden",wordBreak:"break-word",textOverflow:"ellipsis",whiteSpace:"normal"},onClick:()=>$h(x),children:[d.jsx("div",{className:"font-bold text-lg mb-1 truncate w-full",title:x.name,children:x.name}),d.jsx("div",{className:"text-sm text-gray-500 truncate w-full",title:x.description,children:x.description})]},x.id))})}),d.jsx("div",{className:"mt-4 flex flex-wrap justify-end gap-2",children:Dt&&d.jsxs(d.Fragment,{children:[d.jsx(je,{onClick:()=>{Bh(Li,w,Kc),Mo()},className:"bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors",disabled:Li.length===0,children:"Đồng bộ"}),d.jsx(je,{onClick:()=>Gc(null),children:"Quay lại"})]})}),Dt&&d.jsxs("button",{onClick:()=>Nd(x=>!x),className:`absolute bottom-4 left-4 flex items-center gap-2 px-3 py-2 rounded-md text-white transition-colors ${Oo?"bg-green-500 hover:bg-green-600":"bg-gray-400 hover:bg-gray-500"}`,title:"Bật/tắt tự động cập nhật KB",children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"6",ry:"6"}),d.jsx("circle",{cx:Oo?"16":"8",cy:"12",r:"2",fill:"currentColor"})]}),d.jsx("span",{className:"text-sm",children:"Tự động cập nhật KB"})]})]})]}),d.jsxs(ls,{open:Gy,onOpenChange:Aa,children:[d.jsx(yi,{className:"fixed inset-0 bg-black bg-opacity-50 z-[60]"}),d.jsxs(wi,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[400px] max-w-[90vw] z-[60]",children:[d.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Xác nhận đăng xuất"}),d.jsx("p",{className:"text-gray-600 mb-6",children:"Bạn có chắc chắn muốn đăng xuất khỏi SharePoint?"}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(je,{variant:"outline",onClick:()=>Aa(!1),children:"Hủy"}),d.jsx(je,{variant:"destructive",onClick:()=>{zd(),Aa(!1)},children:"Đăng xuất"})]})]})]})]}),d.jsx(yr,{open:!!Fy,onOpenChange:x=>{x||(_h(!1),Th([]),xh(""))},children:d.jsx(Zn,{className:"max-h-[700px] pb-3 px-1 s3-explr-input-group max-w-5xl w-[90%] p-6 bg-white rounded-lg shadow-lg",children:d.jsxs(er,{className:"s3-explr-dialog-header",children:[d.jsx(tr,{className:"s3-explr-dialog-title",children:d.jsxs("h3",{className:"font-medium mb-2",children:["Danh sách flows đang sử dụng dữ liệu từ folder(",d.jsx("span",{className:"font-bold",children:xs}),"):"," "]})}),d.jsx(Ei,{className:"s3-explr-dialog-description",children:$y?d.jsxs("div",{className:"flex items-center justify-center py-4",children:[d.jsx(Tt,{className:"h-6 w-6 animate-spin"}),d.jsx("span",{className:"ml-2",children:"Đang tải thông tin flows..."})]}):d.jsx("div",{children:wa&&Array.isArray(wa)&&wa.length>0?d.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:d.jsxs("table",{className:"w-full border-collapse",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"bg-gray-100",children:[d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"Tên Flow"}),d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"KnowledgeBase Id"}),d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"Loại"}),d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"Ngày tạo"})]})}),d.jsx("tbody",{children:wa.map((x,R)=>d.jsxs("tr",{className:R%2===0?"bg-white":"bg-gray-50",children:[d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:x.name}),d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:x.KnowledgeBaseId}),d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:x.type==="MULTIAGENT"?"Agent Flow":"Chat Flow"}),d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:x.createdDate?new Date(x.createdDate).toLocaleString("vi-VN"):"N/A"})]},R))})]})}):d.jsx("div",{className:"text-gray-500 italic py-2",children:"Không có flow nào sử dụng dữ liệu từ folder này"})})})]})})}),d.jsx(yr,{open:!!z,onOpenChange:x=>!x&&de(null),children:d.jsxs(Zn,{className:"s3-explr-dialog-content",children:[d.jsxs(er,{className:"s3-explr-dialog-header",children:[d.jsx(tr,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),d.jsxs(Ei,{className:"s3-explr-dialog-description break-words whitespace-pre-wrap",children:["Bạn có chắc chắn muốn xóa"," ",d.jsx("span",{className:"font-medium break-all",children:z==null?void 0:z.name}),"? Hành động này không thể hoàn tác."]})]}),d.jsxs(io,{className:"s3-explr-dialog-footer",children:[d.jsx(je,{variant:"outline",onClick:()=>de(null),className:"s3-explr-cancel-btn",children:"Hủy"}),d.jsx(je,{variant:"destructive",onClick:()=>sl(z),disabled:Ne,className:"s3-explr-confirm-delete-btn",children:Ne?d.jsxs(d.Fragment,{children:[d.jsx(Tt,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),d.jsx(yr,{open:!!Z,onOpenChange:x=>{x||(me(null),te(null),be(""),ze(""),At("rename"))},children:d.jsxs(Zn,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[d.jsx(er,{className:"s3-explr-dialog-header",children:d.jsx(tr,{className:"s3-explr-dialog-title",children:Z!=null&&Z.isFolder?"Đổi tên thư mục":pa(Z)||Fr(Z)?"Quản lý tập tin":"Đổi tên tập tin"})}),Z&&d.jsxs(uv,{value:In,onValueChange:x=>At(x),children:[d.jsxs(Nf,{"aria-checked":!pa(Z)&&!Fr(Z),"aria-disabled":Z.isFolder,className:"grid w-full grid-cols-3 aria-checked:grid-cols-2 aria-disabled:grid-cols-1",children:[d.jsx(na,{value:"rename",children:"Đổi tên"}),!Z.isFolder&&d.jsxs(d.Fragment,{children:[(pa(Z)||Fr(Z))&&d.jsx(na,{value:"edit",children:Fr(Z)?"Sửa nội dung OCR":"Sửa nội dung"}),d.jsx(na,{value:"edit-metadata",children:"Sửa metadata file"})]})]}),d.jsx(gs,{value:"rename",children:d.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:d.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1 s3-explr-input-group",children:[d.jsx(Or,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),d.jsx(nr,{id:"newName",value:pe,onChange:x=>be(x.target.value),placeholder:"Nhập tên mới",disabled:Me,className:"s3-explr-input"})]})})}),!Z.isFolder&&d.jsxs(d.Fragment,{children:[(pa(Z)||Fr(Z))&&d.jsx(gs,{value:"edit",children:d.jsx("div",{className:"space-y-4 py-4",children:wt?d.jsx("div",{className:"flex items-center justify-center py-10",children:d.jsx(Tt,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):d.jsxs("div",{className:"max-h-[70dvh] overflow-auto rounded-md border px-4 py-3 bg-muted/30",children:[d.jsx(Or,{htmlFor:"content",className:"block text-sm font-medium mb-2 text-muted-foreground",children:Fr(Z)?"Nội dung OCR (đang chỉnh sửa nội dung OCR được trích xuất từ ảnh)":"Nội dung tập tin"}),d.jsx(Ql,{id:"content",value:ct,onChange:x=>ze(x.target.value),placeholder:Fr(Z)?"Chưa có nội dung OCR...":"Nhập nội dung tập tin",className:"font-mono text-sm resize-none min-h-[200px] w-full",disabled:qt,style:{height:"auto",maxHeight:"60vh"},rows:Math.max(10,ct.split(`
|
|
1066
|
+
`).length+1)})]})})}),d.jsx(gs,{value:"edit-metadata",children:d.jsx("div",{className:"space-y-4 py-4",children:wt?d.jsx("div",{className:"flex items-center justify-center py-4",children:d.jsx(Tt,{className:"h-6 w-6 animate-spin"})}):d.jsx("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:ke&&typeof ke=="object"&&Object.entries(ke).map(([x,R],N)=>d.jsxs("div",{className:"pb-3 flex flex-col gap-2",children:[d.jsxs(Or,{htmlFor:x,className:"s3-explr-label flex items-center gap-1",children:[m2[x]||x,Km(x)&&d.jsx(NR,{className:"h-[12px] w-[12px] text-red-500"})]}),v2(x)?d.jsx(Ql,{id:x,value:typeof R=="string"?R:JSON.stringify(R),onChange:G=>{const U={...ke,[x]:G.target.value};te(U)},placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:qt||Km(x)}):d.jsx(nr,{id:x,value:typeof R=="string"?R:JSON.stringify(R),onChange:G=>{const U={...ke,[x]:G.target.value};te(U)},placeholder:"Nhập nội dung",className:"s3-explr-input",disabled:qt||Km(x)})]},N))})})})]})]}),d.jsxs(io,{className:"s3-explr-dialog-footer",children:[d.jsx(je,{variant:"outline",onClick:()=>{me(null),te(null),be(""),ze("")},className:"s3-explr-cancel-btn",children:"Hủy"}),In==="edit"?d.jsx(je,{onClick:()=>Z&&ll(Z,ct),disabled:qt||wt,className:"s3-explr-save-btn",children:qt?d.jsxs(d.Fragment,{children:[d.jsx(Tt,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):In==="edit-metadata"?d.jsx(je,{onClick:()=>ke&&typeof ke=="object"&&Z&&dl(Z),disabled:qt||wt,className:"s3-explr-save-btn",children:qt?d.jsxs(d.Fragment,{children:[d.jsx(Tt,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):d.jsx(je,{onClick:()=>{pe.trim()&&Z&&al(Z,pe.trim())},disabled:Me||!pe.trim()||pe.trim()===(Z==null?void 0:Z.name),className:"s3-explr-rename-btn",children:Me?d.jsxs(d.Fragment,{children:[d.jsx(Tt,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})}),d.jsx(yr,{open:!!_e,onOpenChange:x=>{x||(Ee(null),ze(""))},children:d.jsxs(Zn,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[d.jsx(er,{className:"s3-explr-dialog-header",children:d.jsx(tr,{className:"s3-explr-dialog-title",children:"Xem tập tin"})}),_e&&d.jsxs(uv,{value:"view",children:[d.jsx(Nf,{className:"grid w-full grid-cols-1 ",children:!_e.isFolder&&pa(_e)&&d.jsx(na,{value:"view",children:"Nội dung"})}),!_e.isFolder&&pa(_e)?d.jsx(gs,{value:"view",children:d.jsx("div",{className:"space-y-4 py-4",children:wt?d.jsx("div",{className:"flex items-center justify-center py-4",children:d.jsx(Tt,{className:"h-6 w-6 animate-spin"})}):d.jsx("div",{className:"overflow-hidden overflow-y-auto pb-3 px-1",children:d.jsx("div",{className:"rounded-md bg-muted p-4 font-mono text-sm overflow-auto max-h-[60vh] border",children:d.jsx("pre",{className:"whitespace-pre-wrap break-words",children:ct})})})})}):d.jsx(gs,{value:"view",children:d.jsx("div",{className:"space-y-4 py-4",children:wt?d.jsx("div",{className:"flex items-center justify-center py-4",children:d.jsx(Tt,{className:"h-6 w-6 animate-spin"})}):d.jsx("div",{className:"overflow-hidden overflow-y-auto pb-3 px-1",children:d.jsx("div",{className:"rounded-md bg-muted p-4 font-mono text-sm overflow-auto max-h-[60vh] border",children:d.jsx("pre",{className:"whitespace-pre-wrap break-words",children:"Định dạng file không xem trực tiếp được, hãy tải file về để xem!"})})})})})]}),d.jsx(io,{className:"s3-explr-dialog-footer",children:d.jsx(je,{variant:"outline",onClick:()=>{Ee(null),ze("")},className:"s3-explr-cancel-btn",children:"Đóng"})})]})}),ne&&Ie&&d.jsx($B,{openDialogRename:Ie,setOpenDialogRename:Pe,apiBaseUrl:e,setFileToMove:ae,fileToMove:ne,refreshFiles:kn,ignoreCache:Lr,autoSyncAfterFileOperation:zi})]})]}),Wy&&d.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative s3-explr-error",children:"Đã xảy ra lỗi khi tải danh sách tập tin"}),d.jsx(LB,{onFilesSelected:(x,R)=>Rs(x,w,R),children:d.jsx("div",{className:"rounded-md border s3-explr-table-container",children:d.jsxs(Tf,{className:"s3-explr-table",children:[d.jsx(Ef,{className:"s3-explr-table-header",children:Gd.getHeaderGroups().map(x=>d.jsx(To,{className:"hover:bg-transparent s3-explr-header-row",children:x.headers.map(R=>d.jsx(Wo,{className:"s3-explr-header-cell",children:R.isPlaceholder?null:yf(R.column.columnDef.header,R.getContext())},R.id))},x.id))}),d.jsx(Af,{className:"s3-explr-table-body",children:Gd.getRowModel().rows.length===0?d.jsx(To,{className:"s3-explr-empty-row",children:d.jsx(Dr,{colSpan:Wh.length,className:"h-24 text-center s3-explr-empty-cell",children:v?d.jsxs("div",{className:"text-gray-500 s3-explr-no-results",children:['Không tìm thấy tập tin hoặc thư mục nào khớp với "',v,'"']}):d.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:No?"Đang tải nội dung thư mục... Vui lòng đợi":"Thư mục này không chứa tập tin hoặc thư mục con nào"})})}):Gd.getRowModel().rows.map(x=>d.jsx(To,{className:"h-12 s3-explr-row",children:x.getVisibleCells().map(R=>d.jsx(Dr,{className:"align-middle s3-explr-cell",children:yf(R.column.columnDef.cell,R.getContext())},R.id))},x.id))})]})})}),v&&Ia!==0&&d.jsx(d.Fragment,{children:d.jsx(Gl,{children:d.jsxs(jl,{children:[d.jsx(Wl,{onClick:()=>bt(x=>Math.max(x-1,1)),"aria-disabled":Ge===1,className:"cursor-pointer aria-disabled:pointer-events-none"}),Array.from({length:Math.ceil(Ia/20)},(x,R)=>{const N=R+1,G=Math.ceil(Ia/20);return G>7&&!(N===1||N===G||N>=Ge-1&&N<=Ge+1)?N===Ge-2&&Ge>4||N===Ge+2&&Ge<G-3?d.jsx(Yl,{className:"pointer-events-none",children:"..."},R):null:d.jsx(Nr,{className:"cursor-pointer",children:d.jsx(ea,{isActive:Ge===N,onClick:()=>bt(N),className:`${Ge===N?"bg-blue-500 text-white":"bg-white text-black"} hover:bg-blue-100`,children:N})},R)}),d.jsx(Nr,{children:d.jsx(ql,{onClick:()=>bt(x=>Math.min(x+1,Math.ceil(Ia/20))),"aria-disabled":Ge===Math.ceil(Ia/20),className:"cursor-pointer aria-disabled:pointer-events-none"})})]})})}),!v&&Is&&Is.totalPages>1&&d.jsx(d.Fragment,{children:d.jsx("div",{className:"flex items-center justify-between mt-4",children:d.jsx(Gl,{children:d.jsxs(jl,{children:[d.jsx(Wl,{onClick:()=>!No&&Gn(x=>Math.max(x-1,1)),"aria-disabled":Pt===1||No,className:"cursor-pointer aria-disabled:pointer-events-none aria-disabled:opacity-50"}),No?d.jsx(Nr,{children:d.jsxs("div",{className:"flex items-center gap-2 px-4",children:[d.jsx(Tt,{className:"h-4 w-4 animate-spin"}),d.jsx("span",{className:"text-sm",children:"Đang tải..."})]})}):Array.from({length:Is.totalPages},(x,R)=>{const N=R+1,G=Is.totalPages;return G>7&&!(N===1||N===G||N>=Pt-1&&N<=Pt+1)?N===Pt-2&&Pt>4||N===Pt+2&&Pt<G-3?d.jsx(Yl,{className:"pointer-events-none",children:"..."},R):null:d.jsx(Nr,{className:"cursor-pointer",children:d.jsx(ea,{isActive:Pt===N,onClick:()=>Gn(N),className:`${Pt===N?"bg-blue-500 text-white":"bg-white text-black"} hover:bg-blue-100`,children:N})},R)}),d.jsx(Nr,{children:d.jsx(ql,{onClick:()=>!No&&Gn(x=>Math.min(x+1,Is.totalPages)),"aria-disabled":Pt===Is.totalPages||No,className:"cursor-pointer aria-disabled:pointer-events-none aria-disabled:opacity-50"})})]})})})}),i&&a&&d.jsxs("div",{className:"flex justify-between items-center mt-4 s3-explr-selector-footer",children:[d.jsx("div",{className:"text-sm text-gray-500 s3-explr-selection-count",children:lw()}),d.jsx(je,{variant:"default",onClick:()=>a(cl()),disabled:C.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),d.jsx(_4,{open:!!Eh,onClose:()=>Uc(null),file:Eh,apiBaseUrl:e,rootUrlHostApi:r}),d.jsx(FB,{open:Hy,onClose:()=>Ss(!1),currentJob:Ye,elapsedTime:Ln,onStop:jd})]})}),$4=t=>d.jsxs(d.Fragment,{children:[d.jsx(F4,{...t}),d.jsx(g2,{})]});var md=t=>t.type==="checkbox",gh=t=>t.type==="file",Cs=t=>t instanceof Date,zn=t=>t==null;const Iy=t=>typeof t=="object";var ln=t=>!zn(t)&&!Array.isArray(t)&&Iy(t)&&!Cs(t),U4=t=>ln(t)&&t.target?md(t.target)?t.target.checked:gh(t.target)?t.target.files:t.target.value:t,H4=(t,e)=>e.split(".").some((n,r,o)=>!isNaN(Number(n))&&t.has(o.slice(0,r).join("."))),EA=t=>{const e=t.constructor&&t.constructor.prototype;return ln(e)&&e.hasOwnProperty("isPrototypeOf")},mh=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function gn(t){if(t instanceof Date)return new Date(t);const e=typeof FileList<"u"&&t instanceof FileList;if(mh&&(t instanceof Blob||e))return t;const n=Array.isArray(t);if(!n&&!(ln(t)&&EA(t)))return t;const r=n?[]:Object.create(Object.getPrototypeOf(t));for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=gn(t[o]));return r}const Mc={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Io={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ko={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},AA="root",ky=["__proto__","constructor","prototype"],B4=/^\w*$/;var vd=t=>B4.test(t),cn=t=>t===void 0;const z4=/[.[\]'"]/;var vh=t=>t.split(z4).filter(Boolean),We=(t,e,n)=>{if(!e||!ln(t))return n;const r=vd(e)?[e]:vh(e);if(r.some(i=>ky.includes(i)))return n;const o=r.reduce((i,a)=>zn(i)?void 0:i[a],t);return cn(o)||o===t?cn(t[e])?n:t[e]:o},Xo=t=>typeof t=="boolean",ao=t=>typeof t=="function",on=(t,e,n)=>{let r=-1;const o=vd(e)?[e]:vh(e),i=o.length,a=i-1;for(;++r<i;){const c=o[r];let u=n;if(r!==a){const h=t[c];u=ln(h)||Array.isArray(h)?h:isNaN(+o[r+1])?{}:[]}if(ky.includes(c))return;t[c]=u,t=t[c]}};const V4=D.createContext(null);V4.displayName="HookFormControlContext";var K4=(t,e,n,r=!0)=>{const o={};for(const i in t)Object.defineProperty(o,i,{get:()=>{const a=i;return e._proxyFormState[a]!==Io.all&&(e._proxyFormState[a]=!r||Io.all),t[a]}});return o};const G4=mh?D.useLayoutEffect:D.useEffect;var Vn=t=>typeof t=="string",j4=(t,e,n,r,o)=>Vn(t)?(r&&e.watch.add(t),We(n,t,o)):Array.isArray(t)?t.map(i=>(r&&e.watch.add(i),We(n,i))):(r&&(e.watchAll=!0),n),Py=t=>zn(t)||!Iy(t);const IA=(t,e)=>e.length===0&&!Array.isArray(t)&&!EA(t);function Zo(t,e,n=new WeakMap){if(t===e)return!0;if(Py(t)||Py(e))return Object.is(t,e);if(Cs(t)&&Cs(e))return Object.is(t.getTime(),e.getTime());const r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;if(IA(t,r)||IA(e,o))return Object.is(t,e);if(!r.length&&Array.isArray(t)!==Array.isArray(e))return!1;const i=n.get(t);if(i&&i.has(e))return!0;if(i)i.add(e);else{const a=new WeakSet;a.add(e),n.set(t,a)}for(const a of r){const c=t[a];if(!(a in e))return!1;if(a!=="ref"){const u=e[a];if(Cs(c)&&Cs(u)||(ln(c)||Array.isArray(c))&&(ln(u)||Array.isArray(u))?!Zo(c,u,n):!Object.is(c,u))return!1}}return!0}var yh=t=>({isOnSubmit:!t||t===Io.onSubmit,isOnBlur:t===Io.onBlur,isOnChange:t===Io.onChange,isOnAll:t===Io.all,isOnTouch:t===Io.onTouched}),Oy=(t,e,n)=>{if(n)return!1;if(e.watchAll||e.watch.has(t))return!0;for(const r of e.watch)if(t.startsWith(r)&&t.charAt(r.length)===".")return!0;return!1};const yd=(t,e,n,r)=>{for(const o of n||Object.keys(t)){if(o==="_f")continue;const i=n?We(t,o):t[o];if(i){const{_f:a}=i;if(a){if(a.refs&&a.refs[0]&&e(a.refs[0],o)&&!r)return!0;if(a.ref&&e(a.ref,a.name)&&!r)return!0;if(yd(i,e))break}else if((ln(i)||Array.isArray(i))&&yd(i,e))break}}};var kA=(t,e,n)=>{const r=We(t,n),o=Array.isArray(r)?r:[];return on(o,AA,e[n]),on(t,n,o),t},Kn=t=>ln(t)&&!Object.keys(t).length,wh=t=>{if(!mh)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},Ny=t=>t.type==="radio",bh=t=>t instanceof RegExp,W4=(t,e,n,r,o)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:o||!0}}:{};const PA={value:!1,isValid:!1},OA={value:!0,isValid:!0};var NA=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!cn(t[0].attributes.value)?cn(t[0].value)||t[0].value===""?OA:{value:t[0].value,isValid:!0}:OA:PA}return PA};const DA={isValid:!1,value:null};var MA=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,DA):DA;function RA(t,e,n="validate"){if(Vn(t)||Array.isArray(t)&&t.every(Vn)||Xo(t)&&!t)return{type:n,message:Vn(t)?t:"",ref:e}}var Rc=t=>ln(t)&&!bh(t)?t:{value:t,message:""},LA=async(t,e,n,r,o,i)=>{const{ref:a,refs:c,required:u,maxLength:h,minLength:p,min:g,max:v,pattern:m,validate:C,name:b,valueAsNumber:w,mount:_}=t._f,E=We(n,b);if(!_||e.has(b))return{};const I=c?c[0]:a,k=ne=>{if(o&&I.reportValidity){const ae=Xo(ne)?"":ne||"";c?c.forEach(Q=>Q.setCustomValidity(ae)):I.setCustomValidity(ae),I.reportValidity()}},A={},M=Ny(a),B=md(a),W=M||B,Y=(w||gh(a))&&cn(a.value)&&cn(E)||wh(a)&&a.value===""||E===""||Array.isArray(E)&&!E.length,z=W4.bind(null,b,r,A),de=(ne,ae,Q,re=ko.maxLength,j=ko.minLength)=>{const se=ne?ae:Q;A[b]={type:ne?re:j,message:se,ref:a,...z(ne?re:j,se)}};if(i?!Array.isArray(E)||!E.length:u&&(!W&&(Y||zn(E))||Xo(E)&&!E||B&&!NA(c).isValid||M&&!MA(c).isValid)){const{value:ne,message:ae}=Vn(u)?{value:!!u,message:u}:Rc(u);if(ne&&(A[b]={type:ko.required,message:ae,ref:I,...z(ko.required,ae)},!r))return k(ae),A}if(!Y&&(!zn(g)||!zn(v))){let ne,ae;const Q=Rc(v),re=Rc(g);if(!zn(E)&&!isNaN(E)){const j=a.valueAsNumber||E&&+E;zn(Q.value)||(ne=j>Q.value),zn(re.value)||(ae=j<re.value)}else{const j=a.valueAsDate||new Date(E),se=$=>new Date(new Date().toDateString()+" "+$),ie=a.type=="time",ce=a.type=="week";Vn(Q.value)&&E&&(ne=ie?se(E)>se(Q.value):ce?E>Q.value:j>new Date(Q.value)),Vn(re.value)&&E&&(ae=ie?se(E)<se(re.value):ce?E<re.value:j<new Date(re.value))}if((ne||ae)&&(de(!!ne,Q.message,re.message,ko.max,ko.min),!r))return k(A[b].message),A}if((h||p)&&!Y&&(Vn(E)||i&&Array.isArray(E))){const ne=Rc(h),ae=Rc(p),Q=!zn(ne.value)&&E.length>+ne.value,re=!zn(ae.value)&&E.length<+ae.value;if((Q||re)&&(de(Q,ne.message,ae.message),!r))return k(A[b].message),A}if(m&&!Y&&Vn(E)){const{value:ne,message:ae}=Rc(m);if(bh(ne)&&!E.match(ne)&&(A[b]={type:ko.pattern,message:ae,ref:a,...z(ko.pattern,ae)},!r))return k(ae),A}if(C){if(ao(C)){const ne=await C(E,n),ae=RA(ne,I);if(ae&&(A[b]={...ae,...z(ko.validate,ae.message)},!r))return k(ae.message),A}else if(ln(C)){let ne={};for(const ae in C){if(!Kn(ne)&&!r)break;const Q=RA(await C[ae](E,n),I,ae);Q&&(ne={...Q,...z(ae,Q.message)},k(Q.message),r&&(A[b]=ne))}if(!Kn(ne)&&(A[b]={ref:I,...ne},!r))return A}}return k(!0),A},Ch=t=>Array.isArray(t)?t:[t],FA=t=>Array.isArray(t)?t.filter(Boolean):[];function q4(t,e){const n=e.length-1;let r=0;for(;r<n;){if(zn(t)){t=void 0;break}t=t[e[r]],r++}return t}function Y4(t){for(const e in t)if(t.hasOwnProperty(e)&&!cn(t[e]))return!1;return!0}function bn(t,e){if(Vn(e)&&Object.prototype.hasOwnProperty.call(t,e))return delete t[e],t;const n=Array.isArray(e)?e:vd(e)?[e]:vh(e);if(n.some(a=>ky.includes(String(a))))return t;const r=n.length===1?t:q4(t,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(ln(r)&&Kn(r)||Array.isArray(r)&&Y4(r))&&bn(t,n.slice(0,-1)),t}const $A=t=>{const e={};for(const n of Object.keys(t))if(Iy(t[n])&&t[n]!==null&&!Cs(t[n])){const r=$A(t[n]);for(const o of Object.keys(r))e[`${n}.${o}`]=r[o]}else e[n]=t[n];return e},Q4=D.createContext(null);Q4.displayName="HookFormContext";var UA=()=>{let t=[];return{get observers(){return t},next:o=>{for(const i of t)i.next&&i.next(o)},subscribe:o=>(t.push(o),{unsubscribe:()=>{t=t.filter(i=>i!==o)}}),unsubscribe:()=>{t=[]}}};function HA(t,e){const n={};for(const r in t)if(t.hasOwnProperty(r)){const o=t[r],i=e[r];if(o&&ln(o)&&i){const a=HA(o,i);ln(a)&&(n[r]=a)}else t[r]&&(n[r]=i)}return n}var BA=t=>t.type==="select-multiple",J4=t=>Ny(t)||md(t),Dy=t=>wh(t)&&t.isConnected;function zA(t){return Array.isArray(t)||ln(t)}function VA(t,e,n="",r=[]){for(const o in t){const i=n?`${n}.${o}`:o,a=t[o];zA(a)&&zA(We(e,i))?VA(a,e,i,r):r.push(i)}return r}var X4=t=>{for(const e in t)if(ao(t[e]))return!0;return!1};function KA(t){return Array.isArray(t)||ln(t)&&!X4(t)}function GA(t){return!!(t&&"_f"in t)}function jA(t){return Array.isArray(t)?!t.some(e=>!cn(e)):!Object.keys(t).length}function My(t,e){Array.isArray(t)?t[e]=void 0:delete t[e]}function Ry(t,e={},n){for(const r in t){const o=t[r],i=n&&n[r];KA(o)&&(!Array.isArray(o)||!GA(i))?(e[r]=Array.isArray(o)?[]:{},Ry(o,e[r],i),jA(e[r])&&My(e,r)):cn(o)||(e[r]=!0)}return e}function ga(t,e,n,r){n||(n=Ry(e,{},r));for(const o in t){const i=t[o],a=r&&r[o];KA(i)&&(!Array.isArray(i)||!GA(a))?(cn(e)||Py(n[o])?n[o]=Ry(i,Array.isArray(i)?[]:{},a):ga(i,zn(e)?{}:e[o],n[o],a),jA(n[o])&&My(n,o)):Zo(i,e[o])?My(n,o):n[o]=!0}return n}var WA=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>cn(t)?t:e?t===""?NaN:t&&+t:n&&Vn(t)?new Date(t):r?r(t):t;function qA(t){const e=t.ref;return gh(e)?e.files:Ny(e)?MA(t.refs).value:BA(e)?[...e.selectedOptions].map(({value:n})=>n):md(e)?NA(t.refs).value:WA(e.value,t)}var Z4=(t,e,n,r)=>{const o={};for(const i of t){const a=We(e,i);a&&on(o,i,a._f)}return{criteriaMode:n,names:[...t],fields:o,shouldUseNativeValidation:r}},wd=t=>cn(t)?t:bh(t)?t.source:ln(t)?bh(t.value)?t.value.source:t.value:t;const YA="AsyncFunction";var ez=t=>{if(!t||!t.validate)return!1;if(ao(t.validate))return t.validate.constructor.name===YA;if(ln(t.validate)){for(const e in t.validate)if(t.validate[e].constructor.name===YA)return!0}return!1},tz=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function QA(t,e,n){const r=We(t,n);if(r||vd(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),a=We(e,i),c=We(t,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(c&&c.type)return{name:i,error:c};if(c&&c.root&&c.root.type)return{name:`${i}.root`,error:c.root};o.pop()}return{name:n}}var nz=(t,e,n,r)=>{n(t);const o=Object.keys(t).filter(i=>i!=="name");return!o.length||r&&o.length>=Object.keys(e).length||o.find(i=>e[i]===(!r||Io.all))},rz=(t,e,n)=>!t||!e||t===e||Ch(t).some(r=>r&&(n?r===e||r.startsWith(e+"."):r.startsWith(e)||e.startsWith(r))),oz=(t,e,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(e||t):(n?r.isOnBlur:o.isOnBlur)?!t:(n?r.isOnChange:o.isOnChange)?t:!0,iz=(t,e)=>!FA(We(t,e)).length&&bn(t,e);const sz={mode:Io.onSubmit,reValidateMode:Io.onChange,shouldFocusError:!0},Ly="form",az=(t,e)=>{for(const n in t)n in e||delete t[n];Object.assign(t,e)},JA={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function cz(t={}){let e={...sz,...t},n={...gn(JA),isLoading:ao(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1},r={},o=ln(e.defaultValues)||ln(e.values)?gn(e.defaultValues||e.values)||{}:{},i=e.shouldUnregister?{}:gn(o),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const u={},h={};let p=0,g=yh(e.mode),v=yh(e.reValidateMode);const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},C={...m};let b={...C};const w={array:UA(),state:UA()};let _=0;const E=e.criteriaMode===Io.all,I=(L,X)=>ee=>{clearTimeout(h[L]),h[L]=setTimeout(X,ee)},k=async L=>{if(!a.keepIsValid&&!e.disabled&&(C.isValid||b.isValid||L)){const X=++_;let ee;e.resolver?(ee=Kn((await Q()).errors),X===_&&A()):ee=await se({fields:r,onlyCheckValid:!0,eventType:Mc.VALID}),X===_&&ee!==n.isValid&&w.state.next({isValid:ee})}},A=(L,X)=>{!e.disabled&&(C.isValidating||C.validatingFields||b.isValidating||b.validatingFields)&&((L||Array.from(c.mount)).forEach(ee=>{ee&&(X?on(n.validatingFields,ee,X):bn(n.validatingFields,ee))}),w.state.next({validatingFields:n.validatingFields,isValidating:!Kn(n.validatingFields)}))},M=()=>{n.dirtyFields=ga(o,i,void 0,r)},B=(L,X=[],ee,Ce,Se=!0,Oe=!0)=>{if(Ce&&ee&&!e.disabled){if(a.action=!0,Oe&&Array.isArray(We(r,L))){const Ne=ee(We(r,L),Ce.argA,Ce.argB);Se&&on(r,L,Ne)}if(Oe&&Array.isArray(We(n.errors,L))){const Ne=ee(We(n.errors,L),Ce.argA,Ce.argB);Se&&on(n.errors,L,Ne),iz(n.errors,L)}if((C.touchedFields||b.touchedFields)&&Oe&&Array.isArray(We(n.touchedFields,L))){const Ne=ee(We(n.touchedFields,L),Ce.argA,Ce.argB);Se&&on(n.touchedFields,L,Ne)}(C.dirtyFields||b.dirtyFields)&&M(),w.state.next({name:L,isDirty:ce(L,X),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else on(i,L,X)},W=(L,X)=>{on(n.errors,L,X),n.errors={...n.errors},w.state.next({errors:n.errors})},Y=L=>{n.errors=L,w.state.next({errors:n.errors,isValid:!1})},z=L=>{const X=vd(L)?[L]:vh(L);let ee=i,Ce=o;for(let Se=0;Se<X.length-1;Se++){const Oe=X[Se];if(ee=zn(ee)?ee:ee[Oe],Ce=zn(Ce)?Ce:Ce[Oe],ee===null&&Ce!==null)return!0}return!1},de=(L,X,ee,Ce)=>{const Se=We(r,L);if(Se){if(z(L))return;const Oe=cn(We(i,L)),Ne=We(i,L,cn(ee)?We(o,L):ee);cn(Ne)||Ce&&Ce.defaultChecked||X?on(i,L,X?Ne:qA(Se._f)):me(L,Ne),a.mount&&!a.action&&(k(),Oe&&n.isDirty&&(C.isDirty||b.isDirty)&&(ce()||(n.isDirty=!1,w.state.next({...n}))),t.shouldUnregister&&Oe&&!cn(We(i,L))&&Oy(L,c)&&(a.watch=!0))}},ne=(L,X,ee,Ce,Se)=>{let Oe=!1,Ne=!1;const Re={name:L};if(!e.disabled||Ce===!0){if(!ee||Ce){const Ge=Zo(We(o,L),X);(C.isDirty||b.isDirty)&&(Ne=n.isDirty,n.isDirty=Re.isDirty=!Ge||ce(),Oe=Ne!==Re.isDirty),Ne=!!We(n.dirtyFields,L),Ge!==n.isDirty?az(n.dirtyFields,ga(o,i,void 0,r)):Ge?bn(n.dirtyFields,L):on(n.dirtyFields,L,!0),Re.dirtyFields=n.dirtyFields,Oe=Oe||(C.dirtyFields||b.dirtyFields)&&Ne!==!Ge}if(ee){const Ge=We(n.touchedFields,L);Ge||(on(n.touchedFields,L,ee),Re.touchedFields=n.touchedFields,Oe=Oe||(C.touchedFields||b.touchedFields)&&Ge!==ee)}Oe&&Se&&w.state.next(Re)}return Oe?Re:{}},ae=(L,X,ee,Ce)=>{const Se=We(n.errors,L),Oe=(C.isValid||b.isValid)&&Xo(X)&&n.isValid!==X;if(e.delayError&&ee?(u[L]=I(L,()=>W(L,ee)),u[L](e.delayError)):(clearTimeout(h[L]),delete u[L],ee?on(n.errors,L,ee):bn(n.errors,L),n.errors={...n.errors}),(ee?!Zo(Se,ee):Se)||!Kn(Ce)||Oe){const Ne={...Ce,...Oe&&Xo(X)?{isValid:X}:{},errors:n.errors,name:L};n={...n,...Ne},w.state.next(Ne)}},Q=async L=>(A(L,!0),await e.resolver(i,e.context,Z4(L||c.mount,r,e.criteriaMode,e.shouldUseNativeValidation))),re=async L=>{const{errors:X}=await Q(L);if(A(L),L){for(const ee of L){const Ce=We(X,ee);Ce?c.array.has(ee)&&ln(Ce)&&!Object.keys(Ce).some(Se=>!Number.isNaN(Number(Se)))?kA(n.errors,{[ee]:Ce},ee):on(n.errors,ee,Ce):bn(n.errors,ee)}n.errors={...n.errors}}else n.errors=X;return X},j=async({name:L,eventType:X})=>{if(t.validate){const ee=await t.validate({formValues:i,formState:n,name:L,eventType:X});if(ln(ee))for(const Ce in ee){const Se=ee[Ce];Se&&He(`${Ly}.${Ce}`,{message:Vn(Se.message)?Se.message:"",type:Se.type||ko.validate})}else Vn(ee)||!ee?He(Ly,{message:ee||"",type:ko.validate}):fe(Ly);return ee}return!0},se=async({fields:L,onlyCheckValid:X,name:ee,eventType:Ce,context:Se={valid:!0,runRootValidation:!1}})=>{if(t.validate&&(Se.runRootValidation=!0,!await j({name:ee,eventType:Ce})&&(Se.valid=!1,X)))return Se.valid;for(const Oe in L){const Ne=L[Oe];if(Ne){const{_f:Re,...Ge}=Ne;if(Re){const bt=c.array.has(Re.name),Pt=Ne._f&&ez(Ne._f),Gn=C.validatingFields||C.isValidating||b.validatingFields||b.isValidating;Pt&&Gn&&A([Re.name],!0);const xr=await LA(Ne,c.disabled,i,E,e.shouldUseNativeValidation&&!X,bt);if(Pt&&Gn&&A([Re.name]),xr[Re.name]&&(Se.valid=!1,X)||(!X&&(We(xr,Re.name)?bt?kA(n.errors,xr,Re.name):on(n.errors,Re.name,xr[Re.name]):bn(n.errors,Re.name)),t.shouldUseNativeValidation&&xr[Re.name]))break}!Kn(Ge)&&await se({context:Se,onlyCheckValid:X,fields:Ge,name:Oe,eventType:Ce})}}return Se.valid},ie=()=>{for(const L of c.unMount){const X=We(r,L);X&&(X._f.refs?X._f.refs.every(ee=>!Dy(ee)):!Dy(X._f.ref))&&wt(L)}c.unMount=new Set},ce=(L,X)=>(L&&X&&on(i,L,X),!Zo(a.mount?i:o,o)),$=(L,X,ee)=>j4(L,c,{...a.mount?i:cn(X)?o:Vn(L)?{[L]:X}:X},ee,X),Z=L=>FA(We(a.mount?i:o,L,e.shouldUnregister?We(o,L,[]):[])),me=(L,X,ee={},Ce=!1,Se=!1)=>{const Oe=We(r,L);let Ne=X;if(Oe){const Re=Oe._f;Re&&(!Re.disabled&&on(i,L,WA(X,Re)),Ne=wh(Re.ref)&&zn(X)?"":X,BA(Re.ref)?[...Re.ref.options].forEach(Ge=>Ge.selected=Ne.includes(Ge.value)):Re.refs?md(Re.ref)?Re.refs.forEach(Ge=>{(!Ge.defaultChecked||!Ge.disabled)&&(Array.isArray(Ne)?Ge.checked=!!Ne.find(bt=>bt===Ge.value):Ge.checked=Ne===Ge.value||!!Ne)}):Re.refs.forEach(Ge=>Ge.checked=Ge.value===Ne):gh(Re.ref)?Re.ref.value="":(Re.ref.value=Ne,!Re.ref.type&&!Se&&w.state.next({name:L,values:Ce?i:gn(i)})))}(ee.shouldDirty||ee.shouldTouch)&&ne(L,Ne,ee.shouldTouch,ee.shouldDirty,!Se),ee.shouldValidate&&Ie(L,{delayError:ee.delayError})},_e=(L,X,ee,Ce=!1,Se=!1)=>{c.array.has(L)&&w.array.next({name:L,values:Ce?i:gn(i)});for(const Oe in X){if(!X.hasOwnProperty(Oe))return;const Ne=X[Oe],Re=L+"."+Oe,Ge=We(r,Re);(c.array.has(L)||ln(Ne)||Ge&&!Ge._f)&&!Cs(Ne)?_e(Re,Ne,ee,Ce,Se):me(Re,Ne,ee,Ce,Se)}},Ee=(L,X,ee,Ce,Se=!1)=>{const Oe=We(r,L),Ne=c.array.has(L),Re=Ce?X:gn(X),Ge=We(i,L),bt=Zo(Ge,Re);if(bt||on(i,L,Re),Ne)w.array.next({name:L,values:Ce?i:gn(i)}),(C.isDirty||C.dirtyFields||b.isDirty||b.dirtyFields)&&ee.shouldDirty&&(M(),Se||w.state.next({name:L,dirtyFields:n.dirtyFields,isDirty:ce(L,Re)}));else{const Pt=Array.isArray(Re)&&!Re.length||Kn(Re);!Oe||Oe._f||zn(Re)||Pt?me(L,Re,ee,Ce,Se):_e(L,Re,ee,Ce,Se)}if(!bt&&!Se){const Pt=Oy(L,c),Gn=Ce?i:gn(i);w.state.next({...Pt&&n,name:a.mount||Pt?L:void 0,values:Gn})}},ke=(L,X,ee={})=>Ee(L,X,ee,!1),te=(L,X={})=>{const ee=ao(L)?L(i):L;if(!Zo(i,ee)){i={...i,...ee};const Ce=$A(ee);for(const Se of c.mount)Se in Ce&&Ee(Se,Ce[Se],X,!0,!0);w.state.next({...n,name:void 0,type:void 0,...p?{values:i}:{}}),X.shouldValidate&&k()}},pe=async L=>{a.mount=!0;const X=L.target;let ee=X.name,Ce=!0;const Se=We(r,ee),Oe=Ne=>{Ce=Number.isNaN(Ne)||Cs(Ne)&&isNaN(Ne.getTime())||Zo(Ne,We(i,ee,Ne))};if(Se){let Ne,Re;const Ge=X.type?qA(Se._f):U4(L),bt=L.type===Mc.BLUR||L.type===Mc.FOCUS_OUT,Pt=!tz(Se._f)&&!t.validate&&!e.resolver&&!We(n.errors,ee)&&!Se._f.deps,Gn=Pt||oz(bt,We(n.touchedFields,ee),n.isSubmitted,v,g),xr=Oy(ee,c,bt);if(on(i,ee,Ge),bt){if(!X||!X.readOnly){Se._f.onBlur&&Se._f.onBlur(L);const Ln=u[ee];Ln&&Ln(0)}}else Se._f.onChange&&Se._f.onChange(L);const Po=ne(ee,Ge,bt),Ye=!Kn(Po)||xr;if(!bt&&w.state.next({name:ee,type:L.type,...p?{values:gn(i)}:{}}),Gn)return(!Pt||!n.isValid)&&(C.isValid||b.isValid)&&(e.mode==="onBlur"?bt&&k():bt||k()),Ye&&w.state.next({name:ee,...xr?{}:Po});if(!e.resolver&&t.validate&&await j({name:ee,eventType:L.type}),!bt&&xr&&w.state.next({...n}),e.resolver){const{errors:Ln}=await Q([ee]);if(A([ee]),Oe(Ge),!Ce){!Kn(Po)&&w.state.next(Po);return}const Lc=QA(n.errors,r,ee),$r=QA(Ln,r,Lc.name||ee);Ne=$r.error,ee=$r.name,Re=Kn(Ln)}else A([ee],!0),Ne=(await LA(Se,c.disabled,i,E,e.shouldUseNativeValidation))[ee],A([ee]),Oe(Ge),Ce&&(Ne?Re=!1:(C.isValid||b.isValid)&&(Re=await se({fields:r,onlyCheckValid:!0,name:ee,eventType:L.type})));Ce&&(Se._f.deps&&(!Array.isArray(Se._f.deps)||Se._f.deps.length>0)&&Ie(Se._f.deps),ae(ee,Re,Ne,Po))}},be=(L,X)=>{if(We(n.errors,X)&&L.focus)return L.focus(),1},Ie=async(L,X={})=>{let ee,Ce;const Se=Ch(L);if(e.resolver){const Oe=await re(cn(L)?L:Se);ee=Kn(Oe),Ce=L?!Se.some(Ne=>We(Oe,Ne)):ee}else L?(Ce=(await Promise.all(Se.map(async Oe=>{const Ne=We(r,Oe);return await se({fields:Ne&&Ne._f?{[Oe]:Ne}:Ne,eventType:Mc.TRIGGER})}))).every(Boolean),!(!Ce&&!n.isValid)&&k()):Ce=ee=await se({fields:r,name:L,eventType:Mc.TRIGGER});if(X.delayError&&e.delayError&&Vn(L)){const Oe=We(n.errors,L);Oe?(bn(n.errors,L),u[L]=I(L,()=>W(L,Oe)),u[L](e.delayError)):(clearTimeout(h[L]),delete u[L])}return w.state.next({...!Vn(L)||(C.isValid||b.isValid)&&ee!==n.isValid?{}:{name:L},...e.resolver||!L?{isValid:ee}:{},errors:n.errors}),X.shouldFocus&&!Ce&&yd(r,be,L?Se:c.mount),Ce},Pe=(L,X)=>{let ee={...a.mount?i:o};return X&&(ee=HA(X.dirtyFields?n.dirtyFields:n.touchedFields,ee)),cn(L)?ee:Vn(L)?We(ee,L):L.map(Ce=>We(ee,Ce))},Me=(L,X)=>({invalid:!!We((X||n).errors,L),isDirty:!!We((X||n).dirtyFields,L),error:We((X||n).errors,L),isValidating:!!We(n.validatingFields,L),isTouched:!!We((X||n).touchedFields,L)}),fe=L=>{const X=L?Ch(L):void 0;X==null||X.forEach(ee=>bn(n.errors,ee)),X?X.forEach(ee=>{w.state.next({name:ee,errors:n.errors})}):(n.errors={},w.state.next({errors:n.errors}))},He=(L,X,ee)=>{const Ce=(We(r,L,{_f:{}})._f||{}).ref,Se=We(n.errors,L)||{},{ref:Oe,message:Ne,type:Re,...Ge}=Se;on(n.errors,L,{...Ge,...X,ref:Ce}),w.state.next({name:L,errors:n.errors,isValid:!1}),ee&&ee.shouldFocus&&Ce&&Ce.focus&&Ce.focus()},Ut=(L,X)=>{if(ao(L)){p++;const{unsubscribe:ee}=w.state.subscribe({next:Se=>"values"in Se&&L(Se.values||$(void 0,X),Se)});let Ce=!1;return{unsubscribe:()=>{Ce||(Ce=!0,p--,ee())}}}return $(L,X,!0)},ct=L=>{var X;const ee=!!(!((X=L.formState)===null||X===void 0)&&X.values);ee&&p++;const{unsubscribe:Ce}=w.state.subscribe({next:Oe=>{if(rz(L.name,Oe.name,L.exact)&&nz(Oe,L.formState||C,kt,L.reRenderRoot)){const Ne={...i};L.callback({values:Ne,...n,...Oe,defaultValues:o})}}});if(!ee)return Ce;let Se=!1;return()=>{Se||(Se=!0,p--,Ce())}},ze=L=>(a.mount=!0,b={...b,...L.formState},ct({...L,formState:{...m,...L.formState}})),wt=(L,X={})=>{for(const ee of L?Ch(L):c.mount)c.mount.delete(ee),c.array.delete(ee),X.keepValue||(bn(r,ee),bn(i,ee)),!X.keepError&&bn(n.errors,ee),!X.keepDirty&&bn(n.dirtyFields,ee),!X.keepTouched&&bn(n.touchedFields,ee),!X.keepIsValidating&&bn(n.validatingFields,ee),!e.shouldUnregister&&!X.keepDefaultValue&&bn(o,ee);w.state.next({values:gn(i)}),w.state.next({...n,...X.keepDirty?{isDirty:ce()}:{}}),!X.keepIsValid&&k()},vt=({disabled:L,name:X})=>{if(Xo(L)&&a.mount||L||c.disabled.has(X)){const Se=c.disabled.has(X)!==!!L;L?c.disabled.add(X):c.disabled.delete(X),Se&&a.mount&&!a.action&&k()}},qt=(L,X={})=>{let ee=We(r,L);const Ce=Xo(X.disabled)||Xo(e.disabled),Se=!c.registerName.has(L)&&ee&&ee._f&&!ee._f.mount;return on(r,L,{...ee||{},_f:{...ee&&ee._f?ee._f:{ref:{name:L}},name:L,mount:!0,...X}}),c.mount.add(L),ee&&!Se?vt({disabled:Xo(X.disabled)?X.disabled:e.disabled,name:L}):de(L,!0,X.value),{...Ce?{disabled:X.disabled||e.disabled}:{},...e.progressive?{required:!!X.required,min:wd(X.min),max:wd(X.max),minLength:wd(X.minLength),maxLength:wd(X.maxLength),pattern:wd(X.pattern)}:{},name:L,onChange:pe,onBlur:pe,ref:Oe=>{if(Oe){c.registerName.add(L),qt(L,X),c.registerName.delete(L),ee=We(r,L);const Ne=cn(Oe.value)&&Oe.querySelectorAll&&Oe.querySelectorAll("input,select,textarea")[0]||Oe,Re=J4(Ne),Ge=ee._f.refs||[];if(Re?Ge.find(Pt=>Pt===Ne):Ne===ee._f.ref)return;const bt={...ee._f};Re?(bt.refs=[...Ge.filter(Dy),Ne,...Array.isArray(We(o,L))?[{}]:[]],bt.ref={type:Ne.type,name:L}):(bt.ref=Ne,delete bt.refs),on(r,L,{_f:bt}),de(L,!1,void 0,Ne)}else ee=We(r,L,{}),ee._f&&(ee._f.mount=!1),(e.shouldUnregister||X.shouldUnregister)&&!(H4(c.array,L)&&a.action)&&c.unMount.add(L)}}},An=()=>e.shouldFocusError&&!e.shouldUseNativeValidation&&yd(r,be,c.mount),In=L=>{Xo(L)&&(w.state.next({disabled:L}),yd(r,(X,ee)=>{const Ce=We(r,ee);Ce&&(X.disabled=Ce._f.disabled||L,Array.isArray(Ce._f.refs)&&Ce._f.refs.forEach(Se=>{Se.disabled=Ce._f.disabled||L}))},0,!1))},At=(L,X)=>async ee=>{let Ce,Se;ee&&(ee.preventDefault&&ee.preventDefault(),ee.persist&&ee.persist());let Oe=gn(i);if(w.state.next({isSubmitting:!0}),e.resolver){const{errors:Ne,values:Re}=await Q();A(),n.errors=Ne,Oe=gn(Re)}else await se({fields:r,eventType:Mc.SUBMIT});if(c.disabled.size)for(const Ne of c.disabled)bn(Oe,Ne);if(bn(n.errors,AA),Kn(n.errors)){w.state.next({errors:{}});try{Ce=await L(Oe,ee)}catch(Ne){Se=Ne}}else X&&await X({...n.errors},ee),An(),setTimeout(An);if(w.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Kn(n.errors)&&!Se,submitCount:n.submitCount+1,errors:n.errors}),Se)throw Se;return Ce},co=(L,X={})=>{We(r,L)&&(cn(X.defaultValue)?ke(L,gn(We(o,L))):(ke(L,X.defaultValue),on(o,L,gn(X.defaultValue))),X.keepTouched||bn(n.touchedFields,L),X.keepDirty||(bn(n.dirtyFields,L),n.isDirty=X.defaultValue?ce(L,gn(We(o,L))):ce()),X.keepError||(bn(n.errors,L),C.isValid&&k()),w.state.next({...n}))},sr=(L,X={})=>{const ee=L?gn(L):o,Ce=gn(ee),Se=Kn(L),Oe=Ce,Ne=r;if(X.keepDefaultValues||(o=ee),!X.keepValues){if(X.keepDirtyValues){const Re=new Set([...c.mount,...VA(ga(o,i,void 0,Ne),n.dirtyFields)]);for(const Ge of Array.from(Re)){const bt=We(n.dirtyFields,Ge),Pt=We(i,Ge),Gn=We(Oe,Ge);bt&&!cn(Pt)?on(Oe,Ge,Pt):!bt&&!cn(Gn)&&ke(Ge,Gn)}}else{if(mh&&cn(L))for(const Re of c.mount){const Ge=We(r,Re);if(Ge&&Ge._f){const bt=Array.isArray(Ge._f.refs)?Ge._f.refs[0]:Ge._f.ref;if(wh(bt)){const Pt=bt.closest("form");if(Pt){Pt.reset();break}}}}if(X.keepFieldsRef)for(const Re of c.mount)ke(Re,We(Oe,Re));else r={}}if(e.shouldUnregister){if(i=X.keepDefaultValues?gn(o):{},X.keepFieldsRef)for(const Re of c.mount)on(i,Re,We(Oe,Re))}else i=gn(Oe);w.array.next({values:{...Oe}}),w.state.next({name:void 0,type:void 0,values:{...Oe}})}c={mount:X.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!C.isValid||!!X.keepIsValid||!!X.keepDirtyValues||!e.shouldUnregister&&!Kn(Oe),a.watch=!!e.shouldUnregister,a.keepIsValid=!!X.keepIsValid,a.action=!1,X.keepErrors||(n.errors={}),w.state.next({submitCount:X.keepSubmitCount?n.submitCount:0,isDirty:Se?!1:X.keepDirty?n.isDirty:X.keepValues?ce():!!(X.keepDefaultValues&&!Zo(L,o)),isSubmitted:X.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Se?{}:X.keepDirtyValues?X.keepDefaultValues&&i?ga(o,i,void 0,Ne):n.dirtyFields:X.keepDefaultValues&&L?ga(o,L,void 0,Ne):X.keepDirty?n.dirtyFields:{},touchedFields:X.keepTouched?n.touchedFields:{},errors:X.keepErrors?n.errors:{},isSubmitSuccessful:X.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},De=(L,X)=>sr(ao(L)?L(i):L,{...e.resetOptions,...X}),qe=(L,X={})=>{const ee=We(r,L),Ce=ee&&ee._f;if(Ce){const Se=Ce.refs?Ce.refs[0]:Ce.ref;Se.focus&&setTimeout(()=>{Se.focus(),X.shouldSelect&&ao(Se.select)&&Se.select()})}},kt=L=>{const{name:X,type:ee,values:Ce,...Se}=L;n={...n,...Se}},dn={control:{register:qt,unregister:wt,getFieldState:Me,handleSubmit:At,setError:He,_subscribe:ct,_runSchema:Q,_updateIsValidating:A,_focusError:An,_getWatch:$,_getDirty:ce,_setValid:k,_setFieldArray:B,_setDisabledField:vt,_setErrors:Y,_getFieldArray:Z,_reset:sr,_resetDefaultValues:()=>ao(e.defaultValues)&&e.defaultValues().then(L=>{De(L,e.resetOptions),w.state.next({isLoading:!1})}),_removeUnmounted:ie,_disableForm:In,_subjects:w,_proxyFormState:C,get _fields(){return r},get _formValues(){return i},get _state(){return a},set _state(L){a=L},get _defaultValues(){return o},get _names(){return c},set _names(L){c=L},get _formState(){return n},get _options(){return e},set _options(L){e={...e,...L},g=yh(e.mode),v=yh(e.reValidateMode)}},subscribe:ze,trigger:Ie,register:qt,handleSubmit:At,watch:Ut,setValue:ke,setValues:te,getValues:Pe,reset:De,resetField:co,resetDefaultValues:(L,X={})=>{if(o=gn(L),!X.keepDirty){const ee=ga(o,i,void 0,r);n.dirtyFields=ee,n.isDirty=!Kn(ee)}X.keepIsValid||k(),w.state.next({...n,defaultValues:o})},clearErrors:fe,unregister:wt,setError:He,setFocus:qe,getFieldState:Me};return{...dn,formControl:dn}}function lz(t={}){const e=D.useRef(void 0),n=D.useRef(void 0),r=D.useRef(t.formControl),[o,i]=D.useState(()=>({...gn(JA),isLoading:ao(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1,defaultValues:ao(t.defaultValues)?void 0:t.defaultValues}));if(!e.current||t.formControl&&r.current!==t.formControl)if(r.current=t.formControl,t.formControl)e.current={...t.formControl,formState:o},t.defaultValues&&!ao(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:c,...u}=cz(t);e.current={...u,formState:o}}const a=e.current.control;return a._options=t,G4(()=>{const c=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState,defaultValues:a._defaultValues}),reRenderRoot:!0});return i(u=>({...u,isReady:!0})),a._formState.isReady=!0,c},[a]),D.useEffect(()=>a._disableForm(t.disabled),[a,t.disabled]),D.useEffect(()=>{t.mode&&(a._options.mode=t.mode),t.reValidateMode&&(a._options.reValidateMode=t.reValidateMode)},[a,t.mode,t.reValidateMode]),D.useEffect(()=>{t.errors&&(a._setErrors(t.errors),a._focusError())},[a,t.errors]),D.useEffect(()=>{t.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,t.shouldUnregister]),D.useEffect(()=>{if(a._proxyFormState.isDirty){const c=a._getDirty();c!==o.isDirty&&a._subjects.state.next({isDirty:c})}},[a,o.isDirty]),D.useEffect(()=>{var c;t.values&&!Zo(t.values,n.current)?(a._reset(t.values,{keepFieldsRef:!0,...a._options.resetOptions}),!((c=a._options.resetOptions)===null||c===void 0)&&c.keepIsValid||a._setValid(),n.current=t.values,i(u=>({...u}))):a._resetDefaultValues()},[a,t.values]),D.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),e.current.formState=D.useMemo(()=>K4(o,a),[a,o]),e.current}const XA=({className:t,children:e,content:n,side:r})=>{const[o,i]=D.useState(!1);return d.jsx(wr,{delayDuration:0,children:d.jsxs(br,{open:o,children:[d.jsx(Cr,{asChild:!0,children:d.jsx("button",{type:"button",className:Xe("cursor-pointer",t),onClick:()=>i(!o),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onTouchStart:()=>i(!o),onKeyDown:a=>{a.preventDefault(),a.key==="Enter"&&i(!o)},children:e})}),d.jsx(rr,{side:r,className:n?"":"hidden",children:d.jsx("span",{className:"inline-block",children:n})})]})})},dz=(t,e)=>{const[n,r]=D.useState(t);return D.useEffect(()=>{const o=setTimeout(()=>{r(t)},e);return()=>{clearTimeout(o)}},[t,e]),n},uz=({apiBaseUrl:t=ud})=>{var M,B;const[e,n]=D.useState([]),[r,o]=D.useState(!1),[i,a]=D.useState([]),[c,u]=D.useState(1),[h,p]=D.useState(1),[g,v]=D.useState(null),[m,C]=D.useState(""),b=dz(m,500),w=W=>{const Y=W.match(/\d{6}/);if(!Y)return{month:"",year:""};const z=Y[0],de=z.substring(0,2),ne=z.substring(2);return{month:de,year:ne}},_=W=>W.map(z=>{let de=(z==null?void 0:z.month)||"",ne=(z==null?void 0:z.year)||"";if((!de||!ne)&&(z!=null&&z.file_name)){const ae=w(z.file_name);de=de||ae.month,ne=ne||ae.year}return{id:z==null?void 0:z.id,prefix:(z==null?void 0:z.prefix)||"",model:(z==null?void 0:z.model)||"",fileName:(z==null?void 0:z.file_name)||"",code:(z==null?void 0:z.stock_id)||"",month:de,year:ne,content:(z==null?void 0:z.text_summary)||"",status:(z==null?void 0:z.status)||"",note:(z==null?void 0:z.note)||"",lastUpdate:z==null?void 0:z.updated_at,stock_id:z==null?void 0:z.stock_id}}),E=W=>{if(!(W!=null&&W.data))return[];const Y=_(W==null?void 0:W.data);n(Y),p(W.pagination.totalPages)},I=async(W=1,Y=15)=>{v(W),o(!0);try{const z=await $e.get(`${t}/api/latest-summaries`,{params:{page:W,limit:Y,search:m}});(z==null?void 0:z.status)===200?E(z.data):console.error(z)}catch(z){console.error("Error fetching data:",z)}finally{v(null),o(!1)}};D.useEffect(()=>{b&&u(1),I(c)},[c,b]);const k=D.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:Y})=>d.jsx("span",{className:"flex flex-col",children:Y.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:Y})=>{const z=Y.original.month,de=Y.original.year;return d.jsx("span",{className:"flex flex-col",children:`${z.toString().padStart(2,"0")}/${de}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:Y})=>{const z=Y.getValue("content");return d.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:z})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:Y})=>{const de=Y.original.status!=="unpublish";return d.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${de?"bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20":"bg-gray-50 text-gray-600 ring-1 ring-inset ring-gray-500/20"}`,children:de?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:Y})=>d.jsx(XA,{content:d.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:Y.original.note}),children:d.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:Y.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:Y})=>{const z=new Date(Y.original.lastUpdate),de=z.getDate(),ne=z.getMonth()+1,ae=`ngày ${de} tháng ${ne}`;return d.jsx("span",{className:"flex flex-col",children:ae})}},{accessorKey:"actions",header:()=>d.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:Y})=>{const[z,de]=D.useState(!1),[ne,ae]=D.useState(!1),[Q,re]=D.useState(!1),{handleSubmit:j,register:se,reset:ie}=lz(),ce=Y.original.id,$=Y.getValue("status"),Z=Y.getValue("content"),[me,_e]=D.useState(!1),Ee=async()=>{try{_e(!0);const te=$==="unpublish"?"published":"unpublish",pe=await $e.patch(`${t}/api/toggle-publish/${ce}`,{id:ce,typeAction:"update",status:$,idInput:ce,stock_id:Y.original.stock_id,prefix:Y.original.prefix,model:Y.original.model,summary_result:Y.original.content,note:Y.original.note});pe.status===200?n(be=>be.map(Ie=>Ie.id===ce?{...Ie,status:te}:Ie)):console.error("Failed to toggle publish status:",pe)}catch(te){console.error("Error toggling publish status:",te)}finally{_e(!1)}},ke=async te=>{de(!0);try{const pe=await $e.patch(`${t}/api/update-summary`,{note:te.note,text_summary:te.content,id:ce});pe.status===200?(await I(c),ae(!1)):console.error("Failed to update summary:",pe)}catch(pe){console.error("Error updating summary:",pe)}return de(!1)};return d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[d.jsx(je,{variant:"outline",size:"sm",onClick:()=>re(!0),className:"px-2 py-0.5 h-7",children:d.jsx(Fm,{className:"h-4 w-4"})}),d.jsx(yr,{open:Q,onOpenChange:re,children:d.jsxs(Zn,{className:"max-w-3xl max-h-[80vh]",children:[d.jsx(er,{children:d.jsx(tr,{children:"Nội dung chi tiết"})}),d.jsx("div",{className:"mt-4 overflow-y-auto max-h-[60vh]",children:d.jsx("div",{className:"whitespace-pre-wrap text-[16px] leading-relaxed",children:Z})})]})}),d.jsxs(yr,{open:ne,onOpenChange:te=>{ae(te),te?ie({content:Y.original.content,note:Y.original.note}):ie()},children:[d.jsx(Kl,{asChild:!0,children:d.jsx(je,{variant:"outline",size:"sm",onClick:()=>ae(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),d.jsx(Zn,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:d.jsxs(er,{className:"flex flex-col gap-3",children:[d.jsx(tr,{className:"max-sm:hidden text-center",children:"Sửa summary"}),d.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:j(ke),children:[d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("div",{className:"flex flex-col items-start",children:[d.jsx("span",{children:"Nội dung:"}),d.jsx(Ql,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:Y.original.answer||"",rows:10,...se("content")})]}),d.jsxs("div",{className:"flex flex-col items-start",children:[d.jsx("span",{children:"Ghi chú:"}),d.jsx(Ql,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:Y.original.note||"",rows:1,...se("note")})]})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx(je,{disabled:z,type:"submit",variant:"default",children:z?d.jsx(Tt,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),d.jsx(je,{variant:"outline",size:"sm",onClick:Ee,disabled:me,className:"w-[70px] px-2 py-0.5 h-7",children:me?d.jsx(Tt,{className:"h-4 w-4 animate-spin"}):$==="unpublish"?"Publish":"Unpublish"})]})}}],[]),A=p0({data:e,columns:k,state:{columnFilters:i},enableRowSelection:!0,onColumnFiltersChange:a,getFilteredRowModel:uR(),getCoreRowModel:h0()});return d.jsxs("div",{className:"space-y-4 s3-explr-container",children:[d.jsx("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:d.jsxs("div",{className:"relative max-w-sm",children:[d.jsx(nr,{placeholder:"Tìm kiếm theo mã...",value:m,onChange:W=>C(W.target.value),className:"pr-8"}),m&&d.jsx(je,{variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6 p-0",onClick:()=>C(""),children:d.jsx(Um,{className:"h-4 w-4"})})]})}),d.jsx("div",{className:"rounded-md border s3-explr-table-container",children:d.jsxs(Tf,{className:"s3-explr-table",children:[d.jsx(Ef,{className:"s3-explr-table-header",children:A.getHeaderGroups().map(W=>d.jsx(To,{className:"hover:bg-transparent s3-explr-header-row",children:W.headers.map(Y=>d.jsx(Wo,{className:"s3-explr-header-cell",children:Y.isPlaceholder?null:yf(Y.column.columnDef.header,Y.getContext())},Y.id))},W.id))}),d.jsx(Af,{className:"s3-explr-table-body",children:r?d.jsx(To,{children:d.jsx(Dr,{colSpan:k.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(M=A.getRowModel().rows)!=null&&M.length?(B=A.getRowModel().rows)==null?void 0:B.map(W=>d.jsx(To,{className:"h-12 s3-explr-row",children:W.getVisibleCells().map(Y=>d.jsx(Dr,{className:"align-middle s3-explr-cell",children:yf(Y.column.columnDef.cell,Y.getContext())},Y.id))},W.id)):d.jsx(To,{children:d.jsx(Dr,{colSpan:k.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),d.jsx("div",{className:"mt-4",children:d.jsx(Gl,{children:d.jsxs(jl,{children:[d.jsx(Nr,{children:d.jsx(Wl,{onClick:()=>u(W=>Math.max(1,W-1)),className:c===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:h},(W,Y)=>Y+1).filter(W=>W===1||W===h||Math.abs(W-c)<=1).map((W,Y,z)=>d.jsxs(d.Fragment,{children:[Y>0&&z[Y-1]!==W-1&&d.jsx(Nr,{children:d.jsx(Yl,{})},W+"..."),d.jsx(Nr,{children:d.jsx(ea,{onClick:()=>u(W),isActive:c===W,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===W?d.jsx(Tt,{className:"h-4 w-4 animate-spin"}):W})},W)]})),d.jsx(Nr,{children:d.jsx(ql,{onClick:()=>u(W=>Math.min(h,W+1)),className:c===h||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},ZA=10,fz=D.memo(({apiBaseUrl:t=ud})=>{const[e,n]=D.useState(1),[r,o]=D.useState([]),[i,a]=D.useState({total:0,page:1,limit:ZA,totalPages:1}),[c,u]=D.useState(!0),[h,p]=D.useState(null),[g,v]=D.useState(new Set),{toast:m}=Zl(),[C,b]=D.useState(!1),w=async A=>{try{p(A);const M=await $e.get(`${t}/api/jobs`,{params:{page:A.toString(),limit:ZA.toString()}});o(M.data.data),a(M.data.pagination)}catch{m({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{p(null),u(!1)}};D.useEffect(()=>{w(e)},[e,t]);const _=async A=>{v(M=>new Set(M).add(A.toString()));try{await $e.post(`${t}/api/retry-job`,{jobId:A}),m({title:"Job Restarted",description:`Job ${A} has been successfully restarted.`}),w(e)}catch{m({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${A}. Please try again.`})}finally{v(M=>{const B=new Set(M);return B.delete(A.toString()),B})}},E=async()=>{b(!0),n(1),await w(1),b(!1)},I=A=>new Date(A).toLocaleString(),k=A=>{if(A=parseFloat(A),A<60)return`${A.toFixed(2)}s`;const M=Math.floor(A/60),B=(A%60).toFixed(0);return`${M}m ${B}s`};return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[d.jsx(bR,{className:"w-8 h-8 text-primary"}),d.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),d.jsx(je,{variant:"outline",size:"icon",onClick:E,disabled:C||c,className:"ml-2",children:d.jsx(DR,{className:`h-4 w-4 ${C?"animate-spin":""}`})})]}),d.jsx("div",{className:"rounded-md border",children:d.jsxs(Tf,{children:[d.jsx(Ef,{children:d.jsxs(To,{children:[d.jsx(Wo,{children:"ID"}),d.jsx(Wo,{children:"Tên Công Việc"}),d.jsx(Wo,{children:"Thời Gian Bắt Đầu"}),d.jsx(Wo,{children:"Thời Gian Cập Nhật"}),d.jsx(Wo,{children:"Thời Gian Thực Thi"}),d.jsx(Wo,{children:"Trạng Thái"}),d.jsx(Wo,{children:"Thao Tác"})]})}),d.jsx(Af,{children:c&&r.length===0?d.jsx(To,{children:d.jsx(Dr,{colSpan:7,className:"text-center py-4",children:d.jsx(Tt,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(A=>{var M,B;return d.jsxs(To,{children:[d.jsx(Dr,{className:"!w-[100px]",children:A.id}),d.jsx(Dr,{className:"font-medium",children:(M=A.job_name)==null?void 0:M.replace("Upload file","Summary")}),d.jsx(Dr,{className:"!w-[200px]",children:I(A.created_at)}),d.jsx(Dr,{className:"!w-[200px]",children:I(A.updated_at)}),d.jsx(Dr,{className:"!w-[150px]",children:k(A.execution_time_seconds)}),d.jsx(Dr,{className:"!w-[200px]",children:d.jsx(XA,{content:A.status==="fail"&&A.error?d.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:A.error}):null,children:d.jsx("div",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]
|
|
1067
|
+
${A.status==="done"?"bg-green-100 text-green-800":A.status==="fail"?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"}`,children:A.status==="fail"?"FAILED":(B=A.status)==null?void 0:B.toUpperCase()})})}),d.jsx(Dr,{className:"!w-[200px]",children:A.status==="fail"?d.jsx(je,{variant:"outline",size:"sm",onClick:()=>_(A.id),disabled:g.has(A.id.toString()),className:"h-[32px]",children:g.has(A.id.toString())?d.jsxs(d.Fragment,{children:[d.jsx(Tt,{className:"mr-2 h-4 w-4 animate-spin"}),"Đang thử lại..."]}):"Thử Lại"}):d.jsx("div",{className:"h-[32px]"})})]},A.id)})})]})}),d.jsx("div",{className:"mt-4",children:d.jsx(Gl,{children:d.jsxs(jl,{children:[d.jsx(Nr,{children:d.jsx(Wl,{onClick:()=>n(A=>Math.max(1,A-1)),className:e===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:i.totalPages},(A,M)=>M+1).filter(A=>A===1||A===i.totalPages||Math.abs(A-e)<=1).map((A,M,B)=>d.jsxs(d.Fragment,{children:[M>0&&B[M-1]!==A-1&&d.jsx(Nr,{children:d.jsx(Yl,{})},A+"..."),d.jsx(Nr,{children:d.jsx(ea,{onClick:()=>n(A),isActive:e===A,className:`cursor-pointer ${h!==null?"pointer-events-none":""}`,children:h===A?d.jsx(Tt,{className:"h-4 w-4 animate-spin"}):A})},A)]})),d.jsx(Nr,{children:d.jsx(ql,{onClick:()=>n(A=>Math.min(i.totalPages,A+1)),className:e===i.totalPages||h!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),d.jsx(DS,{})]})});Gt.API_BASE_URL=ud,Gt.Job=fz,Gt.S3Explorer=$4,Gt.Summary=uz,Object.defineProperty(Gt,Symbol.toStringTag,{value:"Module"})});
|
|
1068
|
+
//# sourceMappingURL=s3-explorer.umd.cjs.map
|