@syncfy/authentication-widget 1.2.0 → 1.3.0

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.
@@ -1,4 +1,4 @@
1
- (function(Zn,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(Zn=typeof globalThis<"u"?globalThis:Zn||self,Zn.SyncfyAuthenticationWidget=e())})(this,function(){"use strict";var li=Object.defineProperty;var ui=(Zn,e,t)=>e in Zn?li(Zn,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):Zn[e]=t;var $n=(Zn,e,t)=>ui(Zn,typeof e!="symbol"?e+"":e,t);const resource$1={accounts_selection:{done:e=>{const{normalize:t}=e;return t(["Done"])},error:e=>{const{normalize:t}=e;return t(["An error occurred while fetching the accounts."])},fetching:e=>{const{normalize:t}=e;return t(["Fetching accounts"])},form_error:e=>{const{normalize:t}=e;return t(["Please select at least one account."])},form_label:e=>{const{normalize:t}=e;return t(["Syncfy will only share the data you select."])},form_label_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Syncfy will only share the data you select with ",n(a("client")),"."])},title:e=>{const{normalize:t}=e;return t(["Select Accounts"])}},api_errors:{400:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Some API request params are incorrect."])},short_description:e=>{const{normalize:t}=e;return t(["Bad Request"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Authentication failed."])},short_description:e=>{const{normalize:t}=e;return t(["Unauthorized"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},402:{long_description:e=>{const{normalize:t}=e;return t(["Something went wrong when trying to access this service. Please contact the support team for more information."])},real:{long_description:e=>{const{normalize:t}=e;return t(["API is disabled for non-payment."])},short_description:e=>{const{normalize:t}=e;return t(["Payment Required"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Forbidden."])},short_description:e=>{const{normalize:t}=e;return t(["Forbidden"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},404:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Not Found."])},short_description:e=>{const{normalize:t}=e;return t(["Not Found"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},429:{long_description:e=>{const{normalize:t}=e;return t(["Too many requests have been made in a short time. Please try again later"])},real:{long_description:e=>{const{normalize:t}=e;return t(["Too Many Requests."])},short_description:e=>{const{normalize:t}=e;return t(["Too Many Requests"])}},short_description:e=>{const{normalize:t}=e;return t(["Requests Rate Limit Exceeded"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Internal Server Error."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Server Error"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},503:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Service Unavailable."])},short_description:e=>{const{normalize:t}=e;return t(["Service Unavailable"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},credential_error:{long_description:e=>{const{normalize:t}=e;return t(["Credential error, please consider updating credential password."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Credential error, please consider updating credential password."])},short_description:e=>{const{normalize:t}=e;return t(["Credential error"])}},short_description:e=>{const{normalize:t}=e;return t(["Credential error"])}},credential_not_found:{long_description:e=>{const{normalize:t}=e;return t(["The given credential was invalid or not found."])},real:{long_description:e=>{const{normalize:t}=e;return t(["The given credential was invalid or not found."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid credential"])}},short_description:e=>{const{normalize:t}=e;return t(["Invalid credential"])}},no_internet:{long_description:e=>{const{normalize:t}=e;return t(["There is no internet connection, check your connection and try again."])},real:{long_description:e=>{const{normalize:t}=e;return t(["There is no internet connection, check your connection and try again."])},short_description:e=>{const{normalize:t}=e;return t(["Connection error"])}},short_description:e=>{const{normalize:t}=e;return t(["Connection error"])}},site_not_found:{long_description:e=>{const{normalize:t}=e;return t(["The given entrypoint.site was invalid or not found."])},real:{long_description:e=>{const{normalize:t}=e;return t(["The given entrypoint.site was invalid or not found."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid entrypoint.site"])}},short_description:e=>{const{normalize:t}=e;return t(["Invalid entrypoint.site"])}},unauthorized:{long_description:e=>{const{normalize:t}=e;return t(["Your session has expired."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Your session has expired."])},short_description:e=>{const{normalize:t}=e;return t(["Unauthorized"])}},short_description:e=>{const{normalize:t}=e;return t(["Unauthorized"])}}},back_up_connection:{description:e=>{const{normalize:t}=e;return t(["Something went wrong when trying to connect to the institution, but you can upload your statement and we will extract the information."])},title:e=>{const{normalize:t}=e;return t(["An error occurred in the connection"])}},bridge:{114:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},116:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3e3:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3001:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3008:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3010:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3014:{long_description:e=>{const{normalize:t}=e;return t(["Se ha detectado más de una Llave Inteligente BBVA u ocurrió un error de comunicación."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3015:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3016:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3020:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3021:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3022:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3333:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3334:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3335:{long_description:e=>{const{normalize:t}=e;return t(["No se ha detectado una Llave Inteligente BBVA, verifique que esté conectada correctamente a su equipo."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3336:{long_description:e=>{const{normalize:t}=e;return t(["Error de comunicación durante el proceso de validación de su Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_config_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass configuration script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},host_update_available:{long_description:e=>{const{normalize:t}=e;return t(["Host application update available."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},not_ready:{long_description:e=>{const{normalize:t}=e;return t(["Bridge is not ready"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}}},common:{add_other:e=>{const{normalize:t}=e;return t(["Add another institution"])},back:e=>{const{normalize:t}=e;return t(["Back"])},cancel:e=>{const{normalize:t}=e;return t(["Cancel"])},continue:e=>{const{normalize:t}=e;return t(["Continue"])},close:e=>{const{normalize:t}=e;return t(["Close"])},data_error:e=>{const{normalize:t}=e;return t(["Sorry, an error occurred when loading the initial data"])},error:e=>{const{normalize:t}=e;return t(["Error"])},expand:e=>{const{normalize:t}=e;return t(["Expand"])},find_your_institution:e=>{const{normalize:t}=e;return t(["Find Your Institution"])},finish:e=>{const{normalize:t}=e;return t(["Finish"])},header:{login:e=>{const{normalize:t}=e;return t(["Login Information"])},link:e=>{const{normalize:t}=e;return t(["Link your Institution"])},select:e=>{const{normalize:t}=e;return t(["Select the institution"])}},hide:e=>{const{normalize:t}=e;return t(["Hide"])},intro:e=>{const{normalize:t}=e;return t(["Connect accounts from different institutions and extract data automatically"])},less:e=>{const{normalize:t}=e;return t(["less"])},long_description:e=>{const{normalize:t}=e;return t(["Connect accounts from different institutions and extract data automatically"])},more:e=>{const{normalize:t}=e;return t(["more"])},next:e=>{const{normalize:t}=e;return t(["Next"])},no_filtered_data:e=>{const{normalize:t}=e;return t(["There are no institutions available with the search criteria."])},process_running:e=>{const{normalize:t}=e;return t(["There is an institution being connected at this moment. Please, wait for this connection to finish."])},refresh:e=>{const{normalize:t}=e;return t(["Refresh"])},retry:e=>{const{normalize:t}=e;return t(["Try Again"])},search:e=>{const{normalize:t}=e;return t(["Search..."])},security_banner_content:e=>{const{normalize:t}=e;return t(["Your information is transferred encrypted end-to-end with the same standard Banks and Financial Institutions utilize."])},security_banner_title:e=>{const{normalize:t}=e;return t(["Secure and Private"])},session_error:e=>{const{normalize:t}=e;return t(["Something went wrong."])},session_refreshed_message:e=>{const{normalize:t}=e;return t(["Your session has been updated."])},session_refreshed:e=>{const{normalize:t}=e;return t(["Session refreshed"])},show:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Show ",n(a("msg"))])},show_password:e=>{const{normalize:t}=e;return t(["Show"])},test_mode:e=>{const{normalize:t}=e;return t(["You are currently running in Test Mode"])},unauthorized_message:e=>{const{normalize:t}=e;return t(["Your session expired, do you want refresh your session?"])},unauthorized:e=>{const{normalize:t}=e;return t(["Unauthorized"])},update_title:e=>{const{normalize:t}=e;return t(["Update Institution"])},webapp_add_banks:e=>{const{normalize:t}=e;return t(["Banks"])},webapp_add_blockchain:e=>{const{normalize:t}=e;return t(["Blockchain"])},webapp_add_government:e=>{const{normalize:t}=e;return t(["Government"])},webapp_add_utilities:e=>{const{normalize:t}=e;return t(["Utilities"])},webapp_add_wallet:e=>{const{normalize:t}=e;return t(["Digital Wallets"])}},credential:{api_error:{message:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},title:e=>{const{normalize:t}=e;return t(["Error"])}},found:{message:e=>{const{normalize:t}=e;return t(["Waiting to establish connection."])},title:e=>{const{normalize:t}=e;return t(["Credential found"])}},header_title:{sync:e=>{const{normalize:t}=e;return t(["Syncing credential"])},update:e=>{const{normalize:t}=e;return t(["Updating credential"])}},loading:{message:e=>{const{normalize:t}=e;return t(["Please wait a moment while we connect to the institution."])},title:e=>{const{normalize:t}=e;return t(["Connecting to institution"])}},search:{message:e=>{const{normalize:t}=e;return t(["Please wait a moment while we verify your information."])},title:e=>{const{normalize:t}=e;return t(["Validating credentials"])}}},download_options:{date_range_end:e=>{const{normalize:t}=e;return t(["End date"])},date_range_start:e=>{const{normalize:t}=e;return t(["Start date"])},label:e=>{const{normalize:t}=e;return t(["Download date range"])},switch:e=>{const{normalize:t}=e;return t(["Define download date range"])}},file:{click:e=>{const{normalize:t}=e;return t(["Clic to upload"])},invalid:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["The file extension must be ",n(a("extension")),"."])},invalid_multiple:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["The file extension must be one of these: ",n(a("extensions")),"."])},no_chosen:e=>{const{normalize:t}=e;return t(["No file chosen."])},remove:e=>{const{normalize:t}=e;return t(["Remove file."])},required:e=>{const{normalize:t}=e;return t(["is required."])}},form_errors:{regex:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Introduced value is not of type ",n(a("label")),"."])},required:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("label"))," is required."])}},privacy:{link:e=>{const{normalize:t}=e;return t(["Syncfy's Privacy Policy"])},list:{first:e=>{const{normalize:t}=e;return t(["Your data belongs to you!"])},second:e=>{const{normalize:t}=e;return t(["Connect easy and safely to your accounts."])},third:e=>{const{normalize:t}=e;return t(["Trusted by more than +100K users."])}},message:e=>{const{normalize:t}=e;return t(["By selecting ”Continue” you agree to"])},title:e=>{const{normalize:t}=e;return t(["You are using Syncfy for bank connectivity."])},title_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("client"))," partners with Syncfy for bank connectivity."])},url:e=>{const{normalize:t}=e;return t(["https://help.paybook.com/en/article/privacy-and-security-policy-k33bgf/"])}},santander_ws:{error:{long_description:e=>{const{normalize:t}=e;return t(["There was an error generating the token."])},short_description:e=>{const{normalize:t}=e;return t(["Token error"])}},script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Script not loaded."])},short_description:e=>{const{normalize:t}=e;return t(["Token error"])}}},site:{login:{authenticating:e=>{const{normalize:t}=e;return t(["Authenticating"])},error:e=>{const{normalize:t}=e;return t(["Authentication Error"])},success:e=>{const{normalize:t}=e;return t(["Successful Authentication"])}}},socket:{error:{long_description:e=>{const{normalize:t}=e;return t(["Socket connection ended, check your connection and try again."])},short_description:e=>{const{normalize:t}=e;return t(["Socket error"])}},message:{100:{long_description:e=>{const{normalize:t}=e;return t(["Establishing connection with the institution..."])},short_description:e=>{const{normalize:t}=e;return t(["Establishing Connection"])}},101:{long_description:e=>{const{normalize:t}=e;return t(["Connection established with the institution, credentials are being validated..."])},short_description:e=>{const{normalize:t}=e;return t(["Validating Credentials"])}},102:{long_description:e=>{const{normalize:t}=e;return t(["Successfully logged into the institution"])},short_description:e=>{const{normalize:t}=e;return t(["Login Successful"])}},103:{long_description:e=>{const{normalize:t}=e;return t(["The token has been sent and is being validated..."])},short_description:e=>{const{normalize:t}=e;return t(["Validating Token"])}},200:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. Data has been extracted"])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},201:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. We have partially extracted information, but data will still be extracted in background processes."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},202:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, no transactions were found."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},203:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, more than one account does not have transactions."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},204:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, the data downloaded is incomplete."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},206:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, there were no accounts linked to the given credentials."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},400:{long_description:e=>{const{normalize:t}=e;return t(["The value of one of the parameters is incorrect."])},short_description:e=>{const{normalize:t}=e;return t(["Bad request"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["The value of one of the given Authentication Fields was not accepted by the institution. Please verify the information and try again."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid Credentials"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["The given token value introduced was not accepted by the institution or the expiration time was reached."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid Token"])}},405:{long_description:e=>{const{normalize:t}=e;return t(["The institution has blocked the given credential, please contact your institution and make sure your connection to the site is working properly before trying again."])},short_description:e=>{const{normalize:t}=e;return t(["Credential Locked"])}},406:{long_description:e=>{const{normalize:t}=e;return t(["The institution does not allow to have more than one user logged in. If you have logged into your institution using another device, please make sure to log out before trying again."])},short_description:e=>{const{normalize:t}=e;return t(["Already Logged In"])}},408:{long_description:e=>{const{normalize:t}=e;return t(["The institution requires attention from the user. We advise you to log into the institution to confirm everything is working properly. Upon confirmation, try again."])},short_description:e=>{const{normalize:t}=e;return t(["Attention Required"])}},409:{long_description:e=>{const{normalize:t}=e;return t(["The given credentials seem to be valid, but they belong to a different site from the same organization."])},short_description:e=>{const{normalize:t}=e;return t(["Incorrect Site"])}},410:{long_description:e=>{const{normalize:t}=e;return t(["Waiting for token..."])},short_description:e=>{const{normalize:t}=e;return t(["Authenticating"])}},411:{long_description:e=>{const{normalize:t}=e;return t(["The time to introduce the token value has been exceeded."])},short_description:e=>{const{normalize:t}=e;return t(["Token Not Received"])}},413:{long_description:e=>{const{normalize:t}=e;return t(["There was a problem in the connection. Please wait 15 minutes and try again. If the problem persists contact Technical Support."])},short_description:e=>{const{normalize:t}=e;return t(["Connection Error"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Error"])}},501:{long_description:e=>{const{normalize:t}=e;return t(["The institution has informed to us that there was a problem in the connection. Please wait 15 minutes and try again. If the problem persists contact Technical Support."])},short_description:e=>{const{normalize:t}=e;return t(["Connection Error"])}},504:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Error"])}},507:{long_description:e=>{const{normalize:t}=e;return t(["The institution has informed to us that there was a problem in the connection. Please wait 15 minutes and try again. If the problem persists contact Technical Support."])},short_description:e=>{const{normalize:t}=e;return t(["Connection Error"])}},509:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, the institution is in maintenance."])},short_description:e=>{const{normalize:t}=e;return t(["Site in Maintenance"])}}},quick_answer:{long_description:e=>{const{normalize:t}=e;return t(["Successfully logged into the institution. The data will be extracted by background processes."])},short_description:e=>{const{normalize:t}=e;return t(["Login Successful"])}},timeout:{long_description:e=>{const{normalize:t}=e;return t(["Server is taking too long to respond."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Error"])}}},twofa:{waiting:e=>{const{normalize:t}=e;return t(["Waiting for token"])}}},resource={accounts_selection:{done:e=>{const{normalize:t}=e;return t(["Terminar"])},error:e=>{const{normalize:t}=e;return t(["Pasó un error al obtener las cuentas."])},fetching:e=>{const{normalize:t}=e;return t(["Obteniendo cuentas"])},form_error:e=>{const{normalize:t}=e;return t(["Por favor selecciona al menos una cuenta."])},form_label:e=>{const{normalize:t}=e;return t(["Syncfy sólo compartirá los datos que selecciones."])},form_label_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Syncfy sólo compartirá los datos que selecciones con ",n(a("client")),"."])},title:e=>{const{normalize:t}=e;return t(["Seleccionar cuentas"])}},api_errors:{400:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Algunos parámetros de la petición son incorrectos."])},short_description:e=>{const{normalize:t}=e;return t(["Petición incorrecta"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["La autenticación falló."])},short_description:e=>{const{normalize:t}=e;return t(["No autorizado"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},402:{long_description:e=>{const{normalize:t}=e;return t(["Algo salió mal al intentar acceder a este servicio. Comunícate con el equipo de soporte para obtener más información."])},real:{long_description:e=>{const{normalize:t}=e;return t(["El API se deshabilitó por falta de pago."])},short_description:e=>{const{normalize:t}=e;return t(["Pago requerido"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Prohibido."])},short_description:e=>{const{normalize:t}=e;return t(["Prohibido"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},404:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["No encontrado."])},short_description:e=>{const{normalize:t}=e;return t(["No encontrado"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},429:{long_description:e=>{const{normalize:t}=e;return t(["Se han realizado muchas peticiones en un periodo corto de tiempo. Por favor intentar nuevamente más tarde."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Se han realizado muchas peticiones en un periodo corto de tiempo. Por favor intentar nuevamente más tarde."])},short_description:e=>{const{normalize:t}=e;return t(["Límite de peticiones excedido"])}},short_description:e=>{const{normalize:t}=e;return t(["Límite de peticiones excedido"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, un error interno ha ocurrido. Por favor intenta nuevamente más tarde."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Error interno del servidor."])},short_description:e=>{const{normalize:t}=e;return t(["Error interno del servidor"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},503:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, un error interno ha ocurrido. Por favor intenta nuevamente más tarde."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Servicio no disponible."])},short_description:e=>{const{normalize:t}=e;return t(["Servicio no disponible"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},credential_error:{long_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales, por favor considera actualizar la contraseña de las credenciales."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales, por favor considera actualizar la contraseña de las credenciales."])},short_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales"])}},short_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales"])}},credential_not_found:{long_description:e=>{const{normalize:t}=e;return t(["La credencial proporcionada es inválida o no se encontró."])},real:{long_description:e=>{const{normalize:t}=e;return t(["La credencial proporcionada es inválida o no se encontró."])},short_description:e=>{const{normalize:t}=e;return t(["Credencial inválida"])}},short_description:e=>{const{normalize:t}=e;return t(["Credencial inválida"])}},no_internet:{long_description:e=>{const{normalize:t}=e;return t(["No hay conexión a internet, revisa tu conexión e intenta nuevamente."])},real:{long_description:e=>{const{normalize:t}=e;return t(["No hay conexión a internet, revisa tu conexión e intenta nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Error de conexión"])}},short_description:e=>{const{normalize:t}=e;return t(["Error de conexión"])}},site_not_found:{long_description:e=>{const{normalize:t}=e;return t(["El parámetro entrypoint.site proporcionado es inválido o no se encontró."])},real:{long_description:e=>{const{normalize:t}=e;return t(["El parámetro entrypoint.site proporcionado es inválido o no se encontró."])},short_description:e=>{const{normalize:t}=e;return t(["entrypoint.site inválido"])}},short_description:e=>{const{normalize:t}=e;return t(["entrypoint.site inválido"])}},unauthorized:{long_description:e=>{const{normalize:t}=e;return t(["Tu sesión ha expirado."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Tu sesión ha expirado."])},short_description:e=>{const{normalize:t}=e;return t(["No autorizado"])}},short_description:e=>{const{normalize:t}=e;return t(["No autorizado"])}}},back_up_connection:{description:e=>{const{normalize:t}=e;return t(["Algo salió mal al intentar realizar la conexión, pero puedes subir tu estado de cuenta y extraeremos la información."])},title:e=>{const{normalize:t}=e;return t(["Se produjo un error en la conexión"])}},bridge:{114:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},116:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3e3:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3001:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3008:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3010:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3014:{long_description:e=>{const{normalize:t}=e;return t(["Se ha detectado más de una Llave Inteligente BBVA u ocurrió un error de comunicación."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3015:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3016:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3020:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3021:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3022:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3333:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3334:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3335:{long_description:e=>{const{normalize:t}=e;return t(["No se ha detectado una Llave Inteligente BBVA, verifique que esté conectada correctamente a su equipo."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3336:{long_description:e=>{const{normalize:t}=e;return t(["Error de comunicación durante el proceso de validación de su Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_config_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass configuration script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},host_update_available:{long_description:e=>{const{normalize:t}=e;return t(["Host application update available."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},not_ready:{long_description:e=>{const{normalize:t}=e;return t(["Bridge is not ready"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}}},common:{add_other:e=>{const{normalize:t}=e;return t(["Agregar Otra Institución"])},back:e=>{const{normalize:t}=e;return t(["Atrás"])},cancel:e=>{const{normalize:t}=e;return t(["Cancelar"])},close:e=>{const{normalize:t}=e;return t(["Cerrar"])},continue:e=>{const{normalize:t}=e;return t(["Continuar"])},data_error:e=>{const{normalize:t}=e;return t(["Lo sentimos, ocurrió un error al cargar la información inicial"])},error:e=>{const{normalize:t}=e;return t(["Error"])},expand:e=>{const{normalize:t}=e;return t(["Expandir"])},find_your_institution:e=>{const{normalize:t}=e;return t(["Encuentra tu institución"])},finish:e=>{const{normalize:t}=e;return t(["Finalizar"])},header:{login:e=>{const{normalize:t}=e;return t(["Información de inicio de sesión"])},link:e=>{const{normalize:t}=e;return t(["Conecta tu institución"])},select:e=>{const{normalize:t}=e;return t(["Seleccione la institución"])}},hide:e=>{const{normalize:t}=e;return t(["Ocultar"])},intro:e=>{const{normalize:t}=e;return t(["Conecta cuentas de diferentes instituciones y extrae datos automáticamente"])},less:e=>{const{normalize:t}=e;return t(["menos"])},long_description:e=>{const{normalize:t}=e;return t(["Conecta cuentas de diferentes instituciones y extrae datos automáticamente"])},more:e=>{const{normalize:t}=e;return t(["más"])},next:e=>{const{normalize:t}=e;return t(["Siguiente"])},no_filtered_data:e=>{const{normalize:t}=e;return t(["No hay instituciones disponibles con el criterio de búsqueda."])},process_running:e=>{const{normalize:t}=e;return t(["Actualmente existe una institución procesándose en este momento. Por favor, espera a que este proceso termine."])},refresh:e=>{const{normalize:t}=e;return t(["Renovar"])},retry:e=>{const{normalize:t}=e;return t(["Intentar Nuevamente"])},search:e=>{const{normalize:t}=e;return t(["Buscar..."])},security_banner_content:e=>{const{normalize:t}=e;return t(["Tu información se transfiere cifrada de extremo a extremo con el mismo estándar que utilizan los bancos e instituciones financieras."])},security_banner_title:e=>{const{normalize:t}=e;return t(["Seguro y privado"])},session_error:e=>{const{normalize:t}=e;return t(["Algo salió mal al actualizar la sesión."])},session_refreshed_message:e=>{const{normalize:t}=e;return t(["Tu sesión ha sido actualizada."])},session_refreshed:e=>{const{normalize:t}=e;return t(["Sesión renovada"])},show:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Mostrar ",n(a("msg"))])},show_password:e=>{const{normalize:t}=e;return t(["Mostrar"])},test_mode:e=>{const{normalize:t}=e;return t(["Actualmente estás operando en Modo de Prueba"])},unauthorized_message:e=>{const{normalize:t}=e;return t(["Tu sesión ha expirado, ¿Quieres renovar tu sesión?"])},unauthorized:e=>{const{normalize:t}=e;return t(["Sin autorización"])},update_title:e=>{const{normalize:t}=e;return t(["Actualizar Institución"])},webapp_add_banks:e=>{const{normalize:t}=e;return t(["Bancos"])},webapp_add_blockchain:e=>{const{normalize:t}=e;return t(["Blockchain"])},webapp_add_government:e=>{const{normalize:t}=e;return t(["Gobierno"])},webapp_add_utilities:e=>{const{normalize:t}=e;return t(["Servicios"])},webapp_add_wallet:e=>{const{normalize:t}=e;return t(["Carteras Digitales"])}},credential:{api_error:{message:e=>{const{normalize:t}=e;return t(["Lo sentimos, un error interno ha ocurrido. Por favor intenta nuevamente más tarde."])},title:e=>{const{normalize:t}=e;return t(["Error"])}},found:{message:e=>{const{normalize:t}=e;return t(["Espere un momento mientras conectamos con la institución."])},title:e=>{const{normalize:t}=e;return t(["Credenciales encontradas"])}},header_title:{sync:e=>{const{normalize:t}=e;return t(["Sincronizando credencial"])},update:e=>{const{normalize:t}=e;return t(["Actualizando credencial"])}},loading:{message:e=>{const{normalize:t}=e;return t(["Espere un momento mientras conectamos con la institución."])},title:e=>{const{normalize:t}=e;return t(["Conectando con la institución"])}},search:{message:e=>{const{normalize:t}=e;return t(["Por favor espera un momento mientras validamos tus credenciales."])},title:e=>{const{normalize:t}=e;return t(["Validando credenciales"])}}},download_options:{date_range_end:e=>{const{normalize:t}=e;return t(["Fecha final"])},date_range_start:e=>{const{normalize:t}=e;return t(["Fecha de inicio"])},label:e=>{const{normalize:t}=e;return t(["Periodo de descarga"])},switch:e=>{const{normalize:t}=e;return t(["Definir periodo de descarga"])}},file:{click:e=>{const{normalize:t}=e;return t(["Clic para subir"])},invalid:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["La extensión del archivo debe ser ",n(a("extension")),"."])},invalid_multiple:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["La extensión del archivo debe ser alguna de estas: ",n(a("extensions")),"."])},no_chosen:e=>{const{normalize:t}=e;return t(["Ningún archivo seleccionado."])},remove:e=>{const{normalize:t}=e;return t(["Quitar archivo."])},required:e=>{const{normalize:t}=e;return t(["es requerido."])}},form_errors:{regex:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["El valor ingresado no es de tipo ",n(a("label")),"."])},required:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("label"))," es requerido."])}},privacy:{link:e=>{const{normalize:t}=e;return t(["Política de privacidad de Syncfy"])},list:{first:e=>{const{normalize:t}=e;return t(["¡Tus datos te pertenecen!"])},second:e=>{const{normalize:t}=e;return t(["Conecta tus cuentas de forma fácil y segura."])},third:e=>{const{normalize:t}=e;return t(["Más de 100k usuarios confían en nosotros."])}},message:e=>{const{normalize:t}=e;return t(["Al seleccionar ”Continuar”, aceptas la"])},title:e=>{const{normalize:t}=e;return t(["Estás usando Syncfy para conectar tus cuentas."])},title_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("client"))," se une a Syncfy para conectar tus cuentas."])},url:e=>{const{normalize:t}=e;return t(["https://help.paybook.com/es/article/politica-de-privacidad-y-seguridad-4b9oho/"])}},santander_ws:{error:{long_description:e=>{const{normalize:t}=e;return t(["Hubo un error al generar el token."])},short_description:e=>{const{normalize:t}=e;return t(["Error del token"])}},script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["No se cargó el script."])},short_description:e=>{const{normalize:t}=e;return t(["Error del token"])}}},site:{login:{authenticating:e=>{const{normalize:t}=e;return t(["Autenticando"])},error:e=>{const{normalize:t}=e;return t(["Error de Autenticación"])},success:e=>{const{normalize:t}=e;return t(["Autenticación Exitosa"])}}},socket:{error:{long_description:e=>{const{normalize:t}=e;return t(["La conexión con el socket finalizó, revisa tu conexión e intenta nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Error del socket"])}},message:{100:{long_description:e=>{const{normalize:t}=e;return t(["Estableciendo conexión con la institución..."])},short_description:e=>{const{normalize:t}=e;return t(["Estableciendo Conexión"])}},101:{long_description:e=>{const{normalize:t}=e;return t(["Conexión establecida con la institución, las credenciales se encuentran en proceso de validación..."])},short_description:e=>{const{normalize:t}=e;return t(["Validando Credenciales"])}},102:{long_description:e=>{const{normalize:t}=e;return t(["Se ha iniciado sesión exitosamente en el sitio de la institución."])},short_description:e=>{const{normalize:t}=e;return t(["Sesión Iniciada Exitosamente"])}},103:{long_description:e=>{const{normalize:t}=e;return t(["El token ha sido enviado al sitio y se encuentra en proceso de validación..."])},short_description:e=>{const{normalize:t}=e;return t(["Validando Token"])}},200:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Se ha descargado la información."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},201:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Se ha descargado parte de la información, pero se continuará descargando información en segundo plano."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},202:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Sin embargo, no se encontraron transacciones."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},203:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Se ha detectado que una o más cuentas no tienen transacciones."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},204:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha concluido. Sin embargo, se ha detectado que la información obtenida está incompleta."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},206:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Sin embargo, no se encontraron cuentas vinculadas a las credenciales proporcionadas."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},400:{long_description:e=>{const{normalize:t}=e;return t(["El valor de alguno de los parámetros es incorrecto."])},short_description:e=>{const{normalize:t}=e;return t(["Solicitud incorrecta"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["El valor de alguno de los elementos de autenticación que proporcionaste no fue aceptado por la institución. Por favor verifica la información e intenta de nuevo."])},short_description:e=>{const{normalize:t}=e;return t(["Credenciales Inválidas"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["El valor del token introducido no aceptado por la institución o ha expirado el tiempo para utilizarlo."])},short_description:e=>{const{normalize:t}=e;return t(["Token Inválido"])}},405:{long_description:e=>{const{normalize:t}=e;return t(["La institución ha bloqueado las credenciales proporcionadas. Por favor contacta a tu institución y asegúrate que tu banca en línea está funcionando correctamente antes de intentarlo nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Credenciales Bloqueadas"])}},406:{long_description:e=>{const{normalize:t}=e;return t(["La institución no permite iniciar más de una sesión para las credenciales proporcionadas. Si has iniciado sesión en otro lado por favor asegúrate de haberla cerrado antes de intentarlo nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Sesión Abierta"])}},408:{long_description:e=>{const{normalize:t}=e;return t(["La institución solicita atención del usuario para las credenciales proporcionadas. Te recomendamos iniciar sesión en el portal de la institución para confirmar que todo está en orden, posterior a eso favor de intentar nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Atención Requerida"])}},409:{long_description:e=>{const{normalize:t}=e;return t(["Las credenciales parecen ser válidas sin embargo corresponden a un sitio diferente de la misma organización."])},short_description:e=>{const{normalize:t}=e;return t(["Sitio Incorrecto"])}},410:{long_description:e=>{const{normalize:t}=e;return t(["Esperando token..."])},short_description:e=>{const{normalize:t}=e;return t(["Autenticando"])}},411:{long_description:e=>{const{normalize:t}=e;return t(["Se excedió el tiempo de espera para introducir el valor del token."])},short_description:e=>{const{normalize:t}=e;return t(["Token no recibido"])}},413:{long_description:e=>{const{normalize:t}=e;return t(["Hubo un problema durante el proceso de conexión. Por favor esperar 15 minutos e intentar nuevamente. Si persiste el problema contacte a Soporte Técnico."])},short_description:e=>{const{normalize:t}=e;return t(["Error de Conexión"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, ha ocurrido un error interno al procesar tu institución."])},short_description:e=>{const{normalize:t}=e;return t(["Error Interno"])}},501:{long_description:e=>{const{normalize:t}=e;return t(["La institución nos ha informado que tuvo un problema durante el proceso de conexión. Por favor esperar 15 minutos e intentar nuevamente. Si persiste el problema contacte a Soporte Técnico."])},short_description:e=>{const{normalize:t}=e;return t(["Error de Conexión"])}},504:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, ha ocurrido un error interno al procesar tu institución."])},short_description:e=>{const{normalize:t}=e;return t(["Error Interno"])}},507:{long_description:e=>{const{normalize:t}=e;return t(["La institución nos ha informado que tuvo un problema durante el proceso de conexión. Por favor esperar 15 minutos e intentar nuevamente. Si persiste el problema contacte a Soporte Técnico."])},short_description:e=>{const{normalize:t}=e;return t(["Error de Conexión"])}},509:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra en mantenimiento."])},short_description:e=>{const{normalize:t}=e;return t(["Sitio en Mantenimiento"])}}},quick_answer:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. La información se continuará descargando información en segundo plano."])},short_description:e=>{const{normalize:t}=e;return t(["Sesión Iniciada Exitosamente."])}},timeout:{long_description:e=>{const{normalize:t}=e;return t(["El servidor ha tardado en responder."])},short_description:e=>{const{normalize:t}=e;return t(["Error Interno"])}}},twofa:{waiting:e=>{const{normalize:t}=e;return t(["Esperando token"])}}};function isElement$1(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e!==null&&e.nodeType===1&&typeof e.nodeName=="string"}const global$1=globalThis||void 0||self;function getDefaultExportFromCjs$1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var browser$d={exports:{}},process=browser$d.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch{try{return cachedSetTimeout.call(null,e,0)}catch{return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch{try{return cachedClearTimeout.call(null,e)}catch{return cachedClearTimeout.call(this,e)}}}var queue$1=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue$1=currentQueue.concat(queue$1):queueIndex=-1,queue$1.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue$1.length;t;){for(currentQueue=queue$1,queue$1=[];++queueIndex<t;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,t=queue$1.length}currentQueue=null,draining=!1,runClearTimeout(e)}}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];queue$1.push(new Item(e,t)),queue$1.length===1&&!draining&&runTimeout(drainQueue)};function Item(e,t){this.fun=e,this.array=t}Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={};function noop$2(){}process.on=noop$2,process.addListener=noop$2,process.once=noop$2,process.off=noop$2,process.removeListener=noop$2,process.removeAllListeners=noop$2,process.emit=noop$2,process.prependListener=noop$2,process.prependOnceListener=noop$2,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var browserExports=browser$d.exports;const process$1=getDefaultExportFromCjs$1(browserExports),getDefaultsFromPostinstall=()=>{};/**
1
+ (function(Zn,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(Zn=typeof globalThis<"u"?globalThis:Zn||self,Zn.SyncfyAuthenticationWidget=e())})(this,function(){"use strict";var li=Object.defineProperty;var ui=(Zn,e,t)=>e in Zn?li(Zn,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):Zn[e]=t;var $n=(Zn,e,t)=>ui(Zn,typeof e!="symbol"?e+"":e,t);const resource$1={accounts_selection:{done:e=>{const{normalize:t}=e;return t(["Done"])},error:e=>{const{normalize:t}=e;return t(["An error occurred while fetching the accounts."])},fetching:e=>{const{normalize:t}=e;return t(["Fetching accounts"])},form_error:e=>{const{normalize:t}=e;return t(["Please select at least one account."])},form_label:e=>{const{normalize:t}=e;return t(["Syncfy will only share the data you select."])},form_label_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Syncfy will only share the data you select with ",n(a("client")),"."])},title:e=>{const{normalize:t}=e;return t(["Select Accounts"])}},api_errors:{400:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Some API request params are incorrect."])},short_description:e=>{const{normalize:t}=e;return t(["Bad Request"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Authentication failed."])},short_description:e=>{const{normalize:t}=e;return t(["Unauthorized"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},402:{long_description:e=>{const{normalize:t}=e;return t(["Something went wrong when trying to access this service. Please contact the support team for more information."])},real:{long_description:e=>{const{normalize:t}=e;return t(["API is disabled for non-payment."])},short_description:e=>{const{normalize:t}=e;return t(["Payment Required"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Forbidden."])},short_description:e=>{const{normalize:t}=e;return t(["Forbidden"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},404:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Not Found."])},short_description:e=>{const{normalize:t}=e;return t(["Not Found"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},429:{long_description:e=>{const{normalize:t}=e;return t(["Too many requests have been made in a short time. Please try again later"])},real:{long_description:e=>{const{normalize:t}=e;return t(["Too Many Requests."])},short_description:e=>{const{normalize:t}=e;return t(["Too Many Requests"])}},short_description:e=>{const{normalize:t}=e;return t(["Requests Rate Limit Exceeded"])}},449:{long_description:e=>{const{normalize:t}=e;return t(["The provided entrypoint.credential parameter is no longer valid, as the site it belongs to has been deactivated or is obsolete."])},real:{long_description:e=>{const{normalize:t}=e;return t(["The provided entrypoint.credential parameter is no longer valid, as the site it belongs to has been deactivated or is obsolete."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid credential"])}},short_description:e=>{const{normalize:t}=e;return t(["Invalid credential"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Internal Server Error."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Server Error"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},503:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Service Unavailable."])},short_description:e=>{const{normalize:t}=e;return t(["Service Unavailable"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},credential_error:{long_description:e=>{const{normalize:t}=e;return t(["Credential error, please consider updating credential password."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Credential error, please consider updating credential password."])},short_description:e=>{const{normalize:t}=e;return t(["Credential error"])}},short_description:e=>{const{normalize:t}=e;return t(["Credential error"])}},credential_not_found:{long_description:e=>{const{normalize:t}=e;return t(["The given credential was invalid or not found."])},real:{long_description:e=>{const{normalize:t}=e;return t(["The given credential was invalid or not found."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid credential"])}},short_description:e=>{const{normalize:t}=e;return t(["Invalid credential"])}},no_internet:{long_description:e=>{const{normalize:t}=e;return t(["There is no internet connection, check your connection and try again."])},real:{long_description:e=>{const{normalize:t}=e;return t(["There is no internet connection, check your connection and try again."])},short_description:e=>{const{normalize:t}=e;return t(["Connection error"])}},short_description:e=>{const{normalize:t}=e;return t(["Connection error"])}},site_not_found:{long_description:e=>{const{normalize:t}=e;return t(["The given entrypoint.site was invalid or not found."])},real:{long_description:e=>{const{normalize:t}=e;return t(["The given entrypoint.site was invalid or not found."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid entrypoint.site"])}},short_description:e=>{const{normalize:t}=e;return t(["Invalid entrypoint.site"])}},unauthorized:{long_description:e=>{const{normalize:t}=e;return t(["Your session has expired."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Your session has expired."])},short_description:e=>{const{normalize:t}=e;return t(["Unauthorized"])}},short_description:e=>{const{normalize:t}=e;return t(["Unauthorized"])}}},back_up_connection:{description:e=>{const{normalize:t}=e;return t(["Something went wrong when trying to connect to the institution, but you can upload your statement and we will extract the information."])},title:e=>{const{normalize:t}=e;return t(["An error occurred in the connection"])}},bridge:{114:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},116:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3e3:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3001:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3008:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3010:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3014:{long_description:e=>{const{normalize:t}=e;return t(["Se ha detectado más de una Llave Inteligente BBVA u ocurrió un error de comunicación."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3015:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3016:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3020:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3021:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3022:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3333:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3334:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3335:{long_description:e=>{const{normalize:t}=e;return t(["No se ha detectado una Llave Inteligente BBVA, verifique que esté conectada correctamente a su equipo."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3336:{long_description:e=>{const{normalize:t}=e;return t(["Error de comunicación durante el proceso de validación de su Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_config_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass configuration script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},host_update_available:{long_description:e=>{const{normalize:t}=e;return t(["Host application update available."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},not_ready:{long_description:e=>{const{normalize:t}=e;return t(["Bridge is not ready"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}}},common:{add_other:e=>{const{normalize:t}=e;return t(["Add another institution"])},back:e=>{const{normalize:t}=e;return t(["Back"])},cancel:e=>{const{normalize:t}=e;return t(["Cancel"])},continue:e=>{const{normalize:t}=e;return t(["Continue"])},close:e=>{const{normalize:t}=e;return t(["Close"])},data_error:e=>{const{normalize:t}=e;return t(["Sorry, an error occurred when loading the initial data"])},error:e=>{const{normalize:t}=e;return t(["Error"])},expand:e=>{const{normalize:t}=e;return t(["Expand"])},find_your_institution:e=>{const{normalize:t}=e;return t(["Find Your Institution"])},finish:e=>{const{normalize:t}=e;return t(["Finish"])},header:{login:e=>{const{normalize:t}=e;return t(["Login Information"])},link:e=>{const{normalize:t}=e;return t(["Link your Institution"])},select:e=>{const{normalize:t}=e;return t(["Select the institution"])}},hide:e=>{const{normalize:t}=e;return t(["Hide"])},intro:e=>{const{normalize:t}=e;return t(["Connect accounts from different institutions and extract data automatically"])},less:e=>{const{normalize:t}=e;return t(["less"])},long_description:e=>{const{normalize:t}=e;return t(["Connect accounts from different institutions and extract data automatically"])},more:e=>{const{normalize:t}=e;return t(["more"])},next:e=>{const{normalize:t}=e;return t(["Next"])},no_filtered_data:e=>{const{normalize:t}=e;return t(["There are no institutions available with the search criteria."])},process_running:e=>{const{normalize:t}=e;return t(["There is an institution being connected at this moment. Please, wait for this connection to finish."])},refresh:e=>{const{normalize:t}=e;return t(["Refresh"])},retry:e=>{const{normalize:t}=e;return t(["Try Again"])},search:e=>{const{normalize:t}=e;return t(["Search..."])},security_banner_content:e=>{const{normalize:t}=e;return t(["Your information is transferred encrypted end-to-end with the same standard Banks and Financial Institutions utilize."])},security_banner_title:e=>{const{normalize:t}=e;return t(["Secure and Private"])},session_error:e=>{const{normalize:t}=e;return t(["Something went wrong."])},session_refreshed_message:e=>{const{normalize:t}=e;return t(["Your session has been updated."])},session_refreshed:e=>{const{normalize:t}=e;return t(["Session refreshed"])},show:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Show ",n(a("msg"))])},show_password:e=>{const{normalize:t}=e;return t(["Show"])},test_mode:e=>{const{normalize:t}=e;return t(["You are currently running in Test Mode"])},unauthorized_message:e=>{const{normalize:t}=e;return t(["Your session expired, do you want refresh your session?"])},unauthorized:e=>{const{normalize:t}=e;return t(["Unauthorized"])},update_title:e=>{const{normalize:t}=e;return t(["Update Institution"])},webapp_add_banks:e=>{const{normalize:t}=e;return t(["Banks"])},webapp_add_blockchain:e=>{const{normalize:t}=e;return t(["Blockchain"])},webapp_add_government:e=>{const{normalize:t}=e;return t(["Government"])},webapp_add_utilities:e=>{const{normalize:t}=e;return t(["Utilities"])},webapp_add_wallet:e=>{const{normalize:t}=e;return t(["Digital Wallets"])}},credential:{api_error:{message:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},title:e=>{const{normalize:t}=e;return t(["Error"])}},found:{message:e=>{const{normalize:t}=e;return t(["Waiting to establish connection."])},title:e=>{const{normalize:t}=e;return t(["Credential found"])}},header_title:{sync:e=>{const{normalize:t}=e;return t(["Syncing credential"])},update:e=>{const{normalize:t}=e;return t(["Updating credential"])}},loading:{message:e=>{const{normalize:t}=e;return t(["Please wait a moment while we connect to the institution."])},title:e=>{const{normalize:t}=e;return t(["Connecting to institution"])}},search:{message:e=>{const{normalize:t}=e;return t(["Please wait a moment while we verify your information."])},title:e=>{const{normalize:t}=e;return t(["Validating credentials"])}}},download_options:{date_range_end:e=>{const{normalize:t}=e;return t(["End date"])},date_range_start:e=>{const{normalize:t}=e;return t(["Start date"])},label:e=>{const{normalize:t}=e;return t(["Download date range"])},switch:e=>{const{normalize:t}=e;return t(["Define download date range"])}},file:{click:e=>{const{normalize:t}=e;return t(["Clic to upload"])},invalid:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["The file extension must be ",n(a("extension")),"."])},invalid_multiple:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["The file extension must be one of these: ",n(a("extensions")),"."])},no_chosen:e=>{const{normalize:t}=e;return t(["No file chosen."])},remove:e=>{const{normalize:t}=e;return t(["Remove file."])},required:e=>{const{normalize:t}=e;return t(["is required."])}},form_errors:{regex:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Introduced value is not of type ",n(a("label")),"."])},required:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("label"))," is required."])}},privacy:{link:e=>{const{normalize:t}=e;return t(["Syncfy's Privacy Policy"])},list:{first:e=>{const{normalize:t}=e;return t(["Your data belongs to you!"])},second:e=>{const{normalize:t}=e;return t(["Connect easy and safely to your accounts."])},third:e=>{const{normalize:t}=e;return t(["Trusted by more than +100K users."])}},message:e=>{const{normalize:t}=e;return t(["By selecting ”Continue” you agree to"])},title:e=>{const{normalize:t}=e;return t(["You are using Syncfy for bank connectivity."])},title_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("client"))," partners with Syncfy for bank connectivity."])},url:e=>{const{normalize:t}=e;return t(["https://help.paybook.com/en/article/privacy-and-security-policy-k33bgf/"])}},santander_ws:{error:{long_description:e=>{const{normalize:t}=e;return t(["There was an error generating the token."])},short_description:e=>{const{normalize:t}=e;return t(["Token error"])}},script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Script not loaded."])},short_description:e=>{const{normalize:t}=e;return t(["Token error"])}}},site:{login:{authenticating:e=>{const{normalize:t}=e;return t(["Authenticating"])},error:e=>{const{normalize:t}=e;return t(["Authentication Error"])},success:e=>{const{normalize:t}=e;return t(["Successful Authentication"])}}},socket:{error:{long_description:e=>{const{normalize:t}=e;return t(["Socket connection ended, check your connection and try again."])},short_description:e=>{const{normalize:t}=e;return t(["Socket error"])}},message:{100:{long_description:e=>{const{normalize:t}=e;return t(["Establishing connection with the institution..."])},short_description:e=>{const{normalize:t}=e;return t(["Establishing Connection"])}},101:{long_description:e=>{const{normalize:t}=e;return t(["Connection established with the institution, credentials are being validated..."])},short_description:e=>{const{normalize:t}=e;return t(["Validating Credentials"])}},102:{long_description:e=>{const{normalize:t}=e;return t(["Successfully logged into the institution"])},short_description:e=>{const{normalize:t}=e;return t(["Login Successful"])}},103:{long_description:e=>{const{normalize:t}=e;return t(["The token has been sent and is being validated..."])},short_description:e=>{const{normalize:t}=e;return t(["Validating Token"])}},200:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. Data has been extracted"])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},201:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. We have partially extracted information, but data will still be extracted in background processes."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},202:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, no transactions were found."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},203:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, more than one account does not have transactions."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},204:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, the data downloaded is incomplete."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},206:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, there were no accounts linked to the given credentials."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},400:{long_description:e=>{const{normalize:t}=e;return t(["The value of one of the parameters is incorrect."])},short_description:e=>{const{normalize:t}=e;return t(["Bad request"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["The value of one of the given Authentication Fields was not accepted by the institution. Please verify the information and try again."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid Credentials"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["The given token value introduced was not accepted by the institution or the expiration time was reached."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid Token"])}},405:{long_description:e=>{const{normalize:t}=e;return t(["The institution has blocked the given credential, please contact your institution and make sure your connection to the site is working properly before trying again."])},short_description:e=>{const{normalize:t}=e;return t(["Credential Locked"])}},406:{long_description:e=>{const{normalize:t}=e;return t(["The institution does not allow to have more than one user logged in. If you have logged into your institution using another device, please make sure to log out before trying again."])},short_description:e=>{const{normalize:t}=e;return t(["Already Logged In"])}},408:{long_description:e=>{const{normalize:t}=e;return t(["The institution requires attention from the user. We advise you to log into the institution to confirm everything is working properly. Upon confirmation, try again."])},short_description:e=>{const{normalize:t}=e;return t(["Attention Required"])}},409:{long_description:e=>{const{normalize:t}=e;return t(["The given credentials seem to be valid, but they belong to a different site from the same organization."])},short_description:e=>{const{normalize:t}=e;return t(["Incorrect Site"])}},410:{long_description:e=>{const{normalize:t}=e;return t(["Waiting for token..."])},short_description:e=>{const{normalize:t}=e;return t(["Authenticating"])}},411:{long_description:e=>{const{normalize:t}=e;return t(["The time to introduce the token value has been exceeded."])},short_description:e=>{const{normalize:t}=e;return t(["Token Not Received"])}},413:{long_description:e=>{const{normalize:t}=e;return t(["There was a problem in the connection. Please wait 15 minutes and try again. If the problem persists contact Technical Support."])},short_description:e=>{const{normalize:t}=e;return t(["Connection Error"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Error"])}},501:{long_description:e=>{const{normalize:t}=e;return t(["The institution has informed to us that there was a problem in the connection. Please wait 15 minutes and try again. If the problem persists contact Technical Support."])},short_description:e=>{const{normalize:t}=e;return t(["Connection Error"])}},504:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Error"])}},507:{long_description:e=>{const{normalize:t}=e;return t(["The institution has informed to us that there was a problem in the connection. Please wait 15 minutes and try again. If the problem persists contact Technical Support."])},short_description:e=>{const{normalize:t}=e;return t(["Connection Error"])}},509:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, the institution is in maintenance."])},short_description:e=>{const{normalize:t}=e;return t(["Site in Maintenance"])}}},quick_answer:{long_description:e=>{const{normalize:t}=e;return t(["Successfully logged into the institution. The data will be extracted by background processes."])},short_description:e=>{const{normalize:t}=e;return t(["Login Successful"])}},timeout:{long_description:e=>{const{normalize:t}=e;return t(["Server is taking too long to respond."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Error"])}}},twofa:{waiting:e=>{const{normalize:t}=e;return t(["Waiting for token"])}}},resource={accounts_selection:{done:e=>{const{normalize:t}=e;return t(["Terminar"])},error:e=>{const{normalize:t}=e;return t(["Pasó un error al obtener las cuentas."])},fetching:e=>{const{normalize:t}=e;return t(["Obteniendo cuentas"])},form_error:e=>{const{normalize:t}=e;return t(["Por favor selecciona al menos una cuenta."])},form_label:e=>{const{normalize:t}=e;return t(["Syncfy sólo compartirá los datos que selecciones."])},form_label_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Syncfy sólo compartirá los datos que selecciones con ",n(a("client")),"."])},title:e=>{const{normalize:t}=e;return t(["Seleccionar cuentas"])}},api_errors:{400:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Algunos parámetros de la petición son incorrectos."])},short_description:e=>{const{normalize:t}=e;return t(["Petición incorrecta"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["La autenticación falló."])},short_description:e=>{const{normalize:t}=e;return t(["No autorizado"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},402:{long_description:e=>{const{normalize:t}=e;return t(["Algo salió mal al intentar acceder a este servicio. Comunícate con el equipo de soporte para obtener más información."])},real:{long_description:e=>{const{normalize:t}=e;return t(["El API se deshabilitó por falta de pago."])},short_description:e=>{const{normalize:t}=e;return t(["Pago requerido"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Prohibido."])},short_description:e=>{const{normalize:t}=e;return t(["Prohibido"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},404:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["No encontrado."])},short_description:e=>{const{normalize:t}=e;return t(["No encontrado"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},429:{long_description:e=>{const{normalize:t}=e;return t(["Se han realizado muchas peticiones en un periodo corto de tiempo. Por favor intentar nuevamente más tarde."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Se han realizado muchas peticiones en un periodo corto de tiempo. Por favor intentar nuevamente más tarde."])},short_description:e=>{const{normalize:t}=e;return t(["Límite de peticiones excedido"])}},short_description:e=>{const{normalize:t}=e;return t(["Límite de peticiones excedido"])}},449:{long_description:e=>{const{normalize:t}=e;return t(["El parámetro entrypoint.credential proporcionado ya no es válido, ya que el sitio al que pertenece ha sido dado de baja o se encuentra obsoleto."])},real:{long_description:e=>{const{normalize:t}=e;return t(["El parámetro entrypoint.credential proporcionado ya no es válido, ya que el sitio al que pertenece ha sido dado de baja o se encuentra obsoleto."])},short_description:e=>{const{normalize:t}=e;return t(["Credencial inválida"])}},short_description:e=>{const{normalize:t}=e;return t(["Credencial inválida"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, un error interno ha ocurrido. Por favor intenta nuevamente más tarde."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Error interno del servidor."])},short_description:e=>{const{normalize:t}=e;return t(["Error interno del servidor"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},503:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, un error interno ha ocurrido. Por favor intenta nuevamente más tarde."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Servicio no disponible."])},short_description:e=>{const{normalize:t}=e;return t(["Servicio no disponible"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},credential_error:{long_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales, por favor considera actualizar la contraseña de las credenciales."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales, por favor considera actualizar la contraseña de las credenciales."])},short_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales"])}},short_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales"])}},credential_not_found:{long_description:e=>{const{normalize:t}=e;return t(["La credencial proporcionada es inválida o no se encontró."])},real:{long_description:e=>{const{normalize:t}=e;return t(["La credencial proporcionada es inválida o no se encontró."])},short_description:e=>{const{normalize:t}=e;return t(["Credencial inválida"])}},short_description:e=>{const{normalize:t}=e;return t(["Credencial inválida"])}},no_internet:{long_description:e=>{const{normalize:t}=e;return t(["No hay conexión a internet, revisa tu conexión e intenta nuevamente."])},real:{long_description:e=>{const{normalize:t}=e;return t(["No hay conexión a internet, revisa tu conexión e intenta nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Error de conexión"])}},short_description:e=>{const{normalize:t}=e;return t(["Error de conexión"])}},site_not_found:{long_description:e=>{const{normalize:t}=e;return t(["El parámetro entrypoint.site proporcionado es inválido o no se encontró."])},real:{long_description:e=>{const{normalize:t}=e;return t(["El parámetro entrypoint.site proporcionado es inválido o no se encontró."])},short_description:e=>{const{normalize:t}=e;return t(["entrypoint.site inválido"])}},short_description:e=>{const{normalize:t}=e;return t(["entrypoint.site inválido"])}},unauthorized:{long_description:e=>{const{normalize:t}=e;return t(["Tu sesión ha expirado."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Tu sesión ha expirado."])},short_description:e=>{const{normalize:t}=e;return t(["No autorizado"])}},short_description:e=>{const{normalize:t}=e;return t(["No autorizado"])}}},back_up_connection:{description:e=>{const{normalize:t}=e;return t(["Algo salió mal al intentar realizar la conexión, pero puedes subir tu estado de cuenta y extraeremos la información."])},title:e=>{const{normalize:t}=e;return t(["Se produjo un error en la conexión"])}},bridge:{114:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},116:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3e3:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3001:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3008:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3010:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3014:{long_description:e=>{const{normalize:t}=e;return t(["Se ha detectado más de una Llave Inteligente BBVA u ocurrió un error de comunicación."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3015:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3016:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3020:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3021:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3022:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3333:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3334:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3335:{long_description:e=>{const{normalize:t}=e;return t(["No se ha detectado una Llave Inteligente BBVA, verifique que esté conectada correctamente a su equipo."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3336:{long_description:e=>{const{normalize:t}=e;return t(["Error de comunicación durante el proceso de validación de su Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_config_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass configuration script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},host_update_available:{long_description:e=>{const{normalize:t}=e;return t(["Host application update available."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},not_ready:{long_description:e=>{const{normalize:t}=e;return t(["Bridge is not ready"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}}},common:{add_other:e=>{const{normalize:t}=e;return t(["Agregar Otra Institución"])},back:e=>{const{normalize:t}=e;return t(["Atrás"])},cancel:e=>{const{normalize:t}=e;return t(["Cancelar"])},close:e=>{const{normalize:t}=e;return t(["Cerrar"])},continue:e=>{const{normalize:t}=e;return t(["Continuar"])},data_error:e=>{const{normalize:t}=e;return t(["Lo sentimos, ocurrió un error al cargar la información inicial"])},error:e=>{const{normalize:t}=e;return t(["Error"])},expand:e=>{const{normalize:t}=e;return t(["Expandir"])},find_your_institution:e=>{const{normalize:t}=e;return t(["Encuentra tu institución"])},finish:e=>{const{normalize:t}=e;return t(["Finalizar"])},header:{login:e=>{const{normalize:t}=e;return t(["Información de inicio de sesión"])},link:e=>{const{normalize:t}=e;return t(["Conecta tu institución"])},select:e=>{const{normalize:t}=e;return t(["Seleccione la institución"])}},hide:e=>{const{normalize:t}=e;return t(["Ocultar"])},intro:e=>{const{normalize:t}=e;return t(["Conecta cuentas de diferentes instituciones y extrae datos automáticamente"])},less:e=>{const{normalize:t}=e;return t(["menos"])},long_description:e=>{const{normalize:t}=e;return t(["Conecta cuentas de diferentes instituciones y extrae datos automáticamente"])},more:e=>{const{normalize:t}=e;return t(["más"])},next:e=>{const{normalize:t}=e;return t(["Siguiente"])},no_filtered_data:e=>{const{normalize:t}=e;return t(["No hay instituciones disponibles con el criterio de búsqueda."])},process_running:e=>{const{normalize:t}=e;return t(["Actualmente existe una institución procesándose en este momento. Por favor, espera a que este proceso termine."])},refresh:e=>{const{normalize:t}=e;return t(["Renovar"])},retry:e=>{const{normalize:t}=e;return t(["Intentar Nuevamente"])},search:e=>{const{normalize:t}=e;return t(["Buscar..."])},security_banner_content:e=>{const{normalize:t}=e;return t(["Tu información se transfiere cifrada de extremo a extremo con el mismo estándar que utilizan los bancos e instituciones financieras."])},security_banner_title:e=>{const{normalize:t}=e;return t(["Seguro y privado"])},session_error:e=>{const{normalize:t}=e;return t(["Algo salió mal al actualizar la sesión."])},session_refreshed_message:e=>{const{normalize:t}=e;return t(["Tu sesión ha sido actualizada."])},session_refreshed:e=>{const{normalize:t}=e;return t(["Sesión renovada"])},show:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Mostrar ",n(a("msg"))])},show_password:e=>{const{normalize:t}=e;return t(["Mostrar"])},test_mode:e=>{const{normalize:t}=e;return t(["Actualmente estás operando en Modo de Prueba"])},unauthorized_message:e=>{const{normalize:t}=e;return t(["Tu sesión ha expirado, ¿Quieres renovar tu sesión?"])},unauthorized:e=>{const{normalize:t}=e;return t(["Sin autorización"])},update_title:e=>{const{normalize:t}=e;return t(["Actualizar Institución"])},webapp_add_banks:e=>{const{normalize:t}=e;return t(["Bancos"])},webapp_add_blockchain:e=>{const{normalize:t}=e;return t(["Blockchain"])},webapp_add_government:e=>{const{normalize:t}=e;return t(["Gobierno"])},webapp_add_utilities:e=>{const{normalize:t}=e;return t(["Servicios"])},webapp_add_wallet:e=>{const{normalize:t}=e;return t(["Carteras Digitales"])}},credential:{api_error:{message:e=>{const{normalize:t}=e;return t(["Lo sentimos, un error interno ha ocurrido. Por favor intenta nuevamente más tarde."])},title:e=>{const{normalize:t}=e;return t(["Error"])}},found:{message:e=>{const{normalize:t}=e;return t(["Espere un momento mientras conectamos con la institución."])},title:e=>{const{normalize:t}=e;return t(["Credenciales encontradas"])}},header_title:{sync:e=>{const{normalize:t}=e;return t(["Sincronizando credencial"])},update:e=>{const{normalize:t}=e;return t(["Actualizando credencial"])}},loading:{message:e=>{const{normalize:t}=e;return t(["Espere un momento mientras conectamos con la institución."])},title:e=>{const{normalize:t}=e;return t(["Conectando con la institución"])}},search:{message:e=>{const{normalize:t}=e;return t(["Por favor espera un momento mientras validamos tus credenciales."])},title:e=>{const{normalize:t}=e;return t(["Validando credenciales"])}}},download_options:{date_range_end:e=>{const{normalize:t}=e;return t(["Fecha final"])},date_range_start:e=>{const{normalize:t}=e;return t(["Fecha de inicio"])},label:e=>{const{normalize:t}=e;return t(["Periodo de descarga"])},switch:e=>{const{normalize:t}=e;return t(["Definir periodo de descarga"])}},file:{click:e=>{const{normalize:t}=e;return t(["Clic para subir"])},invalid:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["La extensión del archivo debe ser ",n(a("extension")),"."])},invalid_multiple:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["La extensión del archivo debe ser alguna de estas: ",n(a("extensions")),"."])},no_chosen:e=>{const{normalize:t}=e;return t(["Ningún archivo seleccionado."])},remove:e=>{const{normalize:t}=e;return t(["Quitar archivo."])},required:e=>{const{normalize:t}=e;return t(["es requerido."])}},form_errors:{regex:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["El valor ingresado no es de tipo ",n(a("label")),"."])},required:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("label"))," es requerido."])}},privacy:{link:e=>{const{normalize:t}=e;return t(["Política de privacidad de Syncfy"])},list:{first:e=>{const{normalize:t}=e;return t(["¡Tus datos te pertenecen!"])},second:e=>{const{normalize:t}=e;return t(["Conecta tus cuentas de forma fácil y segura."])},third:e=>{const{normalize:t}=e;return t(["Más de 100k usuarios confían en nosotros."])}},message:e=>{const{normalize:t}=e;return t(["Al seleccionar ”Continuar”, aceptas la"])},title:e=>{const{normalize:t}=e;return t(["Estás usando Syncfy para conectar tus cuentas."])},title_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("client"))," se une a Syncfy para conectar tus cuentas."])},url:e=>{const{normalize:t}=e;return t(["https://help.paybook.com/es/article/politica-de-privacidad-y-seguridad-4b9oho/"])}},santander_ws:{error:{long_description:e=>{const{normalize:t}=e;return t(["Hubo un error al generar el token."])},short_description:e=>{const{normalize:t}=e;return t(["Error del token"])}},script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["No se cargó el script."])},short_description:e=>{const{normalize:t}=e;return t(["Error del token"])}}},site:{login:{authenticating:e=>{const{normalize:t}=e;return t(["Autenticando"])},error:e=>{const{normalize:t}=e;return t(["Error de Autenticación"])},success:e=>{const{normalize:t}=e;return t(["Autenticación Exitosa"])}}},socket:{error:{long_description:e=>{const{normalize:t}=e;return t(["La conexión con el socket finalizó, revisa tu conexión e intenta nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Error del socket"])}},message:{100:{long_description:e=>{const{normalize:t}=e;return t(["Estableciendo conexión con la institución..."])},short_description:e=>{const{normalize:t}=e;return t(["Estableciendo Conexión"])}},101:{long_description:e=>{const{normalize:t}=e;return t(["Conexión establecida con la institución, las credenciales se encuentran en proceso de validación..."])},short_description:e=>{const{normalize:t}=e;return t(["Validando Credenciales"])}},102:{long_description:e=>{const{normalize:t}=e;return t(["Se ha iniciado sesión exitosamente en el sitio de la institución."])},short_description:e=>{const{normalize:t}=e;return t(["Sesión Iniciada Exitosamente"])}},103:{long_description:e=>{const{normalize:t}=e;return t(["El token ha sido enviado al sitio y se encuentra en proceso de validación..."])},short_description:e=>{const{normalize:t}=e;return t(["Validando Token"])}},200:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Se ha descargado la información."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},201:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Se ha descargado parte de la información, pero se continuará descargando información en segundo plano."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},202:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Sin embargo, no se encontraron transacciones."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},203:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Se ha detectado que una o más cuentas no tienen transacciones."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},204:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha concluido. Sin embargo, se ha detectado que la información obtenida está incompleta."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},206:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Sin embargo, no se encontraron cuentas vinculadas a las credenciales proporcionadas."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},400:{long_description:e=>{const{normalize:t}=e;return t(["El valor de alguno de los parámetros es incorrecto."])},short_description:e=>{const{normalize:t}=e;return t(["Solicitud incorrecta"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["El valor de alguno de los elementos de autenticación que proporcionaste no fue aceptado por la institución. Por favor verifica la información e intenta de nuevo."])},short_description:e=>{const{normalize:t}=e;return t(["Credenciales Inválidas"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["El valor del token introducido no aceptado por la institución o ha expirado el tiempo para utilizarlo."])},short_description:e=>{const{normalize:t}=e;return t(["Token Inválido"])}},405:{long_description:e=>{const{normalize:t}=e;return t(["La institución ha bloqueado las credenciales proporcionadas. Por favor contacta a tu institución y asegúrate que tu banca en línea está funcionando correctamente antes de intentarlo nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Credenciales Bloqueadas"])}},406:{long_description:e=>{const{normalize:t}=e;return t(["La institución no permite iniciar más de una sesión para las credenciales proporcionadas. Si has iniciado sesión en otro lado por favor asegúrate de haberla cerrado antes de intentarlo nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Sesión Abierta"])}},408:{long_description:e=>{const{normalize:t}=e;return t(["La institución solicita atención del usuario para las credenciales proporcionadas. Te recomendamos iniciar sesión en el portal de la institución para confirmar que todo está en orden, posterior a eso favor de intentar nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Atención Requerida"])}},409:{long_description:e=>{const{normalize:t}=e;return t(["Las credenciales parecen ser válidas sin embargo corresponden a un sitio diferente de la misma organización."])},short_description:e=>{const{normalize:t}=e;return t(["Sitio Incorrecto"])}},410:{long_description:e=>{const{normalize:t}=e;return t(["Esperando token..."])},short_description:e=>{const{normalize:t}=e;return t(["Autenticando"])}},411:{long_description:e=>{const{normalize:t}=e;return t(["Se excedió el tiempo de espera para introducir el valor del token."])},short_description:e=>{const{normalize:t}=e;return t(["Token no recibido"])}},413:{long_description:e=>{const{normalize:t}=e;return t(["Hubo un problema durante el proceso de conexión. Por favor esperar 15 minutos e intentar nuevamente. Si persiste el problema contacte a Soporte Técnico."])},short_description:e=>{const{normalize:t}=e;return t(["Error de Conexión"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, ha ocurrido un error interno al procesar tu institución."])},short_description:e=>{const{normalize:t}=e;return t(["Error Interno"])}},501:{long_description:e=>{const{normalize:t}=e;return t(["La institución nos ha informado que tuvo un problema durante el proceso de conexión. Por favor esperar 15 minutos e intentar nuevamente. Si persiste el problema contacte a Soporte Técnico."])},short_description:e=>{const{normalize:t}=e;return t(["Error de Conexión"])}},504:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, ha ocurrido un error interno al procesar tu institución."])},short_description:e=>{const{normalize:t}=e;return t(["Error Interno"])}},507:{long_description:e=>{const{normalize:t}=e;return t(["La institución nos ha informado que tuvo un problema durante el proceso de conexión. Por favor esperar 15 minutos e intentar nuevamente. Si persiste el problema contacte a Soporte Técnico."])},short_description:e=>{const{normalize:t}=e;return t(["Error de Conexión"])}},509:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra en mantenimiento."])},short_description:e=>{const{normalize:t}=e;return t(["Sitio en Mantenimiento"])}}},quick_answer:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. La información se continuará descargando información en segundo plano."])},short_description:e=>{const{normalize:t}=e;return t(["Sesión Iniciada Exitosamente."])}},timeout:{long_description:e=>{const{normalize:t}=e;return t(["El servidor ha tardado en responder."])},short_description:e=>{const{normalize:t}=e;return t(["Error Interno"])}}},twofa:{waiting:e=>{const{normalize:t}=e;return t(["Esperando token"])}}};function isElement$1(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e!==null&&e.nodeType===1&&typeof e.nodeName=="string"}const global$1=globalThis||void 0||self;function getDefaultExportFromCjs$1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var browser$d={exports:{}},process=browser$d.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch{try{return cachedSetTimeout.call(null,e,0)}catch{return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch{try{return cachedClearTimeout.call(null,e)}catch{return cachedClearTimeout.call(this,e)}}}var queue$1=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue$1=currentQueue.concat(queue$1):queueIndex=-1,queue$1.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue$1.length;t;){for(currentQueue=queue$1,queue$1=[];++queueIndex<t;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,t=queue$1.length}currentQueue=null,draining=!1,runClearTimeout(e)}}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];queue$1.push(new Item(e,t)),queue$1.length===1&&!draining&&runTimeout(drainQueue)};function Item(e,t){this.fun=e,this.array=t}Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={};function noop$2(){}process.on=noop$2,process.addListener=noop$2,process.once=noop$2,process.off=noop$2,process.removeListener=noop$2,process.removeAllListeners=noop$2,process.emit=noop$2,process.prependListener=noop$2,process.prependOnceListener=noop$2,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var browserExports=browser$d.exports;const process$1=getDefaultExportFromCjs$1(browserExports),getDefaultsFromPostinstall=()=>{};/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  *
@@ -676,7 +676,7 @@
676
676
  */registerVersion(name,version$3,"app");function initFirebase(){const t=initializeApp({apiKey:"AIzaSyC9JxQ4ULW2nC-tBNwsZ52OTQnS9mIeeS8",authDomain:"syncfy-widget.firebaseapp.com",projectId:"syncfy-widget",storageBucket:"syncfy-widget.appspot.com",messagingSenderId:"406921126981",appId:"1:406921126981:web:788d7d85203868101aaf2c",measurementId:"G-FYDLPN68N8"});getAnalytics(t),measureEvent("load")}function measureEvent(e,t){const n=getAnalytics();logEvent(n,e,{environment:void 0,eventAction:e,...t||{}})}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var propertyExpr,hasRequiredPropertyExpr;function requirePropertyExpr(){if(hasRequiredPropertyExpr)return propertyExpr;hasRequiredPropertyExpr=1;function e(pe){this._maxSize=pe,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(pe){return this._values[pe]},e.prototype.set=function(pe,Ce){return this._size>=this._maxSize&&this.clear(),pe in this._values||this._size++,this._values[pe]=Ce};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,a=/^\d/,s=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,o=/^\s*(['"]?)(.*?)(\1)\s*$/,c=512,f=new e(c),y=new e(c),m=new e(c);propertyExpr={Cache:e,split:z,normalizePath:g,setter:function(pe){var Ce=g(pe);return y.get(pe)||y.set(pe,function(qe,At){for(var Et=0,ze=Ce.length,kt=qe;Et<ze-1;){var Pt=Ce[Et];if(Pt==="__proto__"||Pt==="constructor"||Pt==="prototype")return qe;kt=kt[Ce[Et++]]}kt[Ce[Et]]=At})},getter:function(pe,Ce){var Oe=g(pe);return m.get(pe)||m.set(pe,function(At){for(var Et=0,ze=Oe.length;Et<ze;)if(At!=null||!Ce)At=At[Oe[Et++]];else return;return At})},join:function(pe){return pe.reduce(function(Ce,Oe){return Ce+(re(Oe)||n.test(Oe)?"["+Oe+"]":(Ce?".":"")+Oe)},"")},forEach:function(pe,Ce,Oe){ie(Array.isArray(pe)?pe:z(pe),Ce,Oe)}};function g(pe){return f.get(pe)||f.set(pe,z(pe).map(function(Ce){return Ce.replace(o,"$2")}))}function z(pe){return pe.match(t)||[""]}function ie(pe,Ce,Oe){var qe=pe.length,At,Et,ze,kt;for(Et=0;Et<qe;Et++)At=pe[Et],At&&($e(At)&&(At='"'+At+'"'),kt=re(At),ze=!kt&&/^\d+$/.test(At),Ce.call(Oe,At,kt,ze,Et,pe))}function re(pe){return typeof pe=="string"&&pe&&["'",'"'].indexOf(pe.charAt(0))!==-1}function he(pe){return pe.match(a)&&!pe.match(n)}function _e(pe){return s.test(pe)}function $e(pe){return!re(pe)&&(he(pe)||_e(pe))}return propertyExpr}var propertyExprExports=requirePropertyExpr(),tinyCase,hasRequiredTinyCase;function requireTinyCase(){if(hasRequiredTinyCase)return tinyCase;hasRequiredTinyCase=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \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]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \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\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \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]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \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\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \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\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=g=>g.match(e)||[],n=g=>g[0].toUpperCase()+g.slice(1),a=(g,z)=>t(g).join(z).toLowerCase(),s=g=>t(g).reduce((z,ie)=>`${z}${z?ie[0].toUpperCase()+ie.slice(1).toLowerCase():ie.toLowerCase()}`,"");return tinyCase={words:t,upperFirst:n,camelCase:s,pascalCase:g=>n(s(g)),snakeCase:g=>a(g,"_"),kebabCase:g=>a(g,"-"),sentenceCase:g=>n(a(g," ")),titleCase:g=>t(g).map(n).join(" ")},tinyCase}var tinyCaseExports=requireTinyCase(),toposort$1={exports:{}},hasRequiredToposort;function requireToposort(){if(hasRequiredToposort)return toposort$1.exports;hasRequiredToposort=1,toposort$1.exports=function(s){return e(t(s),s)},toposort$1.exports.array=e;function e(s,o){var c=s.length,f=new Array(c),y={},m=c,g=n(o),z=a(s);for(o.forEach(function(re){if(!z.has(re[0])||!z.has(re[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});m--;)y[m]||ie(s[m],m,new Set);return f;function ie(re,he,_e){if(_e.has(re)){var $e;try{$e=", node was:"+JSON.stringify(re)}catch{$e=""}throw new Error("Cyclic dependency"+$e)}if(!z.has(re))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(re));if(!y[he]){y[he]=!0;var pe=g.get(re)||new Set;if(pe=Array.from(pe),he=pe.length){_e.add(re);do{var Ce=pe[--he];ie(Ce,z.get(Ce),_e)}while(he);_e.delete(re)}f[--c]=re}}}function t(s){for(var o=new Set,c=0,f=s.length;c<f;c++){var y=s[c];o.add(y[0]),o.add(y[1])}return Array.from(o)}function n(s){for(var o=new Map,c=0,f=s.length;c<f;c++){var y=s[c];o.has(y[0])||o.set(y[0],new Set),o.has(y[1])||o.set(y[1],new Set),o.get(y[0]).add(y[1])}return o}function a(s){for(var o=new Map,c=0,f=s.length;c<f;c++)o.set(s[c],c);return o}return toposort$1.exports}var toposortExports=requireToposort();const toposort=getDefaultExportFromCjs(toposortExports),toString$2=Object.prototype.toString,errorToString=Error.prototype.toString,regExpToString=RegExp.prototype.toString,symbolToString$1=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",SYMBOL_REGEXP=/^Symbol\((.*)\)(.*)$/;function printNumber(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function printSimpleValue(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return printNumber(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return symbolToString$1.call(e).replace(SYMBOL_REGEXP,"Symbol($1)");const a=toString$2.call(e).slice(8,-1);return a==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):a==="Error"||e instanceof Error?"["+errorToString.call(e)+"]":a==="RegExp"?regExpToString.call(e):null}function printValue(e,t){let n=printSimpleValue(e,t);return n!==null?n:JSON.stringify(e,function(a,s){let o=printSimpleValue(this[a],t);return o!==null?o:s},2)}function toArray$1(e){return e==null?[]:[].concat(e)}let _Symbol$toStringTag,_Symbol$hasInstance,_Symbol$toStringTag2,strReg=/\$\{\s*(\w+)\s*\}/g;_Symbol$toStringTag=Symbol.toStringTag;class ValidationErrorNoStack{constructor(t,n,a,s){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[_Symbol$toStringTag]="Error",this.name="ValidationError",this.value=n,this.path=a,this.type=s,this.errors=[],this.inner=[],toArray$1(t).forEach(o=>{if(ValidationError.isError(o)){this.errors.push(...o.errors);const c=o.inner.length?o.inner:[o];this.inner.push(...c)}else this.errors.push(o)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}_Symbol$hasInstance=Symbol.hasInstance,_Symbol$toStringTag2=Symbol.toStringTag;class ValidationError extends Error{static formatError(t,n){const a=n.label||n.path||"this";return n=Object.assign({},n,{path:a,originalPath:n.path}),typeof t=="string"?t.replace(strReg,(s,o)=>printValue(n[o])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,a,s,o){const c=new ValidationErrorNoStack(t,n,a,s);if(o)return c;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[_Symbol$toStringTag2]="Error",this.name=c.name,this.message=c.message,this.type=c.type,this.value=c.value,this.path=c.path,this.errors=c.errors,this.inner=c.inner,Error.captureStackTrace&&Error.captureStackTrace(this,ValidationError)}static[_Symbol$hasInstance](t){return ValidationErrorNoStack[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let mixed={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:a})=>{const s=a!=null&&a!==n?` (cast from the value \`${printValue(a,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${printValue(n,!0)}\``+s:`${e} must match the configured type. The validated value was: \`${printValue(n,!0)}\``+s}},string$1={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},number$2={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date$1={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},boolean={isValue:"${path} field must be ${value}"},object$1={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},array$1={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},tuple={notType:e=>{const{path:t,value:n,spec:a}=e,s=a.types.length;if(Array.isArray(n)){if(n.length<s)return`${t} tuple value has too few items, expected a length of ${s} but got ${n.length} for value: \`${printValue(n,!0)}\``;if(n.length>s)return`${t} tuple value has too many items, expected a length of ${s} but got ${n.length} for value: \`${printValue(n,!0)}\``}return ValidationError.formatError(mixed.notType,e)}};Object.assign(Object.create(null),{mixed,string:string$1,number:number$2,date:date$1,object:object$1,array:array$1,boolean,tuple});const isSchema=e=>e&&e.__isYupSchema__;class Condition{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:a,then:s,otherwise:o}=n,c=typeof a=="function"?a:(...f)=>f.every(y=>y===a);return new Condition(t,(f,y)=>{var m;let g=c(...f)?s:o;return(m=g==null?void 0:g(y))!=null?m:y})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let a=this.refs.map(o=>o.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),s=this.fn(a,t,n);if(s===void 0||s===t)return t;if(!isSchema(s))throw new TypeError("conditions must return a schema object");return s.resolve(n)}}const prefixes$1={context:"$",value:"."};class Reference{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===prefixes$1.context,this.isValue=this.key[0]===prefixes$1.value,this.isSibling=!this.isContext&&!this.isValue;let a=this.isContext?prefixes$1.context:this.isValue?prefixes$1.value:"";this.path=this.key.slice(a.length),this.getter=this.path&&propertyExprExports.getter(this.path,!0),this.map=n.map}getValue(t,n,a){let s=this.isContext?a:this.isValue?t:n;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Reference.prototype.__isYupRef=!0;const isAbsent=e=>e==null;function createValidation(e){function t({value:n,path:a="",options:s,originalValue:o,schema:c},f,y){const{name:m,test:g,params:z,message:ie,skipAbsent:re}=e;let{parent:he,context:_e,abortEarly:$e=c.spec.abortEarly,disableStackTrace:pe=c.spec.disableStackTrace}=s;const Ce={value:n,parent:he,context:_e};function Oe(Ie={}){const u=resolveParams(Object.assign({value:n,originalValue:o,label:c.spec.label,path:Ie.path||a,spec:c.spec,disableStackTrace:Ie.disableStackTrace||pe},z,Ie.params),Ce),v=new ValidationError(ValidationError.formatError(Ie.message||ie,u),n,u.path,Ie.type||m,u.disableStackTrace);return v.params=u,v}const qe=$e?f:y;let At={path:a,parent:he,type:m,from:s.from,createError:Oe,resolve(Ie){return resolveMaybeRef(Ie,Ce)},options:s,originalValue:o,schema:c};const Et=Ie=>{ValidationError.isError(Ie)?qe(Ie):Ie?y(null):qe(Oe())},ze=Ie=>{ValidationError.isError(Ie)?qe(Ie):f(Ie)};if(re&&isAbsent(n))return Et(!0);let Pt;try{var jt;if(Pt=g.call(At,n,At),typeof((jt=Pt)==null?void 0:jt.then)=="function"){if(s.sync)throw new Error(`Validation test of type: "${At.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(Pt).then(Et,ze)}}catch(Ie){ze(Ie);return}Et(Pt)}return t.OPTIONS=e,t}function resolveParams(e,t){if(!e)return e;for(const n of Object.keys(e))e[n]=resolveMaybeRef(e[n],t);return e}function resolveMaybeRef(e,t){return Reference.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function getIn(e,t,n,a=n){let s,o,c;return t?(propertyExprExports.forEach(t,(f,y,m)=>{let g=y?f.slice(1,f.length-1):f;e=e.resolve({context:a,parent:s,value:n});let z=e.type==="tuple",ie=m?parseInt(g,10):0;if(e.innerType||z){if(z&&!m)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${c}" must contain an index to the tuple element, e.g. "${c}[0]"`);if(n&&ie>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${f}, in the path: ${t}. because there is no value at that index. `);s=n,n=n&&n[ie],e=z?e.spec.types[ie]:e.innerType}if(!m){if(!e.fields||!e.fields[g])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${c} which is a type: "${e.type}")`);s=n,n=n&&n[g],e=e.fields[g]}o=g,c=y?"["+f+"]":"."+f}),{schema:e,parent:s,parentPath:o}):{parent:s,parentPath:t,schema:e}}class ReferenceSet extends Set{describe(){const t=[];for(const n of this.values())t.push(Reference.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const a of this.values())n.push(t(a));return n}clone(){return new ReferenceSet(this.values())}merge(t,n){const a=this.clone();return t.forEach(s=>a.add(s)),n.forEach(s=>a.delete(s)),a}}function clone$1(e,t=new Map){if(isSchema(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let a=0;a<e.length;a++)n[a]=clone$1(e[a],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[a,s]of e.entries())n.set(a,clone$1(s,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const a of e)n.add(clone$1(a,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[a,s]of Object.entries(e))n[a]=clone$1(s,t)}else throw Error(`Unable to clone ${e}`);return n}function createStandardPath(e){if(!(e!=null&&e.length))return;const t=[];let n="",a=!1,s=!1;for(let o=0;o<e.length;o++){const c=e[o];if(c==="["&&!s){n&&(t.push(...n.split(".").filter(Boolean)),n=""),a=!0;continue}if(c==="]"&&!s){n&&(/^\d+$/.test(n)?t.push(n):t.push(n.replace(/^"|"$/g,"")),n=""),a=!1;continue}if(c==='"'){s=!s;continue}if(c==="."&&!a&&!s){n&&(t.push(n),n="");continue}n+=c}return n&&t.push(...n.split(".").filter(Boolean)),t}function createStandardIssues(e,t){const n=t?`${t}.${e.path}`:e.path;return e.errors.map(a=>({message:a,path:createStandardPath(n)}))}function issuesFromValidationError(e,t){var n;if(!((n=e.inner)!=null&&n.length)&&e.errors.length)return createStandardIssues(e,t);const a=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(s=>issuesFromValidationError(s,a))}let Schema$1=class{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ReferenceSet,this._blacklist=new ReferenceSet,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(mixed.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=clone$1(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let a=t(this);return this._mutate=n,a}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,a=t.clone();const s=Object.assign({},n.spec,a.spec);return a.spec=s,a.internalTests=Object.assign({},n.internalTests,a.internalTests),a._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),a._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),a.tests=n.tests,a.exclusiveTests=n.exclusiveTests,a.withMutation(o=>{t.tests.forEach(c=>{o.test(c.OPTIONS)})}),a.transforms=[...n.transforms,...a.transforms],a}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let a=n.conditions;n=n.clone(),n.conditions=[],n=a.reduce((s,o)=>o.resolve(s,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,a,s,o;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(a=t.abortEarly)!=null?a:this.spec.abortEarly,recursive:(s=t.recursive)!=null?s:this.spec.recursive,disableStackTrace:(o=t.disableStackTrace)!=null?o:this.spec.disableStackTrace})}cast(t,n={}){let a=this.resolve(Object.assign({value:t},n)),s=n.assert==="ignore-optionality",o=a._cast(t,n);if(n.assert!==!1&&!a.isType(o)){if(s&&isAbsent(o))return o;let c=printValue(t),f=printValue(o);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${a.type}".
677
677
 
678
678
  attempted value: ${c}
679
- `+(f!==c?`result of cast: ${f}`:""))}return o}_cast(t,n){let a=t===void 0?t:this.transforms.reduce((s,o)=>o.call(this,s,t,this),t);return a===void 0&&(a=this.getDefault(n)),a}_validate(t,n={},a,s){let{path:o,originalValue:c=t,strict:f=this.spec.strict}=n,y=t;f||(y=this._cast(y,Object.assign({assert:!1},n)));let m=[];for(let g of Object.values(this.internalTests))g&&m.push(g);this.runTests({path:o,value:y,originalValue:c,options:n,tests:m},a,g=>{if(g.length)return s(g,y);this.runTests({path:o,value:y,originalValue:c,options:n,tests:this.tests},a,s)})}runTests(t,n,a){let s=!1,{tests:o,value:c,originalValue:f,path:y,options:m}=t,g=_e=>{s||(s=!0,n(_e,c))},z=_e=>{s||(s=!0,a(_e,c))},ie=o.length,re=[];if(!ie)return z([]);let he={value:c,originalValue:f,path:y,options:m,schema:this};for(let _e=0;_e<o.length;_e++){const $e=o[_e];$e(he,g,function(Ce){Ce&&(Array.isArray(Ce)?re.push(...Ce):re.push(Ce)),--ie<=0&&z(re)})}}asNestedTest({key:t,index:n,parent:a,parentPath:s,originalParent:o,options:c}){const f=t??n;if(f==null)throw TypeError("Must include `key` or `index` for nested validations");const y=typeof f=="number";let m=a[f];const g=Object.assign({},c,{strict:!0,parent:a,value:m,originalValue:o[f],key:void 0,[y?"index":"key"]:f,path:y||f.includes(".")?`${s||""}[${y?f:`"${f}"`}]`:(s?`${s}.`:"")+t});return(z,ie,re)=>this.resolve(g)._validate(m,g,ie,re)}validate(t,n){var a;let s=this.resolve(Object.assign({},n,{value:t})),o=(a=n==null?void 0:n.disableStackTrace)!=null?a:s.spec.disableStackTrace;return new Promise((c,f)=>s._validate(t,n,(y,m)=>{ValidationError.isError(y)&&(y.value=m),f(y)},(y,m)=>{y.length?f(new ValidationError(y,m,void 0,void 0,o)):c(m)}))}validateSync(t,n){var a;let s=this.resolve(Object.assign({},n,{value:t})),o,c=(a=n==null?void 0:n.disableStackTrace)!=null?a:s.spec.disableStackTrace;return s._validate(t,Object.assign({},n,{sync:!0}),(f,y)=>{throw ValidationError.isError(f)&&(f.value=y),f},(f,y)=>{if(f.length)throw new ValidationError(f,t,void 0,void 0,c);o=y}),o}isValid(t,n){return this.validate(t,n).then(()=>!0,a=>{if(ValidationError.isError(a))return!1;throw a})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(a){if(ValidationError.isError(a))return!1;throw a}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):clone$1(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const a=this.clone({nullable:t});return a.internalTests.nullable=createValidation({message:n,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),a}optionality(t,n){const a=this.clone({optional:t});return a.internalTests.optionality=createValidation({message:n,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),a}optional(){return this.optionality(!0)}defined(t=mixed.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=mixed.notNull){return this.nullability(!1,t)}required(t=mixed.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=mixed.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let a=this.clone(),s=createValidation(n),o=n.exclusive||n.name&&a.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(a.exclusiveTests[n.name]=!!n.exclusive),a.tests=a.tests.filter(c=>!(c.OPTIONS.name===n.name&&(o||c.OPTIONS.test===s.OPTIONS.test))),a.tests.push(s),a}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let a=this.clone(),s=toArray$1(t).map(o=>new Reference(o));return s.forEach(o=>{o.isSibling&&a.deps.push(o.key)}),a.conditions.push(typeof n=="function"?new Condition(s,n):Condition.fromOptions(s,n)),a}typeError(t){let n=this.clone();return n.internalTests.typeError=createValidation({message:t,name:"typeError",skipAbsent:!0,test(a){return this.schema._typeCheck(a)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=mixed.oneOf){let a=this.clone();return t.forEach(s=>{a._whitelist.add(s),a._blacklist.delete(s)}),a.internalTests.whiteList=createValidation({message:n,name:"oneOf",skipAbsent:!0,test(s){let o=this.schema._whitelist,c=o.resolveAll(this.resolve);return c.includes(s)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:c}})}}),a}notOneOf(t,n=mixed.notOneOf){let a=this.clone();return t.forEach(s=>{a._blacklist.add(s),a._whitelist.delete(s)}),a.internalTests.blacklist=createValidation({message:n,name:"notOneOf",test(s){let o=this.schema._blacklist,c=o.resolveAll(this.resolve);return c.includes(s)?this.createError({params:{values:Array.from(o).join(", "),resolved:c}}):!0}}),a}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:a,meta:s,optional:o,nullable:c}=n.spec;return{meta:s,label:a,optional:o,nullable:c,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.filter((y,m,g)=>g.findIndex(z=>z.OPTIONS.name===y.OPTIONS.name)===m).map(y=>{const m=y.OPTIONS.params&&t?resolveParams(Object.assign({},y.OPTIONS.params),t):y.OPTIONS.params;return{name:y.OPTIONS.name,params:m}})}}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(a){try{return{value:await t.validate(a,{abortEarly:!1})}}catch(s){if(s instanceof ValidationError)return{issues:issuesFromValidationError(s)};throw s}}}}};Schema$1.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Schema$1.prototype[`${e}At`]=function(t,n,a={}){const{parent:s,parentPath:o,schema:c}=getIn(this,t,n,a.context);return c[e](s&&s[o],Object.assign({},a,{parent:s,path:t}))};for(const e of["equals","is"])Schema$1.prototype[e]=Schema$1.prototype.oneOf;for(const e of["not","nope"])Schema$1.prototype[e]=Schema$1.prototype.notOneOf;const returnsTrue=()=>!0;function create$8(e){return new MixedSchema(e)}class MixedSchema extends Schema$1{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:returnsTrue},t))}}create$8.prototype=MixedSchema.prototype;function create$7(){return new BooleanSchema}class BooleanSchema extends Schema$1{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,n,a)=>{if(a.spec.coerce&&!a.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=boolean.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return isAbsent(n)||n===!0}})}isFalse(t=boolean.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return isAbsent(n)||n===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}create$7.prototype=BooleanSchema.prototype;const isoReg=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function parseIsoDate(e){const t=parseDateStruct(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function parseDateStruct(e){var t,n;const a=isoReg.exec(e);return a?{year:toNumber$2(a[1]),month:toNumber$2(a[2],1)-1,day:toNumber$2(a[3],1),hour:toNumber$2(a[4]),minute:toNumber$2(a[5]),second:toNumber$2(a[6]),millisecond:a[7]?toNumber$2(a[7].substring(0,3)):0,precision:(t=(n=a[7])==null?void 0:n.length)!=null?t:void 0,z:a[8]||void 0,plusMinus:a[9]||void 0,hourOffset:toNumber$2(a[10]),minuteOffset:toNumber$2(a[11])}:null}function toNumber$2(e,t=0){return Number(e)||t}let rEmail=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,rUrl=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,rUUID=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,yearMonthDay="^\\d{4}-\\d{2}-\\d{2}",hourMinuteSecond="\\d{2}:\\d{2}:\\d{2}",zOrOffset="(([+-]\\d{2}(:?\\d{2})?)|Z)",rIsoDateTime=new RegExp(`${yearMonthDay}T${hourMinuteSecond}(\\.\\d+)?${zOrOffset}$`),isTrimmed=e=>isAbsent(e)||e===e.trim(),objStringTag={}.toString();function create$6(){return new StringSchema}class StringSchema extends Schema$1{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,a)=>{if(!a.spec.coerce||a.isType(t)||Array.isArray(t))return t;const s=t!=null&&t.toString?t.toString():t;return s===objStringTag?t:s})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||mixed.required,name:"required",skipAbsent:!0,test:a=>!!a.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=string$1.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(a){return a.length===this.resolve(t)}})}min(t,n=string$1.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a.length>=this.resolve(t)}})}max(t,n=string$1.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(a){return a.length<=this.resolve(t)}})}matches(t,n){let a=!1,s,o;return n&&(typeof n=="object"?{excludeEmptyString:a=!1,message:s,name:o}=n:s=n),this.test({name:o||"matches",message:s||string$1.matches,params:{regex:t},skipAbsent:!0,test:c=>c===""&&a||c.search(t)!==-1})}email(t=string$1.email){return this.matches(rEmail,{name:"email",message:t,excludeEmptyString:!0})}url(t=string$1.url){return this.matches(rUrl,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=string$1.uuid){return this.matches(rUUID,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",a,s;return t&&(typeof t=="object"?{message:n="",allowOffset:a=!1,precision:s=void 0}=t:n=t),this.matches(rIsoDateTime,{name:"datetime",message:n||string$1.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||string$1.datetime_offset,params:{allowOffset:a},skipAbsent:!0,test:o=>{if(!o||a)return!0;const c=parseDateStruct(o);return c?!!c.z:!1}}).test({name:"datetime_precision",message:n||string$1.datetime_precision,params:{precision:s},skipAbsent:!0,test:o=>{if(!o||s==null)return!0;const c=parseDateStruct(o);return c?c.precision===s:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=string$1.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:isTrimmed})}lowercase(t=string$1.lowercase){return this.transform(n=>isAbsent(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>isAbsent(n)||n===n.toLowerCase()})}uppercase(t=string$1.uppercase){return this.transform(n=>isAbsent(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>isAbsent(n)||n===n.toUpperCase()})}}create$6.prototype=StringSchema.prototype;let isNaN$1=e=>e!=+e;function create$5(){return new NumberSchema}class NumberSchema extends Schema$1{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!isNaN$1(t)}}),this.withMutation(()=>{this.transform((t,n,a)=>{if(!a.spec.coerce)return t;let s=t;if(typeof s=="string"){if(s=s.replace(/\s/g,""),s==="")return NaN;s=+s}return a.isType(s)||s===null?s:parseFloat(s)})})}min(t,n=number$2.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a>=this.resolve(t)}})}max(t,n=number$2.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a<=this.resolve(t)}})}lessThan(t,n=number$2.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(a){return a<this.resolve(t)}})}moreThan(t,n=number$2.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(a){return a>this.resolve(t)}})}positive(t=number$2.positive){return this.moreThan(0,t)}negative(t=number$2.negative){return this.lessThan(0,t)}integer(t=number$2.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>isAbsent(t)?t:t|0)}round(t){var n;let a=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(a.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+a.join(", "));return this.transform(s=>isAbsent(s)?s:Math[t](s))}}create$5.prototype=NumberSchema.prototype;let invalidDate=new Date(""),isDate$3=e=>Object.prototype.toString.call(e)==="[object Date]";class DateSchema extends Schema$1{constructor(){super({type:"date",check(t){return isDate$3(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,a)=>!a.spec.coerce||a.isType(t)||t===null?t:(t=parseIsoDate(t),isNaN(t)?DateSchema.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let a;if(Reference.isRef(t))a=t;else{let s=this.cast(t);if(!this._typeCheck(s))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);a=s}return a}min(t,n=date$1.min){let a=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s>=this.resolve(a)}})}max(t,n=date$1.max){let a=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(s){return s<=this.resolve(a)}})}}DateSchema.INVALID_DATE=invalidDate;function sortFields(e,t=[]){let n=[],a=new Set,s=new Set(t.map(([c,f])=>`${c}-${f}`));function o(c,f){let y=propertyExprExports.split(c)[0];a.add(y),s.has(`${f}-${y}`)||n.push([f,y])}for(const c of Object.keys(e)){let f=e[c];a.add(c),Reference.isRef(f)&&f.isSibling?o(f.path,c):isSchema(f)&&"deps"in f&&f.deps.forEach(y=>o(y,c))}return toposort.array(Array.from(a),n).reverse()}function findIndex(e,t){let n=1/0;return e.some((a,s)=>{var o;if((o=t.path)!=null&&o.includes(a))return n=s,!0}),n}function sortByKeyOrder(e){return(t,n)=>findIndex(e,t)-findIndex(e,n)}const parseJson=(e,t,n)=>{if(typeof e!="string")return e;let a=e;try{a=JSON.parse(e)}catch{}return n.isType(a)?a:e};function deepPartial(e){if("fields"in e){const t={};for(const[n,a]of Object.entries(e.fields))t[n]=deepPartial(a);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=deepPartial(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(deepPartial)}):"optional"in e?e.optional():e}const deepHas=(e,t)=>{const n=[...propertyExprExports.normalizePath(t)];if(n.length===1)return n[0]in e;let a=n.pop(),s=propertyExprExports.getter(propertyExprExports.join(n),!0)(e);return!!(s&&a in s)};let isObject$5=e=>Object.prototype.toString.call(e)==="[object Object]";function unknown(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(a=>n.indexOf(a)===-1)}const defaultSort=sortByKeyOrder([]);function create$3(e){return new ObjectSchema(e)}class ObjectSchema extends Schema$1{constructor(t){super({type:"object",check(n){return isObject$5(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=defaultSort,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var a;let s=super._cast(t,n);if(s===void 0)return this.getDefault(n);if(!this._typeCheck(s))return s;let o=this.fields,c=(a=n.stripUnknown)!=null?a:this.spec.noUnknown,f=[].concat(this._nodes,Object.keys(s).filter(z=>!this._nodes.includes(z))),y={},m=Object.assign({},n,{parent:y,__validating:n.__validating||!1}),g=!1;for(const z of f){let ie=o[z],re=z in s;if(ie){let he,_e=s[z];m.path=(n.path?`${n.path}.`:"")+z,ie=ie.resolve({value:_e,context:n.context,parent:y});let $e=ie instanceof Schema$1?ie.spec:void 0,pe=$e==null?void 0:$e.strict;if($e!=null&&$e.strip){g=g||z in s;continue}he=!n.__validating||!pe?ie.cast(s[z],m):s[z],he!==void 0&&(y[z]=he)}else re&&!c&&(y[z]=s[z]);(re!==z in y||y[z]!==s[z])&&(g=!0)}return g?y:s}_validate(t,n={},a,s){let{from:o=[],originalValue:c=t,recursive:f=this.spec.recursive}=n;n.from=[{schema:this,value:c},...o],n.__validating=!0,n.originalValue=c,super._validate(t,n,a,(y,m)=>{if(!f||!isObject$5(m)){s(y,m);return}c=c||m;let g=[];for(let z of this._nodes){let ie=this.fields[z];!ie||Reference.isRef(ie)||g.push(ie.asNestedTest({options:n,key:z,parent:m,parentPath:n.path,originalParent:c}))}this.runTests({tests:g,value:m,originalValue:c,options:n},a,z=>{s(z.sort(this._sortErrors).concat(y),m)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),a=n.fields;for(let[s,o]of Object.entries(this.fields)){const c=a[s];a[s]=c===void 0?o:c}return n.withMutation(s=>s.setFields(a,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(a=>{var s;const o=this.fields[a];let c=t;(s=c)!=null&&s.value&&(c=Object.assign({},c,{parent:c.value,value:c.value[a]})),n[a]=o&&"getDefault"in o?o.getDefault(c):void 0}),n}setFields(t,n){let a=this.clone();return a.fields=t,a._nodes=sortFields(t,n),a._sortErrors=sortByKeyOrder(Object.keys(t)),n&&(a._excludedEdges=n),a}shape(t,n=[]){return this.clone().withMutation(a=>{let s=a._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),s=[...a._excludedEdges,...n]),a.setFields(Object.assign(a.fields,t),s)})}partial(){const t={};for(const[n,a]of Object.entries(this.fields))t[n]="optional"in a&&a.optional instanceof Function?a.optional():a;return this.setFields(t)}deepPartial(){return deepPartial(this)}pick(t){const n={};for(const a of t)this.fields[a]&&(n[a]=this.fields[a]);return this.setFields(n,this._excludedEdges.filter(([a,s])=>t.includes(a)&&t.includes(s)))}omit(t){const n=[];for(const a of Object.keys(this.fields))t.includes(a)||n.push(a);return this.pick(n)}from(t,n,a){let s=propertyExprExports.getter(t,!0);return this.transform(o=>{if(!o)return o;let c=o;return deepHas(o,t)&&(c=Object.assign({},o),a||delete c[t],c[n]=s(o)),c})}json(){return this.transform(parseJson)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||object$1.exact,test(n){if(n==null)return!0;const a=unknown(this.schema,n);return a.length===0||this.createError({params:{properties:a.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=object$1.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let a=this.test({name:"noUnknown",exclusive:!0,message:n,test(s){if(s==null)return!0;const o=unknown(this.schema,s);return!t||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return a.spec.noUnknown=t,a}unknown(t=!0,n=object$1.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const a={};for(const s of Object.keys(n))a[t(s)]=n[s];return a})}camelCase(){return this.transformKeys(tinyCaseExports.camelCase)}snakeCase(){return this.transformKeys(tinyCaseExports.snakeCase)}constantCase(){return this.transformKeys(t=>tinyCaseExports.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),a=super.describe(t);a.fields={};for(const[o,c]of Object.entries(n.fields)){var s;let f=t;(s=f)!=null&&s.value&&(f=Object.assign({},f,{parent:f.value,value:f.value[o]})),a.fields[o]=c.describe(f)}return a}}create$3.prototype=ObjectSchema.prototype;function create$2(e){return new ArraySchema(e)}class ArraySchema extends Schema$1{constructor(t){super({type:"array",spec:{types:t},check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=t}_cast(t,n){const a=super._cast(t,n);if(!this._typeCheck(a)||!this.innerType)return a;let s=!1;const o=a.map((c,f)=>{const y=this.innerType.cast(c,Object.assign({},n,{path:`${n.path||""}[${f}]`}));return y!==c&&(s=!0),y});return s?o:a}_validate(t,n={},a,s){var o;let c=this.innerType,f=(o=n.recursive)!=null?o:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(t,n,a,(y,m)=>{var g;if(!f||!c||!this._typeCheck(m)){s(y,m);return}let z=new Array(m.length);for(let re=0;re<m.length;re++){var ie;z[re]=c.asNestedTest({options:n,index:re,parent:m,parentPath:n.path,originalParent:(ie=n.originalValue)!=null?ie:t})}this.runTests({value:m,tests:z,originalValue:(g=n.originalValue)!=null?g:t,options:n},a,re=>s(re.concat(y),m))})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}json(){return this.transform(parseJson)}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!isSchema(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+printValue(t));return n.innerType=t,n.spec=Object.assign({},n.spec,{types:t}),n}length(t,n=array$1.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(a){return a.length===this.resolve(t)}})}min(t,n){return n=n||array$1.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a.length>=this.resolve(t)}})}max(t,n){return n=n||array$1.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(a,s,o)=>!t(a,s,o):a=>!!a;return this.transform(a=>a!=null?a.filter(n):a)}describe(t){const n=(t?this.resolve(t):this).clone(),a=super.describe(t);if(n.innerType){var s;let o=t;(s=o)!=null&&s.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[0]})),a.innerType=n.innerType.describe(o)}return a}}create$2.prototype=ArraySchema.prototype;function create$4(e){return new Lazy(e)}function catchValidationError(e){try{return e()}catch(t){if(ValidationError.isError(t))return Promise.reject(t);throw t}}class Lazy{constructor(t){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(n,a={})=>{let s=this.builder(n,a);if(!isSchema(s))throw new TypeError("lazy() functions must return a valid schema");return this.spec.optional&&(s=s.optional()),s.resolve(a)},this.builder=t,this.spec={meta:void 0,optional:!1}}clone(t){const n=new Lazy(this.builder);return n.spec=Object.assign({},this.spec,t),n}optionality(t){return this.clone({optional:t})}optional(){return this.optionality(!0)}resolve(t){return this._resolve(t.value,t)}cast(t,n){return this._resolve(t,n).cast(t,n)}asNestedTest(t){let{key:n,index:a,parent:s,options:o}=t,c=s[a??n];return this._resolve(c,Object.assign({},o,{value:c,parent:s})).asNestedTest(t)}validate(t,n){return catchValidationError(()=>this._resolve(t,n).validate(t,n))}validateSync(t,n){return this._resolve(t,n).validateSync(t,n)}validateAt(t,n,a){return catchValidationError(()=>this._resolve(n,a).validateAt(t,n,a))}validateSyncAt(t,n,a){return this._resolve(n,a).validateSyncAt(t,n,a)}isValid(t,n){try{return this._resolve(t,n).isValid(t,n)}catch(a){if(ValidationError.isError(a))return Promise.resolve(!1);throw a}}isValidSync(t,n){return this._resolve(t,n).isValidSync(t,n)}describe(t){return t?this.resolve(t).describe(t):{type:"lazy",meta:this.spec.meta,label:void 0}}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(a){try{return{value:await t.validate(a,{abortEarly:!1})}}catch(s){if(ValidationError.isError(s))return{issues:issuesFromValidationError(s)};throw s}}}}}const configValidator=create$3().noUnknown().shape({client:create$3().noUnknown().shape({logo:create$6(),name:create$6()}),entrypoint:create$3().noUnknown().shape({account:create$6(),country:create$6(),credential:create$6(),site:create$6(),siteOrganizationType:create$6(),updateCredential:create$6()}),locale:create$6().oneOf(["es","en"]),navigation:create$3().noUnknown().shape({disableFormAutocomplete:create$7(),displayAccountsSelection:create$7(),displayBusinessSites:create$7(),displayCredentialInModal:create$7(),displayErrorsInToast:create$7(),displayLogoImages:create$7(),displayLongDescription:create$7(),displayPersonalSites:create$7(),displayPrivacyScreen:create$7(),displaySiteOrganizations:create$2().of(create$6()),displaySiteOrganizationTypes:create$2().of(create$6()),displaySites:create$2().of(create$6()),displayStatusInToast:create$7(),enableBackNavigation:create$7(),enableTwofaBackNavigation:create$7(),formButtonsDisabledStyle:create$7(),formShowPasswordStyle:create$6().oneOf(["icon","none","text"]),getSelectedAccounts:create$8().test("isFunction","${path} is not a function",e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!0),hideSelectCountry:create$7(),hideSiteOrganizations:create$2().of(create$6()),hideSiteOrganizationTypes:create$2().of(create$6()),hideSites:create$2().of(create$6()),oneSiteFlow:create$7(),quickAnswer:create$7(),returnToSiteFormOnUserError:create$4(e=>typeof e=="object"?create$2().of(create$5().oneOf([401,403,411])):create$7()),saveCredential:create$7(),selectClass:create$6(),socketTimeout:create$5().min(1),toastDuration:create$5().min(0),toastPosition:create$6().oneOf(["bottom-left","bottom-right","top-left","top-right"])}),__internal__:create$3().noUnknown().shape({apiBaseUrl:create$6(),apiEnv:create$6().oneOf(["development","production"]),assetsBaseUrl:create$6(),plaidSites:create$7(),defaultHttpParams:create$3()})}),paramsValidator=create$3().shape({token:create$6().required(),element:create$4(e=>{switch(typeof e){case"string":return create$6().test("isElement","${path} is not an Element",t=>{if(!document.querySelector(t))throw new ValidationError(`Invalid selector: Element "${t}" not found.`);return!0});case"object":return create$3().test("isElement","${path} is not an Element",t=>{if(!isElement$1(t))throw new ValidationError("Invalid element: Object should be a valid HtmlElement.");return!0});default:return create$6()}}),refreshTokenFunction:create$8().test("isFunction","${path} is not a function",e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!0),enableTestMode:create$7(),strict:create$3().noUnknown().nullable().shape({authorization:create$3().noUnknown().required().shape({type:create$6().oneOf(["jwk"]).required(),key:create$6().required()}),body:create$3().noUnknown().required().shape({type:create$6().oneOf(["jwk"]).required(),key:create$6().required().test("isBase64","${path} is not a base64 encoded",e=>e&&/^(?:[A-Za-z0-9+/]{2}[A-Za-z0-9+/]{2})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e))})}),config:configValidator}).strict().noUnknown();let __VERSION__={git:{hash:"gb72999f",distance:0,tag:"v1.2.0"}};function getVersion(){let e=`${__VERSION__.git.tag}.${__VERSION__.git.distance}`;return e=`${e}-${__VERSION__.git.hash}`,e}function getBridgeData(e,t){const n=parseInt("0x4",16),a="38060000000000000000000000000000000000000000000F00000000000000000000000000000000000D9802010000010101000000000000";let s;return getBridgeScripts$2().then(()=>(s=new digipass.nativebridge.DP110,new Promise((c,f)=>{s.onError(()=>f("bridge.not_ready")),s.onReady(y=>{if(y.versionCode<s.versionCode&&f("bridge.host_update_available"),s.isReady())s.getTokenInfo(n,function(g){if(g.returnCode!==0)return f(`bridge.${Math.abs(g.returnCode)}`);s.generateOTP(a,t,function(z){if(z.returnCode!==0)return f(`bridge.${Math.abs(z.returnCode)}`);c({token:`${e}XX${z.otp}XX${g.info}XX${y.versionCode}`,challenge:t})})});else return Promise.reject("bridge.not_ready")})})))}function getBridgeScripts$2(){const e=new Promise((n,a)=>{if(document.getElementById("widgetBridgeConfig"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeConfig"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.config.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_config_script_not_loaded")}}),t=new Promise((n,a)=>{if(document.getElementById("widgetBridgeUsb"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeUsb"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.dp110.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}function generateResponseOnlyOTP(){const e=window.bridgeBluetooth;if(e.timeoutValidation=!1,e.cryptoAppOTP=7,!e.bridge.isReady()){e.bridge.reconnect();return}clearTimeout(e.varSetTime),e.bridge.generateResponseOnlyOTP(e.cryptoAppOTP,function(t){t.returnCode!=0?(t.returnCode==-6014||t.returnCode==-6015||t.returnCode==-6016)&&turnOn(!1,!1):e.timeoutValidation||(e.validOTP=!0,e.valFinalFlow=!0,e.token=t.otp,e.acceptB?sendRequestDP785():(otpDP785ConnectedServices(),otpDP785Connected()))})}function getBridgeBluetoothFakeToken(e){const t=window.bridgeBluetooth;return new Promise((n,a)=>{t.resolve=n,t.reject=a,getSetTimeRequest(e)})}function getBridgeBluetoothFinalToken(e){const t=window.bridgeBluetooth;return new Promise((n,a)=>{t.resolve=n,t.reject=a,getChallengeResponseRequestContinue(e)})}function getBridgeBluetoothTimeChallengeV1(e,t){window.bridgeBluetooth={acceptB:null,accesLogin:!0,bridge:null,cancelB:!1,cancelB2:!1,changeIdNameOtp:!1,claveInsSegOTP:null,contNB:2,contNBReady:0,contNBVersion:0,cryptoAppOTP:null,digipassSerial:null,eai_firma_DP110:null,eai_serial_DP110:null,isChequeLineaOrSAT:null,jspDesafio:t,jspToken:e,nbProcessIsComplete:!1,resolve:null,reject:null,setTimeReady:!1,switchState:!0,timeoutValidation:!1,token:"",valFinalFlow:!1,validOTP:!1,varSetTime:null,versionCode:null};const n=window.bridgeBluetooth;return getBridgeScripts$1().then(()=>new Promise((s,o)=>{n.resolve=s,n.reject=o,initNativeBrigde()}))}function getBridgeScripts$1(){const e=new Promise((n,a)=>{if(document.getElementById("widgetBridgeConfig"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeConfig"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.config.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_config_script_not_loaded")}}),t=new Promise((n,a)=>{if(document.getElementById("widgetBridgeBluetooth"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeBluetooth"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.dptoken.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}function getChallengeResponseRequest(){const e=window.bridgeBluetooth;e.accesLogin&&(e.cancelB||(e.valFinalFlow=!0,e.token="********",e.resolve(e.token)),e.accesLogin=!1)}function getChallengeResponseRequestContinue(e){const t=window.bridgeBluetooth,n=JSON.parse(e);n.estado!=="OK"||t.cancelB2||processRequestMessage(n.requestMessage)}function getSetTimeRequest(e){const t=JSON.parse(e);t.estado!=="OK"||processRequestMessageSetTime(t.requestMessage)}function initializeDigipass$1(){const e=window.bridgeBluetooth;if(!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.initializeDigipass(e.digipassSerial,function(t){t.returnCode!=0||e.bridge.getDigipassTimeChallenge(function(n){n.returnCode!=0?timeEvents(function(){e.switchState&&listDigipass()},5e3,"timeOut"):(clearTimeout(e.varSetTime),e.timeoutValidation=!1,e.setTimeReady?getChallengeResponseRequest():setDPTime())})})}function initNativeBrigde(){const e=window.bridgeBluetooth;try{e.bridge=new digipass.nativebridge.DPToken,e.bridge.getDigipassTimeChallenge(function(){turnOn(!0,!1)}),e.bridge.onError(function(){e.contNB++,e.nbProcessIsComplete||e.contNB<=4&&(e.accesLogin?e.bridge.reconnect():e.bridge.getDigipassTimeChallenge(function(){}))}),e.bridge.onReady(function(){clearTimeout(e.varSetTime),e.contNB=0,e.contNBReady===0&&(e.validOTP||(timeEvents(function(){e.timeoutValidation=!0},3e4,"timeOut"),e.switchState&&listDigipass()),e.contNBReady++)})}catch(t){e.reject(t)}}function listDigipass(){const e=window.bridgeBluetooth;if(e.digipassSerial=null,!e.bridge.isReady()){e.bridge.reconnect();return}if(e.contNBVersion===0&&e.bridge.getNativeBridgeVersion(function(t){e.versionCode=t.versionCode,e.contNBVersion++}),!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.getDigipassList(function(t){e.timeoutValidation||t.returnCode!=0||(t.devices.length==0?e.switchState&&listDigipass():(t.devices.forEach(n=>{n.digipassSerial===e.jspToken&&(e.digipassSerial=n.digipassSerial,e.jspDesafio!=="null"&&(e.eai_serial_DP110=e.jspToken))}),e.digipassSerial===null?e.switchState&&listDigipass():e.timeoutValidation||initializeDigipass$1()))})}function otpDP785Connected(){const e=window.bridgeBluetooth;if(e.switchState){let t="";e.token!==void 0?(t=e.token,e.token=t+e.cryptoAppOTP):(t=e.claveInsSegOTP,e.claveInsSegOTP=t+e.cryptoAppOTP)}e.resolve(`${e.token}XX${e.eai_firma_DP110}XX${e.eai_serial_DP110}XX${e.versionCode}`)}function otpDP785ConnectedServices(){const e=window.bridgeBluetooth;e.changeIdNameOtp=!0}function otpDP785DisconnectedServices(){const e=window.bridgeBluetooth;e.changeIdNameOtp=!1}function parseResponseMessage(e,t){const n=window.bridgeBluetooth;if(!n.bridge.isReady()){n.bridge.reconnect();return}n.bridge.parseResponseMessage(e,t,function(a){a.returnCode!=0?(a.returnCode==-6014||a.returnCode==-6015||a.returnCode==-6016)&&turnOn(!1,!1):n.timeoutValidation||(n.validOTP=!0,n.jspDesafio!=="null"&&(n.eai_firma_DP110=a.messageSignature),generateResponseOnlyOTP())})}function parseResponseMessageSetTime(e,t){const n=window.bridgeBluetooth;if(!n.bridge.isReady()){n.bridge.reconnect();return}n.bridge.parseResponseMessage(e,t,function(a){a.returnCode!=0||(n.setTimeReady=!0,getChallengeResponseRequest())})}function processRequestMessage(e){const t=window.bridgeBluetooth;if(!t.bridge.isReady()){t.bridge.reconnect();return}t.bridge.transmitRequestMessage(e,function(n){n.returnCode!=0||parseResponseMessage(n.responseMessage,e)})}function processRequestMessageSetTime(e){const t=window.bridgeBluetooth;if(!t.bridge.isReady()){t.bridge.reconnect();return}t.bridge.transmitRequestMessage(e,function(n){n.returnCode!=0||parseResponseMessageSetTime(n.responseMessage,e)})}function sendRequestDP785(){const e=window.bridgeBluetooth;clearTimeout(e.varSetTime),otpDP785Connected()}function setDPTime(){const e=window.bridgeBluetooth;if(!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.getDigipassTimeChallenge(function(t){t.returnCode!=0||e.resolve(t.timeChallenge)})}function timeEvents(e,t,n){const a=window.bridgeBluetooth;switch(n){case"timeOut":a.varSetTime=setTimeout(e,t);break;case"interval":setInterval(e,t);break}}function turnOn(e,t){const n=window.bridgeBluetooth,a="";if(n.timeoutValidation=!1,n.acceptB=t,clearTimeout(n.varSetTime),n.token.length!=8&&!t&&(n.validOTP=!1),t||(n.switchState=e),e)if(n.contNBVersion=0,n.valFinalFlow=!1,t||(n.accesLogin=!0,n.cancelB=!1),n.validOTP)sendRequestDP785(),n.valFinalFlow=!0;else{if(n.contNBVersion=0,n.cancelB2=!1,n.contNB=2,t||(n.token=a),n.bridge===void 0&&initNativeBrigde(),!n.bridge.isReady()){n.bridge.reconnect();return}clearTimeout(n.varSetTime),timeEvents(function(){n.timeoutValidation=!0},3e4,"timeOut"),n.contNBReady!==0?listDigipass():n.bridge.reconnect()}else clearTimeout(n.varSetTime),n.validOTP=!0,n.cancelB=!0,n.cancelB2=!0,otpDP785DisconnectedServices(),n.claveInsSegOTP=a,n.token=a}function turnOnBridgeBluetoothBeforeSendingTwofa(){turnOn(!0,!0)}const appStateWindowProperty="bridgeBluetooth";function continueDPToken(e){const t=window[appStateWindowProperty];return new Promise((a,s)=>{t.resolve=a,t.reject=s;let o,c;const{authenticationData:f}=e.authenticationResponse;f[0].idAuthenticationData==="signedMessage"?([o]=f[0].authenticationData,[c]=f[1].authenticationData):([o]=f[1].authenticationData,[c]=f[0].authenticationData),secondPartDPToken({signedMessage:o,signedTimeMessage:c})})}async function generateTimeChallenge(){const e=window[appStateWindowProperty];return new Promise(async(t,n)=>{if(e.nativeBridgeInstance.isReady())try{const a=await async function(s){return new Promise((o,c)=>{s.getDigipassTimeChallenge(f=>{if(f.returnCode!==0){const m={title:"Generar - TimeChallenge",response:{message:"Se ha producido un error al generar el TimeChallenge. Por favor, asegúrate de tener tu token conectado y encendido.",returnCode:f.returnCode}};return void c(m)}const y={title:"Generar - TimeChallenge",response:{message:`El TimeChallenge es: ${f.timeChallenge}`,timeChallenge:f.timeChallenge,errorCode:""}};o(y)})})}(e.nativeBridgeInstance);t(a)}catch(a){n(a)}else n({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:""}})})}function getBridgeBluetoothTimeChallengeV2(e){window[appStateWindowProperty]={isDp785Signature:!1,nativeBridgeInstance:null,resolve:null,reject:null};const t=window[appStateWindowProperty];return getBridgeScripts().then(()=>new Promise((a,s)=>{t.resolve=a,t.reject=s,t.isDp785Signature=e!=="214",t.nativeBridgeInstance=new window.digipass.nativebridge.DPToken,onProcessDPToken()}))}function getBridgeScripts(){const e=new Promise((n,a)=>{if(document.getElementById("widgetBridgeConfig"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeConfig"),s.setAttribute("src","undefineddigipass.nativebridge.config.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_config_script_not_loaded")}}),t=new Promise((n,a)=>{if(document.getElementById("widgetBridgeBluetooth"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeBluetooth"),s.setAttribute("src","undefineddigipass.nativebridge.dptoken.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}async function initDPToken(){const e=window[appStateWindowProperty];try{const t=await initializeDevice(e.isDp785Signature);if(t.length===1){const[n]=t;await initializeDigipass(n.serial);const a=await generateTimeChallenge();e.resolve(a.response.timeChallenge)}}catch(t){e.reject(t),alert("Por favor, asegúrate de tener tu token conectado y encendido.")}}async function initializeDevice(e){const t=window[appStateWindowProperty];return new Promise(async(n,a)=>{const s=e?"DP785_T4_MANUAL":"DP785_T4_NOT_LINKED";if(t.nativeBridgeInstance.isReady())try{const o=await async function(y){return new Promise((m,g)=>{y.getDigipassList(z=>{if(z.returnCode===0)m(z.devices);else{const ie={title:"Listar dispositivos",response:{message:"Error al obtener la lista de dispositivos disponibles.",returnCode:z.returnCode}};g(ie)}})})}(t.nativeBridgeInstance),c=o.map(y=>({name:y.deviceName,serial:y.digipassSerial})),[f]=c;if(!f||!f.serial)return void a({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:s}});n(c)}catch(o){a(o)}else a({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:s}})})}async function initializeDigipass(e){const t=window[appStateWindowProperty];return new Promise((n,a)=>{t.nativeBridgeInstance.initializeDigipass(e,s=>{if(s.returnCode!==0){const c={title:"Inicializar dispositivo",response:{message:"Error al intentar inicializar el dispositivo.",returnCode:s.returnCode}};return void a(c)}const o={title:"Inicializar dispositivo",response:{message:`El dispositivo con serial: ${e} está listo para ser usado.`,errorCode:""}};n(o)})})}async function generateResponseOnlyOTPBridge(e){const t=window[appStateWindowProperty];return new Promise(async(n,a)=>{if(t.nativeBridgeInstance.isReady())try{const s=await async function(o,c){return new Promise((f,y)=>{o.generateResponseOnlyOTP(c,m=>{if(m.returnCode!==0){const z={title:"Generar OTP con PIN",response:{message:"No fue posible generar la OTP.",returnCode:m.returnCode}};return void y(z)}const g={title:"Generar OTP con PIN",response:{message:`La OTP se generó correctamente: ${m.otp}`,otp:m.otp,errorCode:"",processType:"DP785_T4_LINKED"}};f(g)})})}(t.nativeBridgeInstance,e);n(s)}catch(s){a(s)}else a({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:"DP785_T4_NOT_LINKED"}})})}async function onProcessDPToken(){const e=window[appStateWindowProperty],t=await startNativeBridgeValidation();if(t.response.errorCode!==""){alert(t.response.message),e.reject(t.response.errorCode);return}else await initDPToken()}async function secondPartDPToken({signedMessage:e="",signedTimeMessage:t=""}){const n=window[appStateWindowProperty];try{await transmitRequestMessageBridge(t,n.isDp785Signature);const a=await transmitRequestMessageBridge(e,n.isDp785Signature),{response:{messageSignature:s}}=a,o=7,c=await generateResponseOnlyOTPBridge(o),{response:{otp:f}}=c,y={};y.otpChallenge=s;const m=`${f}${o}`;y.otp=m,n.resolve(`${y.otpChallenge}XX${y.otp}`)}catch(a){n.reject(a),alert("Error al intentar validar la sesión desde el dispositivo de acceso seguro.")}}async function startNativeBridgeValidation(){const e=window[appStateWindowProperty];return new Promise((t,n)=>{e.nativeBridgeInstance.onReady(()=>{e.nativeBridgeInstance.getNativeBridgeVersion(a=>{const s={title:"Conexión con Native Bridge",response:{errorCode:"",message:"El software Native Bridge se encuentra instalado en tu ordenador.",updateAvailable:!(a.versionCode>=e.nativeBridgeInstance.versionCode)}};t(s)})}),e.nativeBridgeInstance.onError(()=>{n({title:"Conexión con Native Bridge",response:{errorCode:"222",message:"El software Native Bridge no se encontró instalado en tu ordenador.",processType:"DP785_T4_NOT_LINKED"}})})})}async function transmitRequestMessageBridge(e,t){const n=window[appStateWindowProperty];return new Promise(async(a,s)=>{const o=t?"DP785_T4_MANUAL":"DP785_T4_NOT_LINKED";if(n.nativeBridgeInstance.isReady())try{const{responseMessage:c}=await async function(y,m){return new Promise((g,z)=>{y.transmitRequestMessage(m,ie=>{if(ie.returnCode===0)g(ie);else{const re={title:"Firmar mensaje",response:{message:"No fue posible transmitir el mensaje.",returnCode:ie.returnCode}};z(re)}})})}(n.nativeBridgeInstance,e),f=await async function(y,m,g){return new Promise((z,ie)=>{y.parseResponseMessage(m,g,re=>{if(re.returnCode!==0){const _e={title:"Firmar mensaje",response:{message:"No fue posible parsear el mensaje.",returnCode:re.returnCode}};return void ie(_e)}const he={title:"Firmar mensaje",response:{message:`Se realizó la firma del mensaje correctamente: ${re.messageSignature}`,messageSignature:re.messageSignature,errorCode:"",processType:"DP785_T4_LINKED"}};z(he)})})}(n.nativeBridgeInstance,c,e);a(f)}catch(c){s(c)}else s({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:o}})})}const DOWNLOAD_OPTIONS_ACTIVE={enables:["download_options"],name:"download_options_active",required:!1,translate_label:"download_options.switch",type:"switch",validation:null},DOWNLOAD_OPTIONS={name:"download_options",required:!1,enabled_by:"download_options_active",translate_error_label:"download_options.label",type:"date_range",validation:null},DOWNLOAD_OPTIONS_SITES=["56cf5728784806f72b8b456f","5da784f1f9de2a06483abec1"];var buffer$2={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup[45]=62,revLookup[95]=63;function getLens(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var a=n===t?0:4-n%4;return[n,a]}function byteLength(e){var t=getLens(e),n=t[0],a=t[1];return(n+a)*3/4-a}function _byteLength(e,t,n){return(t+n)*3/4-n}function toByteArray(e){var t,n=getLens(e),a=n[0],s=n[1],o=new Arr(_byteLength(e,a,s)),c=0,f=s>0?a-4:a,y;for(y=0;y<f;y+=4)t=revLookup[e.charCodeAt(y)]<<18|revLookup[e.charCodeAt(y+1)]<<12|revLookup[e.charCodeAt(y+2)]<<6|revLookup[e.charCodeAt(y+3)],o[c++]=t>>16&255,o[c++]=t>>8&255,o[c++]=t&255;return s===2&&(t=revLookup[e.charCodeAt(y)]<<2|revLookup[e.charCodeAt(y+1)]>>4,o[c++]=t&255),s===1&&(t=revLookup[e.charCodeAt(y)]<<10|revLookup[e.charCodeAt(y+1)]<<4|revLookup[e.charCodeAt(y+2)]>>2,o[c++]=t>>8&255,o[c++]=t&255),o}function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[e&63]}function encodeChunk(e,t,n){for(var a,s=[],o=t;o<n;o+=3)a=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),s.push(tripletToBase64(a));return s.join("")}function fromByteArray(e){for(var t,n=e.length,a=n%3,s=[],o=16383,c=0,f=n-a;c<f;c+=o)s.push(encodeChunk(e,c,c+o>f?f:c+o));return a===1?(t=e[n-1],s.push(lookup[t>>2]+lookup[t<<4&63]+"==")):a===2&&(t=(e[n-2]<<8)+e[n-1],s.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),s.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function(e,t,n,a,s){var o,c,f=s*8-a-1,y=(1<<f)-1,m=y>>1,g=-7,z=n?s-1:0,ie=n?-1:1,re=e[t+z];for(z+=ie,o=re&(1<<-g)-1,re>>=-g,g+=f;g>0;o=o*256+e[t+z],z+=ie,g-=8);for(c=o&(1<<-g)-1,o>>=-g,g+=a;g>0;c=c*256+e[t+z],z+=ie,g-=8);if(o===0)o=1-m;else{if(o===y)return c?NaN:(re?-1:1)*(1/0);c=c+Math.pow(2,a),o=o-m}return(re?-1:1)*c*Math.pow(2,o-a)},ieee754.write=function(e,t,n,a,s,o){var c,f,y,m=o*8-s-1,g=(1<<m)-1,z=g>>1,ie=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,re=a?0:o-1,he=a?1:-1,_e=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,c=g):(c=Math.floor(Math.log(t)/Math.LN2),t*(y=Math.pow(2,-c))<1&&(c--,y*=2),c+z>=1?t+=ie/y:t+=ie*Math.pow(2,1-z),t*y>=2&&(c++,y/=2),c+z>=g?(f=0,c=g):c+z>=1?(f=(t*y-1)*Math.pow(2,s),c=c+z):(f=t*Math.pow(2,z-1)*Math.pow(2,s),c=0));s>=8;e[n+re]=f&255,re+=he,f/=256,s-=8);for(c=c<<s|f,m+=s;m>0;e[n+re]=c&255,re+=he,c/=256,m-=8);e[n+re-he]|=_e*128};/*!
679
+ `+(f!==c?`result of cast: ${f}`:""))}return o}_cast(t,n){let a=t===void 0?t:this.transforms.reduce((s,o)=>o.call(this,s,t,this),t);return a===void 0&&(a=this.getDefault(n)),a}_validate(t,n={},a,s){let{path:o,originalValue:c=t,strict:f=this.spec.strict}=n,y=t;f||(y=this._cast(y,Object.assign({assert:!1},n)));let m=[];for(let g of Object.values(this.internalTests))g&&m.push(g);this.runTests({path:o,value:y,originalValue:c,options:n,tests:m},a,g=>{if(g.length)return s(g,y);this.runTests({path:o,value:y,originalValue:c,options:n,tests:this.tests},a,s)})}runTests(t,n,a){let s=!1,{tests:o,value:c,originalValue:f,path:y,options:m}=t,g=_e=>{s||(s=!0,n(_e,c))},z=_e=>{s||(s=!0,a(_e,c))},ie=o.length,re=[];if(!ie)return z([]);let he={value:c,originalValue:f,path:y,options:m,schema:this};for(let _e=0;_e<o.length;_e++){const $e=o[_e];$e(he,g,function(Ce){Ce&&(Array.isArray(Ce)?re.push(...Ce):re.push(Ce)),--ie<=0&&z(re)})}}asNestedTest({key:t,index:n,parent:a,parentPath:s,originalParent:o,options:c}){const f=t??n;if(f==null)throw TypeError("Must include `key` or `index` for nested validations");const y=typeof f=="number";let m=a[f];const g=Object.assign({},c,{strict:!0,parent:a,value:m,originalValue:o[f],key:void 0,[y?"index":"key"]:f,path:y||f.includes(".")?`${s||""}[${y?f:`"${f}"`}]`:(s?`${s}.`:"")+t});return(z,ie,re)=>this.resolve(g)._validate(m,g,ie,re)}validate(t,n){var a;let s=this.resolve(Object.assign({},n,{value:t})),o=(a=n==null?void 0:n.disableStackTrace)!=null?a:s.spec.disableStackTrace;return new Promise((c,f)=>s._validate(t,n,(y,m)=>{ValidationError.isError(y)&&(y.value=m),f(y)},(y,m)=>{y.length?f(new ValidationError(y,m,void 0,void 0,o)):c(m)}))}validateSync(t,n){var a;let s=this.resolve(Object.assign({},n,{value:t})),o,c=(a=n==null?void 0:n.disableStackTrace)!=null?a:s.spec.disableStackTrace;return s._validate(t,Object.assign({},n,{sync:!0}),(f,y)=>{throw ValidationError.isError(f)&&(f.value=y),f},(f,y)=>{if(f.length)throw new ValidationError(f,t,void 0,void 0,c);o=y}),o}isValid(t,n){return this.validate(t,n).then(()=>!0,a=>{if(ValidationError.isError(a))return!1;throw a})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(a){if(ValidationError.isError(a))return!1;throw a}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):clone$1(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const a=this.clone({nullable:t});return a.internalTests.nullable=createValidation({message:n,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),a}optionality(t,n){const a=this.clone({optional:t});return a.internalTests.optionality=createValidation({message:n,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),a}optional(){return this.optionality(!0)}defined(t=mixed.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=mixed.notNull){return this.nullability(!1,t)}required(t=mixed.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=mixed.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let a=this.clone(),s=createValidation(n),o=n.exclusive||n.name&&a.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(a.exclusiveTests[n.name]=!!n.exclusive),a.tests=a.tests.filter(c=>!(c.OPTIONS.name===n.name&&(o||c.OPTIONS.test===s.OPTIONS.test))),a.tests.push(s),a}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let a=this.clone(),s=toArray$1(t).map(o=>new Reference(o));return s.forEach(o=>{o.isSibling&&a.deps.push(o.key)}),a.conditions.push(typeof n=="function"?new Condition(s,n):Condition.fromOptions(s,n)),a}typeError(t){let n=this.clone();return n.internalTests.typeError=createValidation({message:t,name:"typeError",skipAbsent:!0,test(a){return this.schema._typeCheck(a)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=mixed.oneOf){let a=this.clone();return t.forEach(s=>{a._whitelist.add(s),a._blacklist.delete(s)}),a.internalTests.whiteList=createValidation({message:n,name:"oneOf",skipAbsent:!0,test(s){let o=this.schema._whitelist,c=o.resolveAll(this.resolve);return c.includes(s)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:c}})}}),a}notOneOf(t,n=mixed.notOneOf){let a=this.clone();return t.forEach(s=>{a._blacklist.add(s),a._whitelist.delete(s)}),a.internalTests.blacklist=createValidation({message:n,name:"notOneOf",test(s){let o=this.schema._blacklist,c=o.resolveAll(this.resolve);return c.includes(s)?this.createError({params:{values:Array.from(o).join(", "),resolved:c}}):!0}}),a}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:a,meta:s,optional:o,nullable:c}=n.spec;return{meta:s,label:a,optional:o,nullable:c,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.filter((y,m,g)=>g.findIndex(z=>z.OPTIONS.name===y.OPTIONS.name)===m).map(y=>{const m=y.OPTIONS.params&&t?resolveParams(Object.assign({},y.OPTIONS.params),t):y.OPTIONS.params;return{name:y.OPTIONS.name,params:m}})}}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(a){try{return{value:await t.validate(a,{abortEarly:!1})}}catch(s){if(s instanceof ValidationError)return{issues:issuesFromValidationError(s)};throw s}}}}};Schema$1.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Schema$1.prototype[`${e}At`]=function(t,n,a={}){const{parent:s,parentPath:o,schema:c}=getIn(this,t,n,a.context);return c[e](s&&s[o],Object.assign({},a,{parent:s,path:t}))};for(const e of["equals","is"])Schema$1.prototype[e]=Schema$1.prototype.oneOf;for(const e of["not","nope"])Schema$1.prototype[e]=Schema$1.prototype.notOneOf;const returnsTrue=()=>!0;function create$8(e){return new MixedSchema(e)}class MixedSchema extends Schema$1{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:returnsTrue},t))}}create$8.prototype=MixedSchema.prototype;function create$7(){return new BooleanSchema}class BooleanSchema extends Schema$1{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,n,a)=>{if(a.spec.coerce&&!a.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=boolean.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return isAbsent(n)||n===!0}})}isFalse(t=boolean.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return isAbsent(n)||n===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}create$7.prototype=BooleanSchema.prototype;const isoReg=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function parseIsoDate(e){const t=parseDateStruct(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function parseDateStruct(e){var t,n;const a=isoReg.exec(e);return a?{year:toNumber$2(a[1]),month:toNumber$2(a[2],1)-1,day:toNumber$2(a[3],1),hour:toNumber$2(a[4]),minute:toNumber$2(a[5]),second:toNumber$2(a[6]),millisecond:a[7]?toNumber$2(a[7].substring(0,3)):0,precision:(t=(n=a[7])==null?void 0:n.length)!=null?t:void 0,z:a[8]||void 0,plusMinus:a[9]||void 0,hourOffset:toNumber$2(a[10]),minuteOffset:toNumber$2(a[11])}:null}function toNumber$2(e,t=0){return Number(e)||t}let rEmail=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,rUrl=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,rUUID=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,yearMonthDay="^\\d{4}-\\d{2}-\\d{2}",hourMinuteSecond="\\d{2}:\\d{2}:\\d{2}",zOrOffset="(([+-]\\d{2}(:?\\d{2})?)|Z)",rIsoDateTime=new RegExp(`${yearMonthDay}T${hourMinuteSecond}(\\.\\d+)?${zOrOffset}$`),isTrimmed=e=>isAbsent(e)||e===e.trim(),objStringTag={}.toString();function create$6(){return new StringSchema}class StringSchema extends Schema$1{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,a)=>{if(!a.spec.coerce||a.isType(t)||Array.isArray(t))return t;const s=t!=null&&t.toString?t.toString():t;return s===objStringTag?t:s})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||mixed.required,name:"required",skipAbsent:!0,test:a=>!!a.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=string$1.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(a){return a.length===this.resolve(t)}})}min(t,n=string$1.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a.length>=this.resolve(t)}})}max(t,n=string$1.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(a){return a.length<=this.resolve(t)}})}matches(t,n){let a=!1,s,o;return n&&(typeof n=="object"?{excludeEmptyString:a=!1,message:s,name:o}=n:s=n),this.test({name:o||"matches",message:s||string$1.matches,params:{regex:t},skipAbsent:!0,test:c=>c===""&&a||c.search(t)!==-1})}email(t=string$1.email){return this.matches(rEmail,{name:"email",message:t,excludeEmptyString:!0})}url(t=string$1.url){return this.matches(rUrl,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=string$1.uuid){return this.matches(rUUID,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",a,s;return t&&(typeof t=="object"?{message:n="",allowOffset:a=!1,precision:s=void 0}=t:n=t),this.matches(rIsoDateTime,{name:"datetime",message:n||string$1.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||string$1.datetime_offset,params:{allowOffset:a},skipAbsent:!0,test:o=>{if(!o||a)return!0;const c=parseDateStruct(o);return c?!!c.z:!1}}).test({name:"datetime_precision",message:n||string$1.datetime_precision,params:{precision:s},skipAbsent:!0,test:o=>{if(!o||s==null)return!0;const c=parseDateStruct(o);return c?c.precision===s:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=string$1.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:isTrimmed})}lowercase(t=string$1.lowercase){return this.transform(n=>isAbsent(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>isAbsent(n)||n===n.toLowerCase()})}uppercase(t=string$1.uppercase){return this.transform(n=>isAbsent(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>isAbsent(n)||n===n.toUpperCase()})}}create$6.prototype=StringSchema.prototype;let isNaN$1=e=>e!=+e;function create$5(){return new NumberSchema}class NumberSchema extends Schema$1{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!isNaN$1(t)}}),this.withMutation(()=>{this.transform((t,n,a)=>{if(!a.spec.coerce)return t;let s=t;if(typeof s=="string"){if(s=s.replace(/\s/g,""),s==="")return NaN;s=+s}return a.isType(s)||s===null?s:parseFloat(s)})})}min(t,n=number$2.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a>=this.resolve(t)}})}max(t,n=number$2.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a<=this.resolve(t)}})}lessThan(t,n=number$2.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(a){return a<this.resolve(t)}})}moreThan(t,n=number$2.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(a){return a>this.resolve(t)}})}positive(t=number$2.positive){return this.moreThan(0,t)}negative(t=number$2.negative){return this.lessThan(0,t)}integer(t=number$2.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>isAbsent(t)?t:t|0)}round(t){var n;let a=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(a.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+a.join(", "));return this.transform(s=>isAbsent(s)?s:Math[t](s))}}create$5.prototype=NumberSchema.prototype;let invalidDate=new Date(""),isDate$3=e=>Object.prototype.toString.call(e)==="[object Date]";class DateSchema extends Schema$1{constructor(){super({type:"date",check(t){return isDate$3(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,a)=>!a.spec.coerce||a.isType(t)||t===null?t:(t=parseIsoDate(t),isNaN(t)?DateSchema.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let a;if(Reference.isRef(t))a=t;else{let s=this.cast(t);if(!this._typeCheck(s))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);a=s}return a}min(t,n=date$1.min){let a=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s>=this.resolve(a)}})}max(t,n=date$1.max){let a=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(s){return s<=this.resolve(a)}})}}DateSchema.INVALID_DATE=invalidDate;function sortFields(e,t=[]){let n=[],a=new Set,s=new Set(t.map(([c,f])=>`${c}-${f}`));function o(c,f){let y=propertyExprExports.split(c)[0];a.add(y),s.has(`${f}-${y}`)||n.push([f,y])}for(const c of Object.keys(e)){let f=e[c];a.add(c),Reference.isRef(f)&&f.isSibling?o(f.path,c):isSchema(f)&&"deps"in f&&f.deps.forEach(y=>o(y,c))}return toposort.array(Array.from(a),n).reverse()}function findIndex(e,t){let n=1/0;return e.some((a,s)=>{var o;if((o=t.path)!=null&&o.includes(a))return n=s,!0}),n}function sortByKeyOrder(e){return(t,n)=>findIndex(e,t)-findIndex(e,n)}const parseJson=(e,t,n)=>{if(typeof e!="string")return e;let a=e;try{a=JSON.parse(e)}catch{}return n.isType(a)?a:e};function deepPartial(e){if("fields"in e){const t={};for(const[n,a]of Object.entries(e.fields))t[n]=deepPartial(a);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=deepPartial(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(deepPartial)}):"optional"in e?e.optional():e}const deepHas=(e,t)=>{const n=[...propertyExprExports.normalizePath(t)];if(n.length===1)return n[0]in e;let a=n.pop(),s=propertyExprExports.getter(propertyExprExports.join(n),!0)(e);return!!(s&&a in s)};let isObject$5=e=>Object.prototype.toString.call(e)==="[object Object]";function unknown(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(a=>n.indexOf(a)===-1)}const defaultSort=sortByKeyOrder([]);function create$3(e){return new ObjectSchema(e)}class ObjectSchema extends Schema$1{constructor(t){super({type:"object",check(n){return isObject$5(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=defaultSort,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var a;let s=super._cast(t,n);if(s===void 0)return this.getDefault(n);if(!this._typeCheck(s))return s;let o=this.fields,c=(a=n.stripUnknown)!=null?a:this.spec.noUnknown,f=[].concat(this._nodes,Object.keys(s).filter(z=>!this._nodes.includes(z))),y={},m=Object.assign({},n,{parent:y,__validating:n.__validating||!1}),g=!1;for(const z of f){let ie=o[z],re=z in s;if(ie){let he,_e=s[z];m.path=(n.path?`${n.path}.`:"")+z,ie=ie.resolve({value:_e,context:n.context,parent:y});let $e=ie instanceof Schema$1?ie.spec:void 0,pe=$e==null?void 0:$e.strict;if($e!=null&&$e.strip){g=g||z in s;continue}he=!n.__validating||!pe?ie.cast(s[z],m):s[z],he!==void 0&&(y[z]=he)}else re&&!c&&(y[z]=s[z]);(re!==z in y||y[z]!==s[z])&&(g=!0)}return g?y:s}_validate(t,n={},a,s){let{from:o=[],originalValue:c=t,recursive:f=this.spec.recursive}=n;n.from=[{schema:this,value:c},...o],n.__validating=!0,n.originalValue=c,super._validate(t,n,a,(y,m)=>{if(!f||!isObject$5(m)){s(y,m);return}c=c||m;let g=[];for(let z of this._nodes){let ie=this.fields[z];!ie||Reference.isRef(ie)||g.push(ie.asNestedTest({options:n,key:z,parent:m,parentPath:n.path,originalParent:c}))}this.runTests({tests:g,value:m,originalValue:c,options:n},a,z=>{s(z.sort(this._sortErrors).concat(y),m)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),a=n.fields;for(let[s,o]of Object.entries(this.fields)){const c=a[s];a[s]=c===void 0?o:c}return n.withMutation(s=>s.setFields(a,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(a=>{var s;const o=this.fields[a];let c=t;(s=c)!=null&&s.value&&(c=Object.assign({},c,{parent:c.value,value:c.value[a]})),n[a]=o&&"getDefault"in o?o.getDefault(c):void 0}),n}setFields(t,n){let a=this.clone();return a.fields=t,a._nodes=sortFields(t,n),a._sortErrors=sortByKeyOrder(Object.keys(t)),n&&(a._excludedEdges=n),a}shape(t,n=[]){return this.clone().withMutation(a=>{let s=a._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),s=[...a._excludedEdges,...n]),a.setFields(Object.assign(a.fields,t),s)})}partial(){const t={};for(const[n,a]of Object.entries(this.fields))t[n]="optional"in a&&a.optional instanceof Function?a.optional():a;return this.setFields(t)}deepPartial(){return deepPartial(this)}pick(t){const n={};for(const a of t)this.fields[a]&&(n[a]=this.fields[a]);return this.setFields(n,this._excludedEdges.filter(([a,s])=>t.includes(a)&&t.includes(s)))}omit(t){const n=[];for(const a of Object.keys(this.fields))t.includes(a)||n.push(a);return this.pick(n)}from(t,n,a){let s=propertyExprExports.getter(t,!0);return this.transform(o=>{if(!o)return o;let c=o;return deepHas(o,t)&&(c=Object.assign({},o),a||delete c[t],c[n]=s(o)),c})}json(){return this.transform(parseJson)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||object$1.exact,test(n){if(n==null)return!0;const a=unknown(this.schema,n);return a.length===0||this.createError({params:{properties:a.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=object$1.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let a=this.test({name:"noUnknown",exclusive:!0,message:n,test(s){if(s==null)return!0;const o=unknown(this.schema,s);return!t||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return a.spec.noUnknown=t,a}unknown(t=!0,n=object$1.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const a={};for(const s of Object.keys(n))a[t(s)]=n[s];return a})}camelCase(){return this.transformKeys(tinyCaseExports.camelCase)}snakeCase(){return this.transformKeys(tinyCaseExports.snakeCase)}constantCase(){return this.transformKeys(t=>tinyCaseExports.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),a=super.describe(t);a.fields={};for(const[o,c]of Object.entries(n.fields)){var s;let f=t;(s=f)!=null&&s.value&&(f=Object.assign({},f,{parent:f.value,value:f.value[o]})),a.fields[o]=c.describe(f)}return a}}create$3.prototype=ObjectSchema.prototype;function create$2(e){return new ArraySchema(e)}class ArraySchema extends Schema$1{constructor(t){super({type:"array",spec:{types:t},check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=t}_cast(t,n){const a=super._cast(t,n);if(!this._typeCheck(a)||!this.innerType)return a;let s=!1;const o=a.map((c,f)=>{const y=this.innerType.cast(c,Object.assign({},n,{path:`${n.path||""}[${f}]`}));return y!==c&&(s=!0),y});return s?o:a}_validate(t,n={},a,s){var o;let c=this.innerType,f=(o=n.recursive)!=null?o:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(t,n,a,(y,m)=>{var g;if(!f||!c||!this._typeCheck(m)){s(y,m);return}let z=new Array(m.length);for(let re=0;re<m.length;re++){var ie;z[re]=c.asNestedTest({options:n,index:re,parent:m,parentPath:n.path,originalParent:(ie=n.originalValue)!=null?ie:t})}this.runTests({value:m,tests:z,originalValue:(g=n.originalValue)!=null?g:t,options:n},a,re=>s(re.concat(y),m))})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}json(){return this.transform(parseJson)}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!isSchema(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+printValue(t));return n.innerType=t,n.spec=Object.assign({},n.spec,{types:t}),n}length(t,n=array$1.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(a){return a.length===this.resolve(t)}})}min(t,n){return n=n||array$1.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a.length>=this.resolve(t)}})}max(t,n){return n=n||array$1.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(a,s,o)=>!t(a,s,o):a=>!!a;return this.transform(a=>a!=null?a.filter(n):a)}describe(t){const n=(t?this.resolve(t):this).clone(),a=super.describe(t);if(n.innerType){var s;let o=t;(s=o)!=null&&s.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[0]})),a.innerType=n.innerType.describe(o)}return a}}create$2.prototype=ArraySchema.prototype;function create$4(e){return new Lazy(e)}function catchValidationError(e){try{return e()}catch(t){if(ValidationError.isError(t))return Promise.reject(t);throw t}}class Lazy{constructor(t){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(n,a={})=>{let s=this.builder(n,a);if(!isSchema(s))throw new TypeError("lazy() functions must return a valid schema");return this.spec.optional&&(s=s.optional()),s.resolve(a)},this.builder=t,this.spec={meta:void 0,optional:!1}}clone(t){const n=new Lazy(this.builder);return n.spec=Object.assign({},this.spec,t),n}optionality(t){return this.clone({optional:t})}optional(){return this.optionality(!0)}resolve(t){return this._resolve(t.value,t)}cast(t,n){return this._resolve(t,n).cast(t,n)}asNestedTest(t){let{key:n,index:a,parent:s,options:o}=t,c=s[a??n];return this._resolve(c,Object.assign({},o,{value:c,parent:s})).asNestedTest(t)}validate(t,n){return catchValidationError(()=>this._resolve(t,n).validate(t,n))}validateSync(t,n){return this._resolve(t,n).validateSync(t,n)}validateAt(t,n,a){return catchValidationError(()=>this._resolve(n,a).validateAt(t,n,a))}validateSyncAt(t,n,a){return this._resolve(n,a).validateSyncAt(t,n,a)}isValid(t,n){try{return this._resolve(t,n).isValid(t,n)}catch(a){if(ValidationError.isError(a))return Promise.resolve(!1);throw a}}isValidSync(t,n){return this._resolve(t,n).isValidSync(t,n)}describe(t){return t?this.resolve(t).describe(t):{type:"lazy",meta:this.spec.meta,label:void 0}}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(a){try{return{value:await t.validate(a,{abortEarly:!1})}}catch(s){if(ValidationError.isError(s))return{issues:issuesFromValidationError(s)};throw s}}}}}const configValidator=create$3().noUnknown().shape({client:create$3().noUnknown().shape({logo:create$6(),name:create$6()}),entrypoint:create$3().noUnknown().shape({account:create$6(),country:create$6(),credential:create$6(),site:create$6(),siteOrganizationType:create$6(),updateCredential:create$6()}),locale:create$6().oneOf(["es","en"]),navigation:create$3().noUnknown().shape({disableFormAutocomplete:create$7(),displayAccountsSelection:create$7(),displayBusinessSites:create$7(),displayCredentialInModal:create$7(),displayErrorsInToast:create$7(),displayLogoImages:create$7(),displayLongDescription:create$7(),displayPersonalSites:create$7(),displayPrivacyScreen:create$7(),displaySiteOrganizations:create$2().of(create$6()),displaySiteOrganizationTypes:create$2().of(create$6()),displaySites:create$2().of(create$6()),displayStatusInToast:create$7(),enableBackNavigation:create$7(),enableTwofaBackNavigation:create$7(),formButtonsDisabledStyle:create$7(),formShowPasswordStyle:create$6().oneOf(["icon","none","text"]),getSelectedAccounts:create$8().test("isFunction","${path} is not a function",e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!0),hideSelectCountry:create$7(),hideSiteOrganizations:create$2().of(create$6()),hideSiteOrganizationTypes:create$2().of(create$6()),hideSites:create$2().of(create$6()),oneSiteFlow:create$7(),quickAnswer:create$7(),returnToSiteFormOnUserError:create$4(e=>typeof e=="object"?create$2().of(create$5().oneOf([401,403,411])):create$7()),saveCredential:create$7(),selectClass:create$6(),socketTimeout:create$5().min(1),toastDuration:create$5().min(0),toastPosition:create$6().oneOf(["bottom-left","bottom-right","top-left","top-right"])}),__internal__:create$3().noUnknown().shape({apiBaseUrl:create$6(),apiEnv:create$6().oneOf(["development","production"]),assetsBaseUrl:create$6(),plaidSites:create$7(),defaultHttpParams:create$3()})}),paramsValidator=create$3().shape({token:create$6().required(),element:create$4(e=>{switch(typeof e){case"string":return create$6().test("isElement","${path} is not an Element",t=>{if(!document.querySelector(t))throw new ValidationError(`Invalid selector: Element "${t}" not found.`);return!0});case"object":return create$3().test("isElement","${path} is not an Element",t=>{if(!isElement$1(t))throw new ValidationError("Invalid element: Object should be a valid HtmlElement.");return!0});default:return create$6()}}),refreshTokenFunction:create$8().test("isFunction","${path} is not a function",e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!0),enableTestMode:create$7(),strict:create$3().noUnknown().nullable().shape({authorization:create$3().noUnknown().required().shape({type:create$6().oneOf(["jwk"]).required(),key:create$6().required()}),body:create$3().noUnknown().required().shape({type:create$6().oneOf(["jwk"]).required(),key:create$6().required().test("isBase64","${path} is not a base64 encoded",e=>e&&/^(?:[A-Za-z0-9+/]{2}[A-Za-z0-9+/]{2})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e))})}),config:configValidator}).strict().noUnknown();let __VERSION__={git:{hash:"ged753f6",distance:0,tag:"v1.3.0"}};function getVersion(){let e=`${__VERSION__.git.tag}.${__VERSION__.git.distance}`;return e=`${e}-${__VERSION__.git.hash}`,e}function getBridgeData(e,t){const n=parseInt("0x4",16),a="38060000000000000000000000000000000000000000000F00000000000000000000000000000000000D9802010000010101000000000000";let s;return getBridgeScripts$2().then(()=>(s=new digipass.nativebridge.DP110,new Promise((c,f)=>{s.onError(()=>f("bridge.not_ready")),s.onReady(y=>{if(y.versionCode<s.versionCode&&f("bridge.host_update_available"),s.isReady())s.getTokenInfo(n,function(g){if(g.returnCode!==0)return f(`bridge.${Math.abs(g.returnCode)}`);s.generateOTP(a,t,function(z){if(z.returnCode!==0)return f(`bridge.${Math.abs(z.returnCode)}`);c({token:`${e}XX${z.otp}XX${g.info}XX${y.versionCode}`,challenge:t})})});else return Promise.reject("bridge.not_ready")})})))}function getBridgeScripts$2(){const e=new Promise((n,a)=>{if(document.getElementById("widgetBridgeConfig"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeConfig"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.config.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_config_script_not_loaded")}}),t=new Promise((n,a)=>{if(document.getElementById("widgetBridgeUsb"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeUsb"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.dp110.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}function generateResponseOnlyOTP(){const e=window.bridgeBluetooth;if(e.timeoutValidation=!1,e.cryptoAppOTP=7,!e.bridge.isReady()){e.bridge.reconnect();return}clearTimeout(e.varSetTime),e.bridge.generateResponseOnlyOTP(e.cryptoAppOTP,function(t){t.returnCode!=0?(t.returnCode==-6014||t.returnCode==-6015||t.returnCode==-6016)&&turnOn(!1,!1):e.timeoutValidation||(e.validOTP=!0,e.valFinalFlow=!0,e.token=t.otp,e.acceptB?sendRequestDP785():(otpDP785ConnectedServices(),otpDP785Connected()))})}function getBridgeBluetoothFakeToken(e){const t=window.bridgeBluetooth;return new Promise((n,a)=>{t.resolve=n,t.reject=a,getSetTimeRequest(e)})}function getBridgeBluetoothFinalToken(e){const t=window.bridgeBluetooth;return new Promise((n,a)=>{t.resolve=n,t.reject=a,getChallengeResponseRequestContinue(e)})}function getBridgeBluetoothTimeChallengeV1(e,t){window.bridgeBluetooth={acceptB:null,accesLogin:!0,bridge:null,cancelB:!1,cancelB2:!1,changeIdNameOtp:!1,claveInsSegOTP:null,contNB:2,contNBReady:0,contNBVersion:0,cryptoAppOTP:null,digipassSerial:null,eai_firma_DP110:null,eai_serial_DP110:null,isChequeLineaOrSAT:null,jspDesafio:t,jspToken:e,nbProcessIsComplete:!1,resolve:null,reject:null,setTimeReady:!1,switchState:!0,timeoutValidation:!1,token:"",valFinalFlow:!1,validOTP:!1,varSetTime:null,versionCode:null};const n=window.bridgeBluetooth;return getBridgeScripts$1().then(()=>new Promise((s,o)=>{n.resolve=s,n.reject=o,initNativeBrigde()}))}function getBridgeScripts$1(){const e=new Promise((n,a)=>{if(document.getElementById("widgetBridgeConfig"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeConfig"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.config.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_config_script_not_loaded")}}),t=new Promise((n,a)=>{if(document.getElementById("widgetBridgeBluetooth"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeBluetooth"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.dptoken.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}function getChallengeResponseRequest(){const e=window.bridgeBluetooth;e.accesLogin&&(e.cancelB||(e.valFinalFlow=!0,e.token="********",e.resolve(e.token)),e.accesLogin=!1)}function getChallengeResponseRequestContinue(e){const t=window.bridgeBluetooth,n=JSON.parse(e);n.estado!=="OK"||t.cancelB2||processRequestMessage(n.requestMessage)}function getSetTimeRequest(e){const t=JSON.parse(e);t.estado!=="OK"||processRequestMessageSetTime(t.requestMessage)}function initializeDigipass$1(){const e=window.bridgeBluetooth;if(!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.initializeDigipass(e.digipassSerial,function(t){t.returnCode!=0||e.bridge.getDigipassTimeChallenge(function(n){n.returnCode!=0?timeEvents(function(){e.switchState&&listDigipass()},5e3,"timeOut"):(clearTimeout(e.varSetTime),e.timeoutValidation=!1,e.setTimeReady?getChallengeResponseRequest():setDPTime())})})}function initNativeBrigde(){const e=window.bridgeBluetooth;try{e.bridge=new digipass.nativebridge.DPToken,e.bridge.getDigipassTimeChallenge(function(){turnOn(!0,!1)}),e.bridge.onError(function(){e.contNB++,e.nbProcessIsComplete||e.contNB<=4&&(e.accesLogin?e.bridge.reconnect():e.bridge.getDigipassTimeChallenge(function(){}))}),e.bridge.onReady(function(){clearTimeout(e.varSetTime),e.contNB=0,e.contNBReady===0&&(e.validOTP||(timeEvents(function(){e.timeoutValidation=!0},3e4,"timeOut"),e.switchState&&listDigipass()),e.contNBReady++)})}catch(t){e.reject(t)}}function listDigipass(){const e=window.bridgeBluetooth;if(e.digipassSerial=null,!e.bridge.isReady()){e.bridge.reconnect();return}if(e.contNBVersion===0&&e.bridge.getNativeBridgeVersion(function(t){e.versionCode=t.versionCode,e.contNBVersion++}),!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.getDigipassList(function(t){e.timeoutValidation||t.returnCode!=0||(t.devices.length==0?e.switchState&&listDigipass():(t.devices.forEach(n=>{n.digipassSerial===e.jspToken&&(e.digipassSerial=n.digipassSerial,e.jspDesafio!=="null"&&(e.eai_serial_DP110=e.jspToken))}),e.digipassSerial===null?e.switchState&&listDigipass():e.timeoutValidation||initializeDigipass$1()))})}function otpDP785Connected(){const e=window.bridgeBluetooth;if(e.switchState){let t="";e.token!==void 0?(t=e.token,e.token=t+e.cryptoAppOTP):(t=e.claveInsSegOTP,e.claveInsSegOTP=t+e.cryptoAppOTP)}e.resolve(`${e.token}XX${e.eai_firma_DP110}XX${e.eai_serial_DP110}XX${e.versionCode}`)}function otpDP785ConnectedServices(){const e=window.bridgeBluetooth;e.changeIdNameOtp=!0}function otpDP785DisconnectedServices(){const e=window.bridgeBluetooth;e.changeIdNameOtp=!1}function parseResponseMessage(e,t){const n=window.bridgeBluetooth;if(!n.bridge.isReady()){n.bridge.reconnect();return}n.bridge.parseResponseMessage(e,t,function(a){a.returnCode!=0?(a.returnCode==-6014||a.returnCode==-6015||a.returnCode==-6016)&&turnOn(!1,!1):n.timeoutValidation||(n.validOTP=!0,n.jspDesafio!=="null"&&(n.eai_firma_DP110=a.messageSignature),generateResponseOnlyOTP())})}function parseResponseMessageSetTime(e,t){const n=window.bridgeBluetooth;if(!n.bridge.isReady()){n.bridge.reconnect();return}n.bridge.parseResponseMessage(e,t,function(a){a.returnCode!=0||(n.setTimeReady=!0,getChallengeResponseRequest())})}function processRequestMessage(e){const t=window.bridgeBluetooth;if(!t.bridge.isReady()){t.bridge.reconnect();return}t.bridge.transmitRequestMessage(e,function(n){n.returnCode!=0||parseResponseMessage(n.responseMessage,e)})}function processRequestMessageSetTime(e){const t=window.bridgeBluetooth;if(!t.bridge.isReady()){t.bridge.reconnect();return}t.bridge.transmitRequestMessage(e,function(n){n.returnCode!=0||parseResponseMessageSetTime(n.responseMessage,e)})}function sendRequestDP785(){const e=window.bridgeBluetooth;clearTimeout(e.varSetTime),otpDP785Connected()}function setDPTime(){const e=window.bridgeBluetooth;if(!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.getDigipassTimeChallenge(function(t){t.returnCode!=0||e.resolve(t.timeChallenge)})}function timeEvents(e,t,n){const a=window.bridgeBluetooth;switch(n){case"timeOut":a.varSetTime=setTimeout(e,t);break;case"interval":setInterval(e,t);break}}function turnOn(e,t){const n=window.bridgeBluetooth,a="";if(n.timeoutValidation=!1,n.acceptB=t,clearTimeout(n.varSetTime),n.token.length!=8&&!t&&(n.validOTP=!1),t||(n.switchState=e),e)if(n.contNBVersion=0,n.valFinalFlow=!1,t||(n.accesLogin=!0,n.cancelB=!1),n.validOTP)sendRequestDP785(),n.valFinalFlow=!0;else{if(n.contNBVersion=0,n.cancelB2=!1,n.contNB=2,t||(n.token=a),n.bridge===void 0&&initNativeBrigde(),!n.bridge.isReady()){n.bridge.reconnect();return}clearTimeout(n.varSetTime),timeEvents(function(){n.timeoutValidation=!0},3e4,"timeOut"),n.contNBReady!==0?listDigipass():n.bridge.reconnect()}else clearTimeout(n.varSetTime),n.validOTP=!0,n.cancelB=!0,n.cancelB2=!0,otpDP785DisconnectedServices(),n.claveInsSegOTP=a,n.token=a}function turnOnBridgeBluetoothBeforeSendingTwofa(){turnOn(!0,!0)}const appStateWindowProperty="bridgeBluetooth";function continueDPToken(e){const t=window[appStateWindowProperty];return new Promise((a,s)=>{t.resolve=a,t.reject=s;let o,c;const{authenticationData:f}=e.authenticationResponse;f[0].idAuthenticationData==="signedMessage"?([o]=f[0].authenticationData,[c]=f[1].authenticationData):([o]=f[1].authenticationData,[c]=f[0].authenticationData),secondPartDPToken({signedMessage:o,signedTimeMessage:c})})}async function generateTimeChallenge(){const e=window[appStateWindowProperty];return new Promise(async(t,n)=>{if(e.nativeBridgeInstance.isReady())try{const a=await async function(s){return new Promise((o,c)=>{s.getDigipassTimeChallenge(f=>{if(f.returnCode!==0){const m={title:"Generar - TimeChallenge",response:{message:"Se ha producido un error al generar el TimeChallenge. Por favor, asegúrate de tener tu token conectado y encendido.",returnCode:f.returnCode}};return void c(m)}const y={title:"Generar - TimeChallenge",response:{message:`El TimeChallenge es: ${f.timeChallenge}`,timeChallenge:f.timeChallenge,errorCode:""}};o(y)})})}(e.nativeBridgeInstance);t(a)}catch(a){n(a)}else n({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:""}})})}function getBridgeBluetoothTimeChallengeV2(e){window[appStateWindowProperty]={isDp785Signature:!1,nativeBridgeInstance:null,resolve:null,reject:null};const t=window[appStateWindowProperty];return getBridgeScripts().then(()=>new Promise((a,s)=>{t.resolve=a,t.reject=s,t.isDp785Signature=e!=="214",t.nativeBridgeInstance=new window.digipass.nativebridge.DPToken,onProcessDPToken()}))}function getBridgeScripts(){const e=new Promise((n,a)=>{if(document.getElementById("widgetBridgeConfig"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeConfig"),s.setAttribute("src","undefineddigipass.nativebridge.config.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_config_script_not_loaded")}}),t=new Promise((n,a)=>{if(document.getElementById("widgetBridgeBluetooth"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeBluetooth"),s.setAttribute("src","undefineddigipass.nativebridge.dptoken.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}async function initDPToken(){const e=window[appStateWindowProperty];try{const t=await initializeDevice(e.isDp785Signature);if(t.length===1){const[n]=t;await initializeDigipass(n.serial);const a=await generateTimeChallenge();e.resolve(a.response.timeChallenge)}}catch(t){e.reject(t),alert("Por favor, asegúrate de tener tu token conectado y encendido.")}}async function initializeDevice(e){const t=window[appStateWindowProperty];return new Promise(async(n,a)=>{const s=e?"DP785_T4_MANUAL":"DP785_T4_NOT_LINKED";if(t.nativeBridgeInstance.isReady())try{const o=await async function(y){return new Promise((m,g)=>{y.getDigipassList(z=>{if(z.returnCode===0)m(z.devices);else{const ie={title:"Listar dispositivos",response:{message:"Error al obtener la lista de dispositivos disponibles.",returnCode:z.returnCode}};g(ie)}})})}(t.nativeBridgeInstance),c=o.map(y=>({name:y.deviceName,serial:y.digipassSerial})),[f]=c;if(!f||!f.serial)return void a({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:s}});n(c)}catch(o){a(o)}else a({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:s}})})}async function initializeDigipass(e){const t=window[appStateWindowProperty];return new Promise((n,a)=>{t.nativeBridgeInstance.initializeDigipass(e,s=>{if(s.returnCode!==0){const c={title:"Inicializar dispositivo",response:{message:"Error al intentar inicializar el dispositivo.",returnCode:s.returnCode}};return void a(c)}const o={title:"Inicializar dispositivo",response:{message:`El dispositivo con serial: ${e} está listo para ser usado.`,errorCode:""}};n(o)})})}async function generateResponseOnlyOTPBridge(e){const t=window[appStateWindowProperty];return new Promise(async(n,a)=>{if(t.nativeBridgeInstance.isReady())try{const s=await async function(o,c){return new Promise((f,y)=>{o.generateResponseOnlyOTP(c,m=>{if(m.returnCode!==0){const z={title:"Generar OTP con PIN",response:{message:"No fue posible generar la OTP.",returnCode:m.returnCode}};return void y(z)}const g={title:"Generar OTP con PIN",response:{message:`La OTP se generó correctamente: ${m.otp}`,otp:m.otp,errorCode:"",processType:"DP785_T4_LINKED"}};f(g)})})}(t.nativeBridgeInstance,e);n(s)}catch(s){a(s)}else a({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:"DP785_T4_NOT_LINKED"}})})}async function onProcessDPToken(){const e=window[appStateWindowProperty],t=await startNativeBridgeValidation();if(t.response.errorCode!==""){alert(t.response.message),e.reject(t.response.errorCode);return}else await initDPToken()}async function secondPartDPToken({signedMessage:e="",signedTimeMessage:t=""}){const n=window[appStateWindowProperty];try{await transmitRequestMessageBridge(t,n.isDp785Signature);const a=await transmitRequestMessageBridge(e,n.isDp785Signature),{response:{messageSignature:s}}=a,o=7,c=await generateResponseOnlyOTPBridge(o),{response:{otp:f}}=c,y={};y.otpChallenge=s;const m=`${f}${o}`;y.otp=m,n.resolve(`${y.otpChallenge}XX${y.otp}`)}catch(a){n.reject(a),alert("Error al intentar validar la sesión desde el dispositivo de acceso seguro.")}}async function startNativeBridgeValidation(){const e=window[appStateWindowProperty];return new Promise((t,n)=>{e.nativeBridgeInstance.onReady(()=>{e.nativeBridgeInstance.getNativeBridgeVersion(a=>{const s={title:"Conexión con Native Bridge",response:{errorCode:"",message:"El software Native Bridge se encuentra instalado en tu ordenador.",updateAvailable:!(a.versionCode>=e.nativeBridgeInstance.versionCode)}};t(s)})}),e.nativeBridgeInstance.onError(()=>{n({title:"Conexión con Native Bridge",response:{errorCode:"222",message:"El software Native Bridge no se encontró instalado en tu ordenador.",processType:"DP785_T4_NOT_LINKED"}})})})}async function transmitRequestMessageBridge(e,t){const n=window[appStateWindowProperty];return new Promise(async(a,s)=>{const o=t?"DP785_T4_MANUAL":"DP785_T4_NOT_LINKED";if(n.nativeBridgeInstance.isReady())try{const{responseMessage:c}=await async function(y,m){return new Promise((g,z)=>{y.transmitRequestMessage(m,ie=>{if(ie.returnCode===0)g(ie);else{const re={title:"Firmar mensaje",response:{message:"No fue posible transmitir el mensaje.",returnCode:ie.returnCode}};z(re)}})})}(n.nativeBridgeInstance,e),f=await async function(y,m,g){return new Promise((z,ie)=>{y.parseResponseMessage(m,g,re=>{if(re.returnCode!==0){const _e={title:"Firmar mensaje",response:{message:"No fue posible parsear el mensaje.",returnCode:re.returnCode}};return void ie(_e)}const he={title:"Firmar mensaje",response:{message:`Se realizó la firma del mensaje correctamente: ${re.messageSignature}`,messageSignature:re.messageSignature,errorCode:"",processType:"DP785_T4_LINKED"}};z(he)})})}(n.nativeBridgeInstance,c,e);a(f)}catch(c){s(c)}else s({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:o}})})}const DOWNLOAD_OPTIONS_ACTIVE={enables:["download_options"],name:"download_options_active",required:!1,translate_label:"download_options.switch",type:"switch",validation:null},DOWNLOAD_OPTIONS={name:"download_options",required:!1,enabled_by:"download_options_active",translate_error_label:"download_options.label",type:"date_range",validation:null},DOWNLOAD_OPTIONS_SITES=["56cf5728784806f72b8b456f","5da784f1f9de2a06483abec1"];var buffer$2={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup[45]=62,revLookup[95]=63;function getLens(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var a=n===t?0:4-n%4;return[n,a]}function byteLength(e){var t=getLens(e),n=t[0],a=t[1];return(n+a)*3/4-a}function _byteLength(e,t,n){return(t+n)*3/4-n}function toByteArray(e){var t,n=getLens(e),a=n[0],s=n[1],o=new Arr(_byteLength(e,a,s)),c=0,f=s>0?a-4:a,y;for(y=0;y<f;y+=4)t=revLookup[e.charCodeAt(y)]<<18|revLookup[e.charCodeAt(y+1)]<<12|revLookup[e.charCodeAt(y+2)]<<6|revLookup[e.charCodeAt(y+3)],o[c++]=t>>16&255,o[c++]=t>>8&255,o[c++]=t&255;return s===2&&(t=revLookup[e.charCodeAt(y)]<<2|revLookup[e.charCodeAt(y+1)]>>4,o[c++]=t&255),s===1&&(t=revLookup[e.charCodeAt(y)]<<10|revLookup[e.charCodeAt(y+1)]<<4|revLookup[e.charCodeAt(y+2)]>>2,o[c++]=t>>8&255,o[c++]=t&255),o}function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[e&63]}function encodeChunk(e,t,n){for(var a,s=[],o=t;o<n;o+=3)a=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),s.push(tripletToBase64(a));return s.join("")}function fromByteArray(e){for(var t,n=e.length,a=n%3,s=[],o=16383,c=0,f=n-a;c<f;c+=o)s.push(encodeChunk(e,c,c+o>f?f:c+o));return a===1?(t=e[n-1],s.push(lookup[t>>2]+lookup[t<<4&63]+"==")):a===2&&(t=(e[n-2]<<8)+e[n-1],s.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),s.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function(e,t,n,a,s){var o,c,f=s*8-a-1,y=(1<<f)-1,m=y>>1,g=-7,z=n?s-1:0,ie=n?-1:1,re=e[t+z];for(z+=ie,o=re&(1<<-g)-1,re>>=-g,g+=f;g>0;o=o*256+e[t+z],z+=ie,g-=8);for(c=o&(1<<-g)-1,o>>=-g,g+=a;g>0;c=c*256+e[t+z],z+=ie,g-=8);if(o===0)o=1-m;else{if(o===y)return c?NaN:(re?-1:1)*(1/0);c=c+Math.pow(2,a),o=o-m}return(re?-1:1)*c*Math.pow(2,o-a)},ieee754.write=function(e,t,n,a,s,o){var c,f,y,m=o*8-s-1,g=(1<<m)-1,z=g>>1,ie=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,re=a?0:o-1,he=a?1:-1,_e=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,c=g):(c=Math.floor(Math.log(t)/Math.LN2),t*(y=Math.pow(2,-c))<1&&(c--,y*=2),c+z>=1?t+=ie/y:t+=ie*Math.pow(2,1-z),t*y>=2&&(c++,y/=2),c+z>=g?(f=0,c=g):c+z>=1?(f=(t*y-1)*Math.pow(2,s),c=c+z):(f=t*Math.pow(2,z-1)*Math.pow(2,s),c=0));s>=8;e[n+re]=f&255,re+=he,f/=256,s-=8);for(c=c<<s|f,m+=s;m>0;e[n+re]=c&255,re+=he,c/=256,m-=8);e[n+re-he]|=_e*128};/*!
680
680
  * The buffer module from node.js, for the browser.
681
681
  *
682
682
  * @author Feross Aboukhadijeh <https://feross.org>
@@ -869,9 +869,9 @@ For more detail, please visit: ${s}
869
869
  (?:`+a+":){1}(?:(?::"+a+"){0,4}:"+n+"|(?::"+a+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
870
870
  (?::(?:(?::`+a+"){0,5}:"+n+"|(?::"+a+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
871
871
  )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
872
- `).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),o=new RegExp("(?:^"+n+"$)|(?:^"+s+"$)"),c=new RegExp("^"+n+"$"),f=new RegExp("^"+s+"$"),y=function(qe){return qe&&qe.exact?o:new RegExp("(?:"+t(qe)+n+t(qe)+")|(?:"+t(qe)+s+t(qe)+")","g")};y.v4=function(Oe){return Oe&&Oe.exact?c:new RegExp(""+t(Oe)+n+t(Oe),"g")},y.v6=function(Oe){return Oe&&Oe.exact?f:new RegExp(""+t(Oe)+s+t(Oe),"g")};var m="(?:(?:[a-z]+:)?//)",g="(?:\\S+(?::\\S*)?@)?",z=y.v4().source,ie=y.v6().source,re="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",he="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",_e="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",$e="(?::\\d{2,5})?",pe='(?:[/?#][^\\s"]*)?',Ce="(?:"+m+"|www\\.)"+g+"(?:localhost|"+z+"|"+ie+"|"+re+he+_e+")"+$e+pe;return urlReg=new RegExp("(?:^"+Ce+"$)","i"),urlReg},pattern$2={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},types={integer:function e(t){return types.number(t)&&parseInt(t,10)===t},float:function e(t){return types.number(t)&&!types.integer(t)},array:function e(t){return Array.isArray(t)},regexp:function e(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function e(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function e(t){return isNaN(t)?!1:typeof t=="number"},object:function e(t){return typeof t=="object"&&!types.array(t)},method:function e(t){return typeof t=="function"},email:function e(t){return typeof t=="string"&&t.length<=320&&!!t.match(pattern$2.email)},url:function e(t){return typeof t=="string"&&t.length<=2048&&!!t.match(getUrlRegex())},hex:function e(t){return typeof t=="string"&&!!t.match(pattern$2.hex)}},type$1=function e(t,n,a,s,o){if(t.required&&n===void 0){required$1(t,n,a,s,o);return}var c=["integer","float","array","regexp","object","method","email","number","date","url","hex"],f=t.type;c.indexOf(f)>-1?types[f](n)||s.push(format(o.messages.types[f],t.fullField,t.type)):f&&typeof n!==t.type&&s.push(format(o.messages.types[f],t.fullField,t.type))},range=function e(t,n,a,s,o){var c=typeof t.len=="number",f=typeof t.min=="number",y=typeof t.max=="number",m=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,g=n,z=null,ie=typeof n=="number",re=typeof n=="string",he=Array.isArray(n);if(ie?z="number":re?z="string":he&&(z="array"),!z)return!1;he&&(g=n.length),re&&(g=n.replace(m,"_").length),c?g!==t.len&&s.push(format(o.messages[z].len,t.fullField,t.len)):f&&!y&&g<t.min?s.push(format(o.messages[z].min,t.fullField,t.min)):y&&!f&&g>t.max?s.push(format(o.messages[z].max,t.fullField,t.max)):f&&y&&(g<t.min||g>t.max)&&s.push(format(o.messages[z].range,t.fullField,t.min,t.max))},ENUM$1="enum",enumerable$1=function e(t,n,a,s,o){t[ENUM$1]=Array.isArray(t[ENUM$1])?t[ENUM$1]:[],t[ENUM$1].indexOf(n)===-1&&s.push(format(o.messages[ENUM$1],t.fullField,t[ENUM$1].join(", ")))},pattern$1=function e(t,n,a,s,o){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||s.push(format(o.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var c=new RegExp(t.pattern);c.test(n)||s.push(format(o.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},rules={required:required$1,whitespace,type:type$1,range,enum:enumerable$1,pattern:pattern$1},string=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n,"string")&&!t.required)return a();rules.required(t,n,s,c,o,"string"),isEmptyValue(n,"string")||(rules.type(t,n,s,c,o),rules.range(t,n,s,c,o),rules.pattern(t,n,s,c,o),t.whitespace===!0&&rules.whitespace(t,n,s,c,o))}a(c)},method=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),n!==void 0&&rules.type(t,n,s,c,o)}a(c)},number=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(n===""&&(n=void 0),isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),n!==void 0&&(rules.type(t,n,s,c,o),rules.range(t,n,s,c,o))}a(c)},_boolean=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),n!==void 0&&rules.type(t,n,s,c,o)}a(c)},regexp=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),isEmptyValue(n)||rules.type(t,n,s,c,o)}a(c)},integer=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),n!==void 0&&(rules.type(t,n,s,c,o),rules.range(t,n,s,c,o))}a(c)},floatFn=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),n!==void 0&&(rules.type(t,n,s,c,o),rules.range(t,n,s,c,o))}a(c)},array=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(n==null&&!t.required)return a();rules.required(t,n,s,c,o,"array"),n!=null&&(rules.type(t,n,s,c,o),rules.range(t,n,s,c,o))}a(c)},object=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),n!==void 0&&rules.type(t,n,s,c,o)}a(c)},ENUM="enum",enumerable=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),n!==void 0&&rules[ENUM](t,n,s,c,o)}a(c)},pattern=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n,"string")&&!t.required)return a();rules.required(t,n,s,c,o),isEmptyValue(n,"string")||rules.pattern(t,n,s,c,o)}a(c)},date=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n,"date")&&!t.required)return a();if(rules.required(t,n,s,c,o),!isEmptyValue(n,"date")){var y;n instanceof Date?y=n:y=new Date(n),rules.type(t,y,s,c,o),y&&rules.range(t,y.getTime(),s,c,o)}}a(c)},required=function e(t,n,a,s,o){var c=[],f=Array.isArray(n)?"array":typeof n;rules.required(t,n,s,c,o,f),a(c)},type=function e(t,n,a,s,o){var c=t.type,f=[],y=t.required||!t.required&&s.hasOwnProperty(t.field);if(y){if(isEmptyValue(n,c)&&!t.required)return a();rules.required(t,n,s,f,o,c),isEmptyValue(n,c)||rules.type(t,n,s,f,o)}a(f)},any=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o)}a(c)},validators$2={string,method,number,boolean:_boolean,regexp,integer,float:floatFn,array,object,enum:enumerable,pattern,date,url:type,hex:type,email:type,required,any};function newMessages(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var messages=newMessages(),Schema=function(){function e(n){this.rules=null,this._messages=messages,this.define(n)}var t=e.prototype;return t.define=function(a){var s=this;if(!a)throw new Error("Cannot configure a schema with no rules");if(typeof a!="object"||Array.isArray(a))throw new Error("Rules must be an object");this.rules={},Object.keys(a).forEach(function(o){var c=a[o];s.rules[o]=Array.isArray(c)?c:[c]})},t.messages=function(a){return a&&(this._messages=deepMerge(newMessages(),a)),this._messages},t.validate=function(a,s,o){var c=this;s===void 0&&(s={}),o===void 0&&(o=function(){});var f=a,y=s,m=o;if(typeof y=="function"&&(m=y,y={}),!this.rules||Object.keys(this.rules).length===0)return m&&m(null,f),Promise.resolve(f);function g(_e){var $e=[],pe={};function Ce(qe){if(Array.isArray(qe)){var At;$e=(At=$e).concat.apply(At,qe)}else $e.push(qe)}for(var Oe=0;Oe<_e.length;Oe++)Ce(_e[Oe]);$e.length?(pe=convertFieldsError($e),m($e,pe)):m(null,f)}if(y.messages){var z=this.messages();z===messages&&(z=newMessages()),deepMerge(z,y.messages),y.messages=z}else y.messages=this.messages();var ie={},re=y.keys||Object.keys(this.rules);re.forEach(function(_e){var $e=c.rules[_e],pe=f[_e];$e.forEach(function(Ce){var Oe=Ce;typeof Oe.transform=="function"&&(f===a&&(f=_extends({},f)),pe=f[_e]=Oe.transform(pe)),typeof Oe=="function"?Oe={validator:Oe}:Oe=_extends({},Oe),Oe.validator=c.getValidationMethod(Oe),Oe.validator&&(Oe.field=_e,Oe.fullField=Oe.fullField||_e,Oe.type=c.getType(Oe),ie[_e]=ie[_e]||[],ie[_e].push({rule:Oe,value:pe,source:f,field:_e}))})});var he={};return asyncMap(ie,y,function(_e,$e){var pe=_e.rule,Ce=(pe.type==="object"||pe.type==="array")&&(typeof pe.fields=="object"||typeof pe.defaultField=="object");Ce=Ce&&(pe.required||!pe.required&&_e.value),pe.field=_e.field;function Oe(Et,ze){return _extends({},ze,{fullField:pe.fullField+"."+Et,fullFields:pe.fullFields?[].concat(pe.fullFields,[Et]):[Et]})}function qe(Et){Et===void 0&&(Et=[]);var ze=Array.isArray(Et)?Et:[Et];!y.suppressWarning&&ze.length&&e.warning("async-validator:",ze),ze.length&&pe.message!==void 0&&(ze=[].concat(pe.message));var kt=ze.map(complementError(pe,f));if(y.first&&kt.length)return he[pe.field]=1,$e(kt);if(!Ce)$e(kt);else{if(pe.required&&!_e.value)return pe.message!==void 0?kt=[].concat(pe.message).map(complementError(pe,f)):y.error&&(kt=[y.error(pe,format(y.messages.required,pe.field))]),$e(kt);var Pt={};pe.defaultField&&Object.keys(_e.value).map(function(u){Pt[u]=pe.defaultField}),Pt=_extends({},Pt,_e.rule.fields);var jt={};Object.keys(Pt).forEach(function(u){var v=Pt[u],Y=Array.isArray(v)?v:[v];jt[u]=Y.map(Oe.bind(null,u))});var Ie=new e(jt);Ie.messages(y.messages),_e.rule.options&&(_e.rule.options.messages=y.messages,_e.rule.options.error=y.error),Ie.validate(_e.value,_e.rule.options||y,function(u){var v=[];kt&&kt.length&&v.push.apply(v,kt),u&&u.length&&v.push.apply(v,u),$e(v.length?v:null)})}}var At;if(pe.asyncValidator)At=pe.asyncValidator(pe,_e.value,qe,_e.source,y);else if(pe.validator){try{At=pe.validator(pe,_e.value,qe,_e.source,y)}catch(Et){console.error==null||console.error(Et),y.suppressValidatorError||setTimeout(function(){throw Et},0),qe(Et.message)}At===!0?qe():At===!1?qe(typeof pe.message=="function"?pe.message(pe.fullField||pe.field):pe.message||(pe.fullField||pe.field)+" fails"):At instanceof Array?qe(At):At instanceof Error&&qe(At.message)}At&&At.then&&At.then(function(){return qe()},function(Et){return qe(Et)})},function(_e){g(_e)},f)},t.getType=function(a){if(a.type===void 0&&a.pattern instanceof RegExp&&(a.type="pattern"),typeof a.validator!="function"&&a.type&&!validators$2.hasOwnProperty(a.type))throw new Error(format("Unknown rule type %s",a.type));return a.type||"string"},t.getValidationMethod=function(a){if(typeof a.validator=="function")return a.validator;var s=Object.keys(a),o=s.indexOf("message");return o!==-1&&s.splice(o,1),s.length===1&&s[0]==="required"?validators$2.required:validators$2[this.getType(a)]||void 0},e}();Schema.register=function e(t,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");validators$2[t]=n},Schema.warning=warning,Schema.messages=messages,Schema.validators=validators$2;const formItemValidateStates=["","error","validating","success"],formItemProps=buildProps({label:String,labelWidth:{type:[String,Number],default:""},labelPosition:{type:String,values:["left","right","top",""],default:""},prop:{type:definePropType([String,Array])},required:{type:Boolean,default:void 0},rules:{type:definePropType([Object,Array])},error:String,validateStatus:{type:String,values:formItemValidateStates},for:String,inlineMessage:{type:[String,Boolean],default:""},showMessage:{type:Boolean,default:!0},size:{type:String,values:componentSizes}}),COMPONENT_NAME$5="ElLabelWrap";var FormLabelWrap=defineComponent({name:COMPONENT_NAME$5,props:{isAutoWidth:Boolean,updateAll:Boolean},setup(e,{slots:t}){const n=inject(formContextKey,void 0),a=inject(formItemContextKey);a||throwError(COMPONENT_NAME$5,"usage: <el-form-item><label-wrap /></el-form-item>");const s=useNamespace("form"),o=ref(),c=ref(0),f=()=>{var g;if((g=o.value)!=null&&g.firstElementChild){const z=window.getComputedStyle(o.value.firstElementChild).width;return Math.ceil(Number.parseFloat(z))}else return 0},y=(g="update")=>{nextTick(()=>{t.default&&e.isAutoWidth&&(g==="update"?c.value=f():g==="remove"&&(n==null||n.deregisterLabelWidth(c.value)))})},m=()=>y("update");return onMounted(()=>{m()}),onBeforeUnmount(()=>{y("remove")}),onUpdated(()=>m()),watch(c,(g,z)=>{e.updateAll&&(n==null||n.registerLabelWidth(g,z))}),useResizeObserver(computed(()=>{var g,z;return(z=(g=o.value)==null?void 0:g.firstElementChild)!=null?z:null}),m),()=>{var g,z;if(!t)return null;const{isAutoWidth:ie}=e;if(ie){const re=n==null?void 0:n.autoLabelWidth,he=a==null?void 0:a.hasLabel,_e={};if(he&&re&&re!=="auto"){const $e=Math.max(0,Number.parseInt(re,10)-c.value),Ce=(a.labelPosition||n.labelPosition)==="left"?"marginRight":"marginLeft";$e&&(_e[Ce]=`${$e}px`)}return createVNode("div",{ref:o,class:[s.be("item","label-wrap")],style:_e},[(g=t.default)==null?void 0:g.call(t)])}else return createVNode(Fragment,{ref:o},[(z=t.default)==null?void 0:z.call(t)])}}});const __default__$7=defineComponent({name:"ElFormItem"}),_sfc_main$t=defineComponent({...__default__$7,props:formItemProps,setup(e,{expose:t}){const n=e,a=useSlots(),s=inject(formContextKey,void 0),o=inject(formItemContextKey,void 0),c=useFormSize(void 0,{formItem:!1}),f=useNamespace("form-item"),y=useId().value,m=ref([]),g=ref(""),z=refDebounced(g,100),ie=ref(""),re=ref();let he,_e=!1;const $e=computed(()=>n.labelPosition||(s==null?void 0:s.labelPosition)),pe=computed(()=>{if($e.value==="top")return{};const fr=addUnit(n.labelWidth||(s==null?void 0:s.labelWidth)||"");return fr?{width:fr}:{}}),Ce=computed(()=>{if($e.value==="top"||s!=null&&s.inline)return{};if(!n.label&&!n.labelWidth&&jt)return{};const fr=addUnit(n.labelWidth||(s==null?void 0:s.labelWidth)||"");return!n.label&&!a.label?{marginLeft:fr}:{}}),Oe=computed(()=>[f.b(),f.m(c.value),f.is("error",g.value==="error"),f.is("validating",g.value==="validating"),f.is("success",g.value==="success"),f.is("required",ae.value||n.required),f.is("no-asterisk",s==null?void 0:s.hideRequiredAsterisk),(s==null?void 0:s.requireAsteriskPosition)==="right"?"asterisk-right":"asterisk-left",{[f.m("feedback")]:s==null?void 0:s.statusIcon,[f.m(`label-${$e.value}`)]:$e.value}]),qe=computed(()=>isBoolean$1(n.inlineMessage)?n.inlineMessage:(s==null?void 0:s.inlineMessage)||!1),At=computed(()=>[f.e("error"),{[f.em("error","inline")]:qe.value}]),Et=computed(()=>n.prop?isString$5(n.prop)?n.prop:n.prop.join("."):""),ze=computed(()=>!!(n.label||a.label)),kt=computed(()=>{var fr;return(fr=n.for)!=null?fr:m.value.length===1?m.value[0]:void 0}),Pt=computed(()=>!kt.value&&ze.value),jt=!!o,Ie=computed(()=>{const fr=s==null?void 0:s.model;if(!(!fr||!n.prop))return getProp(fr,n.prop).value}),u=computed(()=>{const{required:fr}=n,Cr=[];n.rules&&Cr.push(...castArray$1(n.rules));const Mr=s==null?void 0:s.rules;if(Mr&&n.prop){const xr=getProp(Mr,n.prop).value;xr&&Cr.push(...castArray$1(xr))}if(fr!==void 0){const xr=Cr.map((gr,dr)=>[gr,dr]).filter(([gr])=>Object.keys(gr).includes("required"));if(xr.length>0)for(const[gr,dr]of xr)gr.required!==fr&&(Cr[dr]={...gr,required:fr});else Cr.push({required:fr})}return Cr}),v=computed(()=>u.value.length>0),Y=fr=>u.value.filter(Mr=>!Mr.trigger||!fr?!0:isArray$4(Mr.trigger)?Mr.trigger.includes(fr):Mr.trigger===fr).map(({trigger:Mr,...xr})=>xr),ae=computed(()=>u.value.some(fr=>fr.required)),xe=computed(()=>{var fr;return z.value==="error"&&n.showMessage&&((fr=s==null?void 0:s.showMessage)!=null?fr:!0)}),Ve=computed(()=>`${n.label||""}${(s==null?void 0:s.labelSuffix)||""}`),Ue=fr=>{g.value=fr},Ne=fr=>{var Cr,Mr;const{errors:xr,fields:gr}=fr;(!xr||!gr)&&console.error(fr),Ue("error"),ie.value=xr?(Mr=(Cr=xr==null?void 0:xr[0])==null?void 0:Cr.message)!=null?Mr:`${n.prop} is required`:"",s==null||s.emit("validate",n.prop,!1,ie.value)},L=()=>{Ue("success"),s==null||s.emit("validate",n.prop,!0,"")},Fe=async fr=>{const Cr=Et.value;return new Schema({[Cr]:fr}).validate({[Cr]:Ie.value},{firstFields:!0}).then(()=>(L(),!0)).catch(xr=>(Ne(xr),Promise.reject(xr)))},Dt=async(fr,Cr)=>{if(_e||!n.prop)return!1;const Mr=isFunction$4(Cr);if(!v.value)return Cr==null||Cr(!1),!1;const xr=Y(fr);return xr.length===0?(Cr==null||Cr(!0),!0):(Ue("validating"),Fe(xr).then(()=>(Cr==null||Cr(!0),!0)).catch(gr=>{const{fields:dr}=gr;return Cr==null||Cr(!1,dr),Mr?!1:Promise.reject(dr)}))},er=()=>{Ue(""),ie.value="",_e=!1},ir=async()=>{const fr=s==null?void 0:s.model;if(!fr||!n.prop)return;const Cr=getProp(fr,n.prop);_e=!0,Cr.value=clone(he),await nextTick(),er(),_e=!1},cr=fr=>{m.value.includes(fr)||m.value.push(fr)},sr=fr=>{m.value=m.value.filter(Cr=>Cr!==fr)};watch(()=>n.error,fr=>{ie.value=fr||"",Ue(fr?"error":"")},{immediate:!0}),watch(()=>n.validateStatus,fr=>Ue(fr||""));const ar=reactive({...toRefs(n),$el:re,size:c,validateState:g,labelId:y,inputIds:m,isGroup:Pt,hasLabel:ze,fieldValue:Ie,addInputId:cr,removeInputId:sr,resetField:ir,clearValidate:er,validate:Dt});return provide(formItemContextKey,ar),onMounted(()=>{n.prop&&(s==null||s.addField(ar),he=clone(Ie.value))}),onBeforeUnmount(()=>{s==null||s.removeField(ar)}),t({size:c,validateMessage:ie,validateState:g,validate:Dt,clearValidate:er,resetField:ir}),(fr,Cr)=>{var Mr;return openBlock(),createElementBlock("div",{ref_key:"formItemRef",ref:re,class:normalizeClass(unref(Oe)),role:unref(Pt)?"group":void 0,"aria-labelledby":unref(Pt)?unref(y):void 0},[createVNode(unref(FormLabelWrap),{"is-auto-width":unref(pe).width==="auto","update-all":((Mr=unref(s))==null?void 0:Mr.labelWidth)==="auto"},{default:withCtx(()=>[unref(ze)?(openBlock(),createBlock(resolveDynamicComponent(unref(kt)?"label":"div"),{key:0,id:unref(y),for:unref(kt),class:normalizeClass(unref(f).e("label")),style:normalizeStyle(unref(pe))},{default:withCtx(()=>[renderSlot(fr.$slots,"label",{label:unref(Ve)},()=>[createTextVNode(toDisplayString$1(unref(Ve)),1)])]),_:3},8,["id","for","class","style"])):createCommentVNode("v-if",!0)]),_:3},8,["is-auto-width","update-all"]),createBaseVNode("div",{class:normalizeClass(unref(f).e("content")),style:normalizeStyle(unref(Ce))},[renderSlot(fr.$slots,"default"),createVNode(TransitionGroup,{name:`${unref(f).namespace.value}-zoom-in-top`},{default:withCtx(()=>[unref(xe)?renderSlot(fr.$slots,"error",{key:0,error:ie.value},()=>[createBaseVNode("div",{class:normalizeClass(unref(At))},toDisplayString$1(ie.value),3)]):createCommentVNode("v-if",!0)]),_:3},8,["name"])],6)],10,["role","aria-labelledby"])}}});var FormItem=_export_sfc$1(_sfc_main$t,[["__file","form-item.vue"]]);const ElForm=withInstall(Form,{FormItem}),ElFormItem=withNoopInstall(FormItem);function useCalcInputWidth(){const e=shallowRef(),t=ref(0),n=11,a=computed(()=>({minWidth:`${Math.max(t.value,n)}px`}));return useResizeObserver(e,()=>{var o,c;t.value=(c=(o=e.value)==null?void 0:o.getBoundingClientRect().width)!=null?c:0}),{calculatorRef:e,calculatorWidth:t,inputStyle:a}}const linkProps=buildProps({type:{type:String,values:["primary","success","warning","info","danger","default"],default:void 0},underline:{type:[Boolean,String],values:[!0,!1,"always","never","hover"],default:void 0},disabled:Boolean,href:{type:String,default:""},target:{type:String,default:"_self"},icon:{type:iconPropType}}),linkEmits={click:e=>e instanceof MouseEvent},__default__$6=defineComponent({name:"ElLink"}),_sfc_main$s=defineComponent({...__default__$6,props:linkProps,emits:linkEmits,setup(e,{emit:t}){const n=e,a=useGlobalConfig("link");useDeprecated({scope:"el-link",from:"The underline option (boolean)",replacement:"'always' | 'hover' | 'never'",version:"3.0.0",ref:"https://element-plus.org/en-US/component/link.html#underline"},computed(()=>isBoolean$1(n.underline)));const s=useNamespace("link"),o=computed(()=>{var y,m,g;return[s.b(),s.m((g=(m=n.type)!=null?m:(y=a.value)==null?void 0:y.type)!=null?g:"default"),s.is("disabled",n.disabled),s.is("underline",c.value==="always"),s.is("hover-underline",c.value==="hover"&&!n.disabled)]}),c=computed(()=>{var y,m,g;return isBoolean$1(n.underline)?n.underline?"hover":"never":(g=(m=n.underline)!=null?m:(y=a.value)==null?void 0:y.underline)!=null?g:"hover"});function f(y){n.disabled||t("click",y)}return(y,m)=>(openBlock(),createElementBlock("a",{class:normalizeClass(unref(o)),href:y.disabled||!y.href?void 0:y.href,target:y.disabled||!y.href?void 0:y.target,onClick:f},[y.icon?(openBlock(),createBlock(unref(ElIcon),{key:0},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(y.icon)))]),_:1})):createCommentVNode("v-if",!0),y.$slots.default?(openBlock(),createElementBlock("span",{key:1,class:normalizeClass(unref(s).e("inner"))},[renderSlot(y.$slots,"default")],2)):createCommentVNode("v-if",!0),y.$slots.icon?renderSlot(y.$slots,"icon",{key:2}):createCommentVNode("v-if",!0)],10,["href","target"]))}});var Link=_export_sfc$1(_sfc_main$s,[["__file","link.vue"]]);const ElLink=withInstall(Link);let SubMenu$1=class{constructor(t,n){this.parent=t,this.domNode=n,this.subIndex=0,this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()}gotoSubIndex(t){t===this.subMenuItems.length?t=0:t<0&&(t=this.subMenuItems.length-1),this.subMenuItems[t].focus(),this.subIndex=t}addListeners(){const t=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,n=>{n.addEventListener("keydown",a=>{let s=!1;switch(a.code){case EVENT_CODE.down:{this.gotoSubIndex(this.subIndex+1),s=!0;break}case EVENT_CODE.up:{this.gotoSubIndex(this.subIndex-1),s=!0;break}case EVENT_CODE.tab:{triggerEvent(t,"mouseleave");break}case EVENT_CODE.enter:case EVENT_CODE.numpadEnter:case EVENT_CODE.space:{s=!0,a.currentTarget.click();break}}return s&&(a.preventDefault(),a.stopPropagation()),!1})})}},MenuItem$1=class{constructor(t,n){this.domNode=t,this.submenu=null,this.submenu=null,this.init(n)}init(t){this.domNode.setAttribute("tabindex","0");const n=this.domNode.querySelector(`.${t}-menu`);n&&(this.submenu=new SubMenu$1(this,n)),this.addListeners()}addListeners(){this.domNode.addEventListener("keydown",t=>{let n=!1;switch(t.code){case EVENT_CODE.down:{triggerEvent(t.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(0),n=!0;break}case EVENT_CODE.up:{triggerEvent(t.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(this.submenu.subMenuItems.length-1),n=!0;break}case EVENT_CODE.tab:{triggerEvent(t.currentTarget,"mouseleave");break}case EVENT_CODE.enter:case EVENT_CODE.numpadEnter:case EVENT_CODE.space:{n=!0,t.currentTarget.click();break}}n&&t.preventDefault()})}},Menu$1=class{constructor(t,n){this.domNode=t,this.init(n)}init(t){const n=this.domNode.childNodes;Array.from(n).forEach(a=>{a.nodeType===1&&new MenuItem$1(a,t)})}};const __default__$5=defineComponent({name:"ElMenuCollapseTransition"}),_sfc_main$r=defineComponent({...__default__$5,setup(e){const t=useNamespace("menu"),n={onBeforeEnter:a=>a.style.opacity="0.2",onEnter(a,s){addClass(a,`${t.namespace.value}-opacity-transition`),a.style.opacity="1",s()},onAfterEnter(a){removeClass(a,`${t.namespace.value}-opacity-transition`),a.style.opacity=""},onBeforeLeave(a){a.dataset||(a.dataset={}),hasClass(a,t.m("collapse"))?(removeClass(a,t.m("collapse")),a.dataset.oldOverflow=a.style.overflow,a.dataset.scrollWidth=a.clientWidth.toString(),addClass(a,t.m("collapse"))):(addClass(a,t.m("collapse")),a.dataset.oldOverflow=a.style.overflow,a.dataset.scrollWidth=a.clientWidth.toString(),removeClass(a,t.m("collapse"))),a.style.width=`${a.scrollWidth}px`,a.style.overflow="hidden"},onLeave(a){addClass(a,"horizontal-collapse-transition"),a.style.width=`${a.dataset.scrollWidth}px`}};return(a,s)=>(openBlock(),createBlock(Transition,mergeProps({mode:"out-in"},unref(n)),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16))}});var ElMenuCollapseTransition=_export_sfc$1(_sfc_main$r,[["__file","menu-collapse-transition.vue"]]);function useMenu(e,t){const n=computed(()=>{let s=e.parent;const o=[t.value];for(;s.type.name!=="ElMenu";)s.props.index&&o.unshift(s.props.index),s=s.parent;return o});return{parentMenu:computed(()=>{let s=e.parent;for(;s&&!["ElMenu","ElSubMenu"].includes(s.type.name);)s=s.parent;return s}),indexPath:n}}function useMenuColor(e){return computed(()=>{const n=e.backgroundColor;return n?new TinyColor(n).shade(20).toString():""})}const useMenuCssVar=(e,t)=>{const n=useNamespace("menu");return computed(()=>n.cssVarBlock({"text-color":e.textColor||"","hover-text-color":e.textColor||"","bg-color":e.backgroundColor||"","hover-bg-color":useMenuColor(e).value||"","active-color":e.activeTextColor||"",level:`${t}`}))},MENU_INJECTION_KEY="rootMenu",SUB_MENU_INJECTION_KEY="subMenu:",subMenuProps=buildProps({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:String,disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:iconPropType},expandOpenIcon:{type:iconPropType},collapseCloseIcon:{type:iconPropType},collapseOpenIcon:{type:iconPropType}}),COMPONENT_NAME$4="ElSubMenu";var SubMenu=defineComponent({name:COMPONENT_NAME$4,props:subMenuProps,setup(e,{slots:t,expose:n}){const a=getCurrentInstance(),{indexPath:s,parentMenu:o}=useMenu(a,computed(()=>e.index)),c=useNamespace("menu"),f=useNamespace("sub-menu"),y=inject(MENU_INJECTION_KEY);y||throwError(COMPONENT_NAME$4,"can not inject root menu");const m=inject(`${SUB_MENU_INJECTION_KEY}${o.value.uid}`);m||throwError(COMPONENT_NAME$4,"can not inject sub menu");const g=ref({}),z=ref({});let ie;const re=ref(!1),he=ref(),_e=ref(),$e=computed(()=>kt.value==="horizontal"&&Ce.value?"bottom-start":"right-start"),pe=computed(()=>kt.value==="horizontal"&&Ce.value||kt.value==="vertical"&&!y.props.collapse?e.expandCloseIcon&&e.expandOpenIcon?Et.value?e.expandOpenIcon:e.expandCloseIcon:arrow_down_default:e.collapseCloseIcon&&e.collapseOpenIcon?Et.value?e.collapseOpenIcon:e.collapseCloseIcon:arrow_right_default),Ce=computed(()=>m.level===0),Oe=computed(()=>{const Fe=e.teleported;return isUndefined$1(Fe)?Ce.value:Fe}),qe=computed(()=>y.props.collapse?`${c.namespace.value}-zoom-in-left`:`${c.namespace.value}-zoom-in-top`),At=computed(()=>kt.value==="horizontal"&&Ce.value?["bottom-start","bottom-end","top-start","top-end","right-start","left-start"]:["right-start","right","right-end","left-start","bottom-start","bottom-end","top-start","top-end"]),Et=computed(()=>y.openedMenus.includes(e.index)),ze=computed(()=>[...Object.values(g.value),...Object.values(z.value)].some(({active:Fe})=>Fe)),kt=computed(()=>y.props.mode),Pt=computed(()=>y.props.persistent),jt=reactive({index:e.index,indexPath:s,active:ze}),Ie=useMenuCssVar(y.props,m.level+1),u=computed(()=>{var Fe;return(Fe=e.popperOffset)!=null?Fe:y.props.popperOffset}),v=computed(()=>{var Fe;return(Fe=e.popperClass)!=null?Fe:y.props.popperClass}),Y=computed(()=>{var Fe;return(Fe=e.showTimeout)!=null?Fe:y.props.showTimeout}),ae=computed(()=>{var Fe;return(Fe=e.hideTimeout)!=null?Fe:y.props.hideTimeout}),xe=()=>{var Fe,Dt,er;return(er=(Dt=(Fe=_e.value)==null?void 0:Fe.popperRef)==null?void 0:Dt.popperInstanceRef)==null?void 0:er.destroy()},Ve=Fe=>{Fe||xe()},Ue=()=>{y.props.menuTrigger==="hover"&&y.props.mode==="horizontal"||y.props.collapse&&y.props.mode==="vertical"||e.disabled||y.handleSubMenuClick({index:e.index,indexPath:s.value,active:ze.value})},Ne=(Fe,Dt=Y.value)=>{var er;if(Fe.type!=="focus"){if(y.props.menuTrigger==="click"&&y.props.mode==="horizontal"||!y.props.collapse&&y.props.mode==="vertical"||e.disabled){m.mouseInChild.value=!0;return}m.mouseInChild.value=!0,ie==null||ie(),{stop:ie}=useTimeoutFn(()=>{y.openMenu(e.index,s.value)},Dt),Oe.value&&((er=o.value.vnode.el)==null||er.dispatchEvent(new MouseEvent("mouseenter")))}},L=(Fe=!1)=>{var Dt;if(y.props.menuTrigger==="click"&&y.props.mode==="horizontal"||!y.props.collapse&&y.props.mode==="vertical"){m.mouseInChild.value=!1;return}ie==null||ie(),m.mouseInChild.value=!1,{stop:ie}=useTimeoutFn(()=>!re.value&&y.closeMenu(e.index,s.value),ae.value),Oe.value&&Fe&&((Dt=m.handleMouseleave)==null||Dt.call(m,!0))};watch(()=>y.props.collapse,Fe=>Ve(!!Fe));{const Fe=er=>{z.value[er.index]=er},Dt=er=>{delete z.value[er.index]};provide(`${SUB_MENU_INJECTION_KEY}${a.uid}`,{addSubMenu:Fe,removeSubMenu:Dt,handleMouseleave:L,mouseInChild:re,level:m.level+1})}return n({opened:Et}),onMounted(()=>{y.addSubMenu(jt),m.addSubMenu(jt)}),onBeforeUnmount(()=>{m.removeSubMenu(jt),y.removeSubMenu(jt)}),()=>{var Fe;const Dt=[(Fe=t.title)==null?void 0:Fe.call(t),h(ElIcon,{class:f.e("icon-arrow"),style:{transform:Et.value?e.expandCloseIcon&&e.expandOpenIcon||e.collapseCloseIcon&&e.collapseOpenIcon&&y.props.collapse?"none":"rotateZ(180deg)":"none"}},{default:()=>isString$5(pe.value)?h(a.appContext.components[pe.value]):h(pe.value)})],er=y.isMenuPopup?h(ElTooltip,{ref:_e,visible:Et.value,effect:"light",pure:!0,offset:u.value,showArrow:!1,persistent:Pt.value,popperClass:v.value,placement:$e.value,teleported:Oe.value,fallbackPlacements:At.value,transition:qe.value,gpuAcceleration:!1},{content:()=>{var ir;return h("div",{class:[c.m(kt.value),c.m("popup-container"),v.value],onMouseenter:cr=>Ne(cr,100),onMouseleave:()=>L(!0),onFocus:cr=>Ne(cr,100)},[h("ul",{class:[c.b(),c.m("popup"),c.m(`popup-${$e.value}`)],style:Ie.value},[(ir=t.default)==null?void 0:ir.call(t)])])},default:()=>h("div",{class:f.e("title"),onClick:Ue},Dt)}):h(Fragment,{},[h("div",{class:f.e("title"),ref:he,onClick:Ue},Dt),h(ElCollapseTransition,{},{default:()=>{var ir;return withDirectives(h("ul",{role:"menu",class:[c.b(),c.m("inline")],style:Ie.value},[(ir=t.default)==null?void 0:ir.call(t)]),[[vShow,Et.value]])}})]);return h("li",{class:[f.b(),f.is("active",ze.value),f.is("opened",Et.value),f.is("disabled",e.disabled)],role:"menuitem",ariaHaspopup:!0,ariaExpanded:Et.value,onMouseenter:Ne,onMouseleave:()=>L(),onFocus:Ne},[er])}}});const menuProps=buildProps({mode:{type:String,values:["horizontal","vertical"],default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:{type:definePropType(Array),default:()=>mutable([])},uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,values:["hover","click"],default:"hover"},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,closeOnClickOutside:Boolean,collapseTransition:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},popperOffset:{type:Number,default:6},ellipsisIcon:{type:iconPropType,default:()=>more_default},popperEffect:{type:definePropType(String),default:"dark"},popperClass:String,showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300},persistent:{type:Boolean,default:!0}}),checkIndexPath=e=>isArray$4(e)&&e.every(t=>isString$5(t)),menuEmits={close:(e,t)=>isString$5(e)&&checkIndexPath(t),open:(e,t)=>isString$5(e)&&checkIndexPath(t),select:(e,t,n,a)=>isString$5(e)&&checkIndexPath(t)&&isObject$4(n)&&(isUndefined$1(a)||a instanceof Promise)};var Menu=defineComponent({name:"ElMenu",props:menuProps,emits:menuEmits,setup(e,{emit:t,slots:n,expose:a}){const s=getCurrentInstance(),o=s.appContext.config.globalProperties.$router,c=ref(),f=useNamespace("menu"),y=useNamespace("sub-menu"),m=ref(-1),g=ref(e.defaultOpeneds&&!e.collapse?e.defaultOpeneds.slice(0):[]),z=ref(e.defaultActive),ie=ref({}),re=ref({}),he=computed(()=>e.mode==="horizontal"||e.mode==="vertical"&&e.collapse),_e=()=>{const ae=z.value&&ie.value[z.value];if(!ae||e.mode==="horizontal"||e.collapse)return;ae.indexPath.forEach(Ve=>{const Ue=re.value[Ve];Ue&&$e(Ve,Ue.indexPath)})},$e=(ae,xe)=>{g.value.includes(ae)||(e.uniqueOpened&&(g.value=g.value.filter(Ve=>xe.includes(Ve))),g.value.push(ae),t("open",ae,xe))},pe=ae=>{const xe=g.value.indexOf(ae);xe!==-1&&g.value.splice(xe,1)},Ce=(ae,xe)=>{pe(ae),t("close",ae,xe)},Oe=({index:ae,indexPath:xe})=>{g.value.includes(ae)?Ce(ae,xe):$e(ae,xe)},qe=ae=>{(e.mode==="horizontal"||e.collapse)&&(g.value=[]);const{index:xe,indexPath:Ve}=ae;if(!(isNil(xe)||isNil(Ve)))if(e.router&&o){const Ue=ae.route||xe,Ne=o.push(Ue).then(L=>(L||(z.value=xe),L));t("select",xe,Ve,{index:xe,indexPath:Ve,route:Ue},Ne)}else z.value=xe,t("select",xe,Ve,{index:xe,indexPath:Ve})},At=ae=>{var xe;const Ve=ie.value,Ue=Ve[ae]||z.value&&Ve[z.value]||Ve[e.defaultActive];z.value=(xe=Ue==null?void 0:Ue.index)!=null?xe:ae},Et=ae=>{const xe=getComputedStyle(ae),Ve=Number.parseInt(xe.marginLeft,10),Ue=Number.parseInt(xe.marginRight,10);return ae.offsetWidth+Ve+Ue||0},ze=()=>{var ae,xe;if(!c.value)return-1;const Ve=Array.from((xe=(ae=c.value)==null?void 0:ae.childNodes)!=null?xe:[]).filter(cr=>cr.nodeName!=="#text"||cr.nodeValue),Ue=64,Ne=getComputedStyle(c.value),L=Number.parseInt(Ne.paddingLeft,10),Fe=Number.parseInt(Ne.paddingRight,10),Dt=c.value.clientWidth-L-Fe;let er=0,ir=0;return Ve.forEach((cr,sr)=>{cr.nodeName!=="#comment"&&(er+=Et(cr),er<=Dt-Ue&&(ir=sr+1))}),ir===Ve.length?-1:ir},kt=ae=>re.value[ae].indexPath,Pt=(ae,xe=33.34)=>{let Ve;return()=>{Ve&&clearTimeout(Ve),Ve=setTimeout(()=>{ae()},xe)}};let jt=!0;const Ie=()=>{if(m.value===ze())return;const ae=()=>{m.value=-1,nextTick(()=>{m.value=ze()})};jt?ae():Pt(ae)(),jt=!1};watch(()=>e.defaultActive,ae=>{ie.value[ae]||(z.value=""),At(ae)}),watch(()=>e.collapse,ae=>{ae&&(g.value=[])}),watch(ie.value,_e);let u;watchEffect(()=>{e.mode==="horizontal"&&e.ellipsis?u=useResizeObserver(c,Ie).stop:u==null||u()});const v=ref(!1);{const ae=Ne=>{re.value[Ne.index]=Ne},xe=Ne=>{delete re.value[Ne.index]};provide(MENU_INJECTION_KEY,reactive({props:e,openedMenus:g,items:ie,subMenus:re,activeIndex:z,isMenuPopup:he,addMenuItem:Ne=>{ie.value[Ne.index]=Ne},removeMenuItem:Ne=>{delete ie.value[Ne.index]},addSubMenu:ae,removeSubMenu:xe,openMenu:$e,closeMenu:Ce,handleMenuItemClick:qe,handleSubMenuClick:Oe})),provide(`${SUB_MENU_INJECTION_KEY}${s.uid}`,{addSubMenu:ae,removeSubMenu:xe,mouseInChild:v,level:0})}onMounted(()=>{e.mode==="horizontal"&&new Menu$1(s.vnode.el,f.namespace.value)}),a({open:xe=>{const{indexPath:Ve}=re.value[xe];Ve.forEach(Ue=>$e(Ue,Ve))},close:pe,updateActiveIndex:At,handleResize:Ie});const Y=useMenuCssVar(e,0);return()=>{var ae,xe;let Ve=(xe=(ae=n.default)==null?void 0:ae.call(n))!=null?xe:[];const Ue=[];if(e.mode==="horizontal"&&c.value){const Fe=flattedChildren(Ve),Dt=m.value===-1?Fe:Fe.slice(0,m.value),er=m.value===-1?[]:Fe.slice(m.value);er!=null&&er.length&&e.ellipsis&&(Ve=Dt,Ue.push(h(SubMenu,{index:"sub-menu-more",class:y.e("hide-arrow"),popperOffset:e.popperOffset},{title:()=>h(ElIcon,{class:y.e("icon-more")},{default:()=>h(e.ellipsisIcon)}),default:()=>er})))}const Ne=e.closeOnClickOutside?[[ClickOutside,()=>{g.value.length&&(v.value||(g.value.forEach(Fe=>t("close",Fe,kt(Fe))),g.value=[]))}]]:[],L=withDirectives(h("ul",{key:String(e.collapse),role:"menubar",ref:c,style:Y.value,class:{[f.b()]:!0,[f.m(e.mode)]:!0,[f.m("collapse")]:e.collapse}},[...Ve,...Ue]),Ne);return e.collapseTransition&&e.mode==="vertical"?h(ElMenuCollapseTransition,()=>L):L}}});const menuItemProps=buildProps({index:{type:definePropType([String,null]),default:null},route:{type:definePropType([String,Object])},disabled:Boolean}),menuItemEmits={click:e=>isString$5(e.index)&&isArray$4(e.indexPath)},COMPONENT_NAME$3="ElMenuItem",__default__$4=defineComponent({name:COMPONENT_NAME$3}),_sfc_main$q=defineComponent({...__default__$4,props:menuItemProps,emits:menuItemEmits,setup(e,{expose:t,emit:n}){const a=e;isPropAbsent(a.index)&&debugWarn(COMPONENT_NAME$3,'Missing required prop: "index"');const s=getCurrentInstance(),o=inject(MENU_INJECTION_KEY),c=useNamespace("menu"),f=useNamespace("menu-item");o||throwError(COMPONENT_NAME$3,"can not inject root menu");const{parentMenu:y,indexPath:m}=useMenu(s,toRef(a,"index")),g=inject(`${SUB_MENU_INJECTION_KEY}${y.value.uid}`);g||throwError(COMPONENT_NAME$3,"can not inject sub menu");const z=computed(()=>a.index===o.activeIndex),ie=reactive({index:a.index,indexPath:m,active:z}),re=()=>{a.disabled||(o.handleMenuItemClick({index:a.index,indexPath:m.value,route:a.route}),n("click",ie))};return onMounted(()=>{g.addSubMenu(ie),o.addMenuItem(ie)}),onBeforeUnmount(()=>{g.removeSubMenu(ie),o.removeMenuItem(ie)}),t({parentMenu:y,rootMenu:o,active:z,nsMenu:c,nsMenuItem:f,handleClick:re}),(he,_e)=>(openBlock(),createElementBlock("li",{class:normalizeClass([unref(f).b(),unref(f).is("active",unref(z)),unref(f).is("disabled",he.disabled)]),role:"menuitem",tabindex:"-1",onClick:re},[unref(y).type.name==="ElMenu"&&unref(o).props.collapse&&he.$slots.title?(openBlock(),createBlock(unref(ElTooltip),{key:0,effect:unref(o).props.popperEffect,placement:"right","fallback-placements":["left"],persistent:unref(o).props.persistent},{content:withCtx(()=>[renderSlot(he.$slots,"title")]),default:withCtx(()=>[createBaseVNode("div",{class:normalizeClass(unref(c).be("tooltip","trigger"))},[renderSlot(he.$slots,"default")],2)]),_:3},8,["effect","persistent"])):(openBlock(),createElementBlock(Fragment,{key:1},[renderSlot(he.$slots,"default"),renderSlot(he.$slots,"title")],64))],2))}});var MenuItem=_export_sfc$1(_sfc_main$q,[["__file","menu-item.vue"]]);const menuItemGroupProps={title:String},__default__$3=defineComponent({name:"ElMenuItemGroup"}),_sfc_main$p=defineComponent({...__default__$3,props:menuItemGroupProps,setup(e){const t=useNamespace("menu-item-group");return(n,a)=>(openBlock(),createElementBlock("li",{class:normalizeClass(unref(t).b())},[createBaseVNode("div",{class:normalizeClass(unref(t).e("title"))},[n.$slots.title?renderSlot(n.$slots,"title",{key:1}):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString$1(n.title),1)],64))],2),createBaseVNode("ul",null,[renderSlot(n.$slots,"default")])],2))}});var MenuItemGroup=_export_sfc$1(_sfc_main$p,[["__file","menu-item-group.vue"]]);const ElMenu=withInstall(Menu,{MenuItem,MenuItemGroup,SubMenu}),ElMenuItem=withNoopInstall(MenuItem);withNoopInstall(MenuItemGroup),withNoopInstall(SubMenu);const selectGroupKey=Symbol("ElSelectGroup"),selectKey=Symbol("ElSelect"),COMPONENT_NAME$2="ElOption",optionProps=buildProps({value:{type:[String,Number,Boolean,Object],required:!0},label:{type:[String,Number]},created:Boolean,disabled:Boolean});function useOption(e,t){const n=inject(selectKey);n||throwError(COMPONENT_NAME$2,"usage: <el-select><el-option /></el-select/>");const a=inject(selectGroupKey,{disabled:!1}),s=computed(()=>g(castArray$1(n.props.modelValue),e.value)),o=computed(()=>{var re;if(n.props.multiple){const he=castArray$1((re=n.props.modelValue)!=null?re:[]);return!s.value&&he.length>=n.props.multipleLimit&&n.props.multipleLimit>0}else return!1}),c=computed(()=>{var re;return(re=e.label)!=null?re:isObject$4(e.value)?"":e.value}),f=computed(()=>e.value||e.label||""),y=computed(()=>e.disabled||t.groupDisabled||o.value),m=getCurrentInstance(),g=(re=[],he)=>{if(isObject$4(e.value)){const _e=n.props.valueKey;return re&&re.some($e=>toRaw(get($e,_e))===get(he,_e))}else return re&&re.includes(he)},z=()=>{!e.disabled&&!a.disabled&&(n.states.hoveringIndex=n.optionsArray.indexOf(m.proxy))},ie=re=>{const he=new RegExp(escapeStringRegexp(re),"i");t.visible=he.test(String(c.value))||e.created};return watch(()=>c.value,()=>{!e.created&&!n.props.remote&&n.setSelected()}),watch(()=>e.value,(re,he)=>{const{remote:_e,valueKey:$e}=n.props;if((_e?re!==he:!isEqual(re,he))&&(n.onOptionDestroy(he,m.proxy),n.onOptionCreate(m.proxy)),!e.created&&!_e){if($e&&isObject$4(re)&&isObject$4(he)&&re[$e]===he[$e])return;n.setSelected()}}),watch(()=>a.disabled,()=>{t.groupDisabled=a.disabled},{immediate:!0}),{select:n,currentLabel:c,currentValue:f,itemSelected:s,isDisabled:y,hoverItem:z,updateOption:ie}}const _sfc_main$o=defineComponent({name:COMPONENT_NAME$2,componentName:COMPONENT_NAME$2,props:optionProps,setup(e){const t=useNamespace("select"),n=useId(),a=computed(()=>[t.be("dropdown","item"),t.is("disabled",unref(f)),t.is("selected",unref(c)),t.is("hovering",unref(ie))]),s=reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:o,itemSelected:c,isDisabled:f,select:y,hoverItem:m,updateOption:g}=useOption(e,s),{visible:z,hover:ie}=toRefs(s),re=getCurrentInstance().proxy;y.onOptionCreate(re),onBeforeUnmount(()=>{const _e=re.value,{selected:$e}=y.states,pe=$e.some(Ce=>Ce.value===re.value);nextTick(()=>{y.states.cachedOptions.get(_e)===re&&!pe&&y.states.cachedOptions.delete(_e)}),y.onOptionDestroy(_e,re)});function he(){f.value||y.handleOptionSelect(re)}return{ns:t,id:n,containerKls:a,currentLabel:o,itemSelected:c,isDisabled:f,select:y,visible:z,hover:ie,states:s,hoverItem:m,updateOption:g,selectOptionClick:he}}});function _sfc_render$3(e,t){return withDirectives((openBlock(),createElementBlock("li",{id:e.id,class:normalizeClass(e.containerKls),role:"option","aria-disabled":e.isDisabled||void 0,"aria-selected":e.itemSelected,onMousemove:e.hoverItem,onClick:withModifiers(e.selectOptionClick,["stop"])},[renderSlot(e.$slots,"default",{},()=>[createBaseVNode("span",null,toDisplayString$1(e.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMousemove","onClick"])),[[vShow,e.visible]])}var Option=_export_sfc$1(_sfc_main$o,[["render",_sfc_render$3],["__file","option.vue"]]);const _sfc_main$n=defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const e=inject(selectKey),t=useNamespace("select"),n=computed(()=>e.props.popperClass),a=computed(()=>e.props.multiple),s=computed(()=>e.props.fitInputWidth),o=ref("");function c(){var f;o.value=`${(f=e.selectRef)==null?void 0:f.offsetWidth}px`}return onMounted(()=>{c(),useResizeObserver(e.selectRef,c)}),{ns:t,minWidth:o,popperClass:n,isMultiple:a,isFitInputWidth:s}}});function _sfc_render$2(e,t,n,a,s,o){return openBlock(),createElementBlock("div",{class:normalizeClass([e.ns.b("dropdown"),e.ns.is("multiple",e.isMultiple),e.popperClass]),style:normalizeStyle({[e.isFitInputWidth?"width":"minWidth"]:e.minWidth})},[e.$slots.header?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(e.ns.be("dropdown","header"))},[renderSlot(e.$slots,"header")],2)):createCommentVNode("v-if",!0),renderSlot(e.$slots,"default"),e.$slots.footer?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(e.ns.be("dropdown","footer"))},[renderSlot(e.$slots,"footer")],2)):createCommentVNode("v-if",!0)],6)}var ElSelectMenu=_export_sfc$1(_sfc_main$n,[["render",_sfc_render$2],["__file","select-dropdown.vue"]]);const useSelect=(e,t)=>{const{t:n}=useLocale(),a=useId(),s=useNamespace("select"),o=useNamespace("input"),c=reactive({inputValue:"",options:new Map,cachedOptions:new Map,optionValues:[],selected:[],selectionWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),f=ref(),y=ref(),m=ref(),g=ref(),z=ref(),ie=ref(),re=ref(),he=ref(),_e=ref(),$e=ref(),pe=ref(),{isComposing:Ce,handleCompositionStart:Oe,handleCompositionUpdate:qe,handleCompositionEnd:At}=useComposition({afterComposition:Dr=>jr(Dr)}),{wrapperRef:Et,isFocused:ze,handleBlur:kt}=useFocusController(z,{beforeFocus(){return xe.value},afterFocus(){e.automaticDropdown&&!Pt.value&&(Pt.value=!0,c.menuVisibleOnFocus=!0)},beforeBlur(Dr){var Sn,hn;return((Sn=m.value)==null?void 0:Sn.isFocusInsideContent(Dr))||((hn=g.value)==null?void 0:hn.isFocusInsideContent(Dr))},afterBlur(){var Dr;Pt.value=!1,c.menuVisibleOnFocus=!1,e.validateEvent&&((Dr=u==null?void 0:u.validate)==null||Dr.call(u,"blur").catch(Sn=>debugWarn(Sn)))}}),Pt=ref(!1),jt=ref(),{form:Ie,formItem:u}=useFormItem(),{inputId:v}=useFormItemInputId(e,{formItemContext:u}),{valueOnClear:Y,isEmptyValue:ae}=useEmptyValues(e),xe=computed(()=>e.disabled||(Ie==null?void 0:Ie.disabled)),Ve=computed(()=>isArray$4(e.modelValue)?e.modelValue.length>0:!ae(e.modelValue)),Ue=computed(()=>{var Dr;return(Dr=Ie==null?void 0:Ie.statusIcon)!=null?Dr:!1}),Ne=computed(()=>e.clearable&&!xe.value&&c.inputHovering&&Ve.value),L=computed(()=>e.remote&&e.filterable&&!e.remoteShowSuffix?"":e.suffixIcon),Fe=computed(()=>s.is("reverse",!!(L.value&&Pt.value))),Dt=computed(()=>(u==null?void 0:u.validateState)||""),er=computed(()=>Dt.value&&ValidateComponentsMap[Dt.value]),ir=computed(()=>e.remote?300:0),cr=computed(()=>e.remote&&!c.inputValue&&c.options.size===0),sr=computed(()=>e.loading?e.loadingText||n("el.select.loading"):e.filterable&&c.inputValue&&c.options.size>0&&ar.value===0?e.noMatchText||n("el.select.noMatch"):c.options.size===0?e.noDataText||n("el.select.noData"):null),ar=computed(()=>fr.value.filter(Dr=>Dr.visible).length),fr=computed(()=>{const Dr=Array.from(c.options.values()),Sn=[];return c.optionValues.forEach(hn=>{const Cn=Dr.findIndex(Mn=>Mn.value===hn);Cn>-1&&Sn.push(Dr[Cn])}),Sn.length>=Dr.length?Sn:Dr}),Cr=computed(()=>Array.from(c.cachedOptions.values())),Mr=computed(()=>{const Dr=fr.value.filter(Sn=>!Sn.created).some(Sn=>Sn.currentLabel===c.inputValue);return e.filterable&&e.allowCreate&&c.inputValue!==""&&!Dr}),xr=()=>{e.filterable&&isFunction$4(e.filterMethod)||e.filterable&&e.remote&&isFunction$4(e.remoteMethod)||fr.value.forEach(Dr=>{var Sn;(Sn=Dr.updateOption)==null||Sn.call(Dr,c.inputValue)})},gr=useFormSize(),dr=computed(()=>["small"].includes(gr.value)?"small":"default"),Br=computed({get(){return Pt.value&&!cr.value},set(Dr){Pt.value=Dr}}),Ir=computed(()=>{if(e.multiple&&!isUndefined$1(e.modelValue))return castArray$1(e.modelValue).length===0&&!c.inputValue;const Dr=isArray$4(e.modelValue)?e.modelValue[0]:e.modelValue;return e.filterable||isUndefined$1(Dr)?!c.inputValue:!0}),Nr=computed(()=>{var Dr;const Sn=(Dr=e.placeholder)!=null?Dr:n("el.select.placeholder");return e.multiple||!Ve.value?Sn:c.selectedLabel}),Kr=computed(()=>isIOS?null:"mouseenter");watch(()=>e.modelValue,(Dr,Sn)=>{e.multiple&&e.filterable&&!e.reserveKeyword&&(c.inputValue="",_r("")),Vr(),!isEqual(Dr,Sn)&&e.validateEvent&&(u==null||u.validate("change").catch(hn=>debugWarn(hn)))},{flush:"post",deep:!0}),watch(()=>Pt.value,Dr=>{Dr?_r(c.inputValue):(c.inputValue="",c.previousQuery=null,c.isBeforeHide=!0),t("visible-change",Dr)}),watch(()=>c.options.entries(),()=>{isClient&&(Vr(),e.defaultFirstOption&&(e.filterable||e.remote)&&ar.value&&vr())},{flush:"post"}),watch([()=>c.hoveringIndex,fr],([Dr])=>{isNumber$1(Dr)&&Dr>-1?jt.value=fr.value[Dr]||{}:jt.value={},fr.value.forEach(Sn=>{Sn.hover=jt.value===Sn})}),watchEffect(()=>{c.isBeforeHide||xr()});const _r=Dr=>{c.previousQuery===Dr||Ce.value||(c.previousQuery=Dr,e.filterable&&isFunction$4(e.filterMethod)?e.filterMethod(Dr):e.filterable&&e.remote&&isFunction$4(e.remoteMethod)&&e.remoteMethod(Dr),e.defaultFirstOption&&(e.filterable||e.remote)&&ar.value?nextTick(vr):nextTick(Or))},vr=()=>{const Dr=fr.value.filter(Mn=>Mn.visible&&!Mn.disabled&&!Mn.states.groupDisabled),Sn=Dr.find(Mn=>Mn.created),hn=Dr[0],Cn=fr.value.map(Mn=>Mn.value);c.hoveringIndex=hr(Cn,Sn||hn)},Vr=()=>{if(e.multiple)c.selectedLabel="";else{const Sn=isArray$4(e.modelValue)?e.modelValue[0]:e.modelValue,hn=$r(Sn);c.selectedLabel=hn.currentLabel,c.selected=[hn];return}const Dr=[];isUndefined$1(e.modelValue)||castArray$1(e.modelValue).forEach(Sn=>{Dr.push($r(Sn))}),c.selected=Dr},$r=Dr=>{let Sn;const hn=isPlainObject$3(Dr);for(let Bn=c.cachedOptions.size-1;Bn>=0;Bn--){const Nn=Cr.value[Bn];if(hn?get(Nn.value,e.valueKey)===get(Dr,e.valueKey):Nn.value===Dr){Sn={value:Dr,currentLabel:Nn.currentLabel,get isDisabled(){return Nn.isDisabled}};break}}if(Sn)return Sn;const Cn=hn?Dr.label:Dr??"";return{value:Dr,currentLabel:Cn}},Or=()=>{c.hoveringIndex=fr.value.findIndex(Dr=>c.selected.some(Sn=>tr(Sn)===tr(Dr)))},Pr=()=>{c.selectionWidth=Number.parseFloat(window.getComputedStyle(y.value).width)},Sr=()=>{c.collapseItemWidth=$e.value.getBoundingClientRect().width},Er=()=>{var Dr,Sn;(Sn=(Dr=m.value)==null?void 0:Dr.updatePopper)==null||Sn.call(Dr)},zr=()=>{var Dr,Sn;(Sn=(Dr=g.value)==null?void 0:Dr.updatePopper)==null||Sn.call(Dr)},Lr=()=>{c.inputValue.length>0&&!Pt.value&&(Pt.value=!0),_r(c.inputValue)},jr=Dr=>{if(c.inputValue=Dr.target.value,e.remote)Ar();else return Lr()},Ar=debounce$1(()=>{Lr()},ir.value),lr=Dr=>{isEqual(e.modelValue,Dr)||t(CHANGE_EVENT,Dr)},nr=Dr=>findLastIndex(Dr,Sn=>{const hn=c.cachedOptions.get(Sn);return hn&&!hn.disabled&&!hn.states.groupDisabled}),or=Dr=>{if(e.multiple&&Dr.code!==EVENT_CODE.delete&&Dr.target.value.length<=0){const Sn=castArray$1(e.modelValue).slice(),hn=nr(Sn);if(hn<0)return;const Cn=Sn[hn];Sn.splice(hn,1),t(UPDATE_MODEL_EVENT,Sn),lr(Sn),t("remove-tag",Cn)}},br=(Dr,Sn)=>{const hn=c.selected.indexOf(Sn);if(hn>-1&&!xe.value){const Cn=castArray$1(e.modelValue).slice();Cn.splice(hn,1),t(UPDATE_MODEL_EVENT,Cn),lr(Cn),t("remove-tag",Sn.value)}Dr.stopPropagation(),Xr()},yr=Dr=>{Dr.stopPropagation();const Sn=e.multiple?[]:Y.value;if(e.multiple)for(const hn of c.selected)hn.isDisabled&&Sn.push(hn.value);t(UPDATE_MODEL_EVENT,Sn),lr(Sn),c.hoveringIndex=-1,Pt.value=!1,t("clear"),Xr()},Tr=Dr=>{var Sn;if(e.multiple){const hn=castArray$1((Sn=e.modelValue)!=null?Sn:[]).slice(),Cn=hr(hn,Dr);Cn>-1?hn.splice(Cn,1):(e.multipleLimit<=0||hn.length<e.multipleLimit)&&hn.push(Dr.value),t(UPDATE_MODEL_EVENT,hn),lr(hn),Dr.created&&_r(""),e.filterable&&!e.reserveKeyword&&(c.inputValue="")}else t(UPDATE_MODEL_EVENT,Dr.value),lr(Dr.value),Pt.value=!1;Xr(),!Pt.value&&nextTick(()=>{ur(Dr)})},hr=(Dr,Sn)=>isUndefined$1(Sn)?-1:isObject$4(Sn.value)?Dr.findIndex(hn=>isEqual(get(hn,e.valueKey),tr(Sn))):Dr.indexOf(Sn.value),ur=Dr=>{var Sn,hn,Cn,Mn,Bn;const Nn=isArray$4(Dr)?Dr[0]:Dr;let qn=null;if(Nn!=null&&Nn.value){const Pn=fr.value.filter(Dn=>Dn.value===Nn.value);Pn.length>0&&(qn=Pn[0].$el)}if(m.value&&qn){const Pn=(Mn=(Cn=(hn=(Sn=m.value)==null?void 0:Sn.popperRef)==null?void 0:hn.contentRef)==null?void 0:Cn.querySelector)==null?void 0:Mn.call(Cn,`.${s.be("dropdown","wrap")}`);Pn&&scrollIntoView(Pn,qn)}(Bn=pe.value)==null||Bn.handleScroll()},vn=Dr=>{c.options.set(Dr.value,Dr),c.cachedOptions.set(Dr.value,Dr)},Yr=(Dr,Sn)=>{c.options.get(Dr)===Sn&&c.options.delete(Dr)},Wr=computed(()=>{var Dr,Sn;return(Sn=(Dr=m.value)==null?void 0:Dr.popperRef)==null?void 0:Sn.contentRef}),xn=()=>{c.isBeforeHide=!1,nextTick(()=>{var Dr;(Dr=pe.value)==null||Dr.update(),ur(c.selected)})},Xr=()=>{var Dr;(Dr=z.value)==null||Dr.focus()},wn=()=>{var Dr;if(Pt.value){Pt.value=!1,nextTick(()=>{var Sn;return(Sn=z.value)==null?void 0:Sn.blur()});return}(Dr=z.value)==null||Dr.blur()},En=Dr=>{yr(Dr)},Hr=Dr=>{if(Pt.value=!1,ze.value){const Sn=new FocusEvent("focus",Dr);nextTick(()=>kt(Sn))}},Zr=()=>{c.inputValue.length>0?c.inputValue="":Pt.value=!1},Gr=()=>{xe.value||(isIOS&&(c.inputHovering=!0),c.menuVisibleOnFocus?c.menuVisibleOnFocus=!1:Pt.value=!Pt.value)},Lt=()=>{if(!Pt.value)Gr();else{const Dr=fr.value[c.hoveringIndex];Dr&&!Dr.isDisabled&&Tr(Dr)}},tr=Dr=>isObject$4(Dr.value)?get(Dr.value,e.valueKey):Dr.value,rr=computed(()=>fr.value.filter(Dr=>Dr.visible).every(Dr=>Dr.isDisabled)),pr=computed(()=>e.multiple?e.collapseTags?c.selected.slice(0,e.maxCollapseTags):c.selected:[]),wr=computed(()=>e.multiple?e.collapseTags?c.selected.slice(e.maxCollapseTags):[]:[]),Ur=Dr=>{if(!Pt.value){Pt.value=!0;return}if(!(c.options.size===0||ar.value===0||Ce.value)&&!rr.value){Dr==="next"?(c.hoveringIndex++,c.hoveringIndex===c.options.size&&(c.hoveringIndex=0)):Dr==="prev"&&(c.hoveringIndex--,c.hoveringIndex<0&&(c.hoveringIndex=c.options.size-1));const Sn=fr.value[c.hoveringIndex];(Sn.isDisabled||!Sn.visible)&&Ur(Dr),nextTick(()=>ur(jt.value))}},qr=()=>{if(!y.value)return 0;const Dr=window.getComputedStyle(y.value);return Number.parseFloat(Dr.gap||"6px")},Jr=computed(()=>{const Dr=qr();return{maxWidth:`${$e.value&&e.maxCollapseTags===1?c.selectionWidth-c.collapseItemWidth-Dr:c.selectionWidth}px`}}),Rn=computed(()=>({maxWidth:`${c.selectionWidth}px`})),Qr=Dr=>{t("popup-scroll",Dr)};return useResizeObserver(y,Pr),useResizeObserver(he,Er),useResizeObserver(Et,Er),useResizeObserver(_e,zr),useResizeObserver($e,Sr),onMounted(()=>{Vr()}),{inputId:v,contentId:a,nsSelect:s,nsInput:o,states:c,isFocused:ze,expanded:Pt,optionsArray:fr,hoverOption:jt,selectSize:gr,filteredOptionsCount:ar,updateTooltip:Er,updateTagTooltip:zr,debouncedOnInputChange:Ar,onInput:jr,deletePrevTag:or,deleteTag:br,deleteSelected:yr,handleOptionSelect:Tr,scrollToOption:ur,hasModelValue:Ve,shouldShowPlaceholder:Ir,currentPlaceholder:Nr,mouseEnterEventName:Kr,needStatusIcon:Ue,showClose:Ne,iconComponent:L,iconReverse:Fe,validateState:Dt,validateIcon:er,showNewOption:Mr,updateOptions:xr,collapseTagSize:dr,setSelected:Vr,selectDisabled:xe,emptyText:sr,handleCompositionStart:Oe,handleCompositionUpdate:qe,handleCompositionEnd:At,onOptionCreate:vn,onOptionDestroy:Yr,handleMenuEnter:xn,focus:Xr,blur:wn,handleClearClick:En,handleClickOutside:Hr,handleEsc:Zr,toggleMenu:Gr,selectOption:Lt,getValueKey:tr,navigateOptions:Ur,dropdownMenuVisible:Br,showTagList:pr,collapseTagList:wr,popupScroll:Qr,tagStyle:Jr,collapseTagStyle:Rn,popperRef:Wr,inputRef:z,tooltipRef:m,tagTooltipRef:g,prefixRef:ie,suffixRef:re,selectRef:f,wrapperRef:Et,selectionRef:y,scrollbarRef:pe,menuRef:he,tagMenuRef:_e,collapseItemRef:$e}};var ElOptions=defineComponent({name:"ElOptions",setup(e,{slots:t}){const n=inject(selectKey);let a=[];return()=>{var s,o;const c=(s=t.default)==null?void 0:s.call(t),f=[];function y(m){isArray$4(m)&&m.forEach(g=>{var z,ie,re,he;const _e=(z=(g==null?void 0:g.type)||{})==null?void 0:z.name;_e==="ElOptionGroup"?y(!isString$5(g.children)&&!isArray$4(g.children)&&isFunction$4((ie=g.children)==null?void 0:ie.default)?(re=g.children)==null?void 0:re.default():g.children):_e==="ElOption"?f.push((he=g.props)==null?void 0:he.value):isArray$4(g.children)&&y(g.children)})}return c.length&&y((o=c[0])==null?void 0:o.children),isEqual(f,a)||(a=f,n&&(n.states.optionValues=f)),c}}});const selectProps=buildProps({name:String,id:String,modelValue:{type:definePropType([Array,String,Number,Boolean,Object]),default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:useSizeProp,effect:{type:definePropType(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:definePropType(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:useTooltipContentProps.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:iconPropType,default:circle_close_default},fitInputWidth:Boolean,suffixIcon:{type:iconPropType,default:arrow_down_default},tagType:{...tagProps.type,default:"info"},tagEffect:{...tagProps.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,showArrow:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:definePropType(String),values:Ee,default:"bottom-start"},fallbackPlacements:{type:definePropType(Array),default:["bottom-start","top-start","right","left"]},tabindex:{type:[String,Number],default:0},appendTo:useTooltipContentProps.appendTo,...useEmptyValuesProps,...useAriaProps(["ariaLabel"])});scrollbarEmits.scroll;const COMPONENT_NAME$1="ElSelect",_sfc_main$m=defineComponent({name:COMPONENT_NAME$1,componentName:COMPONENT_NAME$1,components:{ElSelectMenu,ElOption:Option,ElOptions,ElTag,ElScrollbar,ElTooltip,ElIcon},directives:{ClickOutside},props:selectProps,emits:[UPDATE_MODEL_EVENT,CHANGE_EVENT,"remove-tag","clear","visible-change","focus","blur","popup-scroll"],setup(e,{emit:t,slots:n}){const a=computed(()=>{const{modelValue:g,multiple:z}=e,ie=z?[]:void 0;return isArray$4(g)?z?g:ie:z?ie:g}),s=reactive({...toRefs(e),modelValue:a}),o=useSelect(s,t),{calculatorRef:c,inputStyle:f}=useCalcInputWidth(),y=g=>{flattedChildren(g).filter(ie=>isObject$4(ie)&&ie.type.name==="ElOption").forEach(ie=>{const re={...ie.props};re.currentLabel=re.label||(isObject$4(re.value)?"":re.value),o.onOptionCreate(re)})};watchEffect(()=>{e.persistent||nextTick(()=>{var g,z;const ie=h(Fragment,(z=(g=n.default)==null?void 0:g.call(n))!=null?z:[]).children;y(ie)})}),provide(selectKey,reactive({props:s,states:o.states,selectRef:o.selectRef,optionsArray:o.optionsArray,setSelected:o.setSelected,handleOptionSelect:o.handleOptionSelect,onOptionCreate:o.onOptionCreate,onOptionDestroy:o.onOptionDestroy}));const m=computed(()=>e.multiple?o.states.selected.map(g=>g.currentLabel):o.states.selectedLabel);return{...o,modelValue:a,selectedLabel:m,calculatorRef:c,inputStyle:f}}});function _sfc_render$1(e,t){const n=resolveComponent("el-tag"),a=resolveComponent("el-tooltip"),s=resolveComponent("el-icon"),o=resolveComponent("el-option"),c=resolveComponent("el-options"),f=resolveComponent("el-scrollbar"),y=resolveComponent("el-select-menu"),m=resolveDirective("click-outside");return withDirectives((openBlock(),createElementBlock("div",{ref:"selectRef",class:normalizeClass([e.nsSelect.b(),e.nsSelect.m(e.selectSize)]),[toHandlerKey(e.mouseEnterEventName)]:g=>e.states.inputHovering=!0,onMouseleave:g=>e.states.inputHovering=!1},[createVNode(a,{ref:"tooltipRef",visible:e.dropdownMenuVisible,placement:e.placement,teleported:e.teleported,"popper-class":[e.nsSelect.e("popper"),e.popperClass],"popper-options":e.popperOptions,"fallback-placements":e.fallbackPlacements,effect:e.effect,pure:"",trigger:"click",transition:`${e.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:e.persistent,"append-to":e.appendTo,"show-arrow":e.showArrow,offset:e.offset,onBeforeShow:e.handleMenuEnter,onHide:g=>e.states.isBeforeHide=!1},{default:withCtx(()=>{var g;return[createBaseVNode("div",{ref:"wrapperRef",class:normalizeClass([e.nsSelect.e("wrapper"),e.nsSelect.is("focused",e.isFocused),e.nsSelect.is("hovering",e.states.inputHovering),e.nsSelect.is("filterable",e.filterable),e.nsSelect.is("disabled",e.selectDisabled)]),onClick:withModifiers(e.toggleMenu,["prevent"])},[e.$slots.prefix?(openBlock(),createElementBlock("div",{key:0,ref:"prefixRef",class:normalizeClass(e.nsSelect.e("prefix"))},[renderSlot(e.$slots,"prefix")],2)):createCommentVNode("v-if",!0),createBaseVNode("div",{ref:"selectionRef",class:normalizeClass([e.nsSelect.e("selection"),e.nsSelect.is("near",e.multiple&&!e.$slots.prefix&&!!e.states.selected.length)])},[e.multiple?renderSlot(e.$slots,"tag",{key:0},()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.showTagList,z=>(openBlock(),createElementBlock("div",{key:e.getValueKey(z),class:normalizeClass(e.nsSelect.e("selected-item"))},[createVNode(n,{closable:!e.selectDisabled&&!z.isDisabled,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",style:normalizeStyle(e.tagStyle),onClose:ie=>e.deleteTag(ie,z)},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass(e.nsSelect.e("tags-text"))},[renderSlot(e.$slots,"label",{label:z.currentLabel,value:z.value},()=>[createTextVNode(toDisplayString$1(z.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),e.collapseTags&&e.states.selected.length>e.maxCollapseTags?(openBlock(),createBlock(a,{key:0,ref:"tagTooltipRef",disabled:e.dropdownMenuVisible||!e.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:e.teleported},{default:withCtx(()=>[createBaseVNode("div",{ref:"collapseItemRef",class:normalizeClass(e.nsSelect.e("selected-item"))},[createVNode(n,{closable:!1,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",style:normalizeStyle(e.collapseTagStyle)},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass(e.nsSelect.e("tags-text"))}," + "+toDisplayString$1(e.states.selected.length-e.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:withCtx(()=>[createBaseVNode("div",{ref:"tagMenuRef",class:normalizeClass(e.nsSelect.e("selection"))},[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.collapseTagList,z=>(openBlock(),createElementBlock("div",{key:e.getValueKey(z),class:normalizeClass(e.nsSelect.e("selected-item"))},[createVNode(n,{class:"in-tooltip",closable:!e.selectDisabled&&!z.isDisabled,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",onClose:ie=>e.deleteTag(ie,z)},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass(e.nsSelect.e("tags-text"))},[renderSlot(e.$slots,"label",{label:z.currentLabel,value:z.value},()=>[createTextVNode(toDisplayString$1(z.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):createCommentVNode("v-if",!0)]):createCommentVNode("v-if",!0),createBaseVNode("div",{class:normalizeClass([e.nsSelect.e("selected-item"),e.nsSelect.e("input-wrapper"),e.nsSelect.is("hidden",!e.filterable)])},[withDirectives(createBaseVNode("input",{id:e.inputId,ref:"inputRef","onUpdate:modelValue":z=>e.states.inputValue=z,type:"text",name:e.name,class:normalizeClass([e.nsSelect.e("input"),e.nsSelect.is(e.selectSize)]),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:normalizeStyle(e.inputStyle),tabindex:e.tabindex,role:"combobox",readonly:!e.filterable,spellcheck:"false","aria-activedescendant":((g=e.hoverOption)==null?void 0:g.id)||"","aria-controls":e.contentId,"aria-expanded":e.dropdownMenuVisible,"aria-label":e.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[withKeys(withModifiers(z=>e.navigateOptions("next"),["stop","prevent"]),["down"]),withKeys(withModifiers(z=>e.navigateOptions("prev"),["stop","prevent"]),["up"]),withKeys(withModifiers(e.handleEsc,["stop","prevent"]),["esc"]),withKeys(withModifiers(e.selectOption,["stop","prevent"]),["enter"]),withKeys(withModifiers(e.deletePrevTag,["stop"]),["delete"])],onCompositionstart:e.handleCompositionStart,onCompositionupdate:e.handleCompositionUpdate,onCompositionend:e.handleCompositionEnd,onInput:e.onInput,onClick:withModifiers(e.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","tabindex","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[vModelText,e.states.inputValue]]),e.filterable?(openBlock(),createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:normalizeClass(e.nsSelect.e("input-calculator")),textContent:toDisplayString$1(e.states.inputValue)},null,10,["textContent"])):createCommentVNode("v-if",!0)],2),e.shouldShowPlaceholder?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass([e.nsSelect.e("selected-item"),e.nsSelect.e("placeholder"),e.nsSelect.is("transparent",!e.hasModelValue||e.expanded&&!e.states.inputValue)])},[e.hasModelValue?renderSlot(e.$slots,"label",{key:0,label:e.currentPlaceholder,value:e.modelValue},()=>[createBaseVNode("span",null,toDisplayString$1(e.currentPlaceholder),1)]):(openBlock(),createElementBlock("span",{key:1},toDisplayString$1(e.currentPlaceholder),1))],2)):createCommentVNode("v-if",!0)],2),createBaseVNode("div",{ref:"suffixRef",class:normalizeClass(e.nsSelect.e("suffix"))},[e.iconComponent&&!e.showClose?(openBlock(),createBlock(s,{key:0,class:normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):createCommentVNode("v-if",!0),e.showClose&&e.clearIcon?(openBlock(),createBlock(s,{key:1,class:normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.nsSelect.e("clear")]),onClick:e.handleClearClick},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.clearIcon)))]),_:1},8,["class","onClick"])):createCommentVNode("v-if",!0),e.validateState&&e.validateIcon&&e.needStatusIcon?(openBlock(),createBlock(s,{key:2,class:normalizeClass([e.nsInput.e("icon"),e.nsInput.e("validateIcon"),e.nsInput.is("loading",e.validateState==="validating")])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.validateIcon)))]),_:1},8,["class"])):createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:withCtx(()=>[createVNode(y,{ref:"menuRef"},{default:withCtx(()=>[e.$slots.header?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(e.nsSelect.be("dropdown","header")),onClick:withModifiers(()=>{},["stop"])},[renderSlot(e.$slots,"header")],10,["onClick"])):createCommentVNode("v-if",!0),withDirectives(createVNode(f,{id:e.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":e.nsSelect.be("dropdown","wrap"),"view-class":e.nsSelect.be("dropdown","list"),class:normalizeClass([e.nsSelect.is("empty",e.filteredOptionsCount===0)]),role:"listbox","aria-label":e.ariaLabel,"aria-orientation":"vertical",onScroll:e.popupScroll},{default:withCtx(()=>[e.showNewOption?(openBlock(),createBlock(o,{key:0,value:e.states.inputValue,created:!0},null,8,["value"])):createCommentVNode("v-if",!0),createVNode(c,null,{default:withCtx(()=>[renderSlot(e.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label","onScroll"]),[[vShow,e.states.options.size>0&&!e.loading]]),e.$slots.loading&&e.loading?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(e.nsSelect.be("dropdown","loading"))},[renderSlot(e.$slots,"loading")],2)):e.loading||e.filteredOptionsCount===0?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(e.nsSelect.be("dropdown","empty"))},[renderSlot(e.$slots,"empty",{},()=>[createBaseVNode("span",null,toDisplayString$1(e.emptyText),1)])],2)):createCommentVNode("v-if",!0),e.$slots.footer?(openBlock(),createElementBlock("div",{key:3,class:normalizeClass(e.nsSelect.be("dropdown","footer")),onClick:withModifiers(()=>{},["stop"])},[renderSlot(e.$slots,"footer")],10,["onClick"])):createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","show-arrow","offset","onBeforeShow","onHide"])],16,["onMouseleave"])),[[m,e.handleClickOutside,e.popperRef]])}var Select=_export_sfc$1(_sfc_main$m,[["render",_sfc_render$1],["__file","select.vue"]]);const _sfc_main$l=defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(e){const t=useNamespace("select"),n=ref(),a=getCurrentInstance(),s=ref([]);provide(selectGroupKey,reactive({...toRefs(e)}));const o=computed(()=>s.value.some(m=>m.visible===!0)),c=m=>{var g;return m.type.name==="ElOption"&&!!((g=m.component)!=null&&g.proxy)},f=m=>{const g=castArray$1(m),z=[];return g.forEach(ie=>{var re;isVNode$1(ie)&&(c(ie)?z.push(ie.component.proxy):isArray$4(ie.children)&&ie.children.length?z.push(...f(ie.children)):(re=ie.component)!=null&&re.subTree&&z.push(...f(ie.component.subTree)))}),z},y=()=>{s.value=f(a.subTree)};return onMounted(()=>{y()}),useMutationObserver(n,y,{attributes:!0,subtree:!0,childList:!0}),{groupRef:n,visible:o,ns:t}}});function _sfc_render(e,t,n,a,s,o){return withDirectives((openBlock(),createElementBlock("ul",{ref:"groupRef",class:normalizeClass(e.ns.be("group","wrap"))},[createBaseVNode("li",{class:normalizeClass(e.ns.be("group","title"))},toDisplayString$1(e.label),3),createBaseVNode("li",null,[createBaseVNode("ul",{class:normalizeClass(e.ns.b("group"))},[renderSlot(e.$slots,"default")],2)])],2)),[[vShow,e.visible]])}var OptionGroup=_export_sfc$1(_sfc_main$l,[["render",_sfc_render],["__file","option-group.vue"]]);const ElSelect=withInstall(Select,{Option,OptionGroup}),ElOption=withNoopInstall(Option);withNoopInstall(OptionGroup);const statisticProps=buildProps({decimalSeparator:{type:String,default:"."},groupSeparator:{type:String,default:","},precision:{type:Number,default:0},formatter:Function,value:{type:definePropType([Number,Object]),default:0},prefix:String,suffix:String,title:String,valueStyle:{type:definePropType([String,Object,Array])}}),__default__$2=defineComponent({name:"ElStatistic"}),_sfc_main$k=defineComponent({...__default__$2,props:statisticProps,setup(e,{expose:t}){const n=e,a=useNamespace("statistic"),s=computed(()=>{const{value:o,formatter:c,precision:f,decimalSeparator:y,groupSeparator:m}=n;if(isFunction$4(c))return c(o);if(!isNumber$1(o)||Number.isNaN(o))return o;let[g,z=""]=String(o).split(".");return z=z.padEnd(f,"0").slice(0,f>0?f:0),g=g.replace(/\B(?=(\d{3})+(?!\d))/g,m),[g,z].join(z?y:"")});return t({displayValue:s}),(o,c)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(a).b())},[o.$slots.title||o.title?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(unref(a).e("head"))},[renderSlot(o.$slots,"title",{},()=>[createTextVNode(toDisplayString$1(o.title),1)])],2)):createCommentVNode("v-if",!0),createBaseVNode("div",{class:normalizeClass(unref(a).e("content"))},[o.$slots.prefix||o.prefix?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(unref(a).e("prefix"))},[renderSlot(o.$slots,"prefix",{},()=>[createBaseVNode("span",null,toDisplayString$1(o.prefix),1)])],2)):createCommentVNode("v-if",!0),createBaseVNode("span",{class:normalizeClass(unref(a).e("number")),style:normalizeStyle(o.valueStyle)},toDisplayString$1(unref(s)),7),o.$slots.suffix||o.suffix?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(unref(a).e("suffix"))},[renderSlot(o.$slots,"suffix",{},()=>[createBaseVNode("span",null,toDisplayString$1(o.suffix),1)])],2)):createCommentVNode("v-if",!0)],2)],2))}});var Statistic=_export_sfc$1(_sfc_main$k,[["__file","statistic.vue"]]);const ElStatistic=withInstall(Statistic),isValidComponentSize=e=>["",...componentSizes].includes(e),switchProps=buildProps({modelValue:{type:[Boolean,String,Number],default:!1},disabled:Boolean,loading:Boolean,size:{type:String,validator:isValidComponentSize},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:iconPropType},activeActionIcon:{type:iconPropType},activeIcon:{type:iconPropType},inactiveIcon:{type:iconPropType},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:definePropType(Function)},id:String,tabindex:{type:[String,Number]},...useAriaProps(["ariaLabel"])}),switchEmits={[UPDATE_MODEL_EVENT]:e=>isBoolean$1(e)||isString$5(e)||isNumber$1(e),[CHANGE_EVENT]:e=>isBoolean$1(e)||isString$5(e)||isNumber$1(e),[INPUT_EVENT]:e=>isBoolean$1(e)||isString$5(e)||isNumber$1(e)},COMPONENT_NAME="ElSwitch",__default__$1=defineComponent({name:COMPONENT_NAME}),_sfc_main$j=defineComponent({...__default__$1,props:switchProps,emits:switchEmits,setup(e,{expose:t,emit:n}){const a=e,{formItem:s}=useFormItem(),o=useFormSize(),c=useNamespace("switch"),{inputId:f}=useFormItemInputId(a,{formItemContext:s}),y=useFormDisabled(computed(()=>a.loading)),m=ref(a.modelValue!==!1),g=ref(),z=ref(),ie=computed(()=>[c.b(),c.m(o.value),c.is("disabled",y.value),c.is("checked",pe.value)]),re=computed(()=>[c.e("label"),c.em("label","left"),c.is("active",!pe.value)]),he=computed(()=>[c.e("label"),c.em("label","right"),c.is("active",pe.value)]),_e=computed(()=>({width:addUnit(a.width)}));watch(()=>a.modelValue,()=>{m.value=!0});const $e=computed(()=>m.value?a.modelValue:!1),pe=computed(()=>$e.value===a.activeValue);[a.activeValue,a.inactiveValue].includes($e.value)||(n(UPDATE_MODEL_EVENT,a.inactiveValue),n(CHANGE_EVENT,a.inactiveValue),n(INPUT_EVENT,a.inactiveValue)),watch(pe,At=>{var Et;g.value.checked=At,a.validateEvent&&((Et=s==null?void 0:s.validate)==null||Et.call(s,"change").catch(ze=>debugWarn(ze)))});const Ce=()=>{const At=pe.value?a.inactiveValue:a.activeValue;n(UPDATE_MODEL_EVENT,At),n(CHANGE_EVENT,At),n(INPUT_EVENT,At),nextTick(()=>{g.value.checked=pe.value})},Oe=()=>{if(y.value)return;const{beforeChange:At}=a;if(!At){Ce();return}const Et=At();[isPromise$1(Et),isBoolean$1(Et)].includes(!0)||throwError(COMPONENT_NAME,"beforeChange must return type `Promise<boolean>` or `boolean`"),isPromise$1(Et)?Et.then(kt=>{kt&&Ce()}).catch(kt=>{debugWarn(COMPONENT_NAME,`some error occurred: ${kt}`)}):Et&&Ce()},qe=()=>{var At,Et;(Et=(At=g.value)==null?void 0:At.focus)==null||Et.call(At)};return onMounted(()=>{g.value.checked=pe.value}),t({focus:qe,checked:pe}),(At,Et)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(ie)),onClick:withModifiers(Oe,["prevent"])},[createBaseVNode("input",{id:unref(f),ref_key:"input",ref:g,class:normalizeClass(unref(c).e("input")),type:"checkbox",role:"switch","aria-checked":unref(pe),"aria-disabled":unref(y),"aria-label":At.ariaLabel,name:At.name,"true-value":At.activeValue,"false-value":At.inactiveValue,disabled:unref(y),tabindex:At.tabindex,onChange:Ce,onKeydown:withKeys(Oe,["enter"])},null,42,["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex","onKeydown"]),!At.inlinePrompt&&(At.inactiveIcon||At.inactiveText)?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(unref(re))},[At.inactiveIcon?(openBlock(),createBlock(unref(ElIcon),{key:0},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(At.inactiveIcon)))]),_:1})):createCommentVNode("v-if",!0),!At.inactiveIcon&&At.inactiveText?(openBlock(),createElementBlock("span",{key:1,"aria-hidden":unref(pe)},toDisplayString$1(At.inactiveText),9,["aria-hidden"])):createCommentVNode("v-if",!0)],2)):createCommentVNode("v-if",!0),createBaseVNode("span",{ref_key:"core",ref:z,class:normalizeClass(unref(c).e("core")),style:normalizeStyle(unref(_e))},[At.inlinePrompt?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(unref(c).e("inner"))},[At.activeIcon||At.inactiveIcon?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass(unref(c).is("icon"))},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(unref(pe)?At.activeIcon:At.inactiveIcon)))]),_:1},8,["class"])):At.activeText||At.inactiveText?(openBlock(),createElementBlock("span",{key:1,class:normalizeClass(unref(c).is("text")),"aria-hidden":!unref(pe)},toDisplayString$1(unref(pe)?At.activeText:At.inactiveText),11,["aria-hidden"])):createCommentVNode("v-if",!0)],2)):createCommentVNode("v-if",!0),createBaseVNode("div",{class:normalizeClass(unref(c).e("action"))},[At.loading?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass(unref(c).is("loading"))},{default:withCtx(()=>[createVNode(unref(loading_default))]),_:1},8,["class"])):unref(pe)?renderSlot(At.$slots,"active-action",{key:1},()=>[At.activeActionIcon?(openBlock(),createBlock(unref(ElIcon),{key:0},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(At.activeActionIcon)))]),_:1})):createCommentVNode("v-if",!0)]):unref(pe)?createCommentVNode("v-if",!0):renderSlot(At.$slots,"inactive-action",{key:2},()=>[At.inactiveActionIcon?(openBlock(),createBlock(unref(ElIcon),{key:0},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(At.inactiveActionIcon)))]),_:1})):createCommentVNode("v-if",!0)])],2)],6),!At.inlinePrompt&&(At.activeIcon||At.activeText)?(openBlock(),createElementBlock("span",{key:1,class:normalizeClass(unref(he))},[At.activeIcon?(openBlock(),createBlock(unref(ElIcon),{key:0},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(At.activeIcon)))]),_:1})):createCommentVNode("v-if",!0),!At.activeIcon&&At.activeText?(openBlock(),createElementBlock("span",{key:1,"aria-hidden":!unref(pe)},toDisplayString$1(At.activeText),9,["aria-hidden"])):createCommentVNode("v-if",!0)],2)):createCommentVNode("v-if",!0)],10,["onClick"]))}});var Switch=_export_sfc$1(_sfc_main$j,[["__file","switch.vue"]]);const ElSwitch=withInstall(Switch);function createLoadingComponent(e,t){let n;const a=ref(!1),s=reactive({...e,originalPosition:"",originalOverflow:"",visible:!1});function o(re){s.text=re}function c(){const re=s.parent,he=ie.ns;if(!re.vLoadingAddClassList){let _e=re.getAttribute("loading-number");_e=Number.parseInt(_e)-1,_e?re.setAttribute("loading-number",_e.toString()):(removeClass(re,he.bm("parent","relative")),re.removeAttribute("loading-number")),removeClass(re,he.bm("parent","hidden"))}f(),z.unmount()}function f(){var re,he;(he=(re=ie.$el)==null?void 0:re.parentNode)==null||he.removeChild(ie.$el)}function y(){var re;e.beforeClose&&!e.beforeClose()||(a.value=!0,clearTimeout(n),n=setTimeout(m,400),s.visible=!1,(re=e.closed)==null||re.call(e))}function m(){if(!a.value)return;const re=s.parent;a.value=!1,re.vLoadingAddClassList=void 0,c()}const z=createApp(defineComponent({name:"ElLoading",setup(re,{expose:he}){const{ns:_e,zIndex:$e}=useGlobalComponentSettings("loading");return he({ns:_e,zIndex:$e}),()=>{const pe=s.spinner||s.svg,Ce=h("svg",{class:"circular",viewBox:s.svgViewBox?s.svgViewBox:"0 0 50 50",...pe?{innerHTML:pe}:{}},[h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),Oe=s.text?h("p",{class:_e.b("text")},[s.text]):void 0;return h(Transition,{name:_e.b("fade"),onAfterLeave:m},{default:withCtx(()=>[withDirectives(createVNode("div",{style:{backgroundColor:s.background||""},class:[_e.b("mask"),s.customClass,s.fullscreen?"is-fullscreen":""]},[h("div",{class:_e.b("spinner")},[Ce,Oe])]),[[vShow,s.visible]])])})}}}));Object.assign(z._context,t??{});const ie=z.mount(document.createElement("div"));return{...toRefs(s),setText:o,removeElLoadingChild:f,close:y,handleAfterLeave:m,vm:ie,get $el(){return ie.$el}}}let fullscreenInstance;const Loading=function(e={}){if(!isClient)return;const t=resolveOptions(e);if(t.fullscreen&&fullscreenInstance)return fullscreenInstance;const n=createLoadingComponent({...t,closed:()=>{var s;(s=t.closed)==null||s.call(t),t.fullscreen&&(fullscreenInstance=void 0)}},Loading._context);addStyle(t,t.parent,n),addClassList(t,t.parent,n),t.parent.vLoadingAddClassList=()=>addClassList(t,t.parent,n);let a=t.parent.getAttribute("loading-number");return a?a=`${Number.parseInt(a)+1}`:a="1",t.parent.setAttribute("loading-number",a),t.parent.appendChild(n.$el),nextTick(()=>n.visible.value=t.visible),t.fullscreen&&(fullscreenInstance=n),n},resolveOptions=e=>{var t,n,a,s;let o;return isString$5(e.target)?o=(t=document.querySelector(e.target))!=null?t:document.body:o=e.target||document.body,{parent:o===document.body||e.body?document.body:o,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:o===document.body&&((n=e.fullscreen)!=null?n:!0),lock:(a=e.lock)!=null?a:!1,customClass:e.customClass||"",visible:(s=e.visible)!=null?s:!0,beforeClose:e.beforeClose,closed:e.closed,target:o}},addStyle=async(e,t,n)=>{const{nextZIndex:a}=n.vm.zIndex||n.vm._.exposed.zIndex,s={};if(e.fullscreen)n.originalPosition.value=getStyle(document.body,"position"),n.originalOverflow.value=getStyle(document.body,"overflow"),s.zIndex=a();else if(e.parent===document.body){n.originalPosition.value=getStyle(document.body,"position"),await nextTick();for(const o of["top","left"]){const c=o==="top"?"scrollTop":"scrollLeft";s[o]=`${e.target.getBoundingClientRect()[o]+document.body[c]+document.documentElement[c]-Number.parseInt(getStyle(document.body,`margin-${o}`),10)}px`}for(const o of["height","width"])s[o]=`${e.target.getBoundingClientRect()[o]}px`}else n.originalPosition.value=getStyle(t,"position");for(const[o,c]of Object.entries(s))n.$el.style[o]=c},addClassList=(e,t,n)=>{const a=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?removeClass(t,a.bm("parent","relative")):addClass(t,a.bm("parent","relative")),e.fullscreen&&e.lock?addClass(t,a.bm("parent","hidden")):removeClass(t,a.bm("parent","hidden"))};Loading._context=null;const INSTANCE_KEY=Symbol("ElLoading"),createInstance$1=(e,t)=>{var n,a,s,o;const c=t.instance,f=re=>isObject$4(t.value)?t.value[re]:void 0,y=re=>{const he=isString$5(re)&&(c==null?void 0:c[re])||re;return he&&ref(he)},m=re=>y(f(re)||e.getAttribute(`element-loading-${hyphenate(re)}`)),g=(n=f("fullscreen"))!=null?n:t.modifiers.fullscreen,z={text:m("text"),svg:m("svg"),svgViewBox:m("svgViewBox"),spinner:m("spinner"),background:m("background"),customClass:m("customClass"),fullscreen:g,target:(a=f("target"))!=null?a:g?void 0:e,body:(s=f("body"))!=null?s:t.modifiers.body,lock:(o=f("lock"))!=null?o:t.modifiers.lock},ie=Loading(z);ie._context=vLoading._context,e[INSTANCE_KEY]={options:z,instance:ie}},updateOptions=(e,t)=>{for(const n of Object.keys(t))isRef(t[n])&&(t[n].value=e[n])},vLoading={mounted(e,t){t.value&&createInstance$1(e,t)},updated(e,t){const n=e[INSTANCE_KEY];t.oldValue!==t.value&&(t.value&&!t.oldValue?createInstance$1(e,t):t.value&&t.oldValue?isObject$4(t.value)&&updateOptions(t.value,n.options):n==null||n.instance.close())},unmounted(e){var t;(t=e[INSTANCE_KEY])==null||t.instance.close(),e[INSTANCE_KEY]=null}};vLoading._context=null;const notificationTypes=["primary","success","info","warning","error"],notificationProps=buildProps({customClass:{type:String,default:""},dangerouslyUseHTMLString:Boolean,duration:{type:Number,default:4500},icon:{type:iconPropType},id:{type:String,default:""},message:{type:definePropType([String,Object,Function]),default:""},offset:{type:Number,default:0},onClick:{type:definePropType(Function),default:()=>{}},onClose:{type:definePropType(Function),required:!0},position:{type:String,values:["top-right","top-left","bottom-right","bottom-left"],default:"top-right"},showClose:{type:Boolean,default:!0},title:{type:String,default:""},type:{type:String,values:[...notificationTypes,""],default:""},zIndex:Number,closeIcon:{type:iconPropType,default:close_default}}),notificationEmits={destroy:()=>!0},__default__=defineComponent({name:"ElNotification"}),_sfc_main$i=defineComponent({...__default__,props:notificationProps,emits:notificationEmits,setup(e,{expose:t}){const n=e,{ns:a,zIndex:s}=useGlobalComponentSettings("notification"),{nextZIndex:o,currentZIndex:c}=s,f=ref(!1);let y;const m=computed(()=>{const Ce=n.type;return Ce&&TypeComponentsMap[n.type]?a.m(Ce):""}),g=computed(()=>n.type&&TypeComponentsMap[n.type]||n.icon),z=computed(()=>n.position.endsWith("right")?"right":"left"),ie=computed(()=>n.position.startsWith("top")?"top":"bottom"),re=computed(()=>{var Ce;return{[ie.value]:`${n.offset}px`,zIndex:(Ce=n.zIndex)!=null?Ce:c.value}});function he(){n.duration>0&&({stop:y}=useTimeoutFn(()=>{f.value&&$e()},n.duration))}function _e(){y==null||y()}function $e(){f.value=!1}function pe({code:Ce}){Ce===EVENT_CODE.delete||Ce===EVENT_CODE.backspace?_e():Ce===EVENT_CODE.esc?f.value&&$e():he()}return onMounted(()=>{he(),o(),f.value=!0}),useEventListener(document,"keydown",pe),t({visible:f,close:$e}),(Ce,Oe)=>(openBlock(),createBlock(Transition,{name:unref(a).b("fade"),onBeforeLeave:Ce.onClose,onAfterLeave:qe=>Ce.$emit("destroy"),persisted:""},{default:withCtx(()=>[withDirectives(createBaseVNode("div",{id:Ce.id,class:normalizeClass([unref(a).b(),Ce.customClass,unref(z)]),style:normalizeStyle(unref(re)),role:"alert",onMouseenter:_e,onMouseleave:he,onClick:Ce.onClick},[unref(g)?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass([unref(a).e("icon"),unref(m)])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(unref(g))))]),_:1},8,["class"])):createCommentVNode("v-if",!0),createBaseVNode("div",{class:normalizeClass(unref(a).e("group"))},[createBaseVNode("h2",{class:normalizeClass(unref(a).e("title")),textContent:toDisplayString$1(Ce.title)},null,10,["textContent"]),withDirectives(createBaseVNode("div",{class:normalizeClass(unref(a).e("content")),style:normalizeStyle(Ce.title?void 0:{margin:0})},[renderSlot(Ce.$slots,"default",{},()=>[Ce.dangerouslyUseHTMLString?(openBlock(),createElementBlock(Fragment,{key:1},[createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),createBaseVNode("p",{innerHTML:Ce.message},null,8,["innerHTML"])],2112)):(openBlock(),createElementBlock("p",{key:0},toDisplayString$1(Ce.message),1))])],6),[[vShow,Ce.message]]),Ce.showClose?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass(unref(a).e("closeBtn")),onClick:withModifiers($e,["stop"])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(Ce.closeIcon)))]),_:1},8,["class","onClick"])):createCommentVNode("v-if",!0)],2)],46,["id","onClick"]),[[vShow,f.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var NotificationConstructor=_export_sfc$1(_sfc_main$i,[["__file","notification.vue"]]);const notifications={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]},GAP_SIZE=16;let seed=1;const notify=function(e={},t){if(!isClient)return{close:()=>{}};(isString$5(e)||isVNode$1(e))&&(e={message:e});const n=e.position||"top-right";let a=e.offset||0;notifications[n].forEach(({vm:g})=>{var z;a+=(((z=g.el)==null?void 0:z.offsetHeight)||0)+GAP_SIZE}),a+=GAP_SIZE;const s=`notification_${seed++}`,o=e.onClose,c={...e,offset:a,id:s,onClose:()=>{close(s,n,o)}};let f=document.body;isElement(e.appendTo)?f=e.appendTo:isString$5(e.appendTo)&&(f=document.querySelector(e.appendTo)),isElement(f)||(debugWarn("ElNotification","the appendTo option is not an HTMLElement. Falling back to document.body."),f=document.body);const y=document.createElement("div"),m=createVNode(NotificationConstructor,c,isFunction$4(c.message)?c.message:isVNode$1(c.message)?()=>c.message:null);return m.appContext=isUndefined$1(t)?notify._context:t,m.props.onDestroy=()=>{render(null,y)},render(m,y),notifications[n].push({vm:m}),f.appendChild(y.firstElementChild),{close:()=>{m.component.exposed.visible.value=!1}}};notificationTypes.forEach(e=>{notify[e]=(t={},n)=>((isString$5(t)||isVNode$1(t))&&(t={message:t}),notify({...t,type:e},n))});function close(e,t,n){const a=notifications[t],s=a.findIndex(({vm:m})=>{var g;return((g=m.component)==null?void 0:g.props.id)===e});if(s===-1)return;const{vm:o}=a[s];if(!o)return;n==null||n(o);const c=o.el.offsetHeight,f=t.split("-")[0];a.splice(s,1);const y=a.length;if(!(y<1))for(let m=s;m<y;m++){const{el:g,component:z}=a[m].vm,ie=Number.parseInt(g.style[f],10)-c-GAP_SIZE;z.props.offset=ie}}function closeAll(){for(const e of Object.values(notifications))e.forEach(({vm:t})=>{t.component.exposed.visible.value=!1})}notify.closeAll=closeAll,notify._context=null;const ElNotification=withInstallFunction(notify,"$notify");/*! Element Plus v2.10.1 */var en={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};/*! Element Plus v2.10.1 */var es={name:"es",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"Confirmar",clear:"Despejar"},datepicker:{now:"Ahora",today:"Hoy",cancel:"Cancelar",clear:"Despejar",confirm:"Confirmar",selectDate:"Seleccionar fecha",selectTime:"Seleccionar hora",startDate:"Fecha Incial",startTime:"Hora Inicial",endDate:"Fecha Final",endTime:"Hora Final",prevYear:"Año Anterior",nextYear:"Próximo Año",prevMonth:"Mes Anterior",nextMonth:"Próximo Mes",year:"",month1:"enero",month2:"febrero",month3:"marzo",month4:"abril",month5:"mayo",month6:"junio",month7:"julio",month8:"agosto",month9:"septiembre",month10:"octubre",month11:"noviembre",month12:"diciembre",weeks:{sun:"dom",mon:"lun",tue:"mar",wed:"mié",thu:"jue",fri:"vie",sat:"sáb"},months:{jan:"ene",feb:"feb",mar:"mar",apr:"abr",may:"may",jun:"jun",jul:"jul",aug:"ago",sep:"sep",oct:"oct",nov:"nov",dec:"dic"}},select:{loading:"Cargando",noMatch:"No hay datos que coincidan",noData:"Sin datos",placeholder:"Seleccionar"},mention:{loading:"Cargando"},cascader:{noMatch:"No hay datos que coincidan",loading:"Cargando",placeholder:"Seleccionar",noData:"Sin datos"},pagination:{goto:"Ir a",pagesize:"/página",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages"},messagebox:{confirm:"Aceptar",cancel:"Cancelar",error:"Entrada inválida"},upload:{deleteTip:"Pulse Eliminar para retirar",delete:"Eliminar",preview:"Vista Previa",continue:"Continuar"},table:{emptyText:"Sin Datos",confirmFilter:"Confirmar",resetFilter:"Reiniciar",clearFilter:"Despejar",sumText:"Suma"},tree:{emptyText:"Sin Datos"},transfer:{noMatch:"No hay datos que coincidan",noData:"Sin datos",titles:["Lista 1","Lista 2"],filterPlaceholder:"Ingresar palabra clave",noCheckedFormat:"{total} artículos",hasCheckedFormat:"{checked}/{total} revisados"},image:{error:"HA FALLADO"},pageHeader:{title:"Volver"},popconfirm:{confirmButtonText:"Si",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const _hoisted_1$b={key:0,width:"30",height:"28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$9={key:1,xmlns:"http://www.w3.org/2000/svg",width:"23",height:"23",fill:"none"},_hoisted_3$7={key:2,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"},_hoisted_4$4={key:3,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#31383e"},_hoisted_5$2={key:4,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#31383e"},_hoisted_6$1={key:5,xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none",stroke:"#666e7b","stroke-width":"2","stroke-linejoin":"round","xmlns:v":"https://vecta.io/nano"},_hoisted_7$1={key:6,xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none",stroke:"#666e7b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","xmlns:v":"https://vecta.io/nano"},_hoisted_8$1={key:7,xmlns:"http://www.w3.org/2000/svg",width:"22",height:"23",fill:"none",stroke:"#969eab","stroke-width":"3","stroke-linejoin":"round","xmlns:v":"https://vecta.io/nano"},_hoisted_9={key:8,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"},_hoisted_10={key:9,xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none",stroke:"#666e7b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","xmlns:v":"https://vecta.io/nano"},_hoisted_11={key:10,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"#abb6c8","stroke-width":"1.5","xmlns:v":"https://vecta.io/nano"},_sfc_main$h=defineComponent({__name:"CustomIcon",props:{icon:{}},setup(e){const t=e;return(n,a)=>t.icon==="back"?(openBlock(),createElementBlock("svg",_hoisted_1$b,a[0]||(a[0]=[createBaseVNode("path",{d:"M2 14.219h26.5M2 13.781 13.781 2M2 14.219 13.781 26",stroke:"#000","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))):t.icon==="close"?(openBlock(),createElementBlock("svg",_hoisted_2$9,a[1]||(a[1]=[createBaseVNode("path",{d:"m2 2 18.738 18.738M2.12 21.107 20.857 2.37",stroke:"#000","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))):t.icon==="error"?(openBlock(),createElementBlock("svg",_hoisted_3$7,a[2]||(a[2]=[createBaseVNode("circle",{cx:"25",cy:"25",r:"25",fill:"#d75a4a"},null,-1),createBaseVNode("path",{fill:"none",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-miterlimit":"10",d:"M16 34l9-9 9-9M16 16l9 9 9 9"},null,-1)]))):t.icon==="eye"?(openBlock(),createElementBlock("svg",_hoisted_4$4,a[3]||(a[3]=[createBaseVNode("path",{d:"M12 9q1.219 0 2.109.891T15 12t-.891 2.109T12 15t-2.109-.891T9 12t.891-2.109T12 9zm0 8.016q2.063 0 3.539-1.477T17.016 12t-1.477-3.539T12 6.984 8.461 8.461 6.984 12t1.477 3.539T12 17.016zM12 4.5q3.703 0 6.703 2.063t4.313 5.438q-1.313 3.375-4.313 5.438T12 19.502t-6.703-2.063-4.313-5.438q1.313-3.375 4.313-5.438T12 4.5z"},null,-1)]))):t.icon==="eye-slash"?(openBlock(),createElementBlock("svg",_hoisted_5$2,a[4]||(a[4]=[createBaseVNode("path",{d:"M11.859 9H12q1.219 0 2.109.891T15 12v.188zm-4.312.797Q6.984 10.922 6.984 12q0 2.063 1.477 3.539T12 17.016q1.078 0 2.203-.563l-1.547-1.547Q12.281 15 12 15q-1.219 0-2.109-.891T9 12q0-.281.094-.656zM2.016 4.266L3.282 3l17.719 17.719-1.266 1.266q-.234-.234-1.477-1.453t-1.898-1.875q-2.016.844-4.359.844-3.703 0-6.703-2.063T.985 12q.516-1.219 1.617-2.695t2.133-2.273q-.563-.563-1.57-1.594T2.017 4.266zM12 6.984q-.938 0-1.828.375L8.016 5.203Q9.844 4.5 12 4.5q3.703 0 6.68 2.063t4.289 5.438q-1.125 2.766-3.422 4.734l-2.906-2.906q.375-.891.375-1.828 0-2.063-1.477-3.539T12 6.985z"},null,-1)]))):t.icon==="files"?(openBlock(),createElementBlock("svg",_hoisted_6$1,a[5]||(a[5]=[createBaseVNode("path",{d:"M21 28H7a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10l5 5v14a1 1 0 0 1-1 1Z"},null,-1),createBaseVNode("path",{d:"M10 8V5a1 1 0 0 1 1-1h10l5 5v14a1 1 0 0 1-1 1h-3m-11-5h6m-6 4h6","stroke-linecap":"round"},null,-1)]))):t.icon==="lock"?(openBlock(),createElementBlock("svg",_hoisted_7$1,a[6]||(a[6]=[createBaseVNode("path",{d:"M16 20a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zm0 0v3"},null,-1),createBaseVNode("path",{d:"M26 11H6a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V12a1 1 0 0 0-1-1ZM11.5 11V6.5a4.5 4.5 0 1 1 9 0V11"},null,-1)]))):t.icon==="search"?(openBlock(),createElementBlock("svg",_hoisted_8$1,a[7]||(a[7]=[createBaseVNode("circle",{cx:"9.451",cy:"9.451",r:"7.451"},null,-1),createBaseVNode("path",{d:"M13.921 15.412 19.51 21","stroke-linecap":"round"},null,-1)]))):t.icon==="success"?(openBlock(),createElementBlock("svg",_hoisted_9,a[8]||(a[8]=[createBaseVNode("circle",{cx:"25",cy:"25",r:"25",fill:"#25ae88"},null,-1),createBaseVNode("path",{fill:"none",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":"10",d:"M38 15L22 33l-10-8"},null,-1)]))):t.icon==="users"?(openBlock(),createElementBlock("svg",_hoisted_10,a[9]||(a[9]=[createBaseVNode("path",{d:"M16 22.5a5 5 0 1 0 0-10 5 5 0 0 0 0 10zm8.5-8a7.475 7.475 0 0 1 6 3m-29 0a7.474 7.474 0 0 1 6-3"},null,-1),createBaseVNode("path",{d:"M8.8 27a8.012 8.012 0 0 1 14.4 0M7.5 14.5a4 4 0 1 1 3.925-4.75m9.15 0A4 4 0 1 1 24.5 14.5"},null,-1)]))):t.icon==="x-circle"?(openBlock(),createElementBlock("svg",_hoisted_11,a[10]||(a[10]=[createBaseVNode("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z","stroke-miterlimit":"10"},null,-1),createBaseVNode("path",{d:"M15 9l-6 6m6 0L9 9","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))):createCommentVNode("",!0)}}),_hoisted_1$a=["src"],_sfc_main$g=defineComponent({__name:"AppLoader",props:{avatar:{default:void 0},grow:{type:Boolean,default:!0},icon:{default:void 0},message:{default:void 0},size:{default:"small"},title:{default:void 0},type:{default:"loading"}},emits:["imagesLoaded","imagesLoading"],setup(e,{emit:t}){const n=e,a=t;return onMounted(()=>{n.avatar&&a("imagesLoading")}),(s,o)=>(openBlock(),createElementBlock("div",{class:normalizeClass([s.$style["loader-body"],[s.$style[`loader-${s.size}`]],[s.$style[`loader-${s.type}`]],{[s.$style["loader-no-grow"]]:s.grow===!1}])},[createBaseVNode("div",{class:normalizeClass(s.$style["loader-container"])},[createBaseVNode("div",{class:normalizeClass(s.$style["loader-inner"])},[createBaseVNode("div",{class:normalizeClass(s.$style["loader-mask"])},[s.avatar?(openBlock(),createElementBlock("img",{key:0,alt:"",src:s.avatar,width:"1",height:"1",onLoad:o[0]||(o[0]=()=>a("imagesLoaded"))},null,40,_hoisted_1$a)):createCommentVNode("",!0),s.icon?(openBlock(),createBlock(_sfc_main$h,{key:1,icon:s.icon},null,8,["icon"])):createCommentVNode("",!0)],2)],2),createBaseVNode("div",{class:normalizeClass(s.$style.loader)},o[1]||(o[1]=[createBaseVNode("span",null,null,-1)]),2)],2),s.title?(openBlock(),createElementBlock("h2",{key:0,class:normalizeClass(s.$style["loader-title"])},toDisplayString$1(s.title),3)):createCommentVNode("",!0),s.message?(openBlock(),createElementBlock("p",{key:1,class:normalizeClass(s.$style["loader-message"])},toDisplayString$1(s.message),3)):createCommentVNode("",!0)],2))}}),loader="pb-w-sync_loader",style0$f={loader,"loader-container-animation":"pb-w-sync_loader-container-animation","loader-clip-animation":"pb-w-sync_loader-clip-animation","loader-bar-animation":"pb-w-sync_loader-bar-animation","loader-body":"pb-w-sync_loader-body","loader-error":"pb-w-sync_loader-error","loader-title":"pb-w-sync_loader-title","loader-success":"pb-w-sync_loader-success","loader-large":"pb-w-sync_loader-large","loader-container":"pb-w-sync_loader-container","loader-inner":"pb-w-sync_loader-inner","loader-loading":"pb-w-sync_loader-loading","loader-no-grow":"pb-w-sync_loader-no-grow","loader-small":"pb-w-sync_loader-small","loader-mask":"pb-w-sync_loader-mask","loader-message":"pb-w-sync_loader-message"},_export_sfc=(e,t)=>{const n=e.__vccOpts||e;for(const[a,s]of t)n[a]=s;return n},cssModules$f={$style:style0$f},AppLoader=_export_sfc(_sfc_main$g,[["__cssModules",cssModules$f]]),_hoisted_1$9=["disabled"],_sfc_main$f=defineComponent({__name:"AccountsSelection",props:{avatar:{default:void 0},buttonDisabledStyle:{type:Boolean,default:!1},client:{},credential:{},disableFormAutocomplete:{type:Boolean,default:!1},getSelectedAccounts:{type:Function,default:void 0},selectClass:{default:""},sync:{}},emits:["done"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),{t:o}=useI18n(),c=ref([]),f=ref(null),y=ref(!1),m=reactive({accounts:[]}),g=ref(!0),z=ref(!0),ie=reactive({accounts:[{type:"array",required:!0,message:o("accounts_selection.form_error"),trigger:"change"}]});let re;function he(){n.getSelectedAccounts?n.getSelectedAccounts(n.credential).then(At=>{re=At,c.value.length>0&&Ce()}).catch(()=>{re=[],c.value.length>0&&Ce()}):re=[],pe()}function _e(){let At=c.value.reduce((Et,ze)=>(Et={...Et,[ze.id_account]:!1},Et),{});return m.accounts.forEach(Et=>{At[Et]=!0}),At}function $e(At){return`**${At.slice(-4)}`}function pe(){const At=setInterval(()=>{n.sync.getAccounts({id_credential:n.credential}).then(Et=>{Et.length>0&&c.value.length===0&&(clearInterval(At),c.value=Et,re&&Ce())}).catch(()=>{clearInterval(At),z.value=!1,y.value=!0,s("accounts-error")})},2e3)}function Ce(){re.length>0&&(m.accounts=re.filter(At=>c.value.some(Et=>Et.id_account===At))),m.accounts.length===0&&c.value.length>0&&(m.accounts=c.value.map(At=>At.id_account)),z.value=!1}const Oe=async(At,Et)=>{At.preventDefault(),Et&&await Et.validate(ze=>{ze&&(s("accounts-selected",_e()),a("done"))})};function qe(At,Et){g.value=!Et}return he(),(At,Et)=>(openBlock(),createElementBlock("div",{class:normalizeClass([At.$style["accounts-selection"],{[At.$style["accounts-api-error"]]:y.value}])},[z.value||y.value?(openBlock(),createBlock(AppLoader,{key:0,avatar:n.avatar,grow:!y.value,message:y.value?unref(o)("accounts_selection.error"):unref(o)("accounts_selection.fetching"),size:"large",title:unref(o)("accounts_selection.fetching"),type:y.value?"error":"loading",onImagesLoaded:Et[0]||(Et[0]=()=>unref(s)("images-loaded")),onImagesLoading:Et[1]||(Et[1]=()=>unref(s)("images-loading"))},null,8,["avatar","grow","message","title","type"])):(openBlock(),createBlock(unref(ElForm),{key:1,ref_key:"accountsFormRef",ref:f,class:normalizeClass(At.$style["accounts-form"]),autocomplete:At.disableFormAutocomplete?"off":"on",disabled:z.value,"hide-required-asterisk":!0,"label-position":"top",model:m,name:"accounts-selection",rules:ie,onSubmit:Et[3]||(Et[3]=ze=>Oe(ze,f.value)),onValidate:qe},{default:withCtx(()=>[createVNode(unref(ElFormItem),{label:n.client.name?unref(o)("accounts_selection.form_label_client",{client:n.client.name}):unref(o)("accounts_selection.form_label"),prop:"accounts"},{default:withCtx(()=>[createVNode(unref(ElCheckboxGroup),{modelValue:m.accounts,"onUpdate:modelValue":Et[2]||(Et[2]=ze=>m.accounts=ze),class:normalizeClass(At.$style["accounts-checkboxes"])},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(c.value,ze=>(openBlock(),createBlock(unref(ElCheckbox),{key:ze.id_account,class:normalizeClass(At.$style["accounts-checkbox"]),name:"accounts",value:ze.id_account},{default:withCtx(()=>[createBaseVNode("div",{class:normalizeClass(At.$style["accounts-checkbox-content"])},[createBaseVNode("div",null,toDisplayString$1(ze.account_type),1),createBaseVNode("div",{class:normalizeClass(At.$style["accounts-checkbox-row"])},[createBaseVNode("div",null,toDisplayString$1($e(ze.number)),1),createBaseVNode("div",null,[createVNode(unref(ElStatistic),{class:normalizeClass(At.$style["accounts-balance"]),value:ze.balance,precision:2},null,8,["class","value"]),createTextVNode(" "+toDisplayString$1(ze.currency),1)])],2)],2)]),_:2},1032,["class","value"]))),128))]),_:1},8,["modelValue","class"])]),_:1},8,["label"]),createBaseVNode("button",{class:"pb-w-sync_primary-button","data-testid":"accounts-button",disabled:At.buttonDisabledStyle&&g.value,type:"submit"},toDisplayString$1(unref(o)("accounts_selection.done")),9,_hoisted_1$9)]),_:1},8,["class","autocomplete","disabled","model","rules"])),y.value?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(At.$style["accounts-error-button-container"])},[createBaseVNode("button",{class:"pb-w-sync_primary-button","data-testid":"accounts-button",type:"button",onClick:Et[4]||(Et[4]=()=>a("done"))},toDisplayString$1(unref(o)("accounts_selection.done")),1)],2)):createCommentVNode("",!0)],2))}}),style0$e={"accounts-balance":"pb-w-sync_accounts-balance","accounts-checkbox":"pb-w-sync_accounts-checkbox","accounts-checkbox-content":"pb-w-sync_accounts-checkbox-content","accounts-checkbox-row":"pb-w-sync_accounts-checkbox-row","accounts-checkboxes":"pb-w-sync_accounts-checkboxes","accounts-error-button-container":"pb-w-sync_accounts-error-button-container","accounts-form":"pb-w-sync_accounts-form","accounts-selection":"pb-w-sync_accounts-selection","accounts-api-error":"pb-w-sync_accounts-api-error"},cssModules$e={$style:style0$e},AccountsSelection=_export_sfc(_sfc_main$f,[["__cssModules",cssModules$e]]),_sfc_main$e=defineComponent({__name:"FinalResponse",props:{avatar:{},displayAccountsSelection:{type:Boolean},displayAddAnotherButton:{type:Boolean},longMessage:{default:""},message:{default:""},showLogo:{type:Boolean},type:{default:"error"}},emits:["add-other","select-accounts"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),{t:o}=useI18n();return(c,f)=>(openBlock(),createElementBlock("div",{class:normalizeClass(c.$style["final-response-container"])},[createVNode(AppLoader,{avatar:c.showLogo?c.avatar:void 0,grow:!1,icon:c.showLogo?void 0:c.type,message:c.longMessage,size:"large",title:c.message,type:c.type,onImagesLoaded:f[0]||(f[0]=()=>unref(s)("images-loaded")),onImagesLoading:f[1]||(f[1]=()=>unref(s)("images-loading"))},null,8,["avatar","icon","message","title","type"]),c.displayAddAnotherButton&&(!n.displayAccountsSelection||n.type==="error")?(openBlock(),createElementBlock("button",{key:0,class:"pb-w-sync_primary-button",onClick:f[2]||(f[2]=y=>a("add-other"))},toDisplayString$1(unref(o)("common.add_other")),1)):createCommentVNode("",!0),n.displayAccountsSelection&&n.type==="success"?(openBlock(),createElementBlock("button",{key:1,class:"pb-w-sync_primary-button",onClick:f[3]||(f[3]=y=>a("select-accounts"))},toDisplayString$1(unref(o)("common.continue")),1)):createCommentVNode("",!0)],2))}}),style0$d={"final-response-container":"pb-w-sync_final-response-container"},cssModules$d={$style:style0$d},FinalResponse=_export_sfc(_sfc_main$e,[["__cssModules",cssModules$d]]),_hoisted_1$8=["src"],_hoisted_2$8=["src"],_hoisted_3$6=["onClick"],_sfc_main$d=defineComponent({__name:"InstitutionFilters",props:{countryId:{},filteredCountries:{},filteredOrganizationTypes:{},showCountries:{type:Boolean},organizationTypeId:{},selectClass:{}},emits:["update:countryId","update:organizationTypeId"],setup(e,{emit:t}){const n=e,a=t,{t:s}=useI18n(),o=computed(()=>f(n.filteredCountries.find(m=>m.id_country===n.countryId)));function c(m){measureEvent("open_country",{id_country:m}),a("update:countryId",m)}function f(m){return`https://hatscripts.github.io/circle-flags/flags/${m.code.toLocaleLowerCase()}.svg`}function y(m){measureEvent("open_site_organization_type",{id_site_organization_type:m}),a("update:organizationTypeId",m)}return(m,g)=>(openBlock(),createElementBlock(Fragment,null,[createBaseVNode("p",{class:normalizeClass(m.$style["institution-filters-intro"])},toDisplayString$1(unref(s)("common.intro")),3),m.showCountries?(openBlock(),createBlock(unref(ElSelect),{key:0,class:normalizeClass(m.$style["widget-country"]),"model-value":n.countryId,"popper-class":n.selectClass,onChange:c},{prefix:withCtx(()=>[createBaseVNode("img",{src:o.value,width:"44",height:"44",alt:""},null,8,_hoisted_1$8)]),default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(m.filteredCountries,z=>(openBlock(),createBlock(unref(ElOption),{key:z.id_country,class:normalizeClass(m.$style["widget-country-option"]),value:z.id_country,label:z.name},{default:withCtx(()=>[createBaseVNode("img",{src:f(z),width:"44",height:"44",alt:""},null,8,_hoisted_2$8),createBaseVNode("span",null,toDisplayString$1(z.name),1)]),_:2},1032,["class","value","label"]))),128))]),_:1},8,["class","model-value","popper-class"])):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass(m.$style["organization-types-list"])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(m.filteredOrganizationTypes,z=>(openBlock(),createElementBlock("button",{key:z.id_site_organization_type,onClick:()=>y(z.id_site_organization_type)},toDisplayString$1(unref(s)(`common.${z.label}`)),9,_hoisted_3$6))),128))],2)],64))}}),style0$c={"institution-filters-intro":"pb-w-sync_institution-filters-intro","organization-types-list":"pb-w-sync_organization-types-list","widget-country":"pb-w-sync_widget-country","widget-country-option":"pb-w-sync_widget-country-option"},cssModules$c={$style:style0$c},InstitutionFilters=_export_sfc(_sfc_main$d,[["__cssModules",cssModules$c]]),_hoisted_1$7=["onClick"],_hoisted_2$7=["alt","src"],_hoisted_3$5={key:1},_sfc_main$c=defineComponent({__name:"OrganizationSitesList",props:{assetsPath:{default:"https://s.paybook.com"},items:{default:()=>[]},showLogo:{type:Boolean,default:!0},showPlaidSitesButton:{type:Boolean,default:!1}},emits:["select"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),{t:o}=useI18n(),c=ref("");let f=0;const y=computed(()=>{const z=c.value.toLocaleLowerCase();return n.items.map(ie=>({...ie,show:z===""?!0:ie.name.toLocaleLowerCase().includes(z)}))});onMounted(()=>{n.items.length>0&&n.showLogo&&(f=0,s("images-loading"))}),watch(()=>n.items,z=>{z.length>0&&n.showLogo&&(f=0,s("images-loading"))});function m(){f++,f===n.items.length&&s("images-loaded")}function g(z){a("select",z)}return(z,ie)=>z.showPlaidSitesButton?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(z.$style["widget-plaid-container"])},[createBaseVNode("button",{class:"pb-w-sync_primary-button",onClick:ie[0]||(ie[0]=()=>unref(s)("__internal__.plaid-sites-clicked"))},toDisplayString$1(unref(o)("common.find_your_institution")),1)],2)):(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(unref(ElInput),{modelValue:c.value,"onUpdate:modelValue":ie[1]||(ie[1]=re=>c.value=re),"data-testid":"search-organization",placeholder:unref(o)("common.search")},{prefix:withCtx(()=>[createVNode(_sfc_main$h,{icon:"search"})]),_:1},8,["modelValue","placeholder"]),createBaseVNode("div",{class:normalizeClass(z.$style["organization-sites"])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(y.value,(re,he)=>withDirectives((openBlock(),createElementBlock("button",{key:`${re.id_site_organization}-${he}`,class:normalizeClass(z.$style["organization-button"]),type:"button",onClick:()=>g(re)},[z.showLogo?(openBlock(),createElementBlock("img",{key:0,alt:re.name,src:`${z.assetsPath}${re.small_cover}`,loading:"lazy",height:"66",width:"220",onLoad:m},null,40,_hoisted_2$7)):(openBlock(),createElementBlock("span",_hoisted_3$5,toDisplayString$1(re.name),1))],10,_hoisted_1$7)),[[vShow,re.show]])),128))],2)],64))}}),style0$b={"widget-plaid-container":"pb-w-sync_widget-plaid-container","organization-sites":"pb-w-sync_organization-sites","organization-button":"pb-w-sync_organization-button"},cssModules$b={$style:style0$b},OrganizationSitesList=_export_sfc(_sfc_main$c,[["__cssModules",cssModules$b]]),_hoisted_1$6={key:0},_hoisted_2$6=["src"],_hoisted_3$4=["src"],_hoisted_4$3=["href"],_sfc_main$b=defineComponent({__name:"PrivacyPolicy",props:{client:{}},emits:["continue"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),{t:o}=useI18n(),c="https://www.paybook.com/lib/syncfy/";let f=0;onMounted(()=>{s("images-loading")});function y(){s("privacy-accepted"),a("continue")}function m(){f++,(f===1&&!n.client.logo||f===2)&&s("images-loaded")}return(g,z)=>(openBlock(),createElementBlock("div",{class:normalizeClass(g.$style["privacy-container"])},[z[1]||(z[1]=createBaseVNode("div",null,null,-1)),createBaseVNode("div",{class:normalizeClass(g.$style["privacy-center"])},[createBaseVNode("div",{class:normalizeClass([g.$style["privacy-images"],{[g.$style["with-client-logo"]]:n.client.logo}])},[n.client.logo?(openBlock(),createElementBlock("div",_hoisted_1$6,[createBaseVNode("img",{src:n.client.logo,alt:"",onLoad:m},null,40,_hoisted_2$6)])):createCommentVNode("",!0),createBaseVNode("div",null,[createBaseVNode("img",{src:`${unref(c)}blog/syncfy-icon.svg`,alt:"",width:"190",height:"43",onLoad:m},null,40,_hoisted_3$4)])],2),createBaseVNode("h1",null,toDisplayString$1(n.client.name?unref(o)("privacy.title_client",{client:n.client.name}):unref(o)("privacy.title")),1),createBaseVNode("ul",null,[createBaseVNode("li",null,[createVNode(_sfc_main$h,{icon:"files"}),createTextVNode(" "+toDisplayString$1(unref(o)("privacy.list.first")),1)]),createBaseVNode("li",null,[createVNode(_sfc_main$h,{icon:"lock"}),createTextVNode(" "+toDisplayString$1(unref(o)("privacy.list.second")),1)]),createBaseVNode("li",null,[createVNode(_sfc_main$h,{icon:"users"}),createTextVNode(" "+toDisplayString$1(unref(o)("privacy.list.third")),1)])]),createBaseVNode("button",{class:"pb-w-sync_primary-button","data-testid":"privacy-button",type:"button",onClick:y},toDisplayString$1(unref(o)("common.continue")),1),createBaseVNode("p",null,[createTextVNode(toDisplayString$1(unref(o)("privacy.message"))+" ",1),createBaseVNode("a",{rel:"noopener",href:unref(o)("privacy.url"),target:"_blank"},toDisplayString$1(unref(o)("privacy.link")),9,_hoisted_4$3),z[0]||(z[0]=createTextVNode(". ",-1))])],2),z[2]||(z[2]=createBaseVNode("div",null,null,-1))],2))}}),style0$a={"privacy-container":"pb-w-sync_privacy-container","privacy-center":"pb-w-sync_privacy-center","privacy-images":"pb-w-sync_privacy-images","with-client-logo":"pb-w-sync_with-client-logo"},cssModules$a={$style:style0$a},PrivacyPolicy=_export_sfc(_sfc_main$b,[["__cssModules",cssModules$a]]),_hoisted_1$5=["for"],_hoisted_2$5=["aria-label"],_hoisted_3$3=["accept","name"],_sfc_main$a=defineComponent({__name:"FileInput",props:{credential:{},displayError:{type:Boolean},idSite:{}},emits:["input","validate"],setup(e,{emit:t}){const n=e,a=t,{t:s}=useI18n(),o=ref(null),c=ref(null),f=ref(!1),y=ref(!1),m=computed(()=>g.value.join(",")),g=computed(()=>{const Oe=[],qe=[];let At="";return n.credential.accept&&n.credential.accept.forEach(Et=>{Oe.push(`.${Et.extension}`),Oe.push(Et.mime_type)}),Oe.sort(),Oe.forEach(Et=>{Et!==At&&(qe.push(Et),At=Et)}),qe}),z=computed(()=>f.value&&!c.value&&!y.value),ie=computed(()=>{const Oe=g.value.filter(qe=>qe[0]===".");return Oe.length>1?s("file.invalid_multiple",{extensions:Oe.join(", ")}):s("file.invalid",{extension:Oe[0]})});watch(()=>n.displayError,Oe=>{Oe&&(f.value=!0)});function re(Oe){const qe=new FileReader;qe.onload=At=>{c.value={file:At.target.result,info:{type:Oe.type,name:Oe.name}},a("input",At.target.result)},qe.readAsDataURL(Oe)}function he(Oe){Oe.preventDefault(),Oe.dataTransfer.files[0]&&re(Oe.dataTransfer.files[0])}function _e(Oe){y.value=!1;const qe=Oe.target.files[0],At=Oe.srcElement.value;Oe.preventDefault(),Oe.stopPropagation(),At.length>0?g.value.length===0||g.value.includes(qe.type)||g.value.includes(`.${At.split(".").pop()}`)?(a("validate",!0),re(qe)):qe.value||(y.value=!0,a("validate",!1)):qe.value||a("validate",!1)}function $e(Oe){Oe.stopPropagation(),Oe.preventDefault(),setTimeout(()=>{f.value=!0},2e3)}function pe(Oe){Oe.stopPropagation(),c.value=null,o.value.value=null,a("input",null)}function Ce(Oe){Oe.preventDefault(),o.value.click(),setTimeout(()=>{f.value=!0},5e3)}return(Oe,qe)=>(openBlock(),createElementBlock("div",{class:normalizeClass(Oe.$style["upload-document"])},[createBaseVNode("div",{class:normalizeClass(Oe.$style["upload-document-input"]),onClick:qe[1]||(qe[1]=At=>Ce(At)),onDrop:qe[2]||(qe[2]=At=>he(At)),onDragover:qe[3]||(qe[3]=At=>$e(At))},[createBaseVNode("label",{class:normalizeClass(Oe.$style["upload-document-label"]),for:`${n.idSite}[${n.credential.name}]`},toDisplayString$1(n.credential.label),11,_hoisted_1$5),c.value?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(Oe.$style["upload-document-name"])},[createBaseVNode("span",null,toDisplayString$1(c.value?c.value.info.name:Oe.$t("file.no_chosen")),1),createBaseVNode("button",{"aria-label":unref(s)("common.back"),class:normalizeClass(Oe.$style["widget-back-button"]),onClick:qe[0]||(qe[0]=At=>pe(At))},[createVNode(_sfc_main$h,{icon:"x-circle"})],10,_hoisted_2$5)],2)):(openBlock(),createElementBlock("button",{key:1,class:normalizeClass(Oe.$style["upload-document-button"])},toDisplayString$1(Oe.$t("file.click")),3))],34),z.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Oe.$style["upload-document-required-error"])},toDisplayString$1(n.credential.label)+" "+toDisplayString$1(Oe.$t("file.required")),3)):createCommentVNode("",!0),y.value?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(Oe.$style["upload-document-required-error"])},toDisplayString$1(ie.value),3)):createCommentVNode("",!0),createBaseVNode("input",{ref_key:"fileInput",ref:o,type:"file","data-testid":"file-input",accept:m.value,style:{position:"absolute",left:"-99999999px"},name:`${n.idSite}[${n.credential.name}]`,onClick:qe[4]||(qe[4]=At=>At.stopPropagation()),onChange:qe[5]||(qe[5]=At=>_e(At))},null,40,_hoisted_3$3)],2))}}),style0$9={"upload-document":"pb-w-sync_upload-document","upload-document-button":"pb-w-sync_upload-document-button","upload-document-input":"pb-w-sync_upload-document-input","upload-document-label":"pb-w-sync_upload-document-label","upload-document-name":"pb-w-sync_upload-document-name","upload-document-required-error":"pb-w-sync_upload-document-required-error"},cssModules$9={$style:style0$9},FileInput=_export_sfc(_sfc_main$a,[["__cssModules",cssModules$9]]);function isSiteV1Service(e){return e.version===1}function isSiteV3Service(e){return e.version===3}function isSiteV4Service(e){return e.version===4}const _hoisted_1$4={key:1},_hoisted_2$4=["alt","src"],_hoisted_3$2=["aria-label"],_hoisted_4$2={class:"el-form-item__error"},_hoisted_5$1=["disabled"],_sfc_main$9=defineComponent({__name:"SiteForm",props:{assetsPath:{default:"https://s.paybook.com"},backUpConnection:{type:Boolean},buttonDisabledStyle:{type:Boolean,default:!1},credentialService:{default:null},disableFormAutocomplete:{type:Boolean,default:!1},displayBackButton:{type:Boolean},errorMessage:{default:null},loaderMessage:{},selectClass:{default:""},showHeader:{type:Boolean,default:!0},showLogo:{type:Boolean,default:!0},showPasswordStyle:{default:"icon"},site:{},testMode:{type:Boolean,default:!1},updateMode:{type:Boolean,default:!1}},emits:["back","error","success","valid"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),o=ref("0"),c=ref({...isSiteV1Service(n.site)?n.site.data:isSiteV3Service(n.site)?n.site.input[o.value].data:n.backUpConnection?n.site.backUpInput.data:n.site.input[o.value].data}),f=ref(!0),y=ref(!1),m=ref(!1),g=ref(!1),z=ref(!1);let ie=0,re=null,he={};const _e=ref(null),$e=ref(null),pe=computed(()=>isSiteV1Service(n.site)?n.site.getFields(n.updateMode):isSiteV3Service(n.site)?n.site.getFields(Number.parseInt(o.value),n.updateMode):isSiteV4Service(n.site)?n.backUpConnection?n.site.getBackUpFields(n.updateMode):n.site.getFields(Number.parseInt(o.value),n.updateMode):null),Ce=computed(()=>isSiteV1Service(n.site)?n.site.getRules(n.updateMode):isSiteV3Service(n.site)?n.site.getRules(Number.parseInt(o.value),n.updateMode):n.backUpConnection?n.site.getBackUpRules(n.updateMode):n.site.getRules(Number.parseInt(o.value),n.updateMode)),Oe=computed(()=>n.site.config.version===3?n.site.config.input:isSiteV4Service(n.site)?n.backUpConnection?[n.site.backUpConnection]:n.site.connections:[]),{t:qe}=useI18n();onBeforeUnmount(()=>{clearTimeout(re)}),onMounted(()=>{n.showLogo&&s("images-loading"),kt(),xe(),n.site.on("status-update",Ve=>{Ve==="loading"?y.value=!0:y.value=!1})});function At(Ve){return Ve.getTime()>Date.now()}function Et(Ve){return!!c.value[Ve]}function ze(){clearTimeout(re),n.testMode&&(ie<2?(ie++,re=setTimeout(()=>{ie=0},500)):(n.site.toggleTestMode(),z.value=n.site.testMode,ie=0))}function kt(){_e.value&&_e.value[0]&&_e.value[0].focus()}function Pt(Ve){return Ve.translate_error_label?qe(Ve.translate_error_label):Ve.error_label?Ve.error_label:Ve.translate_label?qe(Ve.translate_label):Ve.label}function jt(){s("images-loaded")}function Ie(Ve){return Ve.enabled_by?c.value[Ve.enabled_by]:!0}function u(){n.site.status==="loading"&&(y.value=!0)}function v(Ve){n.site.updateData(Number.parseInt(o.value),c.value),o.value=Ve,c.value={...n.site.input[o.value].data},xe(),nextTick(()=>{kt()})}const Y=async(Ve,Ue)=>{Ve.preventDefault();let Ne;Ue&&await Ue.validate(L=>{L&&!f.value?(a("valid"),s("submitted"),n.updateMode?(Ne=n.credentialService.update(n.site,c.value,Number.parseInt(o.value),n.backUpConnection),y.value=!0):isSiteV1Service(n.site)?Ne=n.site.connect(c.value):isSiteV3Service(n.site)?Ne=n.site.connect(Number.parseInt(o.value),c.value):Ne=n.site.connect(Number.parseInt(o.value),c.value,n.backUpConnection),Ne.then(Fe=>(a("success",Fe),n.site.config.request||s("updated",n.site.response),Fe)).catch(Fe=>{c.value={},xe(),a("error",Fe)})):g.value=!0})};function ae(Ve,Ue,Ne){Ne&&Ne.forEach(L=>{Ve?Ce.value[L].push({required:!0,message:"required"}):Ce.value[L]=Ce.value[L].filter(Fe=>Fe.message!=="required")})}function xe(Ve,Ue){Ve&&(he[Ve]=Ue),f.value=Object.keys(Ce.value).reduce((Ne,L)=>Ce.value[L].length===0?Ne:Ne||!he[L],!1)}return u(),(Ve,Ue)=>y.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Ve.$style["widget-form-loader"])},[createVNode(AppLoader,{avatar:Ve.showLogo?`${Ve.assetsPath}${Ve.site.config.site_organization.avatar}`:void 0,message:n.loaderMessage.long,title:n.loaderMessage.short,size:"large",onImagesLoaded:Ue[0]||(Ue[0]=()=>unref(s)("images-loaded")),onImagesLoading:Ue[1]||(Ue[1]=()=>unref(s)("images-loading"))},null,8,["avatar","message","title"])],2)):(openBlock(),createElementBlock("div",_hoisted_1$4,[createBaseVNode("div",{class:normalizeClass(Ve.$style["site-form-header"])},[z.value?(openBlock(),createBlock(unref(ElAlert),{key:0,center:"",closable:!1,effect:"dark"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(qe)("common.test_mode")),1)]),_:1})):createCommentVNode("",!0),Ve.showLogo&&Ve.showHeader?(openBlock(),createElementBlock("img",{key:1,alt:Ve.site.config.site_organization.name,class:normalizeClass(Ve.$style["site-cover"]),src:`${Ve.assetsPath}${Ve.site.config.site_organization.cover}`,width:"1600",height:"480",onLoad:jt},null,42,_hoisted_2$4)):createCommentVNode("",!0),Ve.showHeader?(openBlock(),createElementBlock("h2",{key:2,onClick:ze},toDisplayString$1(Ve.site.config.name),1)):createCommentVNode("",!0)],2),Ve.errorMessage?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Ve.$style["auth-error"])},[createBaseVNode("h3",null,toDisplayString$1(Ve.errorMessage.short),1),createBaseVNode("p",null,toDisplayString$1(Ve.errorMessage.long),1)],2)):createCommentVNode("",!0),Oe.value.length>1&&!n.backUpConnection?(openBlock(),createBlock(unref(ElMenu),{key:1,"default-active":"0",mode:"horizontal",class:normalizeClass(Ve.$style["site-tabs"]),ellipsis:!1,onSelect:v},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(Oe.value,(Ne,L)=>(openBlock(),createBlock(unref(ElMenuItem),{key:L,index:`${L}`},{default:withCtx(()=>[createTextVNode(toDisplayString$1(Ne.label),1)]),_:2},1032,["index"]))),128))]),_:1},8,["class"])):createCommentVNode("",!0),createVNode(unref(ElForm),{ref_key:"siteFormRef",ref:$e,"data-testid":"site-form",autocomplete:Ve.disableFormAutocomplete?"off":"on",disabled:y.value,"hide-required-asterisk":!0,"label-position":"top",model:c.value,name:`${Ve.site.config.id_site}`,rules:Ce.value,onSubmit:Ue[5]||(Ue[5]=Ne=>Y(Ne,$e.value)),onValidate:xe},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(pe.value,(Ne,L)=>(openBlock(),createElementBlock(Fragment,{key:`${L}-${Ne.name}`},[Ie(Ne)?(openBlock(),createElementBlock(Fragment,{key:0},[Ne.type==="file"?(openBlock(),createBlock(FileInput,{key:`${L}-${Ne.name}`,credential:Ne,"display-error":g.value,"id-site":Ve.site.config.id_site,onInput:Fe=>c.value[Ne.name]=Fe,onValidate:Fe=>xe(Ne.name,Fe)},null,8,["credential","display-error","id-site","onInput","onValidate"])):(openBlock(),createBlock(unref(ElFormItem),{key:1,class:normalizeClass({[Ve.$style["site-switch"]]:Ne.type==="switch"}),label:Ne.translate_label?Ve.$t(Ne.translate_label):Ne.label||"",prop:Ne.name,for:`${Ve.site.config.id_site}[${Ne.name}]`},{error:withCtx(({error:Fe})=>[createBaseVNode("div",_hoisted_4$2,toDisplayString$1(unref(qe)(`form_errors.${Fe}`,{label:Pt(Ne)})),1)]),default:withCtx(()=>[Ne.type==="text"||Ne.type==="password"?(openBlock(),createBlock(unref(ElInput),{key:0,ref_for:!0,ref_key:"firstInput",ref:_e,modelValue:c.value[Ne.name],"onUpdate:modelValue":Fe=>c.value[Ne.name]=Fe,"data-testid":"site-input",autocomplete:Ne.name==="password"?`${Ve.site.config.id_site} new-password`:Ve.disableFormAutocomplete?"off":`${Ve.site.config.id_site} ${Ne.name}`,name:`${Ve.site.config.id_site}[${Ne.name}]`,type:Ne.type==="password"&&m.value?"text":Ne.type},createSlots({_:2},[Ne.type==="password"&&Ve.showPasswordStyle==="icon"?{name:"append",fn:withCtx(()=>[createBaseVNode("button",{class:normalizeClass(Ve.$style["icon-eye"]),"aria-label":unref(qe)(`common.${m.value?"hide":"show_password"}`),type:"button",onClick:Ue[2]||(Ue[2]=()=>{m.value=!m.value})},[m.value?(openBlock(),createBlock(_sfc_main$h,{key:0,icon:"eye-slash"})):(openBlock(),createBlock(_sfc_main$h,{key:1,icon:"eye"}))],10,_hoisted_3$2)]),key:"0"}:void 0]),1032,["modelValue","onUpdate:modelValue","autocomplete","name","type"])):createCommentVNode("",!0),Ne.type==="select"?(openBlock(),createBlock(unref(ElSelect),{key:1,ref_for:!0,ref_key:"firstInput",ref:_e,modelValue:c.value[Ne.name],"onUpdate:modelValue":Fe=>c.value[Ne.name]=Fe,"data-testid":"site-select","popper-class":Ve.selectClass,autocomplete:Ve.disableFormAutocomplete?"off":`${Ve.site.config.id_site} ${Ne.name}`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(Ne.options,(Fe,Dt)=>(openBlock(),createBlock(unref(ElOption),{key:Dt,value:Fe.value,label:Fe.label},null,8,["value","label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","popper-class","autocomplete"])):createCommentVNode("",!0),Ne.type==="switch"?(openBlock(),createBlock(unref(ElSwitch),{key:2,ref_for:!0,ref_key:"firstInput",ref:_e,modelValue:c.value[Ne.name],"onUpdate:modelValue":Fe=>c.value[Ne.name]=Fe,onInput:Fe=>ae(Fe,Ne.name,Ne.enables)},null,8,["modelValue","onUpdate:modelValue","onInput"])):createCommentVNode("",!0),Ne.type==="date_range"?(openBlock(),createBlock(unref(ElDatePicker),{key:3,ref_for:!0,ref_key:"firstInput",ref:_e,modelValue:c.value[Ne.name],"onUpdate:modelValue":Fe=>c.value[Ne.name]=Fe,type:"daterange","range-separator":"-","start-placeholder":Ve.$t("download_options.date_range_start"),"end-placeholder":Ve.$t("download_options.date_range_end"),"disabled-date":At},null,8,["modelValue","onUpdate:modelValue","start-placeholder","end-placeholder"])):createCommentVNode("",!0)]),_:2},1032,["class","label","prop","for"])),Ne.type==="password"&&Ve.showPasswordStyle==="text"&&Et(Ne.name)?(openBlock(),createBlock(unref(ElButton),{key:`${L}-${Ne.name}-toggle`,class:normalizeClass(Ve.$style["show-hide"]),"native-type":"button",onClick:Ue[3]||(Ue[3]=()=>{m.value=!m.value})},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(qe)(`common.${m.value?"hide":"show_password"}`)),1)]),_:2},1032,["class"])):createCommentVNode("",!0)],64)):createCommentVNode("",!0)],64))),128)),createBaseVNode("div",{class:normalizeClass(Ve.$style["site-buttons"])},[Ve.displayBackButton?(openBlock(),createElementBlock("button",{key:0,class:"pb-w-sync_secondary-button","data-testid":"site-back",type:"button",onClick:Ue[4]||(Ue[4]=()=>a("back"))},toDisplayString$1(unref(qe)("common.back")),1)):createCommentVNode("",!0),createBaseVNode("button",{class:"pb-w-sync_primary-button","data-testid":"site-button",disabled:Ve.buttonDisabledStyle&&f.value,type:"submit"},toDisplayString$1(unref(qe)("common.next")),9,_hoisted_5$1)],2)]),_:1},8,["autocomplete","disabled","model","name","rules"])]))}}),style0$8={"auth-error":"pb-w-sync_auth-error","icon-eye":"pb-w-sync_icon-eye","show-hide":"pb-w-sync_show-hide","site-buttons":"pb-w-sync_site-buttons","site-form-header":"pb-w-sync_site-form-header","site-cover":"pb-w-sync_site-cover","site-tabs":"pb-w-sync_site-tabs","site-switch":"pb-w-sync_site-switch","widget-form-loader":"pb-w-sync_widget-form-loader"},cssModules$8={$style:style0$8},SiteForm=_export_sfc(_sfc_main$9,[["__cssModules",cssModules$8]]),_hoisted_1$3=["alt","src"],_hoisted_2$3=["onClick"],_sfc_main$8=defineComponent({__name:"SitesList",props:{assetsPath:{},items:{},organization:{},showLogo:{type:Boolean}},emits:["back","select"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter);onMounted(()=>{n.showLogo&&s("images-loading")});function o(){s("images-loaded")}function c(f){a("select",f)}return(f,y)=>(openBlock(),createElementBlock("div",{class:normalizeClass(f.$style["sites-container"])},[f.showLogo?(openBlock(),createElementBlock("img",{key:0,class:normalizeClass(f.$style["organization-cover"]),alt:f.organization.name,src:`${f.assetsPath}${f.organization.cover}`,width:"1600",height:"480",onLoad:o},null,42,_hoisted_1$3)):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass(f.$style.sites)},[(openBlock(!0),createElementBlock(Fragment,null,renderList(f.items,(m,g)=>(openBlock(),createElementBlock("button",{key:`${m.id_site}-${g}`,type:"button",onClick:()=>c(m)},toDisplayString$1(m.name),9,_hoisted_2$3))),128)),createBaseVNode("button",{type:"button",onClick:y[0]||(y[0]=()=>a("back"))},toDisplayString$1(f.$t("common.back")),1)],2)],2))}}),sites="pb-w-sync_sites",style0$7={"organization-cover":"pb-w-sync_organization-cover","sites-container":"pb-w-sync_sites-container",sites},cssModules$7={$style:style0$7},SitesList=_export_sfc(_sfc_main$8,[["__cssModules",cssModules$7]]),_sfc_main$7=defineComponent({__name:"TheModal",props:{mobile:{type:Boolean,default:!1},visible:{type:Boolean,default:!1}},emits:["update:visible"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter);function o(){measureEvent("close"),a("update:visible",!1),s("closed")}return(c,f)=>withDirectives((openBlock(),createElementBlock("div",{class:normalizeClass(c.$style["modal-container"])},[createBaseVNode("div",{class:normalizeClass(c.$style["modal-overlay-backdrop"]),onClick:o},null,2),createBaseVNode("div",{class:normalizeClass(c.$style["modal-wrapper"])},[createBaseVNode("div",{class:normalizeClass([c.$style.modal,{[c.$style["is-mobile"]]:n.mobile}])},[renderSlot(c.$slots,"default")],2)],2)],2)),[[vShow,c.visible]])}}),modal="pb-w-sync_modal",style0$6={"modal-container":"pb-w-sync_modal-container","modal-wrapper":"pb-w-sync_modal-wrapper","modal-overlay-backdrop":"pb-w-sync_modal-overlay-backdrop",modal,"is-mobile":"pb-w-sync_is-mobile"},cssModules$6={$style:style0$6},TheModal=_export_sfc(_sfc_main$7,[["__cssModules",cssModules$6]]),_hoisted_1$2=["onClick"],_hoisted_2$2=["src"],_sfc_main$6=defineComponent({__name:"MultipleImages",props:{credential:{default:()=>({type:"options",name:"token",label:"Por favor, revisa las imágenes que se te presentan y selecciona la correcta",options:[]})},modelValue:{default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter);let o=0;const c=computed(()=>{const m=Math.sqrt(n.credential.options.length);return m%1===0?[m,m]:f(Math.floor(m))});onMounted(()=>{s("images-loading")});function f(m){if(n.credential.options.length%m===0){const g=n.credential.options.length/m;return[m,g]}return f(m-1)}function y(){o++,o===n.credential.options.length&&s("images-loaded")}return(m,g)=>(openBlock(),createElementBlock("div",{class:normalizeClass(m.$style["multiple-images-container"])},[createBaseVNode("div",{class:normalizeClass(m.$style["multiple-images-wrapper"])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(c.value[0],z=>(openBlock(),createElementBlock("div",{key:z,class:normalizeClass(m.$style["credential-options-row"])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(c.value[1],ie=>(openBlock(),createElementBlock("div",{key:ie,class:normalizeClass([m.$style["credential-options-col"],{[m.$style.selected]:m.modelValue===m.credential.options[ie-1+(z-1)*c.value[1]].value}]),onClick:re=>a("update:modelValue",m.credential.options[ie-1+(z-1)*c.value[1]].value)},[createBaseVNode("img",{class:normalizeClass(m.$style["credental-options-img"]),src:m.credential.options[ie-1+(z-1)*c.value[1]].imgBase64File||m.credential.options[ie-1+(z-1)*c.value[1]].imgURL,onLoad:y},null,42,_hoisted_2$2)],10,_hoisted_1$2))),128))],2))),128))],2)],2))}}),selected="pb-w-sync_selected",style0$5={"multiple-images-container":"pb-w-sync_multiple-images-container","multiple-images-wrapper":"pb-w-sync_multiple-images-wrapper","credential-options-row":"pb-w-sync_credential-options-row","credential-options-col":"pb-w-sync_credential-options-col",selected,"credental-options-img":"pb-w-sync_credental-options-img"},cssModules$5={$style:style0$5},MultipleImages=_export_sfc(_sfc_main$6,[["__cssModules",cssModules$5]]),_hoisted_1$1={key:1},_hoisted_2$1=["alt","src"],_hoisted_3$1={key:0},_hoisted_4$1=["src"],_hoisted_5={key:1},_hoisted_6=["src","onLoad"],_hoisted_7=["aria-label"],_hoisted_8=["disabled"],_sfc_main$5=defineComponent({__name:"TwofaForm",props:{avatar:{},buttonDisabledStyle:{type:Boolean},cover:{},disableFormAutocomplete:{type:Boolean},enableBackNavigation:{type:Boolean},inNotification:{type:Boolean},loaderMessage:{},selectClass:{},siteName:{},showLogo:{type:Boolean},showPasswordStyle:{},twofa:{}},emits:["back","error"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),o=inject(translateFunction),c=ref({}),f=ref({...n.twofa.data}),y=ref({}),m=ref([]),g=ref(!1);let z=0,ie=!0,re=!1,he={};const _e=computed(()=>n.twofa.config.twofa.reduce((Y,ae)=>ae.imgBase64File?Y+1:Y,0)),$e=ref(null),pe=ref(null);watch(()=>n.twofa,()=>{Ie()});function Ce(){Ie()}function Oe(Y){return y.value[Y]||{}}function qe(Y){return!!f[Y]}function At(Y){const ae=m.value[Y];ae&&(y.value={...y.value,[Y]:{width:`${ae.naturalWidth}px`}},nextTick(ze))}function Et(){$e.value&&$e.value[0].focus()}function ze(){z++,z===_e.value&&s("images-loaded")}function kt(){const Y={};n.twofa.config.twofa&&n.twofa.config.twofa.length&&n.twofa.config.twofa.forEach(ae=>{ae.type==="accounts"&&(Y[ae.name]=[])}),c.value=Y}function Pt(Y){return["text","password","textOptions","accounts","options"].includes(Y)}function jt(Y){f.value={...f.value,[Y]:c.value[Y].join()}}function Ie(){c.value={},f.value={...n.twofa.data},y.value={},m.value=[],g.value=!1,z=0,ie=!0,re=!1,he={},n.twofa.defineRules(o),kt(),n.twofa.on("loading",()=>{g.value=!0}),n.twofa.on("twofa-device-error",Y=>{a("error",Y)}),n.twofa.on("token-received",()=>{f.value={...n.twofa.data}}),_e.value&&s("images-loading"),v(),n.twofa.config.twofa.forEach(Y=>{["connection","challenge"].includes(Y.type)&&v(Y.name,!0)}),nextTick(()=>{Et()})}function u(){pe.value.validate(Y=>{Y&&(s("submitted"),n.twofa.authenticate({...f.value}).then(ae=>ae).catch(ae=>{a("error",ae)}))})}function v(Y,ae){Y&&(he[Y]=ae),ie=Object.getOwnPropertyNames(n.twofa.rules).reduce((xe,Ve)=>Ve==="__ob__"||n.twofa.rules[Ve].length===0?xe:xe||!he[Ve],!1)}return Ce(),(Y,ae)=>g.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Y.$style["twofa-form-loader"])},[createVNode(AppLoader,{avatar:Y.showLogo?Y.avatar:void 0,message:n.loaderMessage.long,title:n.loaderMessage.short,size:"large",onImagesLoaded:ae[0]||(ae[0]=()=>unref(s)("images-loaded")),onImagesLoading:ae[1]||(ae[1]=()=>unref(s)("images-loading"))},null,8,["avatar","message","title"])],2)):(openBlock(),createElementBlock("div",_hoisted_1$1,[Y.inNotification?createCommentVNode("",!0):(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Y.$style["twofa-form-header"])},[Y.showLogo?(openBlock(),createElementBlock("img",{key:0,alt:Y.siteName,class:normalizeClass(Y.$style["twofa-cover"]),src:Y.cover,width:"1600",height:"480",onLoad:ze},null,42,_hoisted_2$1)):createCommentVNode("",!0),createBaseVNode("h2",null,toDisplayString$1(Y.siteName),1)],2)),n.twofa?(openBlock(),createBlock(unref(ElForm),{key:1,ref_key:"twofaForm",ref:pe,"data-testid":"twofa-form","label-position":"top",disabled:g.value,model:f.value,rules:n.twofa.rules,name:`twofa-${n.twofa.config.id_site}`,autocomplete:n.disableFormAutocomplete?"off":"on",onSubmit:withModifiers(u,["prevent"]),onValidate:v},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(n.twofa.config.twofa,(xe,Ve)=>(openBlock(),createElementBlock(Fragment,{key:`${Ve}-${xe.name}`},[xe.type==="externalAction"?(openBlock(),createElementBlock("div",_hoisted_3$1,[createBaseVNode("label",{class:normalizeClass(Y.$style["external-action-label"])},toDisplayString$1(xe.label),3),createBaseVNode("div",{class:normalizeClass(Y.$style["external-action-img-container"])},[xe.imgBase64File?(openBlock(),createElementBlock("img",{key:0,alt:"",src:xe.imgBase64File,onLoad:ze},null,40,_hoisted_4$1)):createCommentVNode("",!0)],2)])):xe.type==="instructions"?(openBlock(),createElementBlock("div",_hoisted_5,[createBaseVNode("label",{class:normalizeClass(Y.$style["external-action-label"])},toDisplayString$1(xe.label),3)])):createCommentVNode("",!0),Pt(xe.type)?(openBlock(),createBlock(unref(ElFormItem),{key:2,label:xe.label,prop:xe.name,for:`twofa-${n.twofa.config.id_site}[${xe.name}]`},{default:withCtx(()=>[xe.imgBase64File?(openBlock(),createElementBlock("img",{key:0,ref_for:!0,ref_key:"imageWithoutSize",ref:m,src:xe.imgBase64File,class:normalizeClass(Y.$style["input-image"]),style:normalizeStyle(Oe(Ve)),alt:"",onLoad:Ue=>At(Ve)},null,46,_hoisted_6)):createCommentVNode("",!0),xe.type==="text"||xe.type==="password"?(openBlock(),createBlock(unref(ElInput),{key:1,ref_for:!0,ref:Ve===0&&"firstInput",modelValue:f.value[xe.name],"onUpdate:modelValue":Ue=>f.value[xe.name]=Ue,"data-testid":"twofa-input",name:`twofa-${n.twofa.config.id_site}[${xe.name}]`,autocomplete:xe.name==="password"?`${n.twofa.config.id_site} new-password`:n.disableFormAutocomplete?"off":`${n.twofa.config.id_site} ${xe.name}`,disabled:xe.disabled,type:xe.type==="password"&&unref(re)?"text":xe.type},createSlots({_:2},[xe.type==="password"&&n.showPasswordStyle==="icon"?{name:"append",fn:withCtx(()=>[createBaseVNode("button",{class:normalizeClass(Y.$style["icon-eye-twofa"]),"aria-label":unref(o)(`common.${unref(re)?"hide":"show_password"}`),type:"button",onClick:ae[2]||(ae[2]=()=>{isRef(re)?re.value=!unref(re):re=!unref(re)})},[unref(re)?(openBlock(),createBlock(_sfc_main$h,{key:1,icon:"eye-slash"})):(openBlock(),createBlock(_sfc_main$h,{key:0,icon:"eye"}))],10,_hoisted_7)]),key:"0"}:void 0]),1032,["modelValue","onUpdate:modelValue","name","autocomplete","disabled","type"])):createCommentVNode("",!0),xe.type==="textOptions"?(openBlock(),createBlock(unref(ElSelect),{key:2,ref_for:!0,ref:Ve===0&&"firstInput",modelValue:f.value[xe.name],"onUpdate:modelValue":Ue=>f.value[xe.name]=Ue,"data-testid":"twofa-select",autocomplete:n.disableFormAutocomplete?"off":`twofa-${n.twofa.config.id_site} ${xe.name}`,name:`twofa-${n.twofa.config.id_site}[${xe.name}]`,"popper-class":n.selectClass},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(xe.options,(Ue,Ne)=>(openBlock(),createBlock(unref(ElOption),{key:Ne,value:Ue.value,label:Ue.label},null,8,["value","label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","autocomplete","name","popper-class"])):createCommentVNode("",!0),xe.type==="accounts"?(openBlock(),createBlock(unref(ElSelect),{key:3,ref_for:!0,ref:Ve===0&&"firstInput",modelValue:c.value[xe.name],"onUpdate:modelValue":Ue=>c.value[xe.name]=Ue,"data-testid":"twofa-multi-select",autocomplete:n.disableFormAutocomplete?"off":`twofa-${n.twofa.config.id_site} ${xe.name}`,filterable:"",multiple:"",name:`twofa-${n.twofa.config.id_site}[${xe.name}]`,"popper-class":n.selectClass,onChange:()=>jt(xe.name)},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(xe.options,(Ue,Ne)=>(openBlock(),createBlock(unref(ElOption),{key:Ne,value:Ue.value,label:Ue.label},null,8,["value","label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","autocomplete","name","popper-class","onChange"])):createCommentVNode("",!0),xe.type==="options"?(openBlock(),createBlock(MultipleImages,{key:4,modelValue:f.value[xe.name],"onUpdate:modelValue":[Ue=>f.value[xe.name]=Ue,()=>{v(xe.name,!0)}],credential:xe},null,8,["modelValue","onUpdate:modelValue","credential"])):createCommentVNode("",!0)]),_:2},1032,["label","prop","for"])):createCommentVNode("",!0),xe.type==="password"&&n.showPasswordStyle==="text"&&qe(xe.name)?(openBlock(),createBlock(unref(ElButton),{key:`${Ve}-${xe.name}-toggle`,class:normalizeClass(Y.$style["show-hide"]),"native-type":"button",onClick:ae[3]||(ae[3]=()=>{isRef(re)?re.value=!unref(re):re=!unref(re)})},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(o)(`common.${unref(re)?"hide":"show_password"}`)),1)]),_:2},1032,["class"])):createCommentVNode("",!0)],64))),128)),createBaseVNode("div",{class:normalizeClass(Y.$style["twofa-buttons"])},[n.enableBackNavigation?(openBlock(),createElementBlock("button",{key:0,class:"pb-w-sync_secondary-button","data-testid":"twofa-back",type:"button",onClick:ae[4]||(ae[4]=()=>{a("back")})},toDisplayString$1(unref(o)("common.back")),1)):createCommentVNode("",!0),n.twofa.displaySubmitButton?(openBlock(),createElementBlock("button",{key:1,class:"pb-w-sync_primary-button",disabled:n.buttonDisabledStyle&&unref(ie),"data-testid":"twofa-button",type:"submit"},toDisplayString$1(unref(o)("common.next")),9,_hoisted_8)):createCommentVNode("",!0)],2)]),_:1},8,["disabled","model","rules","name","autocomplete"])):createCommentVNode("",!0)]))}}),style0$4={"external-action-img-container":"pb-w-sync_external-action-img-container","external-action-label":"pb-w-sync_external-action-label","icon-eye-twofa":"pb-w-sync_icon-eye-twofa","input-image":"pb-w-sync_input-image","show-hide":"pb-w-sync_show-hide","twofa-buttons":"pb-w-sync_twofa-buttons","twofa-form-header":"pb-w-sync_twofa-form-header","twofa-cover":"pb-w-sync_twofa-cover","twofa-form-loader":"pb-w-sync_twofa-form-loader"},cssModules$4={$style:style0$4},TwofaForm=_export_sfc(_sfc_main$5,[["__cssModules",cssModules$4]]),_sfc_main$4=defineComponent({__name:"TwofaNotification",props:{assetsPath:{default:"https://s.paybook.com"},buttonDisabledStyle:{type:Boolean,default:!1},disableFormAutocomplete:{type:Boolean,default:!1},displayLongDescription:{type:Boolean,default:!1},duration:{},enableBackNavigation:{type:Boolean,default:!1},hideForm:{type:Boolean,default:!1},initLongMessage:{default:null},initMessage:{default:null},initTitle:{default:""},item:{default:null},messagesUpdater:{default:null},rootEmit:{type:Function,default:null},selectClass:{default:""},showLogo:{type:Boolean,default:!1},showPasswordStyle:{default:"icon"},t:{},type:{}},emits:["back","error","imagesLoaded","imagesLoading"],setup(e,{emit:t}){var _e,$e,pe,Ce;const n=e,a=t;provide(rootEmitter,n.rootEmit),provide(translateFunction,n.t);let s=ref(n.initLongMessage||((_e=n.messagesUpdater)==null?void 0:_e.getMessages().long)||""),o=ref(n.initMessage||(($e=n.messagesUpdater)==null?void 0:$e.getMessages().short)||""),c=ref(n.displayLongDescription||!1),f=ref((pe=n.item)==null?void 0:pe.status),y=ref((Ce=n.item)!=null&&Ce.config?n.item.config.name:n.initTitle);const m=computed(()=>n.item&&n.item.config?`${n.assetsPath}${n.item.config.avatar}`:""),g=computed(()=>n.item&&n.item.config?`${n.assetsPath}${n.item.config.cover}`:""),z=computed(()=>n.item?f.value==="twofa"&&!n.hideForm:!1),ie=computed(()=>n.item?n.type==="info"&&f.value!=="twofa":n.type==="info");function re(){n.messagesUpdater&&n.messagesUpdater.subscribe(()=>{const Oe=n.messagesUpdater.getMessages();s.value=Oe.long,o.value=Oe.short}),n.item&&(n.item.on("twofa",()=>{f.value="twofa"}),n.item.on("twofa-loading",()=>{f.value="twofa-loading"}))}function he(){c.value=!c.value}return re(),(Oe,qe)=>(openBlock(),createElementBlock("div",{class:normalizeClass(Oe.$style["twofa-notification"])},[createBaseVNode("div",{class:normalizeClass(Oe.$style["site-identifier"])},[ie.value||Oe.showLogo?(openBlock(),createBlock(AppLoader,{key:0,class:normalizeClass(Oe.$style["notification-loader"]),avatar:Oe.showLogo?m.value:void 0,type:n.type==="info"?"loading":n.type,onImagesLoaded:qe[0]||(qe[0]=()=>a("imagesLoaded")),onImagesLoading:qe[1]||(qe[1]=()=>a("imagesLoading"))},null,8,["class","avatar","type"])):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass([Oe.$style["site-identifier-description"],{[Oe.$style["with-loader"]]:ie.value||Oe.showLogo}])},[createBaseVNode("span",{class:normalizeClass([Oe.$style["site-name"],Oe.$style[n.type]])},toDisplayString$1(unref(y)),3),createBaseVNode("p",{class:normalizeClass(Oe.$style["site-identifier-message"])},toDisplayString$1(unref(o)),3),unref(c)?(openBlock(),createElementBlock("p",{key:0,class:normalizeClass(Oe.$style["site-identifier-long-message"])},toDisplayString$1(unref(s)),3)):createCommentVNode("",!0),n.type!=="info"?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(Oe.$style["widget-notification-show-more-container"])},[unref(s)?(openBlock(),createBlock(unref(ElLink),{key:0,type:"primary",onClick:withModifiers(he,["stop"])},{default:withCtx(()=>[createTextVNode(toDisplayString$1(n.t("common.show",{msg:n.t(`common.${unref(c)?"less":"more"}`)})),1)]),_:1})):createCommentVNode("",!0)],2)):createCommentVNode("",!0)],2)],2),z.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Oe.$style["notification-form"])},[createVNode(TwofaForm,{avatar:m.value,"button-disabled-style":Oe.buttonDisabledStyle,cover:g.value,"disable-form-autocomplete":Oe.disableFormAutocomplete,"enable-back-navigation":Oe.enableBackNavigation,"in-notification":!0,"loader-message":{long:unref(s),short:unref(o)},"select-class":Oe.selectClass,"show-logo":Oe.showLogo,"show-password-style":Oe.showPasswordStyle,"site-name":unref(y),twofa:n.item.twofa,onBack:qe[2]||(qe[2]=()=>a("back")),onError:qe[3]||(qe[3]=At=>a("error",At))},null,8,["avatar","button-disabled-style","cover","disable-form-autocomplete","enable-back-navigation","loader-message","select-class","show-logo","show-password-style","site-name","twofa"])],2)):createCommentVNode("",!0)],2))}}),error="pb-w-sync_error",success="pb-w-sync_success",style0$3={"notification-form":"pb-w-sync_notification-form","notification-loader":"pb-w-sync_notification-loader","site-identifier":"pb-w-sync_site-identifier","site-identifier-description":"pb-w-sync_site-identifier-description","with-loader":"pb-w-sync_with-loader","site-name":"pb-w-sync_site-name",error,success,"site-identifier-long-message":"pb-w-sync_site-identifier-long-message","site-identifier-message":"pb-w-sync_site-identifier-message","twofa-notification":"pb-w-sync_twofa-notification","widget-notification-show-more-container":"pb-w-sync_widget-notification-show-more-container"},cssModules$3={$style:style0$3},TwofaNotification=_export_sfc(_sfc_main$4,[["__cssModules",cssModules$3]]),_sfc_main$3=defineComponent({__name:"UnauthorizedNotification",props:{initMessage:{default:""},initTitle:{default:""},refreshTokenFunction:{},t:{}},emits:["closed","closeNotification","refreshToken","refreshTokenError"],setup(e,{emit:t}){const n=e,a=t;let s=ref(!1);onBeforeUnmount(()=>{a("closed")});function o(){s.value=!0,n.refreshTokenFunction().then(({token:c,strict:f})=>{if(typeof c!="string")throw new Error("Refresh token is not valid. Promise should return a valid token.");return new Promise(y=>{a("refreshToken",{token:c,strict:f,resolve:y})})}).catch(()=>{a("refreshTokenError")}).finally(()=>{s.value=!1})}return(c,f)=>(openBlock(),createElementBlock("div",{class:normalizeClass(c.$style["unauthorized-notification"])},[createBaseVNode("span",null,toDisplayString$1(n.initTitle),1),createBaseVNode("p",null,toDisplayString$1(n.initMessage),1),createBaseVNode("div",{class:normalizeClass(c.$style["unauthorized-button-container"])},[withDirectives((openBlock(),createBlock(unref(ElButton),{disabled:unref(s),type:"primary",onClick:withModifiers(o,["stop"])},{default:withCtx(()=>[createTextVNode(toDisplayString$1(n.t("common.refresh")),1)]),_:1},8,["disabled"])),[[unref(vLoading),unref(s)]]),createVNode(unref(ElButton),{disabled:unref(s),onClick:f[0]||(f[0]=withModifiers(()=>{a("closeNotification")},["stop"]))},{default:withCtx(()=>[createTextVNode(toDisplayString$1(n.t("common.cancel")),1)]),_:1},8,["disabled"])],2)],2))}}),style0$2={"unauthorized-notification":"pb-w-sync_unauthorized-notification","unauthorized-button-container":"pb-w-sync_unauthorized-button-container"},cssModules$2={$style:style0$2},UnauthorizedNotification=_export_sfc(_sfc_main$3,[["__cssModules",cssModules$2]]);var LIBVERSION="2.0.4",UA_MAX_LENGTH=500,USER_AGENT="user-agent",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",UA_BROWSER="browser",UA_CPU="cpu",UA_DEVICE="device",UA_ENGINE="engine",UA_OS="os",UA_RESULT="result",NAME="name",TYPE="type",VENDOR="vendor",VERSION$2="version",ARCHITECTURE="architecture",MAJOR="major",MODEL="model",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",XR="xr",EMBEDDED="embedded",INAPP="inapp",BRANDS="brands",FORMFACTORS="formFactors",FULLVERLIST="fullVersionList",PLATFORM="platform",PLATFORMVER="platformVersion",BITNESS="bitness",CH_HEADER="sec-ch-ua",CH_HEADER_FULL_VER_LIST=CH_HEADER+"-full-version-list",CH_HEADER_ARCH=CH_HEADER+"-arch",CH_HEADER_BITNESS=CH_HEADER+"-"+BITNESS,CH_HEADER_FORM_FACTORS=CH_HEADER+"-form-factors",CH_HEADER_MOBILE=CH_HEADER+"-"+MOBILE,CH_HEADER_MODEL=CH_HEADER+"-"+MODEL,CH_HEADER_PLATFORM=CH_HEADER+"-"+PLATFORM,CH_HEADER_PLATFORM_VER=CH_HEADER_PLATFORM+"-version",CH_ALL_VALUES=[BRANDS,FULLVERLIST,MOBILE,MODEL,PLATFORM,PLATFORMVER,ARCHITECTURE,FORMFACTORS,BITNESS],AMAZON="Amazon",APPLE="Apple",ASUS="ASUS",BLACKBERRY="BlackBerry",GOOGLE="Google",HUAWEI="Huawei",LENOVO="Lenovo",HONOR="Honor",LG="LG",MICROSOFT="Microsoft",MOTOROLA="Motorola",NVIDIA="Nvidia",ONEPLUS="OnePlus",OPPO="OPPO",SAMSUNG="Samsung",SHARP="Sharp",SONY="Sony",XIAOMI="Xiaomi",ZEBRA="Zebra",CHROME="Chrome",CHROMIUM="Chromium",CHROMECAST="Chromecast",EDGE="Edge",FIREFOX="Firefox",OPERA="Opera",FACEBOOK="Facebook",SOGOU="Sogou",PREFIX_MOBILE="Mobile ",SUFFIX_BROWSER=" Browser",WINDOWS="Windows",isWindow=typeof window!==UNDEF_TYPE,NAVIGATOR=isWindow&&window.navigator?window.navigator:void 0,NAVIGATOR_UADATA=NAVIGATOR&&NAVIGATOR.userAgentData?NAVIGATOR.userAgentData:void 0,extend$1=function(e,t){var n={},a=t;if(!isExtensions(t)){a={};for(var s in t)for(var o in t[s])a[o]=t[s][o].concat(a[o]?a[o]:[])}for(var c in e)n[c]=a[c]&&a[c].length%2===0?a[c].concat(e[c]):e[c];return n},enumerize=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},has=function(e,t){if(typeof e===OBJ_TYPE&&e.length>0){for(var n in e)if(lowerize(t)==lowerize(e[n]))return!0;return!1}return isString$1(e)?lowerize(t)==lowerize(e):!1},isExtensions=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||(t?isExtensions(e[n]):!1)},isString$1=function(e){return typeof e===STR_TYPE},itemListToArray=function(e){if(e){for(var t=[],n=strip(/\\?\"/g,e).split(","),a=0;a<n.length;a++)if(n[a].indexOf(";")>-1){var s=trim$1(n[a]).split(";v=");t[a]={brand:s[0],version:s[1]}}else t[a]=trim$1(n[a]);return t}},lowerize=function(e){return isString$1(e)?e.toLowerCase():e},majorize=function(e){return isString$1(e)?strip(/[^\d\.]/g,e).split(".")[0]:void 0},setProps=function(e){for(var t in e){var n=e[t];typeof n==OBJ_TYPE&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},strip=function(e,t){return isString$1(t)?t.replace(e,EMPTY):t},stripQuotes=function(e){return strip(/\\?\"/g,e)},trim$1=function(e,t){if(isString$1(e))return e=strip(/^\s\s*/,e),typeof t===UNDEF_TYPE?e:e.substring(0,UA_MAX_LENGTH)},rgxMapper=function(e,t){if(!(!e||!t))for(var n=0,a,s,o,c,f,y;n<t.length&&!f;){var m=t[n],g=t[n+1];for(a=s=0;a<m.length&&!f&&m[a];)if(f=m[a++].exec(e),f)for(o=0;o<g.length;o++)y=f[++s],c=g[o],typeof c===OBJ_TYPE&&c.length>0?c.length===2?typeof c[1]==FUNC_TYPE?this[c[0]]=c[1].call(this,y):this[c[0]]=c[1]:c.length>=3&&(typeof c[1]===FUNC_TYPE&&!(c[1].exec&&c[1].test)?c.length>3?this[c[0]]=y?c[1].apply(this,c.slice(2)):void 0:this[c[0]]=y?c[1].call(this,y,c[2]):void 0:c.length==3?this[c[0]]=y?y.replace(c[1],c[2]):void 0:c.length==4?this[c[0]]=y?c[3].call(this,y.replace(c[1],c[2])):void 0:c.length>4&&(this[c[0]]=y?c[3].apply(this,[y.replace(c[1],c[2])].concat(c.slice(4))):void 0)):this[c]=y||void 0;n+=2}},strMapper=function(e,t){for(var n in t)if(typeof t[n]===OBJ_TYPE&&t[n].length>0){for(var a=0;a<t[n].length;a++)if(has(t[n][a],e))return n===UNKNOWN?void 0:n}else if(has(t[n],e))return n===UNKNOWN?void 0:n;return t.hasOwnProperty("*")?t["*"]:e},windowsVersionMap={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},formFactorsMap={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},browserHintsMap={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},defaultRegexes={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[VERSION$2,[NAME,PREFIX_MOBILE+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[VERSION$2,[NAME,EDGE+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[VERSION$2,[NAME,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[NAME,VERSION$2],[/opios[\/ ]+([\w\.]+)/i],[VERSION$2,[NAME,OPERA+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[VERSION$2,[NAME,OPERA+" GX"]],[/\bopr\/([\w\.]+)/i],[VERSION$2,[NAME,OPERA]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[VERSION$2,[NAME,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[VERSION$2,[NAME,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[NAME,VERSION$2],[/quark(?:pc)?\/([-\w\.]+)/i],[VERSION$2,[NAME,"Quark"]],[/\bddg\/([\w\.]+)/i],[VERSION$2,[NAME,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[VERSION$2,[NAME,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[VERSION$2,[NAME,"WeChat"]],[/konqueror\/([\w\.]+)/i],[VERSION$2,[NAME,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[VERSION$2,[NAME,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[VERSION$2,[NAME,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[VERSION$2,[NAME,"Smart "+LENOVO+SUFFIX_BROWSER]],[/(avast|avg)\/([\w\.]+)/i],[[NAME,/(.+)/,"$1 Secure"+SUFFIX_BROWSER],VERSION$2],[/\bfocus\/([\w\.]+)/i],[VERSION$2,[NAME,FIREFOX+" Focus"]],[/\bopt\/([\w\.]+)/i],[VERSION$2,[NAME,OPERA+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[VERSION$2,[NAME,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[VERSION$2,[NAME,"Dolphin"]],[/coast\/([\w\.]+)/i],[VERSION$2,[NAME,OPERA+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[VERSION$2,[NAME,"MIUI"+SUFFIX_BROWSER]],[/fxios\/([\w\.-]+)/i],[VERSION$2,[NAME,PREFIX_MOBILE+FIREFOX]],[/\bqihoobrowser\/?([\w\.]*)/i],[VERSION$2,[NAME,"360"]],[/\b(qq)\/([\w\.]+)/i],[[NAME,/(.+)/,"$1Browser"],VERSION$2],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[NAME,/(.+)/,"$1"+SUFFIX_BROWSER],VERSION$2],[/samsungbrowser\/([\w\.]+)/i],[VERSION$2,[NAME,SAMSUNG+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[VERSION$2,[NAME,SOGOU+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[NAME,SOGOU+" Mobile"],VERSION$2],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[NAME,VERSION$2],[/(lbbrowser|rekonq)/i],[NAME],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[VERSION$2,NAME],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[NAME,FACEBOOK],VERSION$2,[TYPE,INAPP]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[NAME,VERSION$2,[TYPE,INAPP]],[/\bgsa\/([\w\.]+) .*safari\//i],[VERSION$2,[NAME,"GSA"],[TYPE,INAPP]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[VERSION$2,[NAME,"TikTok"],[TYPE,INAPP]],[/\[(linkedin)app\]/i],[NAME,[TYPE,INAPP]],[/(chromium)[\/ ]([-\w\.]+)/i],[NAME,VERSION$2],[/headlesschrome(?:\/([\w\.]+)| )/i],[VERSION$2,[NAME,CHROME+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[VERSION$2,[NAME,EDGE+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[NAME,CHROME+" WebView"],VERSION$2],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[VERSION$2,[NAME,"Android"+SUFFIX_BROWSER]],[/chrome\/([\w\.]+) mobile/i],[VERSION$2,[NAME,PREFIX_MOBILE+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[NAME,VERSION$2],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[VERSION$2,[NAME,PREFIX_MOBILE+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[NAME,PREFIX_MOBILE+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[VERSION$2,NAME],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[NAME,[VERSION$2,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[NAME,VERSION$2],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[NAME,PREFIX_MOBILE+FIREFOX],VERSION$2],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[NAME,"Netscape"],VERSION$2],[/(wolvic|librewolf)\/([\w\.]+)/i],[NAME,VERSION$2],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[VERSION$2,[NAME,FIREFOX+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[NAME,[VERSION$2,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[NAME,[VERSION$2,/[^\d\.]+./,EMPTY]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[ARCHITECTURE,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[ARCHITECTURE,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[ARCHITECTURE,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[ARCHITECTURE,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[ARCHITECTURE,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[ARCHITECTURE,/ower/,EMPTY,lowerize]],[/ sun4\w[;\)]/i],[[ARCHITECTURE,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[ARCHITECTURE,lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,TABLET]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,MOBILE]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[MODEL,[VENDOR,APPLE],[TYPE,MOBILE]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[MODEL,[VENDOR,APPLE],[TYPE,TABLET]],[/(macintosh);/i],[MODEL,[VENDOR,APPLE]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[MODEL,[VENDOR,SHARP],[TYPE,MOBILE]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[MODEL,[VENDOR,HONOR],[TYPE,TABLET]],[/honor([-\w ]+)[;\)]/i],[MODEL,[VENDOR,HONOR],[TYPE,MOBILE]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,TABLET]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,MOBILE]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,TABLET]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,MOBILE]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[MODEL,[VENDOR,ONEPLUS],[TYPE,MOBILE]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[MODEL,[VENDOR,OPPO],[TYPE,MOBILE]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[MODEL,[VENDOR,strMapper,{OnePlus:["203","304","403","404","413","415"],"*":OPPO}],[TYPE,TABLET]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[MODEL,[VENDOR,"BLU"],[TYPE,MOBILE]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[MODEL,[VENDOR,"Vivo"],[TYPE,MOBILE]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[MODEL,[VENDOR,"Realme"],[TYPE,MOBILE]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[MODEL,[VENDOR,LENOVO],[TYPE,TABLET]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[MODEL,[VENDOR,LENOVO],[TYPE,MOBILE]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[MODEL,[VENDOR,MOTOROLA],[TYPE,MOBILE]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[MODEL,[VENDOR,MOTOROLA],[TYPE,TABLET]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[MODEL,[VENDOR,LG],[TYPE,TABLET]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[MODEL,[VENDOR,LG],[TYPE,MOBILE]],[/(nokia) (t[12][01])/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[MODEL,/_/g," "],[TYPE,MOBILE],[VENDOR,"Nokia"]],[/(pixel (c|tablet))\b/i],[MODEL,[VENDOR,GOOGLE],[TYPE,TABLET]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[MODEL,[VENDOR,GOOGLE],[TYPE,MOBILE]],[/(google) (pixelbook( go)?)/i],[VENDOR,MODEL],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[MODEL,[VENDOR,SONY],[TYPE,MOBILE]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[MODEL,"Xperia Tablet"],[VENDOR,SONY],[TYPE,TABLET]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[MODEL,[VENDOR,AMAZON],[TYPE,TABLET]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[MODEL,/(.+)/g,"Fire Phone $1"],[VENDOR,AMAZON],[TYPE,MOBILE]],[/(playbook);[-\w\),; ]+(rim)/i],[MODEL,VENDOR,[TYPE,TABLET]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[MODEL,[VENDOR,BLACKBERRY],[TYPE,MOBILE]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[MODEL,[VENDOR,ASUS],[TYPE,TABLET]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[MODEL,[VENDOR,ASUS],[TYPE,MOBILE]],[/(nexus 9)/i],[MODEL,[VENDOR,"HTC"],[TYPE,TABLET]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[VENDOR,[MODEL,/_/g," "],[TYPE,MOBILE]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[MODEL,[VENDOR,"TCL"],[TYPE,TABLET]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[MODEL,[VENDOR,"TCL"],[TYPE,MOBILE]],[/(itel) ((\w+))/i],[[VENDOR,lowerize],MODEL,[TYPE,strMapper,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[MODEL,[VENDOR,"Acer"],[TYPE,TABLET]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[MODEL,[VENDOR,"Meizu"],[TYPE,MOBILE]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[MODEL,[VENDOR,"Ulefone"],[TYPE,MOBILE]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[MODEL,[VENDOR,"Energizer"],[TYPE,MOBILE]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[MODEL,[VENDOR,"Cat"],[TYPE,MOBILE]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[MODEL,[VENDOR,"Smartfren"],[TYPE,MOBILE]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[MODEL,[VENDOR,"Nothing"],[TYPE,MOBILE]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[MODEL,[VENDOR,"Archos"],[TYPE,TABLET]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[MODEL,[VENDOR,"Archos"],[TYPE,MOBILE]],[/; (n159v)/i],[MODEL,[VENDOR,"HMD"],[TYPE,MOBILE]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(surface duo)/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,TABLET]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[MODEL,[VENDOR,"Fairphone"],[TYPE,MOBILE]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[MODEL,[VENDOR,NVIDIA],[TYPE,TABLET]],[/(sprint) (\w+)/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kin\.[onetw]{3})/i],[[MODEL,/\./g," "],[VENDOR,MICROSOFT],[TYPE,MOBILE]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,TABLET]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,MOBILE]],[/smart-tv.+(samsung)/i],[VENDOR,[TYPE,SMARTTV]],[/hbbtv.+maple;(\d+)/i],[[MODEL,/^/,"SmartTV"],[VENDOR,SAMSUNG],[TYPE,SMARTTV]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[VENDOR,MODEL,[TYPE,SMARTTV]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[VENDOR,LG],[TYPE,SMARTTV]],[/(apple) ?tv/i],[VENDOR,[MODEL,APPLE+" TV"],[TYPE,SMARTTV]],[/crkey.*devicetype\/chromecast/i],[[MODEL,CHROMECAST+" Third Generation"],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/crkey.*devicetype\/([^/]*)/i],[[MODEL,/^/,"Chromecast "],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/fuchsia.*crkey/i],[[MODEL,CHROMECAST+" Nest Hub"],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/crkey/i],[[MODEL,CHROMECAST],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/(portaltv)/i],[MODEL,[VENDOR,FACEBOOK],[TYPE,SMARTTV]],[/droid.+aft(\w+)( bui|\))/i],[MODEL,[VENDOR,AMAZON],[TYPE,SMARTTV]],[/(shield \w+ tv)/i],[MODEL,[VENDOR,NVIDIA],[TYPE,SMARTTV]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[MODEL,[VENDOR,SHARP],[TYPE,SMARTTV]],[/(bravia[\w ]+)( bui|\))/i],[MODEL,[VENDOR,SONY],[TYPE,SMARTTV]],[/(mi(tv|box)-?\w+) bui/i],[MODEL,[VENDOR,XIAOMI],[TYPE,SMARTTV]],[/Hbbtv.*(technisat) (.*);/i],[VENDOR,MODEL,[TYPE,SMARTTV]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[VENDOR,/.+\/(\w+)/,"$1",strMapper,{LG:"lge"}],[MODEL,trim$1],[TYPE,SMARTTV]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[MODEL,[TYPE,SMARTTV]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:|large screen[\w ]+safari)\b/i],[[TYPE,SMARTTV]],[/(playstation \w+)/i],[MODEL,[VENDOR,SONY],[TYPE,CONSOLE]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,CONSOLE]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[VENDOR,MODEL,[TYPE,CONSOLE]],[/droid.+; (shield)( bui|\))/i],[MODEL,[VENDOR,NVIDIA],[TYPE,CONSOLE]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,WEARABLE]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[VENDOR,MODEL,[TYPE,WEARABLE]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[MODEL,[VENDOR,OPPO],[TYPE,WEARABLE]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[MODEL,[VENDOR,APPLE],[TYPE,WEARABLE]],[/(opwwe\d{3})/i],[MODEL,[VENDOR,ONEPLUS],[TYPE,WEARABLE]],[/(moto 360)/i],[MODEL,[VENDOR,MOTOROLA],[TYPE,WEARABLE]],[/(smartwatch 3)/i],[MODEL,[VENDOR,SONY],[TYPE,WEARABLE]],[/(g watch r)/i],[MODEL,[VENDOR,LG],[TYPE,WEARABLE]],[/droid.+; (wt63?0{2,3})\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,WEARABLE]],[/droid.+; (glass) \d/i],[MODEL,[VENDOR,GOOGLE],[TYPE,XR]],[/(pico) (4|neo3(?: link|pro)?)/i],[VENDOR,MODEL,[TYPE,XR]],[/(quest( \d| pro)?s?).+vr/i],[MODEL,[VENDOR,FACEBOOK],[TYPE,XR]],[/mobile vr; rv.+firefox/i],[[TYPE,XR]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[VENDOR,[TYPE,EMBEDDED]],[/(aeobc)\b/i],[MODEL,[VENDOR,AMAZON],[TYPE,EMBEDDED]],[/(homepod).+mac os/i],[MODEL,[VENDOR,APPLE],[TYPE,EMBEDDED]],[/windows iot/i],[[TYPE,EMBEDDED]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[MODEL,[TYPE,strMapper,{mobile:"Mobile",xr:"VR","*":TABLET}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[TYPE,TABLET]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[TYPE,MOBILE]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[MODEL,[VENDOR,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[VERSION$2,[NAME,EDGE+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[NAME,VERSION$2],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[VERSION$2,[NAME,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[NAME,VERSION$2],[/ladybird\//i],[[NAME,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[VERSION$2,NAME]],os:[[/(windows nt) (6\.[23]); arm/i],[[NAME,/N/,"R"],[VERSION$2,strMapper,windowsVersionMap]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[NAME,VERSION$2],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[VERSION$2,/(;|\))/g,"",strMapper,windowsVersionMap],[NAME,WINDOWS]],[/(windows ce)\/?([\d\.]*)/i],[NAME,VERSION$2],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[VERSION$2,/_/g,"."],[NAME,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[NAME,"macOS"],[VERSION$2,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[VERSION$2,[NAME,CHROMECAST+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[VERSION$2,[NAME,CHROMECAST+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[VERSION$2,[NAME,CHROMECAST+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[VERSION$2,[NAME,CHROMECAST+" Linux"]],[/crkey\/([\d\.]+)/i],[VERSION$2,[NAME,CHROMECAST]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[VERSION$2,NAME],[/(ubuntu) ([\w\.]+) like android/i],[[NAME,/(.+)/,"$1 Touch"],VERSION$2],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[NAME,VERSION$2],[/\(bb(10);/i],[VERSION$2,[NAME,BLACKBERRY]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[VERSION$2,[NAME,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[VERSION$2,[NAME,FIREFOX+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[VERSION$2,[NAME,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[VERSION$2,strMapper,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[NAME,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[VERSION$2,[NAME,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[NAME,"Chrome OS"],VERSION$2],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[NAME,VERSION$2],[/(sunos) ?([\d\.]*)/i],[[NAME,"Solaris"],VERSION$2],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[NAME,VERSION$2]]},defaultProps=function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return setProps.call(e.init,[[UA_BROWSER,[NAME,VERSION$2,MAJOR,TYPE]],[UA_CPU,[ARCHITECTURE]],[UA_DEVICE,[TYPE,MODEL,VENDOR]],[UA_ENGINE,[NAME,VERSION$2]],[UA_OS,[NAME,VERSION$2]]]),setProps.call(e.isIgnore,[[UA_BROWSER,[VERSION$2,MAJOR]],[UA_ENGINE,[VERSION$2]],[UA_OS,[VERSION$2]]]),setProps.call(e.isIgnoreRgx,[[UA_BROWSER,/ ?browser$/i],[UA_OS,/ ?os$/i]]),setProps.call(e.toString,[[UA_BROWSER,[NAME,VERSION$2]],[UA_CPU,[ARCHITECTURE]],[UA_DEVICE,[VENDOR,MODEL]],[UA_ENGINE,[NAME,VERSION$2]],[UA_OS,[NAME,VERSION$2]]]),e}(),createIData=function(e,t){var n=defaultProps.init[t],a=defaultProps.isIgnore[t]||0,s=defaultProps.isIgnoreRgx[t]||0,o=defaultProps.toString[t]||0;function c(){setProps.call(this,n)}return c.prototype.getItem=function(){return e},c.prototype.withClientHints=function(){return NAVIGATOR_UADATA?NAVIGATOR_UADATA.getHighEntropyValues(CH_ALL_VALUES).then(function(f){return e.setCH(new UACHData(f,!1)).parseCH().get()}):e.parseCH().get()},c.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=UA_RESULT&&(c.prototype.is=function(f){var y=!1;for(var m in this)if(this.hasOwnProperty(m)&&!has(a,m)&&lowerize(s?strip(s,this[m]):this[m])==lowerize(s?strip(s,f):f)){if(y=!0,f!=UNDEF_TYPE)break}else if(f==UNDEF_TYPE&&y){y=!y;break}return y},c.prototype.toString=function(){var f=EMPTY;for(var y in o)typeof this[o[y]]!==UNDEF_TYPE&&(f+=(f?" ":EMPTY)+this[o[y]]);return f||UNDEF_TYPE}),NAVIGATOR_UADATA||(c.prototype.then=function(f){var y=this,m=function(){for(var z in y)y.hasOwnProperty(z)&&(this[z]=y[z])};m.prototype={is:c.prototype.is,toString:c.prototype.toString};var g=new m;return f(g),g}),new c};function UACHData(e,t){if(e=e||{},setProps.call(this,CH_ALL_VALUES),t)setProps.call(this,[[BRANDS,itemListToArray(e[CH_HEADER])],[FULLVERLIST,itemListToArray(e[CH_HEADER_FULL_VER_LIST])],[MOBILE,/\?1/.test(e[CH_HEADER_MOBILE])],[MODEL,stripQuotes(e[CH_HEADER_MODEL])],[PLATFORM,stripQuotes(e[CH_HEADER_PLATFORM])],[PLATFORMVER,stripQuotes(e[CH_HEADER_PLATFORM_VER])],[ARCHITECTURE,stripQuotes(e[CH_HEADER_ARCH])],[FORMFACTORS,itemListToArray(e[CH_HEADER_FORM_FACTORS])],[BITNESS,stripQuotes(e[CH_HEADER_BITNESS])]]);else for(var n in e)this.hasOwnProperty(n)&&typeof e[n]!==UNDEF_TYPE&&(this[n]=e[n])}function UAItem(e,t,n,a){return this.get=function(s){return s?this.data.hasOwnProperty(s)?this.data[s]:void 0:this.data},this.set=function(s,o){return this.data[s]=o,this},this.setCH=function(s){return this.uaCH=s,this},this.detectFeature=function(){if(NAVIGATOR&&NAVIGATOR.userAgent==this.ua)switch(this.itemType){case UA_BROWSER:NAVIGATOR.brave&&typeof NAVIGATOR.brave.isBrave==FUNC_TYPE&&this.set(NAME,"Brave");break;case UA_DEVICE:!this.get(TYPE)&&NAVIGATOR_UADATA&&NAVIGATOR_UADATA[MOBILE]&&this.set(TYPE,MOBILE),this.get(MODEL)=="Macintosh"&&NAVIGATOR&&typeof NAVIGATOR.standalone!==UNDEF_TYPE&&NAVIGATOR.maxTouchPoints&&NAVIGATOR.maxTouchPoints>2&&this.set(MODEL,"iPad").set(TYPE,TABLET);break;case UA_OS:!this.get(NAME)&&NAVIGATOR_UADATA&&NAVIGATOR_UADATA[PLATFORM]&&this.set(NAME,NAVIGATOR_UADATA[PLATFORM]);break;case UA_RESULT:var s=this.data,o=function(c){return s[c].getItem().detectFeature().get()};this.set(UA_BROWSER,o(UA_BROWSER)).set(UA_CPU,o(UA_CPU)).set(UA_DEVICE,o(UA_DEVICE)).set(UA_ENGINE,o(UA_ENGINE)).set(UA_OS,o(UA_OS))}return this},this.parseUA=function(){return this.itemType!=UA_RESULT&&rgxMapper.call(this.data,this.ua,this.rgxMap),this.itemType==UA_BROWSER&&this.set(MAJOR,majorize(this.get(VERSION$2))),this},this.parseCH=function(){var s=this.uaCH,o=this.rgxMap;switch(this.itemType){case UA_BROWSER:case UA_ENGINE:var c=s[FULLVERLIST]||s[BRANDS],f;if(c)for(var y in c){var m=c[y].brand||c[y],g=c[y].version;this.itemType==UA_BROWSER&&!/not.a.brand/i.test(m)&&(!f||/Chrom/.test(f)&&m!=CHROMIUM||f==EDGE&&/WebView2/.test(m))&&(m=strMapper(m,browserHintsMap),f=this.get(NAME),f&&!/Chrom/.test(f)&&/Chrom/.test(m)||this.set(NAME,m).set(VERSION$2,g).set(MAJOR,majorize(g)),f=m),this.itemType==UA_ENGINE&&m==CHROMIUM&&this.set(VERSION$2,g)}break;case UA_CPU:var z=s[ARCHITECTURE];z&&(z&&s[BITNESS]=="64"&&(z+="64"),rgxMapper.call(this.data,z+";",o));break;case UA_DEVICE:if(s[MOBILE]&&this.set(TYPE,MOBILE),s[MODEL]&&(this.set(MODEL,s[MODEL]),!this.get(TYPE)||!this.get(VENDOR))){var ie={};rgxMapper.call(ie,"droid 9; "+s[MODEL]+")",o),!this.get(TYPE)&&ie.type&&this.set(TYPE,ie.type),!this.get(VENDOR)&&ie.vendor&&this.set(VENDOR,ie.vendor)}if(s[FORMFACTORS]){var re;if(typeof s[FORMFACTORS]!="string")for(var he=0;!re&&he<s[FORMFACTORS].length;)re=strMapper(s[FORMFACTORS][he++],formFactorsMap);else re=strMapper(s[FORMFACTORS],formFactorsMap);this.set(TYPE,re)}break;case UA_OS:var _e=s[PLATFORM];if(_e){var $e=s[PLATFORMVER];_e==WINDOWS&&($e=parseInt(majorize($e),10)>=13?"11":"10"),this.set(NAME,_e).set(VERSION$2,$e)}this.get(NAME)==WINDOWS&&s[MODEL]=="Xbox"&&this.set(NAME,"Xbox").set(VERSION$2,void 0);break;case UA_RESULT:var pe=this.data,Ce=function(Oe){return pe[Oe].getItem().setCH(s).parseCH().get()};this.set(UA_BROWSER,Ce(UA_BROWSER)).set(UA_CPU,Ce(UA_CPU)).set(UA_DEVICE,Ce(UA_DEVICE)).set(UA_ENGINE,Ce(UA_ENGINE)).set(UA_OS,Ce(UA_OS))}return this},setProps.call(this,[["itemType",e],["ua",t],["uaCH",a],["rgxMap",n],["data",createIData(this,e)]]),this}function UAParser(e,t,n){if(typeof e===OBJ_TYPE?(isExtensions(e,!0)?(typeof t===OBJ_TYPE&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e===STR_TYPE&&!isExtensions(t,!0)&&(n=t,t=void 0),n&&typeof n.append===FUNC_TYPE){var a={};n.forEach(function(y,m){a[m]=y}),n=a}if(!(this instanceof UAParser))return new UAParser(e,t,n).getResult();var s=typeof e===STR_TYPE?e:n&&n[USER_AGENT]?n[USER_AGENT]:NAVIGATOR&&NAVIGATOR.userAgent?NAVIGATOR.userAgent:EMPTY,o=new UACHData(n,!0),c=t?extend$1(defaultRegexes,t):defaultRegexes,f=function(y){return y==UA_RESULT?function(){return new UAItem(y,s,c,o).set("ua",s).set(UA_BROWSER,this.getBrowser()).set(UA_CPU,this.getCPU()).set(UA_DEVICE,this.getDevice()).set(UA_ENGINE,this.getEngine()).set(UA_OS,this.getOS()).get()}:function(){return new UAItem(y,s,c[y],o).parseUA().get()}};return setProps.call(this,[["getBrowser",f(UA_BROWSER)],["getCPU",f(UA_CPU)],["getDevice",f(UA_DEVICE)],["getEngine",f(UA_ENGINE)],["getOS",f(UA_OS)],["getResult",f(UA_RESULT)],["getUA",function(){return s}],["setUA",function(y){return isString$1(y)&&(s=y.length>UA_MAX_LENGTH?trim$1(y,UA_MAX_LENGTH):y),this}]]).setUA(s),this}UAParser.VERSION=LIBVERSION,UAParser.BROWSER=enumerize([NAME,VERSION$2,MAJOR,TYPE]),UAParser.CPU=enumerize([ARCHITECTURE]),UAParser.DEVICE=enumerize([MODEL,VENDOR,TYPE,CONSOLE,MOBILE,SMARTTV,TABLET,WEARABLE,EMBEDDED]),UAParser.ENGINE=UAParser.OS=enumerize([NAME,VERSION$2]);function useMobile(){const e=ref(!1);function t(){const{device:n}=UAParser(navigator.userAgent);nextTick(()=>{e.value=n.type==="mobile"||window.innerWidth<540})}return onBeforeUnmount(()=>window.removeEventListener("resize",t)),onMounted(()=>{t(),window.addEventListener("resize",t)}),{mobile:e}}var eventsExports=requireEvents();class TWOFA extends eventsExports.EventEmitter{constructor(n,a,s=!0){super();$n(this,"bluetoothDevice",!1);$n(this,"connection");$n(this,"data",{});$n(this,"displaySubmitButton",!0);$n(this,"http");$n(this,"interfaceVersion");$n(this,"_loading",!1);$n(this,"messageEncrypted");$n(this,"rules",{});$n(this,"rulesDefined",!1);if(this.config=n,this.measureEvents=s,this.http=a.getInstance(),n.twofa&&n.twofa.length)this.configuredMeasureEvent("twofa_request",{id_site:n.id_site,...n.id_site?{}:{id_request:n.id_request}}),n.twofa.forEach(o=>{const c=o.name;this.data[c]=null,(o.type==="authentication_type"||o.type==="challenge")&&(this.data[c]=o.label),o.type==="connection"&&(this.connection=this.data[c]=o.label),(o.type==="externalAction"||o.type==="instructions")&&(this.displaySubmitButton=!1),o.type==="interface_version"&&(this.interfaceVersion=this.data[c]=o.label)}),this.connectSantanderUsbToken(),this.handleBbvaNetcashConnections();else throw new Error("TWOFA credentials are required.")}get loading(){return this._loading}set loading(n){this._loading=n,n&&this.emit("loading")}authenticate(n){return this.data={...n},this.configuredMeasureEvent("twofa_send",{id_site:this.config.id_site,...this.config.id_site?{}:{id_request:this.config.id_request}}),this.loading=!0,this.connection==="eai_otp_GO3"&&!this.bluetoothDevice?this.sendBbvaNetcashUsbToken():(this.turnOnBbvaNetcashBluetoothDevice(),this.http.post(this.config.address,{twofa:{...this.data}}).then(a=>(this.emit("login-success"),a)).catch(a=>(this.loading=!1,this.emit("twofa-api-error"),Promise.reject(a))))}defineRules(n){this.rulesDefined||(this.rulesDefined=!0,this.config.twofa.forEach(a=>{Object.defineProperty(this.rules,a.name,{value:this.setRules(a,n)})}))}getFields(){return this.config.twofa.filter(n=>n.type!=="challenge"&&n.type!=="connection")}getBbvaNetcashBluetoothFinalToken(n){const a=this.findTwofaByName("token").label;this.displaySubmitButton=!1,this.config.twofa=[{label:a,name:"token",type:"instructions"}],getBridgeBluetoothFinalToken(n).then(s=>{this.data={token:s,other_message_encrypted:"other_message_encrypted"},this.authenticate(this.data)})}statusChanged(){this.loading||(this.loading=!0)}configuredMeasureEvent(n,a){this.measureEvents&&measureEvent(n,a)}connectSantanderUsbToken(){this.config.id_site==="57f6dd8c78480602048b4567"&&this.config.twofa[0].type==="instructions"&&getSantanderWebSocketData(this.config.twofa[0].imgBase64File).then(n=>{this.authenticate(n)}).catch(n=>{this.emit("twofa-api-error"),this.emit("twofa-device-error",n)})}findTwofaByName(n){return this.config.twofa.find(a=>a.name===n)}findTwofaByType(n){return this.config.twofa.find(a=>a.type===n)}handleBbvaNetcashConnections(){this.messageEncrypted=this.findTwofaByType("message_encrypted");const n=this.findTwofaByType("other_message_encrypted");this.connection==="eai_otp_GO3"&&(this.bluetoothDevice=this.findTwofaByType("bluetooth_device").label==="S",this.bluetoothDevice?this.sendBbvaNetcashBluetoothTimeChallengeV1():this.setBbvaNetcashUsbFields()),this.messageEncrypted&&this.setBbvaNetcashBluetoothFakeToken(),n&&this.getBbvaNetcashBluetoothFinalToken(n.label),this.findTwofaByType("authentication_type")&&this.sendBbvaNetcashBluetoothTimeChallengeV2(),this.config.id_site==="57239fae78480601038b4567"&&!this.connection&&this.findTwofaByType("challenge")&&!this.messageEncrypted&&!n&&this.sendBbvaNetcashBluetoothSecondToken()}sendBbvaNetcashBluetoothSecondToken(){const n=JSON.parse(this.findTwofaByType("challenge").label),a=this.findTwofaByName("token").label;this.displaySubmitButton=!1,this.config.twofa=[{label:a,name:"token",type:"instructions"}],continueDPToken(n).then(s=>{this.authenticate({challenge:s,token:s})})}sendBbvaNetcashBluetoothTimeChallengeV1(){const n=this.findTwofaByType("challenge").label,a=this.findTwofaByType("device").label,s=this.findTwofaByName("token").label;this.displaySubmitButton=!1,this.config.twofa=[{label:s,name:"token",type:"instructions"}],getBridgeBluetoothTimeChallengeV1(a,n).then(o=>{this.data={bluetooth_device:"bluetooth_device",challenge:"challenge",connection:"connection",device:"device",interface_version:"interface_version",token:o},this.authenticate(this.data)})}sendBbvaNetcashBluetoothTimeChallengeV2(){const n=this.findTwofaByType("authentication_type").label,a=this.findTwofaByName("token").label;this.displaySubmitButton=!1,this.config.twofa=[{label:a,name:"token",type:"instructions"}],getBridgeBluetoothTimeChallengeV2(n).then(s=>{this.authenticate({authentication_type:"authentication_type",interface_version:"interface_version",token:s})})}sendBbvaNetcashUsbToken(){return getBridgeData(this.data.token,this.data.challenge).then(n=>this.http.post(this.config.address,{twofa:{...this.data,...n,bluetooth_device:"bluetooth_device",challenge:"challenge",connection:"connection"}}).then(a=>(this.emit("login-success"),a)).catch(a=>(this.loading=!1,this.emit("twofa-api-error"),Promise.reject(a)))).catch(n=>(this.loading=!1,this.emit("twofa-api-error"),Promise.reject(n.response?{...n,response:{...n.response,status:500}}:n)))}setBbvaNetcashBluetoothFakeToken(){const n=this.findTwofaByName("token").label;this.rules={token:[{required:!0}]},this.rulesDefined=!0,this.data={token:""},this.config.twofa=[{name:"token",type:"text",label:n,disabled:!0}],getBridgeBluetoothFakeToken(this.messageEncrypted.label).then(a=>{this.data={token:a},this.emit("token-received")})}setBbvaNetcashUsbFields(){this.config.twofa=[this.findTwofaByType("text")]}setRules(n,a){const s=[];return s.push({required:!0,message:a("form_errors.required",{label:n.label})}),n.validation&&n.validation.forEach(o=>{switch(o.type){case"text":break;case"regex":s.push({pattern:o.value,message:o.error_message});break}}),s}turnOnBbvaNetcashBluetoothDevice(){this.messageEncrypted&&(this.data={token:"OK",message_encrypted:"message_encrypted"},turnOnBridgeBluetoothBeforeSendingTwofa())}}class SiteBase extends eventsExports.EventEmitter{constructor(n,a,s){super();$n(this,"config");$n(this,"response");$n(this,"testMode",!1);$n(this,"http");$n(this,"_finalResponse",null);$n(this,"_lastSocketMessage");$n(this,"_loading",!1);$n(this,"_status","start");$n(this,"_twofa");$n(this,"isSocketOpen",!1);$n(this,"options",{});$n(this,"socket");$n(this,"socketOpened",!1);$n(this,"socketTimeoutAfterError");$n(this,"timer",null);this.httpService=a,this.userConfig=s,this.config=n,this.http=a.getInstance()}get finalResponse(){return this._finalResponse}set finalResponse(n){this._finalResponse=n,this.status="finish"}get lastSocketMessage(){return this._lastSocketMessage}set lastSocketMessage(n){this._lastSocketMessage=n}get loading(){return this._loading}set loading(n){this._loading=n,n&&(this.status="loading")}get status(){return this._status}set status(n){const a=this._status!==n;this._status=n,a&&(this.emit(n),this.emit("status-update",n))}get twofa(){return this._twofa}set twofa(n){this._twofa=n,n&&(this.status="twofa",n.on("loading",()=>{this._twofa===n&&this.status==="twofa"&&(this.status="twofa-loading")}))}setOption(n,a){this.options[n]=a}toggleTestMode(){this.testMode=!this.testMode}configuredMeasureEvent(n,a){this.userConfig.isHeadless||measureEvent(n,a)}clearTimer(){clearTimeout(this.timer)}moveDownloadOptions(n){if(n.download_options_active){const a=n.download_options[0],s=n.download_options[1];this.setOption("search_from",this.formatDate(a)),this.setOption("search_to",this.formatDate(s))}delete n.download_options_active,delete n.download_options}setRules(n){const a=[];return n.required&&a.push({required:!0,message:"required"}),n.validation&&n.validation.forEach(s=>{switch(s.type){case"text":break;case"regex":a.push({pattern:s.value,message:"regex"});break}}),a}setSocket(n){this.socket=new WebSocket(n),this.socket.onclose=a=>this.reopenSocket(a),this.socket.onerror=()=>this.socketError(),this.socket.onmessage=a=>this.socketMessage(a),this.socket.onopen=()=>this.socketOpen()}spreadOptions(){const n=Object.keys(this.options).reduce((a,s)=>(this.options[s]!==null&&this.options[s]!==void 0&&(a[s]=this.options[s]),a),{});return Object.keys(n).length?{options:{...n}}:{}}startTimer(){this.timer=setTimeout(()=>{this.socketTimeout()},this.userConfig.socketTimeoutTime)}formatDate(n){return`${n.getFullYear()}-${`0${n.getMonth()+1}`.slice(-2)}-${`0${n.getDate()}`.slice(-2)}`}reopenSocket(n){this.setSocket(n.target.url)}reopenSocketAfterError(){if(!this.socketTimeoutAfterError){this.socketTimeoutAfterError=new Date().getTime()+12e4,this.setSocket(this.response.ws);const n=setInterval(()=>{this.isSocketOpen?clearInterval(n):new Date().getTime()<this.socketTimeoutAfterError?(this.socket.close(),this.setSocket(this.response.ws)):(clearInterval(n),this.socket.close(),this.loading=!1,this.emit("socket-error"),this.finalResponse="error")},2e3)}}socketClose(n){this.clearTimer(),this.twofa=null,this.emit("socket-close",event),n&&n(this),this.socket&&(this.socket.onclose=null,this.socket.close())}socketError(){this.isSocketOpen=!1,this.socketOpened?this.reopenSocketAfterError():(this.loading=!1,this.emit("socket-error"),this.finalResponse="error")}socketMessage(n){const a=JSON.parse(n.data);if(this.lastSocketMessage=a,this.clearTimer(),this.config.quickAnswer&&a.code===102){this.socketClose(()=>{this.finalResponse="success",this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.emit("socket-quick-answer")}),this.configuredMeasureEvent("sync_success",{code:a.code,id_site:this.config.id_site});return}a.code===401&&this.configuredMeasureEvent("unauthorized",{id_site:this.config.id_site}),a.code===410&&(this.twofa=new TWOFA({...a,id_site:this.config.id_site},this.httpService,!this.userConfig.isHeadless),this.emit("twofa",this.twofa),this.twofa.on("twofa-api-error",()=>{this.socketClose()})),this.emit("socket-message",a),this.startTimer(),a.code===411&&this.configuredMeasureEvent("twofa_timeout",{id_site:this.config.id_site}),(200<=a.code&&a.code<300||400<=a.code&&a.code<600&&a.code!==410)&&(a.code<300?(this.finalResponse="success",this.configuredMeasureEvent("sync_success",{code:a.code,id_site:this.config.id_site})):(this.finalResponse="error",this.configuredMeasureEvent("sync_error",{code:a.code,code_origin:"socket",id_site:this.config.id_site})),this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.socketClose()),!(400<=a.code&&a.code<600&&a.code!==410||200<=a.code&&a.code<300)&&this.twofa&&a.code!==410&&(this.twofa.loading=!0,this.status="twofa-loading")}socketOpen(){this.isSocketOpen=this.socketOpened=!0,this.socketTimeoutAfterError=void 0}socketTimeout(){this.socketClose(()=>{this.finalResponse="error",this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.emit("socket-timeout")})}}const Zn=class Zn extends SiteBase{constructor(n,a,s,o){super(n,a,o);$n(this,"input",[]);$n(this,"backUpInputArray",[]);this.defaultParams=s,this.userConfig=o,this.allConnections.forEach(c=>{const f={rules:{},data:{}};DOWNLOAD_OPTIONS_SITES.includes(n.id_site)&&this.addDownloadOptions(c),c.fields.forEach(y=>{const m=y.name;Object.defineProperty(f.rules,m,{enumerable:!0,value:this.setRules(y),writable:!0}),f.data[m]=null}),c.name===Zn.statementParseInputName?this.backUpInputArray=[f]:this.input.push(f)})}get backUpConnection(){return this.allConnections.find(n=>n.name===Zn.statementParseInputName)}get backUpInput(){return this.backUpInputArray[0]}get connections(){return this.allConnections.filter(n=>n.name!==Zn.statementParseInputName)}get version(){return 4}get allConnections(){return this.config.input.map(n=>({name:n.name,label:n.label,fields:n.fields.map(a=>({...a.options.widget,name:a.name,identifier:a.options.api.identifier,required:a.required}))}))}connect(n,a,s=!1){const o=this.getConnectData(n,a,s);return this.startTimer(),this.http.post(this.config.endpoint,o).then(c=>(this.response=c,this.emit("login-success"),this.setSocket(c.ws),c)).catch(c=>(this.configuredMeasureEvent("sync_error",{code:c.response?c.response.status:c.toString(),code_origin:"endpoint",id_site:this.config.id_site}),s?this.backUpInput.data={}:this.input[n].data={},this.loading=!1,this.status="start",this.clearTimer(),Promise.reject(c)))}getConnectData(n,a,s=!1){this.updateData(n,a,s);const o=n||0,c={...s?this.backUpInput.data:this.input[o].data};DOWNLOAD_OPTIONS_SITES.includes(this.config.id_site)&&this.moveDownloadOptions(c),this.testMode?this.setOption("allowMultipleRequests",!0):this.setOption("allowMultipleRequests",void 0);const f={...this.defaultParams,id_site:this.config.id_site,input_name:s?Zn.statementParseInputName:this.connections[n].name,input:c,...this.spreadOptions()};return this.config.request?Promise.resolve(f.input):(this.configuredMeasureEvent("sync",{id_site:this.config.id_site}),this.loading=!0,this.userConfig.saveCredential||(f.save_credential=this.userConfig.saveCredential),this.testMode&&(f.test=1),f)}getFields(n,a=!1){return a?this.connections[n].fields.filter(s=>!s.identifier):this.connections[n].fields}getBackUpFields(n=!1){var a;return n?this.backUpConnection.fields.filter(s=>!s.identifier):(a=this.backUpConnection)==null?void 0:a.fields}getBackUpRules(n=!1){if(n){const a={};return this.getBackUpFields(!0).forEach(s=>{a[s.name]=this.setRules(s)}),a}return this.backUpInput.rules}getOptions(){return this.connections}getRules(n,a=!1){if(a){const s={};return this.getFields(n,!0).forEach(o=>{s[o.name]=this.setRules(o)}),s}return this.input[n].rules}updateData(n,a,s=!1){if(s){this.backUpInput.data={...a};return}this.input[n].data={...a}}addDownloadOptions(n){n.fields.includes(DOWNLOAD_OPTIONS_ACTIVE)||(n.fields.push(DOWNLOAD_OPTIONS_ACTIVE),n.fields.push(DOWNLOAD_OPTIONS))}};$n(Zn,"statementParseInputName","statement_account_parse");let SiteV4Service=Zn;function bind(e,t){return function(){return e.apply(t,arguments)}}const{toString}=Object.prototype,{getPrototypeOf}=Object,{iterator,toStringTag}=Symbol,kindOf=(e=>t=>{const n=toString.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=e=>(e=e.toLowerCase(),t=>kindOf(t)===e),typeOfTest=e=>t=>typeof t===e,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&isFunction(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&isArrayBuffer(e.buffer),t}const isString=typeOfTest("string"),isFunction=typeOfTest("function"),isNumber=typeOfTest("number"),isObject=e=>e!==null&&typeof e=="object",isBoolean=e=>e===!0||e===!1,isPlainObject=e=>{if(kindOf(e)!=="object")return!1;const t=getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(toStringTag in e)&&!(iterator in e)},isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=e=>isObject(e)&&isFunction(e.pipe),isFormData=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||isFunction(e.append)&&((t=kindOf(e))==="formdata"||t==="object"&&isFunction(e.toString)&&e.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let a,s;if(typeof e!="object"&&(e=[e]),isArray(e))for(a=0,s=e.length;a<s;a++)t.call(null,e[a],a,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),c=o.length;let f;for(a=0;a<c;a++)f=o[a],t.call(null,e[f],f,e)}}function findKey(e,t){t=t.toLowerCase();const n=Object.keys(e);let a=n.length,s;for(;a-- >0;)if(s=n[a],t===s.toLowerCase())return s;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global$1,isContextDefined=e=>!isUndefined(e)&&e!==_global;function merge(){const{caseless:e}=isContextDefined(this)&&this||{},t={},n=(a,s)=>{const o=e&&findKey(t,s)||s;isPlainObject(t[o])&&isPlainObject(a)?t[o]=merge(t[o],a):isPlainObject(a)?t[o]=merge({},a):isArray(a)?t[o]=a.slice():t[o]=a};for(let a=0,s=arguments.length;a<s;a++)arguments[a]&&forEach(arguments[a],n);return t}const extend=(e,t,n,{allOwnKeys:a}={})=>(forEach(t,(s,o)=>{n&&isFunction(s)?e[o]=bind(s,n):e[o]=s},{allOwnKeys:a}),e),stripBOM=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),inherits=(e,t,n,a)=>{e.prototype=Object.create(t.prototype,a),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject=(e,t,n,a)=>{let s,o,c;const f={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)c=s[o],(!a||a(c,e,t))&&!f[c]&&(t[c]=e[c],f[c]=!0);e=n!==!1&&getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},endsWith=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const a=e.indexOf(t,n);return a!==-1&&a===n},toArray=e=>{if(!e)return null;if(isArray(e))return e;let t=e.length;if(!isNumber(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},isTypedArray=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(e,t)=>{const a=(e&&e[iterator]).call(e);let s;for(;(s=a.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},matchAll=(e,t)=>{let n;const a=[];for(;(n=e.exec(t))!==null;)a.push(n);return a},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,a,s){return a.toUpperCase()+s}),hasOwnProperty=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),a={};forEach(n,(s,o)=>{let c;(c=t(s,o,e))!==!1&&(a[o]=c||s)}),Object.defineProperties(e,a)},freezeMethods=e=>{reduceDescriptors(e,(t,n)=>{if(isFunction(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const a=e[n];if(isFunction(a)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet=(e,t)=>{const n={},a=s=>{s.forEach(o=>{n[o]=!0})};return isArray(e)?a(e):a(String(e).split(t)),n},noop=()=>{},toFiniteNumber=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function isSpecCompliantForm(e){return!!(e&&isFunction(e.append)&&e[toStringTag]==="FormData"&&e[iterator])}const toJSONObject=e=>{const t=new Array(10),n=(a,s)=>{if(isObject(a)){if(t.indexOf(a)>=0)return;if(!("toJSON"in a)){t[s]=a;const o=isArray(a)?[]:{};return forEach(a,(c,f)=>{const y=n(c,s+1);!isUndefined(y)&&(o[f]=y)}),t[s]=void 0,o}}return a};return n(e,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=e=>e&&(isObject(e)||isFunction(e))&&isFunction(e.then)&&isFunction(e.catch),_setImmediate=((e,t)=>e?setImmediate:t?((n,a)=>(_global.addEventListener("message",({source:s,data:o})=>{s===_global&&o===n&&a.length&&a.shift()()},!1),s=>{a.push(s),_global.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",isFunction(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process$1<"u"&&process$1.nextTick||_setImmediate,isIterable=e=>e!=null&&isFunction(e[iterator]),utils$1={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isBoolean,isObject,isPlainObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate,isFile,isBlob,isRegExp,isFunction,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop,toFiniteNumber,findKey,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};function AxiosError$1(e,t,n,a,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),a&&(this.request=a),s&&(this.response=s,this.status=s.status?s.status:null)}utils$1.inherits(AxiosError$1,Error,{toJSON:function 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:utils$1.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{descriptors[e]={value:e}}),Object.defineProperties(AxiosError$1,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError$1.from=(e,t,n,a,s,o)=>{const c=Object.create(prototype$1);return utils$1.toFlatObject(e,c,function(y){return y!==Error.prototype},f=>f!=="isAxiosError"),AxiosError$1.call(c,e.message,t,n,a,s),c.cause=e,c.name=e.name,o&&Object.assign(c,o),c};const httpAdapter=null;function isVisitable(e){return utils$1.isPlainObject(e)||utils$1.isArray(e)}function removeBrackets(e){return utils$1.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey(e,t,n){return e?e.concat(t).map(function(s,o){return s=removeBrackets(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function isFlatArray(e){return utils$1.isArray(e)&&!e.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function e(t){return/^is[A-Z]/.test(t)});function toFormData$1(e,t,n){if(!utils$1.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=utils$1.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_e,$e){return!utils$1.isUndefined($e[_e])});const a=n.metaTokens,s=n.visitor||g,o=n.dots,c=n.indexes,y=(n.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(t);if(!utils$1.isFunction(s))throw new TypeError("visitor must be a function");function m(he){if(he===null)return"";if(utils$1.isDate(he))return he.toISOString();if(!y&&utils$1.isBlob(he))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(he)||utils$1.isTypedArray(he)?y&&typeof Blob=="function"?new Blob([he]):Buffer$2.from(he):he}function g(he,_e,$e){let pe=he;if(he&&!$e&&typeof he=="object"){if(utils$1.endsWith(_e,"{}"))_e=a?_e:_e.slice(0,-2),he=JSON.stringify(he);else if(utils$1.isArray(he)&&isFlatArray(he)||(utils$1.isFileList(he)||utils$1.endsWith(_e,"[]"))&&(pe=utils$1.toArray(he)))return _e=removeBrackets(_e),pe.forEach(function(Oe,qe){!(utils$1.isUndefined(Oe)||Oe===null)&&t.append(c===!0?renderKey([_e],qe,o):c===null?_e:_e+"[]",m(Oe))}),!1}return isVisitable(he)?!0:(t.append(renderKey($e,_e,o),m(he)),!1)}const z=[],ie=Object.assign(predicates,{defaultVisitor:g,convertValue:m,isVisitable});function re(he,_e){if(!utils$1.isUndefined(he)){if(z.indexOf(he)!==-1)throw Error("Circular reference detected in "+_e.join("."));z.push(he),utils$1.forEach(he,function(pe,Ce){(!(utils$1.isUndefined(pe)||pe===null)&&s.call(t,pe,utils$1.isString(Ce)?Ce.trim():Ce,_e,ie))===!0&&re(pe,_e?_e.concat(Ce):[Ce])}),z.pop()}}if(!utils$1.isObject(e))throw new TypeError("data must be an object");return re(e),t}function encode$1(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(a){return t[a]})}function AxiosURLSearchParams(e,t){this._pairs=[],e&&toFormData$1(e,this,t)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function e(t,n){this._pairs.push([t,n])},prototype.toString=function e(t){const n=t?function(a){return t.call(this,a,encode$1)}:encode$1;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(e,t,n){if(!t)return e;const a=n&&n.encode||encode;utils$1.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=utils$1.isURLSearchParams(t)?t.toString():new AxiosURLSearchParams(t,n).toString(a),o){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class InterceptorManager{constructor(){this.handlers=[]}use(t,n,a){return this.handlers.push({fulfilled:t,rejected:n,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){utils$1.forEach(this.handlers,function(a){a!==null&&t(a)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils,...platform$1};function toURLEncodedForm(e,t){return toFormData$1(e,new platform.classes.URLSearchParams,Object.assign({visitor:function(n,a,s,o){return platform.isNode&&utils$1.isBuffer(n)?(this.append(a,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function parsePropPath(e){return utils$1.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function arrayToObject(e){const t={},n=Object.keys(e);let a;const s=n.length;let o;for(a=0;a<s;a++)o=n[a],t[o]=e[o];return t}function formDataToJSON(e){function t(n,a,s,o){let c=n[o++];if(c==="__proto__")return!0;const f=Number.isFinite(+c),y=o>=n.length;return c=!c&&utils$1.isArray(s)?s.length:c,y?(utils$1.hasOwnProp(s,c)?s[c]=[s[c],a]:s[c]=a,!f):((!s[c]||!utils$1.isObject(s[c]))&&(s[c]=[]),t(n,a,s[c],o)&&utils$1.isArray(s[c])&&(s[c]=arrayToObject(s[c])),!f)}if(utils$1.isFormData(e)&&utils$1.isFunction(e.entries)){const n={};return utils$1.forEachEntry(e,(a,s)=>{t(parsePropPath(a),s,n,0)}),n}return null}function stringifySafely(e,t,n){if(utils$1.isString(e))try{return(t||JSON.parse)(e),utils$1.trim(e)}catch(a){if(a.name!=="SyntaxError")throw a}return(n||JSON.stringify)(e)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function e(t,n){const a=n.getContentType()||"",s=a.indexOf("application/json")>-1,o=utils$1.isObject(t);if(o&&utils$1.isHTMLForm(t)&&(t=new FormData(t)),utils$1.isFormData(t))return s?JSON.stringify(formDataToJSON(t)):t;if(utils$1.isArrayBuffer(t)||utils$1.isBuffer(t)||utils$1.isStream(t)||utils$1.isFile(t)||utils$1.isBlob(t)||utils$1.isReadableStream(t))return t;if(utils$1.isArrayBufferView(t))return t.buffer;if(utils$1.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let f;if(o){if(a.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(t,this.formSerializer).toString();if((f=utils$1.isFileList(t))||a.indexOf("multipart/form-data")>-1){const y=this.env&&this.env.FormData;return toFormData$1(f?{"files[]":t}:t,y&&new y,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),stringifySafely(t)):t}],transformResponse:[function e(t){const n=this.transitional||defaults.transitional,a=n&&n.forcedJSONParsing,s=this.responseType==="json";if(utils$1.isResponse(t)||utils$1.isReadableStream(t))return t;if(t&&utils$1.isString(t)&&(a&&!this.responseType||s)){const c=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(f){if(c)throw f.name==="SyntaxError"?AxiosError$1.from(f,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):f}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function e(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],e=>{defaults.headers[e]={}});const ignoreDuplicateOf=utils$1.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"]),parseHeaders=e=>{const t={};let n,a,s;return e&&e.split(`
872
+ `).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),o=new RegExp("(?:^"+n+"$)|(?:^"+s+"$)"),c=new RegExp("^"+n+"$"),f=new RegExp("^"+s+"$"),y=function(qe){return qe&&qe.exact?o:new RegExp("(?:"+t(qe)+n+t(qe)+")|(?:"+t(qe)+s+t(qe)+")","g")};y.v4=function(Oe){return Oe&&Oe.exact?c:new RegExp(""+t(Oe)+n+t(Oe),"g")},y.v6=function(Oe){return Oe&&Oe.exact?f:new RegExp(""+t(Oe)+s+t(Oe),"g")};var m="(?:(?:[a-z]+:)?//)",g="(?:\\S+(?::\\S*)?@)?",z=y.v4().source,ie=y.v6().source,re="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",he="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",_e="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",$e="(?::\\d{2,5})?",pe='(?:[/?#][^\\s"]*)?',Ce="(?:"+m+"|www\\.)"+g+"(?:localhost|"+z+"|"+ie+"|"+re+he+_e+")"+$e+pe;return urlReg=new RegExp("(?:^"+Ce+"$)","i"),urlReg},pattern$2={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},types={integer:function e(t){return types.number(t)&&parseInt(t,10)===t},float:function e(t){return types.number(t)&&!types.integer(t)},array:function e(t){return Array.isArray(t)},regexp:function e(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function e(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function e(t){return isNaN(t)?!1:typeof t=="number"},object:function e(t){return typeof t=="object"&&!types.array(t)},method:function e(t){return typeof t=="function"},email:function e(t){return typeof t=="string"&&t.length<=320&&!!t.match(pattern$2.email)},url:function e(t){return typeof t=="string"&&t.length<=2048&&!!t.match(getUrlRegex())},hex:function e(t){return typeof t=="string"&&!!t.match(pattern$2.hex)}},type$1=function e(t,n,a,s,o){if(t.required&&n===void 0){required$1(t,n,a,s,o);return}var c=["integer","float","array","regexp","object","method","email","number","date","url","hex"],f=t.type;c.indexOf(f)>-1?types[f](n)||s.push(format(o.messages.types[f],t.fullField,t.type)):f&&typeof n!==t.type&&s.push(format(o.messages.types[f],t.fullField,t.type))},range=function e(t,n,a,s,o){var c=typeof t.len=="number",f=typeof t.min=="number",y=typeof t.max=="number",m=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,g=n,z=null,ie=typeof n=="number",re=typeof n=="string",he=Array.isArray(n);if(ie?z="number":re?z="string":he&&(z="array"),!z)return!1;he&&(g=n.length),re&&(g=n.replace(m,"_").length),c?g!==t.len&&s.push(format(o.messages[z].len,t.fullField,t.len)):f&&!y&&g<t.min?s.push(format(o.messages[z].min,t.fullField,t.min)):y&&!f&&g>t.max?s.push(format(o.messages[z].max,t.fullField,t.max)):f&&y&&(g<t.min||g>t.max)&&s.push(format(o.messages[z].range,t.fullField,t.min,t.max))},ENUM$1="enum",enumerable$1=function e(t,n,a,s,o){t[ENUM$1]=Array.isArray(t[ENUM$1])?t[ENUM$1]:[],t[ENUM$1].indexOf(n)===-1&&s.push(format(o.messages[ENUM$1],t.fullField,t[ENUM$1].join(", ")))},pattern$1=function e(t,n,a,s,o){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||s.push(format(o.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var c=new RegExp(t.pattern);c.test(n)||s.push(format(o.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},rules={required:required$1,whitespace,type:type$1,range,enum:enumerable$1,pattern:pattern$1},string=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n,"string")&&!t.required)return a();rules.required(t,n,s,c,o,"string"),isEmptyValue(n,"string")||(rules.type(t,n,s,c,o),rules.range(t,n,s,c,o),rules.pattern(t,n,s,c,o),t.whitespace===!0&&rules.whitespace(t,n,s,c,o))}a(c)},method=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),n!==void 0&&rules.type(t,n,s,c,o)}a(c)},number=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(n===""&&(n=void 0),isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),n!==void 0&&(rules.type(t,n,s,c,o),rules.range(t,n,s,c,o))}a(c)},_boolean=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),n!==void 0&&rules.type(t,n,s,c,o)}a(c)},regexp=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),isEmptyValue(n)||rules.type(t,n,s,c,o)}a(c)},integer=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),n!==void 0&&(rules.type(t,n,s,c,o),rules.range(t,n,s,c,o))}a(c)},floatFn=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),n!==void 0&&(rules.type(t,n,s,c,o),rules.range(t,n,s,c,o))}a(c)},array=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(n==null&&!t.required)return a();rules.required(t,n,s,c,o,"array"),n!=null&&(rules.type(t,n,s,c,o),rules.range(t,n,s,c,o))}a(c)},object=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),n!==void 0&&rules.type(t,n,s,c,o)}a(c)},ENUM="enum",enumerable=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o),n!==void 0&&rules[ENUM](t,n,s,c,o)}a(c)},pattern=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n,"string")&&!t.required)return a();rules.required(t,n,s,c,o),isEmptyValue(n,"string")||rules.pattern(t,n,s,c,o)}a(c)},date=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n,"date")&&!t.required)return a();if(rules.required(t,n,s,c,o),!isEmptyValue(n,"date")){var y;n instanceof Date?y=n:y=new Date(n),rules.type(t,y,s,c,o),y&&rules.range(t,y.getTime(),s,c,o)}}a(c)},required=function e(t,n,a,s,o){var c=[],f=Array.isArray(n)?"array":typeof n;rules.required(t,n,s,c,o,f),a(c)},type=function e(t,n,a,s,o){var c=t.type,f=[],y=t.required||!t.required&&s.hasOwnProperty(t.field);if(y){if(isEmptyValue(n,c)&&!t.required)return a();rules.required(t,n,s,f,o,c),isEmptyValue(n,c)||rules.type(t,n,s,f,o)}a(f)},any=function e(t,n,a,s,o){var c=[],f=t.required||!t.required&&s.hasOwnProperty(t.field);if(f){if(isEmptyValue(n)&&!t.required)return a();rules.required(t,n,s,c,o)}a(c)},validators$2={string,method,number,boolean:_boolean,regexp,integer,float:floatFn,array,object,enum:enumerable,pattern,date,url:type,hex:type,email:type,required,any};function newMessages(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var messages=newMessages(),Schema=function(){function e(n){this.rules=null,this._messages=messages,this.define(n)}var t=e.prototype;return t.define=function(a){var s=this;if(!a)throw new Error("Cannot configure a schema with no rules");if(typeof a!="object"||Array.isArray(a))throw new Error("Rules must be an object");this.rules={},Object.keys(a).forEach(function(o){var c=a[o];s.rules[o]=Array.isArray(c)?c:[c]})},t.messages=function(a){return a&&(this._messages=deepMerge(newMessages(),a)),this._messages},t.validate=function(a,s,o){var c=this;s===void 0&&(s={}),o===void 0&&(o=function(){});var f=a,y=s,m=o;if(typeof y=="function"&&(m=y,y={}),!this.rules||Object.keys(this.rules).length===0)return m&&m(null,f),Promise.resolve(f);function g(_e){var $e=[],pe={};function Ce(qe){if(Array.isArray(qe)){var At;$e=(At=$e).concat.apply(At,qe)}else $e.push(qe)}for(var Oe=0;Oe<_e.length;Oe++)Ce(_e[Oe]);$e.length?(pe=convertFieldsError($e),m($e,pe)):m(null,f)}if(y.messages){var z=this.messages();z===messages&&(z=newMessages()),deepMerge(z,y.messages),y.messages=z}else y.messages=this.messages();var ie={},re=y.keys||Object.keys(this.rules);re.forEach(function(_e){var $e=c.rules[_e],pe=f[_e];$e.forEach(function(Ce){var Oe=Ce;typeof Oe.transform=="function"&&(f===a&&(f=_extends({},f)),pe=f[_e]=Oe.transform(pe)),typeof Oe=="function"?Oe={validator:Oe}:Oe=_extends({},Oe),Oe.validator=c.getValidationMethod(Oe),Oe.validator&&(Oe.field=_e,Oe.fullField=Oe.fullField||_e,Oe.type=c.getType(Oe),ie[_e]=ie[_e]||[],ie[_e].push({rule:Oe,value:pe,source:f,field:_e}))})});var he={};return asyncMap(ie,y,function(_e,$e){var pe=_e.rule,Ce=(pe.type==="object"||pe.type==="array")&&(typeof pe.fields=="object"||typeof pe.defaultField=="object");Ce=Ce&&(pe.required||!pe.required&&_e.value),pe.field=_e.field;function Oe(Et,ze){return _extends({},ze,{fullField:pe.fullField+"."+Et,fullFields:pe.fullFields?[].concat(pe.fullFields,[Et]):[Et]})}function qe(Et){Et===void 0&&(Et=[]);var ze=Array.isArray(Et)?Et:[Et];!y.suppressWarning&&ze.length&&e.warning("async-validator:",ze),ze.length&&pe.message!==void 0&&(ze=[].concat(pe.message));var kt=ze.map(complementError(pe,f));if(y.first&&kt.length)return he[pe.field]=1,$e(kt);if(!Ce)$e(kt);else{if(pe.required&&!_e.value)return pe.message!==void 0?kt=[].concat(pe.message).map(complementError(pe,f)):y.error&&(kt=[y.error(pe,format(y.messages.required,pe.field))]),$e(kt);var Pt={};pe.defaultField&&Object.keys(_e.value).map(function(u){Pt[u]=pe.defaultField}),Pt=_extends({},Pt,_e.rule.fields);var jt={};Object.keys(Pt).forEach(function(u){var v=Pt[u],Y=Array.isArray(v)?v:[v];jt[u]=Y.map(Oe.bind(null,u))});var Ie=new e(jt);Ie.messages(y.messages),_e.rule.options&&(_e.rule.options.messages=y.messages,_e.rule.options.error=y.error),Ie.validate(_e.value,_e.rule.options||y,function(u){var v=[];kt&&kt.length&&v.push.apply(v,kt),u&&u.length&&v.push.apply(v,u),$e(v.length?v:null)})}}var At;if(pe.asyncValidator)At=pe.asyncValidator(pe,_e.value,qe,_e.source,y);else if(pe.validator){try{At=pe.validator(pe,_e.value,qe,_e.source,y)}catch(Et){console.error==null||console.error(Et),y.suppressValidatorError||setTimeout(function(){throw Et},0),qe(Et.message)}At===!0?qe():At===!1?qe(typeof pe.message=="function"?pe.message(pe.fullField||pe.field):pe.message||(pe.fullField||pe.field)+" fails"):At instanceof Array?qe(At):At instanceof Error&&qe(At.message)}At&&At.then&&At.then(function(){return qe()},function(Et){return qe(Et)})},function(_e){g(_e)},f)},t.getType=function(a){if(a.type===void 0&&a.pattern instanceof RegExp&&(a.type="pattern"),typeof a.validator!="function"&&a.type&&!validators$2.hasOwnProperty(a.type))throw new Error(format("Unknown rule type %s",a.type));return a.type||"string"},t.getValidationMethod=function(a){if(typeof a.validator=="function")return a.validator;var s=Object.keys(a),o=s.indexOf("message");return o!==-1&&s.splice(o,1),s.length===1&&s[0]==="required"?validators$2.required:validators$2[this.getType(a)]||void 0},e}();Schema.register=function e(t,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");validators$2[t]=n},Schema.warning=warning,Schema.messages=messages,Schema.validators=validators$2;const formItemValidateStates=["","error","validating","success"],formItemProps=buildProps({label:String,labelWidth:{type:[String,Number],default:""},labelPosition:{type:String,values:["left","right","top",""],default:""},prop:{type:definePropType([String,Array])},required:{type:Boolean,default:void 0},rules:{type:definePropType([Object,Array])},error:String,validateStatus:{type:String,values:formItemValidateStates},for:String,inlineMessage:{type:[String,Boolean],default:""},showMessage:{type:Boolean,default:!0},size:{type:String,values:componentSizes}}),COMPONENT_NAME$5="ElLabelWrap";var FormLabelWrap=defineComponent({name:COMPONENT_NAME$5,props:{isAutoWidth:Boolean,updateAll:Boolean},setup(e,{slots:t}){const n=inject(formContextKey,void 0),a=inject(formItemContextKey);a||throwError(COMPONENT_NAME$5,"usage: <el-form-item><label-wrap /></el-form-item>");const s=useNamespace("form"),o=ref(),c=ref(0),f=()=>{var g;if((g=o.value)!=null&&g.firstElementChild){const z=window.getComputedStyle(o.value.firstElementChild).width;return Math.ceil(Number.parseFloat(z))}else return 0},y=(g="update")=>{nextTick(()=>{t.default&&e.isAutoWidth&&(g==="update"?c.value=f():g==="remove"&&(n==null||n.deregisterLabelWidth(c.value)))})},m=()=>y("update");return onMounted(()=>{m()}),onBeforeUnmount(()=>{y("remove")}),onUpdated(()=>m()),watch(c,(g,z)=>{e.updateAll&&(n==null||n.registerLabelWidth(g,z))}),useResizeObserver(computed(()=>{var g,z;return(z=(g=o.value)==null?void 0:g.firstElementChild)!=null?z:null}),m),()=>{var g,z;if(!t)return null;const{isAutoWidth:ie}=e;if(ie){const re=n==null?void 0:n.autoLabelWidth,he=a==null?void 0:a.hasLabel,_e={};if(he&&re&&re!=="auto"){const $e=Math.max(0,Number.parseInt(re,10)-c.value),Ce=(a.labelPosition||n.labelPosition)==="left"?"marginRight":"marginLeft";$e&&(_e[Ce]=`${$e}px`)}return createVNode("div",{ref:o,class:[s.be("item","label-wrap")],style:_e},[(g=t.default)==null?void 0:g.call(t)])}else return createVNode(Fragment,{ref:o},[(z=t.default)==null?void 0:z.call(t)])}}});const __default__$7=defineComponent({name:"ElFormItem"}),_sfc_main$t=defineComponent({...__default__$7,props:formItemProps,setup(e,{expose:t}){const n=e,a=useSlots(),s=inject(formContextKey,void 0),o=inject(formItemContextKey,void 0),c=useFormSize(void 0,{formItem:!1}),f=useNamespace("form-item"),y=useId().value,m=ref([]),g=ref(""),z=refDebounced(g,100),ie=ref(""),re=ref();let he,_e=!1;const $e=computed(()=>n.labelPosition||(s==null?void 0:s.labelPosition)),pe=computed(()=>{if($e.value==="top")return{};const fr=addUnit(n.labelWidth||(s==null?void 0:s.labelWidth)||"");return fr?{width:fr}:{}}),Ce=computed(()=>{if($e.value==="top"||s!=null&&s.inline)return{};if(!n.label&&!n.labelWidth&&jt)return{};const fr=addUnit(n.labelWidth||(s==null?void 0:s.labelWidth)||"");return!n.label&&!a.label?{marginLeft:fr}:{}}),Oe=computed(()=>[f.b(),f.m(c.value),f.is("error",g.value==="error"),f.is("validating",g.value==="validating"),f.is("success",g.value==="success"),f.is("required",ae.value||n.required),f.is("no-asterisk",s==null?void 0:s.hideRequiredAsterisk),(s==null?void 0:s.requireAsteriskPosition)==="right"?"asterisk-right":"asterisk-left",{[f.m("feedback")]:s==null?void 0:s.statusIcon,[f.m(`label-${$e.value}`)]:$e.value}]),qe=computed(()=>isBoolean$1(n.inlineMessage)?n.inlineMessage:(s==null?void 0:s.inlineMessage)||!1),At=computed(()=>[f.e("error"),{[f.em("error","inline")]:qe.value}]),Et=computed(()=>n.prop?isString$5(n.prop)?n.prop:n.prop.join("."):""),ze=computed(()=>!!(n.label||a.label)),kt=computed(()=>{var fr;return(fr=n.for)!=null?fr:m.value.length===1?m.value[0]:void 0}),Pt=computed(()=>!kt.value&&ze.value),jt=!!o,Ie=computed(()=>{const fr=s==null?void 0:s.model;if(!(!fr||!n.prop))return getProp(fr,n.prop).value}),u=computed(()=>{const{required:fr}=n,Cr=[];n.rules&&Cr.push(...castArray$1(n.rules));const Mr=s==null?void 0:s.rules;if(Mr&&n.prop){const xr=getProp(Mr,n.prop).value;xr&&Cr.push(...castArray$1(xr))}if(fr!==void 0){const xr=Cr.map((gr,dr)=>[gr,dr]).filter(([gr])=>Object.keys(gr).includes("required"));if(xr.length>0)for(const[gr,dr]of xr)gr.required!==fr&&(Cr[dr]={...gr,required:fr});else Cr.push({required:fr})}return Cr}),v=computed(()=>u.value.length>0),Y=fr=>u.value.filter(Mr=>!Mr.trigger||!fr?!0:isArray$4(Mr.trigger)?Mr.trigger.includes(fr):Mr.trigger===fr).map(({trigger:Mr,...xr})=>xr),ae=computed(()=>u.value.some(fr=>fr.required)),xe=computed(()=>{var fr;return z.value==="error"&&n.showMessage&&((fr=s==null?void 0:s.showMessage)!=null?fr:!0)}),Ve=computed(()=>`${n.label||""}${(s==null?void 0:s.labelSuffix)||""}`),Ue=fr=>{g.value=fr},Ne=fr=>{var Cr,Mr;const{errors:xr,fields:gr}=fr;(!xr||!gr)&&console.error(fr),Ue("error"),ie.value=xr?(Mr=(Cr=xr==null?void 0:xr[0])==null?void 0:Cr.message)!=null?Mr:`${n.prop} is required`:"",s==null||s.emit("validate",n.prop,!1,ie.value)},L=()=>{Ue("success"),s==null||s.emit("validate",n.prop,!0,"")},Fe=async fr=>{const Cr=Et.value;return new Schema({[Cr]:fr}).validate({[Cr]:Ie.value},{firstFields:!0}).then(()=>(L(),!0)).catch(xr=>(Ne(xr),Promise.reject(xr)))},Dt=async(fr,Cr)=>{if(_e||!n.prop)return!1;const Mr=isFunction$4(Cr);if(!v.value)return Cr==null||Cr(!1),!1;const xr=Y(fr);return xr.length===0?(Cr==null||Cr(!0),!0):(Ue("validating"),Fe(xr).then(()=>(Cr==null||Cr(!0),!0)).catch(gr=>{const{fields:dr}=gr;return Cr==null||Cr(!1,dr),Mr?!1:Promise.reject(dr)}))},er=()=>{Ue(""),ie.value="",_e=!1},ir=async()=>{const fr=s==null?void 0:s.model;if(!fr||!n.prop)return;const Cr=getProp(fr,n.prop);_e=!0,Cr.value=clone(he),await nextTick(),er(),_e=!1},cr=fr=>{m.value.includes(fr)||m.value.push(fr)},sr=fr=>{m.value=m.value.filter(Cr=>Cr!==fr)};watch(()=>n.error,fr=>{ie.value=fr||"",Ue(fr?"error":"")},{immediate:!0}),watch(()=>n.validateStatus,fr=>Ue(fr||""));const ar=reactive({...toRefs(n),$el:re,size:c,validateState:g,labelId:y,inputIds:m,isGroup:Pt,hasLabel:ze,fieldValue:Ie,addInputId:cr,removeInputId:sr,resetField:ir,clearValidate:er,validate:Dt});return provide(formItemContextKey,ar),onMounted(()=>{n.prop&&(s==null||s.addField(ar),he=clone(Ie.value))}),onBeforeUnmount(()=>{s==null||s.removeField(ar)}),t({size:c,validateMessage:ie,validateState:g,validate:Dt,clearValidate:er,resetField:ir}),(fr,Cr)=>{var Mr;return openBlock(),createElementBlock("div",{ref_key:"formItemRef",ref:re,class:normalizeClass(unref(Oe)),role:unref(Pt)?"group":void 0,"aria-labelledby":unref(Pt)?unref(y):void 0},[createVNode(unref(FormLabelWrap),{"is-auto-width":unref(pe).width==="auto","update-all":((Mr=unref(s))==null?void 0:Mr.labelWidth)==="auto"},{default:withCtx(()=>[unref(ze)?(openBlock(),createBlock(resolveDynamicComponent(unref(kt)?"label":"div"),{key:0,id:unref(y),for:unref(kt),class:normalizeClass(unref(f).e("label")),style:normalizeStyle(unref(pe))},{default:withCtx(()=>[renderSlot(fr.$slots,"label",{label:unref(Ve)},()=>[createTextVNode(toDisplayString$1(unref(Ve)),1)])]),_:3},8,["id","for","class","style"])):createCommentVNode("v-if",!0)]),_:3},8,["is-auto-width","update-all"]),createBaseVNode("div",{class:normalizeClass(unref(f).e("content")),style:normalizeStyle(unref(Ce))},[renderSlot(fr.$slots,"default"),createVNode(TransitionGroup,{name:`${unref(f).namespace.value}-zoom-in-top`},{default:withCtx(()=>[unref(xe)?renderSlot(fr.$slots,"error",{key:0,error:ie.value},()=>[createBaseVNode("div",{class:normalizeClass(unref(At))},toDisplayString$1(ie.value),3)]):createCommentVNode("v-if",!0)]),_:3},8,["name"])],6)],10,["role","aria-labelledby"])}}});var FormItem=_export_sfc$1(_sfc_main$t,[["__file","form-item.vue"]]);const ElForm=withInstall(Form,{FormItem}),ElFormItem=withNoopInstall(FormItem);function useCalcInputWidth(){const e=shallowRef(),t=ref(0),n=11,a=computed(()=>({minWidth:`${Math.max(t.value,n)}px`}));return useResizeObserver(e,()=>{var o,c;t.value=(c=(o=e.value)==null?void 0:o.getBoundingClientRect().width)!=null?c:0}),{calculatorRef:e,calculatorWidth:t,inputStyle:a}}const linkProps=buildProps({type:{type:String,values:["primary","success","warning","info","danger","default"],default:void 0},underline:{type:[Boolean,String],values:[!0,!1,"always","never","hover"],default:void 0},disabled:Boolean,href:{type:String,default:""},target:{type:String,default:"_self"},icon:{type:iconPropType}}),linkEmits={click:e=>e instanceof MouseEvent},__default__$6=defineComponent({name:"ElLink"}),_sfc_main$s=defineComponent({...__default__$6,props:linkProps,emits:linkEmits,setup(e,{emit:t}){const n=e,a=useGlobalConfig("link");useDeprecated({scope:"el-link",from:"The underline option (boolean)",replacement:"'always' | 'hover' | 'never'",version:"3.0.0",ref:"https://element-plus.org/en-US/component/link.html#underline"},computed(()=>isBoolean$1(n.underline)));const s=useNamespace("link"),o=computed(()=>{var y,m,g;return[s.b(),s.m((g=(m=n.type)!=null?m:(y=a.value)==null?void 0:y.type)!=null?g:"default"),s.is("disabled",n.disabled),s.is("underline",c.value==="always"),s.is("hover-underline",c.value==="hover"&&!n.disabled)]}),c=computed(()=>{var y,m,g;return isBoolean$1(n.underline)?n.underline?"hover":"never":(g=(m=n.underline)!=null?m:(y=a.value)==null?void 0:y.underline)!=null?g:"hover"});function f(y){n.disabled||t("click",y)}return(y,m)=>(openBlock(),createElementBlock("a",{class:normalizeClass(unref(o)),href:y.disabled||!y.href?void 0:y.href,target:y.disabled||!y.href?void 0:y.target,onClick:f},[y.icon?(openBlock(),createBlock(unref(ElIcon),{key:0},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(y.icon)))]),_:1})):createCommentVNode("v-if",!0),y.$slots.default?(openBlock(),createElementBlock("span",{key:1,class:normalizeClass(unref(s).e("inner"))},[renderSlot(y.$slots,"default")],2)):createCommentVNode("v-if",!0),y.$slots.icon?renderSlot(y.$slots,"icon",{key:2}):createCommentVNode("v-if",!0)],10,["href","target"]))}});var Link=_export_sfc$1(_sfc_main$s,[["__file","link.vue"]]);const ElLink=withInstall(Link);let SubMenu$1=class{constructor(t,n){this.parent=t,this.domNode=n,this.subIndex=0,this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()}gotoSubIndex(t){t===this.subMenuItems.length?t=0:t<0&&(t=this.subMenuItems.length-1),this.subMenuItems[t].focus(),this.subIndex=t}addListeners(){const t=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,n=>{n.addEventListener("keydown",a=>{let s=!1;switch(a.code){case EVENT_CODE.down:{this.gotoSubIndex(this.subIndex+1),s=!0;break}case EVENT_CODE.up:{this.gotoSubIndex(this.subIndex-1),s=!0;break}case EVENT_CODE.tab:{triggerEvent(t,"mouseleave");break}case EVENT_CODE.enter:case EVENT_CODE.numpadEnter:case EVENT_CODE.space:{s=!0,a.currentTarget.click();break}}return s&&(a.preventDefault(),a.stopPropagation()),!1})})}},MenuItem$1=class{constructor(t,n){this.domNode=t,this.submenu=null,this.submenu=null,this.init(n)}init(t){this.domNode.setAttribute("tabindex","0");const n=this.domNode.querySelector(`.${t}-menu`);n&&(this.submenu=new SubMenu$1(this,n)),this.addListeners()}addListeners(){this.domNode.addEventListener("keydown",t=>{let n=!1;switch(t.code){case EVENT_CODE.down:{triggerEvent(t.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(0),n=!0;break}case EVENT_CODE.up:{triggerEvent(t.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(this.submenu.subMenuItems.length-1),n=!0;break}case EVENT_CODE.tab:{triggerEvent(t.currentTarget,"mouseleave");break}case EVENT_CODE.enter:case EVENT_CODE.numpadEnter:case EVENT_CODE.space:{n=!0,t.currentTarget.click();break}}n&&t.preventDefault()})}},Menu$1=class{constructor(t,n){this.domNode=t,this.init(n)}init(t){const n=this.domNode.childNodes;Array.from(n).forEach(a=>{a.nodeType===1&&new MenuItem$1(a,t)})}};const __default__$5=defineComponent({name:"ElMenuCollapseTransition"}),_sfc_main$r=defineComponent({...__default__$5,setup(e){const t=useNamespace("menu"),n={onBeforeEnter:a=>a.style.opacity="0.2",onEnter(a,s){addClass(a,`${t.namespace.value}-opacity-transition`),a.style.opacity="1",s()},onAfterEnter(a){removeClass(a,`${t.namespace.value}-opacity-transition`),a.style.opacity=""},onBeforeLeave(a){a.dataset||(a.dataset={}),hasClass(a,t.m("collapse"))?(removeClass(a,t.m("collapse")),a.dataset.oldOverflow=a.style.overflow,a.dataset.scrollWidth=a.clientWidth.toString(),addClass(a,t.m("collapse"))):(addClass(a,t.m("collapse")),a.dataset.oldOverflow=a.style.overflow,a.dataset.scrollWidth=a.clientWidth.toString(),removeClass(a,t.m("collapse"))),a.style.width=`${a.scrollWidth}px`,a.style.overflow="hidden"},onLeave(a){addClass(a,"horizontal-collapse-transition"),a.style.width=`${a.dataset.scrollWidth}px`}};return(a,s)=>(openBlock(),createBlock(Transition,mergeProps({mode:"out-in"},unref(n)),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16))}});var ElMenuCollapseTransition=_export_sfc$1(_sfc_main$r,[["__file","menu-collapse-transition.vue"]]);function useMenu(e,t){const n=computed(()=>{let s=e.parent;const o=[t.value];for(;s.type.name!=="ElMenu";)s.props.index&&o.unshift(s.props.index),s=s.parent;return o});return{parentMenu:computed(()=>{let s=e.parent;for(;s&&!["ElMenu","ElSubMenu"].includes(s.type.name);)s=s.parent;return s}),indexPath:n}}function useMenuColor(e){return computed(()=>{const n=e.backgroundColor;return n?new TinyColor(n).shade(20).toString():""})}const useMenuCssVar=(e,t)=>{const n=useNamespace("menu");return computed(()=>n.cssVarBlock({"text-color":e.textColor||"","hover-text-color":e.textColor||"","bg-color":e.backgroundColor||"","hover-bg-color":useMenuColor(e).value||"","active-color":e.activeTextColor||"",level:`${t}`}))},MENU_INJECTION_KEY="rootMenu",SUB_MENU_INJECTION_KEY="subMenu:",subMenuProps=buildProps({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:String,disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:iconPropType},expandOpenIcon:{type:iconPropType},collapseCloseIcon:{type:iconPropType},collapseOpenIcon:{type:iconPropType}}),COMPONENT_NAME$4="ElSubMenu";var SubMenu=defineComponent({name:COMPONENT_NAME$4,props:subMenuProps,setup(e,{slots:t,expose:n}){const a=getCurrentInstance(),{indexPath:s,parentMenu:o}=useMenu(a,computed(()=>e.index)),c=useNamespace("menu"),f=useNamespace("sub-menu"),y=inject(MENU_INJECTION_KEY);y||throwError(COMPONENT_NAME$4,"can not inject root menu");const m=inject(`${SUB_MENU_INJECTION_KEY}${o.value.uid}`);m||throwError(COMPONENT_NAME$4,"can not inject sub menu");const g=ref({}),z=ref({});let ie;const re=ref(!1),he=ref(),_e=ref(),$e=computed(()=>kt.value==="horizontal"&&Ce.value?"bottom-start":"right-start"),pe=computed(()=>kt.value==="horizontal"&&Ce.value||kt.value==="vertical"&&!y.props.collapse?e.expandCloseIcon&&e.expandOpenIcon?Et.value?e.expandOpenIcon:e.expandCloseIcon:arrow_down_default:e.collapseCloseIcon&&e.collapseOpenIcon?Et.value?e.collapseOpenIcon:e.collapseCloseIcon:arrow_right_default),Ce=computed(()=>m.level===0),Oe=computed(()=>{const Fe=e.teleported;return isUndefined$1(Fe)?Ce.value:Fe}),qe=computed(()=>y.props.collapse?`${c.namespace.value}-zoom-in-left`:`${c.namespace.value}-zoom-in-top`),At=computed(()=>kt.value==="horizontal"&&Ce.value?["bottom-start","bottom-end","top-start","top-end","right-start","left-start"]:["right-start","right","right-end","left-start","bottom-start","bottom-end","top-start","top-end"]),Et=computed(()=>y.openedMenus.includes(e.index)),ze=computed(()=>[...Object.values(g.value),...Object.values(z.value)].some(({active:Fe})=>Fe)),kt=computed(()=>y.props.mode),Pt=computed(()=>y.props.persistent),jt=reactive({index:e.index,indexPath:s,active:ze}),Ie=useMenuCssVar(y.props,m.level+1),u=computed(()=>{var Fe;return(Fe=e.popperOffset)!=null?Fe:y.props.popperOffset}),v=computed(()=>{var Fe;return(Fe=e.popperClass)!=null?Fe:y.props.popperClass}),Y=computed(()=>{var Fe;return(Fe=e.showTimeout)!=null?Fe:y.props.showTimeout}),ae=computed(()=>{var Fe;return(Fe=e.hideTimeout)!=null?Fe:y.props.hideTimeout}),xe=()=>{var Fe,Dt,er;return(er=(Dt=(Fe=_e.value)==null?void 0:Fe.popperRef)==null?void 0:Dt.popperInstanceRef)==null?void 0:er.destroy()},Ve=Fe=>{Fe||xe()},Ue=()=>{y.props.menuTrigger==="hover"&&y.props.mode==="horizontal"||y.props.collapse&&y.props.mode==="vertical"||e.disabled||y.handleSubMenuClick({index:e.index,indexPath:s.value,active:ze.value})},Ne=(Fe,Dt=Y.value)=>{var er;if(Fe.type!=="focus"){if(y.props.menuTrigger==="click"&&y.props.mode==="horizontal"||!y.props.collapse&&y.props.mode==="vertical"||e.disabled){m.mouseInChild.value=!0;return}m.mouseInChild.value=!0,ie==null||ie(),{stop:ie}=useTimeoutFn(()=>{y.openMenu(e.index,s.value)},Dt),Oe.value&&((er=o.value.vnode.el)==null||er.dispatchEvent(new MouseEvent("mouseenter")))}},L=(Fe=!1)=>{var Dt;if(y.props.menuTrigger==="click"&&y.props.mode==="horizontal"||!y.props.collapse&&y.props.mode==="vertical"){m.mouseInChild.value=!1;return}ie==null||ie(),m.mouseInChild.value=!1,{stop:ie}=useTimeoutFn(()=>!re.value&&y.closeMenu(e.index,s.value),ae.value),Oe.value&&Fe&&((Dt=m.handleMouseleave)==null||Dt.call(m,!0))};watch(()=>y.props.collapse,Fe=>Ve(!!Fe));{const Fe=er=>{z.value[er.index]=er},Dt=er=>{delete z.value[er.index]};provide(`${SUB_MENU_INJECTION_KEY}${a.uid}`,{addSubMenu:Fe,removeSubMenu:Dt,handleMouseleave:L,mouseInChild:re,level:m.level+1})}return n({opened:Et}),onMounted(()=>{y.addSubMenu(jt),m.addSubMenu(jt)}),onBeforeUnmount(()=>{m.removeSubMenu(jt),y.removeSubMenu(jt)}),()=>{var Fe;const Dt=[(Fe=t.title)==null?void 0:Fe.call(t),h(ElIcon,{class:f.e("icon-arrow"),style:{transform:Et.value?e.expandCloseIcon&&e.expandOpenIcon||e.collapseCloseIcon&&e.collapseOpenIcon&&y.props.collapse?"none":"rotateZ(180deg)":"none"}},{default:()=>isString$5(pe.value)?h(a.appContext.components[pe.value]):h(pe.value)})],er=y.isMenuPopup?h(ElTooltip,{ref:_e,visible:Et.value,effect:"light",pure:!0,offset:u.value,showArrow:!1,persistent:Pt.value,popperClass:v.value,placement:$e.value,teleported:Oe.value,fallbackPlacements:At.value,transition:qe.value,gpuAcceleration:!1},{content:()=>{var ir;return h("div",{class:[c.m(kt.value),c.m("popup-container"),v.value],onMouseenter:cr=>Ne(cr,100),onMouseleave:()=>L(!0),onFocus:cr=>Ne(cr,100)},[h("ul",{class:[c.b(),c.m("popup"),c.m(`popup-${$e.value}`)],style:Ie.value},[(ir=t.default)==null?void 0:ir.call(t)])])},default:()=>h("div",{class:f.e("title"),onClick:Ue},Dt)}):h(Fragment,{},[h("div",{class:f.e("title"),ref:he,onClick:Ue},Dt),h(ElCollapseTransition,{},{default:()=>{var ir;return withDirectives(h("ul",{role:"menu",class:[c.b(),c.m("inline")],style:Ie.value},[(ir=t.default)==null?void 0:ir.call(t)]),[[vShow,Et.value]])}})]);return h("li",{class:[f.b(),f.is("active",ze.value),f.is("opened",Et.value),f.is("disabled",e.disabled)],role:"menuitem",ariaHaspopup:!0,ariaExpanded:Et.value,onMouseenter:Ne,onMouseleave:()=>L(),onFocus:Ne},[er])}}});const menuProps=buildProps({mode:{type:String,values:["horizontal","vertical"],default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:{type:definePropType(Array),default:()=>mutable([])},uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,values:["hover","click"],default:"hover"},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,closeOnClickOutside:Boolean,collapseTransition:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},popperOffset:{type:Number,default:6},ellipsisIcon:{type:iconPropType,default:()=>more_default},popperEffect:{type:definePropType(String),default:"dark"},popperClass:String,showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300},persistent:{type:Boolean,default:!0}}),checkIndexPath=e=>isArray$4(e)&&e.every(t=>isString$5(t)),menuEmits={close:(e,t)=>isString$5(e)&&checkIndexPath(t),open:(e,t)=>isString$5(e)&&checkIndexPath(t),select:(e,t,n,a)=>isString$5(e)&&checkIndexPath(t)&&isObject$4(n)&&(isUndefined$1(a)||a instanceof Promise)};var Menu=defineComponent({name:"ElMenu",props:menuProps,emits:menuEmits,setup(e,{emit:t,slots:n,expose:a}){const s=getCurrentInstance(),o=s.appContext.config.globalProperties.$router,c=ref(),f=useNamespace("menu"),y=useNamespace("sub-menu"),m=ref(-1),g=ref(e.defaultOpeneds&&!e.collapse?e.defaultOpeneds.slice(0):[]),z=ref(e.defaultActive),ie=ref({}),re=ref({}),he=computed(()=>e.mode==="horizontal"||e.mode==="vertical"&&e.collapse),_e=()=>{const ae=z.value&&ie.value[z.value];if(!ae||e.mode==="horizontal"||e.collapse)return;ae.indexPath.forEach(Ve=>{const Ue=re.value[Ve];Ue&&$e(Ve,Ue.indexPath)})},$e=(ae,xe)=>{g.value.includes(ae)||(e.uniqueOpened&&(g.value=g.value.filter(Ve=>xe.includes(Ve))),g.value.push(ae),t("open",ae,xe))},pe=ae=>{const xe=g.value.indexOf(ae);xe!==-1&&g.value.splice(xe,1)},Ce=(ae,xe)=>{pe(ae),t("close",ae,xe)},Oe=({index:ae,indexPath:xe})=>{g.value.includes(ae)?Ce(ae,xe):$e(ae,xe)},qe=ae=>{(e.mode==="horizontal"||e.collapse)&&(g.value=[]);const{index:xe,indexPath:Ve}=ae;if(!(isNil(xe)||isNil(Ve)))if(e.router&&o){const Ue=ae.route||xe,Ne=o.push(Ue).then(L=>(L||(z.value=xe),L));t("select",xe,Ve,{index:xe,indexPath:Ve,route:Ue},Ne)}else z.value=xe,t("select",xe,Ve,{index:xe,indexPath:Ve})},At=ae=>{var xe;const Ve=ie.value,Ue=Ve[ae]||z.value&&Ve[z.value]||Ve[e.defaultActive];z.value=(xe=Ue==null?void 0:Ue.index)!=null?xe:ae},Et=ae=>{const xe=getComputedStyle(ae),Ve=Number.parseInt(xe.marginLeft,10),Ue=Number.parseInt(xe.marginRight,10);return ae.offsetWidth+Ve+Ue||0},ze=()=>{var ae,xe;if(!c.value)return-1;const Ve=Array.from((xe=(ae=c.value)==null?void 0:ae.childNodes)!=null?xe:[]).filter(cr=>cr.nodeName!=="#text"||cr.nodeValue),Ue=64,Ne=getComputedStyle(c.value),L=Number.parseInt(Ne.paddingLeft,10),Fe=Number.parseInt(Ne.paddingRight,10),Dt=c.value.clientWidth-L-Fe;let er=0,ir=0;return Ve.forEach((cr,sr)=>{cr.nodeName!=="#comment"&&(er+=Et(cr),er<=Dt-Ue&&(ir=sr+1))}),ir===Ve.length?-1:ir},kt=ae=>re.value[ae].indexPath,Pt=(ae,xe=33.34)=>{let Ve;return()=>{Ve&&clearTimeout(Ve),Ve=setTimeout(()=>{ae()},xe)}};let jt=!0;const Ie=()=>{if(m.value===ze())return;const ae=()=>{m.value=-1,nextTick(()=>{m.value=ze()})};jt?ae():Pt(ae)(),jt=!1};watch(()=>e.defaultActive,ae=>{ie.value[ae]||(z.value=""),At(ae)}),watch(()=>e.collapse,ae=>{ae&&(g.value=[])}),watch(ie.value,_e);let u;watchEffect(()=>{e.mode==="horizontal"&&e.ellipsis?u=useResizeObserver(c,Ie).stop:u==null||u()});const v=ref(!1);{const ae=Ne=>{re.value[Ne.index]=Ne},xe=Ne=>{delete re.value[Ne.index]};provide(MENU_INJECTION_KEY,reactive({props:e,openedMenus:g,items:ie,subMenus:re,activeIndex:z,isMenuPopup:he,addMenuItem:Ne=>{ie.value[Ne.index]=Ne},removeMenuItem:Ne=>{delete ie.value[Ne.index]},addSubMenu:ae,removeSubMenu:xe,openMenu:$e,closeMenu:Ce,handleMenuItemClick:qe,handleSubMenuClick:Oe})),provide(`${SUB_MENU_INJECTION_KEY}${s.uid}`,{addSubMenu:ae,removeSubMenu:xe,mouseInChild:v,level:0})}onMounted(()=>{e.mode==="horizontal"&&new Menu$1(s.vnode.el,f.namespace.value)}),a({open:xe=>{const{indexPath:Ve}=re.value[xe];Ve.forEach(Ue=>$e(Ue,Ve))},close:pe,updateActiveIndex:At,handleResize:Ie});const Y=useMenuCssVar(e,0);return()=>{var ae,xe;let Ve=(xe=(ae=n.default)==null?void 0:ae.call(n))!=null?xe:[];const Ue=[];if(e.mode==="horizontal"&&c.value){const Fe=flattedChildren(Ve),Dt=m.value===-1?Fe:Fe.slice(0,m.value),er=m.value===-1?[]:Fe.slice(m.value);er!=null&&er.length&&e.ellipsis&&(Ve=Dt,Ue.push(h(SubMenu,{index:"sub-menu-more",class:y.e("hide-arrow"),popperOffset:e.popperOffset},{title:()=>h(ElIcon,{class:y.e("icon-more")},{default:()=>h(e.ellipsisIcon)}),default:()=>er})))}const Ne=e.closeOnClickOutside?[[ClickOutside,()=>{g.value.length&&(v.value||(g.value.forEach(Fe=>t("close",Fe,kt(Fe))),g.value=[]))}]]:[],L=withDirectives(h("ul",{key:String(e.collapse),role:"menubar",ref:c,style:Y.value,class:{[f.b()]:!0,[f.m(e.mode)]:!0,[f.m("collapse")]:e.collapse}},[...Ve,...Ue]),Ne);return e.collapseTransition&&e.mode==="vertical"?h(ElMenuCollapseTransition,()=>L):L}}});const menuItemProps=buildProps({index:{type:definePropType([String,null]),default:null},route:{type:definePropType([String,Object])},disabled:Boolean}),menuItemEmits={click:e=>isString$5(e.index)&&isArray$4(e.indexPath)},COMPONENT_NAME$3="ElMenuItem",__default__$4=defineComponent({name:COMPONENT_NAME$3}),_sfc_main$q=defineComponent({...__default__$4,props:menuItemProps,emits:menuItemEmits,setup(e,{expose:t,emit:n}){const a=e;isPropAbsent(a.index)&&debugWarn(COMPONENT_NAME$3,'Missing required prop: "index"');const s=getCurrentInstance(),o=inject(MENU_INJECTION_KEY),c=useNamespace("menu"),f=useNamespace("menu-item");o||throwError(COMPONENT_NAME$3,"can not inject root menu");const{parentMenu:y,indexPath:m}=useMenu(s,toRef(a,"index")),g=inject(`${SUB_MENU_INJECTION_KEY}${y.value.uid}`);g||throwError(COMPONENT_NAME$3,"can not inject sub menu");const z=computed(()=>a.index===o.activeIndex),ie=reactive({index:a.index,indexPath:m,active:z}),re=()=>{a.disabled||(o.handleMenuItemClick({index:a.index,indexPath:m.value,route:a.route}),n("click",ie))};return onMounted(()=>{g.addSubMenu(ie),o.addMenuItem(ie)}),onBeforeUnmount(()=>{g.removeSubMenu(ie),o.removeMenuItem(ie)}),t({parentMenu:y,rootMenu:o,active:z,nsMenu:c,nsMenuItem:f,handleClick:re}),(he,_e)=>(openBlock(),createElementBlock("li",{class:normalizeClass([unref(f).b(),unref(f).is("active",unref(z)),unref(f).is("disabled",he.disabled)]),role:"menuitem",tabindex:"-1",onClick:re},[unref(y).type.name==="ElMenu"&&unref(o).props.collapse&&he.$slots.title?(openBlock(),createBlock(unref(ElTooltip),{key:0,effect:unref(o).props.popperEffect,placement:"right","fallback-placements":["left"],persistent:unref(o).props.persistent},{content:withCtx(()=>[renderSlot(he.$slots,"title")]),default:withCtx(()=>[createBaseVNode("div",{class:normalizeClass(unref(c).be("tooltip","trigger"))},[renderSlot(he.$slots,"default")],2)]),_:3},8,["effect","persistent"])):(openBlock(),createElementBlock(Fragment,{key:1},[renderSlot(he.$slots,"default"),renderSlot(he.$slots,"title")],64))],2))}});var MenuItem=_export_sfc$1(_sfc_main$q,[["__file","menu-item.vue"]]);const menuItemGroupProps={title:String},__default__$3=defineComponent({name:"ElMenuItemGroup"}),_sfc_main$p=defineComponent({...__default__$3,props:menuItemGroupProps,setup(e){const t=useNamespace("menu-item-group");return(n,a)=>(openBlock(),createElementBlock("li",{class:normalizeClass(unref(t).b())},[createBaseVNode("div",{class:normalizeClass(unref(t).e("title"))},[n.$slots.title?renderSlot(n.$slots,"title",{key:1}):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString$1(n.title),1)],64))],2),createBaseVNode("ul",null,[renderSlot(n.$slots,"default")])],2))}});var MenuItemGroup=_export_sfc$1(_sfc_main$p,[["__file","menu-item-group.vue"]]);const ElMenu=withInstall(Menu,{MenuItem,MenuItemGroup,SubMenu}),ElMenuItem=withNoopInstall(MenuItem);withNoopInstall(MenuItemGroup),withNoopInstall(SubMenu);const selectGroupKey=Symbol("ElSelectGroup"),selectKey=Symbol("ElSelect"),COMPONENT_NAME$2="ElOption",optionProps=buildProps({value:{type:[String,Number,Boolean,Object],required:!0},label:{type:[String,Number]},created:Boolean,disabled:Boolean});function useOption(e,t){const n=inject(selectKey);n||throwError(COMPONENT_NAME$2,"usage: <el-select><el-option /></el-select/>");const a=inject(selectGroupKey,{disabled:!1}),s=computed(()=>g(castArray$1(n.props.modelValue),e.value)),o=computed(()=>{var re;if(n.props.multiple){const he=castArray$1((re=n.props.modelValue)!=null?re:[]);return!s.value&&he.length>=n.props.multipleLimit&&n.props.multipleLimit>0}else return!1}),c=computed(()=>{var re;return(re=e.label)!=null?re:isObject$4(e.value)?"":e.value}),f=computed(()=>e.value||e.label||""),y=computed(()=>e.disabled||t.groupDisabled||o.value),m=getCurrentInstance(),g=(re=[],he)=>{if(isObject$4(e.value)){const _e=n.props.valueKey;return re&&re.some($e=>toRaw(get($e,_e))===get(he,_e))}else return re&&re.includes(he)},z=()=>{!e.disabled&&!a.disabled&&(n.states.hoveringIndex=n.optionsArray.indexOf(m.proxy))},ie=re=>{const he=new RegExp(escapeStringRegexp(re),"i");t.visible=he.test(String(c.value))||e.created};return watch(()=>c.value,()=>{!e.created&&!n.props.remote&&n.setSelected()}),watch(()=>e.value,(re,he)=>{const{remote:_e,valueKey:$e}=n.props;if((_e?re!==he:!isEqual(re,he))&&(n.onOptionDestroy(he,m.proxy),n.onOptionCreate(m.proxy)),!e.created&&!_e){if($e&&isObject$4(re)&&isObject$4(he)&&re[$e]===he[$e])return;n.setSelected()}}),watch(()=>a.disabled,()=>{t.groupDisabled=a.disabled},{immediate:!0}),{select:n,currentLabel:c,currentValue:f,itemSelected:s,isDisabled:y,hoverItem:z,updateOption:ie}}const _sfc_main$o=defineComponent({name:COMPONENT_NAME$2,componentName:COMPONENT_NAME$2,props:optionProps,setup(e){const t=useNamespace("select"),n=useId(),a=computed(()=>[t.be("dropdown","item"),t.is("disabled",unref(f)),t.is("selected",unref(c)),t.is("hovering",unref(ie))]),s=reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:o,itemSelected:c,isDisabled:f,select:y,hoverItem:m,updateOption:g}=useOption(e,s),{visible:z,hover:ie}=toRefs(s),re=getCurrentInstance().proxy;y.onOptionCreate(re),onBeforeUnmount(()=>{const _e=re.value,{selected:$e}=y.states,pe=$e.some(Ce=>Ce.value===re.value);nextTick(()=>{y.states.cachedOptions.get(_e)===re&&!pe&&y.states.cachedOptions.delete(_e)}),y.onOptionDestroy(_e,re)});function he(){f.value||y.handleOptionSelect(re)}return{ns:t,id:n,containerKls:a,currentLabel:o,itemSelected:c,isDisabled:f,select:y,visible:z,hover:ie,states:s,hoverItem:m,updateOption:g,selectOptionClick:he}}});function _sfc_render$3(e,t){return withDirectives((openBlock(),createElementBlock("li",{id:e.id,class:normalizeClass(e.containerKls),role:"option","aria-disabled":e.isDisabled||void 0,"aria-selected":e.itemSelected,onMousemove:e.hoverItem,onClick:withModifiers(e.selectOptionClick,["stop"])},[renderSlot(e.$slots,"default",{},()=>[createBaseVNode("span",null,toDisplayString$1(e.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMousemove","onClick"])),[[vShow,e.visible]])}var Option=_export_sfc$1(_sfc_main$o,[["render",_sfc_render$3],["__file","option.vue"]]);const _sfc_main$n=defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const e=inject(selectKey),t=useNamespace("select"),n=computed(()=>e.props.popperClass),a=computed(()=>e.props.multiple),s=computed(()=>e.props.fitInputWidth),o=ref("");function c(){var f;o.value=`${(f=e.selectRef)==null?void 0:f.offsetWidth}px`}return onMounted(()=>{c(),useResizeObserver(e.selectRef,c)}),{ns:t,minWidth:o,popperClass:n,isMultiple:a,isFitInputWidth:s}}});function _sfc_render$2(e,t,n,a,s,o){return openBlock(),createElementBlock("div",{class:normalizeClass([e.ns.b("dropdown"),e.ns.is("multiple",e.isMultiple),e.popperClass]),style:normalizeStyle({[e.isFitInputWidth?"width":"minWidth"]:e.minWidth})},[e.$slots.header?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(e.ns.be("dropdown","header"))},[renderSlot(e.$slots,"header")],2)):createCommentVNode("v-if",!0),renderSlot(e.$slots,"default"),e.$slots.footer?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(e.ns.be("dropdown","footer"))},[renderSlot(e.$slots,"footer")],2)):createCommentVNode("v-if",!0)],6)}var ElSelectMenu=_export_sfc$1(_sfc_main$n,[["render",_sfc_render$2],["__file","select-dropdown.vue"]]);const useSelect=(e,t)=>{const{t:n}=useLocale(),a=useId(),s=useNamespace("select"),o=useNamespace("input"),c=reactive({inputValue:"",options:new Map,cachedOptions:new Map,optionValues:[],selected:[],selectionWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),f=ref(),y=ref(),m=ref(),g=ref(),z=ref(),ie=ref(),re=ref(),he=ref(),_e=ref(),$e=ref(),pe=ref(),{isComposing:Ce,handleCompositionStart:Oe,handleCompositionUpdate:qe,handleCompositionEnd:At}=useComposition({afterComposition:Dr=>jr(Dr)}),{wrapperRef:Et,isFocused:ze,handleBlur:kt}=useFocusController(z,{beforeFocus(){return xe.value},afterFocus(){e.automaticDropdown&&!Pt.value&&(Pt.value=!0,c.menuVisibleOnFocus=!0)},beforeBlur(Dr){var Sn,hn;return((Sn=m.value)==null?void 0:Sn.isFocusInsideContent(Dr))||((hn=g.value)==null?void 0:hn.isFocusInsideContent(Dr))},afterBlur(){var Dr;Pt.value=!1,c.menuVisibleOnFocus=!1,e.validateEvent&&((Dr=u==null?void 0:u.validate)==null||Dr.call(u,"blur").catch(Sn=>debugWarn(Sn)))}}),Pt=ref(!1),jt=ref(),{form:Ie,formItem:u}=useFormItem(),{inputId:v}=useFormItemInputId(e,{formItemContext:u}),{valueOnClear:Y,isEmptyValue:ae}=useEmptyValues(e),xe=computed(()=>e.disabled||(Ie==null?void 0:Ie.disabled)),Ve=computed(()=>isArray$4(e.modelValue)?e.modelValue.length>0:!ae(e.modelValue)),Ue=computed(()=>{var Dr;return(Dr=Ie==null?void 0:Ie.statusIcon)!=null?Dr:!1}),Ne=computed(()=>e.clearable&&!xe.value&&c.inputHovering&&Ve.value),L=computed(()=>e.remote&&e.filterable&&!e.remoteShowSuffix?"":e.suffixIcon),Fe=computed(()=>s.is("reverse",!!(L.value&&Pt.value))),Dt=computed(()=>(u==null?void 0:u.validateState)||""),er=computed(()=>Dt.value&&ValidateComponentsMap[Dt.value]),ir=computed(()=>e.remote?300:0),cr=computed(()=>e.remote&&!c.inputValue&&c.options.size===0),sr=computed(()=>e.loading?e.loadingText||n("el.select.loading"):e.filterable&&c.inputValue&&c.options.size>0&&ar.value===0?e.noMatchText||n("el.select.noMatch"):c.options.size===0?e.noDataText||n("el.select.noData"):null),ar=computed(()=>fr.value.filter(Dr=>Dr.visible).length),fr=computed(()=>{const Dr=Array.from(c.options.values()),Sn=[];return c.optionValues.forEach(hn=>{const Cn=Dr.findIndex(Mn=>Mn.value===hn);Cn>-1&&Sn.push(Dr[Cn])}),Sn.length>=Dr.length?Sn:Dr}),Cr=computed(()=>Array.from(c.cachedOptions.values())),Mr=computed(()=>{const Dr=fr.value.filter(Sn=>!Sn.created).some(Sn=>Sn.currentLabel===c.inputValue);return e.filterable&&e.allowCreate&&c.inputValue!==""&&!Dr}),xr=()=>{e.filterable&&isFunction$4(e.filterMethod)||e.filterable&&e.remote&&isFunction$4(e.remoteMethod)||fr.value.forEach(Dr=>{var Sn;(Sn=Dr.updateOption)==null||Sn.call(Dr,c.inputValue)})},gr=useFormSize(),dr=computed(()=>["small"].includes(gr.value)?"small":"default"),Br=computed({get(){return Pt.value&&!cr.value},set(Dr){Pt.value=Dr}}),Ir=computed(()=>{if(e.multiple&&!isUndefined$1(e.modelValue))return castArray$1(e.modelValue).length===0&&!c.inputValue;const Dr=isArray$4(e.modelValue)?e.modelValue[0]:e.modelValue;return e.filterable||isUndefined$1(Dr)?!c.inputValue:!0}),Nr=computed(()=>{var Dr;const Sn=(Dr=e.placeholder)!=null?Dr:n("el.select.placeholder");return e.multiple||!Ve.value?Sn:c.selectedLabel}),Kr=computed(()=>isIOS?null:"mouseenter");watch(()=>e.modelValue,(Dr,Sn)=>{e.multiple&&e.filterable&&!e.reserveKeyword&&(c.inputValue="",_r("")),Vr(),!isEqual(Dr,Sn)&&e.validateEvent&&(u==null||u.validate("change").catch(hn=>debugWarn(hn)))},{flush:"post",deep:!0}),watch(()=>Pt.value,Dr=>{Dr?_r(c.inputValue):(c.inputValue="",c.previousQuery=null,c.isBeforeHide=!0),t("visible-change",Dr)}),watch(()=>c.options.entries(),()=>{isClient&&(Vr(),e.defaultFirstOption&&(e.filterable||e.remote)&&ar.value&&vr())},{flush:"post"}),watch([()=>c.hoveringIndex,fr],([Dr])=>{isNumber$1(Dr)&&Dr>-1?jt.value=fr.value[Dr]||{}:jt.value={},fr.value.forEach(Sn=>{Sn.hover=jt.value===Sn})}),watchEffect(()=>{c.isBeforeHide||xr()});const _r=Dr=>{c.previousQuery===Dr||Ce.value||(c.previousQuery=Dr,e.filterable&&isFunction$4(e.filterMethod)?e.filterMethod(Dr):e.filterable&&e.remote&&isFunction$4(e.remoteMethod)&&e.remoteMethod(Dr),e.defaultFirstOption&&(e.filterable||e.remote)&&ar.value?nextTick(vr):nextTick(Or))},vr=()=>{const Dr=fr.value.filter(Mn=>Mn.visible&&!Mn.disabled&&!Mn.states.groupDisabled),Sn=Dr.find(Mn=>Mn.created),hn=Dr[0],Cn=fr.value.map(Mn=>Mn.value);c.hoveringIndex=hr(Cn,Sn||hn)},Vr=()=>{if(e.multiple)c.selectedLabel="";else{const Sn=isArray$4(e.modelValue)?e.modelValue[0]:e.modelValue,hn=$r(Sn);c.selectedLabel=hn.currentLabel,c.selected=[hn];return}const Dr=[];isUndefined$1(e.modelValue)||castArray$1(e.modelValue).forEach(Sn=>{Dr.push($r(Sn))}),c.selected=Dr},$r=Dr=>{let Sn;const hn=isPlainObject$3(Dr);for(let Bn=c.cachedOptions.size-1;Bn>=0;Bn--){const Nn=Cr.value[Bn];if(hn?get(Nn.value,e.valueKey)===get(Dr,e.valueKey):Nn.value===Dr){Sn={value:Dr,currentLabel:Nn.currentLabel,get isDisabled(){return Nn.isDisabled}};break}}if(Sn)return Sn;const Cn=hn?Dr.label:Dr??"";return{value:Dr,currentLabel:Cn}},Or=()=>{c.hoveringIndex=fr.value.findIndex(Dr=>c.selected.some(Sn=>tr(Sn)===tr(Dr)))},Pr=()=>{c.selectionWidth=Number.parseFloat(window.getComputedStyle(y.value).width)},Sr=()=>{c.collapseItemWidth=$e.value.getBoundingClientRect().width},Er=()=>{var Dr,Sn;(Sn=(Dr=m.value)==null?void 0:Dr.updatePopper)==null||Sn.call(Dr)},zr=()=>{var Dr,Sn;(Sn=(Dr=g.value)==null?void 0:Dr.updatePopper)==null||Sn.call(Dr)},Lr=()=>{c.inputValue.length>0&&!Pt.value&&(Pt.value=!0),_r(c.inputValue)},jr=Dr=>{if(c.inputValue=Dr.target.value,e.remote)Ar();else return Lr()},Ar=debounce$1(()=>{Lr()},ir.value),lr=Dr=>{isEqual(e.modelValue,Dr)||t(CHANGE_EVENT,Dr)},nr=Dr=>findLastIndex(Dr,Sn=>{const hn=c.cachedOptions.get(Sn);return hn&&!hn.disabled&&!hn.states.groupDisabled}),or=Dr=>{if(e.multiple&&Dr.code!==EVENT_CODE.delete&&Dr.target.value.length<=0){const Sn=castArray$1(e.modelValue).slice(),hn=nr(Sn);if(hn<0)return;const Cn=Sn[hn];Sn.splice(hn,1),t(UPDATE_MODEL_EVENT,Sn),lr(Sn),t("remove-tag",Cn)}},br=(Dr,Sn)=>{const hn=c.selected.indexOf(Sn);if(hn>-1&&!xe.value){const Cn=castArray$1(e.modelValue).slice();Cn.splice(hn,1),t(UPDATE_MODEL_EVENT,Cn),lr(Cn),t("remove-tag",Sn.value)}Dr.stopPropagation(),Xr()},yr=Dr=>{Dr.stopPropagation();const Sn=e.multiple?[]:Y.value;if(e.multiple)for(const hn of c.selected)hn.isDisabled&&Sn.push(hn.value);t(UPDATE_MODEL_EVENT,Sn),lr(Sn),c.hoveringIndex=-1,Pt.value=!1,t("clear"),Xr()},Tr=Dr=>{var Sn;if(e.multiple){const hn=castArray$1((Sn=e.modelValue)!=null?Sn:[]).slice(),Cn=hr(hn,Dr);Cn>-1?hn.splice(Cn,1):(e.multipleLimit<=0||hn.length<e.multipleLimit)&&hn.push(Dr.value),t(UPDATE_MODEL_EVENT,hn),lr(hn),Dr.created&&_r(""),e.filterable&&!e.reserveKeyword&&(c.inputValue="")}else t(UPDATE_MODEL_EVENT,Dr.value),lr(Dr.value),Pt.value=!1;Xr(),!Pt.value&&nextTick(()=>{ur(Dr)})},hr=(Dr,Sn)=>isUndefined$1(Sn)?-1:isObject$4(Sn.value)?Dr.findIndex(hn=>isEqual(get(hn,e.valueKey),tr(Sn))):Dr.indexOf(Sn.value),ur=Dr=>{var Sn,hn,Cn,Mn,Bn;const Nn=isArray$4(Dr)?Dr[0]:Dr;let qn=null;if(Nn!=null&&Nn.value){const Pn=fr.value.filter(Dn=>Dn.value===Nn.value);Pn.length>0&&(qn=Pn[0].$el)}if(m.value&&qn){const Pn=(Mn=(Cn=(hn=(Sn=m.value)==null?void 0:Sn.popperRef)==null?void 0:hn.contentRef)==null?void 0:Cn.querySelector)==null?void 0:Mn.call(Cn,`.${s.be("dropdown","wrap")}`);Pn&&scrollIntoView(Pn,qn)}(Bn=pe.value)==null||Bn.handleScroll()},vn=Dr=>{c.options.set(Dr.value,Dr),c.cachedOptions.set(Dr.value,Dr)},Yr=(Dr,Sn)=>{c.options.get(Dr)===Sn&&c.options.delete(Dr)},Wr=computed(()=>{var Dr,Sn;return(Sn=(Dr=m.value)==null?void 0:Dr.popperRef)==null?void 0:Sn.contentRef}),xn=()=>{c.isBeforeHide=!1,nextTick(()=>{var Dr;(Dr=pe.value)==null||Dr.update(),ur(c.selected)})},Xr=()=>{var Dr;(Dr=z.value)==null||Dr.focus()},wn=()=>{var Dr;if(Pt.value){Pt.value=!1,nextTick(()=>{var Sn;return(Sn=z.value)==null?void 0:Sn.blur()});return}(Dr=z.value)==null||Dr.blur()},En=Dr=>{yr(Dr)},Hr=Dr=>{if(Pt.value=!1,ze.value){const Sn=new FocusEvent("focus",Dr);nextTick(()=>kt(Sn))}},Zr=()=>{c.inputValue.length>0?c.inputValue="":Pt.value=!1},Gr=()=>{xe.value||(isIOS&&(c.inputHovering=!0),c.menuVisibleOnFocus?c.menuVisibleOnFocus=!1:Pt.value=!Pt.value)},Lt=()=>{if(!Pt.value)Gr();else{const Dr=fr.value[c.hoveringIndex];Dr&&!Dr.isDisabled&&Tr(Dr)}},tr=Dr=>isObject$4(Dr.value)?get(Dr.value,e.valueKey):Dr.value,rr=computed(()=>fr.value.filter(Dr=>Dr.visible).every(Dr=>Dr.isDisabled)),pr=computed(()=>e.multiple?e.collapseTags?c.selected.slice(0,e.maxCollapseTags):c.selected:[]),wr=computed(()=>e.multiple?e.collapseTags?c.selected.slice(e.maxCollapseTags):[]:[]),Ur=Dr=>{if(!Pt.value){Pt.value=!0;return}if(!(c.options.size===0||ar.value===0||Ce.value)&&!rr.value){Dr==="next"?(c.hoveringIndex++,c.hoveringIndex===c.options.size&&(c.hoveringIndex=0)):Dr==="prev"&&(c.hoveringIndex--,c.hoveringIndex<0&&(c.hoveringIndex=c.options.size-1));const Sn=fr.value[c.hoveringIndex];(Sn.isDisabled||!Sn.visible)&&Ur(Dr),nextTick(()=>ur(jt.value))}},qr=()=>{if(!y.value)return 0;const Dr=window.getComputedStyle(y.value);return Number.parseFloat(Dr.gap||"6px")},Jr=computed(()=>{const Dr=qr();return{maxWidth:`${$e.value&&e.maxCollapseTags===1?c.selectionWidth-c.collapseItemWidth-Dr:c.selectionWidth}px`}}),Rn=computed(()=>({maxWidth:`${c.selectionWidth}px`})),Qr=Dr=>{t("popup-scroll",Dr)};return useResizeObserver(y,Pr),useResizeObserver(he,Er),useResizeObserver(Et,Er),useResizeObserver(_e,zr),useResizeObserver($e,Sr),onMounted(()=>{Vr()}),{inputId:v,contentId:a,nsSelect:s,nsInput:o,states:c,isFocused:ze,expanded:Pt,optionsArray:fr,hoverOption:jt,selectSize:gr,filteredOptionsCount:ar,updateTooltip:Er,updateTagTooltip:zr,debouncedOnInputChange:Ar,onInput:jr,deletePrevTag:or,deleteTag:br,deleteSelected:yr,handleOptionSelect:Tr,scrollToOption:ur,hasModelValue:Ve,shouldShowPlaceholder:Ir,currentPlaceholder:Nr,mouseEnterEventName:Kr,needStatusIcon:Ue,showClose:Ne,iconComponent:L,iconReverse:Fe,validateState:Dt,validateIcon:er,showNewOption:Mr,updateOptions:xr,collapseTagSize:dr,setSelected:Vr,selectDisabled:xe,emptyText:sr,handleCompositionStart:Oe,handleCompositionUpdate:qe,handleCompositionEnd:At,onOptionCreate:vn,onOptionDestroy:Yr,handleMenuEnter:xn,focus:Xr,blur:wn,handleClearClick:En,handleClickOutside:Hr,handleEsc:Zr,toggleMenu:Gr,selectOption:Lt,getValueKey:tr,navigateOptions:Ur,dropdownMenuVisible:Br,showTagList:pr,collapseTagList:wr,popupScroll:Qr,tagStyle:Jr,collapseTagStyle:Rn,popperRef:Wr,inputRef:z,tooltipRef:m,tagTooltipRef:g,prefixRef:ie,suffixRef:re,selectRef:f,wrapperRef:Et,selectionRef:y,scrollbarRef:pe,menuRef:he,tagMenuRef:_e,collapseItemRef:$e}};var ElOptions=defineComponent({name:"ElOptions",setup(e,{slots:t}){const n=inject(selectKey);let a=[];return()=>{var s,o;const c=(s=t.default)==null?void 0:s.call(t),f=[];function y(m){isArray$4(m)&&m.forEach(g=>{var z,ie,re,he;const _e=(z=(g==null?void 0:g.type)||{})==null?void 0:z.name;_e==="ElOptionGroup"?y(!isString$5(g.children)&&!isArray$4(g.children)&&isFunction$4((ie=g.children)==null?void 0:ie.default)?(re=g.children)==null?void 0:re.default():g.children):_e==="ElOption"?f.push((he=g.props)==null?void 0:he.value):isArray$4(g.children)&&y(g.children)})}return c.length&&y((o=c[0])==null?void 0:o.children),isEqual(f,a)||(a=f,n&&(n.states.optionValues=f)),c}}});const selectProps=buildProps({name:String,id:String,modelValue:{type:definePropType([Array,String,Number,Boolean,Object]),default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:useSizeProp,effect:{type:definePropType(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:definePropType(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:useTooltipContentProps.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:iconPropType,default:circle_close_default},fitInputWidth:Boolean,suffixIcon:{type:iconPropType,default:arrow_down_default},tagType:{...tagProps.type,default:"info"},tagEffect:{...tagProps.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,showArrow:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:definePropType(String),values:Ee,default:"bottom-start"},fallbackPlacements:{type:definePropType(Array),default:["bottom-start","top-start","right","left"]},tabindex:{type:[String,Number],default:0},appendTo:useTooltipContentProps.appendTo,...useEmptyValuesProps,...useAriaProps(["ariaLabel"])});scrollbarEmits.scroll;const COMPONENT_NAME$1="ElSelect",_sfc_main$m=defineComponent({name:COMPONENT_NAME$1,componentName:COMPONENT_NAME$1,components:{ElSelectMenu,ElOption:Option,ElOptions,ElTag,ElScrollbar,ElTooltip,ElIcon},directives:{ClickOutside},props:selectProps,emits:[UPDATE_MODEL_EVENT,CHANGE_EVENT,"remove-tag","clear","visible-change","focus","blur","popup-scroll"],setup(e,{emit:t,slots:n}){const a=computed(()=>{const{modelValue:g,multiple:z}=e,ie=z?[]:void 0;return isArray$4(g)?z?g:ie:z?ie:g}),s=reactive({...toRefs(e),modelValue:a}),o=useSelect(s,t),{calculatorRef:c,inputStyle:f}=useCalcInputWidth(),y=g=>{flattedChildren(g).filter(ie=>isObject$4(ie)&&ie.type.name==="ElOption").forEach(ie=>{const re={...ie.props};re.currentLabel=re.label||(isObject$4(re.value)?"":re.value),o.onOptionCreate(re)})};watchEffect(()=>{e.persistent||nextTick(()=>{var g,z;const ie=h(Fragment,(z=(g=n.default)==null?void 0:g.call(n))!=null?z:[]).children;y(ie)})}),provide(selectKey,reactive({props:s,states:o.states,selectRef:o.selectRef,optionsArray:o.optionsArray,setSelected:o.setSelected,handleOptionSelect:o.handleOptionSelect,onOptionCreate:o.onOptionCreate,onOptionDestroy:o.onOptionDestroy}));const m=computed(()=>e.multiple?o.states.selected.map(g=>g.currentLabel):o.states.selectedLabel);return{...o,modelValue:a,selectedLabel:m,calculatorRef:c,inputStyle:f}}});function _sfc_render$1(e,t){const n=resolveComponent("el-tag"),a=resolveComponent("el-tooltip"),s=resolveComponent("el-icon"),o=resolveComponent("el-option"),c=resolveComponent("el-options"),f=resolveComponent("el-scrollbar"),y=resolveComponent("el-select-menu"),m=resolveDirective("click-outside");return withDirectives((openBlock(),createElementBlock("div",{ref:"selectRef",class:normalizeClass([e.nsSelect.b(),e.nsSelect.m(e.selectSize)]),[toHandlerKey(e.mouseEnterEventName)]:g=>e.states.inputHovering=!0,onMouseleave:g=>e.states.inputHovering=!1},[createVNode(a,{ref:"tooltipRef",visible:e.dropdownMenuVisible,placement:e.placement,teleported:e.teleported,"popper-class":[e.nsSelect.e("popper"),e.popperClass],"popper-options":e.popperOptions,"fallback-placements":e.fallbackPlacements,effect:e.effect,pure:"",trigger:"click",transition:`${e.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:e.persistent,"append-to":e.appendTo,"show-arrow":e.showArrow,offset:e.offset,onBeforeShow:e.handleMenuEnter,onHide:g=>e.states.isBeforeHide=!1},{default:withCtx(()=>{var g;return[createBaseVNode("div",{ref:"wrapperRef",class:normalizeClass([e.nsSelect.e("wrapper"),e.nsSelect.is("focused",e.isFocused),e.nsSelect.is("hovering",e.states.inputHovering),e.nsSelect.is("filterable",e.filterable),e.nsSelect.is("disabled",e.selectDisabled)]),onClick:withModifiers(e.toggleMenu,["prevent"])},[e.$slots.prefix?(openBlock(),createElementBlock("div",{key:0,ref:"prefixRef",class:normalizeClass(e.nsSelect.e("prefix"))},[renderSlot(e.$slots,"prefix")],2)):createCommentVNode("v-if",!0),createBaseVNode("div",{ref:"selectionRef",class:normalizeClass([e.nsSelect.e("selection"),e.nsSelect.is("near",e.multiple&&!e.$slots.prefix&&!!e.states.selected.length)])},[e.multiple?renderSlot(e.$slots,"tag",{key:0},()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.showTagList,z=>(openBlock(),createElementBlock("div",{key:e.getValueKey(z),class:normalizeClass(e.nsSelect.e("selected-item"))},[createVNode(n,{closable:!e.selectDisabled&&!z.isDisabled,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",style:normalizeStyle(e.tagStyle),onClose:ie=>e.deleteTag(ie,z)},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass(e.nsSelect.e("tags-text"))},[renderSlot(e.$slots,"label",{label:z.currentLabel,value:z.value},()=>[createTextVNode(toDisplayString$1(z.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),e.collapseTags&&e.states.selected.length>e.maxCollapseTags?(openBlock(),createBlock(a,{key:0,ref:"tagTooltipRef",disabled:e.dropdownMenuVisible||!e.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:e.teleported},{default:withCtx(()=>[createBaseVNode("div",{ref:"collapseItemRef",class:normalizeClass(e.nsSelect.e("selected-item"))},[createVNode(n,{closable:!1,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",style:normalizeStyle(e.collapseTagStyle)},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass(e.nsSelect.e("tags-text"))}," + "+toDisplayString$1(e.states.selected.length-e.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:withCtx(()=>[createBaseVNode("div",{ref:"tagMenuRef",class:normalizeClass(e.nsSelect.e("selection"))},[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.collapseTagList,z=>(openBlock(),createElementBlock("div",{key:e.getValueKey(z),class:normalizeClass(e.nsSelect.e("selected-item"))},[createVNode(n,{class:"in-tooltip",closable:!e.selectDisabled&&!z.isDisabled,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",onClose:ie=>e.deleteTag(ie,z)},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass(e.nsSelect.e("tags-text"))},[renderSlot(e.$slots,"label",{label:z.currentLabel,value:z.value},()=>[createTextVNode(toDisplayString$1(z.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):createCommentVNode("v-if",!0)]):createCommentVNode("v-if",!0),createBaseVNode("div",{class:normalizeClass([e.nsSelect.e("selected-item"),e.nsSelect.e("input-wrapper"),e.nsSelect.is("hidden",!e.filterable)])},[withDirectives(createBaseVNode("input",{id:e.inputId,ref:"inputRef","onUpdate:modelValue":z=>e.states.inputValue=z,type:"text",name:e.name,class:normalizeClass([e.nsSelect.e("input"),e.nsSelect.is(e.selectSize)]),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:normalizeStyle(e.inputStyle),tabindex:e.tabindex,role:"combobox",readonly:!e.filterable,spellcheck:"false","aria-activedescendant":((g=e.hoverOption)==null?void 0:g.id)||"","aria-controls":e.contentId,"aria-expanded":e.dropdownMenuVisible,"aria-label":e.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[withKeys(withModifiers(z=>e.navigateOptions("next"),["stop","prevent"]),["down"]),withKeys(withModifiers(z=>e.navigateOptions("prev"),["stop","prevent"]),["up"]),withKeys(withModifiers(e.handleEsc,["stop","prevent"]),["esc"]),withKeys(withModifiers(e.selectOption,["stop","prevent"]),["enter"]),withKeys(withModifiers(e.deletePrevTag,["stop"]),["delete"])],onCompositionstart:e.handleCompositionStart,onCompositionupdate:e.handleCompositionUpdate,onCompositionend:e.handleCompositionEnd,onInput:e.onInput,onClick:withModifiers(e.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","tabindex","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[vModelText,e.states.inputValue]]),e.filterable?(openBlock(),createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:normalizeClass(e.nsSelect.e("input-calculator")),textContent:toDisplayString$1(e.states.inputValue)},null,10,["textContent"])):createCommentVNode("v-if",!0)],2),e.shouldShowPlaceholder?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass([e.nsSelect.e("selected-item"),e.nsSelect.e("placeholder"),e.nsSelect.is("transparent",!e.hasModelValue||e.expanded&&!e.states.inputValue)])},[e.hasModelValue?renderSlot(e.$slots,"label",{key:0,label:e.currentPlaceholder,value:e.modelValue},()=>[createBaseVNode("span",null,toDisplayString$1(e.currentPlaceholder),1)]):(openBlock(),createElementBlock("span",{key:1},toDisplayString$1(e.currentPlaceholder),1))],2)):createCommentVNode("v-if",!0)],2),createBaseVNode("div",{ref:"suffixRef",class:normalizeClass(e.nsSelect.e("suffix"))},[e.iconComponent&&!e.showClose?(openBlock(),createBlock(s,{key:0,class:normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):createCommentVNode("v-if",!0),e.showClose&&e.clearIcon?(openBlock(),createBlock(s,{key:1,class:normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.nsSelect.e("clear")]),onClick:e.handleClearClick},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.clearIcon)))]),_:1},8,["class","onClick"])):createCommentVNode("v-if",!0),e.validateState&&e.validateIcon&&e.needStatusIcon?(openBlock(),createBlock(s,{key:2,class:normalizeClass([e.nsInput.e("icon"),e.nsInput.e("validateIcon"),e.nsInput.is("loading",e.validateState==="validating")])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.validateIcon)))]),_:1},8,["class"])):createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:withCtx(()=>[createVNode(y,{ref:"menuRef"},{default:withCtx(()=>[e.$slots.header?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(e.nsSelect.be("dropdown","header")),onClick:withModifiers(()=>{},["stop"])},[renderSlot(e.$slots,"header")],10,["onClick"])):createCommentVNode("v-if",!0),withDirectives(createVNode(f,{id:e.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":e.nsSelect.be("dropdown","wrap"),"view-class":e.nsSelect.be("dropdown","list"),class:normalizeClass([e.nsSelect.is("empty",e.filteredOptionsCount===0)]),role:"listbox","aria-label":e.ariaLabel,"aria-orientation":"vertical",onScroll:e.popupScroll},{default:withCtx(()=>[e.showNewOption?(openBlock(),createBlock(o,{key:0,value:e.states.inputValue,created:!0},null,8,["value"])):createCommentVNode("v-if",!0),createVNode(c,null,{default:withCtx(()=>[renderSlot(e.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label","onScroll"]),[[vShow,e.states.options.size>0&&!e.loading]]),e.$slots.loading&&e.loading?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(e.nsSelect.be("dropdown","loading"))},[renderSlot(e.$slots,"loading")],2)):e.loading||e.filteredOptionsCount===0?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(e.nsSelect.be("dropdown","empty"))},[renderSlot(e.$slots,"empty",{},()=>[createBaseVNode("span",null,toDisplayString$1(e.emptyText),1)])],2)):createCommentVNode("v-if",!0),e.$slots.footer?(openBlock(),createElementBlock("div",{key:3,class:normalizeClass(e.nsSelect.be("dropdown","footer")),onClick:withModifiers(()=>{},["stop"])},[renderSlot(e.$slots,"footer")],10,["onClick"])):createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","show-arrow","offset","onBeforeShow","onHide"])],16,["onMouseleave"])),[[m,e.handleClickOutside,e.popperRef]])}var Select=_export_sfc$1(_sfc_main$m,[["render",_sfc_render$1],["__file","select.vue"]]);const _sfc_main$l=defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(e){const t=useNamespace("select"),n=ref(),a=getCurrentInstance(),s=ref([]);provide(selectGroupKey,reactive({...toRefs(e)}));const o=computed(()=>s.value.some(m=>m.visible===!0)),c=m=>{var g;return m.type.name==="ElOption"&&!!((g=m.component)!=null&&g.proxy)},f=m=>{const g=castArray$1(m),z=[];return g.forEach(ie=>{var re;isVNode$1(ie)&&(c(ie)?z.push(ie.component.proxy):isArray$4(ie.children)&&ie.children.length?z.push(...f(ie.children)):(re=ie.component)!=null&&re.subTree&&z.push(...f(ie.component.subTree)))}),z},y=()=>{s.value=f(a.subTree)};return onMounted(()=>{y()}),useMutationObserver(n,y,{attributes:!0,subtree:!0,childList:!0}),{groupRef:n,visible:o,ns:t}}});function _sfc_render(e,t,n,a,s,o){return withDirectives((openBlock(),createElementBlock("ul",{ref:"groupRef",class:normalizeClass(e.ns.be("group","wrap"))},[createBaseVNode("li",{class:normalizeClass(e.ns.be("group","title"))},toDisplayString$1(e.label),3),createBaseVNode("li",null,[createBaseVNode("ul",{class:normalizeClass(e.ns.b("group"))},[renderSlot(e.$slots,"default")],2)])],2)),[[vShow,e.visible]])}var OptionGroup=_export_sfc$1(_sfc_main$l,[["render",_sfc_render],["__file","option-group.vue"]]);const ElSelect=withInstall(Select,{Option,OptionGroup}),ElOption=withNoopInstall(Option);withNoopInstall(OptionGroup);const statisticProps=buildProps({decimalSeparator:{type:String,default:"."},groupSeparator:{type:String,default:","},precision:{type:Number,default:0},formatter:Function,value:{type:definePropType([Number,Object]),default:0},prefix:String,suffix:String,title:String,valueStyle:{type:definePropType([String,Object,Array])}}),__default__$2=defineComponent({name:"ElStatistic"}),_sfc_main$k=defineComponent({...__default__$2,props:statisticProps,setup(e,{expose:t}){const n=e,a=useNamespace("statistic"),s=computed(()=>{const{value:o,formatter:c,precision:f,decimalSeparator:y,groupSeparator:m}=n;if(isFunction$4(c))return c(o);if(!isNumber$1(o)||Number.isNaN(o))return o;let[g,z=""]=String(o).split(".");return z=z.padEnd(f,"0").slice(0,f>0?f:0),g=g.replace(/\B(?=(\d{3})+(?!\d))/g,m),[g,z].join(z?y:"")});return t({displayValue:s}),(o,c)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(a).b())},[o.$slots.title||o.title?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(unref(a).e("head"))},[renderSlot(o.$slots,"title",{},()=>[createTextVNode(toDisplayString$1(o.title),1)])],2)):createCommentVNode("v-if",!0),createBaseVNode("div",{class:normalizeClass(unref(a).e("content"))},[o.$slots.prefix||o.prefix?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(unref(a).e("prefix"))},[renderSlot(o.$slots,"prefix",{},()=>[createBaseVNode("span",null,toDisplayString$1(o.prefix),1)])],2)):createCommentVNode("v-if",!0),createBaseVNode("span",{class:normalizeClass(unref(a).e("number")),style:normalizeStyle(o.valueStyle)},toDisplayString$1(unref(s)),7),o.$slots.suffix||o.suffix?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(unref(a).e("suffix"))},[renderSlot(o.$slots,"suffix",{},()=>[createBaseVNode("span",null,toDisplayString$1(o.suffix),1)])],2)):createCommentVNode("v-if",!0)],2)],2))}});var Statistic=_export_sfc$1(_sfc_main$k,[["__file","statistic.vue"]]);const ElStatistic=withInstall(Statistic),isValidComponentSize=e=>["",...componentSizes].includes(e),switchProps=buildProps({modelValue:{type:[Boolean,String,Number],default:!1},disabled:Boolean,loading:Boolean,size:{type:String,validator:isValidComponentSize},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:iconPropType},activeActionIcon:{type:iconPropType},activeIcon:{type:iconPropType},inactiveIcon:{type:iconPropType},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:definePropType(Function)},id:String,tabindex:{type:[String,Number]},...useAriaProps(["ariaLabel"])}),switchEmits={[UPDATE_MODEL_EVENT]:e=>isBoolean$1(e)||isString$5(e)||isNumber$1(e),[CHANGE_EVENT]:e=>isBoolean$1(e)||isString$5(e)||isNumber$1(e),[INPUT_EVENT]:e=>isBoolean$1(e)||isString$5(e)||isNumber$1(e)},COMPONENT_NAME="ElSwitch",__default__$1=defineComponent({name:COMPONENT_NAME}),_sfc_main$j=defineComponent({...__default__$1,props:switchProps,emits:switchEmits,setup(e,{expose:t,emit:n}){const a=e,{formItem:s}=useFormItem(),o=useFormSize(),c=useNamespace("switch"),{inputId:f}=useFormItemInputId(a,{formItemContext:s}),y=useFormDisabled(computed(()=>a.loading)),m=ref(a.modelValue!==!1),g=ref(),z=ref(),ie=computed(()=>[c.b(),c.m(o.value),c.is("disabled",y.value),c.is("checked",pe.value)]),re=computed(()=>[c.e("label"),c.em("label","left"),c.is("active",!pe.value)]),he=computed(()=>[c.e("label"),c.em("label","right"),c.is("active",pe.value)]),_e=computed(()=>({width:addUnit(a.width)}));watch(()=>a.modelValue,()=>{m.value=!0});const $e=computed(()=>m.value?a.modelValue:!1),pe=computed(()=>$e.value===a.activeValue);[a.activeValue,a.inactiveValue].includes($e.value)||(n(UPDATE_MODEL_EVENT,a.inactiveValue),n(CHANGE_EVENT,a.inactiveValue),n(INPUT_EVENT,a.inactiveValue)),watch(pe,At=>{var Et;g.value.checked=At,a.validateEvent&&((Et=s==null?void 0:s.validate)==null||Et.call(s,"change").catch(ze=>debugWarn(ze)))});const Ce=()=>{const At=pe.value?a.inactiveValue:a.activeValue;n(UPDATE_MODEL_EVENT,At),n(CHANGE_EVENT,At),n(INPUT_EVENT,At),nextTick(()=>{g.value.checked=pe.value})},Oe=()=>{if(y.value)return;const{beforeChange:At}=a;if(!At){Ce();return}const Et=At();[isPromise$1(Et),isBoolean$1(Et)].includes(!0)||throwError(COMPONENT_NAME,"beforeChange must return type `Promise<boolean>` or `boolean`"),isPromise$1(Et)?Et.then(kt=>{kt&&Ce()}).catch(kt=>{debugWarn(COMPONENT_NAME,`some error occurred: ${kt}`)}):Et&&Ce()},qe=()=>{var At,Et;(Et=(At=g.value)==null?void 0:At.focus)==null||Et.call(At)};return onMounted(()=>{g.value.checked=pe.value}),t({focus:qe,checked:pe}),(At,Et)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(ie)),onClick:withModifiers(Oe,["prevent"])},[createBaseVNode("input",{id:unref(f),ref_key:"input",ref:g,class:normalizeClass(unref(c).e("input")),type:"checkbox",role:"switch","aria-checked":unref(pe),"aria-disabled":unref(y),"aria-label":At.ariaLabel,name:At.name,"true-value":At.activeValue,"false-value":At.inactiveValue,disabled:unref(y),tabindex:At.tabindex,onChange:Ce,onKeydown:withKeys(Oe,["enter"])},null,42,["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex","onKeydown"]),!At.inlinePrompt&&(At.inactiveIcon||At.inactiveText)?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(unref(re))},[At.inactiveIcon?(openBlock(),createBlock(unref(ElIcon),{key:0},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(At.inactiveIcon)))]),_:1})):createCommentVNode("v-if",!0),!At.inactiveIcon&&At.inactiveText?(openBlock(),createElementBlock("span",{key:1,"aria-hidden":unref(pe)},toDisplayString$1(At.inactiveText),9,["aria-hidden"])):createCommentVNode("v-if",!0)],2)):createCommentVNode("v-if",!0),createBaseVNode("span",{ref_key:"core",ref:z,class:normalizeClass(unref(c).e("core")),style:normalizeStyle(unref(_e))},[At.inlinePrompt?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(unref(c).e("inner"))},[At.activeIcon||At.inactiveIcon?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass(unref(c).is("icon"))},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(unref(pe)?At.activeIcon:At.inactiveIcon)))]),_:1},8,["class"])):At.activeText||At.inactiveText?(openBlock(),createElementBlock("span",{key:1,class:normalizeClass(unref(c).is("text")),"aria-hidden":!unref(pe)},toDisplayString$1(unref(pe)?At.activeText:At.inactiveText),11,["aria-hidden"])):createCommentVNode("v-if",!0)],2)):createCommentVNode("v-if",!0),createBaseVNode("div",{class:normalizeClass(unref(c).e("action"))},[At.loading?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass(unref(c).is("loading"))},{default:withCtx(()=>[createVNode(unref(loading_default))]),_:1},8,["class"])):unref(pe)?renderSlot(At.$slots,"active-action",{key:1},()=>[At.activeActionIcon?(openBlock(),createBlock(unref(ElIcon),{key:0},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(At.activeActionIcon)))]),_:1})):createCommentVNode("v-if",!0)]):unref(pe)?createCommentVNode("v-if",!0):renderSlot(At.$slots,"inactive-action",{key:2},()=>[At.inactiveActionIcon?(openBlock(),createBlock(unref(ElIcon),{key:0},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(At.inactiveActionIcon)))]),_:1})):createCommentVNode("v-if",!0)])],2)],6),!At.inlinePrompt&&(At.activeIcon||At.activeText)?(openBlock(),createElementBlock("span",{key:1,class:normalizeClass(unref(he))},[At.activeIcon?(openBlock(),createBlock(unref(ElIcon),{key:0},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(At.activeIcon)))]),_:1})):createCommentVNode("v-if",!0),!At.activeIcon&&At.activeText?(openBlock(),createElementBlock("span",{key:1,"aria-hidden":!unref(pe)},toDisplayString$1(At.activeText),9,["aria-hidden"])):createCommentVNode("v-if",!0)],2)):createCommentVNode("v-if",!0)],10,["onClick"]))}});var Switch=_export_sfc$1(_sfc_main$j,[["__file","switch.vue"]]);const ElSwitch=withInstall(Switch);function createLoadingComponent(e,t){let n;const a=ref(!1),s=reactive({...e,originalPosition:"",originalOverflow:"",visible:!1});function o(re){s.text=re}function c(){const re=s.parent,he=ie.ns;if(!re.vLoadingAddClassList){let _e=re.getAttribute("loading-number");_e=Number.parseInt(_e)-1,_e?re.setAttribute("loading-number",_e.toString()):(removeClass(re,he.bm("parent","relative")),re.removeAttribute("loading-number")),removeClass(re,he.bm("parent","hidden"))}f(),z.unmount()}function f(){var re,he;(he=(re=ie.$el)==null?void 0:re.parentNode)==null||he.removeChild(ie.$el)}function y(){var re;e.beforeClose&&!e.beforeClose()||(a.value=!0,clearTimeout(n),n=setTimeout(m,400),s.visible=!1,(re=e.closed)==null||re.call(e))}function m(){if(!a.value)return;const re=s.parent;a.value=!1,re.vLoadingAddClassList=void 0,c()}const z=createApp(defineComponent({name:"ElLoading",setup(re,{expose:he}){const{ns:_e,zIndex:$e}=useGlobalComponentSettings("loading");return he({ns:_e,zIndex:$e}),()=>{const pe=s.spinner||s.svg,Ce=h("svg",{class:"circular",viewBox:s.svgViewBox?s.svgViewBox:"0 0 50 50",...pe?{innerHTML:pe}:{}},[h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),Oe=s.text?h("p",{class:_e.b("text")},[s.text]):void 0;return h(Transition,{name:_e.b("fade"),onAfterLeave:m},{default:withCtx(()=>[withDirectives(createVNode("div",{style:{backgroundColor:s.background||""},class:[_e.b("mask"),s.customClass,s.fullscreen?"is-fullscreen":""]},[h("div",{class:_e.b("spinner")},[Ce,Oe])]),[[vShow,s.visible]])])})}}}));Object.assign(z._context,t??{});const ie=z.mount(document.createElement("div"));return{...toRefs(s),setText:o,removeElLoadingChild:f,close:y,handleAfterLeave:m,vm:ie,get $el(){return ie.$el}}}let fullscreenInstance;const Loading=function(e={}){if(!isClient)return;const t=resolveOptions(e);if(t.fullscreen&&fullscreenInstance)return fullscreenInstance;const n=createLoadingComponent({...t,closed:()=>{var s;(s=t.closed)==null||s.call(t),t.fullscreen&&(fullscreenInstance=void 0)}},Loading._context);addStyle(t,t.parent,n),addClassList(t,t.parent,n),t.parent.vLoadingAddClassList=()=>addClassList(t,t.parent,n);let a=t.parent.getAttribute("loading-number");return a?a=`${Number.parseInt(a)+1}`:a="1",t.parent.setAttribute("loading-number",a),t.parent.appendChild(n.$el),nextTick(()=>n.visible.value=t.visible),t.fullscreen&&(fullscreenInstance=n),n},resolveOptions=e=>{var t,n,a,s;let o;return isString$5(e.target)?o=(t=document.querySelector(e.target))!=null?t:document.body:o=e.target||document.body,{parent:o===document.body||e.body?document.body:o,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:o===document.body&&((n=e.fullscreen)!=null?n:!0),lock:(a=e.lock)!=null?a:!1,customClass:e.customClass||"",visible:(s=e.visible)!=null?s:!0,beforeClose:e.beforeClose,closed:e.closed,target:o}},addStyle=async(e,t,n)=>{const{nextZIndex:a}=n.vm.zIndex||n.vm._.exposed.zIndex,s={};if(e.fullscreen)n.originalPosition.value=getStyle(document.body,"position"),n.originalOverflow.value=getStyle(document.body,"overflow"),s.zIndex=a();else if(e.parent===document.body){n.originalPosition.value=getStyle(document.body,"position"),await nextTick();for(const o of["top","left"]){const c=o==="top"?"scrollTop":"scrollLeft";s[o]=`${e.target.getBoundingClientRect()[o]+document.body[c]+document.documentElement[c]-Number.parseInt(getStyle(document.body,`margin-${o}`),10)}px`}for(const o of["height","width"])s[o]=`${e.target.getBoundingClientRect()[o]}px`}else n.originalPosition.value=getStyle(t,"position");for(const[o,c]of Object.entries(s))n.$el.style[o]=c},addClassList=(e,t,n)=>{const a=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?removeClass(t,a.bm("parent","relative")):addClass(t,a.bm("parent","relative")),e.fullscreen&&e.lock?addClass(t,a.bm("parent","hidden")):removeClass(t,a.bm("parent","hidden"))};Loading._context=null;const INSTANCE_KEY=Symbol("ElLoading"),createInstance$1=(e,t)=>{var n,a,s,o;const c=t.instance,f=re=>isObject$4(t.value)?t.value[re]:void 0,y=re=>{const he=isString$5(re)&&(c==null?void 0:c[re])||re;return he&&ref(he)},m=re=>y(f(re)||e.getAttribute(`element-loading-${hyphenate(re)}`)),g=(n=f("fullscreen"))!=null?n:t.modifiers.fullscreen,z={text:m("text"),svg:m("svg"),svgViewBox:m("svgViewBox"),spinner:m("spinner"),background:m("background"),customClass:m("customClass"),fullscreen:g,target:(a=f("target"))!=null?a:g?void 0:e,body:(s=f("body"))!=null?s:t.modifiers.body,lock:(o=f("lock"))!=null?o:t.modifiers.lock},ie=Loading(z);ie._context=vLoading._context,e[INSTANCE_KEY]={options:z,instance:ie}},updateOptions=(e,t)=>{for(const n of Object.keys(t))isRef(t[n])&&(t[n].value=e[n])},vLoading={mounted(e,t){t.value&&createInstance$1(e,t)},updated(e,t){const n=e[INSTANCE_KEY];t.oldValue!==t.value&&(t.value&&!t.oldValue?createInstance$1(e,t):t.value&&t.oldValue?isObject$4(t.value)&&updateOptions(t.value,n.options):n==null||n.instance.close())},unmounted(e){var t;(t=e[INSTANCE_KEY])==null||t.instance.close(),e[INSTANCE_KEY]=null}};vLoading._context=null;const notificationTypes=["primary","success","info","warning","error"],notificationProps=buildProps({customClass:{type:String,default:""},dangerouslyUseHTMLString:Boolean,duration:{type:Number,default:4500},icon:{type:iconPropType},id:{type:String,default:""},message:{type:definePropType([String,Object,Function]),default:""},offset:{type:Number,default:0},onClick:{type:definePropType(Function),default:()=>{}},onClose:{type:definePropType(Function),required:!0},position:{type:String,values:["top-right","top-left","bottom-right","bottom-left"],default:"top-right"},showClose:{type:Boolean,default:!0},title:{type:String,default:""},type:{type:String,values:[...notificationTypes,""],default:""},zIndex:Number,closeIcon:{type:iconPropType,default:close_default}}),notificationEmits={destroy:()=>!0},__default__=defineComponent({name:"ElNotification"}),_sfc_main$i=defineComponent({...__default__,props:notificationProps,emits:notificationEmits,setup(e,{expose:t}){const n=e,{ns:a,zIndex:s}=useGlobalComponentSettings("notification"),{nextZIndex:o,currentZIndex:c}=s,f=ref(!1);let y;const m=computed(()=>{const Ce=n.type;return Ce&&TypeComponentsMap[n.type]?a.m(Ce):""}),g=computed(()=>n.type&&TypeComponentsMap[n.type]||n.icon),z=computed(()=>n.position.endsWith("right")?"right":"left"),ie=computed(()=>n.position.startsWith("top")?"top":"bottom"),re=computed(()=>{var Ce;return{[ie.value]:`${n.offset}px`,zIndex:(Ce=n.zIndex)!=null?Ce:c.value}});function he(){n.duration>0&&({stop:y}=useTimeoutFn(()=>{f.value&&$e()},n.duration))}function _e(){y==null||y()}function $e(){f.value=!1}function pe({code:Ce}){Ce===EVENT_CODE.delete||Ce===EVENT_CODE.backspace?_e():Ce===EVENT_CODE.esc?f.value&&$e():he()}return onMounted(()=>{he(),o(),f.value=!0}),useEventListener(document,"keydown",pe),t({visible:f,close:$e}),(Ce,Oe)=>(openBlock(),createBlock(Transition,{name:unref(a).b("fade"),onBeforeLeave:Ce.onClose,onAfterLeave:qe=>Ce.$emit("destroy"),persisted:""},{default:withCtx(()=>[withDirectives(createBaseVNode("div",{id:Ce.id,class:normalizeClass([unref(a).b(),Ce.customClass,unref(z)]),style:normalizeStyle(unref(re)),role:"alert",onMouseenter:_e,onMouseleave:he,onClick:Ce.onClick},[unref(g)?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass([unref(a).e("icon"),unref(m)])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(unref(g))))]),_:1},8,["class"])):createCommentVNode("v-if",!0),createBaseVNode("div",{class:normalizeClass(unref(a).e("group"))},[createBaseVNode("h2",{class:normalizeClass(unref(a).e("title")),textContent:toDisplayString$1(Ce.title)},null,10,["textContent"]),withDirectives(createBaseVNode("div",{class:normalizeClass(unref(a).e("content")),style:normalizeStyle(Ce.title?void 0:{margin:0})},[renderSlot(Ce.$slots,"default",{},()=>[Ce.dangerouslyUseHTMLString?(openBlock(),createElementBlock(Fragment,{key:1},[createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),createBaseVNode("p",{innerHTML:Ce.message},null,8,["innerHTML"])],2112)):(openBlock(),createElementBlock("p",{key:0},toDisplayString$1(Ce.message),1))])],6),[[vShow,Ce.message]]),Ce.showClose?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass(unref(a).e("closeBtn")),onClick:withModifiers($e,["stop"])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(Ce.closeIcon)))]),_:1},8,["class","onClick"])):createCommentVNode("v-if",!0)],2)],46,["id","onClick"]),[[vShow,f.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var NotificationConstructor=_export_sfc$1(_sfc_main$i,[["__file","notification.vue"]]);const notifications={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]},GAP_SIZE=16;let seed=1;const notify=function(e={},t){if(!isClient)return{close:()=>{}};(isString$5(e)||isVNode$1(e))&&(e={message:e});const n=e.position||"top-right";let a=e.offset||0;notifications[n].forEach(({vm:g})=>{var z;a+=(((z=g.el)==null?void 0:z.offsetHeight)||0)+GAP_SIZE}),a+=GAP_SIZE;const s=`notification_${seed++}`,o=e.onClose,c={...e,offset:a,id:s,onClose:()=>{close(s,n,o)}};let f=document.body;isElement(e.appendTo)?f=e.appendTo:isString$5(e.appendTo)&&(f=document.querySelector(e.appendTo)),isElement(f)||(debugWarn("ElNotification","the appendTo option is not an HTMLElement. Falling back to document.body."),f=document.body);const y=document.createElement("div"),m=createVNode(NotificationConstructor,c,isFunction$4(c.message)?c.message:isVNode$1(c.message)?()=>c.message:null);return m.appContext=isUndefined$1(t)?notify._context:t,m.props.onDestroy=()=>{render(null,y)},render(m,y),notifications[n].push({vm:m}),f.appendChild(y.firstElementChild),{close:()=>{m.component.exposed.visible.value=!1}}};notificationTypes.forEach(e=>{notify[e]=(t={},n)=>((isString$5(t)||isVNode$1(t))&&(t={message:t}),notify({...t,type:e},n))});function close(e,t,n){const a=notifications[t],s=a.findIndex(({vm:m})=>{var g;return((g=m.component)==null?void 0:g.props.id)===e});if(s===-1)return;const{vm:o}=a[s];if(!o)return;n==null||n(o);const c=o.el.offsetHeight,f=t.split("-")[0];a.splice(s,1);const y=a.length;if(!(y<1))for(let m=s;m<y;m++){const{el:g,component:z}=a[m].vm,ie=Number.parseInt(g.style[f],10)-c-GAP_SIZE;z.props.offset=ie}}function closeAll(){for(const e of Object.values(notifications))e.forEach(({vm:t})=>{t.component.exposed.visible.value=!1})}notify.closeAll=closeAll,notify._context=null;const ElNotification=withInstallFunction(notify,"$notify");/*! Element Plus v2.10.1 */var en={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};/*! Element Plus v2.10.1 */var es={name:"es",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"Confirmar",clear:"Despejar"},datepicker:{now:"Ahora",today:"Hoy",cancel:"Cancelar",clear:"Despejar",confirm:"Confirmar",selectDate:"Seleccionar fecha",selectTime:"Seleccionar hora",startDate:"Fecha Incial",startTime:"Hora Inicial",endDate:"Fecha Final",endTime:"Hora Final",prevYear:"Año Anterior",nextYear:"Próximo Año",prevMonth:"Mes Anterior",nextMonth:"Próximo Mes",year:"",month1:"enero",month2:"febrero",month3:"marzo",month4:"abril",month5:"mayo",month6:"junio",month7:"julio",month8:"agosto",month9:"septiembre",month10:"octubre",month11:"noviembre",month12:"diciembre",weeks:{sun:"dom",mon:"lun",tue:"mar",wed:"mié",thu:"jue",fri:"vie",sat:"sáb"},months:{jan:"ene",feb:"feb",mar:"mar",apr:"abr",may:"may",jun:"jun",jul:"jul",aug:"ago",sep:"sep",oct:"oct",nov:"nov",dec:"dic"}},select:{loading:"Cargando",noMatch:"No hay datos que coincidan",noData:"Sin datos",placeholder:"Seleccionar"},mention:{loading:"Cargando"},cascader:{noMatch:"No hay datos que coincidan",loading:"Cargando",placeholder:"Seleccionar",noData:"Sin datos"},pagination:{goto:"Ir a",pagesize:"/página",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages"},messagebox:{confirm:"Aceptar",cancel:"Cancelar",error:"Entrada inválida"},upload:{deleteTip:"Pulse Eliminar para retirar",delete:"Eliminar",preview:"Vista Previa",continue:"Continuar"},table:{emptyText:"Sin Datos",confirmFilter:"Confirmar",resetFilter:"Reiniciar",clearFilter:"Despejar",sumText:"Suma"},tree:{emptyText:"Sin Datos"},transfer:{noMatch:"No hay datos que coincidan",noData:"Sin datos",titles:["Lista 1","Lista 2"],filterPlaceholder:"Ingresar palabra clave",noCheckedFormat:"{total} artículos",hasCheckedFormat:"{checked}/{total} revisados"},image:{error:"HA FALLADO"},pageHeader:{title:"Volver"},popconfirm:{confirmButtonText:"Si",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const _hoisted_1$b={key:0,width:"30",height:"28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$9={key:1,xmlns:"http://www.w3.org/2000/svg",width:"23",height:"23",fill:"none"},_hoisted_3$7={key:2,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"},_hoisted_4$4={key:3,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#31383e"},_hoisted_5$2={key:4,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#31383e"},_hoisted_6$1={key:5,xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none",stroke:"#666e7b","stroke-width":"2","stroke-linejoin":"round","xmlns:v":"https://vecta.io/nano"},_hoisted_7$1={key:6,xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none",stroke:"#666e7b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","xmlns:v":"https://vecta.io/nano"},_hoisted_8$1={key:7,xmlns:"http://www.w3.org/2000/svg",width:"22",height:"23",fill:"none",stroke:"#969eab","stroke-width":"3","stroke-linejoin":"round","xmlns:v":"https://vecta.io/nano"},_hoisted_9={key:8,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"},_hoisted_10={key:9,xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none",stroke:"#666e7b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","xmlns:v":"https://vecta.io/nano"},_hoisted_11={key:10,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"#abb6c8","stroke-width":"1.5","xmlns:v":"https://vecta.io/nano"},_sfc_main$h=defineComponent({__name:"CustomIcon",props:{icon:{}},setup(e){const t=e;return(n,a)=>t.icon==="back"?(openBlock(),createElementBlock("svg",_hoisted_1$b,a[0]||(a[0]=[createBaseVNode("path",{d:"M2 14.219h26.5M2 13.781 13.781 2M2 14.219 13.781 26",stroke:"#000","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))):t.icon==="close"?(openBlock(),createElementBlock("svg",_hoisted_2$9,a[1]||(a[1]=[createBaseVNode("path",{d:"m2 2 18.738 18.738M2.12 21.107 20.857 2.37",stroke:"#000","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))):t.icon==="error"?(openBlock(),createElementBlock("svg",_hoisted_3$7,a[2]||(a[2]=[createBaseVNode("circle",{cx:"25",cy:"25",r:"25",fill:"#d75a4a"},null,-1),createBaseVNode("path",{fill:"none",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-miterlimit":"10",d:"M16 34l9-9 9-9M16 16l9 9 9 9"},null,-1)]))):t.icon==="eye"?(openBlock(),createElementBlock("svg",_hoisted_4$4,a[3]||(a[3]=[createBaseVNode("path",{d:"M12 9q1.219 0 2.109.891T15 12t-.891 2.109T12 15t-2.109-.891T9 12t.891-2.109T12 9zm0 8.016q2.063 0 3.539-1.477T17.016 12t-1.477-3.539T12 6.984 8.461 8.461 6.984 12t1.477 3.539T12 17.016zM12 4.5q3.703 0 6.703 2.063t4.313 5.438q-1.313 3.375-4.313 5.438T12 19.502t-6.703-2.063-4.313-5.438q1.313-3.375 4.313-5.438T12 4.5z"},null,-1)]))):t.icon==="eye-slash"?(openBlock(),createElementBlock("svg",_hoisted_5$2,a[4]||(a[4]=[createBaseVNode("path",{d:"M11.859 9H12q1.219 0 2.109.891T15 12v.188zm-4.312.797Q6.984 10.922 6.984 12q0 2.063 1.477 3.539T12 17.016q1.078 0 2.203-.563l-1.547-1.547Q12.281 15 12 15q-1.219 0-2.109-.891T9 12q0-.281.094-.656zM2.016 4.266L3.282 3l17.719 17.719-1.266 1.266q-.234-.234-1.477-1.453t-1.898-1.875q-2.016.844-4.359.844-3.703 0-6.703-2.063T.985 12q.516-1.219 1.617-2.695t2.133-2.273q-.563-.563-1.57-1.594T2.017 4.266zM12 6.984q-.938 0-1.828.375L8.016 5.203Q9.844 4.5 12 4.5q3.703 0 6.68 2.063t4.289 5.438q-1.125 2.766-3.422 4.734l-2.906-2.906q.375-.891.375-1.828 0-2.063-1.477-3.539T12 6.985z"},null,-1)]))):t.icon==="files"?(openBlock(),createElementBlock("svg",_hoisted_6$1,a[5]||(a[5]=[createBaseVNode("path",{d:"M21 28H7a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10l5 5v14a1 1 0 0 1-1 1Z"},null,-1),createBaseVNode("path",{d:"M10 8V5a1 1 0 0 1 1-1h10l5 5v14a1 1 0 0 1-1 1h-3m-11-5h6m-6 4h6","stroke-linecap":"round"},null,-1)]))):t.icon==="lock"?(openBlock(),createElementBlock("svg",_hoisted_7$1,a[6]||(a[6]=[createBaseVNode("path",{d:"M16 20a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zm0 0v3"},null,-1),createBaseVNode("path",{d:"M26 11H6a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V12a1 1 0 0 0-1-1ZM11.5 11V6.5a4.5 4.5 0 1 1 9 0V11"},null,-1)]))):t.icon==="search"?(openBlock(),createElementBlock("svg",_hoisted_8$1,a[7]||(a[7]=[createBaseVNode("circle",{cx:"9.451",cy:"9.451",r:"7.451"},null,-1),createBaseVNode("path",{d:"M13.921 15.412 19.51 21","stroke-linecap":"round"},null,-1)]))):t.icon==="success"?(openBlock(),createElementBlock("svg",_hoisted_9,a[8]||(a[8]=[createBaseVNode("circle",{cx:"25",cy:"25",r:"25",fill:"#25ae88"},null,-1),createBaseVNode("path",{fill:"none",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":"10",d:"M38 15L22 33l-10-8"},null,-1)]))):t.icon==="users"?(openBlock(),createElementBlock("svg",_hoisted_10,a[9]||(a[9]=[createBaseVNode("path",{d:"M16 22.5a5 5 0 1 0 0-10 5 5 0 0 0 0 10zm8.5-8a7.475 7.475 0 0 1 6 3m-29 0a7.474 7.474 0 0 1 6-3"},null,-1),createBaseVNode("path",{d:"M8.8 27a8.012 8.012 0 0 1 14.4 0M7.5 14.5a4 4 0 1 1 3.925-4.75m9.15 0A4 4 0 1 1 24.5 14.5"},null,-1)]))):t.icon==="x-circle"?(openBlock(),createElementBlock("svg",_hoisted_11,a[10]||(a[10]=[createBaseVNode("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z","stroke-miterlimit":"10"},null,-1),createBaseVNode("path",{d:"M15 9l-6 6m6 0L9 9","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))):createCommentVNode("",!0)}}),_hoisted_1$a=["src"],_sfc_main$g=defineComponent({__name:"AppLoader",props:{avatar:{default:void 0},grow:{type:Boolean,default:!0},icon:{default:void 0},message:{default:void 0},size:{default:"small"},title:{default:void 0},type:{default:"loading"}},emits:["imagesLoaded","imagesLoading"],setup(e,{emit:t}){const n=e,a=t;return onMounted(()=>{n.avatar&&a("imagesLoading")}),(s,o)=>(openBlock(),createElementBlock("div",{class:normalizeClass([s.$style["loader-body"],[s.$style[`loader-${s.size}`]],[s.$style[`loader-${s.type}`]],{[s.$style["loader-no-grow"]]:s.grow===!1}])},[createBaseVNode("div",{class:normalizeClass(s.$style["loader-container"])},[createBaseVNode("div",{class:normalizeClass(s.$style["loader-inner"])},[createBaseVNode("div",{class:normalizeClass(s.$style["loader-mask"])},[s.avatar?(openBlock(),createElementBlock("img",{key:0,alt:"",src:s.avatar,width:"1",height:"1",onLoad:o[0]||(o[0]=()=>a("imagesLoaded"))},null,40,_hoisted_1$a)):createCommentVNode("",!0),s.icon?(openBlock(),createBlock(_sfc_main$h,{key:1,icon:s.icon},null,8,["icon"])):createCommentVNode("",!0)],2)],2),createBaseVNode("div",{class:normalizeClass(s.$style.loader)},o[1]||(o[1]=[createBaseVNode("span",null,null,-1)]),2)],2),s.title?(openBlock(),createElementBlock("h2",{key:0,class:normalizeClass(s.$style["loader-title"])},toDisplayString$1(s.title),3)):createCommentVNode("",!0),s.message?(openBlock(),createElementBlock("p",{key:1,class:normalizeClass(s.$style["loader-message"])},toDisplayString$1(s.message),3)):createCommentVNode("",!0)],2))}}),loader="pb-w-sync_loader",style0$f={loader,"loader-container-animation":"pb-w-sync_loader-container-animation","loader-clip-animation":"pb-w-sync_loader-clip-animation","loader-bar-animation":"pb-w-sync_loader-bar-animation","loader-body":"pb-w-sync_loader-body","loader-error":"pb-w-sync_loader-error","loader-title":"pb-w-sync_loader-title","loader-success":"pb-w-sync_loader-success","loader-large":"pb-w-sync_loader-large","loader-container":"pb-w-sync_loader-container","loader-inner":"pb-w-sync_loader-inner","loader-loading":"pb-w-sync_loader-loading","loader-no-grow":"pb-w-sync_loader-no-grow","loader-small":"pb-w-sync_loader-small","loader-mask":"pb-w-sync_loader-mask","loader-message":"pb-w-sync_loader-message"},_export_sfc=(e,t)=>{const n=e.__vccOpts||e;for(const[a,s]of t)n[a]=s;return n},cssModules$f={$style:style0$f},AppLoader=_export_sfc(_sfc_main$g,[["__cssModules",cssModules$f]]),_hoisted_1$9=["disabled"],_sfc_main$f=defineComponent({__name:"AccountsSelection",props:{avatar:{default:void 0},buttonDisabledStyle:{type:Boolean,default:!1},client:{},credential:{},disableFormAutocomplete:{type:Boolean,default:!1},getSelectedAccounts:{type:Function,default:void 0},sync:{}},emits:["done"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),{t:o}=useI18n(),c=ref([]),f=ref(null),y=ref(!1),m=reactive({accounts:[]}),g=ref(!0),z=ref(!0),ie=reactive({accounts:[{type:"array",required:!0,message:o("accounts_selection.form_error"),trigger:"change"}]});let re;function he(){n.getSelectedAccounts?n.getSelectedAccounts(n.credential).then(At=>{re=At,c.value.length>0&&Ce()}).catch(()=>{re=[],c.value.length>0&&Ce()}):re=[],pe()}function _e(){let At=c.value.reduce((Et,ze)=>(Et={...Et,[ze.id_account]:!1},Et),{});return m.accounts.forEach(Et=>{At[Et]=!0}),At}function $e(At){return`**${At.slice(-4)}`}function pe(){const At=setInterval(()=>{n.sync.getAccounts({id_credential:n.credential}).then(Et=>{Et.length>0&&c.value.length===0&&(clearInterval(At),c.value=Et,re&&Ce())}).catch(()=>{clearInterval(At),z.value=!1,y.value=!0,s("accounts-error")})},2e3)}function Ce(){re.length>0&&(m.accounts=re.filter(At=>c.value.some(Et=>Et.id_account===At))),m.accounts.length===0&&c.value.length>0&&(m.accounts=c.value.map(At=>At.id_account)),z.value=!1}const Oe=async(At,Et)=>{At.preventDefault(),Et&&await Et.validate(ze=>{ze&&(s("accounts-selected",_e()),a("done"))})};function qe(At,Et){g.value=!Et}return he(),(At,Et)=>(openBlock(),createElementBlock("div",{class:normalizeClass([At.$style["accounts-selection"],{[At.$style["accounts-api-error"]]:y.value}])},[z.value||y.value?(openBlock(),createBlock(AppLoader,{key:0,avatar:n.avatar,grow:!y.value,message:y.value?unref(o)("accounts_selection.error"):unref(o)("accounts_selection.fetching"),size:"large",title:unref(o)("accounts_selection.fetching"),type:y.value?"error":"loading",onImagesLoaded:Et[0]||(Et[0]=()=>unref(s)("images-loaded")),onImagesLoading:Et[1]||(Et[1]=()=>unref(s)("images-loading"))},null,8,["avatar","grow","message","title","type"])):(openBlock(),createBlock(unref(ElForm),{key:1,ref_key:"accountsFormRef",ref:f,class:normalizeClass(At.$style["accounts-form"]),autocomplete:At.disableFormAutocomplete?"off":"on",disabled:z.value,"hide-required-asterisk":!0,"label-position":"top",model:m,name:"accounts-selection",rules:ie,onSubmit:Et[3]||(Et[3]=ze=>Oe(ze,f.value)),onValidate:qe},{default:withCtx(()=>[createVNode(unref(ElFormItem),{label:n.client.name?unref(o)("accounts_selection.form_label_client",{client:n.client.name}):unref(o)("accounts_selection.form_label"),prop:"accounts"},{default:withCtx(()=>[createVNode(unref(ElCheckboxGroup),{modelValue:m.accounts,"onUpdate:modelValue":Et[2]||(Et[2]=ze=>m.accounts=ze),class:normalizeClass(At.$style["accounts-checkboxes"])},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(c.value,ze=>(openBlock(),createBlock(unref(ElCheckbox),{key:ze.id_account,class:normalizeClass(At.$style["accounts-checkbox"]),name:"accounts",value:ze.id_account},{default:withCtx(()=>[createBaseVNode("div",{class:normalizeClass(At.$style["accounts-checkbox-content"])},[createBaseVNode("div",null,toDisplayString$1(ze.account_type),1),createBaseVNode("div",{class:normalizeClass(At.$style["accounts-checkbox-row"])},[createBaseVNode("div",null,toDisplayString$1($e(ze.number)),1),createBaseVNode("div",null,[createVNode(unref(ElStatistic),{class:normalizeClass(At.$style["accounts-balance"]),value:ze.balance,precision:2},null,8,["class","value"]),createTextVNode(" "+toDisplayString$1(ze.currency),1)])],2)],2)]),_:2},1032,["class","value"]))),128))]),_:1},8,["modelValue","class"])]),_:1},8,["label"]),createBaseVNode("button",{class:"pb-w-sync_primary-button","data-testid":"accounts-button",disabled:At.buttonDisabledStyle&&g.value,type:"submit"},toDisplayString$1(unref(o)("accounts_selection.done")),9,_hoisted_1$9)]),_:1},8,["class","autocomplete","disabled","model","rules"])),y.value?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(At.$style["accounts-error-button-container"])},[createBaseVNode("button",{class:"pb-w-sync_primary-button","data-testid":"accounts-button",type:"button",onClick:Et[4]||(Et[4]=()=>a("done"))},toDisplayString$1(unref(o)("accounts_selection.done")),1)],2)):createCommentVNode("",!0)],2))}}),style0$e={"accounts-balance":"pb-w-sync_accounts-balance","accounts-checkbox":"pb-w-sync_accounts-checkbox","accounts-checkbox-content":"pb-w-sync_accounts-checkbox-content","accounts-checkbox-row":"pb-w-sync_accounts-checkbox-row","accounts-checkboxes":"pb-w-sync_accounts-checkboxes","accounts-error-button-container":"pb-w-sync_accounts-error-button-container","accounts-form":"pb-w-sync_accounts-form","accounts-selection":"pb-w-sync_accounts-selection","accounts-api-error":"pb-w-sync_accounts-api-error"},cssModules$e={$style:style0$e},AccountsSelection=_export_sfc(_sfc_main$f,[["__cssModules",cssModules$e]]),_sfc_main$e=defineComponent({__name:"FinalResponse",props:{avatar:{},displayAccountsSelection:{type:Boolean},displayAddAnotherButton:{type:Boolean},longMessage:{default:""},message:{default:""},showLogo:{type:Boolean},type:{default:"error"}},emits:["add-other","select-accounts"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),{t:o}=useI18n();return(c,f)=>(openBlock(),createElementBlock("div",{class:normalizeClass(c.$style["final-response-container"])},[createVNode(AppLoader,{avatar:c.showLogo?c.avatar:void 0,grow:!1,icon:c.showLogo?void 0:c.type,message:c.longMessage,size:"large",title:c.message,type:c.type,onImagesLoaded:f[0]||(f[0]=()=>unref(s)("images-loaded")),onImagesLoading:f[1]||(f[1]=()=>unref(s)("images-loading"))},null,8,["avatar","icon","message","title","type"]),c.displayAddAnotherButton&&(!n.displayAccountsSelection||n.type==="error")?(openBlock(),createElementBlock("button",{key:0,class:"pb-w-sync_primary-button",onClick:f[2]||(f[2]=y=>a("add-other"))},toDisplayString$1(unref(o)("common.add_other")),1)):createCommentVNode("",!0),n.displayAccountsSelection&&n.type==="success"?(openBlock(),createElementBlock("button",{key:1,class:"pb-w-sync_primary-button",onClick:f[3]||(f[3]=y=>a("select-accounts"))},toDisplayString$1(unref(o)("common.continue")),1)):createCommentVNode("",!0)],2))}}),style0$d={"final-response-container":"pb-w-sync_final-response-container"},cssModules$d={$style:style0$d},FinalResponse=_export_sfc(_sfc_main$e,[["__cssModules",cssModules$d]]),_hoisted_1$8=["src"],_hoisted_2$8=["src"],_hoisted_3$6=["onClick"],_sfc_main$d=defineComponent({__name:"InstitutionFilters",props:{countryId:{},filteredCountries:{},filteredOrganizationTypes:{},showCountries:{type:Boolean},organizationTypeId:{},selectClass:{}},emits:["update:countryId","update:organizationTypeId"],setup(e,{emit:t}){const n=e,a=t,{t:s}=useI18n(),o=computed(()=>f(n.filteredCountries.find(m=>m.id_country===n.countryId)));function c(m){measureEvent("open_country",{id_country:m}),a("update:countryId",m)}function f(m){return`https://hatscripts.github.io/circle-flags/flags/${m.code.toLocaleLowerCase()}.svg`}function y(m){measureEvent("open_site_organization_type",{id_site_organization_type:m}),a("update:organizationTypeId",m)}return(m,g)=>(openBlock(),createElementBlock(Fragment,null,[createBaseVNode("p",{class:normalizeClass(m.$style["institution-filters-intro"])},toDisplayString$1(unref(s)("common.intro")),3),m.showCountries?(openBlock(),createBlock(unref(ElSelect),{key:0,class:normalizeClass(m.$style["widget-country"]),"model-value":n.countryId,"popper-class":n.selectClass,onChange:c},{prefix:withCtx(()=>[createBaseVNode("img",{src:o.value,width:"44",height:"44",alt:""},null,8,_hoisted_1$8)]),default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(m.filteredCountries,z=>(openBlock(),createBlock(unref(ElOption),{key:z.id_country,class:normalizeClass(m.$style["widget-country-option"]),value:z.id_country,label:z.name},{default:withCtx(()=>[createBaseVNode("img",{src:f(z),width:"44",height:"44",alt:""},null,8,_hoisted_2$8),createBaseVNode("span",null,toDisplayString$1(z.name),1)]),_:2},1032,["class","value","label"]))),128))]),_:1},8,["class","model-value","popper-class"])):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass(m.$style["organization-types-list"])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(m.filteredOrganizationTypes,z=>(openBlock(),createElementBlock("button",{key:z.id_site_organization_type,onClick:()=>y(z.id_site_organization_type)},toDisplayString$1(unref(s)(`common.${z.label}`)),9,_hoisted_3$6))),128))],2)],64))}}),style0$c={"institution-filters-intro":"pb-w-sync_institution-filters-intro","organization-types-list":"pb-w-sync_organization-types-list","widget-country":"pb-w-sync_widget-country","widget-country-option":"pb-w-sync_widget-country-option"},cssModules$c={$style:style0$c},InstitutionFilters=_export_sfc(_sfc_main$d,[["__cssModules",cssModules$c]]),_hoisted_1$7=["onClick"],_hoisted_2$7=["alt","src"],_hoisted_3$5={key:1},_sfc_main$c=defineComponent({__name:"OrganizationSitesList",props:{assetsPath:{default:"https://s.paybook.com"},items:{default:()=>[]},showLogo:{type:Boolean,default:!0},showPlaidSitesButton:{type:Boolean,default:!1}},emits:["select"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),{t:o}=useI18n(),c=ref("");let f=0;const y=computed(()=>{const z=c.value.toLocaleLowerCase();return n.items.map(ie=>({...ie,show:z===""?!0:ie.name.toLocaleLowerCase().includes(z)}))});onMounted(()=>{n.items.length>0&&n.showLogo&&(f=0,s("images-loading"))}),watch(()=>n.items,z=>{z.length>0&&n.showLogo&&(f=0,s("images-loading"))});function m(){f++,f===n.items.length&&s("images-loaded")}function g(z){a("select",z)}return(z,ie)=>z.showPlaidSitesButton?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(z.$style["widget-plaid-container"])},[createBaseVNode("button",{class:"pb-w-sync_primary-button",onClick:ie[0]||(ie[0]=()=>unref(s)("__internal__.plaid-sites-clicked"))},toDisplayString$1(unref(o)("common.find_your_institution")),1)],2)):(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(unref(ElInput),{modelValue:c.value,"onUpdate:modelValue":ie[1]||(ie[1]=re=>c.value=re),"data-testid":"search-organization",placeholder:unref(o)("common.search")},{prefix:withCtx(()=>[createVNode(_sfc_main$h,{icon:"search"})]),_:1},8,["modelValue","placeholder"]),createBaseVNode("div",{class:normalizeClass(z.$style["organization-sites"])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(y.value,(re,he)=>withDirectives((openBlock(),createElementBlock("button",{key:`${re.id_site_organization}-${he}`,class:normalizeClass(z.$style["organization-button"]),type:"button",onClick:()=>g(re)},[z.showLogo?(openBlock(),createElementBlock("img",{key:0,alt:re.name,src:`${z.assetsPath}${re.small_cover}`,loading:"lazy",height:"66",width:"220",onLoad:m},null,40,_hoisted_2$7)):(openBlock(),createElementBlock("span",_hoisted_3$5,toDisplayString$1(re.name),1))],10,_hoisted_1$7)),[[vShow,re.show]])),128))],2)],64))}}),style0$b={"widget-plaid-container":"pb-w-sync_widget-plaid-container","organization-sites":"pb-w-sync_organization-sites","organization-button":"pb-w-sync_organization-button"},cssModules$b={$style:style0$b},OrganizationSitesList=_export_sfc(_sfc_main$c,[["__cssModules",cssModules$b]]),_hoisted_1$6={key:0},_hoisted_2$6=["src"],_hoisted_3$4=["src"],_hoisted_4$3=["href"],_sfc_main$b=defineComponent({__name:"PrivacyPolicy",props:{client:{}},emits:["continue"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),{t:o}=useI18n(),c="https://www.paybook.com/lib/syncfy/";let f=0;onMounted(()=>{s("images-loading")});function y(){s("privacy-accepted"),a("continue")}function m(){f++,(f===1&&!n.client.logo||f===2)&&s("images-loaded")}return(g,z)=>(openBlock(),createElementBlock("div",{class:normalizeClass(g.$style["privacy-container"])},[z[1]||(z[1]=createBaseVNode("div",null,null,-1)),createBaseVNode("div",{class:normalizeClass(g.$style["privacy-center"])},[createBaseVNode("div",{class:normalizeClass([g.$style["privacy-images"],{[g.$style["with-client-logo"]]:n.client.logo}])},[n.client.logo?(openBlock(),createElementBlock("div",_hoisted_1$6,[createBaseVNode("img",{src:n.client.logo,alt:"",onLoad:m},null,40,_hoisted_2$6)])):createCommentVNode("",!0),createBaseVNode("div",null,[createBaseVNode("img",{src:`${unref(c)}blog/syncfy-icon.svg`,alt:"",width:"190",height:"43",onLoad:m},null,40,_hoisted_3$4)])],2),createBaseVNode("h1",null,toDisplayString$1(n.client.name?unref(o)("privacy.title_client",{client:n.client.name}):unref(o)("privacy.title")),1),createBaseVNode("ul",null,[createBaseVNode("li",null,[createVNode(_sfc_main$h,{icon:"files"}),createTextVNode(" "+toDisplayString$1(unref(o)("privacy.list.first")),1)]),createBaseVNode("li",null,[createVNode(_sfc_main$h,{icon:"lock"}),createTextVNode(" "+toDisplayString$1(unref(o)("privacy.list.second")),1)]),createBaseVNode("li",null,[createVNode(_sfc_main$h,{icon:"users"}),createTextVNode(" "+toDisplayString$1(unref(o)("privacy.list.third")),1)])]),createBaseVNode("button",{class:"pb-w-sync_primary-button","data-testid":"privacy-button",type:"button",onClick:y},toDisplayString$1(unref(o)("common.continue")),1),createBaseVNode("p",null,[createTextVNode(toDisplayString$1(unref(o)("privacy.message"))+" ",1),createBaseVNode("a",{rel:"noopener",href:unref(o)("privacy.url"),target:"_blank"},toDisplayString$1(unref(o)("privacy.link")),9,_hoisted_4$3),z[0]||(z[0]=createTextVNode(". ",-1))])],2),z[2]||(z[2]=createBaseVNode("div",null,null,-1))],2))}}),style0$a={"privacy-container":"pb-w-sync_privacy-container","privacy-center":"pb-w-sync_privacy-center","privacy-images":"pb-w-sync_privacy-images","with-client-logo":"pb-w-sync_with-client-logo"},cssModules$a={$style:style0$a},PrivacyPolicy=_export_sfc(_sfc_main$b,[["__cssModules",cssModules$a]]),_hoisted_1$5=["for"],_hoisted_2$5=["aria-label"],_hoisted_3$3=["accept","name"],_sfc_main$a=defineComponent({__name:"FileInput",props:{credential:{},displayError:{type:Boolean},idSite:{}},emits:["input","validate"],setup(e,{emit:t}){const n=e,a=t,{t:s}=useI18n(),o=ref(null),c=ref(null),f=ref(!1),y=ref(!1),m=computed(()=>g.value.join(",")),g=computed(()=>{const Oe=[],qe=[];let At="";return n.credential.accept&&n.credential.accept.forEach(Et=>{Oe.push(`.${Et.extension}`),Oe.push(Et.mime_type)}),Oe.sort(),Oe.forEach(Et=>{Et!==At&&(qe.push(Et),At=Et)}),qe}),z=computed(()=>f.value&&!c.value&&!y.value),ie=computed(()=>{const Oe=g.value.filter(qe=>qe[0]===".");return Oe.length>1?s("file.invalid_multiple",{extensions:Oe.join(", ")}):s("file.invalid",{extension:Oe[0]})});watch(()=>n.displayError,Oe=>{Oe&&(f.value=!0)});function re(Oe){const qe=new FileReader;qe.onload=At=>{c.value={file:At.target.result,info:{type:Oe.type,name:Oe.name}},a("input",At.target.result)},qe.readAsDataURL(Oe)}function he(Oe){Oe.preventDefault(),Oe.dataTransfer.files[0]&&re(Oe.dataTransfer.files[0])}function _e(Oe){y.value=!1;const qe=Oe.target.files[0],At=Oe.srcElement.value;Oe.preventDefault(),Oe.stopPropagation(),At.length>0?g.value.length===0||g.value.includes(qe.type)||g.value.includes(`.${At.split(".").pop()}`)?(a("validate",!0),re(qe)):qe.value||(y.value=!0,a("validate",!1)):qe.value||a("validate",!1)}function $e(Oe){Oe.stopPropagation(),Oe.preventDefault(),setTimeout(()=>{f.value=!0},2e3)}function pe(Oe){Oe.stopPropagation(),c.value=null,o.value.value=null,a("input",null)}function Ce(Oe){Oe.preventDefault(),o.value.click(),setTimeout(()=>{f.value=!0},5e3)}return(Oe,qe)=>(openBlock(),createElementBlock("div",{class:normalizeClass(Oe.$style["upload-document"])},[createBaseVNode("div",{class:normalizeClass(Oe.$style["upload-document-input"]),onClick:qe[1]||(qe[1]=At=>Ce(At)),onDrop:qe[2]||(qe[2]=At=>he(At)),onDragover:qe[3]||(qe[3]=At=>$e(At))},[createBaseVNode("label",{class:normalizeClass(Oe.$style["upload-document-label"]),for:`${n.idSite}[${n.credential.name}]`},toDisplayString$1(n.credential.label),11,_hoisted_1$5),c.value?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(Oe.$style["upload-document-name"])},[createBaseVNode("span",null,toDisplayString$1(c.value?c.value.info.name:Oe.$t("file.no_chosen")),1),createBaseVNode("button",{"aria-label":unref(s)("common.back"),class:normalizeClass(Oe.$style["widget-back-button"]),onClick:qe[0]||(qe[0]=At=>pe(At))},[createVNode(_sfc_main$h,{icon:"x-circle"})],10,_hoisted_2$5)],2)):(openBlock(),createElementBlock("button",{key:1,class:normalizeClass(Oe.$style["upload-document-button"])},toDisplayString$1(Oe.$t("file.click")),3))],34),z.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Oe.$style["upload-document-required-error"])},toDisplayString$1(n.credential.label)+" "+toDisplayString$1(Oe.$t("file.required")),3)):createCommentVNode("",!0),y.value?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(Oe.$style["upload-document-required-error"])},toDisplayString$1(ie.value),3)):createCommentVNode("",!0),createBaseVNode("input",{ref_key:"fileInput",ref:o,type:"file","data-testid":"file-input",accept:m.value,style:{position:"absolute",left:"-99999999px"},name:`${n.idSite}[${n.credential.name}]`,onClick:qe[4]||(qe[4]=At=>At.stopPropagation()),onChange:qe[5]||(qe[5]=At=>_e(At))},null,40,_hoisted_3$3)],2))}}),style0$9={"upload-document":"pb-w-sync_upload-document","upload-document-button":"pb-w-sync_upload-document-button","upload-document-input":"pb-w-sync_upload-document-input","upload-document-label":"pb-w-sync_upload-document-label","upload-document-name":"pb-w-sync_upload-document-name","upload-document-required-error":"pb-w-sync_upload-document-required-error"},cssModules$9={$style:style0$9},FileInput=_export_sfc(_sfc_main$a,[["__cssModules",cssModules$9]]);function isSiteV1Service(e){return e.version===1}function isSiteV3Service(e){return e.version===3}function isSiteV4Service(e){return e.version===4}const _hoisted_1$4={key:1},_hoisted_2$4=["alt","src"],_hoisted_3$2=["aria-label"],_hoisted_4$2={class:"el-form-item__error"},_hoisted_5$1=["disabled"],_sfc_main$9=defineComponent({__name:"SiteForm",props:{assetsPath:{default:"https://s.paybook.com"},backUpConnection:{type:Boolean,default:!1},buttonDisabledStyle:{type:Boolean,default:!1},credentialService:{default:null},disableFormAutocomplete:{type:Boolean,default:!1},displayBackButton:{type:Boolean},errorMessage:{default:null},loaderMessage:{},selectClass:{default:""},showHeader:{type:Boolean,default:!0},showLogo:{type:Boolean,default:!0},showPasswordStyle:{default:"icon"},site:{},testMode:{type:Boolean,default:!1},updateMode:{type:Boolean,default:!1}},emits:["back","error","success","valid"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),o=ref("0"),c=ref({...isSiteV1Service(n.site)?n.site.data:isSiteV3Service(n.site)?n.site.input[o.value].data:n.backUpConnection?n.site.backUpInput.data:n.site.input[o.value].data}),f=ref(!0),y=ref(!1),m=ref(!1),g=ref(!1),z=ref(!1);let ie=0,re=null,he={};const _e=ref(null),$e=ref(null),pe=computed(()=>isSiteV1Service(n.site)?n.site.getFields(n.updateMode):isSiteV3Service(n.site)?n.site.getFields(Number.parseInt(o.value),n.updateMode):isSiteV4Service(n.site)?n.backUpConnection?n.site.getBackUpFields(n.updateMode):n.site.getFields(Number.parseInt(o.value),n.updateMode):null),Ce=computed(()=>isSiteV1Service(n.site)?n.site.getRules(n.updateMode):isSiteV3Service(n.site)?n.site.getRules(Number.parseInt(o.value),n.updateMode):n.backUpConnection?n.site.getBackUpRules(n.updateMode):n.site.getRules(Number.parseInt(o.value),n.updateMode)),Oe=computed(()=>n.site.config.version===3?n.site.config.input:isSiteV4Service(n.site)?n.backUpConnection?[n.site.backUpConnection]:n.site.connections:[]),{t:qe}=useI18n();onBeforeUnmount(()=>{clearTimeout(re)}),onMounted(()=>{n.showLogo&&s("images-loading"),kt(),xe(),n.site.on("status-update",Ve=>{Ve==="loading"?y.value=!0:y.value=!1})});function At(Ve){return Ve.getTime()>Date.now()}function Et(Ve){return!!c.value[Ve]}function ze(){clearTimeout(re),n.testMode&&(ie<2?(ie++,re=setTimeout(()=>{ie=0},500)):(n.site.toggleTestMode(),z.value=n.site.testMode,ie=0))}function kt(){_e.value&&_e.value[0]&&_e.value[0].focus()}function Pt(Ve){return Ve.translate_error_label?qe(Ve.translate_error_label):Ve.error_label?Ve.error_label:Ve.translate_label?qe(Ve.translate_label):Ve.label}function jt(){s("images-loaded")}function Ie(Ve){return Ve.enabled_by?c.value[Ve.enabled_by]:!0}function u(){n.site.status==="loading"&&(y.value=!0)}function v(Ve){n.site.updateData(Number.parseInt(o.value),c.value),o.value=Ve,c.value={...n.site.input[o.value].data},xe(),nextTick(()=>{kt()})}const Y=async(Ve,Ue)=>{Ve.preventDefault();let Ne;Ue&&await Ue.validate(L=>{L&&!f.value?(a("valid"),s("submitted"),n.updateMode?(Ne=n.credentialService.update(n.site,c.value,Number.parseInt(o.value),n.backUpConnection),y.value=!0):isSiteV1Service(n.site)?Ne=n.site.connect(c.value):isSiteV3Service(n.site)?Ne=n.site.connect(Number.parseInt(o.value),c.value):Ne=n.site.connect(Number.parseInt(o.value),c.value,n.backUpConnection),Ne.then(Fe=>(a("success",Fe),n.site.config.request||s("updated",n.site.response),Fe)).catch(Fe=>{c.value={},xe(),a("error",Fe)})):g.value=!0})};function ae(Ve,Ue,Ne){Ne&&Ne.forEach(L=>{Ve?Ce.value[L].push({required:!0,message:"required"}):Ce.value[L]=Ce.value[L].filter(Fe=>Fe.message!=="required")})}function xe(Ve,Ue){Ve&&(he[Ve]=Ue),f.value=Object.keys(Ce.value).reduce((Ne,L)=>Ce.value[L].length===0?Ne:Ne||!he[L],!1)}return u(),(Ve,Ue)=>y.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Ve.$style["widget-form-loader"])},[createVNode(AppLoader,{avatar:Ve.showLogo?`${Ve.assetsPath}${Ve.site.config.site_organization.avatar}`:void 0,message:n.loaderMessage.long,title:n.loaderMessage.short,size:"large",onImagesLoaded:Ue[0]||(Ue[0]=()=>unref(s)("images-loaded")),onImagesLoading:Ue[1]||(Ue[1]=()=>unref(s)("images-loading"))},null,8,["avatar","message","title"])],2)):(openBlock(),createElementBlock("div",_hoisted_1$4,[createBaseVNode("div",{class:normalizeClass(Ve.$style["site-form-header"])},[z.value?(openBlock(),createBlock(unref(ElAlert),{key:0,center:"",closable:!1,effect:"dark"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(qe)("common.test_mode")),1)]),_:1})):createCommentVNode("",!0),Ve.showLogo&&Ve.showHeader?(openBlock(),createElementBlock("img",{key:1,alt:Ve.site.config.site_organization.name,class:normalizeClass(Ve.$style["site-cover"]),src:`${Ve.assetsPath}${Ve.site.config.site_organization.cover}`,width:"1600",height:"480",onLoad:jt},null,42,_hoisted_2$4)):createCommentVNode("",!0),Ve.showHeader?(openBlock(),createElementBlock("h2",{key:2,onClick:ze},toDisplayString$1(Ve.site.config.name),1)):createCommentVNode("",!0)],2),Ve.errorMessage?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Ve.$style["auth-error"])},[createBaseVNode("h3",null,toDisplayString$1(Ve.errorMessage.short),1),createBaseVNode("p",null,toDisplayString$1(Ve.errorMessage.long),1)],2)):createCommentVNode("",!0),Oe.value.length>1&&!n.backUpConnection?(openBlock(),createBlock(unref(ElMenu),{key:1,"default-active":"0",mode:"horizontal",class:normalizeClass(Ve.$style["site-tabs"]),ellipsis:!1,onSelect:v},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(Oe.value,(Ne,L)=>(openBlock(),createBlock(unref(ElMenuItem),{key:L,index:`${L}`},{default:withCtx(()=>[createTextVNode(toDisplayString$1(Ne.label),1)]),_:2},1032,["index"]))),128))]),_:1},8,["class"])):createCommentVNode("",!0),createVNode(unref(ElForm),{ref_key:"siteFormRef",ref:$e,"data-testid":"site-form",autocomplete:Ve.disableFormAutocomplete?"off":"on",disabled:y.value,"hide-required-asterisk":!0,"label-position":"top",model:c.value,name:`${Ve.site.config.id_site}`,rules:Ce.value,onSubmit:Ue[5]||(Ue[5]=Ne=>Y(Ne,$e.value)),onValidate:xe},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(pe.value,(Ne,L)=>(openBlock(),createElementBlock(Fragment,{key:`${L}-${Ne.name}`},[Ie(Ne)?(openBlock(),createElementBlock(Fragment,{key:0},[Ne.type==="file"?(openBlock(),createBlock(FileInput,{key:`${L}-${Ne.name}`,credential:Ne,"display-error":g.value,"id-site":Ve.site.config.id_site,onInput:Fe=>c.value[Ne.name]=Fe,onValidate:Fe=>xe(Ne.name,Fe)},null,8,["credential","display-error","id-site","onInput","onValidate"])):(openBlock(),createBlock(unref(ElFormItem),{key:1,class:normalizeClass({[Ve.$style["site-switch"]]:Ne.type==="switch"}),label:Ne.translate_label?Ve.$t(Ne.translate_label):Ne.label||"",prop:Ne.name,for:`${Ve.site.config.id_site}[${Ne.name}]`},{error:withCtx(({error:Fe})=>[createBaseVNode("div",_hoisted_4$2,toDisplayString$1(unref(qe)(`form_errors.${Fe}`,{label:Pt(Ne)})),1)]),default:withCtx(()=>[Ne.type==="text"||Ne.type==="password"?(openBlock(),createBlock(unref(ElInput),{key:0,ref_for:!0,ref_key:"firstInput",ref:_e,modelValue:c.value[Ne.name],"onUpdate:modelValue":Fe=>c.value[Ne.name]=Fe,"data-testid":"site-input",autocomplete:Ne.name==="password"?`${Ve.site.config.id_site} new-password`:Ve.disableFormAutocomplete?"off":`${Ve.site.config.id_site} ${Ne.name}`,name:`${Ve.site.config.id_site}[${Ne.name}]`,type:Ne.type==="password"&&m.value?"text":Ne.type},createSlots({_:2},[Ne.type==="password"&&Ve.showPasswordStyle==="icon"?{name:"append",fn:withCtx(()=>[createBaseVNode("button",{class:normalizeClass(Ve.$style["icon-eye"]),"aria-label":unref(qe)(`common.${m.value?"hide":"show_password"}`),type:"button",onClick:Ue[2]||(Ue[2]=()=>{m.value=!m.value})},[m.value?(openBlock(),createBlock(_sfc_main$h,{key:0,icon:"eye-slash"})):(openBlock(),createBlock(_sfc_main$h,{key:1,icon:"eye"}))],10,_hoisted_3$2)]),key:"0"}:void 0]),1032,["modelValue","onUpdate:modelValue","autocomplete","name","type"])):createCommentVNode("",!0),Ne.type==="select"?(openBlock(),createBlock(unref(ElSelect),{key:1,ref_for:!0,ref_key:"firstInput",ref:_e,modelValue:c.value[Ne.name],"onUpdate:modelValue":Fe=>c.value[Ne.name]=Fe,"data-testid":"site-select","popper-class":Ve.selectClass,autocomplete:Ve.disableFormAutocomplete?"off":`${Ve.site.config.id_site} ${Ne.name}`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(Ne.options,(Fe,Dt)=>(openBlock(),createBlock(unref(ElOption),{key:Dt,value:Fe.value,label:Fe.label},null,8,["value","label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","popper-class","autocomplete"])):createCommentVNode("",!0),Ne.type==="switch"?(openBlock(),createBlock(unref(ElSwitch),{key:2,ref_for:!0,ref_key:"firstInput",ref:_e,modelValue:c.value[Ne.name],"onUpdate:modelValue":Fe=>c.value[Ne.name]=Fe,onInput:Fe=>ae(Fe,Ne.name,Ne.enables)},null,8,["modelValue","onUpdate:modelValue","onInput"])):createCommentVNode("",!0),Ne.type==="date_range"?(openBlock(),createBlock(unref(ElDatePicker),{key:3,ref_for:!0,ref_key:"firstInput",ref:_e,modelValue:c.value[Ne.name],"onUpdate:modelValue":Fe=>c.value[Ne.name]=Fe,type:"daterange","range-separator":"-","start-placeholder":Ve.$t("download_options.date_range_start"),"end-placeholder":Ve.$t("download_options.date_range_end"),"disabled-date":At},null,8,["modelValue","onUpdate:modelValue","start-placeholder","end-placeholder"])):createCommentVNode("",!0)]),_:2},1032,["class","label","prop","for"])),Ne.type==="password"&&Ve.showPasswordStyle==="text"&&Et(Ne.name)?(openBlock(),createBlock(unref(ElButton),{key:`${L}-${Ne.name}-toggle`,class:normalizeClass(Ve.$style["show-hide"]),"native-type":"button",onClick:Ue[3]||(Ue[3]=()=>{m.value=!m.value})},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(qe)(`common.${m.value?"hide":"show_password"}`)),1)]),_:2},1032,["class"])):createCommentVNode("",!0)],64)):createCommentVNode("",!0)],64))),128)),createBaseVNode("div",{class:normalizeClass(Ve.$style["site-buttons"])},[Ve.displayBackButton?(openBlock(),createElementBlock("button",{key:0,class:"pb-w-sync_secondary-button","data-testid":"site-back",type:"button",onClick:Ue[4]||(Ue[4]=()=>a("back"))},toDisplayString$1(unref(qe)("common.back")),1)):createCommentVNode("",!0),createBaseVNode("button",{class:"pb-w-sync_primary-button","data-testid":"site-button",disabled:Ve.buttonDisabledStyle&&f.value,type:"submit"},toDisplayString$1(unref(qe)("common.next")),9,_hoisted_5$1)],2)]),_:1},8,["autocomplete","disabled","model","name","rules"])]))}}),style0$8={"auth-error":"pb-w-sync_auth-error","icon-eye":"pb-w-sync_icon-eye","show-hide":"pb-w-sync_show-hide","site-buttons":"pb-w-sync_site-buttons","site-form-header":"pb-w-sync_site-form-header","site-cover":"pb-w-sync_site-cover","site-tabs":"pb-w-sync_site-tabs","site-switch":"pb-w-sync_site-switch","widget-form-loader":"pb-w-sync_widget-form-loader"},cssModules$8={$style:style0$8},SiteForm=_export_sfc(_sfc_main$9,[["__cssModules",cssModules$8]]),_hoisted_1$3=["alt","src"],_hoisted_2$3=["onClick"],_sfc_main$8=defineComponent({__name:"SitesList",props:{assetsPath:{},items:{},organization:{},showLogo:{type:Boolean}},emits:["back","select"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter);onMounted(()=>{n.showLogo&&s("images-loading")});function o(){s("images-loaded")}function c(f){a("select",f)}return(f,y)=>(openBlock(),createElementBlock("div",{class:normalizeClass(f.$style["sites-container"])},[f.showLogo?(openBlock(),createElementBlock("img",{key:0,class:normalizeClass(f.$style["organization-cover"]),alt:f.organization.name,src:`${f.assetsPath}${f.organization.cover}`,width:"1600",height:"480",onLoad:o},null,42,_hoisted_1$3)):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass(f.$style.sites)},[(openBlock(!0),createElementBlock(Fragment,null,renderList(f.items,(m,g)=>(openBlock(),createElementBlock("button",{key:`${m.id_site}-${g}`,type:"button",onClick:()=>c(m)},toDisplayString$1(m.name),9,_hoisted_2$3))),128)),createBaseVNode("button",{type:"button",onClick:y[0]||(y[0]=()=>a("back"))},toDisplayString$1(f.$t("common.back")),1)],2)],2))}}),sites="pb-w-sync_sites",style0$7={"organization-cover":"pb-w-sync_organization-cover","sites-container":"pb-w-sync_sites-container",sites},cssModules$7={$style:style0$7},SitesList=_export_sfc(_sfc_main$8,[["__cssModules",cssModules$7]]),_sfc_main$7=defineComponent({__name:"TheModal",props:{mobile:{type:Boolean,default:!1},visible:{type:Boolean,default:!1}},emits:["update:visible"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter);function o(){measureEvent("close"),a("update:visible",!1),s("closed")}return(c,f)=>withDirectives((openBlock(),createElementBlock("div",{class:normalizeClass(c.$style["modal-container"])},[createBaseVNode("div",{class:normalizeClass(c.$style["modal-overlay-backdrop"]),onClick:o},null,2),createBaseVNode("div",{class:normalizeClass(c.$style["modal-wrapper"])},[createBaseVNode("div",{class:normalizeClass([c.$style.modal,{[c.$style["is-mobile"]]:n.mobile}])},[renderSlot(c.$slots,"default")],2)],2)],2)),[[vShow,c.visible]])}}),modal="pb-w-sync_modal",style0$6={"modal-container":"pb-w-sync_modal-container","modal-wrapper":"pb-w-sync_modal-wrapper","modal-overlay-backdrop":"pb-w-sync_modal-overlay-backdrop",modal,"is-mobile":"pb-w-sync_is-mobile"},cssModules$6={$style:style0$6},TheModal=_export_sfc(_sfc_main$7,[["__cssModules",cssModules$6]]),_hoisted_1$2=["onClick"],_hoisted_2$2=["src"],_sfc_main$6=defineComponent({__name:"MultipleImages",props:{credential:{default:()=>({type:"options",name:"token",label:"Por favor, revisa las imágenes que se te presentan y selecciona la correcta",options:[]})},modelValue:{default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter);let o=0;const c=computed(()=>{const m=Math.sqrt(n.credential.options.length);return m%1===0?[m,m]:f(Math.floor(m))});onMounted(()=>{s("images-loading")});function f(m){if(n.credential.options.length%m===0){const g=n.credential.options.length/m;return[m,g]}return f(m-1)}function y(){o++,o===n.credential.options.length&&s("images-loaded")}return(m,g)=>(openBlock(),createElementBlock("div",{class:normalizeClass(m.$style["multiple-images-container"])},[createBaseVNode("div",{class:normalizeClass(m.$style["multiple-images-wrapper"])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(c.value[0],z=>(openBlock(),createElementBlock("div",{key:z,class:normalizeClass(m.$style["credential-options-row"])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(c.value[1],ie=>(openBlock(),createElementBlock("div",{key:ie,class:normalizeClass([m.$style["credential-options-col"],{[m.$style.selected]:m.modelValue===m.credential.options[ie-1+(z-1)*c.value[1]].value}]),onClick:re=>a("update:modelValue",m.credential.options[ie-1+(z-1)*c.value[1]].value)},[createBaseVNode("img",{class:normalizeClass(m.$style["credental-options-img"]),src:m.credential.options[ie-1+(z-1)*c.value[1]].imgBase64File||m.credential.options[ie-1+(z-1)*c.value[1]].imgURL,onLoad:y},null,42,_hoisted_2$2)],10,_hoisted_1$2))),128))],2))),128))],2)],2))}}),selected="pb-w-sync_selected",style0$5={"multiple-images-container":"pb-w-sync_multiple-images-container","multiple-images-wrapper":"pb-w-sync_multiple-images-wrapper","credential-options-row":"pb-w-sync_credential-options-row","credential-options-col":"pb-w-sync_credential-options-col",selected,"credental-options-img":"pb-w-sync_credental-options-img"},cssModules$5={$style:style0$5},MultipleImages=_export_sfc(_sfc_main$6,[["__cssModules",cssModules$5]]),_hoisted_1$1={key:1},_hoisted_2$1=["alt","src"],_hoisted_3$1={key:0},_hoisted_4$1=["src"],_hoisted_5={key:1},_hoisted_6=["src","onLoad"],_hoisted_7=["aria-label"],_hoisted_8=["disabled"],_sfc_main$5=defineComponent({__name:"TwofaForm",props:{avatar:{},buttonDisabledStyle:{type:Boolean},cover:{},disableFormAutocomplete:{type:Boolean},enableBackNavigation:{type:Boolean},inNotification:{type:Boolean},loaderMessage:{},selectClass:{},siteName:{},showLogo:{type:Boolean},showPasswordStyle:{},twofa:{}},emits:["back","error"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),o=inject(translateFunction),c=ref({}),f=ref({...n.twofa.data}),y=ref({}),m=ref([]),g=ref(!1);let z=0,ie=!0,re=!1,he={};const _e=computed(()=>n.twofa.config.twofa.reduce((Y,ae)=>ae.imgBase64File?Y+1:Y,0)),$e=ref(null),pe=ref(null);watch(()=>n.twofa,()=>{Ie()});function Ce(){Ie()}function Oe(Y){return y.value[Y]||{}}function qe(Y){return!!f[Y]}function At(Y){const ae=m.value[Y];ae&&(y.value={...y.value,[Y]:{width:`${ae.naturalWidth}px`}},nextTick(ze))}function Et(){$e.value&&$e.value[0].focus()}function ze(){z++,z===_e.value&&s("images-loaded")}function kt(){const Y={};n.twofa.config.twofa&&n.twofa.config.twofa.length&&n.twofa.config.twofa.forEach(ae=>{ae.type==="accounts"&&(Y[ae.name]=[])}),c.value=Y}function Pt(Y){return["text","password","textOptions","accounts","options"].includes(Y)}function jt(Y){f.value={...f.value,[Y]:c.value[Y].join()}}function Ie(){c.value={},f.value={...n.twofa.data},y.value={},m.value=[],g.value=!1,z=0,ie=!0,re=!1,he={},n.twofa.defineRules(o),kt(),n.twofa.on("loading",()=>{g.value=!0}),n.twofa.on("twofa-device-error",Y=>{a("error",Y)}),n.twofa.on("token-received",()=>{f.value={...n.twofa.data}}),_e.value&&s("images-loading"),v(),n.twofa.config.twofa.forEach(Y=>{["connection","challenge"].includes(Y.type)&&v(Y.name,!0)}),nextTick(()=>{Et()})}function u(){pe.value.validate(Y=>{Y&&(s("submitted"),n.twofa.authenticate({...f.value}).then(ae=>ae).catch(ae=>{a("error",ae)}))})}function v(Y,ae){const xe=toRaw(n.twofa.rules);Y&&(he[Y]=ae),ie=Object.getOwnPropertyNames(xe).reduce((Ve,Ue)=>Ue==="__ob__"||xe[Ue].length===0?Ve:Ve||!he[Ue],!1)}return Ce(),(Y,ae)=>g.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Y.$style["twofa-form-loader"])},[createVNode(AppLoader,{avatar:Y.showLogo?Y.avatar:void 0,message:n.loaderMessage.long,title:n.loaderMessage.short,size:"large",onImagesLoaded:ae[0]||(ae[0]=()=>unref(s)("images-loaded")),onImagesLoading:ae[1]||(ae[1]=()=>unref(s)("images-loading"))},null,8,["avatar","message","title"])],2)):(openBlock(),createElementBlock("div",_hoisted_1$1,[Y.inNotification?createCommentVNode("",!0):(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Y.$style["twofa-form-header"])},[Y.showLogo?(openBlock(),createElementBlock("img",{key:0,alt:Y.siteName,class:normalizeClass(Y.$style["twofa-cover"]),src:Y.cover,width:"1600",height:"480",onLoad:ze},null,42,_hoisted_2$1)):createCommentVNode("",!0),createBaseVNode("h2",null,toDisplayString$1(Y.siteName),1)],2)),n.twofa?(openBlock(),createBlock(unref(ElForm),{key:1,ref_key:"twofaForm",ref:pe,"data-testid":"twofa-form","label-position":"top",disabled:g.value,model:f.value,rules:toRaw(n.twofa.rules),name:`twofa-${n.twofa.config.id_site}`,autocomplete:n.disableFormAutocomplete?"off":"on",onSubmit:withModifiers(u,["prevent"]),onValidate:v},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(n.twofa.config.twofa,(xe,Ve)=>(openBlock(),createElementBlock(Fragment,{key:`${Ve}-${xe.name}`},[xe.type==="externalAction"?(openBlock(),createElementBlock("div",_hoisted_3$1,[createBaseVNode("label",{class:normalizeClass(Y.$style["external-action-label"])},toDisplayString$1(xe.label),3),createBaseVNode("div",{class:normalizeClass(Y.$style["external-action-img-container"])},[xe.imgBase64File?(openBlock(),createElementBlock("img",{key:0,alt:"",src:xe.imgBase64File,onLoad:ze},null,40,_hoisted_4$1)):createCommentVNode("",!0)],2)])):xe.type==="instructions"?(openBlock(),createElementBlock("div",_hoisted_5,[createBaseVNode("label",{class:normalizeClass(Y.$style["external-action-label"])},toDisplayString$1(xe.label),3)])):createCommentVNode("",!0),Pt(xe.type)?(openBlock(),createBlock(unref(ElFormItem),{key:2,label:xe.label,prop:xe.name,for:`twofa-${n.twofa.config.id_site}[${xe.name}]`},{default:withCtx(()=>[xe.imgBase64File?(openBlock(),createElementBlock("img",{key:0,ref_for:!0,ref_key:"imageWithoutSize",ref:m,src:xe.imgBase64File,class:normalizeClass(Y.$style["input-image"]),style:normalizeStyle(Oe(Ve)),alt:"",onLoad:Ue=>At(Ve)},null,46,_hoisted_6)):createCommentVNode("",!0),xe.type==="text"||xe.type==="password"?(openBlock(),createBlock(unref(ElInput),{key:1,ref_for:!0,ref:Ve===0&&"firstInput",modelValue:f.value[xe.name],"onUpdate:modelValue":Ue=>f.value[xe.name]=Ue,"data-testid":"twofa-input",name:`twofa-${n.twofa.config.id_site}[${xe.name}]`,autocomplete:xe.name==="password"?`${n.twofa.config.id_site} new-password`:n.disableFormAutocomplete?"off":`${n.twofa.config.id_site} ${xe.name}`,disabled:xe.disabled,type:xe.type==="password"&&unref(re)?"text":xe.type},createSlots({_:2},[xe.type==="password"&&n.showPasswordStyle==="icon"?{name:"append",fn:withCtx(()=>[createBaseVNode("button",{class:normalizeClass(Y.$style["icon-eye-twofa"]),"aria-label":unref(o)(`common.${unref(re)?"hide":"show_password"}`),type:"button",onClick:ae[2]||(ae[2]=()=>{isRef(re)?re.value=!unref(re):re=!unref(re)})},[unref(re)?(openBlock(),createBlock(_sfc_main$h,{key:1,icon:"eye-slash"})):(openBlock(),createBlock(_sfc_main$h,{key:0,icon:"eye"}))],10,_hoisted_7)]),key:"0"}:void 0]),1032,["modelValue","onUpdate:modelValue","name","autocomplete","disabled","type"])):createCommentVNode("",!0),xe.type==="textOptions"?(openBlock(),createBlock(unref(ElSelect),{key:2,ref_for:!0,ref:Ve===0&&"firstInput",modelValue:f.value[xe.name],"onUpdate:modelValue":Ue=>f.value[xe.name]=Ue,"data-testid":"twofa-select",autocomplete:n.disableFormAutocomplete?"off":`twofa-${n.twofa.config.id_site} ${xe.name}`,name:`twofa-${n.twofa.config.id_site}[${xe.name}]`,"popper-class":n.selectClass},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(xe.options,(Ue,Ne)=>(openBlock(),createBlock(unref(ElOption),{key:Ne,value:Ue.value,label:Ue.label},null,8,["value","label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","autocomplete","name","popper-class"])):createCommentVNode("",!0),xe.type==="accounts"?(openBlock(),createBlock(unref(ElSelect),{key:3,ref_for:!0,ref:Ve===0&&"firstInput",modelValue:c.value[xe.name],"onUpdate:modelValue":Ue=>c.value[xe.name]=Ue,"data-testid":"twofa-multi-select",autocomplete:n.disableFormAutocomplete?"off":`twofa-${n.twofa.config.id_site} ${xe.name}`,filterable:"",multiple:"",name:`twofa-${n.twofa.config.id_site}[${xe.name}]`,"popper-class":n.selectClass,onChange:()=>jt(xe.name)},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(xe.options,(Ue,Ne)=>(openBlock(),createBlock(unref(ElOption),{key:Ne,value:Ue.value,label:Ue.label},null,8,["value","label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","autocomplete","name","popper-class","onChange"])):createCommentVNode("",!0),xe.type==="options"?(openBlock(),createBlock(MultipleImages,{key:4,modelValue:f.value[xe.name],"onUpdate:modelValue":[Ue=>f.value[xe.name]=Ue,()=>{v(xe.name,!0)}],credential:xe},null,8,["modelValue","onUpdate:modelValue","credential"])):createCommentVNode("",!0)]),_:2},1032,["label","prop","for"])):createCommentVNode("",!0),xe.type==="password"&&n.showPasswordStyle==="text"&&qe(xe.name)?(openBlock(),createBlock(unref(ElButton),{key:`${Ve}-${xe.name}-toggle`,class:normalizeClass(Y.$style["show-hide"]),"native-type":"button",onClick:ae[3]||(ae[3]=()=>{isRef(re)?re.value=!unref(re):re=!unref(re)})},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(o)(`common.${unref(re)?"hide":"show_password"}`)),1)]),_:2},1032,["class"])):createCommentVNode("",!0)],64))),128)),createBaseVNode("div",{class:normalizeClass(Y.$style["twofa-buttons"])},[n.enableBackNavigation?(openBlock(),createElementBlock("button",{key:0,class:"pb-w-sync_secondary-button","data-testid":"twofa-back",type:"button",onClick:ae[4]||(ae[4]=()=>{a("back")})},toDisplayString$1(unref(o)("common.back")),1)):createCommentVNode("",!0),n.twofa.displaySubmitButton?(openBlock(),createElementBlock("button",{key:1,class:"pb-w-sync_primary-button",disabled:n.buttonDisabledStyle&&unref(ie),"data-testid":"twofa-button",type:"submit"},toDisplayString$1(unref(o)("common.next")),9,_hoisted_8)):createCommentVNode("",!0)],2)]),_:1},8,["disabled","model","rules","name","autocomplete"])):createCommentVNode("",!0)]))}}),style0$4={"external-action-img-container":"pb-w-sync_external-action-img-container","external-action-label":"pb-w-sync_external-action-label","icon-eye-twofa":"pb-w-sync_icon-eye-twofa","input-image":"pb-w-sync_input-image","show-hide":"pb-w-sync_show-hide","twofa-buttons":"pb-w-sync_twofa-buttons","twofa-form-header":"pb-w-sync_twofa-form-header","twofa-cover":"pb-w-sync_twofa-cover","twofa-form-loader":"pb-w-sync_twofa-form-loader"},cssModules$4={$style:style0$4},TwofaForm=_export_sfc(_sfc_main$5,[["__cssModules",cssModules$4]]),_sfc_main$4=defineComponent({__name:"TwofaNotification",props:{assetsPath:{default:"https://s.paybook.com"},buttonDisabledStyle:{type:Boolean,default:!1},disableFormAutocomplete:{type:Boolean,default:!1},displayLongDescription:{type:Boolean,default:!1},duration:{},enableBackNavigation:{type:Boolean,default:!1},hideForm:{type:Boolean,default:!1},initLongMessage:{default:null},initMessage:{default:null},initTitle:{default:""},item:{default:null},messagesUpdater:{default:null},rootEmit:{type:Function,default:null},selectClass:{default:""},showLogo:{type:Boolean,default:!1},showPasswordStyle:{default:"icon"},t:{},type:{}},emits:["back","error","imagesLoaded","imagesLoading"],setup(e,{emit:t}){var _e,$e,pe,Ce;const n=e,a=t;provide(rootEmitter,n.rootEmit),provide(translateFunction,n.t);let s=ref(n.initLongMessage||((_e=n.messagesUpdater)==null?void 0:_e.getMessages().long)||""),o=ref(n.initMessage||(($e=n.messagesUpdater)==null?void 0:$e.getMessages().short)||""),c=ref(n.displayLongDescription||!1),f=ref((pe=n.item)==null?void 0:pe.status),y=ref((Ce=n.item)!=null&&Ce.config?n.item.config.name:n.initTitle);const m=computed(()=>n.item&&n.item.config?`${n.assetsPath}${n.item.config.avatar}`:""),g=computed(()=>n.item&&n.item.config?`${n.assetsPath}${n.item.config.cover}`:""),z=computed(()=>n.item?f.value==="twofa"&&!n.hideForm:!1),ie=computed(()=>n.item?n.type==="info"&&f.value!=="twofa":n.type==="info");function re(){n.messagesUpdater&&n.messagesUpdater.subscribe(()=>{const Oe=n.messagesUpdater.getMessages();s.value=Oe.long,o.value=Oe.short}),n.item&&(n.item.on("twofa",()=>{f.value="twofa"}),n.item.on("twofa-loading",()=>{f.value="twofa-loading"}))}function he(){c.value=!c.value}return re(),(Oe,qe)=>(openBlock(),createElementBlock("div",{class:normalizeClass(Oe.$style["twofa-notification"])},[createBaseVNode("div",{class:normalizeClass(Oe.$style["site-identifier"])},[ie.value||Oe.showLogo?(openBlock(),createBlock(AppLoader,{key:0,class:normalizeClass(Oe.$style["notification-loader"]),avatar:Oe.showLogo?m.value:void 0,type:n.type==="info"?"loading":n.type,onImagesLoaded:qe[0]||(qe[0]=()=>a("imagesLoaded")),onImagesLoading:qe[1]||(qe[1]=()=>a("imagesLoading"))},null,8,["class","avatar","type"])):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass([Oe.$style["site-identifier-description"],{[Oe.$style["with-loader"]]:ie.value||Oe.showLogo}])},[createBaseVNode("span",{class:normalizeClass([Oe.$style["site-name"],Oe.$style[n.type]])},toDisplayString$1(unref(y)),3),createBaseVNode("p",{class:normalizeClass(Oe.$style["site-identifier-message"])},toDisplayString$1(unref(o)),3),unref(c)?(openBlock(),createElementBlock("p",{key:0,class:normalizeClass(Oe.$style["site-identifier-long-message"])},toDisplayString$1(unref(s)),3)):createCommentVNode("",!0),n.type!=="info"?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(Oe.$style["widget-notification-show-more-container"])},[unref(s)?(openBlock(),createBlock(unref(ElLink),{key:0,type:"primary",onClick:withModifiers(he,["stop"])},{default:withCtx(()=>[createTextVNode(toDisplayString$1(n.t("common.show",{msg:n.t(`common.${unref(c)?"less":"more"}`)})),1)]),_:1})):createCommentVNode("",!0)],2)):createCommentVNode("",!0)],2)],2),z.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Oe.$style["notification-form"])},[createVNode(TwofaForm,{avatar:m.value,"button-disabled-style":Oe.buttonDisabledStyle,cover:g.value,"disable-form-autocomplete":Oe.disableFormAutocomplete,"enable-back-navigation":Oe.enableBackNavigation,"in-notification":!0,"loader-message":{long:unref(s),short:unref(o)},"select-class":Oe.selectClass,"show-logo":Oe.showLogo,"show-password-style":Oe.showPasswordStyle,"site-name":unref(y),twofa:n.item.twofa,onBack:qe[2]||(qe[2]=()=>a("back")),onError:qe[3]||(qe[3]=At=>a("error",At))},null,8,["avatar","button-disabled-style","cover","disable-form-autocomplete","enable-back-navigation","loader-message","select-class","show-logo","show-password-style","site-name","twofa"])],2)):createCommentVNode("",!0)],2))}}),error="pb-w-sync_error",success="pb-w-sync_success",style0$3={"notification-form":"pb-w-sync_notification-form","notification-loader":"pb-w-sync_notification-loader","site-identifier":"pb-w-sync_site-identifier","site-identifier-description":"pb-w-sync_site-identifier-description","with-loader":"pb-w-sync_with-loader","site-name":"pb-w-sync_site-name",error,success,"site-identifier-long-message":"pb-w-sync_site-identifier-long-message","site-identifier-message":"pb-w-sync_site-identifier-message","twofa-notification":"pb-w-sync_twofa-notification","widget-notification-show-more-container":"pb-w-sync_widget-notification-show-more-container"},cssModules$3={$style:style0$3},TwofaNotification=_export_sfc(_sfc_main$4,[["__cssModules",cssModules$3]]),_sfc_main$3=defineComponent({__name:"UnauthorizedNotification",props:{initMessage:{default:""},initTitle:{default:""},refreshTokenFunction:{},t:{}},emits:["closed","closeNotification","refreshToken","refreshTokenError"],setup(e,{emit:t}){const n=e,a=t;let s=ref(!1);onBeforeUnmount(()=>{a("closed")});function o(){s.value=!0,n.refreshTokenFunction().then(({token:c,strict:f})=>{if(typeof c!="string")throw new Error("Refresh token is not valid. Promise should return a valid token.");return new Promise(y=>{a("refreshToken",{token:c,strict:f,resolve:y})})}).catch(()=>{a("refreshTokenError")}).finally(()=>{s.value=!1})}return(c,f)=>(openBlock(),createElementBlock("div",{class:normalizeClass(c.$style["unauthorized-notification"])},[createBaseVNode("span",null,toDisplayString$1(n.initTitle),1),createBaseVNode("p",null,toDisplayString$1(n.initMessage),1),createBaseVNode("div",{class:normalizeClass(c.$style["unauthorized-button-container"])},[withDirectives((openBlock(),createBlock(unref(ElButton),{disabled:unref(s),type:"primary",onClick:withModifiers(o,["stop"])},{default:withCtx(()=>[createTextVNode(toDisplayString$1(n.t("common.refresh")),1)]),_:1},8,["disabled"])),[[unref(vLoading),unref(s)]]),createVNode(unref(ElButton),{disabled:unref(s),onClick:f[0]||(f[0]=withModifiers(()=>{a("closeNotification")},["stop"]))},{default:withCtx(()=>[createTextVNode(toDisplayString$1(n.t("common.cancel")),1)]),_:1},8,["disabled"])],2)],2))}}),style0$2={"unauthorized-notification":"pb-w-sync_unauthorized-notification","unauthorized-button-container":"pb-w-sync_unauthorized-button-container"},cssModules$2={$style:style0$2},UnauthorizedNotification=_export_sfc(_sfc_main$3,[["__cssModules",cssModules$2]]);var LIBVERSION="2.0.4",UA_MAX_LENGTH=500,USER_AGENT="user-agent",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",UA_BROWSER="browser",UA_CPU="cpu",UA_DEVICE="device",UA_ENGINE="engine",UA_OS="os",UA_RESULT="result",NAME="name",TYPE="type",VENDOR="vendor",VERSION$2="version",ARCHITECTURE="architecture",MAJOR="major",MODEL="model",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",XR="xr",EMBEDDED="embedded",INAPP="inapp",BRANDS="brands",FORMFACTORS="formFactors",FULLVERLIST="fullVersionList",PLATFORM="platform",PLATFORMVER="platformVersion",BITNESS="bitness",CH_HEADER="sec-ch-ua",CH_HEADER_FULL_VER_LIST=CH_HEADER+"-full-version-list",CH_HEADER_ARCH=CH_HEADER+"-arch",CH_HEADER_BITNESS=CH_HEADER+"-"+BITNESS,CH_HEADER_FORM_FACTORS=CH_HEADER+"-form-factors",CH_HEADER_MOBILE=CH_HEADER+"-"+MOBILE,CH_HEADER_MODEL=CH_HEADER+"-"+MODEL,CH_HEADER_PLATFORM=CH_HEADER+"-"+PLATFORM,CH_HEADER_PLATFORM_VER=CH_HEADER_PLATFORM+"-version",CH_ALL_VALUES=[BRANDS,FULLVERLIST,MOBILE,MODEL,PLATFORM,PLATFORMVER,ARCHITECTURE,FORMFACTORS,BITNESS],AMAZON="Amazon",APPLE="Apple",ASUS="ASUS",BLACKBERRY="BlackBerry",GOOGLE="Google",HUAWEI="Huawei",LENOVO="Lenovo",HONOR="Honor",LG="LG",MICROSOFT="Microsoft",MOTOROLA="Motorola",NVIDIA="Nvidia",ONEPLUS="OnePlus",OPPO="OPPO",SAMSUNG="Samsung",SHARP="Sharp",SONY="Sony",XIAOMI="Xiaomi",ZEBRA="Zebra",CHROME="Chrome",CHROMIUM="Chromium",CHROMECAST="Chromecast",EDGE="Edge",FIREFOX="Firefox",OPERA="Opera",FACEBOOK="Facebook",SOGOU="Sogou",PREFIX_MOBILE="Mobile ",SUFFIX_BROWSER=" Browser",WINDOWS="Windows",isWindow=typeof window!==UNDEF_TYPE,NAVIGATOR=isWindow&&window.navigator?window.navigator:void 0,NAVIGATOR_UADATA=NAVIGATOR&&NAVIGATOR.userAgentData?NAVIGATOR.userAgentData:void 0,extend$1=function(e,t){var n={},a=t;if(!isExtensions(t)){a={};for(var s in t)for(var o in t[s])a[o]=t[s][o].concat(a[o]?a[o]:[])}for(var c in e)n[c]=a[c]&&a[c].length%2===0?a[c].concat(e[c]):e[c];return n},enumerize=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},has=function(e,t){if(typeof e===OBJ_TYPE&&e.length>0){for(var n in e)if(lowerize(t)==lowerize(e[n]))return!0;return!1}return isString$1(e)?lowerize(t)==lowerize(e):!1},isExtensions=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||(t?isExtensions(e[n]):!1)},isString$1=function(e){return typeof e===STR_TYPE},itemListToArray=function(e){if(e){for(var t=[],n=strip(/\\?\"/g,e).split(","),a=0;a<n.length;a++)if(n[a].indexOf(";")>-1){var s=trim$1(n[a]).split(";v=");t[a]={brand:s[0],version:s[1]}}else t[a]=trim$1(n[a]);return t}},lowerize=function(e){return isString$1(e)?e.toLowerCase():e},majorize=function(e){return isString$1(e)?strip(/[^\d\.]/g,e).split(".")[0]:void 0},setProps=function(e){for(var t in e){var n=e[t];typeof n==OBJ_TYPE&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},strip=function(e,t){return isString$1(t)?t.replace(e,EMPTY):t},stripQuotes=function(e){return strip(/\\?\"/g,e)},trim$1=function(e,t){if(isString$1(e))return e=strip(/^\s\s*/,e),typeof t===UNDEF_TYPE?e:e.substring(0,UA_MAX_LENGTH)},rgxMapper=function(e,t){if(!(!e||!t))for(var n=0,a,s,o,c,f,y;n<t.length&&!f;){var m=t[n],g=t[n+1];for(a=s=0;a<m.length&&!f&&m[a];)if(f=m[a++].exec(e),f)for(o=0;o<g.length;o++)y=f[++s],c=g[o],typeof c===OBJ_TYPE&&c.length>0?c.length===2?typeof c[1]==FUNC_TYPE?this[c[0]]=c[1].call(this,y):this[c[0]]=c[1]:c.length>=3&&(typeof c[1]===FUNC_TYPE&&!(c[1].exec&&c[1].test)?c.length>3?this[c[0]]=y?c[1].apply(this,c.slice(2)):void 0:this[c[0]]=y?c[1].call(this,y,c[2]):void 0:c.length==3?this[c[0]]=y?y.replace(c[1],c[2]):void 0:c.length==4?this[c[0]]=y?c[3].call(this,y.replace(c[1],c[2])):void 0:c.length>4&&(this[c[0]]=y?c[3].apply(this,[y.replace(c[1],c[2])].concat(c.slice(4))):void 0)):this[c]=y||void 0;n+=2}},strMapper=function(e,t){for(var n in t)if(typeof t[n]===OBJ_TYPE&&t[n].length>0){for(var a=0;a<t[n].length;a++)if(has(t[n][a],e))return n===UNKNOWN?void 0:n}else if(has(t[n],e))return n===UNKNOWN?void 0:n;return t.hasOwnProperty("*")?t["*"]:e},windowsVersionMap={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},formFactorsMap={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},browserHintsMap={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},defaultRegexes={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[VERSION$2,[NAME,PREFIX_MOBILE+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[VERSION$2,[NAME,EDGE+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[VERSION$2,[NAME,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[NAME,VERSION$2],[/opios[\/ ]+([\w\.]+)/i],[VERSION$2,[NAME,OPERA+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[VERSION$2,[NAME,OPERA+" GX"]],[/\bopr\/([\w\.]+)/i],[VERSION$2,[NAME,OPERA]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[VERSION$2,[NAME,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[VERSION$2,[NAME,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[NAME,VERSION$2],[/quark(?:pc)?\/([-\w\.]+)/i],[VERSION$2,[NAME,"Quark"]],[/\bddg\/([\w\.]+)/i],[VERSION$2,[NAME,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[VERSION$2,[NAME,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[VERSION$2,[NAME,"WeChat"]],[/konqueror\/([\w\.]+)/i],[VERSION$2,[NAME,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[VERSION$2,[NAME,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[VERSION$2,[NAME,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[VERSION$2,[NAME,"Smart "+LENOVO+SUFFIX_BROWSER]],[/(avast|avg)\/([\w\.]+)/i],[[NAME,/(.+)/,"$1 Secure"+SUFFIX_BROWSER],VERSION$2],[/\bfocus\/([\w\.]+)/i],[VERSION$2,[NAME,FIREFOX+" Focus"]],[/\bopt\/([\w\.]+)/i],[VERSION$2,[NAME,OPERA+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[VERSION$2,[NAME,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[VERSION$2,[NAME,"Dolphin"]],[/coast\/([\w\.]+)/i],[VERSION$2,[NAME,OPERA+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[VERSION$2,[NAME,"MIUI"+SUFFIX_BROWSER]],[/fxios\/([\w\.-]+)/i],[VERSION$2,[NAME,PREFIX_MOBILE+FIREFOX]],[/\bqihoobrowser\/?([\w\.]*)/i],[VERSION$2,[NAME,"360"]],[/\b(qq)\/([\w\.]+)/i],[[NAME,/(.+)/,"$1Browser"],VERSION$2],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[NAME,/(.+)/,"$1"+SUFFIX_BROWSER],VERSION$2],[/samsungbrowser\/([\w\.]+)/i],[VERSION$2,[NAME,SAMSUNG+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[VERSION$2,[NAME,SOGOU+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[NAME,SOGOU+" Mobile"],VERSION$2],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[NAME,VERSION$2],[/(lbbrowser|rekonq)/i],[NAME],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[VERSION$2,NAME],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[NAME,FACEBOOK],VERSION$2,[TYPE,INAPP]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[NAME,VERSION$2,[TYPE,INAPP]],[/\bgsa\/([\w\.]+) .*safari\//i],[VERSION$2,[NAME,"GSA"],[TYPE,INAPP]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[VERSION$2,[NAME,"TikTok"],[TYPE,INAPP]],[/\[(linkedin)app\]/i],[NAME,[TYPE,INAPP]],[/(chromium)[\/ ]([-\w\.]+)/i],[NAME,VERSION$2],[/headlesschrome(?:\/([\w\.]+)| )/i],[VERSION$2,[NAME,CHROME+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[VERSION$2,[NAME,EDGE+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[NAME,CHROME+" WebView"],VERSION$2],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[VERSION$2,[NAME,"Android"+SUFFIX_BROWSER]],[/chrome\/([\w\.]+) mobile/i],[VERSION$2,[NAME,PREFIX_MOBILE+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[NAME,VERSION$2],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[VERSION$2,[NAME,PREFIX_MOBILE+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[NAME,PREFIX_MOBILE+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[VERSION$2,NAME],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[NAME,[VERSION$2,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[NAME,VERSION$2],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[NAME,PREFIX_MOBILE+FIREFOX],VERSION$2],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[NAME,"Netscape"],VERSION$2],[/(wolvic|librewolf)\/([\w\.]+)/i],[NAME,VERSION$2],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[VERSION$2,[NAME,FIREFOX+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[NAME,[VERSION$2,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[NAME,[VERSION$2,/[^\d\.]+./,EMPTY]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[ARCHITECTURE,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[ARCHITECTURE,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[ARCHITECTURE,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[ARCHITECTURE,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[ARCHITECTURE,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[ARCHITECTURE,/ower/,EMPTY,lowerize]],[/ sun4\w[;\)]/i],[[ARCHITECTURE,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[ARCHITECTURE,lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,TABLET]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,MOBILE]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[MODEL,[VENDOR,APPLE],[TYPE,MOBILE]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[MODEL,[VENDOR,APPLE],[TYPE,TABLET]],[/(macintosh);/i],[MODEL,[VENDOR,APPLE]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[MODEL,[VENDOR,SHARP],[TYPE,MOBILE]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[MODEL,[VENDOR,HONOR],[TYPE,TABLET]],[/honor([-\w ]+)[;\)]/i],[MODEL,[VENDOR,HONOR],[TYPE,MOBILE]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,TABLET]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,MOBILE]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,TABLET]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,MOBILE]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[MODEL,[VENDOR,ONEPLUS],[TYPE,MOBILE]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[MODEL,[VENDOR,OPPO],[TYPE,MOBILE]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[MODEL,[VENDOR,strMapper,{OnePlus:["203","304","403","404","413","415"],"*":OPPO}],[TYPE,TABLET]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[MODEL,[VENDOR,"BLU"],[TYPE,MOBILE]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[MODEL,[VENDOR,"Vivo"],[TYPE,MOBILE]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[MODEL,[VENDOR,"Realme"],[TYPE,MOBILE]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[MODEL,[VENDOR,LENOVO],[TYPE,TABLET]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[MODEL,[VENDOR,LENOVO],[TYPE,MOBILE]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[MODEL,[VENDOR,MOTOROLA],[TYPE,MOBILE]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[MODEL,[VENDOR,MOTOROLA],[TYPE,TABLET]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[MODEL,[VENDOR,LG],[TYPE,TABLET]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[MODEL,[VENDOR,LG],[TYPE,MOBILE]],[/(nokia) (t[12][01])/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[MODEL,/_/g," "],[TYPE,MOBILE],[VENDOR,"Nokia"]],[/(pixel (c|tablet))\b/i],[MODEL,[VENDOR,GOOGLE],[TYPE,TABLET]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[MODEL,[VENDOR,GOOGLE],[TYPE,MOBILE]],[/(google) (pixelbook( go)?)/i],[VENDOR,MODEL],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[MODEL,[VENDOR,SONY],[TYPE,MOBILE]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[MODEL,"Xperia Tablet"],[VENDOR,SONY],[TYPE,TABLET]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[MODEL,[VENDOR,AMAZON],[TYPE,TABLET]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[MODEL,/(.+)/g,"Fire Phone $1"],[VENDOR,AMAZON],[TYPE,MOBILE]],[/(playbook);[-\w\),; ]+(rim)/i],[MODEL,VENDOR,[TYPE,TABLET]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[MODEL,[VENDOR,BLACKBERRY],[TYPE,MOBILE]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[MODEL,[VENDOR,ASUS],[TYPE,TABLET]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[MODEL,[VENDOR,ASUS],[TYPE,MOBILE]],[/(nexus 9)/i],[MODEL,[VENDOR,"HTC"],[TYPE,TABLET]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[VENDOR,[MODEL,/_/g," "],[TYPE,MOBILE]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[MODEL,[VENDOR,"TCL"],[TYPE,TABLET]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[MODEL,[VENDOR,"TCL"],[TYPE,MOBILE]],[/(itel) ((\w+))/i],[[VENDOR,lowerize],MODEL,[TYPE,strMapper,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[MODEL,[VENDOR,"Acer"],[TYPE,TABLET]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[MODEL,[VENDOR,"Meizu"],[TYPE,MOBILE]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[MODEL,[VENDOR,"Ulefone"],[TYPE,MOBILE]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[MODEL,[VENDOR,"Energizer"],[TYPE,MOBILE]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[MODEL,[VENDOR,"Cat"],[TYPE,MOBILE]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[MODEL,[VENDOR,"Smartfren"],[TYPE,MOBILE]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[MODEL,[VENDOR,"Nothing"],[TYPE,MOBILE]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[MODEL,[VENDOR,"Archos"],[TYPE,TABLET]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[MODEL,[VENDOR,"Archos"],[TYPE,MOBILE]],[/; (n159v)/i],[MODEL,[VENDOR,"HMD"],[TYPE,MOBILE]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(surface duo)/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,TABLET]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[MODEL,[VENDOR,"Fairphone"],[TYPE,MOBILE]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[MODEL,[VENDOR,NVIDIA],[TYPE,TABLET]],[/(sprint) (\w+)/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kin\.[onetw]{3})/i],[[MODEL,/\./g," "],[VENDOR,MICROSOFT],[TYPE,MOBILE]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,TABLET]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,MOBILE]],[/smart-tv.+(samsung)/i],[VENDOR,[TYPE,SMARTTV]],[/hbbtv.+maple;(\d+)/i],[[MODEL,/^/,"SmartTV"],[VENDOR,SAMSUNG],[TYPE,SMARTTV]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[VENDOR,MODEL,[TYPE,SMARTTV]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[VENDOR,LG],[TYPE,SMARTTV]],[/(apple) ?tv/i],[VENDOR,[MODEL,APPLE+" TV"],[TYPE,SMARTTV]],[/crkey.*devicetype\/chromecast/i],[[MODEL,CHROMECAST+" Third Generation"],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/crkey.*devicetype\/([^/]*)/i],[[MODEL,/^/,"Chromecast "],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/fuchsia.*crkey/i],[[MODEL,CHROMECAST+" Nest Hub"],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/crkey/i],[[MODEL,CHROMECAST],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/(portaltv)/i],[MODEL,[VENDOR,FACEBOOK],[TYPE,SMARTTV]],[/droid.+aft(\w+)( bui|\))/i],[MODEL,[VENDOR,AMAZON],[TYPE,SMARTTV]],[/(shield \w+ tv)/i],[MODEL,[VENDOR,NVIDIA],[TYPE,SMARTTV]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[MODEL,[VENDOR,SHARP],[TYPE,SMARTTV]],[/(bravia[\w ]+)( bui|\))/i],[MODEL,[VENDOR,SONY],[TYPE,SMARTTV]],[/(mi(tv|box)-?\w+) bui/i],[MODEL,[VENDOR,XIAOMI],[TYPE,SMARTTV]],[/Hbbtv.*(technisat) (.*);/i],[VENDOR,MODEL,[TYPE,SMARTTV]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[VENDOR,/.+\/(\w+)/,"$1",strMapper,{LG:"lge"}],[MODEL,trim$1],[TYPE,SMARTTV]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[MODEL,[TYPE,SMARTTV]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:|large screen[\w ]+safari)\b/i],[[TYPE,SMARTTV]],[/(playstation \w+)/i],[MODEL,[VENDOR,SONY],[TYPE,CONSOLE]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,CONSOLE]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[VENDOR,MODEL,[TYPE,CONSOLE]],[/droid.+; (shield)( bui|\))/i],[MODEL,[VENDOR,NVIDIA],[TYPE,CONSOLE]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,WEARABLE]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[VENDOR,MODEL,[TYPE,WEARABLE]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[MODEL,[VENDOR,OPPO],[TYPE,WEARABLE]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[MODEL,[VENDOR,APPLE],[TYPE,WEARABLE]],[/(opwwe\d{3})/i],[MODEL,[VENDOR,ONEPLUS],[TYPE,WEARABLE]],[/(moto 360)/i],[MODEL,[VENDOR,MOTOROLA],[TYPE,WEARABLE]],[/(smartwatch 3)/i],[MODEL,[VENDOR,SONY],[TYPE,WEARABLE]],[/(g watch r)/i],[MODEL,[VENDOR,LG],[TYPE,WEARABLE]],[/droid.+; (wt63?0{2,3})\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,WEARABLE]],[/droid.+; (glass) \d/i],[MODEL,[VENDOR,GOOGLE],[TYPE,XR]],[/(pico) (4|neo3(?: link|pro)?)/i],[VENDOR,MODEL,[TYPE,XR]],[/(quest( \d| pro)?s?).+vr/i],[MODEL,[VENDOR,FACEBOOK],[TYPE,XR]],[/mobile vr; rv.+firefox/i],[[TYPE,XR]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[VENDOR,[TYPE,EMBEDDED]],[/(aeobc)\b/i],[MODEL,[VENDOR,AMAZON],[TYPE,EMBEDDED]],[/(homepod).+mac os/i],[MODEL,[VENDOR,APPLE],[TYPE,EMBEDDED]],[/windows iot/i],[[TYPE,EMBEDDED]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[MODEL,[TYPE,strMapper,{mobile:"Mobile",xr:"VR","*":TABLET}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[TYPE,TABLET]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[TYPE,MOBILE]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[MODEL,[VENDOR,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[VERSION$2,[NAME,EDGE+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[NAME,VERSION$2],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[VERSION$2,[NAME,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[NAME,VERSION$2],[/ladybird\//i],[[NAME,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[VERSION$2,NAME]],os:[[/(windows nt) (6\.[23]); arm/i],[[NAME,/N/,"R"],[VERSION$2,strMapper,windowsVersionMap]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[NAME,VERSION$2],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[VERSION$2,/(;|\))/g,"",strMapper,windowsVersionMap],[NAME,WINDOWS]],[/(windows ce)\/?([\d\.]*)/i],[NAME,VERSION$2],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[VERSION$2,/_/g,"."],[NAME,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[NAME,"macOS"],[VERSION$2,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[VERSION$2,[NAME,CHROMECAST+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[VERSION$2,[NAME,CHROMECAST+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[VERSION$2,[NAME,CHROMECAST+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[VERSION$2,[NAME,CHROMECAST+" Linux"]],[/crkey\/([\d\.]+)/i],[VERSION$2,[NAME,CHROMECAST]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[VERSION$2,NAME],[/(ubuntu) ([\w\.]+) like android/i],[[NAME,/(.+)/,"$1 Touch"],VERSION$2],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[NAME,VERSION$2],[/\(bb(10);/i],[VERSION$2,[NAME,BLACKBERRY]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[VERSION$2,[NAME,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[VERSION$2,[NAME,FIREFOX+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[VERSION$2,[NAME,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[VERSION$2,strMapper,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[NAME,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[VERSION$2,[NAME,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[NAME,"Chrome OS"],VERSION$2],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[NAME,VERSION$2],[/(sunos) ?([\d\.]*)/i],[[NAME,"Solaris"],VERSION$2],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[NAME,VERSION$2]]},defaultProps=function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return setProps.call(e.init,[[UA_BROWSER,[NAME,VERSION$2,MAJOR,TYPE]],[UA_CPU,[ARCHITECTURE]],[UA_DEVICE,[TYPE,MODEL,VENDOR]],[UA_ENGINE,[NAME,VERSION$2]],[UA_OS,[NAME,VERSION$2]]]),setProps.call(e.isIgnore,[[UA_BROWSER,[VERSION$2,MAJOR]],[UA_ENGINE,[VERSION$2]],[UA_OS,[VERSION$2]]]),setProps.call(e.isIgnoreRgx,[[UA_BROWSER,/ ?browser$/i],[UA_OS,/ ?os$/i]]),setProps.call(e.toString,[[UA_BROWSER,[NAME,VERSION$2]],[UA_CPU,[ARCHITECTURE]],[UA_DEVICE,[VENDOR,MODEL]],[UA_ENGINE,[NAME,VERSION$2]],[UA_OS,[NAME,VERSION$2]]]),e}(),createIData=function(e,t){var n=defaultProps.init[t],a=defaultProps.isIgnore[t]||0,s=defaultProps.isIgnoreRgx[t]||0,o=defaultProps.toString[t]||0;function c(){setProps.call(this,n)}return c.prototype.getItem=function(){return e},c.prototype.withClientHints=function(){return NAVIGATOR_UADATA?NAVIGATOR_UADATA.getHighEntropyValues(CH_ALL_VALUES).then(function(f){return e.setCH(new UACHData(f,!1)).parseCH().get()}):e.parseCH().get()},c.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=UA_RESULT&&(c.prototype.is=function(f){var y=!1;for(var m in this)if(this.hasOwnProperty(m)&&!has(a,m)&&lowerize(s?strip(s,this[m]):this[m])==lowerize(s?strip(s,f):f)){if(y=!0,f!=UNDEF_TYPE)break}else if(f==UNDEF_TYPE&&y){y=!y;break}return y},c.prototype.toString=function(){var f=EMPTY;for(var y in o)typeof this[o[y]]!==UNDEF_TYPE&&(f+=(f?" ":EMPTY)+this[o[y]]);return f||UNDEF_TYPE}),NAVIGATOR_UADATA||(c.prototype.then=function(f){var y=this,m=function(){for(var z in y)y.hasOwnProperty(z)&&(this[z]=y[z])};m.prototype={is:c.prototype.is,toString:c.prototype.toString};var g=new m;return f(g),g}),new c};function UACHData(e,t){if(e=e||{},setProps.call(this,CH_ALL_VALUES),t)setProps.call(this,[[BRANDS,itemListToArray(e[CH_HEADER])],[FULLVERLIST,itemListToArray(e[CH_HEADER_FULL_VER_LIST])],[MOBILE,/\?1/.test(e[CH_HEADER_MOBILE])],[MODEL,stripQuotes(e[CH_HEADER_MODEL])],[PLATFORM,stripQuotes(e[CH_HEADER_PLATFORM])],[PLATFORMVER,stripQuotes(e[CH_HEADER_PLATFORM_VER])],[ARCHITECTURE,stripQuotes(e[CH_HEADER_ARCH])],[FORMFACTORS,itemListToArray(e[CH_HEADER_FORM_FACTORS])],[BITNESS,stripQuotes(e[CH_HEADER_BITNESS])]]);else for(var n in e)this.hasOwnProperty(n)&&typeof e[n]!==UNDEF_TYPE&&(this[n]=e[n])}function UAItem(e,t,n,a){return this.get=function(s){return s?this.data.hasOwnProperty(s)?this.data[s]:void 0:this.data},this.set=function(s,o){return this.data[s]=o,this},this.setCH=function(s){return this.uaCH=s,this},this.detectFeature=function(){if(NAVIGATOR&&NAVIGATOR.userAgent==this.ua)switch(this.itemType){case UA_BROWSER:NAVIGATOR.brave&&typeof NAVIGATOR.brave.isBrave==FUNC_TYPE&&this.set(NAME,"Brave");break;case UA_DEVICE:!this.get(TYPE)&&NAVIGATOR_UADATA&&NAVIGATOR_UADATA[MOBILE]&&this.set(TYPE,MOBILE),this.get(MODEL)=="Macintosh"&&NAVIGATOR&&typeof NAVIGATOR.standalone!==UNDEF_TYPE&&NAVIGATOR.maxTouchPoints&&NAVIGATOR.maxTouchPoints>2&&this.set(MODEL,"iPad").set(TYPE,TABLET);break;case UA_OS:!this.get(NAME)&&NAVIGATOR_UADATA&&NAVIGATOR_UADATA[PLATFORM]&&this.set(NAME,NAVIGATOR_UADATA[PLATFORM]);break;case UA_RESULT:var s=this.data,o=function(c){return s[c].getItem().detectFeature().get()};this.set(UA_BROWSER,o(UA_BROWSER)).set(UA_CPU,o(UA_CPU)).set(UA_DEVICE,o(UA_DEVICE)).set(UA_ENGINE,o(UA_ENGINE)).set(UA_OS,o(UA_OS))}return this},this.parseUA=function(){return this.itemType!=UA_RESULT&&rgxMapper.call(this.data,this.ua,this.rgxMap),this.itemType==UA_BROWSER&&this.set(MAJOR,majorize(this.get(VERSION$2))),this},this.parseCH=function(){var s=this.uaCH,o=this.rgxMap;switch(this.itemType){case UA_BROWSER:case UA_ENGINE:var c=s[FULLVERLIST]||s[BRANDS],f;if(c)for(var y in c){var m=c[y].brand||c[y],g=c[y].version;this.itemType==UA_BROWSER&&!/not.a.brand/i.test(m)&&(!f||/Chrom/.test(f)&&m!=CHROMIUM||f==EDGE&&/WebView2/.test(m))&&(m=strMapper(m,browserHintsMap),f=this.get(NAME),f&&!/Chrom/.test(f)&&/Chrom/.test(m)||this.set(NAME,m).set(VERSION$2,g).set(MAJOR,majorize(g)),f=m),this.itemType==UA_ENGINE&&m==CHROMIUM&&this.set(VERSION$2,g)}break;case UA_CPU:var z=s[ARCHITECTURE];z&&(z&&s[BITNESS]=="64"&&(z+="64"),rgxMapper.call(this.data,z+";",o));break;case UA_DEVICE:if(s[MOBILE]&&this.set(TYPE,MOBILE),s[MODEL]&&(this.set(MODEL,s[MODEL]),!this.get(TYPE)||!this.get(VENDOR))){var ie={};rgxMapper.call(ie,"droid 9; "+s[MODEL]+")",o),!this.get(TYPE)&&ie.type&&this.set(TYPE,ie.type),!this.get(VENDOR)&&ie.vendor&&this.set(VENDOR,ie.vendor)}if(s[FORMFACTORS]){var re;if(typeof s[FORMFACTORS]!="string")for(var he=0;!re&&he<s[FORMFACTORS].length;)re=strMapper(s[FORMFACTORS][he++],formFactorsMap);else re=strMapper(s[FORMFACTORS],formFactorsMap);this.set(TYPE,re)}break;case UA_OS:var _e=s[PLATFORM];if(_e){var $e=s[PLATFORMVER];_e==WINDOWS&&($e=parseInt(majorize($e),10)>=13?"11":"10"),this.set(NAME,_e).set(VERSION$2,$e)}this.get(NAME)==WINDOWS&&s[MODEL]=="Xbox"&&this.set(NAME,"Xbox").set(VERSION$2,void 0);break;case UA_RESULT:var pe=this.data,Ce=function(Oe){return pe[Oe].getItem().setCH(s).parseCH().get()};this.set(UA_BROWSER,Ce(UA_BROWSER)).set(UA_CPU,Ce(UA_CPU)).set(UA_DEVICE,Ce(UA_DEVICE)).set(UA_ENGINE,Ce(UA_ENGINE)).set(UA_OS,Ce(UA_OS))}return this},setProps.call(this,[["itemType",e],["ua",t],["uaCH",a],["rgxMap",n],["data",createIData(this,e)]]),this}function UAParser(e,t,n){if(typeof e===OBJ_TYPE?(isExtensions(e,!0)?(typeof t===OBJ_TYPE&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e===STR_TYPE&&!isExtensions(t,!0)&&(n=t,t=void 0),n&&typeof n.append===FUNC_TYPE){var a={};n.forEach(function(y,m){a[m]=y}),n=a}if(!(this instanceof UAParser))return new UAParser(e,t,n).getResult();var s=typeof e===STR_TYPE?e:n&&n[USER_AGENT]?n[USER_AGENT]:NAVIGATOR&&NAVIGATOR.userAgent?NAVIGATOR.userAgent:EMPTY,o=new UACHData(n,!0),c=t?extend$1(defaultRegexes,t):defaultRegexes,f=function(y){return y==UA_RESULT?function(){return new UAItem(y,s,c,o).set("ua",s).set(UA_BROWSER,this.getBrowser()).set(UA_CPU,this.getCPU()).set(UA_DEVICE,this.getDevice()).set(UA_ENGINE,this.getEngine()).set(UA_OS,this.getOS()).get()}:function(){return new UAItem(y,s,c[y],o).parseUA().get()}};return setProps.call(this,[["getBrowser",f(UA_BROWSER)],["getCPU",f(UA_CPU)],["getDevice",f(UA_DEVICE)],["getEngine",f(UA_ENGINE)],["getOS",f(UA_OS)],["getResult",f(UA_RESULT)],["getUA",function(){return s}],["setUA",function(y){return isString$1(y)&&(s=y.length>UA_MAX_LENGTH?trim$1(y,UA_MAX_LENGTH):y),this}]]).setUA(s),this}UAParser.VERSION=LIBVERSION,UAParser.BROWSER=enumerize([NAME,VERSION$2,MAJOR,TYPE]),UAParser.CPU=enumerize([ARCHITECTURE]),UAParser.DEVICE=enumerize([MODEL,VENDOR,TYPE,CONSOLE,MOBILE,SMARTTV,TABLET,WEARABLE,EMBEDDED]),UAParser.ENGINE=UAParser.OS=enumerize([NAME,VERSION$2]);function useMobile(){const e=ref(!1);function t(){const{device:n}=UAParser(navigator.userAgent);nextTick(()=>{e.value=n.type==="mobile"||window.innerWidth<540})}return onBeforeUnmount(()=>window.removeEventListener("resize",t)),onMounted(()=>{t(),window.addEventListener("resize",t)}),{mobile:e}}var eventsExports=requireEvents();class TWOFA extends eventsExports.EventEmitter{constructor(n,a,s=!0){super();$n(this,"bluetoothDevice",!1);$n(this,"connection");$n(this,"data",{});$n(this,"displaySubmitButton",!0);$n(this,"http");$n(this,"interfaceVersion");$n(this,"_loading",!1);$n(this,"messageEncrypted");$n(this,"rules",{});$n(this,"rulesDefined",!1);if(this.config=n,this.measureEvents=s,this.http=a.getInstance(),n.twofa&&n.twofa.length)this.configuredMeasureEvent("twofa_request",{id_site:n.id_site,...n.id_site?{}:{id_request:n.id_request}}),n.twofa.forEach(o=>{const c=o.name;this.data[c]=null,(o.type==="authentication_type"||o.type==="challenge")&&(this.data[c]=o.label),o.type==="connection"&&(this.connection=this.data[c]=o.label),(o.type==="externalAction"||o.type==="instructions")&&(this.displaySubmitButton=!1),o.type==="interface_version"&&(this.interfaceVersion=this.data[c]=o.label)}),this.connectSantanderUsbToken(),this.handleBbvaNetcashConnections();else throw new Error("TWOFA credentials are required.")}get loading(){return this._loading}set loading(n){this._loading=n,n&&this.emit("loading")}authenticate(n){return this.data={...n},this.configuredMeasureEvent("twofa_send",{id_site:this.config.id_site,...this.config.id_site?{}:{id_request:this.config.id_request}}),this.loading=!0,this.connection==="eai_otp_GO3"&&!this.bluetoothDevice?this.sendBbvaNetcashUsbToken():(this.turnOnBbvaNetcashBluetoothDevice(),this.http.post(this.config.address,{twofa:{...this.data}}).then(a=>(this.emit("login-success"),a)).catch(a=>(this.loading=!1,this.emit("twofa-api-error"),Promise.reject(a))))}defineRules(n){this.rulesDefined||(this.rulesDefined=!0,this.config.twofa.forEach(a=>{Object.defineProperty(this.rules,a.name,{value:this.setRules(a,n)})}))}getFields(){return this.config.twofa.filter(n=>n.type!=="challenge"&&n.type!=="connection")}getBbvaNetcashBluetoothFinalToken(n){const a=this.findTwofaByName("token").label;this.displaySubmitButton=!1,this.config.twofa=[{label:a,name:"token",type:"instructions"}],getBridgeBluetoothFinalToken(n).then(s=>{this.data={token:s,other_message_encrypted:"other_message_encrypted"},this.authenticate(this.data)})}statusChanged(){this.loading||(this.loading=!0)}configuredMeasureEvent(n,a){this.measureEvents&&measureEvent(n,a)}connectSantanderUsbToken(){this.config.id_site==="57f6dd8c78480602048b4567"&&this.config.twofa[0].type==="instructions"&&getSantanderWebSocketData(this.config.twofa[0].imgBase64File).then(n=>{this.authenticate(n)}).catch(n=>{this.emit("twofa-api-error"),this.emit("twofa-device-error",n)})}findTwofaByName(n){return this.config.twofa.find(a=>a.name===n)}findTwofaByType(n){return this.config.twofa.find(a=>a.type===n)}handleBbvaNetcashConnections(){this.messageEncrypted=this.findTwofaByType("message_encrypted");const n=this.findTwofaByType("other_message_encrypted");this.connection==="eai_otp_GO3"&&(this.bluetoothDevice=this.findTwofaByType("bluetooth_device").label==="S",this.bluetoothDevice?this.sendBbvaNetcashBluetoothTimeChallengeV1():this.setBbvaNetcashUsbFields()),this.messageEncrypted&&this.setBbvaNetcashBluetoothFakeToken(),n&&this.getBbvaNetcashBluetoothFinalToken(n.label),this.findTwofaByType("authentication_type")&&this.sendBbvaNetcashBluetoothTimeChallengeV2(),this.config.id_site==="57239fae78480601038b4567"&&!this.connection&&this.findTwofaByType("challenge")&&!this.messageEncrypted&&!n&&this.sendBbvaNetcashBluetoothSecondToken()}sendBbvaNetcashBluetoothSecondToken(){const n=JSON.parse(this.findTwofaByType("challenge").label),a=this.findTwofaByName("token").label;this.displaySubmitButton=!1,this.config.twofa=[{label:a,name:"token",type:"instructions"}],continueDPToken(n).then(s=>{this.authenticate({challenge:s,token:s})})}sendBbvaNetcashBluetoothTimeChallengeV1(){const n=this.findTwofaByType("challenge").label,a=this.findTwofaByType("device").label,s=this.findTwofaByName("token").label;this.displaySubmitButton=!1,this.config.twofa=[{label:s,name:"token",type:"instructions"}],getBridgeBluetoothTimeChallengeV1(a,n).then(o=>{this.data={bluetooth_device:"bluetooth_device",challenge:"challenge",connection:"connection",device:"device",interface_version:"interface_version",token:o},this.authenticate(this.data)})}sendBbvaNetcashBluetoothTimeChallengeV2(){const n=this.findTwofaByType("authentication_type").label,a=this.findTwofaByName("token").label;this.displaySubmitButton=!1,this.config.twofa=[{label:a,name:"token",type:"instructions"}],getBridgeBluetoothTimeChallengeV2(n).then(s=>{this.authenticate({authentication_type:"authentication_type",interface_version:"interface_version",token:s})})}sendBbvaNetcashUsbToken(){return getBridgeData(this.data.token,this.data.challenge).then(n=>this.http.post(this.config.address,{twofa:{...this.data,...n,bluetooth_device:"bluetooth_device",challenge:"challenge",connection:"connection"}}).then(a=>(this.emit("login-success"),a)).catch(a=>(this.loading=!1,this.emit("twofa-api-error"),Promise.reject(a)))).catch(n=>(this.loading=!1,this.emit("twofa-api-error"),Promise.reject(n.response?{...n,response:{...n.response,status:500}}:n)))}setBbvaNetcashBluetoothFakeToken(){const n=this.findTwofaByName("token").label;this.rules={token:[{required:!0}]},this.rulesDefined=!0,this.data={token:""},this.config.twofa=[{name:"token",type:"text",label:n,disabled:!0}],getBridgeBluetoothFakeToken(this.messageEncrypted.label).then(a=>{this.data={token:a},this.emit("token-received")})}setBbvaNetcashUsbFields(){this.config.twofa=[this.findTwofaByType("text")]}setRules(n,a){const s=[];return s.push({required:!0,message:a("form_errors.required",{label:n.label})}),n.validation&&n.validation.forEach(o=>{switch(o.type){case"text":break;case"regex":s.push({pattern:o.value,message:o.error_message});break}}),s}turnOnBbvaNetcashBluetoothDevice(){this.messageEncrypted&&(this.data={token:"OK",message_encrypted:"message_encrypted"},turnOnBridgeBluetoothBeforeSendingTwofa())}}class SiteBase extends eventsExports.EventEmitter{constructor(n,a,s){super();$n(this,"config");$n(this,"response");$n(this,"testMode",!1);$n(this,"http");$n(this,"_finalResponse",null);$n(this,"_lastSocketMessage");$n(this,"_loading",!1);$n(this,"_status","start");$n(this,"_twofa");$n(this,"isSocketOpen",!1);$n(this,"options",{});$n(this,"socket");$n(this,"socketOpened",!1);$n(this,"socketTimeoutAfterError");$n(this,"timer",null);this.httpService=a,this.userConfig=s,this.config=n,this.http=a.getInstance()}get finalResponse(){return this._finalResponse}set finalResponse(n){this._finalResponse=n,this.status="finish"}get lastSocketMessage(){return this._lastSocketMessage}set lastSocketMessage(n){this._lastSocketMessage=n}get loading(){return this._loading}set loading(n){this._loading=n,n&&(this.status="loading")}get status(){return this._status}set status(n){const a=this._status!==n;this._status=n,a&&(this.emit(n),this.emit("status-update",n))}get twofa(){return this._twofa}set twofa(n){this._twofa=n,n&&(this.status="twofa",n.on("loading",()=>{this._twofa===n&&this.status==="twofa"&&(this.status="twofa-loading")}))}setOption(n,a){this.options[n]=a}toggleTestMode(){this.testMode=!this.testMode}configuredMeasureEvent(n,a){this.userConfig.isHeadless||measureEvent(n,a)}clearTimer(){clearTimeout(this.timer)}moveDownloadOptions(n){if(n.download_options_active){const a=n.download_options[0],s=n.download_options[1];this.setOption("search_from",this.formatDate(a)),this.setOption("search_to",this.formatDate(s))}delete n.download_options_active,delete n.download_options}setRules(n){const a=[];return n.required&&a.push({required:!0,message:"required"}),n.validation&&n.validation.forEach(s=>{switch(s.type){case"text":break;case"regex":a.push({pattern:s.value,message:"regex"});break}}),a}setSocket(n){this.socket=new WebSocket(n),this.socket.onclose=a=>this.reopenSocket(a),this.socket.onerror=()=>this.socketError(),this.socket.onmessage=a=>this.socketMessage(a),this.socket.onopen=()=>this.socketOpen()}spreadOptions(){const n=Object.keys(this.options).reduce((a,s)=>(this.options[s]!==null&&this.options[s]!==void 0&&(a[s]=this.options[s]),a),{});return Object.keys(n).length?{options:{...n}}:{}}startTimer(){this.timer=setTimeout(()=>{this.socketTimeout()},this.userConfig.socketTimeoutTime)}formatDate(n){return`${n.getFullYear()}-${`0${n.getMonth()+1}`.slice(-2)}-${`0${n.getDate()}`.slice(-2)}`}reopenSocket(n){this.setSocket(n.target.url)}reopenSocketAfterError(){if(!this.socketTimeoutAfterError){this.socketTimeoutAfterError=new Date().getTime()+12e4,this.setSocket(this.response.ws);const n=setInterval(()=>{this.isSocketOpen?clearInterval(n):new Date().getTime()<this.socketTimeoutAfterError?(this.socket.close(),this.setSocket(this.response.ws)):(clearInterval(n),this.socket.close(),this.loading=!1,this.emit("socket-error"),this.finalResponse="error")},2e3)}}socketClose(n){this.clearTimer(),this.twofa=null,this.emit("socket-close",event),n&&n(this),this.socket&&(this.socket.onclose=null,this.socket.close())}socketError(){this.isSocketOpen=!1,this.socketOpened?this.reopenSocketAfterError():(this.loading=!1,this.emit("socket-error"),this.finalResponse="error")}socketMessage(n){const a=JSON.parse(n.data);if(this.lastSocketMessage=a,this.clearTimer(),this.config.quickAnswer&&a.code===102){this.socketClose(()=>{this.finalResponse="success",this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.emit("socket-quick-answer")}),this.configuredMeasureEvent("sync_success",{code:a.code,id_site:this.config.id_site});return}a.code===401&&this.configuredMeasureEvent("unauthorized",{id_site:this.config.id_site}),a.code===410&&(this.twofa=new TWOFA({...a,id_site:this.config.id_site},this.httpService,!this.userConfig.isHeadless),this.emit("twofa",this.twofa),this.twofa.on("twofa-api-error",()=>{this.socketClose()})),this.emit("socket-message",a),this.startTimer(),a.code===411&&this.configuredMeasureEvent("twofa_timeout",{id_site:this.config.id_site}),(200<=a.code&&a.code<300||400<=a.code&&a.code<600&&a.code!==410)&&(a.code<300?(this.finalResponse="success",this.configuredMeasureEvent("sync_success",{code:a.code,id_site:this.config.id_site})):(this.finalResponse="error",this.configuredMeasureEvent("sync_error",{code:a.code,code_origin:"socket",id_site:this.config.id_site})),this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.socketClose()),!(400<=a.code&&a.code<600&&a.code!==410||200<=a.code&&a.code<300)&&this.twofa&&a.code!==410&&(this.twofa.loading=!0,this.status="twofa-loading")}socketOpen(){this.isSocketOpen=this.socketOpened=!0,this.socketTimeoutAfterError=void 0}socketTimeout(){this.socketClose(()=>{this.finalResponse="error",this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.emit("socket-timeout")})}}const Zn=class Zn extends SiteBase{constructor(n,a,s,o){super(n,a,o);$n(this,"input",[]);$n(this,"backUpInputArray",[]);this.defaultParams=s,this.userConfig=o,this.allConnections.forEach(c=>{const f={rules:{},data:{}};DOWNLOAD_OPTIONS_SITES.includes(n.id_site)&&this.addDownloadOptions(c),c.fields.forEach(y=>{const m=y.name;Object.defineProperty(f.rules,m,{enumerable:!0,value:this.setRules(y),writable:!0}),f.data[m]=null}),c.name===Zn.statementParseInputName?this.backUpInputArray=[f]:this.input.push(f)})}get backUpConnection(){return this.allConnections.find(n=>n.name===Zn.statementParseInputName)}get backUpInput(){return this.backUpInputArray[0]}get connections(){return this.allConnections.filter(n=>n.name!==Zn.statementParseInputName)}get version(){return 4}get allConnections(){return this.config.input.map(n=>({name:n.name,label:n.label,fields:n.fields.map(a=>({...a.options.widget,name:a.name,identifier:a.options.api.identifier,required:a.required}))}))}connect(n,a,s=!1){const o=this.getConnectData(n,a,s);return this.startTimer(),this.http.post(this.config.endpoint,o).then(c=>(this.response=c,this.emit("login-success"),this.setSocket(c.ws),c)).catch(c=>(this.configuredMeasureEvent("sync_error",{code:c.response?c.response.status:c.toString(),code_origin:"endpoint",id_site:this.config.id_site}),s?this.backUpInput.data={}:this.input[n].data={},this.loading=!1,this.status="start",this.clearTimer(),Promise.reject(c)))}getConnectData(n,a,s=!1){this.updateData(n,a,s);const o=n||0,c={...s?this.backUpInput.data:this.input[o].data};DOWNLOAD_OPTIONS_SITES.includes(this.config.id_site)&&this.moveDownloadOptions(c),this.testMode?this.setOption("allowMultipleRequests",!0):this.setOption("allowMultipleRequests",void 0);const f={...this.defaultParams,id_site:this.config.id_site,input_name:s?Zn.statementParseInputName:this.connections[n].name,input:c,...this.spreadOptions()};return this.config.request?Promise.resolve(f.input):(this.configuredMeasureEvent("sync",{id_site:this.config.id_site}),this.loading=!0,this.userConfig.saveCredential||(f.save_credential=this.userConfig.saveCredential),this.testMode&&(f.test=1),f)}getFields(n,a=!1){return a?this.connections[n].fields.filter(s=>!s.identifier):this.connections[n].fields}getBackUpFields(n=!1){var a;return n?this.backUpConnection.fields.filter(s=>!s.identifier):(a=this.backUpConnection)==null?void 0:a.fields}getBackUpRules(n=!1){if(n){const a={};return this.getBackUpFields(!0).forEach(s=>{a[s.name]=this.setRules(s)}),a}return this.backUpInput.rules}getOptions(){return this.connections}getRules(n,a=!1){if(a){const s={};return this.getFields(n,!0).forEach(o=>{s[o.name]=this.setRules(o)}),s}return this.input[n].rules}updateData(n,a,s=!1){if(s){this.backUpInput.data={...a};return}this.input[n].data={...a}}addDownloadOptions(n){n.fields.includes(DOWNLOAD_OPTIONS_ACTIVE)||(n.fields.push(DOWNLOAD_OPTIONS_ACTIVE),n.fields.push(DOWNLOAD_OPTIONS))}};$n(Zn,"statementParseInputName","statement_account_parse");let SiteV4Service=Zn;function bind(e,t){return function(){return e.apply(t,arguments)}}const{toString}=Object.prototype,{getPrototypeOf}=Object,{iterator,toStringTag}=Symbol,kindOf=(e=>t=>{const n=toString.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=e=>(e=e.toLowerCase(),t=>kindOf(t)===e),typeOfTest=e=>t=>typeof t===e,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&isFunction(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&isArrayBuffer(e.buffer),t}const isString=typeOfTest("string"),isFunction=typeOfTest("function"),isNumber=typeOfTest("number"),isObject=e=>e!==null&&typeof e=="object",isBoolean=e=>e===!0||e===!1,isPlainObject=e=>{if(kindOf(e)!=="object")return!1;const t=getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(toStringTag in e)&&!(iterator in e)},isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=e=>isObject(e)&&isFunction(e.pipe),isFormData=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||isFunction(e.append)&&((t=kindOf(e))==="formdata"||t==="object"&&isFunction(e.toString)&&e.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let a,s;if(typeof e!="object"&&(e=[e]),isArray(e))for(a=0,s=e.length;a<s;a++)t.call(null,e[a],a,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),c=o.length;let f;for(a=0;a<c;a++)f=o[a],t.call(null,e[f],f,e)}}function findKey(e,t){t=t.toLowerCase();const n=Object.keys(e);let a=n.length,s;for(;a-- >0;)if(s=n[a],t===s.toLowerCase())return s;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global$1,isContextDefined=e=>!isUndefined(e)&&e!==_global;function merge(){const{caseless:e}=isContextDefined(this)&&this||{},t={},n=(a,s)=>{const o=e&&findKey(t,s)||s;isPlainObject(t[o])&&isPlainObject(a)?t[o]=merge(t[o],a):isPlainObject(a)?t[o]=merge({},a):isArray(a)?t[o]=a.slice():t[o]=a};for(let a=0,s=arguments.length;a<s;a++)arguments[a]&&forEach(arguments[a],n);return t}const extend=(e,t,n,{allOwnKeys:a}={})=>(forEach(t,(s,o)=>{n&&isFunction(s)?e[o]=bind(s,n):e[o]=s},{allOwnKeys:a}),e),stripBOM=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),inherits=(e,t,n,a)=>{e.prototype=Object.create(t.prototype,a),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject=(e,t,n,a)=>{let s,o,c;const f={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)c=s[o],(!a||a(c,e,t))&&!f[c]&&(t[c]=e[c],f[c]=!0);e=n!==!1&&getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},endsWith=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const a=e.indexOf(t,n);return a!==-1&&a===n},toArray=e=>{if(!e)return null;if(isArray(e))return e;let t=e.length;if(!isNumber(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},isTypedArray=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(e,t)=>{const a=(e&&e[iterator]).call(e);let s;for(;(s=a.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},matchAll=(e,t)=>{let n;const a=[];for(;(n=e.exec(t))!==null;)a.push(n);return a},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,a,s){return a.toUpperCase()+s}),hasOwnProperty=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),a={};forEach(n,(s,o)=>{let c;(c=t(s,o,e))!==!1&&(a[o]=c||s)}),Object.defineProperties(e,a)},freezeMethods=e=>{reduceDescriptors(e,(t,n)=>{if(isFunction(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const a=e[n];if(isFunction(a)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet=(e,t)=>{const n={},a=s=>{s.forEach(o=>{n[o]=!0})};return isArray(e)?a(e):a(String(e).split(t)),n},noop=()=>{},toFiniteNumber=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function isSpecCompliantForm(e){return!!(e&&isFunction(e.append)&&e[toStringTag]==="FormData"&&e[iterator])}const toJSONObject=e=>{const t=new Array(10),n=(a,s)=>{if(isObject(a)){if(t.indexOf(a)>=0)return;if(!("toJSON"in a)){t[s]=a;const o=isArray(a)?[]:{};return forEach(a,(c,f)=>{const y=n(c,s+1);!isUndefined(y)&&(o[f]=y)}),t[s]=void 0,o}}return a};return n(e,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=e=>e&&(isObject(e)||isFunction(e))&&isFunction(e.then)&&isFunction(e.catch),_setImmediate=((e,t)=>e?setImmediate:t?((n,a)=>(_global.addEventListener("message",({source:s,data:o})=>{s===_global&&o===n&&a.length&&a.shift()()},!1),s=>{a.push(s),_global.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",isFunction(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process$1<"u"&&process$1.nextTick||_setImmediate,isIterable=e=>e!=null&&isFunction(e[iterator]),utils$1={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isBoolean,isObject,isPlainObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate,isFile,isBlob,isRegExp,isFunction,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop,toFiniteNumber,findKey,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};function AxiosError$1(e,t,n,a,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),a&&(this.request=a),s&&(this.response=s,this.status=s.status?s.status:null)}utils$1.inherits(AxiosError$1,Error,{toJSON:function 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:utils$1.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{descriptors[e]={value:e}}),Object.defineProperties(AxiosError$1,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError$1.from=(e,t,n,a,s,o)=>{const c=Object.create(prototype$1);return utils$1.toFlatObject(e,c,function(y){return y!==Error.prototype},f=>f!=="isAxiosError"),AxiosError$1.call(c,e.message,t,n,a,s),c.cause=e,c.name=e.name,o&&Object.assign(c,o),c};const httpAdapter=null;function isVisitable(e){return utils$1.isPlainObject(e)||utils$1.isArray(e)}function removeBrackets(e){return utils$1.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey(e,t,n){return e?e.concat(t).map(function(s,o){return s=removeBrackets(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function isFlatArray(e){return utils$1.isArray(e)&&!e.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function e(t){return/^is[A-Z]/.test(t)});function toFormData$1(e,t,n){if(!utils$1.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=utils$1.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_e,$e){return!utils$1.isUndefined($e[_e])});const a=n.metaTokens,s=n.visitor||g,o=n.dots,c=n.indexes,y=(n.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(t);if(!utils$1.isFunction(s))throw new TypeError("visitor must be a function");function m(he){if(he===null)return"";if(utils$1.isDate(he))return he.toISOString();if(!y&&utils$1.isBlob(he))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(he)||utils$1.isTypedArray(he)?y&&typeof Blob=="function"?new Blob([he]):Buffer$2.from(he):he}function g(he,_e,$e){let pe=he;if(he&&!$e&&typeof he=="object"){if(utils$1.endsWith(_e,"{}"))_e=a?_e:_e.slice(0,-2),he=JSON.stringify(he);else if(utils$1.isArray(he)&&isFlatArray(he)||(utils$1.isFileList(he)||utils$1.endsWith(_e,"[]"))&&(pe=utils$1.toArray(he)))return _e=removeBrackets(_e),pe.forEach(function(Oe,qe){!(utils$1.isUndefined(Oe)||Oe===null)&&t.append(c===!0?renderKey([_e],qe,o):c===null?_e:_e+"[]",m(Oe))}),!1}return isVisitable(he)?!0:(t.append(renderKey($e,_e,o),m(he)),!1)}const z=[],ie=Object.assign(predicates,{defaultVisitor:g,convertValue:m,isVisitable});function re(he,_e){if(!utils$1.isUndefined(he)){if(z.indexOf(he)!==-1)throw Error("Circular reference detected in "+_e.join("."));z.push(he),utils$1.forEach(he,function(pe,Ce){(!(utils$1.isUndefined(pe)||pe===null)&&s.call(t,pe,utils$1.isString(Ce)?Ce.trim():Ce,_e,ie))===!0&&re(pe,_e?_e.concat(Ce):[Ce])}),z.pop()}}if(!utils$1.isObject(e))throw new TypeError("data must be an object");return re(e),t}function encode$1(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(a){return t[a]})}function AxiosURLSearchParams(e,t){this._pairs=[],e&&toFormData$1(e,this,t)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function e(t,n){this._pairs.push([t,n])},prototype.toString=function e(t){const n=t?function(a){return t.call(this,a,encode$1)}:encode$1;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(e,t,n){if(!t)return e;const a=n&&n.encode||encode;utils$1.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=utils$1.isURLSearchParams(t)?t.toString():new AxiosURLSearchParams(t,n).toString(a),o){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class InterceptorManager{constructor(){this.handlers=[]}use(t,n,a){return this.handlers.push({fulfilled:t,rejected:n,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){utils$1.forEach(this.handlers,function(a){a!==null&&t(a)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils,...platform$1};function toURLEncodedForm(e,t){return toFormData$1(e,new platform.classes.URLSearchParams,Object.assign({visitor:function(n,a,s,o){return platform.isNode&&utils$1.isBuffer(n)?(this.append(a,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function parsePropPath(e){return utils$1.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function arrayToObject(e){const t={},n=Object.keys(e);let a;const s=n.length;let o;for(a=0;a<s;a++)o=n[a],t[o]=e[o];return t}function formDataToJSON(e){function t(n,a,s,o){let c=n[o++];if(c==="__proto__")return!0;const f=Number.isFinite(+c),y=o>=n.length;return c=!c&&utils$1.isArray(s)?s.length:c,y?(utils$1.hasOwnProp(s,c)?s[c]=[s[c],a]:s[c]=a,!f):((!s[c]||!utils$1.isObject(s[c]))&&(s[c]=[]),t(n,a,s[c],o)&&utils$1.isArray(s[c])&&(s[c]=arrayToObject(s[c])),!f)}if(utils$1.isFormData(e)&&utils$1.isFunction(e.entries)){const n={};return utils$1.forEachEntry(e,(a,s)=>{t(parsePropPath(a),s,n,0)}),n}return null}function stringifySafely(e,t,n){if(utils$1.isString(e))try{return(t||JSON.parse)(e),utils$1.trim(e)}catch(a){if(a.name!=="SyntaxError")throw a}return(n||JSON.stringify)(e)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function e(t,n){const a=n.getContentType()||"",s=a.indexOf("application/json")>-1,o=utils$1.isObject(t);if(o&&utils$1.isHTMLForm(t)&&(t=new FormData(t)),utils$1.isFormData(t))return s?JSON.stringify(formDataToJSON(t)):t;if(utils$1.isArrayBuffer(t)||utils$1.isBuffer(t)||utils$1.isStream(t)||utils$1.isFile(t)||utils$1.isBlob(t)||utils$1.isReadableStream(t))return t;if(utils$1.isArrayBufferView(t))return t.buffer;if(utils$1.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let f;if(o){if(a.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(t,this.formSerializer).toString();if((f=utils$1.isFileList(t))||a.indexOf("multipart/form-data")>-1){const y=this.env&&this.env.FormData;return toFormData$1(f?{"files[]":t}:t,y&&new y,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),stringifySafely(t)):t}],transformResponse:[function e(t){const n=this.transitional||defaults.transitional,a=n&&n.forcedJSONParsing,s=this.responseType==="json";if(utils$1.isResponse(t)||utils$1.isReadableStream(t))return t;if(t&&utils$1.isString(t)&&(a&&!this.responseType||s)){const c=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(f){if(c)throw f.name==="SyntaxError"?AxiosError$1.from(f,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):f}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function e(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],e=>{defaults.headers[e]={}});const ignoreDuplicateOf=utils$1.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"]),parseHeaders=e=>{const t={};let n,a,s;return e&&e.split(`
873
873
  `).forEach(function(c){s=c.indexOf(":"),n=c.substring(0,s).trim().toLowerCase(),a=c.substring(s+1).trim(),!(!n||t[n]&&ignoreDuplicateOf[n])&&(n==="set-cookie"?t[n]?t[n].push(a):t[n]=[a]:t[n]=t[n]?t[n]+", "+a:a)}),t},$internals=Symbol("internals");function normalizeHeader(e){return e&&String(e).trim().toLowerCase()}function normalizeValue(e){return e===!1||e==null?e:utils$1.isArray(e)?e.map(normalizeValue):String(e)}function parseTokens(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=n.exec(e);)t[a[1]]=a[2];return t}const isValidHeaderName=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function matchHeaderValue(e,t,n,a,s){if(utils$1.isFunction(a))return a.call(this,t,n);if(s&&(t=n),!!utils$1.isString(t)){if(utils$1.isString(a))return t.indexOf(a)!==-1;if(utils$1.isRegExp(a))return a.test(t)}}function formatHeader(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,a)=>n.toUpperCase()+a)}function buildAccessors(e,t){const n=utils$1.toCamelCase(" "+t);["get","set","has"].forEach(a=>{Object.defineProperty(e,a+n,{value:function(s,o,c){return this[a].call(this,t,s,o,c)},configurable:!0})})}let AxiosHeaders$1=class{constructor(t){t&&this.set(t)}set(t,n,a){const s=this;function o(f,y,m){const g=normalizeHeader(y);if(!g)throw new Error("header name must be a non-empty string");const z=utils$1.findKey(s,g);(!z||s[z]===void 0||m===!0||m===void 0&&s[z]!==!1)&&(s[z||y]=normalizeValue(f))}const c=(f,y)=>utils$1.forEach(f,(m,g)=>o(m,g,y));if(utils$1.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(utils$1.isString(t)&&(t=t.trim())&&!isValidHeaderName(t))c(parseHeaders(t),n);else if(utils$1.isObject(t)&&utils$1.isIterable(t)){let f={},y,m;for(const g of t){if(!utils$1.isArray(g))throw TypeError("Object iterator must return a key-value pair");f[m=g[0]]=(y=f[m])?utils$1.isArray(y)?[...y,g[1]]:[y,g[1]]:g[1]}c(f,n)}else t!=null&&o(n,t,a);return this}get(t,n){if(t=normalizeHeader(t),t){const a=utils$1.findKey(this,t);if(a){const s=this[a];if(!n)return s;if(n===!0)return parseTokens(s);if(utils$1.isFunction(n))return n.call(this,s,a);if(utils$1.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=normalizeHeader(t),t){const a=utils$1.findKey(this,t);return!!(a&&this[a]!==void 0&&(!n||matchHeaderValue(this,this[a],a,n)))}return!1}delete(t,n){const a=this;let s=!1;function o(c){if(c=normalizeHeader(c),c){const f=utils$1.findKey(a,c);f&&(!n||matchHeaderValue(a,a[f],f,n))&&(delete a[f],s=!0)}}return utils$1.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let a=n.length,s=!1;for(;a--;){const o=n[a];(!t||matchHeaderValue(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,a={};return utils$1.forEach(this,(s,o)=>{const c=utils$1.findKey(a,o);if(c){n[c]=normalizeValue(s),delete n[o];return}const f=t?formatHeader(o):String(o).trim();f!==o&&delete n[o],n[f]=normalizeValue(s),a[f]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return utils$1.forEach(this,(a,s)=>{a!=null&&a!==!1&&(n[s]=t&&utils$1.isArray(a)?a.join(", "):a)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
874
874
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const a=new this(t);return n.forEach(s=>a.set(s)),a}static accessor(t){const a=(this[$internals]=this[$internals]={accessors:{}}).accessors,s=this.prototype;function o(c){const f=normalizeHeader(c);a[f]||(buildAccessors(s,c),a[f]=!0)}return utils$1.isArray(t)?t.forEach(o):o(t),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),utils$1.reduceDescriptors(AxiosHeaders$1.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(a){this[n]=a}}}),utils$1.freezeMethods(AxiosHeaders$1);function transformData(e,t){const n=this||defaults,a=t||n,s=AxiosHeaders$1.from(a.headers);let o=a.data;return utils$1.forEach(e,function(f){o=f.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function isCancel$1(e){return!!(e&&e.__CANCEL__)}function CanceledError$1(e,t,n){AxiosError$1.call(this,e??"canceled",AxiosError$1.ERR_CANCELED,t,n),this.name="CanceledError"}utils$1.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(e,t,n){const a=n.config.validateStatus;!n.status||!a||a(n.status)?e(n):t(new AxiosError$1("Request failed with status code "+n.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function parseProtocol(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function speedometer(e,t){e=e||10;const n=new Array(e),a=new Array(e);let s=0,o=0,c;return t=t!==void 0?t:1e3,function(y){const m=Date.now(),g=a[o];c||(c=m),n[s]=y,a[s]=m;let z=o,ie=0;for(;z!==s;)ie+=n[z++],z=z%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),m-c<t)return;const re=g&&m-g;return re?Math.round(ie*1e3/re):void 0}}function throttle$1(e,t){let n=0,a=1e3/t,s,o;const c=(m,g=Date.now())=>{n=g,s=null,o&&(clearTimeout(o),o=null),e.apply(null,m)};return[(...m)=>{const g=Date.now(),z=g-n;z>=a?c(m,g):(s=m,o||(o=setTimeout(()=>{o=null,c(s)},a-z)))},()=>s&&c(s)]}const progressEventReducer=(e,t,n=3)=>{let a=0;const s=speedometer(50,250);return throttle$1(o=>{const c=o.loaded,f=o.lengthComputable?o.total:void 0,y=c-a,m=s(y),g=c<=f;a=c;const z={loaded:c,total:f,progress:f?c/f:void 0,bytes:y,rate:m||void 0,estimated:m&&f&&g?(f-c)/m:void 0,event:o,lengthComputable:f!=null,[t?"download":"upload"]:!0};e(z)},n)},progressEventDecorator=(e,t)=>{const n=e!=null;return[a=>t[0]({lengthComputable:n,total:e,loaded:a}),t[1]]},asyncDecorator=e=>(...t)=>utils$1.asap(()=>e(...t)),isURLSameOrigin=platform.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,platform.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(platform.origin),platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent)):()=>!0,cookies=platform.hasStandardBrowserEnv?{write(e,t,n,a,s,o){const c=[e+"="+encodeURIComponent(t)];utils$1.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),utils$1.isString(a)&&c.push("path="+a),utils$1.isString(s)&&c.push("domain="+s),o===!0&&c.push("secure"),document.cookie=c.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function buildFullPath(e,t,n){let a=!isAbsoluteURL(t);return e&&(a||n==!1)?combineURLs(e,t):t}const headersToObject=e=>e instanceof AxiosHeaders$1?{...e}:e;function mergeConfig$1(e,t){t=t||{};const n={};function a(m,g,z,ie){return utils$1.isPlainObject(m)&&utils$1.isPlainObject(g)?utils$1.merge.call({caseless:ie},m,g):utils$1.isPlainObject(g)?utils$1.merge({},g):utils$1.isArray(g)?g.slice():g}function s(m,g,z,ie){if(utils$1.isUndefined(g)){if(!utils$1.isUndefined(m))return a(void 0,m,z,ie)}else return a(m,g,z,ie)}function o(m,g){if(!utils$1.isUndefined(g))return a(void 0,g)}function c(m,g){if(utils$1.isUndefined(g)){if(!utils$1.isUndefined(m))return a(void 0,m)}else return a(void 0,g)}function f(m,g,z){if(z in t)return a(m,g);if(z in e)return a(void 0,m)}const y={url:o,method:o,data:o,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:f,headers:(m,g,z)=>s(headersToObject(m),headersToObject(g),z,!0)};return utils$1.forEach(Object.keys(Object.assign({},e,t)),function(g){const z=y[g]||s,ie=z(e[g],t[g],g);utils$1.isUndefined(ie)&&z!==f||(n[g]=ie)}),n}const resolveConfig=e=>{const t=mergeConfig$1({},e);let{data:n,withXSRFToken:a,xsrfHeaderName:s,xsrfCookieName:o,headers:c,auth:f}=t;t.headers=c=AxiosHeaders$1.from(c),t.url=buildURL(buildFullPath(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),f&&c.set("Authorization","Basic "+btoa((f.username||"")+":"+(f.password?unescape(encodeURIComponent(f.password)):"")));let y;if(utils$1.isFormData(n)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if((y=c.getContentType())!==!1){const[m,...g]=y?y.split(";").map(z=>z.trim()).filter(Boolean):[];c.setContentType([m||"multipart/form-data",...g].join("; "))}}if(platform.hasStandardBrowserEnv&&(a&&utils$1.isFunction(a)&&(a=a(t)),a||a!==!1&&isURLSameOrigin(t.url))){const m=s&&o&&cookies.read(o);m&&c.set(s,m)}return t},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(e){return new Promise(function(n,a){const s=resolveConfig(e);let o=s.data;const c=AxiosHeaders$1.from(s.headers).normalize();let{responseType:f,onUploadProgress:y,onDownloadProgress:m}=s,g,z,ie,re,he;function _e(){re&&re(),he&&he(),s.cancelToken&&s.cancelToken.unsubscribe(g),s.signal&&s.signal.removeEventListener("abort",g)}let $e=new XMLHttpRequest;$e.open(s.method.toUpperCase(),s.url,!0),$e.timeout=s.timeout;function pe(){if(!$e)return;const Oe=AxiosHeaders$1.from("getAllResponseHeaders"in $e&&$e.getAllResponseHeaders()),At={data:!f||f==="text"||f==="json"?$e.responseText:$e.response,status:$e.status,statusText:$e.statusText,headers:Oe,config:e,request:$e};settle(function(ze){n(ze),_e()},function(ze){a(ze),_e()},At),$e=null}"onloadend"in $e?$e.onloadend=pe:$e.onreadystatechange=function(){!$e||$e.readyState!==4||$e.status===0&&!($e.responseURL&&$e.responseURL.indexOf("file:")===0)||setTimeout(pe)},$e.onabort=function(){$e&&(a(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,e,$e)),$e=null)},$e.onerror=function(){a(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,e,$e)),$e=null},$e.ontimeout=function(){let qe=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const At=s.transitional||transitionalDefaults;s.timeoutErrorMessage&&(qe=s.timeoutErrorMessage),a(new AxiosError$1(qe,At.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,e,$e)),$e=null},o===void 0&&c.setContentType(null),"setRequestHeader"in $e&&utils$1.forEach(c.toJSON(),function(qe,At){$e.setRequestHeader(At,qe)}),utils$1.isUndefined(s.withCredentials)||($e.withCredentials=!!s.withCredentials),f&&f!=="json"&&($e.responseType=s.responseType),m&&([ie,he]=progressEventReducer(m,!0),$e.addEventListener("progress",ie)),y&&$e.upload&&([z,re]=progressEventReducer(y),$e.upload.addEventListener("progress",z),$e.upload.addEventListener("loadend",re)),(s.cancelToken||s.signal)&&(g=Oe=>{$e&&(a(!Oe||Oe.type?new CanceledError$1(null,e,$e):Oe),$e.abort(),$e=null)},s.cancelToken&&s.cancelToken.subscribe(g),s.signal&&(s.signal.aborted?g():s.signal.addEventListener("abort",g)));const Ce=parseProtocol(s.url);if(Ce&&platform.protocols.indexOf(Ce)===-1){a(new AxiosError$1("Unsupported protocol "+Ce+":",AxiosError$1.ERR_BAD_REQUEST,e));return}$e.send(o||null)})},composeSignals=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let a=new AbortController,s;const o=function(m){if(!s){s=!0,f();const g=m instanceof Error?m:this.reason;a.abort(g instanceof AxiosError$1?g:new CanceledError$1(g instanceof Error?g.message:g))}};let c=t&&setTimeout(()=>{c=null,o(new AxiosError$1(`timeout ${t} of ms exceeded`,AxiosError$1.ETIMEDOUT))},t);const f=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(o):m.removeEventListener("abort",o)}),e=null)};e.forEach(m=>m.addEventListener("abort",o));const{signal:y}=a;return y.unsubscribe=()=>utils$1.asap(f),y}},streamChunk=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let a=0,s;for(;a<n;)s=a+t,yield e.slice(a,s),a=s},readBytes=async function*(e,t){for await(const n of readStream(e))yield*streamChunk(n,t)},readStream=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:a}=await t.read();if(n)break;yield a}}finally{await t.cancel()}},trackStream=(e,t,n,a)=>{const s=readBytes(e,t);let o=0,c,f=y=>{c||(c=!0,a&&a(y))};return new ReadableStream({async pull(y){try{const{done:m,value:g}=await s.next();if(m){f(),y.close();return}let z=g.byteLength;if(n){let ie=o+=z;n(ie)}y.enqueue(new Uint8Array(g))}catch(m){throw f(m),m}},cancel(y){return f(y),s.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),test=(e,...t)=>{try{return!!e(...t)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let e=!1;const t=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$1.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(e=>e.body)};isFetchSupported&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!resolvers[t]&&(resolvers[t]=utils$1.isFunction(e[t])?n=>n[t]():(n,a)=>{throw new AxiosError$1(`Response type '${t}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,a)})})})(new Response);const getBodyLength=async e=>{if(e==null)return 0;if(utils$1.isBlob(e))return e.size;if(utils$1.isSpecCompliantForm(e))return(await new Request(platform.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(utils$1.isArrayBufferView(e)||utils$1.isArrayBuffer(e))return e.byteLength;if(utils$1.isURLSearchParams(e)&&(e=e+""),utils$1.isString(e))return(await encodeText(e)).byteLength},resolveBodyLength=async(e,t)=>{const n=utils$1.toFiniteNumber(e.getContentLength());return n??getBodyLength(t)},fetchAdapter=isFetchSupported&&(async e=>{let{url:t,method:n,data:a,signal:s,cancelToken:o,timeout:c,onDownloadProgress:f,onUploadProgress:y,responseType:m,headers:g,withCredentials:z="same-origin",fetchOptions:ie}=resolveConfig(e);m=m?(m+"").toLowerCase():"text";let re=composeSignals([s,o&&o.toAbortSignal()],c),he;const _e=re&&re.unsubscribe&&(()=>{re.unsubscribe()});let $e;try{if(y&&supportsRequestStream&&n!=="get"&&n!=="head"&&($e=await resolveBodyLength(g,a))!==0){let At=new Request(t,{method:"POST",body:a,duplex:"half"}),Et;if(utils$1.isFormData(a)&&(Et=At.headers.get("content-type"))&&g.setContentType(Et),At.body){const[ze,kt]=progressEventDecorator($e,progressEventReducer(asyncDecorator(y)));a=trackStream(At.body,DEFAULT_CHUNK_SIZE,ze,kt)}}utils$1.isString(z)||(z=z?"include":"omit");const pe="credentials"in Request.prototype;he=new Request(t,{...ie,signal:re,method:n.toUpperCase(),headers:g.normalize().toJSON(),body:a,duplex:"half",credentials:pe?z:void 0});let Ce=await fetch(he);const Oe=supportsResponseStream&&(m==="stream"||m==="response");if(supportsResponseStream&&(f||Oe&&_e)){const At={};["status","statusText","headers"].forEach(Pt=>{At[Pt]=Ce[Pt]});const Et=utils$1.toFiniteNumber(Ce.headers.get("content-length")),[ze,kt]=f&&progressEventDecorator(Et,progressEventReducer(asyncDecorator(f),!0))||[];Ce=new Response(trackStream(Ce.body,DEFAULT_CHUNK_SIZE,ze,()=>{kt&&kt(),_e&&_e()}),At)}m=m||"text";let qe=await resolvers[utils$1.findKey(resolvers,m)||"text"](Ce,e);return!Oe&&_e&&_e(),await new Promise((At,Et)=>{settle(At,Et,{data:qe,headers:AxiosHeaders$1.from(Ce.headers),status:Ce.status,statusText:Ce.statusText,config:e,request:he})})}catch(pe){throw _e&&_e(),pe&&pe.name==="TypeError"&&/Load failed|fetch/i.test(pe.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,e,he),{cause:pe.cause||pe}):AxiosError$1.from(pe,pe&&pe.code,e,he)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$1.forEach(knownAdapters,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const renderReason=e=>`- ${e}`,isResolvedHandle=e=>utils$1.isFunction(e)||e===null||e===!1,adapters={getAdapter:e=>{e=utils$1.isArray(e)?e:[e];const{length:t}=e;let n,a;const s={};for(let o=0;o<t;o++){n=e[o];let c;if(a=n,!isResolvedHandle(n)&&(a=knownAdapters[(c=String(n)).toLowerCase()],a===void 0))throw new AxiosError$1(`Unknown adapter '${c}'`);if(a)break;s[c||"#"+o]=a}if(!a){const o=Object.entries(s).map(([f,y])=>`adapter ${f} `+(y===!1?"is not supported by the environment":"is not available in the build"));let c=t?o.length>1?`since :
875
875
  `+o.map(renderReason).join(`
876
876
  `):" "+renderReason(o[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return a},adapters:knownAdapters};function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError$1(null,e)}function dispatchRequest(e){return throwIfCancellationRequested(e),e.headers=AxiosHeaders$1.from(e.headers),e.data=transformData.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(e.adapter||defaults.adapter)(e).then(function(a){return throwIfCancellationRequested(e),a.data=transformData.call(e,e.transformResponse,a),a.headers=AxiosHeaders$1.from(a.headers),a},function(a){return isCancel$1(a)||(throwIfCancellationRequested(e),a&&a.response&&(a.response.data=transformData.call(e,e.transformResponse,a.response),a.response.headers=AxiosHeaders$1.from(a.response.headers))),Promise.reject(a)})}const VERSION$1="1.9.0",validators$1={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{validators$1[e]=function(a){return typeof a===e||"a"+(t<1?"n ":" ")+e}});const deprecatedWarnings={};validators$1.transitional=function e(t,n,a){function s(o,c){return"[Axios v"+VERSION$1+"] Transitional option '"+o+"'"+c+(a?". "+a:"")}return(o,c,f)=>{if(t===!1)throw new AxiosError$1(s(c," has been removed"+(n?" in "+n:"")),AxiosError$1.ERR_DEPRECATED);return n&&!deprecatedWarnings[c]&&(deprecatedWarnings[c]=!0,console.warn(s(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,c,f):!0}},validators$1.spelling=function e(t){return(n,a)=>(console.warn(`${a} is likely a misspelling of ${t}`),!0)};function assertOptions(e,t,n){if(typeof e!="object")throw new AxiosError$1("options must be an object",AxiosError$1.ERR_BAD_OPTION_VALUE);const a=Object.keys(e);let s=a.length;for(;s-- >0;){const o=a[s],c=t[o];if(c){const f=e[o],y=f===void 0||c(f,o,e);if(y!==!0)throw new AxiosError$1("option "+o+" must be "+y,AxiosError$1.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new AxiosError$1("Unknown option "+o,AxiosError$1.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;let Axios$1=class{constructor(t){this.defaults=t||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(t,n){try{return await this._request(t,n)}catch(a){if(a instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{a.stack?o&&!String(a.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(a.stack+=`
877
- `+o):a.stack=o}catch{}}throw a}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=mergeConfig$1(this.defaults,n);const{transitional:a,paramsSerializer:s,headers:o}=n;a!==void 0&&validator.assertOptions(a,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),s!=null&&(utils$1.isFunction(s)?n.paramsSerializer={serialize:s}:validator.assertOptions(s,{encode:validators.function,serialize:validators.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),validator.assertOptions(n,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=o&&utils$1.merge(o.common,o[n.method]);o&&utils$1.forEach(["delete","get","head","post","put","patch","common"],he=>{delete o[he]}),n.headers=AxiosHeaders$1.concat(c,o);const f=[];let y=!0;this.interceptors.request.forEach(function(_e){typeof _e.runWhen=="function"&&_e.runWhen(n)===!1||(y=y&&_e.synchronous,f.unshift(_e.fulfilled,_e.rejected))});const m=[];this.interceptors.response.forEach(function(_e){m.push(_e.fulfilled,_e.rejected)});let g,z=0,ie;if(!y){const he=[dispatchRequest.bind(this),void 0];for(he.unshift.apply(he,f),he.push.apply(he,m),ie=he.length,g=Promise.resolve(n);z<ie;)g=g.then(he[z++],he[z++]);return g}ie=f.length;let re=n;for(z=0;z<ie;){const he=f[z++],_e=f[z++];try{re=he(re)}catch($e){_e.call(this,$e);break}}try{g=dispatchRequest.call(this,re)}catch(he){return Promise.reject(he)}for(z=0,ie=m.length;z<ie;)g=g.then(m[z++],m[z++]);return g}getUri(t){t=mergeConfig$1(this.defaults,t);const n=buildFullPath(t.baseURL,t.url,t.allowAbsoluteUrls);return buildURL(n,t.params,t.paramsSerializer)}};utils$1.forEach(["delete","get","head","options"],function e(t){Axios$1.prototype[t]=function(n,a){return this.request(mergeConfig$1(a||{},{method:t,url:n,data:(a||{}).data}))}}),utils$1.forEach(["post","put","patch"],function e(t){function n(a){return function(o,c,f){return this.request(mergeConfig$1(f||{},{method:t,headers:a?{"Content-Type":"multipart/form-data"}:{},url:o,data:c}))}}Axios$1.prototype[t]=n(),Axios$1.prototype[t+"Form"]=n(!0)});let CancelToken$1=class si{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const a=this;this.promise.then(s=>{if(!a._listeners)return;let o=a._listeners.length;for(;o-- >0;)a._listeners[o](s);a._listeners=null}),this.promise.then=s=>{let o;const c=new Promise(f=>{a.subscribe(f),o=f}).then(s);return c.cancel=function(){a.unsubscribe(o)},c},t(function(o,c,f){a.reason||(a.reason=new CanceledError$1(o,c,f),n(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=a=>{t.abort(a)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new si(function(s){t=s}),cancel:t}}};function spread$1(e){return function(n){return e.apply(null,n)}}function isAxiosError$1(e){return utils$1.isObject(e)&&e.isAxiosError===!0}const HttpStatusCode$1={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};Object.entries(HttpStatusCode$1).forEach(([e,t])=>{HttpStatusCode$1[t]=e});function createInstance(e){const t=new Axios$1(e),n=bind(Axios$1.prototype.request,t);return utils$1.extend(n,Axios$1.prototype,t,{allOwnKeys:!0}),utils$1.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return createInstance(mergeConfig$1(e,s))},n}const axios=createInstance(defaults);axios.Axios=Axios$1,axios.CanceledError=CanceledError$1,axios.CancelToken=CancelToken$1,axios.isCancel=isCancel$1,axios.VERSION=VERSION$1,axios.toFormData=toFormData$1,axios.AxiosError=AxiosError$1,axios.Cancel=axios.CanceledError,axios.all=function e(t){return Promise.all(t)},axios.spread=spread$1,axios.isAxiosError=isAxiosError$1,axios.mergeConfig=mergeConfig$1,axios.AxiosHeaders=AxiosHeaders$1,axios.formToJSON=e=>formDataToJSON(utils$1.isHTMLForm(e)?new FormData(e):e),axios.getAdapter=adapters.getAdapter,axios.HttpStatusCode=HttpStatusCode$1,axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios;function throttle(e,t,n){var a=n||{},s=a.noTrailing,o=s===void 0?!1:s,c=a.noLeading,f=c===void 0?!1:c,y=a.debounceMode,m=y===void 0?void 0:y,g,z=!1,ie=0;function re(){g&&clearTimeout(g)}function he($e){var pe=$e||{},Ce=pe.upcomingOnly,Oe=Ce===void 0?!1:Ce;re(),z=!Oe}function _e(){for(var $e=arguments.length,pe=new Array($e),Ce=0;Ce<$e;Ce++)pe[Ce]=arguments[Ce];var Oe=this,qe=Date.now()-ie;if(z)return;function At(){ie=Date.now(),t.apply(Oe,pe)}function Et(){g=void 0}!f&&m&&!g&&At(),re(),m===void 0&&qe>e?f?(ie=Date.now(),o||(g=setTimeout(m?Et:At,e))):At():o!==!0&&(g=setTimeout(m?Et:At,m===void 0?e-qe:e))}return _e.cancel=he,_e}function debounce(e,t,n){var a={},s=a.atBegin,o=s===void 0?!1:s;return throttle(e,t,{debounceMode:o!==!1})}class Credential extends eventsExports.EventEmitter{constructor(n,a,s,o,c,f=!1){super();$n(this,"loading",!1);$n(this,"response");$n(this,"_config");$n(this,"_error");$n(this,"_message");$n(this,"_status","searching");$n(this,"_twofa");$n(this,"http");$n(this,"isSocketOpen",!1);$n(this,"options",{});$n(this,"socket");$n(this,"socketOpened",!1);$n(this,"socketTimeoutAfterError");$n(this,"timer",null);this.syncService=s,this.httpService=o,this.socketTimeoutTime=c,this.isHeadless=f,this.http=this.httpService.getInstance(),this.getSitefromCredential(n).then(({site:y,credential:m})=>{this.config={...m,avatar:y.site_organization.avatar,cover:y.site_organization.cover,name:y.name,quickAnswer:this.syncService.quickAnswer,site:y},this.status="found",a||this.sync().then(()=>{this.status="loading"}).catch(g=>{this.error=g,this.status="error"})}).catch(y=>{this.error=y,this.status="not-found"})}get config(){return this._config}set config(n){this._config=n}get error(){return this._error}set error(n){this._error=n}get message(){return this._message}set message(n){this._message=n}get status(){return this._status}set status(n){const a=this._status!==n;this._status=n,a&&(this.emit(n),this.emit("status-updated",n))}get twofa(){return this._twofa}set twofa(n){this._twofa=n,n&&(this.status="twofa",n.on("loading",()=>{this._twofa===n&&this.status==="twofa"&&(this.status="twofa-loading")}),n.on("twofa-api-error",()=>{this.status="twofa-api-error",this.socketClose()}))}getAvatar(){return this.config.avatar}getCover(){return this.config.cover}getCredentialData(){return{...this.config}}getName(){return this.config.name}getSite(){return{...this.config.site}}getSiteService(){return this.syncService.siteConnection(this.config.site)}setOption(n,a){this.options[n]=a}sync(){return this.configuredMeasureEvent("sync_credential",{id_credential:this.config.id_credential,id_site:this.config.id_site}),this.loading=!0,this.startTimer(),this.http.put(`/v1/credentials/${this.config.id_credential}/sync`,{...this.spreadOptions()}).then(n=>(this.response=n,this.setSocket(n.ws),n)).catch(n=>(this.loading=!1,this.configuredMeasureEvent("sync_credential_error",{code:n.response.status,code_origin:"endpoint",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.clearTimer(),Promise.reject(n)))}update(n,a,s,o){let c;return this.configuredMeasureEvent("update_credential",{id_credential:this.config.id_credential,id_site:this.config.id_site}),isSiteV1Service(n)?c=n.getConnectData(a):isSiteV3Service(n)?c=n.getConnectData(s,a):c=n.getConnectData(s,a,o),this.startTimer(),this.http.put(`${n.config.endpoint}/${this.config.id_credential}`,c).then(f=>(this.status="loading",this.loading=!0,this.response=f,this.setSocket(f.ws),f)).catch(f=>(this.error=f,this.status="error",this.configuredMeasureEvent("update_credential_error",{code:f.response.status,code_origin:"endpoint",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.clearTimer(),Promise.reject(f)))}clearTimer(){clearTimeout(this.timer)}configuredMeasureEvent(n,a){this.isHeadless||measureEvent(n,a)}getSitefromCredential(n){return this.http.get("/v1/credentials",{params:{...this.syncService.defaultParams,id_credential:n}}).then(a=>a.length?this.syncService.getOrganizationSites({id_site_organization:a[0].id_site_organization}).then(s=>{if(!s.length)return Promise.reject({response:{status:"credential_not_found"}});let o=s[0].sites.find(c=>c.id_site===a[0].id_site);if(o)o={...o};else return Promise.reject({response:{status:"credential_not_found"}});return o.site_organization=s[0],{site:o,credential:a[0]}}).catch(s=>Promise.reject(s)):Promise.reject({response:{status:"credential_not_found"}}))}reopenSocket(n){this.isSocketOpen=!1,this.socketTimeoutAfterError||this.setSocket(n.target.url)}reopenSocketAfterError(){if(!this.socketTimeoutAfterError){this.socketTimeoutAfterError=new Date().getTime()+12e4,this.setSocket(this.response.ws);const n=setInterval(()=>{this.isSocketOpen?clearInterval(n):new Date().getTime()<this.socketTimeoutAfterError?(this.socket.close(),this.setSocket(this.response.ws)):(clearInterval(n),this.socket.close(),this.loading=!1,this.status="socket-error")},2e3)}}setSocket(n){this.socket=new WebSocket(n),this.socket.onclose=a=>this.reopenSocket(a),this.socket.onerror=()=>this.socketError(),this.socket.onmessage=a=>this.socketMessage(a),this.socket.onopen=()=>this.socketOpen()}socketClose(n){this.clearTimer(),this.socket.onclose=()=>{this.twofa=null,n&&n(this)},this.socket.close()}socketError(){this.isSocketOpen=!1,this.socketOpened?this.reopenSocketAfterError():(this.loading=!1,this.status="socket-error")}socketMessage(n){const a=JSON.parse(n.data);if(this.clearTimer(),this.config.quickAnswer&&a.code===102){this.socketClose(()=>{this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.status="socket-quick-answer"}),this.configuredMeasureEvent("sync_credential_success",{code:a.code,id_credential:this.config.id_credential,id_site:this.config.id_site});return}a.code===401&&this.configuredMeasureEvent("unauthorized",{id_site:this.config.id_site}),a.code===410&&(this.twofa=new TWOFA({...a,id_site:this.config.id_site},this.httpService)),this.emit("socket-message",a),this.startTimer(),a.code===411&&this.configuredMeasureEvent("twofa_timeout",{id_site:this.config.id_site}),200<=a.code&&a.code<300||400<=a.code&&a.code<600&&a.code!==410?(this.loading=!1,this.twofa&&(this.twofa.loading=!1),a.code<300?(this.configuredMeasureEvent("sync_credential_success",{code:a.code,id_credential:this.config.id_credential,id_site:this.config.id_site}),this.message=a,this.status="success"):(this.configuredMeasureEvent("sync_credential_error",{code:a.code,code_origin:"socket",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.error=a,this.status="error"),this.socketClose()):this.twofa&&a.code!==410&&this.twofa.statusChanged()}socketOpen(){this.isSocketOpen=this.socketOpened=!0,this.socketTimeoutAfterError=void 0}socketTimeout(){this.status="socket-timeout",this.socketClose()}spreadOptions(){const n=Object.keys(this.options).reduce((a,s)=>(this.options[s]!==null&&this.options[s]!==void 0&&(a[s]=this.options[s]),a),{});return Object.keys(n).length?{options:{...n}}:{}}startTimer(){this.timer=setTimeout(()=>{this.socketTimeout()},this.socketTimeoutTime)}}axios.defaults.baseURL="https://sync.paybook.com";class HttpService extends eventsExports.EventEmitter{constructor(n,a={}){const{os:s}=UAParser(navigator.userAgent);super();$n(this,"baseURL");$n(this,"isStrict");$n(this,"jwk");this.token=n,a.baseURL&&(this.baseURL=axios.defaults.baseURL=a.baseURL),this.isStrict=a.isStrict||!1,axios.defaults.headers.common={"x-app-version":`syncfy-widget:${a.widgetVersion}:${s.name}:${s.version}`}}getInstance(){const n=axios.create({baseURL:this.baseURL});return n.interceptors.request.use(a=>(a.headers.Authorization=`Bearer ${this.token}`,a),function(a){return Promise.reject(a)}),n.interceptors.response.use(a=>(this.emit("rid",a.data.rid),a.data.response||a.data||a),a=>{var s;return a.response&&(this.emit("rid",(s=a.response.data)==null?void 0:s.rid),a.response.status===401&&this.emit("401")),Promise.reject(a)}),this.isStrict&&n.interceptors.request.use(a=>a.data?createJWE(a.data,this.jwk).then(s=>(a.data={jwe:s},Promise.resolve(a))):Promise.resolve(a),a=>Promise.reject(a)),n}updateToken(n,a){this.token=n,a&&(this.jwk=a)}}class SiteV1Service extends SiteBase{constructor(n,a,s,o){super(n,a,o);$n(this,"data",{});$n(this,"rules",{});if(this.defaultParams=s,this.userConfig=o,DOWNLOAD_OPTIONS_SITES.includes(n.id_site)&&this.addDownloadOptions(n),n.credentials&&n.credentials.length)o.isHeadless||n.credentials.forEach(c=>{const f=c.name;Object.defineProperty(this.rules,f,{enumerable:!0,value:this.setRules(c),writable:!0})});else throw new Error("Site credentials are required.")}get version(){return 1}connect(n){const a=this.getConnectData(n);return this.startTimer(),this.http.post(this.config.endpoint,a).then(s=>(this.response=s,this.emit("login-success"),this.setSocket(s.ws),s)).catch(s=>(this.configuredMeasureEvent("sync_error",{code:s.response?s.response.status:s.toString(),code_origin:"endpoint",id_site:this.config.id_site}),this.loading=!1,this.data={},this.status="start",this.clearTimer(),Promise.reject(s)))}getConnectData(n){this.data={...n};const a={...this.data};DOWNLOAD_OPTIONS_SITES.includes(this.config.id_site)&&this.moveDownloadOptions(a),this.testMode?this.setOption("allowMultipleRequests",!0):this.setOption("allowMultipleRequests",void 0);const s={...this.defaultParams,id_site:this.config.id_site,credentials:a,...this.spreadOptions()};return this.config.request?Promise.resolve(s.credentials):(this.configuredMeasureEvent("sync",{id_site:this.config.id_site}),this.loading=!0,this.userConfig.saveCredential||(s.save_credential=this.userConfig.saveCredential),this.testMode&&(s.test=1),s)}getFields(n=!1){return n?this.config.credentials.filter(a=>!a.identifier):this.config.credentials}getRules(n=!1){if(n){const a={};return this.getFields(!0).forEach(s=>{const o=s.name;a[o]=this.setRules(s)}),a}return this.rules}addDownloadOptions(n){n.credentials.includes(DOWNLOAD_OPTIONS_ACTIVE)||(n.credentials.push(DOWNLOAD_OPTIONS_ACTIVE),n.credentials.push(DOWNLOAD_OPTIONS))}}class SiteV3Service extends SiteBase{constructor(n,a,s,o){super(n,a,o);$n(this,"input",[]);this.defaultParams=s,this.userConfig=o,n.input.forEach(c=>{const f={rules:{},data:{}};DOWNLOAD_OPTIONS_SITES.includes(n.id_site)&&this.addDownloadOptions(c),c.fields.forEach(y=>{const m=y.name;Object.defineProperty(f.rules,m,{enumerable:!0,value:this.setRules(y),writable:!0}),f.data[m]=null}),this.input.push(f)})}get version(){return 3}connect(n,a){const s=this.getConnectData(n,a);return this.startTimer(),this.http.post(this.config.endpoint,s).then(o=>(this.response=o,this.emit("login-success"),this.setSocket(o.ws),o)).catch(o=>(this.configuredMeasureEvent("sync_error",{code:o.response?o.response.status:o.toString(),code_origin:"endpoint",id_site:this.config.id_site}),this.input[n].data={},this.loading=!1,this.status="start",this.clearTimer(),Promise.reject(o)))}getConnectData(n,a){this.updateData(n,a);const s=n||0,o={...this.input[s].data};DOWNLOAD_OPTIONS_SITES.includes(this.config.id_site)&&this.moveDownloadOptions(o),this.testMode?this.setOption("allowMultipleRequests",!0):this.setOption("allowMultipleRequests",void 0);const c={...this.defaultParams,id_site:this.config.id_site,input_name:this.config.input[n].name,input:o,...this.spreadOptions()};return this.config.request?Promise.resolve(c.input):(this.configuredMeasureEvent("sync",{id_site:this.config.id_site}),this.loading=!0,this.userConfig.saveCredential||(c.save_credential=this.userConfig.saveCredential),this.testMode&&(c.test=1),c)}getFields(n,a=!1){return a?this.config.input[n].fields.filter(s=>!s.identifier):this.config.input[n].fields}getOptions(){return this.config.input}getRules(n,a=!1){if(a){const s={};return this.getFields(n,!0).forEach(o=>{const c=o.name;s[c]=this.setRules(o)}),s}return this.input[n].rules}updateData(n,a){this.input[n].data={...a}}addDownloadOptions(n){n.fields.includes(DOWNLOAD_OPTIONS_ACTIVE)||(n.fields.push(DOWNLOAD_OPTIONS_ACTIVE),n.fields.push(DOWNLOAD_OPTIONS))}}class Sync extends eventsExports.EventEmitter{constructor(n,a){super();$n(this,"http");$n(this,"httpService");$n(this,"rid");this.token=n,this.config=a,this.httpService=a.http?new HttpService(n,{...a.http,widgetVersion:a.widgetVersion}):new HttpService(n,{widgetVersion:a.widgetVersion}),this.http=this.httpService.getInstance(),this.httpService.on("401",this.debounce401()),this.httpService.on("rid",s=>{this.rid=s})}get defaultParams(){return this.config.defaultParams}set defaultParams(n){this.config.defaultParams=n}get quickAnswer(){return this.config.quickAnswer}getAccounts(n){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/accounts",{params:{...this.config.defaultParams,...n}})}getCountries(){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/countries",{params:{...this.config.defaultParams}})}getHttpService(){return this.httpService}getLastRid(){return this.rid}getOrganizationSites(n){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/organizations/sites",{params:{...this.config.defaultParams,...n}})}getOrganizationTypes(){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/site_organization_types",{params:{...this.config.defaultParams}})}getSite(n){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get(`/v1/catalogues/widget/sites/${n}`,{params:{...this.config.defaultParams}})}siteConnection(n){switch(n.version){case 1:return new SiteV1Service({...n,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout});case 3:return new SiteV3Service({...n,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout});case 4:return new SiteV4Service({...n,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout})}}strictMode({token:n,strict:a}){return this.token=n,decodeStrictKeys(a).then(({strictAuthorizationKey:s,strictBodyKey:o})=>createJWS({token:n},s).then(c=>(this.httpService.updateToken(c),getLocalKeys().then(({authorization:f})=>{const y={authorization:btoa(JSON.stringify(f.toJSON(!0)))};return createJWE(y,o).then(m=>this.updateStrictSession(n,c,m).then(()=>createJWS({token:n},f).then(g=>this.updateToken(g).then(()=>(this.httpService.updateToken(this.token,o),{jws:g,jwe:o})))))}))))}syncCredential(n,a=!1){return new Credential(n,a,this,this.httpService,this.config.socketTimeout,this.config.isHeadless)}updateApiBaseUrl(n){this.http.defaults.baseURL=n,axios.defaults.baseURL=n}updateEnvironment(n){switch(n){case"production":this.http.defaults.baseURL="https://sync.paybook.com",axios.defaults.baseURL="https://sync.paybook.com";break;case"development":this.http.defaults.baseURL="https://api.syncfy.paybook.dev",axios.defaults.baseURL="https://api.syncfy.paybook.dev";break;default:this.http.defaults.baseURL="https://sync.paybook.com",axios.defaults.baseURL="https://sync.paybook.com";break}}updateToken(n){return new Promise(a=>{this.token!==n&&(this.token=n,this.httpService.updateToken(this.token)),a({token:n})})}debounce401(){return debounce(200,()=>{this.emit("sync_401")})}updateStrictSession(n,a,s){return axios.put(`/v1/sessions/jwt/${n}`,{type:"jwt","payload/jwe":s},{headers:{Authorization:`Bearer ${a}`}})}}class NotificationUpdater{constructor(t){$n(this,"callback");$n(this,"messages");this.messages=t}getMessages(){return this.messages}subscribe(t){this.callback=t}updateMessages(t){this.messages={...this.messages,...t},this.callback&&this.callback()}}const _sfc_main$2=defineComponent({__name:"BackUpConnection",props:{assetsPath:{default:"https://s.paybook.com"},buttonDisabledStyle:{type:Boolean,default:!1},credential:{default:void 0},disableFormAutocomplete:{type:Boolean,default:!1},displayBackButton:{type:Boolean},errorMessage:{default:null},loaderMessage:{},selectClass:{default:""},showLogo:{type:Boolean},showPasswordStyle:{default:"icon"},site:{},testMode:{type:Boolean,default:!1},updateMode:{type:Boolean,default:!1}},emits:["back","error","success","valid"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),{t:o}=useI18n(),c=ref(!1);return onMounted(()=>{n.site.on("status-update",f=>{f==="loading"?c.value=!0:c.value=!1})}),(f,y)=>(openBlock(),createElementBlock("div",{class:normalizeClass(f.$style["back-up-connection"])},[c.value?createCommentVNode("",!0):(openBlock(),createBlock(AppLoader,{key:0,avatar:n.showLogo?`${f.assetsPath}${n.site.config.avatar}`:void 0,grow:!1,icon:n.showLogo?void 0:"error",message:unref(o)("back_up_connection.description"),size:"large",title:unref(o)("back_up_connection.title"),type:"error",onImagesLoaded:y[0]||(y[0]=()=>unref(s)("images-loaded")),onImagesLoading:y[1]||(y[1]=()=>unref(s)("images-loading"))},null,8,["avatar","icon","message","title"])),createBaseVNode("div",{class:normalizeClass(f.$style["back-up-form"])},[createVNode(SiteForm,{"assets-path":n.assetsPath,"back-up-connection":!0,"button-disabled-style":n.buttonDisabledStyle,"credential-service":n.credential,"disable-form-autocomplete":n.disableFormAutocomplete,"display-back-button":n.displayBackButton,"error-message":n.errorMessage,"loader-message":n.loaderMessage,"select-class":n.selectClass,"show-header":!1,"show-logo":n.showLogo,"show-password-style":n.showPasswordStyle,site:n.site,"test-mode":n.testMode,"update-mode":n.updateMode,onBack:y[2]||(y[2]=()=>a("back")),onError:y[3]||(y[3]=m=>a("error",m)),onSuccess:y[4]||(y[4]=m=>a("success",m)),onValid:y[5]||(y[5]=()=>{unref(s)("back-up-site-submitted"),a("valid")})},null,8,["assets-path","button-disabled-style","credential-service","disable-form-autocomplete","display-back-button","error-message","loader-message","select-class","show-logo","show-password-style","site","test-mode","update-mode"])],2)],2))}}),style0$1={"back-up-connection":"pb-w-sync_back-up-connection","back-up-icon":"pb-w-sync_back-up-icon","back-up-form":"pb-w-sync_back-up-form"},cssModules$1={$style:style0$1},BackUpConnection=_export_sfc(_sfc_main$2,[["__cssModules",cssModules$1]]),_hoisted_1=["aria-label"],_hoisted_2={key:1},_hoisted_3=["aria-label"],_hoisted_4={key:0},_sfc_main$1=defineComponent({__name:"DataWidget",props:{client:{},enableTestMode:{type:Boolean},entrypoint:{},internal:{},locale:{},navigation:{},refreshTokenFunction:{type:Function},strict:{},token:{}},emits:["tokenRefreshed"],setup(e,{expose:t,emit:n}){const a=e,s=n,o=inject(rootEmitter),{t:c,locale:f}=useI18n({useScope:"global"}),{mobile:y}=useMobile(),m=ref([]),g=ref(null),z=ref(null),ie=ref(!1),re=ref(!1),he=ref(null),_e=ref(null),$e=ref(null),pe=ref(""),Ce=ref(""),Oe=ref(a.navigation.displayPrivacyScreen),qe=ref(!0),At=ref(!1),Et=ref(null),ze=ref([]),kt=ref(null),Pt=ref(!1),jt=ref(null),Ie=ref(null),u=ref(!1),v=ref(!1);let Y="https://s.paybook.com",ae=null,xe=`${getVersion()}${a.strict?"-strict":""}`,Ve=null,Ue,Ne=null,L=[],Fe=null,Dt=null,er=null;const ir=computed(()=>{var Gr;return(Gr=z.value)!=null&&Gr.displayBackUpConnection||re.value?Fe:null}),cr=computed(()=>$e.value==="credential"||z.value||qe.value?!1:jt.value?a.entrypoint.site&&a.navigation.oneSiteFlow?jt.value==="twofa"&&a.navigation.enableTwofaBackNavigation||a.navigation.displayPrivacyScreen&&jt.value!=="finish":jt.value==="finish"?a.navigation.enableBackNavigation:jt.value==="twofa"?a.navigation.enableTwofaBackNavigation:a.navigation.enableBackNavigation&&jt.value==="start":!!kt.value||a.navigation.displayPrivacyScreen),sr=computed(()=>m.value.filter(Gr=>(Gr.id_country==="51ad44db3b8e77631200047d"||Gr.id_country==="51ad44793b8e77631200027a")&&a.internal.plaidSites||Or(Gr.id_country).length).sort((Gr,Lt)=>Gr.name.localeCompare(Lt.name))),ar=computed(()=>$r(g.value,kt.value)),fr=computed(()=>Or(g.value)),Cr=computed(()=>Pr(g.value,kt.value,Et.value)),Mr=computed(()=>({short:Ce.value,long:pe.value})),xr=computed(()=>{let Gr=[];return ze.value&&ze.value.forEach(Lt=>{Gr=[...Gr,...Lt.sites.map(tr=>({...tr,avatar:Lt.avatar,cover:Lt.cover,site_organization:Lt}))]}),Gr}),gr=computed(()=>ie.value||At.value?"":z.value?z.value.siteToUpdate?c("credential.header_title.update"):c("credential.header_title.sync"):Pt.value?c("accounts_selection.title"):jt.value?jt.value==="start"&&!ir.value?c("common.header.login"):"":kt.value?g.value&&kt.value?c("common.header.select"):"":c("common.header.link"));watch(()=>a.locale,(Gr,Lt)=>{Gr!==Lt&&["es","en"].includes(Gr)&&(f.value=Gr)}),watch(()=>a.internal,(Gr,Lt)=>{if(er.defaultParams=Gr.defaultHttpParams||{},er.defaultParams.locale=a.locale,Gr.apiEnv!==Lt.apiEnv)switch(er.updateEnvironment(Gr.apiEnv),Gr.apiEnv){case"production":Y="https://s.paybook.com";break;case"development":Y="https://s.paybook.dev";break;default:Y="https://s.paybook.com";break}Gr.apiBaseUrl!==Lt.apiBaseUrl&&Gr.apiBaseUrl&&er.updateApiBaseUrl(Gr.apiBaseUrl),Gr.assetsBaseUrl!==Lt.assetsBaseUrl&&Gr.assetsBaseUrl&&(Y=Gr.assetsBaseUrl),Lr()}),watch(()=>a.navigation.displayPersonalSites,()=>{Lr()}),watch(()=>a.navigation.displayBusinessSites,()=>{Lr()}),watch(Ce,Gr=>{Ve&&Ue.updateMessages({short:Gr})}),watch(pe,Gr=>{Ve&&Ue.updateMessages({long:Gr})}),watch(v,()=>{!v.value&&z.value?(z.value=null,Ne&&Ne()):!v.value&&!Ve&&jt.value&&jt.value!=="start"&&jt.value!=="finish"?(Ue=new NotificationUpdater({short:pe.value}),Ve=ElNotification.info({duration:0,message:h(TwofaNotification,{assetsPath:Y,buttonDisabledStyle:a.navigation.formButtonsDisabledStyle,disableFormAutocomplete:a.navigation.disableFormAutocomplete,duration:0,enableBackNavigation:a.navigation.enableTwofaBackNavigation,item:Fe,messagesUpdater:Ue,rootEmit:o,selectClass:a.navigation.selectClass,showLogo:a.navigation.displayLogoImages,showPasswordStyle:a.navigation.formShowPasswordStyle,t:c,type:"info",onBack:()=>{o("back"),Nr(),Fe=jt.value=null,Tr(Dt,!1),v.value=!0},onError:Gr=>{Kr(Gr)},onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),position:a.navigation.toastPosition,showClose:!1})):v.value&&Ve&&(v.value=!1,ElNotification.error({duration:0,position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initMessage:c("common.process_running"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}})}))}),onMounted(()=>{nextTick(()=>{o("dom-updated")})}),onUpdated(()=>{nextTick(()=>{o("dom-updated")})});function dr(){["es","en"].includes(a.locale)&&(f.value=a.locale),Y=a.internal.apiEnv?a.internal.apiEnv==="production"?"https://s.paybook.com":"https://s.paybook.dev":"https://s.paybook.com",a.internal.assetsBaseUrl&&(Y=a.internal.assetsBaseUrl),a.strict?(Yr(),qe.value=!0,setTimeout(()=>{er.strictMode({token:a.token,strict:a.strict}).then(()=>{Lr()})},400)):(Yr(),Lr())}function Br(){return z.value.siteToUpdate}function Ir(){measureEvent("close"),v.value=!1,(jt.value==="start"||jt.value==="finish")&&(jt.value=Fe=null),o("closed")}function Nr(){Ve&&(Ve.close(),Ve=null)}function Kr(Gr){const Lt=Sr(Gr);z.value&&(z.value.siteToUpdate||u.value)?z.value={...z.value,displayBackUpConnection:!1,siteToUpdate:void 0}:!a.navigation.displayErrorsInToast&&v?(re.value=!1,jt.value="finish",Fe&&(Fe.finalResponse="error"),he.value=c(`${Lt}long_description`),_e.value=c(`${Lt}short_description`)):ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:a.navigation.displayLongDescription,duration:0,initLongMessage:c(`${Lt}long_description`),initMessage:c(`${Lt}short_description`),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),vr(Gr,Lt)}const _r=debounce(200,function(){if(ie.value=!1,a.entrypoint.credential)return hr(a.entrypoint.credential,!0);if(a.entrypoint.updateCredential)return Hr(a.entrypoint.updateCredential,!0);if(a.entrypoint.site&&a.navigation.oneSiteFlow)er.getSite(a.entrypoint.site).then(Gr=>{if(o("loaded"),Gr&&Gr.length){const Lt=Gr[0].site_organization;Tr({...Gr[0],avatar:Lt.avatar,cover:Lt.avatar,site_organization:Lt})}else jr({response:{status:"site_not_found"}})}).catch(Gr=>jr(Gr.response||Gr)).finally(()=>{qe.value=!1});else{const Gr={};(a.navigation.displayPersonalSites||a.navigation.displayBusinessSites)&&!(a.navigation.displayPersonalSites&&a.navigation.displayBusinessSites)&&(a.navigation.displayPersonalSites?Gr.is_personal=1:Gr.is_business=1);const Lt=[er.getCountries(),er.getOrganizationTypes(),er.getOrganizationSites(Gr)];return Promise.all(Lt).then(tr=>{m.value=tr[0],L=tr[1],a.internal.plaidSites&&L.unshift({id_site_organization_type:"__internal__.plaidSites",label:"webapp_add_banks",name:"plaid"}),ze.value=tr[2]}).then(()=>nextTick().then(()=>{if(o("loaded"),ur(),a.entrypoint.site){const tr=xr.value.find(rr=>rr.id_site===a.entrypoint.site);return tr?Tr(tr):Promise.reject({response:{response:{status:"site_not_found"}}})}})).catch(tr=>jr(tr.response||tr)).finally(()=>{qe.value=!1})}});function vr(Gr,Lt){o("api-error",Gr.response?Gr.response.status:500,{longMessage:c(`${Lt}real.long_description`),message:c(`${Lt}real.short_description`),noInternet:!Gr.response})}function Vr(Gr){o("socket-error",{longMessage:c(`socket.${Gr}.long_description`),type:Gr,message:c(`socket.${Gr}.short_description`)})}function $r(Gr,Lt){return(a.navigation.displaySiteOrganizations.length||a.navigation.hideSiteOrganizations.length?ze.value.filter(tr=>{if(a.navigation.displaySiteOrganizations.length)return!!a.navigation.displaySiteOrganizations.find(rr=>rr===tr.name||rr===tr.id_site_organization);if(a.navigation.hideSiteOrganizations.length)return!a.navigation.hideSiteOrganizations.find(rr=>rr===tr.name||rr===tr.id_site_organization)}):ze.value).filter(tr=>Gr===tr.id_country&&Lt===tr.id_site_organization_type&&Pr(Gr,Lt,tr.id_site_organization).length)}function Or(Gr){return(a.navigation.displaySiteOrganizationTypes.length||a.navigation.hideSiteOrganizationTypes.length?L.filter(Lt=>{if(a.navigation.displaySiteOrganizationTypes.length)return!!a.navigation.displaySiteOrganizationTypes.find(tr=>tr===Lt.name||tr===Lt.id_site_organization_type);if(a.navigation.hideSiteOrganizationTypes.length)return!a.navigation.hideSiteOrganizationTypes.find(tr=>tr===Lt.name||tr===Lt.id_site_organization_type)}):L).filter(Lt=>(Gr==="51ad44db3b8e77631200047d"||Gr==="51ad44793b8e77631200027a")&&a.internal.plaidSites&&Lt.id_site_organization_type==="__internal__.plaidSites"?!0:$r(Gr,Lt.id_site_organization_type).length)}function Pr(Gr,Lt,tr){return(a.navigation.displaySites.length||a.navigation.hideSites.length?xr.value.filter(rr=>{if(a.navigation.displaySites.length)return!!a.navigation.displaySites.find(pr=>pr===rr.name||pr===rr.id_site);if(a.navigation.hideSites.length)return!a.navigation.hideSites.find(pr=>pr===rr.name||pr===rr.id_site)}):xr.value).filter(rr=>Gr===rr.site_organization.id_country&&Lt===rr.site_organization.id_site_organization_type&&tr===rr.site_organization.id_site_organization)}function Sr(Gr){return typeof Gr=="string"?Gr:Gr.status===401?"api_errors.unauthorized.":Gr.response&&Gr.response.data&&Gr.response.data.message==="Credential error, please consider updating credential password"?"api_errors.credential_error.":`api_errors.${Gr.response?Gr.response.status?Gr.response.status:500:"no_internet"}.`}function Er(){return er.getLastRid()}function zr(){jt.value?jt.value==="finish"?re.value?xn():br():jt.value==="twofa"?En():xn():Et.value?lr():kt.value?nr():(o("back"),Oe.value=!0)}function Lr(){qe.value=!0,_r()}function jr(Gr){const Lt=Sr(Gr);ie.value=Lt,!Gr.response&&a.navigation.displayErrorsInToast&&ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initLongMessage:c(`${Lt}long_description`),initMessage:c(`${Lt}short_description`),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),o("loaded"),vr(Gr,Lt)}function Ar(){measureEvent("open"),qe.value||ur(),v.value=!0,o("opened")}function lr(Gr=!0){Gr&&o("back"),Et.value=null,ar.value.length===1&&nr(!1)}function nr(Gr=!0){Gr&&o("back"),kt.value=null,fr.value.length===1&&(sr.value.length===1||a.navigation.hideSelectCountry)&&a.navigation.displayPrivacyScreen&&(Oe.value=!0)}function or(){Oe.value=!1,(sr.value.length===1||a.navigation.hideSelectCountry)&&fr.value.length===1&&(kt.value=fr.value[0].id_site_organization_type)}function br(){kt.value=$e.value=jt.value=Et.value=Fe=null}function yr(Gr){o("organization-selected",Gr),measureEvent("open_site_organization",{id_site_organization:Gr.id_site_organization}),Et.value=Gr.id_site_organization,nextTick(()=>{Cr.value.length===1&&Tr(Cr.value[0])})}function Tr(Gr,Lt=!0){let tr;Lt&&(o("organization-site-selected",Gr),measureEvent("open_site",{id_site:Gr.id_site})),!Fe||!Fe.loading?(Dt=Gr,tr=Fe=er.siteConnection(Gr),jt.value="start",_e.value=null,he.value=null,Fe.on("login-success",()=>{v.value&&a.navigation.displayStatusInToast&&Ir()}),Fe.on("socket-close",Nr),Fe.on("socket-error",()=>{a.navigation.displayErrorsInToast?ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,duration:0,hideForm:!0,initLongMessage:c("socket.error.long_description"),initMessage:c("socket.error.short_description"),item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}):(he.value=c("socket.error.long_description"),_e.value=c("socket.error.short_description")),Vr("error")}),Fe.on("socket-message",rr=>{const pr=`socket.message.${rr.code?rr.code:500}.`,wr=c(`${pr}short_description`),Ur=c(`${pr}long_description`);switch(!0){case(400<=rr.code&&rr.code<600&&rr.code!==410):Nr(),_e.value=wr,he.value=Ur,o("error",Fe.response,{code:rr.code,longMessage:Ur,message:wr}),rr.code>=500&&isSiteV4Service(Fe)&&Fe.backUpConnection&&!$e.value&&(o("back-up-site",Fe.config.id_site),measureEvent("back-up-site",{id_site:Fe.config.id_site}),re.value=!0),v.value?a.navigation.returnToSiteFormOnUserError!==!1&&(a.navigation.returnToSiteFormOnUserError===!0&&[401,403,411].includes(rr.code)||a.navigation.returnToSiteFormOnUserError!==!0&&a.navigation.returnToSiteFormOnUserError.includes(rr.code))&&(jt.value=Fe=null,Tr(Dt,!1),Ie.value={short:wr,long:Ur}):re.value?Ar():(ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:Ur,initMessage:wr,item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),br(),ur());break;case(200<=rr.code&&rr.code<300):Nr(),_e.value=wr,he.value=Ur,o("success",Fe.response),v.value?$e.value==="credential"&&(z.value={avatar:`${Y}${Fe.config.avatar}`,loaderType:"success",loading:!0,messages:{short:_e.value,long:he.value}}):(ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,hideForm:!0,initLongMessage:Ur,initMessage:wr,item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),br(),ur());break;default:Ce.value=wr,pe.value=Ur}o("status",rr)}),Fe.on("socket-quick-answer",()=>{_e.value=c("socket.quick_answer.short_description"),he.value=c("socket.quick_answer.long_description"),o("success",Fe.response),Nr(),v.value?$e.value==="credential"&&(z.value={avatar:`${Y}${Fe.config.avatar}`,loaderType:"success",loading:!0,messages:{short:_e.value,long:he.value}}):(ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,hideForm:!0,initLongMessage:c("socket.quick_answer.long_description"),initMessage:c("socket.quick_answer.short_description"),item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),br(),ur())}),Fe.on("socket-timeout",()=>{_e.value=c("socket.timeout.short_description"),he.value=c("socket.timeout.long_description"),o("error",Fe.response),(!v.value||a.navigation.displayErrorsInToast)&&(ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:c("socket.timeout.long_description"),initMessage:c("socket.timeout.short_description"),item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),v.value||(br(),ur())),Vr("timeout")}),Fe.on("status-update",rr=>{Fe===tr&&(jt.value=rr)}),Fe.on("twofa",()=>{Ce.value=c("twofa.waiting")})):ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initMessage:c("common.process_running"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})}function hr(Gr,Lt=!1,tr=!1){if(!Gr)throw new Error("idCredential is required to update credential");if(Oe.value=!1,qe.value=!1,tr?(u.value=!0,measureEvent("update_credential",{id_credential:Gr})):measureEvent("open_credential",{id_credential:Gr}),!ae||!ae.loading){let rr=new NotificationUpdater({short:c("credential.search.title")}),pr;Ne=()=>{pr=ElNotification.info({showClose:!1,position:a.navigation.toastPosition,duration:0,message:h(TwofaNotification,{assetsPath:Y,duration:0,messagesUpdater:rr,showLogo:!1,t:c,type:"info",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}})})},a.navigation.displayCredentialInModal?(z.value={loaderType:"loading",loading:!0,messages:{short:c("credential.search.title"),long:c("credential.search.message")}},v.value||Ar()):(v.value&&Ir(),Ne()),ae=er.syncCredential(Gr,tr),ae.on("error",()=>{const{code:wr}=ae.error,Ur=ae.error.response?Sr(ae.error):`socket.message.${wr||500}.`,qr=c(`${Ur}short_description`),Jr=c(`${Ur}long_description`);v.value?(z.value={...z.value,loaderType:"error",messages:{short:qr,long:Jr},siteToUpdate:void 0},Ne=null):(ae.error.response?pr&&pr.close():Nr(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:Jr,initMessage:qr,item:ae,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),ae.error.response?vr(ae.error,Ur):o("error",ae.response,{code:wr,longMessage:Jr,message:qr})}),ae.on("found",()=>{Lt&&o("loaded"),tr?(pr&&pr.close(),Ne=null,pr=ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:!1,duration:a.navigation.toastDuration,initMessage:c("credential.found.title"),item:ae,assetsPath:Y,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),v.value=!0,z.value={avatar:a.navigation.displayLogoImages?`${Y}${ae.config.avatar}`:void 0,loading:!1,siteToUpdate:ae.getSiteService()}):(v.value&&(z.value={...z.value,avatar:a.navigation.displayLogoImages?`${Y}${ae.config.avatar}`:void 0,messages:{short:c("credential.found.title"),long:c("credential.found.message")}}),rr.updateMessages({long:c("credential.found.message"),short:c("credential.found.title")}))}),ae.on("loading",()=>{o("updated",ae.response),Ne=()=>{Ue=new NotificationUpdater({}),Ve=ElNotification.info({showClose:!1,position:a.navigation.toastPosition,duration:0,message:h(TwofaNotification,{assetsPath:Y,buttonDisabledStyle:a.navigation.formButtonsDisabledStyle,disableFormAutocomplete:a.navigation.disableFormAutocomplete,duration:0,item:ae,messagesUpdater:Ue,rootEmit:o,selectClass:a.navigation.selectClass,showLogo:a.navigation.displayLogoImages,showPasswordStyle:a.navigation.formShowPasswordStyle,t:c,type:"info",onError:wr=>{Nr(),Kr(wr)},onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}})})},v.value?z.value={...z.value,loaderType:"loading",loading:!0,messages:{short:c("credential.loading.title"),long:c("credential.loading.message")},siteToUpdate:void 0}:(pr&&pr.close(),Ne())}),ae.on("not-found",()=>{const wr=Sr(ae.error);Lt&&o("loaded"),v.value?(z.value={...z.value,loaderType:"error",messages:{short:c(`${wr}short_description`),long:c(`${wr}long_description`)}},Ne=null):(pr&&pr.close(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:c(`${wr}long_description`),initMessage:c(`${wr}short_description`),t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),vr(ae.error,wr)}),ae.on("socket-error",()=>{v.value?(z.value={...z.value,loaderType:"error",messages:{short:c("socket.error.short_description"),long:c("socket.error.long_description")}},Ne=null):(Nr(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,initLongMessage:c("socket.error.long_description"),initMessage:c("socket.error.short_description"),item:ae,hideForm:!0,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),Vr("error")}),ae.on("socket-message",wr=>{const Ur=ae.getSite(),qr=`socket.message.${wr.code?wr.code:500}.`,Jr=c(`${qr}short_description`),Rn=c(`${qr}long_description`);wr.code>=500&&Ur.version===4&&Ur.input.some(Qr=>Qr.name===SiteV4Service.statementParseInputName)&&!$e.value?(Tr({...Ur,avatar:Ur.site_organization.avatar,cover:Ur.site_organization.cover},!1),o("back-up-site",Ur.id_site),measureEvent("back-up-site",{id_site:Ur.id_site}),z.value={...z.value,displayBackUpConnection:!0},v.value||(Nr(),Ar())):v.value?z.value={...z.value,messages:{short:Jr,long:Rn}}:Ue.updateMessages({long:Rn,short:Jr}),o("status",wr)}),ae.on("socket-quick-answer",()=>{_e.value=c("socket.quick_answer.short_description"),he.value=c("socket.quick_answer.long_description"),o("success",ae.response),v.value?(z.value={...z.value,loaderType:"success",messages:{short:c("socket.quick_answer.short_description"),long:c("socket.quick_answer.long_description")}},Ne=null):(Nr(),ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,initLongMessage:c("socket.quick_answer.long_description"),initMessage:c("socket.quick_answer.short_description"),item:ae,hideForm:!0,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}))}),ae.on("socket-timeout",()=>{v.value?(z.value={...z.value,loaderType:"error",messages:{short:c("socket.timeout.short_description"),long:c("socket.timeout.long_description")}},Ne=null):(Nr(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:c("socket.timeout.long_description"),initMessage:c("socket.timeout.short_description"),item:ae,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),o("error",ae.response),Vr("timeout")}),ae.on("success",()=>{const{code:wr}=ae.message,Ur=`socket.message.${wr||500}.`,qr=c(`${Ur}short_description`),Jr=c(`${Ur}long_description`);v.value?(z.value={...z.value,loaderType:"success",messages:{short:qr,long:Jr}},Ne=null):(Nr(),ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,hideForm:!0,initLongMessage:Jr,initMessage:qr,item:ae,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration})),o("success",ae.response)}),ae.on("twofa",()=>{v.value&&pr&&pr.close(),z.value={...z.value,loading:!1}}),ae.on("twofa-api-error",()=>{v.value?(z.value={...z.value,loaderType:"error",messages:{short:c("credential.api_error.title"),long:c("credential.api_error.message")}},Ne=null):Nr()}),ae.on("twofa-loading",()=>{z.value={...z.value,loading:!0,loaderType:"loading",messages:{short:c("twofa.waiting"),long:c("twofa.waiting")}}})}else ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initMessage:c("common.process_running"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})}function ur(){if(ie.value)return;let Gr;a.entrypoint.country&&(Gr=sr.value.find(Lt=>Lt.code===a.entrypoint.country||Lt.id_country===a.entrypoint.country)),sr.value.length?(g.value=Gr?Gr.id_country:sr.value[0].id_country,measureEvent("open_country",{id_country:g.value}),vn(),At.value=!1):!jt.value&&!z.value&&(At.value=!0)}function vn(){if(a.entrypoint.siteOrganizationType){const Gr=fr.value.find(Lt=>Lt.id_site_organization_type===a.entrypoint.siteOrganizationType);if(Gr){const Lt=Gr.id_site_organization_type;measureEvent("open_site_organization_type",{id_site_organization_type:Lt}),kt.value=Lt}}}function Yr(){er=new Sync(a.token,{http:{baseURL:a.internal.apiBaseUrl?a.internal.apiBaseUrl:a.internal.apiEnv?a.internal.apiEnv==="production"?"https://sync.paybook.com":"https://api.syncfy.paybook.dev":"https://sync.paybook.com",isStrict:!!a.strict},defaultParams:{locale:a.locale,...a.internal.defaultHttpParams},isHeadless:!1,quickAnswer:a.navigation.quickAnswer,saveCredential:a.navigation.saveCredential,socketTimeout:a.navigation.socketTimeout,widgetVersion:xe});let Gr=null;er.on("sync_401",()=>{a.refreshTokenFunction&&!Gr&&(Gr=ElNotification.error({position:a.navigation.toastPosition,showClose:!1,message:h(UnauthorizedNotification,{initTitle:c("common.unauthorized"),initMessage:c("common.unauthorized_message"),refreshTokenFunction:a.refreshTokenFunction,t:c,onClosed:()=>{Gr=null},onCloseNotification:()=>{Gr.close()},onRefreshToken:({token:Lt,strict:tr,resolve:rr})=>{s("tokenRefreshed",Lt),Wr(Lt,tr).then(()=>(Gr.close(),ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:!1,duration:a.navigation.toastDuration,initMessage:c("common.session_refreshed_message"),initTitle:c("common.session_refreshed"),showLogo:!1,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),Lr(),rr(null)))},onRefreshTokenError:()=>{ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:!1,duration:0,initMessage:c("common.session_error"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})}}),duration:0})),o("401")})}function Wr(Gr,Lt){return Lt?er.strictMode({token:Gr,strict:Lt}):er.updateToken(Gr)}function xn(){o("back"),re.value=!1,$e.value=null,a.entrypoint.site&&a.navigation.oneSiteFlow&&a.navigation.displayPrivacyScreen?Oe.value=!0:(measureEvent("close_site",{id_site:Fe.config.id_site}),jt.value=Fe=null,Ie.value=null,Cr.value.length===1&&lr(!1))}function Xr(Gr=!1){Ce.value=c("site.login.authenticating"),Ie.value=null,Gr&&(z.value?$e.value="credential":$e.value="site")}function wn(){z.value&&(z.value=null),re.value&&(re.value=!1),Ce.value=c("site.login.success")}function En(Gr=!0){Gr&&o("back"),jt.value=Fe=null,Tr(Dt,!1)}function Hr(Gr,Lt=!1){if(!Gr)throw new Error("idCredential is required to update credential");hr(Gr,Lt,!0)}function Zr(){Ce.value=c("credential.loading.title"),pe.value=c("credential.loading.message")}return dr(),t({close:Ir,getLastRid:Er,open:Ar,setCredential:hr,setToken:Wr,updateCredential:Hr}),(Gr,Lt)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(TheModal,{visible:v.value,"onUpdate:visible":Lt[5]||(Lt[5]=tr=>v.value=tr),mobile:unref(y)},{default:withCtx(()=>[v.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass([Gr.$style.container,{[Gr.$style["is-mobile"]]:unref(y)}])},[Oe.value?(openBlock(),createBlock(PrivacyPolicy,{key:0,client:a.client,onContinue:or},null,8,["client"])):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode("div",{class:normalizeClass(Gr.$style["widget-header"])},[cr.value?(openBlock(),createElementBlock("button",{key:0,"aria-label":unref(c)("common.back"),class:normalizeClass(Gr.$style["widget-back-button"]),onClick:zr},[createVNode(_sfc_main$h,{icon:"back"})],10,_hoisted_1)):(openBlock(),createElementBlock("span",_hoisted_2)),createBaseVNode("h1",null,toDisplayString$1(jt.value&&a.entrypoint.site?unref(c)("common.update_title"):gr.value),1),createBaseVNode("button",{class:normalizeClass(Gr.$style["widget-close-button"]),"aria-label":unref(c)("common.close"),onClick:Ir},[createVNode(_sfc_main$h,{icon:"close"})],10,_hoisted_3)],2),createBaseVNode("div",{class:normalizeClass(Gr.$style["widget-content"])},[z.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Gr.$style["credential-content"])},[z.value.displayBackUpConnection?(openBlock(),createBlock(BackUpConnection,{key:0,"assets-path":unref(Y),"button-disabled-style":a.navigation.formButtonsDisabledStyle,credential:unref(ae),"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"display-back-button":!1,"error-message":null,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:ir.value,"test-mode":Gr.enableTestMode,"update-mode":u.value,onError:Kr,onSuccess:wn,onValid:Lt[0]||(Lt[0]=()=>Xr(!0))},null,8,["assets-path","button-disabled-style","credential","disable-form-autocomplete","loader-message","select-class","show-logo","show-password-style","site","test-mode","update-mode"])):z.value.siteToUpdate?(openBlock(),createBlock(SiteForm,{key:1,"assets-path":unref(Y),"button-disabled-style":a.navigation.formButtonsDisabledStyle,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"credential-service":unref(ae),"display-back-button":!1,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:Br(),"test-mode":Gr.enableTestMode,"update-mode":!0,onValid:Zr},null,8,["assets-path","button-disabled-style","disable-form-autocomplete","credential-service","loader-message","select-class","show-logo","show-password-style","site","test-mode"])):(openBlock(),createElementBlock(Fragment,{key:2},[z.value.loading||z.value.loaderType!=="loading"?(openBlock(),createBlock(AppLoader,{key:0,avatar:z.value.avatar,grow:z.value.loaderType==="loading",message:z.value.messages.long,size:"large",title:z.value.messages.short,type:z.value.loaderType},null,8,["avatar","grow","message","title","type"])):unref(ae).twofa?(openBlock(),createBlock(TwofaForm,{key:1,avatar:z.value.avatar,"button-disabled-style":a.navigation.formButtonsDisabledStyle,cover:`${unref(Y)}${unref(ae).config.cover}`,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"enable-back-navigation":!1,"in-notification":!1,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,"site-name":unref(ae).config.name,twofa:unref(ae).twofa},null,8,["avatar","button-disabled-style","cover","disable-form-autocomplete","loader-message","select-class","show-logo","show-password-style","site-name","twofa"])):createCommentVNode("",!0),z.value.loaderType!=="loading"?(openBlock(),createElementBlock("button",{key:2,class:"pb-w-sync_primary-button","data-testid":"credential-finish-button",onClick:Ir},toDisplayString$1(unref(c)("common.finish")),1)):createCommentVNode("",!0)],64))],2)):(openBlock(),createElementBlock(Fragment,{key:1},[qe.value?(openBlock(),createBlock(AppLoader,{key:0})):createCommentVNode("",!0),!qe.value&&!ie.value&&!At.value?(openBlock(),createElementBlock(Fragment,{key:1},[jt.value?(openBlock(),createElementBlock(Fragment,{key:1},[re.value?(openBlock(),createBlock(BackUpConnection,{key:0,"assets-path":unref(Y),"button-disabled-style":a.navigation.formButtonsDisabledStyle,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"display-back-button":!(a.entrypoint.site&&a.navigation.oneSiteFlow)||a.navigation.displayPrivacyScreen,"error-message":Ie.value,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:ir.value,"test-mode":Gr.enableTestMode,onBack:xn,onError:Kr,onSuccess:wn,onValid:Lt[3]||(Lt[3]=()=>Xr(!0))},null,8,["assets-path","button-disabled-style","disable-form-autocomplete","display-back-button","error-message","loader-message","select-class","show-logo","show-password-style","site","test-mode"])):jt.value==="start"||jt.value==="loading"?(openBlock(),createBlock(SiteForm,{key:1,"assets-path":unref(Y),"back-up-connection":!!$e.value,"button-disabled-style":a.navigation.formButtonsDisabledStyle,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"display-back-button":a.navigation.enableBackNavigation&&$e.value!=="credential"&&(!(a.entrypoint.site&&a.navigation.oneSiteFlow)||a.navigation.displayPrivacyScreen),"error-message":Ie.value,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:unref(Fe),"test-mode":Gr.enableTestMode,onBack:xn,onError:Kr,onSuccess:wn,onValid:Xr},null,8,["assets-path","back-up-connection","button-disabled-style","disable-form-autocomplete","display-back-button","error-message","loader-message","select-class","show-logo","show-password-style","site","test-mode"])):jt.value==="twofa"||jt.value==="twofa-loading"?(openBlock(),createBlock(TwofaForm,{key:2,avatar:`${unref(Y)}${unref(Fe).config.avatar}`,"button-disabled-style":a.navigation.formButtonsDisabledStyle,cover:`${unref(Y)}${unref(Fe).config.cover}`,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"enable-back-navigation":a.navigation.enableTwofaBackNavigation&&$e.value!=="credential","in-notification":!1,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,"site-name":unref(Fe).config.name,twofa:unref(Fe).twofa,onBack:En,onError:Kr},null,8,["avatar","button-disabled-style","cover","disable-form-autocomplete","enable-back-navigation","loader-message","select-class","show-logo","show-password-style","site-name","twofa"])):jt.value==="finish"?(openBlock(),createElementBlock(Fragment,{key:3},[Pt.value?(openBlock(),createBlock(AccountsSelection,{key:0,avatar:a.navigation.displayLogoImages?`${unref(Y)}${unref(Fe).config.avatar}`:void 0,"button-disabled-style":a.navigation.formButtonsDisabledStyle,client:a.client,credential:unref(Fe).response.id_credential,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"get-selected-accounts":a.navigation.getSelectedAccounts,"select-class":a.navigation.selectClass,sync:unref(er),onDone:Ir},null,8,["avatar","button-disabled-style","client","credential","disable-form-autocomplete","get-selected-accounts","select-class","sync"])):(openBlock(),createBlock(FinalResponse,{key:1,avatar:`${unref(Y)}${unref(Fe).config.avatar}`,"display-accounts-selection":a.navigation.displayAccountsSelection,"display-add-another-button":$e.value!=="credential"&&!(a.navigation.oneSiteFlow&&a.entrypoint.site),"long-message":he.value,message:_e.value,"show-logo":a.navigation.displayLogoImages,type:unref(Fe).finalResponse,onAddOther:br,onSelectAccounts:Lt[4]||(Lt[4]=()=>{Pt.value=!0})},null,8,["avatar","display-accounts-selection","display-add-another-button","long-message","message","show-logo","type"]))],64)):createCommentVNode("",!0)],64)):(openBlock(),createElementBlock("div",_hoisted_4,[g.value&&!kt.value?(openBlock(),createBlock(InstitutionFilters,{key:0,"country-id":g.value,"onUpdate:countryId":Lt[1]||(Lt[1]=tr=>g.value=tr),"organization-type-id":kt.value,"onUpdate:organizationTypeId":Lt[2]||(Lt[2]=tr=>kt.value=tr),"filtered-countries":sr.value,"filtered-organization-types":fr.value,"select-class":a.navigation.selectClass,"show-countries":!a.navigation.hideSelectCountry},null,8,["country-id","organization-type-id","filtered-countries","filtered-organization-types","select-class","show-countries"])):createCommentVNode("",!0),g.value&&kt.value&&!Et.value?(openBlock(),createBlock(OrganizationSitesList,{key:1,"assets-path":unref(Y),items:ar.value,"show-logo":a.navigation.displayLogoImages,"show-plaid-sites-button":a.internal.plaidSites&&kt.value==="__internal__.plaidSites",onSelect:yr},null,8,["assets-path","items","show-logo","show-plaid-sites-button"])):createCommentVNode("",!0),g.value&&kt.value&&Et.value?(openBlock(),createBlock(SitesList,{key:2,"assets-path":unref(Y),items:Cr.value,organization:ar.value.find(tr=>tr.id_site_organization===Et.value),"show-logo":a.navigation.displayLogoImages,onBack:lr,onSelect:Tr},null,8,["assets-path","items","organization","show-logo"])):createCommentVNode("",!0)]))],64)):createCommentVNode("",!0),ie.value?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(Gr.$style["widget-data-error"])},[createVNode(_sfc_main$h,{icon:"x-circle"}),createBaseVNode("h2",null,toDisplayString$1(unref(c)(`${ie.value}short_description`)),1),createBaseVNode("p",null,toDisplayString$1(unref(c)(`${ie.value}long_description`)),1),createBaseVNode("button",{class:"pb-w-sync_primary-button",onClick:Lr},toDisplayString$1(unref(c)("common.retry")),1)],2)):createCommentVNode("",!0),At.value?(openBlock(),createElementBlock("div",{key:3,class:normalizeClass(Gr.$style["widget-data-error"])},[createVNode(_sfc_main$h,{icon:"x-circle"}),createBaseVNode("p",null,toDisplayString$1(unref(c)("common.no_filtered_data")),1),createBaseVNode("button",{class:"pb-w-sync_primary-button",onClick:Ir},toDisplayString$1(unref(c)("common.close")),1)],2)):createCommentVNode("",!0)],64)),!qe.value&&!ie.value&&!At.value||z.value?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(Gr.$style["security-banner"])},[createBaseVNode("p",null,toDisplayString$1(unref(c)("common.security_banner_title")),1),createBaseVNode("p",null,toDisplayString$1(unref(c)("common.security_banner_content")),1)],2)):createCommentVNode("",!0)],2)],64))],2)):createCommentVNode("",!0)]),_:1},8,["visible","mobile"]),createBaseVNode("div",{class:normalizeClass(Gr.$style["widget-version"])},toDisplayString$1(unref(xe)),3)],64))}}),container="pb-w-sync_container",style0={container,"credential-content":"pb-w-sync_credential-content","is-mobile":"pb-w-sync_is-mobile","security-banner":"pb-w-sync_security-banner","widget-back-button":"pb-w-sync_widget-back-button","widget-close-button":"pb-w-sync_widget-close-button","widget-content":"pb-w-sync_widget-content","widget-data-error":"pb-w-sync_widget-data-error","widget-header":"pb-w-sync_widget-header","widget-version":"pb-w-sync_widget-version"},cssModules={$style:style0},DataWidget=_export_sfc(_sfc_main$1,[["__cssModules",cssModules]]),_sfc_main=defineComponent({__name:"App",props:{config:{default:()=>({})},enableTestMode:{type:Boolean,default:!1},refreshTokenFunction:{type:Function,default:void 0},strict:{default:void 0},token:{}},setup(e,{expose:t}){const n=e,a=ref(null),{t:s}=useI18n();provide(translateFunction,s);const o={client:{},locale:"en",entrypoint:{country:"MX"},navigation:{disableFormAutocomplete:!1,displayAccountsSelection:!1,displayBusinessSites:!0,displayCredentialInModal:!1,displayErrorsInToast:!0,displayLogoImages:!0,displayLongDescription:!1,displayPersonalSites:!0,displayPrivacyScreen:!0,displaySiteOrganizations:[],displaySiteOrganizationTypes:[],displaySites:[],displayStatusInToast:!1,enableBackNavigation:!0,enableTwofaBackNavigation:!1,formButtonsDisabledStyle:!1,formShowPasswordStyle:"icon",getSelectedAccounts:void 0,hideSelectCountry:!1,hideSiteOrganizations:[],hideSiteOrganizationTypes:[],hideSites:[],oneSiteFlow:!1,quickAnswer:!1,returnToSiteFormOnUserError:!1,saveCredential:!0,selectClass:"",socketTimeout:24e4,toastDuration:5e3,toastPosition:"top-right"},__internal__:{apiBaseUrl:null,apiEnv:null,assetsBaseUrl:null,plaidSites:!1,defaultHttpParams:{}}},c=reactive({client:{...o.client,...$e(n.config.client)},enableTestMode:n.enableTestMode,entrypoint:{...o.entrypoint,...$e(n.config.entrypoint)},internal:{...o.__internal__,...$e(n.config.__internal__)},locale:n.config.locale||o.locale,navigation:{...o.navigation,...$e(n.config.navigation)},refreshTokenFunction:n.refreshTokenFunction,strict:n.strict,token:n.token,onTokenRefreshed:pe=>{c.token=pe}});function f(){a.value.close()}function y(){return a.value.getLastRid()}function m(){nextTick(()=>{a.value.open()})}function g(pe={}){try{configValidator.validateSync(pe)}catch(Ce){if(Ce.name==="ValidationError")throw new Error(`ValidationError: ${Ce.message}`)}c.client={...o.client,...$e(pe.client)},c.entrypoint={...o.entrypoint,...$e(pe.entrypoint)},c.internal={...o.__internal__,...$e(pe.__internal__)},c.locale=pe.locale||o.locale,c.navigation={...o.navigation,...$e(pe.navigation)}}function z(pe){a.value.setCredential(pe)}function ie(pe){c.entrypoint={...c.entrypoint,site:pe},m()}function re(pe){a.value.updateCredential(pe)}function he(pe,Ce){return a.value.setToken(pe,Ce)}function _e(pe={}){try{configValidator.validateSync(pe)}catch(Ce){if(Ce.name==="ValidationError")throw new Error(`ValidationError: ${Ce.message}`)}c.client={...c.client,...$e(pe.client)},c.entrypoint={...c.entrypoint,...$e(pe.entrypoint)},c.internal={...c.internal,...$e(pe.__internal__)},c.locale=pe.locale||c.locale,c.navigation={...c.navigation,...$e(pe.navigation)}}function $e(pe={}){const Ce={...pe};return Object.keys(Ce).forEach(Oe=>{Ce[Oe]===void 0&&delete Ce[Oe]}),Ce}return t({close:f,getLastRid:y,open:m,setConfig:g,setEntrypointCredential:z,setEntrypointSite:ie,setEntrypointUpdateCredential:re,setToken:he,upsertConfig:_e}),(pe,Ce)=>(openBlock(),createBlock(unref(ElConfigProvider),{locale:c.locale==="es"?unref(es):unref(en)},{default:withCtx(()=>[createVNode(DataWidget,mergeProps(c,{ref_key:"widgetComponent",ref:a}),null,16)]),_:1},8,["locale"]))}});function setDefaultConfig(e){return e||(e={}),{locale:e.locale?e.locale:"en",quickAnswer:!!e.quickAnswer,socketTimeout:e.socketTimeout||24e4}}function setSync(e,t){return new Promise(a=>{const s=new Sync(e.token,{http:{baseURL:"https://sync.paybook.com",isStrict:!!e.strict},defaultParams:{locale:t.locale},isHeadless:!0,quickAnswer:t.quickAnswer,socketTimeout:t.socketTimeout,widgetVersion:`${getVersion()}-headless`});e.strict?s.strictMode({token:e.token,strict:e.strict}).then(()=>{a(s)}):a(s)})}function getAccounts(e,t,n){return new Promise((s,o)=>{const c=setDefaultConfig(n);setSync(e,c).then(f=>{f.getAccounts({id_credential:t}).then(y=>{s(y)}).catch(y=>{o(y)})})})}function getCountries(e,t){return new Promise((a,s)=>{const o=setDefaultConfig(t);setSync(e,o).then(c=>{c.getCountries().then(f=>{a(f)}).catch(f=>{s(f)})})})}function getOrganizationSites(e,t={},n){return new Promise((s,o)=>{const c=setDefaultConfig(n);setSync(e,c).then(f=>{f.getOrganizationSites(t).then(y=>{s(y)}).catch(y=>{o(y)})})})}function getOrganizationTypes(e,t){return new Promise((a,s)=>{const o=setDefaultConfig(t);setSync(e,o).then(c=>{c.getOrganizationTypes().then(f=>{a(f)}).catch(f=>{s(f)})})})}function getSite(e,t,n){return new Promise((s,o)=>{const c=setDefaultConfig(n);setSync(e,c).then(f=>{f.getSite(t).then(y=>{s(y[0])}).catch(y=>{o(y)})})})}function siteConnection(e,t,n){return new Promise(s=>{const o=setDefaultConfig(n);setSync(e,o).then(c=>{s(c.siteConnection(t))})})}function syncCredential(e,t,n){return new Promise(s=>{const o=setDefaultConfig(n);setSync(e,o).then(c=>{s(c.syncCredential(t))})})}function twofa(e,t,n,a){return new Promise(o=>{const c=setDefaultConfig(a);setSync(e,c).then(f=>{o(new TWOFA({...t,id_site:n},f.getHttpService(),!1))})})}function updateCredential(e,t,n){return new Promise(s=>{const o=setDefaultConfig(n);setSync(e,o).then(c=>{s(c.syncCredential(t,!0))})})}const staticMethods={getAccounts,getCountries,getOrganizationSites,getOrganizationTypes,getSite,siteConnection,syncCredential,twofa,updateCredential};initFirebase();class SyncfyWidget{constructor(t){const n=new Rollbar({accessToken:"2d928ea9aa674c6ea84dbf6f3901a403",captureUncaught:!1,captureUnhandledRejections:!1,enabled:!0,environment:"production",payload:{code_version:getVersion()}});let a;if(typeof t=="string")a={token:t};else if(typeof t=="object")a=t;else throw new Error("Invalid params type. Params must be either string or object.");try{paramsValidator.validateSync(a)}catch(g){if(g.name==="ValidationError")throw new Error(`ValidationError: ${g.message}`)}measureEvent("instantiation");const s=createApp(_sfc_main,{config:a.config,enableTestMode:a.enableTestMode,refreshTokenFunction:a.refreshTokenFunction,strict:a.strict,token:a.token}),o=createI18n({fallbackLocale:"en",locale:"en",messages:{en:resource$1,es:resource}});s.use(o),s.use(ge$1),s.config.errorHandler=g=>{throw n.error(g),g};const c=[];function f(g,z){c.push({callback:z,e:g})}function y(g,...z){c.forEach(({callback:ie,e:re})=>{g===re&&ie(...z)})}s.provide(rootEmitter,y);const m=s.mount(a.element||"#widget");return{on:f,close:m.close,getLastRid:m.getLastRid,open:m.open,setConfig:m.setConfig,setEntrypointCredential:m.setEntrypointCredential,setEntrypointSite:m.setEntrypointSite,setEntrypointUpdateCredential:m.setEntrypointUpdateCredential,setToken:m.setToken,upsertConfig:m.upsertConfig}}static getVersion(){return getVersion()}}return $n(SyncfyWidget,"headless",staticMethods),window.SyncfyWidget=SyncfyWidget,SyncfyWidget});
877
+ `+o):a.stack=o}catch{}}throw a}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=mergeConfig$1(this.defaults,n);const{transitional:a,paramsSerializer:s,headers:o}=n;a!==void 0&&validator.assertOptions(a,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),s!=null&&(utils$1.isFunction(s)?n.paramsSerializer={serialize:s}:validator.assertOptions(s,{encode:validators.function,serialize:validators.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),validator.assertOptions(n,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=o&&utils$1.merge(o.common,o[n.method]);o&&utils$1.forEach(["delete","get","head","post","put","patch","common"],he=>{delete o[he]}),n.headers=AxiosHeaders$1.concat(c,o);const f=[];let y=!0;this.interceptors.request.forEach(function(_e){typeof _e.runWhen=="function"&&_e.runWhen(n)===!1||(y=y&&_e.synchronous,f.unshift(_e.fulfilled,_e.rejected))});const m=[];this.interceptors.response.forEach(function(_e){m.push(_e.fulfilled,_e.rejected)});let g,z=0,ie;if(!y){const he=[dispatchRequest.bind(this),void 0];for(he.unshift.apply(he,f),he.push.apply(he,m),ie=he.length,g=Promise.resolve(n);z<ie;)g=g.then(he[z++],he[z++]);return g}ie=f.length;let re=n;for(z=0;z<ie;){const he=f[z++],_e=f[z++];try{re=he(re)}catch($e){_e.call(this,$e);break}}try{g=dispatchRequest.call(this,re)}catch(he){return Promise.reject(he)}for(z=0,ie=m.length;z<ie;)g=g.then(m[z++],m[z++]);return g}getUri(t){t=mergeConfig$1(this.defaults,t);const n=buildFullPath(t.baseURL,t.url,t.allowAbsoluteUrls);return buildURL(n,t.params,t.paramsSerializer)}};utils$1.forEach(["delete","get","head","options"],function e(t){Axios$1.prototype[t]=function(n,a){return this.request(mergeConfig$1(a||{},{method:t,url:n,data:(a||{}).data}))}}),utils$1.forEach(["post","put","patch"],function e(t){function n(a){return function(o,c,f){return this.request(mergeConfig$1(f||{},{method:t,headers:a?{"Content-Type":"multipart/form-data"}:{},url:o,data:c}))}}Axios$1.prototype[t]=n(),Axios$1.prototype[t+"Form"]=n(!0)});let CancelToken$1=class si{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const a=this;this.promise.then(s=>{if(!a._listeners)return;let o=a._listeners.length;for(;o-- >0;)a._listeners[o](s);a._listeners=null}),this.promise.then=s=>{let o;const c=new Promise(f=>{a.subscribe(f),o=f}).then(s);return c.cancel=function(){a.unsubscribe(o)},c},t(function(o,c,f){a.reason||(a.reason=new CanceledError$1(o,c,f),n(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=a=>{t.abort(a)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new si(function(s){t=s}),cancel:t}}};function spread$1(e){return function(n){return e.apply(null,n)}}function isAxiosError$1(e){return utils$1.isObject(e)&&e.isAxiosError===!0}const HttpStatusCode$1={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};Object.entries(HttpStatusCode$1).forEach(([e,t])=>{HttpStatusCode$1[t]=e});function createInstance(e){const t=new Axios$1(e),n=bind(Axios$1.prototype.request,t);return utils$1.extend(n,Axios$1.prototype,t,{allOwnKeys:!0}),utils$1.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return createInstance(mergeConfig$1(e,s))},n}const axios=createInstance(defaults);axios.Axios=Axios$1,axios.CanceledError=CanceledError$1,axios.CancelToken=CancelToken$1,axios.isCancel=isCancel$1,axios.VERSION=VERSION$1,axios.toFormData=toFormData$1,axios.AxiosError=AxiosError$1,axios.Cancel=axios.CanceledError,axios.all=function e(t){return Promise.all(t)},axios.spread=spread$1,axios.isAxiosError=isAxiosError$1,axios.mergeConfig=mergeConfig$1,axios.AxiosHeaders=AxiosHeaders$1,axios.formToJSON=e=>formDataToJSON(utils$1.isHTMLForm(e)?new FormData(e):e),axios.getAdapter=adapters.getAdapter,axios.HttpStatusCode=HttpStatusCode$1,axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios;function throttle(e,t,n){var a=n||{},s=a.noTrailing,o=s===void 0?!1:s,c=a.noLeading,f=c===void 0?!1:c,y=a.debounceMode,m=y===void 0?void 0:y,g,z=!1,ie=0;function re(){g&&clearTimeout(g)}function he($e){var pe=$e||{},Ce=pe.upcomingOnly,Oe=Ce===void 0?!1:Ce;re(),z=!Oe}function _e(){for(var $e=arguments.length,pe=new Array($e),Ce=0;Ce<$e;Ce++)pe[Ce]=arguments[Ce];var Oe=this,qe=Date.now()-ie;if(z)return;function At(){ie=Date.now(),t.apply(Oe,pe)}function Et(){g=void 0}!f&&m&&!g&&At(),re(),m===void 0&&qe>e?f?(ie=Date.now(),o||(g=setTimeout(m?Et:At,e))):At():o!==!0&&(g=setTimeout(m?Et:At,m===void 0?e-qe:e))}return _e.cancel=he,_e}function debounce(e,t,n){var a={},s=a.atBegin,o=s===void 0?!1:s;return throttle(e,t,{debounceMode:o!==!1})}class Credential extends eventsExports.EventEmitter{constructor(n,a,s,o,c,f=!1){super();$n(this,"loading",!1);$n(this,"response");$n(this,"_config");$n(this,"_error");$n(this,"_message");$n(this,"_status","searching");$n(this,"_twofa");$n(this,"http");$n(this,"isSocketOpen",!1);$n(this,"options",{});$n(this,"socket");$n(this,"socketOpened",!1);$n(this,"socketTimeoutAfterError");$n(this,"timer",null);this.syncService=s,this.httpService=o,this.socketTimeoutTime=c,this.isHeadless=f,this.http=this.httpService.getInstance(),this.getSitefromCredential(n).then(({site:y,credential:m})=>{this.config={...m,avatar:y.site_organization.avatar,cover:y.site_organization.cover,name:y.name,quickAnswer:this.syncService.quickAnswer,site:y},this.status="found",a||this.sync().then(()=>{this.status="loading"}).catch(g=>{this.error=g,this.status="error"})}).catch(y=>{this.error=y,this.status="not-found"})}get config(){return this._config}set config(n){this._config=n}get error(){return this._error}set error(n){this._error=n}get message(){return this._message}set message(n){this._message=n}get status(){return this._status}set status(n){const a=this._status!==n;this._status=n,a&&(this.emit(n),this.emit("status-updated",n))}get twofa(){return this._twofa}set twofa(n){this._twofa=n,n&&(this.status="twofa",n.on("loading",()=>{this._twofa===n&&this.status==="twofa"&&(this.status="twofa-loading")}),n.on("twofa-api-error",()=>{this.status="twofa-api-error",this.socketClose()}))}getAvatar(){return this.config.avatar}getCover(){return this.config.cover}getCredentialData(){return{...this.config}}getName(){return this.config.name}getSite(){return{...this.config.site}}getSiteService(){return this.syncService.siteConnection(this.config.site)}setOption(n,a){this.options[n]=a}sync(){return this.configuredMeasureEvent("sync_credential",{id_credential:this.config.id_credential,id_site:this.config.id_site}),this.loading=!0,this.startTimer(),this.http.put(`/v1/credentials/${this.config.id_credential}/sync`,{...this.spreadOptions()}).then(n=>(this.response=n,this.setSocket(n.ws),n)).catch(n=>(this.loading=!1,this.configuredMeasureEvent("sync_credential_error",{code:n.response.status,code_origin:"endpoint",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.clearTimer(),Promise.reject(n)))}update(n,a,s,o){let c;return this.configuredMeasureEvent("update_credential",{id_credential:this.config.id_credential,id_site:this.config.id_site}),isSiteV1Service(n)?c=n.getConnectData(a):isSiteV3Service(n)?c=n.getConnectData(s,a):c=n.getConnectData(s,a,o),this.startTimer(),this.http.put(`${n.config.endpoint}/${this.config.id_credential}`,c).then(f=>(this.status="loading",this.loading=!0,this.response=f,this.setSocket(f.ws),f)).catch(f=>(this.error=f,this.status="error",this.configuredMeasureEvent("update_credential_error",{code:f.response.status,code_origin:"endpoint",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.clearTimer(),Promise.reject(f)))}clearTimer(){clearTimeout(this.timer)}configuredMeasureEvent(n,a){this.isHeadless||measureEvent(n,a)}getSitefromCredential(n){return this.http.get("/v1/credentials",{params:{...this.syncService.defaultParams,id_credential:n}}).then(a=>a.length?this.syncService.getOrganizationSites({id_site_organization:a[0].id_site_organization}).then(s=>{if(!s.length)return Promise.reject({response:{status:"credential_not_found"}});let o=s[0].sites.find(c=>c.id_site===a[0].id_site);if(o)o={...o};else return Promise.reject({response:{status:"credential_not_found"}});return o.site_organization=s[0],{site:o,credential:a[0]}}).catch(s=>Promise.reject(s)):Promise.reject({response:{status:"credential_not_found"}}))}reopenSocket(n){this.isSocketOpen=!1,this.socketTimeoutAfterError||this.setSocket(n.target.url)}reopenSocketAfterError(){if(!this.socketTimeoutAfterError){this.socketTimeoutAfterError=new Date().getTime()+12e4,this.setSocket(this.response.ws);const n=setInterval(()=>{this.isSocketOpen?clearInterval(n):new Date().getTime()<this.socketTimeoutAfterError?(this.socket.close(),this.setSocket(this.response.ws)):(clearInterval(n),this.socket.close(),this.loading=!1,this.status="socket-error")},2e3)}}setSocket(n){this.socket=new WebSocket(n),this.socket.onclose=a=>this.reopenSocket(a),this.socket.onerror=()=>this.socketError(),this.socket.onmessage=a=>this.socketMessage(a),this.socket.onopen=()=>this.socketOpen()}socketClose(n){this.clearTimer(),this.socket.onclose=()=>{this.twofa=null,n&&n(this)},this.socket.close()}socketError(){this.isSocketOpen=!1,this.socketOpened?this.reopenSocketAfterError():(this.loading=!1,this.status="socket-error")}socketMessage(n){const a=JSON.parse(n.data);if(this.clearTimer(),this.config.quickAnswer&&a.code===102){this.socketClose(()=>{this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.status="socket-quick-answer"}),this.configuredMeasureEvent("sync_credential_success",{code:a.code,id_credential:this.config.id_credential,id_site:this.config.id_site});return}a.code===401&&this.configuredMeasureEvent("unauthorized",{id_site:this.config.id_site}),a.code===410&&(this.twofa=new TWOFA({...a,id_site:this.config.id_site},this.httpService)),this.emit("socket-message",a),this.startTimer(),a.code===411&&this.configuredMeasureEvent("twofa_timeout",{id_site:this.config.id_site}),200<=a.code&&a.code<300||400<=a.code&&a.code<600&&a.code!==410?(this.loading=!1,this.twofa&&(this.twofa.loading=!1),a.code<300?(this.configuredMeasureEvent("sync_credential_success",{code:a.code,id_credential:this.config.id_credential,id_site:this.config.id_site}),this.message=a,this.status="success"):(this.configuredMeasureEvent("sync_credential_error",{code:a.code,code_origin:"socket",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.error=a,this.status="error"),this.socketClose()):this.twofa&&a.code!==410&&this.twofa.statusChanged()}socketOpen(){this.isSocketOpen=this.socketOpened=!0,this.socketTimeoutAfterError=void 0}socketTimeout(){this.status="socket-timeout",this.socketClose()}spreadOptions(){const n=Object.keys(this.options).reduce((a,s)=>(this.options[s]!==null&&this.options[s]!==void 0&&(a[s]=this.options[s]),a),{});return Object.keys(n).length?{options:{...n}}:{}}startTimer(){this.timer=setTimeout(()=>{this.socketTimeout()},this.socketTimeoutTime)}}axios.defaults.baseURL="https://sync.paybook.com";class HttpService extends eventsExports.EventEmitter{constructor(n,a={}){const{os:s}=UAParser(navigator.userAgent);super();$n(this,"baseURL");$n(this,"isStrict");$n(this,"jwk");this.token=n,a.baseURL&&(this.baseURL=axios.defaults.baseURL=a.baseURL),this.isStrict=a.isStrict||!1,axios.defaults.headers.common={"x-app-version":`syncfy-widget:${a.widgetVersion}:${s.name}:${s.version}`}}getInstance(){const n=axios.create({baseURL:this.baseURL});return n.interceptors.request.use(a=>(a.headers.Authorization=`Bearer ${this.token}`,a),function(a){return Promise.reject(a)}),n.interceptors.response.use(a=>(this.emit("rid",a.data.rid),a.data.response||a.data||a),a=>{var s;return a.response&&(this.emit("rid",(s=a.response.data)==null?void 0:s.rid),a.response.status===401&&this.emit("401")),Promise.reject(a)}),this.isStrict&&n.interceptors.request.use(a=>a.data?createJWE(a.data,this.jwk).then(s=>(a.data={jwe:s},Promise.resolve(a))):Promise.resolve(a),a=>Promise.reject(a)),n}updateToken(n,a){this.token=n,a&&(this.jwk=a)}}class SiteV1Service extends SiteBase{constructor(n,a,s,o){super(n,a,o);$n(this,"data",{});$n(this,"rules",{});if(this.defaultParams=s,this.userConfig=o,DOWNLOAD_OPTIONS_SITES.includes(n.id_site)&&this.addDownloadOptions(n),n.credentials&&n.credentials.length)o.isHeadless||n.credentials.forEach(c=>{const f=c.name;Object.defineProperty(this.rules,f,{enumerable:!0,value:this.setRules(c),writable:!0})});else throw new Error("Site credentials are required.")}get version(){return 1}connect(n){const a=this.getConnectData(n);return this.startTimer(),this.http.post(this.config.endpoint,a).then(s=>(this.response=s,this.emit("login-success"),this.setSocket(s.ws),s)).catch(s=>(this.configuredMeasureEvent("sync_error",{code:s.response?s.response.status:s.toString(),code_origin:"endpoint",id_site:this.config.id_site}),this.loading=!1,this.data={},this.status="start",this.clearTimer(),Promise.reject(s)))}getConnectData(n){this.data={...n};const a={...this.data};DOWNLOAD_OPTIONS_SITES.includes(this.config.id_site)&&this.moveDownloadOptions(a),this.testMode?this.setOption("allowMultipleRequests",!0):this.setOption("allowMultipleRequests",void 0);const s={...this.defaultParams,id_site:this.config.id_site,credentials:a,...this.spreadOptions()};return this.config.request?Promise.resolve(s.credentials):(this.configuredMeasureEvent("sync",{id_site:this.config.id_site}),this.loading=!0,this.userConfig.saveCredential||(s.save_credential=this.userConfig.saveCredential),this.testMode&&(s.test=1),s)}getFields(n=!1){return n?this.config.credentials.filter(a=>!a.identifier):this.config.credentials}getRules(n=!1){if(n){const a={};return this.getFields(!0).forEach(s=>{const o=s.name;a[o]=this.setRules(s)}),a}return this.rules}addDownloadOptions(n){n.credentials.includes(DOWNLOAD_OPTIONS_ACTIVE)||(n.credentials.push(DOWNLOAD_OPTIONS_ACTIVE),n.credentials.push(DOWNLOAD_OPTIONS))}}class SiteV3Service extends SiteBase{constructor(n,a,s,o){super(n,a,o);$n(this,"input",[]);this.defaultParams=s,this.userConfig=o,n.input.forEach(c=>{const f={rules:{},data:{}};DOWNLOAD_OPTIONS_SITES.includes(n.id_site)&&this.addDownloadOptions(c),c.fields.forEach(y=>{const m=y.name;Object.defineProperty(f.rules,m,{enumerable:!0,value:this.setRules(y),writable:!0}),f.data[m]=null}),this.input.push(f)})}get version(){return 3}connect(n,a){const s=this.getConnectData(n,a);return this.startTimer(),this.http.post(this.config.endpoint,s).then(o=>(this.response=o,this.emit("login-success"),this.setSocket(o.ws),o)).catch(o=>(this.configuredMeasureEvent("sync_error",{code:o.response?o.response.status:o.toString(),code_origin:"endpoint",id_site:this.config.id_site}),this.input[n].data={},this.loading=!1,this.status="start",this.clearTimer(),Promise.reject(o)))}getConnectData(n,a){this.updateData(n,a);const s=n||0,o={...this.input[s].data};DOWNLOAD_OPTIONS_SITES.includes(this.config.id_site)&&this.moveDownloadOptions(o),this.testMode?this.setOption("allowMultipleRequests",!0):this.setOption("allowMultipleRequests",void 0);const c={...this.defaultParams,id_site:this.config.id_site,input_name:this.config.input[n].name,input:o,...this.spreadOptions()};return this.config.request?Promise.resolve(c.input):(this.configuredMeasureEvent("sync",{id_site:this.config.id_site}),this.loading=!0,this.userConfig.saveCredential||(c.save_credential=this.userConfig.saveCredential),this.testMode&&(c.test=1),c)}getFields(n,a=!1){return a?this.config.input[n].fields.filter(s=>!s.identifier):this.config.input[n].fields}getOptions(){return this.config.input}getRules(n,a=!1){if(a){const s={};return this.getFields(n,!0).forEach(o=>{const c=o.name;s[c]=this.setRules(o)}),s}return this.input[n].rules}updateData(n,a){this.input[n].data={...a}}addDownloadOptions(n){n.fields.includes(DOWNLOAD_OPTIONS_ACTIVE)||(n.fields.push(DOWNLOAD_OPTIONS_ACTIVE),n.fields.push(DOWNLOAD_OPTIONS))}}class Sync extends eventsExports.EventEmitter{constructor(n,a){super();$n(this,"http");$n(this,"httpService");$n(this,"rid");this.token=n,this.config=a,this.httpService=a.http?new HttpService(n,{...a.http,widgetVersion:a.widgetVersion}):new HttpService(n,{widgetVersion:a.widgetVersion}),this.http=this.httpService.getInstance(),this.httpService.on("401",this.debounce401()),this.httpService.on("rid",s=>{this.rid=s})}get defaultParams(){return this.config.defaultParams}set defaultParams(n){this.config.defaultParams=n}get quickAnswer(){return this.config.quickAnswer}getAccounts(n){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/accounts",{params:{...this.config.defaultParams,...n}})}getCountries(){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/countries",{params:{...this.config.defaultParams}})}getHttpService(){return this.httpService}getLastRid(){return this.rid}getOrganizationSites(n){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/organizations/sites",{params:{...this.config.defaultParams,...n}})}getOrganizationTypes(){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/site_organization_types",{params:{...this.config.defaultParams}})}getSite(n){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get(`/v1/catalogues/widget/sites/${n}`,{params:{...this.config.defaultParams}})}siteConnection(n){switch(n.version){case 1:return new SiteV1Service({...n,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout});case 3:return new SiteV3Service({...n,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout});case 4:return new SiteV4Service({...n,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout})}}strictMode({token:n,strict:a}){return this.token=n,decodeStrictKeys(a).then(({strictAuthorizationKey:s,strictBodyKey:o})=>createJWS({token:n},s).then(c=>(this.httpService.updateToken(c),getLocalKeys().then(({authorization:f})=>{const y={authorization:btoa(JSON.stringify(f.toJSON(!0)))};return createJWE(y,o).then(m=>this.updateStrictSession(n,c,m).then(()=>createJWS({token:n},f).then(g=>this.updateToken(g).then(()=>(this.httpService.updateToken(this.token,o),{jws:g,jwe:o})))))}))))}syncCredential(n,a=!1){return new Credential(n,a,this,this.httpService,this.config.socketTimeout,this.config.isHeadless)}updateApiBaseUrl(n){this.http.defaults.baseURL=n,axios.defaults.baseURL=n}updateEnvironment(n){switch(n){case"production":this.http.defaults.baseURL="https://sync.paybook.com",axios.defaults.baseURL="https://sync.paybook.com";break;case"development":this.http.defaults.baseURL="https://api.syncfy.paybook.dev",axios.defaults.baseURL="https://api.syncfy.paybook.dev";break;default:this.http.defaults.baseURL="https://sync.paybook.com",axios.defaults.baseURL="https://sync.paybook.com";break}}updateToken(n){return new Promise(a=>{this.token!==n&&(this.token=n,this.httpService.updateToken(this.token)),a({token:n})})}debounce401(){return debounce(200,()=>{this.emit("sync_401")})}updateStrictSession(n,a,s){return axios.put(`/v1/sessions/jwt/${n}`,{type:"jwt","payload/jwe":s},{headers:{Authorization:`Bearer ${a}`}})}}class NotificationUpdater{constructor(t){$n(this,"callback");$n(this,"messages");this.messages=t}getMessages(){return this.messages}subscribe(t){this.callback=t}updateMessages(t){this.messages={...this.messages,...t},this.callback&&this.callback()}}const _sfc_main$2=defineComponent({__name:"BackUpConnection",props:{assetsPath:{default:"https://s.paybook.com"},buttonDisabledStyle:{type:Boolean,default:!1},credential:{default:void 0},disableFormAutocomplete:{type:Boolean,default:!1},displayBackButton:{type:Boolean},errorMessage:{default:null},loaderMessage:{},selectClass:{default:""},showLogo:{type:Boolean},showPasswordStyle:{default:"icon"},site:{},testMode:{type:Boolean,default:!1},updateMode:{type:Boolean,default:!1}},emits:["back","error","success","valid"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),{t:o}=useI18n(),c=ref(!1);return onMounted(()=>{n.site.on("status-update",f=>{f==="loading"?c.value=!0:c.value=!1})}),(f,y)=>(openBlock(),createElementBlock("div",{class:normalizeClass(f.$style["back-up-connection"])},[c.value?createCommentVNode("",!0):(openBlock(),createBlock(AppLoader,{key:0,avatar:n.showLogo?`${f.assetsPath}${n.site.config.avatar}`:void 0,grow:!1,icon:n.showLogo?void 0:"error",message:unref(o)("back_up_connection.description"),size:"large",title:unref(o)("back_up_connection.title"),type:"error",onImagesLoaded:y[0]||(y[0]=()=>unref(s)("images-loaded")),onImagesLoading:y[1]||(y[1]=()=>unref(s)("images-loading"))},null,8,["avatar","icon","message","title"])),createBaseVNode("div",{class:normalizeClass(f.$style["back-up-form"])},[createVNode(SiteForm,{"assets-path":n.assetsPath,"back-up-connection":!0,"button-disabled-style":n.buttonDisabledStyle,"credential-service":n.credential,"disable-form-autocomplete":n.disableFormAutocomplete,"display-back-button":n.displayBackButton,"error-message":n.errorMessage,"loader-message":n.loaderMessage,"select-class":n.selectClass,"show-header":!1,"show-logo":n.showLogo,"show-password-style":n.showPasswordStyle,site:n.site,"test-mode":n.testMode,"update-mode":n.updateMode,onBack:y[2]||(y[2]=()=>a("back")),onError:y[3]||(y[3]=m=>a("error",m)),onSuccess:y[4]||(y[4]=m=>a("success",m)),onValid:y[5]||(y[5]=()=>{unref(s)("back-up-site-submitted"),a("valid")})},null,8,["assets-path","button-disabled-style","credential-service","disable-form-autocomplete","display-back-button","error-message","loader-message","select-class","show-logo","show-password-style","site","test-mode","update-mode"])],2)],2))}}),style0$1={"back-up-connection":"pb-w-sync_back-up-connection","back-up-icon":"pb-w-sync_back-up-icon","back-up-form":"pb-w-sync_back-up-form"},cssModules$1={$style:style0$1},BackUpConnection=_export_sfc(_sfc_main$2,[["__cssModules",cssModules$1]]),_hoisted_1=["aria-label"],_hoisted_2={key:1},_hoisted_3=["aria-label"],_hoisted_4={key:0},_sfc_main$1=defineComponent({__name:"DataWidget",props:{client:{},enableTestMode:{type:Boolean},entrypoint:{},internal:{},locale:{},navigation:{},refreshTokenFunction:{type:Function},strict:{},token:{}},emits:["tokenRefreshed"],setup(e,{expose:t,emit:n}){const a=e,s=n,o=inject(rootEmitter),{t:c,locale:f}=useI18n({useScope:"global"}),{mobile:y}=useMobile(),m=ref([]),g=ref(null),z=ref(null),ie=ref(!1),re=ref(!1),he=ref(null),_e=ref(null),$e=ref(null),pe=ref(""),Ce=ref(""),Oe=ref(a.navigation.displayPrivacyScreen),qe=ref(!0),At=ref(!1),Et=ref(null),ze=ref([]),kt=ref(null),Pt=ref(!1),jt=ref(null),Ie=ref(null),u=ref(!1),v=ref(!1);let Y="https://s.paybook.com",ae=null,xe=`${getVersion()}${a.strict?"-strict":""}`,Ve=null,Ue,Ne=null,L=[],Fe=null,Dt=null,er=null;const ir=computed(()=>{var Gr;return(Gr=z.value)!=null&&Gr.displayBackUpConnection||re.value?Fe:null}),cr=computed(()=>$e.value==="credential"||z.value||qe.value?!1:jt.value?a.entrypoint.site&&a.navigation.oneSiteFlow?jt.value==="twofa"&&a.navigation.enableTwofaBackNavigation||a.navigation.displayPrivacyScreen&&jt.value!=="finish":jt.value==="finish"?a.navigation.enableBackNavigation:jt.value==="twofa"?a.navigation.enableTwofaBackNavigation:a.navigation.enableBackNavigation&&jt.value==="start":!!kt.value||a.navigation.displayPrivacyScreen),sr=computed(()=>m.value.filter(Gr=>(Gr.id_country==="51ad44db3b8e77631200047d"||Gr.id_country==="51ad44793b8e77631200027a")&&a.internal.plaidSites||Or(Gr.id_country).length).sort((Gr,Lt)=>Gr.name.localeCompare(Lt.name))),ar=computed(()=>$r(g.value,kt.value)),fr=computed(()=>Or(g.value)),Cr=computed(()=>Pr(g.value,kt.value,Et.value)),Mr=computed(()=>({short:Ce.value,long:pe.value})),xr=computed(()=>{let Gr=[];return ze.value&&ze.value.forEach(Lt=>{Gr=[...Gr,...Lt.sites.map(tr=>({...tr,avatar:Lt.avatar,cover:Lt.cover,site_organization:Lt}))]}),Gr}),gr=computed(()=>ie.value||At.value?"":z.value?z.value.siteToUpdate?c("credential.header_title.update"):c("credential.header_title.sync"):Pt.value?c("accounts_selection.title"):jt.value?jt.value==="start"&&!ir.value?c("common.header.login"):"":kt.value?g.value&&kt.value?c("common.header.select"):"":c("common.header.link"));watch(()=>a.locale,(Gr,Lt)=>{Gr!==Lt&&["es","en"].includes(Gr)&&(f.value=Gr)}),watch(()=>a.internal,(Gr,Lt)=>{if(er.defaultParams=Gr.defaultHttpParams||{},er.defaultParams.locale=a.locale,Gr.apiEnv!==Lt.apiEnv)switch(er.updateEnvironment(Gr.apiEnv),Gr.apiEnv){case"production":Y="https://s.paybook.com";break;case"development":Y="https://s.paybook.dev";break;default:Y="https://s.paybook.com";break}Gr.apiBaseUrl!==Lt.apiBaseUrl&&Gr.apiBaseUrl&&er.updateApiBaseUrl(Gr.apiBaseUrl),Gr.assetsBaseUrl!==Lt.assetsBaseUrl&&Gr.assetsBaseUrl&&(Y=Gr.assetsBaseUrl),Lr()}),watch(()=>a.navigation.displayPersonalSites,()=>{Lr()}),watch(()=>a.navigation.displayBusinessSites,()=>{Lr()}),watch(Ce,Gr=>{Ve&&Ue.updateMessages({short:Gr})}),watch(pe,Gr=>{Ve&&Ue.updateMessages({long:Gr})}),watch(v,()=>{!v.value&&z.value?(z.value=null,Ne&&Ne()):!v.value&&!Ve&&jt.value&&jt.value!=="start"&&jt.value!=="finish"?(Ue=new NotificationUpdater({short:pe.value}),Ve=ElNotification.info({duration:0,message:h(TwofaNotification,{assetsPath:Y,buttonDisabledStyle:a.navigation.formButtonsDisabledStyle,disableFormAutocomplete:a.navigation.disableFormAutocomplete,duration:0,enableBackNavigation:a.navigation.enableTwofaBackNavigation,item:Fe,messagesUpdater:Ue,rootEmit:o,selectClass:a.navigation.selectClass,showLogo:a.navigation.displayLogoImages,showPasswordStyle:a.navigation.formShowPasswordStyle,t:c,type:"info",onBack:()=>{o("back"),Nr(),Fe=jt.value=null,Tr(Dt,!1),v.value=!0},onError:Gr=>{Kr(Gr)},onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),position:a.navigation.toastPosition,showClose:!1})):v.value&&Ve&&(v.value=!1,ElNotification.error({duration:0,position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initMessage:c("common.process_running"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}})}))}),onMounted(()=>{nextTick(()=>{o("dom-updated")})}),onUpdated(()=>{nextTick(()=>{o("dom-updated")})});function dr(){["es","en"].includes(a.locale)&&(f.value=a.locale),Y=a.internal.apiEnv?a.internal.apiEnv==="production"?"https://s.paybook.com":"https://s.paybook.dev":"https://s.paybook.com",a.internal.assetsBaseUrl&&(Y=a.internal.assetsBaseUrl),a.strict?(Yr(),qe.value=!0,setTimeout(()=>{er.strictMode({token:a.token,strict:a.strict}).then(()=>{Lr()})},400)):(Yr(),Lr())}function Br(){return z.value.siteToUpdate}function Ir(){measureEvent("close"),v.value=!1,(jt.value==="start"||jt.value==="finish")&&(jt.value=Fe=null),o("closed")}function Nr(){Ve&&(Ve.close(),Ve=null)}function Kr(Gr){const Lt=Sr(Gr);z.value&&(z.value.siteToUpdate||u.value)?z.value={...z.value,displayBackUpConnection:!1,siteToUpdate:void 0}:!a.navigation.displayErrorsInToast&&v?(re.value=!1,jt.value="finish",Fe&&(Fe.finalResponse="error"),he.value=c(`${Lt}long_description`),_e.value=c(`${Lt}short_description`)):ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:a.navigation.displayLongDescription,duration:0,initLongMessage:c(`${Lt}long_description`),initMessage:c(`${Lt}short_description`),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),vr(Gr,Lt)}const _r=debounce(200,function(){if(ie.value=!1,a.entrypoint.credential)return hr(a.entrypoint.credential,!0);if(a.entrypoint.updateCredential)return Hr(a.entrypoint.updateCredential,!0);if(a.entrypoint.site&&a.navigation.oneSiteFlow)er.getSite(a.entrypoint.site).then(Gr=>{if(o("loaded"),Gr&&Gr.length){const Lt=Gr[0].site_organization;Tr({...Gr[0],avatar:Lt.avatar,cover:Lt.avatar,site_organization:Lt})}else jr({response:{status:"site_not_found"}})}).catch(Gr=>jr(Gr.response||Gr)).finally(()=>{qe.value=!1});else{const Gr={};(a.navigation.displayPersonalSites||a.navigation.displayBusinessSites)&&!(a.navigation.displayPersonalSites&&a.navigation.displayBusinessSites)&&(a.navigation.displayPersonalSites?Gr.is_personal=1:Gr.is_business=1);const Lt=[er.getCountries(),er.getOrganizationTypes(),er.getOrganizationSites(Gr)];return Promise.all(Lt).then(tr=>{m.value=tr[0],L=tr[1],a.internal.plaidSites&&L.unshift({id_site_organization_type:"__internal__.plaidSites",label:"webapp_add_banks",name:"plaid"}),ze.value=tr[2]}).then(()=>nextTick().then(()=>{if(o("loaded"),ur(),a.entrypoint.site){const tr=xr.value.find(rr=>rr.id_site===a.entrypoint.site);return tr?Tr(tr):Promise.reject({response:{response:{status:"site_not_found"}}})}})).catch(tr=>jr(tr.response||tr)).finally(()=>{qe.value=!1})}});function vr(Gr,Lt){o("api-error",Gr.response?Gr.response.status:500,{longMessage:c(`${Lt}real.long_description`),message:c(`${Lt}real.short_description`),noInternet:!Gr.response})}function Vr(Gr){o("socket-error",{longMessage:c(`socket.${Gr}.long_description`),type:Gr,message:c(`socket.${Gr}.short_description`)})}function $r(Gr,Lt){return(a.navigation.displaySiteOrganizations.length||a.navigation.hideSiteOrganizations.length?ze.value.filter(tr=>{if(a.navigation.displaySiteOrganizations.length)return!!a.navigation.displaySiteOrganizations.find(rr=>rr===tr.name||rr===tr.id_site_organization);if(a.navigation.hideSiteOrganizations.length)return!a.navigation.hideSiteOrganizations.find(rr=>rr===tr.name||rr===tr.id_site_organization)}):ze.value).filter(tr=>Gr===tr.id_country&&Lt===tr.id_site_organization_type&&Pr(Gr,Lt,tr.id_site_organization).length)}function Or(Gr){return(a.navigation.displaySiteOrganizationTypes.length||a.navigation.hideSiteOrganizationTypes.length?L.filter(Lt=>{if(a.navigation.displaySiteOrganizationTypes.length)return!!a.navigation.displaySiteOrganizationTypes.find(tr=>tr===Lt.name||tr===Lt.id_site_organization_type);if(a.navigation.hideSiteOrganizationTypes.length)return!a.navigation.hideSiteOrganizationTypes.find(tr=>tr===Lt.name||tr===Lt.id_site_organization_type)}):L).filter(Lt=>(Gr==="51ad44db3b8e77631200047d"||Gr==="51ad44793b8e77631200027a")&&a.internal.plaidSites&&Lt.id_site_organization_type==="__internal__.plaidSites"?!0:$r(Gr,Lt.id_site_organization_type).length)}function Pr(Gr,Lt,tr){return(a.navigation.displaySites.length||a.navigation.hideSites.length?xr.value.filter(rr=>{if(a.navigation.displaySites.length)return!!a.navigation.displaySites.find(pr=>pr===rr.name||pr===rr.id_site);if(a.navigation.hideSites.length)return!a.navigation.hideSites.find(pr=>pr===rr.name||pr===rr.id_site)}):xr.value).filter(rr=>Gr===rr.site_organization.id_country&&Lt===rr.site_organization.id_site_organization_type&&tr===rr.site_organization.id_site_organization)}function Sr(Gr){return typeof Gr=="string"?Gr:Gr.status===401?"api_errors.unauthorized.":Gr.response&&Gr.response.data&&Gr.response.data.message==="Credential error, please consider updating credential password"?"api_errors.credential_error.":`api_errors.${Gr.response?Gr.response.status?Gr.response.status:500:"no_internet"}.`}function Er(){return er.getLastRid()}function zr(){jt.value?jt.value==="finish"?re.value?xn():br():jt.value==="twofa"?En():xn():Et.value?lr():kt.value?nr():(o("back"),Oe.value=!0)}function Lr(){qe.value=!0,_r()}function jr(Gr){const Lt=Sr(Gr);ie.value=Lt,!Gr.response&&a.navigation.displayErrorsInToast&&ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initLongMessage:c(`${Lt}long_description`),initMessage:c(`${Lt}short_description`),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),o("loaded"),vr(Gr,Lt)}function Ar(){measureEvent("open"),qe.value||ur(),v.value=!0,o("opened")}function lr(Gr=!0){Gr&&o("back"),Et.value=null,ar.value.length===1&&nr(!1)}function nr(Gr=!0){Gr&&o("back"),kt.value=null,fr.value.length===1&&(sr.value.length===1||a.navigation.hideSelectCountry)&&a.navigation.displayPrivacyScreen&&(Oe.value=!0)}function or(){Oe.value=!1,(sr.value.length===1||a.navigation.hideSelectCountry)&&fr.value.length===1&&(kt.value=fr.value[0].id_site_organization_type)}function br(){kt.value=$e.value=jt.value=Et.value=Fe=null}function yr(Gr){o("organization-selected",Gr),measureEvent("open_site_organization",{id_site_organization:Gr.id_site_organization}),Et.value=Gr.id_site_organization,nextTick(()=>{Cr.value.length===1&&Tr(Cr.value[0])})}function Tr(Gr,Lt=!0){let tr;Lt&&(o("organization-site-selected",Gr),measureEvent("open_site",{id_site:Gr.id_site})),!Fe||!Fe.loading?(Dt=Gr,tr=Fe=er.siteConnection(Gr),jt.value="start",_e.value=null,he.value=null,Fe.on("login-success",()=>{v.value&&a.navigation.displayStatusInToast&&Ir()}),Fe.on("socket-close",Nr),Fe.on("socket-error",()=>{a.navigation.displayErrorsInToast?ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,duration:0,hideForm:!0,initLongMessage:c("socket.error.long_description"),initMessage:c("socket.error.short_description"),item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}):(he.value=c("socket.error.long_description"),_e.value=c("socket.error.short_description")),Vr("error")}),Fe.on("socket-message",rr=>{const pr=`socket.message.${rr.code?rr.code:500}.`,wr=c(`${pr}short_description`),Ur=c(`${pr}long_description`);switch(!0){case(400<=rr.code&&rr.code<600&&rr.code!==410):Nr(),_e.value=wr,he.value=Ur,o("error",Fe.response,{code:rr.code,longMessage:Ur,message:wr}),rr.code>=500&&isSiteV4Service(Fe)&&Fe.backUpConnection&&!$e.value&&(o("back-up-site",Fe.config.id_site),measureEvent("back-up-site",{id_site:Fe.config.id_site}),re.value=!0),v.value?a.navigation.returnToSiteFormOnUserError!==!1&&(a.navigation.returnToSiteFormOnUserError===!0&&[401,403,411].includes(rr.code)||a.navigation.returnToSiteFormOnUserError!==!0&&a.navigation.returnToSiteFormOnUserError.includes(rr.code))&&(jt.value=Fe=null,Tr(Dt,!1),Ie.value={short:wr,long:Ur}):re.value?Ar():(ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:Ur,initMessage:wr,item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),br(),ur());break;case(200<=rr.code&&rr.code<300):Nr(),_e.value=wr,he.value=Ur,o("success",Fe.response),v.value?$e.value==="credential"&&(z.value={avatar:`${Y}${Fe.config.avatar}`,loaderType:"success",loading:!0,messages:{short:_e.value,long:he.value}}):(ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,hideForm:!0,initLongMessage:Ur,initMessage:wr,item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),br(),ur());break;default:Ce.value=wr,pe.value=Ur}o("status",rr)}),Fe.on("socket-quick-answer",()=>{_e.value=c("socket.quick_answer.short_description"),he.value=c("socket.quick_answer.long_description"),o("success",Fe.response),Nr(),v.value?$e.value==="credential"&&(z.value={avatar:`${Y}${Fe.config.avatar}`,loaderType:"success",loading:!0,messages:{short:_e.value,long:he.value}}):(ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,hideForm:!0,initLongMessage:c("socket.quick_answer.long_description"),initMessage:c("socket.quick_answer.short_description"),item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),br(),ur())}),Fe.on("socket-timeout",()=>{_e.value=c("socket.timeout.short_description"),he.value=c("socket.timeout.long_description"),o("error",Fe.response),(!v.value||a.navigation.displayErrorsInToast)&&(ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:c("socket.timeout.long_description"),initMessage:c("socket.timeout.short_description"),item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),v.value||(br(),ur())),Vr("timeout")}),Fe.on("status-update",rr=>{Fe===tr&&(jt.value=rr)}),Fe.on("twofa",()=>{Ce.value=c("twofa.waiting")})):ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initMessage:c("common.process_running"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})}function hr(Gr,Lt=!1,tr=!1){if(!Gr)throw new Error("idCredential is required to update credential");if(Oe.value=!1,qe.value=!1,tr?(u.value=!0,measureEvent("update_credential",{id_credential:Gr})):measureEvent("open_credential",{id_credential:Gr}),!ae||!ae.loading){let rr=new NotificationUpdater({short:c("credential.search.title")}),pr;Ne=()=>{pr=ElNotification.info({showClose:!1,position:a.navigation.toastPosition,duration:0,message:h(TwofaNotification,{assetsPath:Y,duration:0,messagesUpdater:rr,showLogo:!1,t:c,type:"info",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}})})},a.navigation.displayCredentialInModal?(z.value={loaderType:"loading",loading:!0,messages:{short:c("credential.search.title"),long:c("credential.search.message")}},v.value||Ar()):(v.value&&Ir(),Ne()),ae=er.syncCredential(Gr,tr),ae.on("error",()=>{const{code:wr}=ae.error,Ur=ae.error.response?Sr(ae.error):`socket.message.${wr||500}.`,qr=c(`${Ur}short_description`),Jr=c(`${Ur}long_description`);v.value?(z.value={...z.value,loaderType:"error",messages:{short:qr,long:Jr},siteToUpdate:void 0},Ne=null):(ae.error.response?pr&&pr.close():Nr(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:Jr,initMessage:qr,item:ae,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),ae.error.response?vr(ae.error,Ur):o("error",ae.response,{code:wr,longMessage:Jr,message:qr})}),ae.on("found",()=>{Lt&&o("loaded"),tr?(pr&&pr.close(),Ne=null,pr=ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:!1,duration:a.navigation.toastDuration,initMessage:c("credential.found.title"),item:ae,assetsPath:Y,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),v.value=!0,z.value={avatar:a.navigation.displayLogoImages?`${Y}${ae.config.avatar}`:void 0,loading:!1,siteToUpdate:ae.getSiteService()}):(v.value&&(z.value={...z.value,avatar:a.navigation.displayLogoImages?`${Y}${ae.config.avatar}`:void 0,messages:{short:c("credential.found.title"),long:c("credential.found.message")}}),rr.updateMessages({long:c("credential.found.message"),short:c("credential.found.title")}))}),ae.on("loading",()=>{o("updated",ae.response),Ne=()=>{Ue=new NotificationUpdater({}),Ve=ElNotification.info({showClose:!1,position:a.navigation.toastPosition,duration:0,message:h(TwofaNotification,{assetsPath:Y,buttonDisabledStyle:a.navigation.formButtonsDisabledStyle,disableFormAutocomplete:a.navigation.disableFormAutocomplete,duration:0,item:ae,messagesUpdater:Ue,rootEmit:o,selectClass:a.navigation.selectClass,showLogo:a.navigation.displayLogoImages,showPasswordStyle:a.navigation.formShowPasswordStyle,t:c,type:"info",onError:wr=>{Nr(),Kr(wr)},onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}})})},v.value?z.value={...z.value,loaderType:"loading",loading:!0,messages:{short:c("credential.loading.title"),long:c("credential.loading.message")},siteToUpdate:void 0}:(pr&&pr.close(),Ne())}),ae.on("not-found",()=>{const wr=Sr(ae.error);Lt&&o("loaded"),v.value?(z.value={...z.value,loaderType:"error",messages:{short:c(`${wr}short_description`),long:c(`${wr}long_description`)}},Ne=null):(pr&&pr.close(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:c(`${wr}long_description`),initMessage:c(`${wr}short_description`),t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),vr(ae.error,wr)}),ae.on("socket-error",()=>{v.value?(z.value={...z.value,loaderType:"error",messages:{short:c("socket.error.short_description"),long:c("socket.error.long_description")}},Ne=null):(Nr(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,initLongMessage:c("socket.error.long_description"),initMessage:c("socket.error.short_description"),item:ae,hideForm:!0,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),Vr("error")}),ae.on("socket-message",wr=>{const Ur=ae.getSite(),qr=`socket.message.${wr.code?wr.code:500}.`,Jr=c(`${qr}short_description`),Rn=c(`${qr}long_description`);wr.code>=500&&Ur.version===4&&Ur.input.some(Qr=>Qr.name===SiteV4Service.statementParseInputName)&&!$e.value?(Tr({...Ur,avatar:Ur.site_organization.avatar,cover:Ur.site_organization.cover},!1),o("back-up-site",Ur.id_site),measureEvent("back-up-site",{id_site:Ur.id_site}),z.value={...z.value,displayBackUpConnection:!0},v.value||(Nr(),Ar())):v.value?z.value={...z.value,messages:{short:Jr,long:Rn}}:Ue.updateMessages({long:Rn,short:Jr}),o("status",wr)}),ae.on("socket-quick-answer",()=>{_e.value=c("socket.quick_answer.short_description"),he.value=c("socket.quick_answer.long_description"),o("success",ae.response),v.value?(z.value={...z.value,loaderType:"success",messages:{short:c("socket.quick_answer.short_description"),long:c("socket.quick_answer.long_description")}},Ne=null):(Nr(),ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,initLongMessage:c("socket.quick_answer.long_description"),initMessage:c("socket.quick_answer.short_description"),item:ae,hideForm:!0,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}))}),ae.on("socket-timeout",()=>{v.value?(z.value={...z.value,loaderType:"error",messages:{short:c("socket.timeout.short_description"),long:c("socket.timeout.long_description")}},Ne=null):(Nr(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:c("socket.timeout.long_description"),initMessage:c("socket.timeout.short_description"),item:ae,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),o("error",ae.response),Vr("timeout")}),ae.on("success",()=>{const{code:wr}=ae.message,Ur=`socket.message.${wr||500}.`,qr=c(`${Ur}short_description`),Jr=c(`${Ur}long_description`);v.value?(z.value={...z.value,loaderType:"success",messages:{short:qr,long:Jr}},Ne=null):(Nr(),ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,hideForm:!0,initLongMessage:Jr,initMessage:qr,item:ae,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration})),o("success",ae.response)}),ae.on("twofa",()=>{v.value&&pr&&pr.close(),z.value={...z.value,loading:!1}}),ae.on("twofa-api-error",()=>{v.value?(z.value={...z.value,loaderType:"error",messages:{short:c("credential.api_error.title"),long:c("credential.api_error.message")}},Ne=null):Nr()}),ae.on("twofa-loading",()=>{z.value={...z.value,loading:!0,loaderType:"loading",messages:{short:c("twofa.waiting"),long:c("twofa.waiting")}}})}else ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initMessage:c("common.process_running"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})}function ur(){if(ie.value)return;let Gr;a.entrypoint.country&&(Gr=sr.value.find(Lt=>Lt.code===a.entrypoint.country||Lt.id_country===a.entrypoint.country)),sr.value.length?(g.value=Gr?Gr.id_country:sr.value[0].id_country,measureEvent("open_country",{id_country:g.value}),vn(),At.value=!1):!jt.value&&!z.value&&(At.value=!0)}function vn(){if(a.entrypoint.siteOrganizationType){const Gr=fr.value.find(Lt=>Lt.id_site_organization_type===a.entrypoint.siteOrganizationType);if(Gr){const Lt=Gr.id_site_organization_type;measureEvent("open_site_organization_type",{id_site_organization_type:Lt}),kt.value=Lt}}}function Yr(){er=new Sync(a.token,{http:{baseURL:a.internal.apiBaseUrl?a.internal.apiBaseUrl:a.internal.apiEnv?a.internal.apiEnv==="production"?"https://sync.paybook.com":"https://api.syncfy.paybook.dev":"https://sync.paybook.com",isStrict:!!a.strict},defaultParams:{locale:a.locale,...a.internal.defaultHttpParams},isHeadless:!1,quickAnswer:a.navigation.quickAnswer,saveCredential:a.navigation.saveCredential,socketTimeout:a.navigation.socketTimeout,widgetVersion:xe});let Gr=null;er.on("sync_401",()=>{a.refreshTokenFunction&&!Gr&&(Gr=ElNotification.error({position:a.navigation.toastPosition,showClose:!1,message:h(UnauthorizedNotification,{initTitle:c("common.unauthorized"),initMessage:c("common.unauthorized_message"),refreshTokenFunction:a.refreshTokenFunction,t:c,onClosed:()=>{Gr=null},onCloseNotification:()=>{Gr.close()},onRefreshToken:({token:Lt,strict:tr,resolve:rr})=>{s("tokenRefreshed",Lt),Wr(Lt,tr).then(()=>(Gr.close(),ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:!1,duration:a.navigation.toastDuration,initMessage:c("common.session_refreshed_message"),initTitle:c("common.session_refreshed"),showLogo:!1,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),Lr(),rr(null)))},onRefreshTokenError:()=>{ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:!1,duration:0,initMessage:c("common.session_error"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})}}),duration:0})),o("401")})}function Wr(Gr,Lt){return Lt?er.strictMode({token:Gr,strict:Lt}):er.updateToken(Gr)}function xn(){o("back"),re.value=!1,$e.value=null,a.entrypoint.site&&a.navigation.oneSiteFlow&&a.navigation.displayPrivacyScreen?Oe.value=!0:(measureEvent("close_site",{id_site:Fe.config.id_site}),jt.value=Fe=null,Ie.value=null,Cr.value.length===1&&lr(!1))}function Xr(Gr=!1){Ce.value=c("site.login.authenticating"),Ie.value=null,Gr&&(z.value?$e.value="credential":$e.value="site")}function wn(){z.value&&(z.value=null),re.value&&(re.value=!1),Ce.value=c("site.login.success")}function En(Gr=!0){Gr&&o("back"),jt.value=Fe=null,Tr(Dt,!1)}function Hr(Gr,Lt=!1){if(!Gr)throw new Error("idCredential is required to update credential");hr(Gr,Lt,!0)}function Zr(){Ce.value=c("credential.loading.title"),pe.value=c("credential.loading.message")}return dr(),t({close:Ir,getLastRid:Er,open:Ar,setCredential:hr,setToken:Wr,updateCredential:Hr}),(Gr,Lt)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(TheModal,{visible:v.value,"onUpdate:visible":Lt[5]||(Lt[5]=tr=>v.value=tr),mobile:unref(y)},{default:withCtx(()=>[v.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass([Gr.$style.container,{[Gr.$style["is-mobile"]]:unref(y)}])},[Oe.value?(openBlock(),createBlock(PrivacyPolicy,{key:0,client:a.client,onContinue:or},null,8,["client"])):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode("div",{class:normalizeClass(Gr.$style["widget-header"])},[cr.value?(openBlock(),createElementBlock("button",{key:0,"aria-label":unref(c)("common.back"),class:normalizeClass(Gr.$style["widget-back-button"]),onClick:zr},[createVNode(_sfc_main$h,{icon:"back"})],10,_hoisted_1)):(openBlock(),createElementBlock("span",_hoisted_2)),createBaseVNode("h1",null,toDisplayString$1(jt.value&&a.entrypoint.site?unref(c)("common.update_title"):gr.value),1),createBaseVNode("button",{class:normalizeClass(Gr.$style["widget-close-button"]),"aria-label":unref(c)("common.close"),onClick:Ir},[createVNode(_sfc_main$h,{icon:"close"})],10,_hoisted_3)],2),createBaseVNode("div",{class:normalizeClass(Gr.$style["widget-content"])},[z.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Gr.$style["credential-content"])},[z.value.displayBackUpConnection?(openBlock(),createBlock(BackUpConnection,{key:0,"assets-path":unref(Y),"button-disabled-style":a.navigation.formButtonsDisabledStyle,credential:unref(ae),"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"display-back-button":!1,"error-message":null,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:ir.value,"test-mode":Gr.enableTestMode,"update-mode":u.value,onError:Kr,onSuccess:wn,onValid:Lt[0]||(Lt[0]=()=>Xr(!0))},null,8,["assets-path","button-disabled-style","credential","disable-form-autocomplete","loader-message","select-class","show-logo","show-password-style","site","test-mode","update-mode"])):z.value.siteToUpdate?(openBlock(),createBlock(SiteForm,{key:1,"assets-path":unref(Y),"button-disabled-style":a.navigation.formButtonsDisabledStyle,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"credential-service":unref(ae),"display-back-button":!1,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:Br(),"test-mode":Gr.enableTestMode,"update-mode":!0,onValid:Zr},null,8,["assets-path","button-disabled-style","disable-form-autocomplete","credential-service","loader-message","select-class","show-logo","show-password-style","site","test-mode"])):(openBlock(),createElementBlock(Fragment,{key:2},[z.value.loading||z.value.loaderType!=="loading"?(openBlock(),createBlock(AppLoader,{key:0,avatar:z.value.avatar,grow:z.value.loaderType==="loading",message:z.value.messages.long,size:"large",title:z.value.messages.short,type:z.value.loaderType},null,8,["avatar","grow","message","title","type"])):unref(ae).twofa?(openBlock(),createBlock(TwofaForm,{key:1,avatar:z.value.avatar,"button-disabled-style":a.navigation.formButtonsDisabledStyle,cover:`${unref(Y)}${unref(ae).config.cover}`,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"enable-back-navigation":!1,"in-notification":!1,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,"site-name":unref(ae).config.name,twofa:unref(ae).twofa},null,8,["avatar","button-disabled-style","cover","disable-form-autocomplete","loader-message","select-class","show-logo","show-password-style","site-name","twofa"])):createCommentVNode("",!0),z.value.loaderType!=="loading"?(openBlock(),createElementBlock("button",{key:2,class:"pb-w-sync_primary-button","data-testid":"credential-finish-button",onClick:Ir},toDisplayString$1(unref(c)("common.finish")),1)):createCommentVNode("",!0)],64))],2)):(openBlock(),createElementBlock(Fragment,{key:1},[qe.value?(openBlock(),createBlock(AppLoader,{key:0})):createCommentVNode("",!0),!qe.value&&!ie.value&&!At.value?(openBlock(),createElementBlock(Fragment,{key:1},[jt.value?(openBlock(),createElementBlock(Fragment,{key:1},[re.value?(openBlock(),createBlock(BackUpConnection,{key:0,"assets-path":unref(Y),"button-disabled-style":a.navigation.formButtonsDisabledStyle,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"display-back-button":!(a.entrypoint.site&&a.navigation.oneSiteFlow)||a.navigation.displayPrivacyScreen,"error-message":Ie.value,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:ir.value,"test-mode":Gr.enableTestMode,onBack:xn,onError:Kr,onSuccess:wn,onValid:Lt[3]||(Lt[3]=()=>Xr(!0))},null,8,["assets-path","button-disabled-style","disable-form-autocomplete","display-back-button","error-message","loader-message","select-class","show-logo","show-password-style","site","test-mode"])):jt.value==="start"||jt.value==="loading"?(openBlock(),createBlock(SiteForm,{key:1,"assets-path":unref(Y),"back-up-connection":!!$e.value,"button-disabled-style":a.navigation.formButtonsDisabledStyle,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"display-back-button":a.navigation.enableBackNavigation&&$e.value!=="credential"&&(!(a.entrypoint.site&&a.navigation.oneSiteFlow)||a.navigation.displayPrivacyScreen),"error-message":Ie.value,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:unref(Fe),"test-mode":Gr.enableTestMode,onBack:xn,onError:Kr,onSuccess:wn,onValid:Xr},null,8,["assets-path","back-up-connection","button-disabled-style","disable-form-autocomplete","display-back-button","error-message","loader-message","select-class","show-logo","show-password-style","site","test-mode"])):jt.value==="twofa"||jt.value==="twofa-loading"?(openBlock(),createBlock(TwofaForm,{key:2,avatar:`${unref(Y)}${unref(Fe).config.avatar}`,"button-disabled-style":a.navigation.formButtonsDisabledStyle,cover:`${unref(Y)}${unref(Fe).config.cover}`,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"enable-back-navigation":a.navigation.enableTwofaBackNavigation&&$e.value!=="credential","in-notification":!1,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,"site-name":unref(Fe).config.name,twofa:unref(Fe).twofa,onBack:En,onError:Kr},null,8,["avatar","button-disabled-style","cover","disable-form-autocomplete","enable-back-navigation","loader-message","select-class","show-logo","show-password-style","site-name","twofa"])):jt.value==="finish"?(openBlock(),createElementBlock(Fragment,{key:3},[Pt.value?(openBlock(),createBlock(AccountsSelection,{key:0,avatar:a.navigation.displayLogoImages?`${unref(Y)}${unref(Fe).config.avatar}`:void 0,"button-disabled-style":a.navigation.formButtonsDisabledStyle,client:a.client,credential:unref(Fe).response.id_credential,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"get-selected-accounts":a.navigation.getSelectedAccounts,sync:unref(er),onDone:Ir},null,8,["avatar","button-disabled-style","client","credential","disable-form-autocomplete","get-selected-accounts","sync"])):(openBlock(),createBlock(FinalResponse,{key:1,avatar:`${unref(Y)}${unref(Fe).config.avatar}`,"display-accounts-selection":a.navigation.displayAccountsSelection,"display-add-another-button":$e.value!=="credential"&&!(a.navigation.oneSiteFlow&&a.entrypoint.site),"long-message":he.value,message:_e.value,"show-logo":a.navigation.displayLogoImages,type:unref(Fe).finalResponse,onAddOther:br,onSelectAccounts:Lt[4]||(Lt[4]=()=>{Pt.value=!0})},null,8,["avatar","display-accounts-selection","display-add-another-button","long-message","message","show-logo","type"]))],64)):createCommentVNode("",!0)],64)):(openBlock(),createElementBlock("div",_hoisted_4,[g.value&&!kt.value?(openBlock(),createBlock(InstitutionFilters,{key:0,"country-id":g.value,"onUpdate:countryId":Lt[1]||(Lt[1]=tr=>g.value=tr),"organization-type-id":kt.value,"onUpdate:organizationTypeId":Lt[2]||(Lt[2]=tr=>kt.value=tr),"filtered-countries":sr.value,"filtered-organization-types":fr.value,"select-class":a.navigation.selectClass,"show-countries":!a.navigation.hideSelectCountry},null,8,["country-id","organization-type-id","filtered-countries","filtered-organization-types","select-class","show-countries"])):createCommentVNode("",!0),g.value&&kt.value&&!Et.value?(openBlock(),createBlock(OrganizationSitesList,{key:1,"assets-path":unref(Y),items:ar.value,"show-logo":a.navigation.displayLogoImages,"show-plaid-sites-button":a.internal.plaidSites&&kt.value==="__internal__.plaidSites",onSelect:yr},null,8,["assets-path","items","show-logo","show-plaid-sites-button"])):createCommentVNode("",!0),g.value&&kt.value&&Et.value?(openBlock(),createBlock(SitesList,{key:2,"assets-path":unref(Y),items:Cr.value,organization:ar.value.find(tr=>tr.id_site_organization===Et.value),"show-logo":a.navigation.displayLogoImages,onBack:lr,onSelect:Tr},null,8,["assets-path","items","organization","show-logo"])):createCommentVNode("",!0)]))],64)):createCommentVNode("",!0),ie.value?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(Gr.$style["widget-data-error"])},[createVNode(_sfc_main$h,{icon:"x-circle"}),createBaseVNode("h2",null,toDisplayString$1(unref(c)(`${ie.value}short_description`)),1),createBaseVNode("p",null,toDisplayString$1(unref(c)(`${ie.value}long_description`)),1),createBaseVNode("button",{class:"pb-w-sync_primary-button",onClick:Lr},toDisplayString$1(unref(c)("common.retry")),1)],2)):createCommentVNode("",!0),At.value?(openBlock(),createElementBlock("div",{key:3,class:normalizeClass(Gr.$style["widget-data-error"])},[createVNode(_sfc_main$h,{icon:"x-circle"}),createBaseVNode("p",null,toDisplayString$1(unref(c)("common.no_filtered_data")),1),createBaseVNode("button",{class:"pb-w-sync_primary-button",onClick:Ir},toDisplayString$1(unref(c)("common.close")),1)],2)):createCommentVNode("",!0)],64)),!qe.value&&!ie.value&&!At.value||z.value?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(Gr.$style["security-banner"])},[createBaseVNode("p",null,toDisplayString$1(unref(c)("common.security_banner_title")),1),createBaseVNode("p",null,toDisplayString$1(unref(c)("common.security_banner_content")),1)],2)):createCommentVNode("",!0)],2)],64))],2)):createCommentVNode("",!0)]),_:1},8,["visible","mobile"]),createBaseVNode("div",{class:normalizeClass(Gr.$style["widget-version"])},toDisplayString$1(unref(xe)),3)],64))}}),container="pb-w-sync_container",style0={container,"credential-content":"pb-w-sync_credential-content","is-mobile":"pb-w-sync_is-mobile","security-banner":"pb-w-sync_security-banner","widget-back-button":"pb-w-sync_widget-back-button","widget-close-button":"pb-w-sync_widget-close-button","widget-content":"pb-w-sync_widget-content","widget-data-error":"pb-w-sync_widget-data-error","widget-header":"pb-w-sync_widget-header","widget-version":"pb-w-sync_widget-version"},cssModules={$style:style0},DataWidget=_export_sfc(_sfc_main$1,[["__cssModules",cssModules]]),defaultConfig={client:{},locale:"en",entrypoint:{country:"MX"},navigation:{disableFormAutocomplete:!1,displayAccountsSelection:!1,displayBusinessSites:!0,displayCredentialInModal:!1,displayErrorsInToast:!0,displayLogoImages:!0,displayLongDescription:!1,displayPersonalSites:!0,displayPrivacyScreen:!0,displaySiteOrganizations:[],displaySiteOrganizationTypes:[],displaySites:[],displayStatusInToast:!1,enableBackNavigation:!0,enableTwofaBackNavigation:!1,formButtonsDisabledStyle:!1,formShowPasswordStyle:"icon",getSelectedAccounts:void 0,hideSelectCountry:!1,hideSiteOrganizations:[],hideSiteOrganizationTypes:[],hideSites:[],oneSiteFlow:!1,quickAnswer:!1,returnToSiteFormOnUserError:!1,saveCredential:!0,selectClass:"",socketTimeout:24e4,toastDuration:5e3,toastPosition:"top-right"},__internal__:{apiBaseUrl:null,apiEnv:null,assetsBaseUrl:null,plaidSites:!1,defaultHttpParams:{}}},_sfc_main=defineComponent({__name:"App",props:{config:{default:()=>({})},enableTestMode:{type:Boolean,default:!1},refreshTokenFunction:{type:Function,default:void 0},strict:{default:void 0},token:{}},setup(e,{expose:t}){const n=e,a=ref(null),{t:s}=useI18n();provide(translateFunction,s);const o=reactive({client:{...defaultConfig.client,..._e(n.config.client)},enableTestMode:n.enableTestMode,entrypoint:{...defaultConfig.entrypoint,..._e(n.config.entrypoint)},internal:{...defaultConfig.__internal__,..._e(n.config.__internal__)},locale:n.config.locale||defaultConfig.locale,navigation:{...defaultConfig.navigation,..._e(n.config.navigation)},refreshTokenFunction:n.refreshTokenFunction,strict:n.strict,token:n.token,onTokenRefreshed:$e=>{o.token=$e}});function c(){a.value.close()}function f(){return a.value.getLastRid()}function y(){nextTick(()=>{a.value.open()})}function m($e={}){try{configValidator.validateSync($e)}catch(pe){if(pe.name==="ValidationError")throw new Error(`ValidationError: ${pe.message}`)}o.client={...defaultConfig.client,..._e($e.client)},o.entrypoint={...defaultConfig.entrypoint,..._e($e.entrypoint)},o.internal={...defaultConfig.__internal__,..._e($e.__internal__)},o.locale=$e.locale||defaultConfig.locale,o.navigation={...defaultConfig.navigation,..._e($e.navigation)}}function g($e){a.value.setCredential($e)}function z($e){o.entrypoint={...o.entrypoint,site:$e},y()}function ie($e){a.value.updateCredential($e)}function re($e,pe){return a.value.setToken($e,pe)}function he($e={}){try{configValidator.validateSync($e)}catch(pe){if(pe.name==="ValidationError")throw new Error(`ValidationError: ${pe.message}`)}o.client={...o.client,..._e($e.client)},o.entrypoint={...o.entrypoint,..._e($e.entrypoint)},o.internal={...o.internal,..._e($e.__internal__)},o.locale=$e.locale||o.locale,o.navigation={...o.navigation,..._e($e.navigation)}}function _e($e={}){const pe={...$e};return Object.keys(pe).forEach(Ce=>{pe[Ce]===void 0&&delete pe[Ce]}),pe}return t({close:c,getLastRid:f,open:y,setConfig:m,setEntrypointCredential:g,setEntrypointSite:z,setEntrypointUpdateCredential:ie,setToken:re,upsertConfig:he}),($e,pe)=>(openBlock(),createBlock(unref(ElConfigProvider),{locale:o.locale==="es"?unref(es):unref(en)},{default:withCtx(()=>[createVNode(DataWidget,mergeProps(o,{ref_key:"widgetComponent",ref:a}),null,16)]),_:1},8,["locale"]))}});function setDefaultConfig(e){return e||(e={}),{locale:e.locale?e.locale:"en",quickAnswer:!!e.quickAnswer,socketTimeout:e.socketTimeout||24e4}}function setSync(e,t){return new Promise(a=>{const s=new Sync(e.token,{http:{baseURL:"https://sync.paybook.com",isStrict:!!e.strict},defaultParams:{locale:t.locale},isHeadless:!0,quickAnswer:t.quickAnswer,socketTimeout:t.socketTimeout,widgetVersion:`${getVersion()}-headless`});e.strict?s.strictMode({token:e.token,strict:e.strict}).then(()=>{a(s)}):a(s)})}function getAccounts(e,t,n){return new Promise((s,o)=>{const c=setDefaultConfig(n);setSync(e,c).then(f=>{f.getAccounts({id_credential:t}).then(y=>{s(y)}).catch(y=>{o(y)})})})}function getCountries(e,t){return new Promise((a,s)=>{const o=setDefaultConfig(t);setSync(e,o).then(c=>{c.getCountries().then(f=>{a(f)}).catch(f=>{s(f)})})})}function getOrganizationSites(e,t={},n){return new Promise((s,o)=>{const c=setDefaultConfig(n);setSync(e,c).then(f=>{f.getOrganizationSites(t).then(y=>{s(y)}).catch(y=>{o(y)})})})}function getOrganizationTypes(e,t){return new Promise((a,s)=>{const o=setDefaultConfig(t);setSync(e,o).then(c=>{c.getOrganizationTypes().then(f=>{a(f)}).catch(f=>{s(f)})})})}function getSite(e,t,n){return new Promise((s,o)=>{const c=setDefaultConfig(n);setSync(e,c).then(f=>{f.getSite(t).then(y=>{s(y[0])}).catch(y=>{o(y)})})})}function siteConnection(e,t,n){return new Promise(s=>{const o=setDefaultConfig(n);setSync(e,o).then(c=>{s(c.siteConnection(t))})})}function syncCredential(e,t,n){return new Promise(s=>{const o=setDefaultConfig(n);setSync(e,o).then(c=>{s(c.syncCredential(t))})})}function twofa(e,t,n,a){return new Promise(o=>{const c=setDefaultConfig(a);setSync(e,c).then(f=>{o(new TWOFA({...t,id_site:n},f.getHttpService(),!1))})})}function updateCredential(e,t,n){return new Promise(s=>{const o=setDefaultConfig(n);setSync(e,o).then(c=>{s(c.syncCredential(t,!0))})})}const staticMethods={getAccounts,getCountries,getOrganizationSites,getOrganizationTypes,getSite,siteConnection,syncCredential,twofa,updateCredential};initFirebase();class SyncfyWidget{constructor(t){const n=new Rollbar({accessToken:"2d928ea9aa674c6ea84dbf6f3901a403",captureUncaught:!1,captureUnhandledRejections:!1,enabled:!0,environment:"production",payload:{code_version:getVersion()}});let a;if(typeof t=="string")a={token:t};else if(typeof t=="object")a=t;else throw new Error("Invalid params type. Params must be either string or object.");try{paramsValidator.validateSync(a)}catch(g){if(g.name==="ValidationError")throw new Error(`ValidationError: ${g.message}`)}measureEvent("instantiation");const s=createApp(_sfc_main,{config:a.config,enableTestMode:a.enableTestMode,refreshTokenFunction:a.refreshTokenFunction,strict:a.strict,token:a.token}),o=createI18n({fallbackLocale:"en",locale:"en",messages:{en:resource$1,es:resource}});s.use(o),s.use(ge$1),s.config.errorHandler=g=>{throw n.error(g),g};const c=[];function f(g,z){c.push({callback:z,e:g})}function y(g,...z){c.forEach(({callback:ie,e:re})=>{g===re&&ie(...z)})}s.provide(rootEmitter,y);const m=s.mount(a.element||"#widget");return{on:f,close:m.close,getLastRid:m.getLastRid,open:m.open,setConfig:m.setConfig,setEntrypointCredential:m.setEntrypointCredential,setEntrypointSite:m.setEntrypointSite,setEntrypointUpdateCredential:m.setEntrypointUpdateCredential,setToken:m.setToken,upsertConfig:m.upsertConfig}}static getVersion(){return getVersion()}}return $n(SyncfyWidget,"headless",staticMethods),window.SyncfyWidget=SyncfyWidget,SyncfyWidget});