From 71379dac8ba0bdb2761aac66f38058e76c7b6816 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 3 Sep 2026 15:41:33 -0400 Subject: [PATCH 01/90] Use config array instead of object for Auth plugins --- .../VuFind/src/VuFind/Auth/AbstractBase.php | 10 +++--- .../VuFind/src/VuFind/Auth/AuthInterface.php | 2 +- module/VuFind/src/VuFind/Auth/ChoiceAuth.php | 8 ++--- .../src/VuFind/Auth/EmailAuthenticator.php | 14 ++++---- .../VuFind/Auth/EmailAuthenticatorFactory.php | 2 +- .../src/VuFind/Auth/LoginTokenManager.php | 15 ++++---- .../VuFind/Auth/LoginTokenManagerFactory.php | 2 +- module/VuFind/src/VuFind/Auth/Manager.php | 35 +++++++++---------- .../VuFind/src/VuFind/Auth/ManagerFactory.php | 2 +- module/VuFind/src/VuFind/Auth/MultiAuth.php | 14 ++++---- .../VuFind/src/VuFind/Auth/PasswordAccess.php | 4 +-- module/VuFind/src/VuFind/Auth/Shibboleth.php | 30 ++++++++-------- 12 files changed, 68 insertions(+), 70 deletions(-) diff --git a/module/VuFind/src/VuFind/Auth/AbstractBase.php b/module/VuFind/src/VuFind/Auth/AbstractBase.php index 22a4e82e4866..fd05f62b68d3 100644 --- a/module/VuFind/src/VuFind/Auth/AbstractBase.php +++ b/module/VuFind/src/VuFind/Auth/AbstractBase.php @@ -70,7 +70,7 @@ abstract class AbstractBase implements /** * Configuration settings. * - * @var \VuFind\Config\Config + * @var array */ protected $config = null; @@ -101,7 +101,7 @@ abstract class AbstractBase implements * exception if the configuration is invalid. * * @throws AuthException - * @return \VuFind\Config\Config + * @return array */ public function getConfig() { @@ -145,7 +145,7 @@ public function clearLoginState() /** * Set configuration. * - * @param \VuFind\Config\Config $config Configuration to set + * @param array $config Configuration to set * * @return void */ @@ -450,8 +450,8 @@ public function getPolicyConfig(string $type): array { $policy = []; $config = $this->getConfig(); - $authConfig = isset($config->Authentication) - ? $config->Authentication->toArray() + $authConfig = isset($config['Authentication']) + ? $config['Authentication'] : []; /* Map settings to the policy array, e.g.: * diff --git a/module/VuFind/src/VuFind/Auth/AuthInterface.php b/module/VuFind/src/VuFind/Auth/AuthInterface.php index b3462534d719..685f3ecc6950 100644 --- a/module/VuFind/src/VuFind/Auth/AuthInterface.php +++ b/module/VuFind/src/VuFind/Auth/AuthInterface.php @@ -71,7 +71,7 @@ public function clearLoginState(); /** * Set configuration. * - * @param \VuFind\Config\Config $config Configuration to set + * @param array $config Configuration to set * * @return void */ diff --git a/module/VuFind/src/VuFind/Auth/ChoiceAuth.php b/module/VuFind/src/VuFind/Auth/ChoiceAuth.php index 6499770ffba6..0f70939eaebc 100644 --- a/module/VuFind/src/VuFind/Auth/ChoiceAuth.php +++ b/module/VuFind/src/VuFind/Auth/ChoiceAuth.php @@ -107,8 +107,8 @@ public function __construct(\Laminas\Session\Container $container) protected function validateConfig() { if ( - !isset($this->config->ChoiceAuth->choice_order) - || !strlen($this->config->ChoiceAuth->choice_order) + !isset($this->config['ChoiceAuth']['choice_order']) + || !strlen($this->config['ChoiceAuth']['choice_order']) ) { throw new AuthException( 'One or more ChoiceAuth parameters are missing. ' . @@ -120,7 +120,7 @@ protected function validateConfig() /** * Set configuration; throw an exception if it is invalid. * - * @param \VuFind\Config\Config $config Configuration to set + * @param $config Configuration to set * * @throws AuthException * @return void @@ -130,7 +130,7 @@ public function setConfig($config) parent::setConfig($config); $this->strategies = array_map( 'trim', - explode(',', $this->getConfig()->ChoiceAuth->choice_order) + explode(',', $this->getConfig()['ChoiceAuth']['choice_order']) ); } diff --git a/module/VuFind/src/VuFind/Auth/EmailAuthenticator.php b/module/VuFind/src/VuFind/Auth/EmailAuthenticator.php index 5a313a0cdbdf..c898a2c7051a 100644 --- a/module/VuFind/src/VuFind/Auth/EmailAuthenticator.php +++ b/module/VuFind/src/VuFind/Auth/EmailAuthenticator.php @@ -70,7 +70,7 @@ class EmailAuthenticator implements \VuFind\I18n\Translator\TranslatorAwareInter * @param \VuFind\Mailer\Mailer $mailer Mailer * @param PhpRenderer $viewRenderer View Renderer * @param UserIpReader $userIpReader User IP address reader - * @param \VuFind\Config\Config $config Configuration + * @param array $config Configuration * @param AuthHashServiceInterface $authHashService AuthHash database service */ public function __construct( @@ -79,7 +79,7 @@ public function __construct( protected \VuFind\Mailer\Mailer $mailer, protected PhpRenderer $viewRenderer, protected UserIpReader $userIpReader, - protected \VuFind\Config\Config $config, + protected array $config, protected AuthHashServiceInterface $authHashService ) { } @@ -113,7 +113,7 @@ public function sendAuthenticationLink( $templateParams = [] ) { // Make sure we've waited long enough - $recoveryInterval = $this->config->Authentication->recover_interval ?? 60; + $recoveryInterval = $this->config['Authentication']['recover_interval'] ?? 60; $sessionId = $this->sessionManager->getId(); if ( @@ -145,7 +145,7 @@ public function sendAuthenticationLink( $viewParams['url'] = $serverHelper( $urlHelper($linkRoute, $routeParams, ['query' => $urlParams]) ); - $viewParams['title'] = $this->config->Site->title; + $viewParams['title'] = $this->config['Site']['title']; $message = $this->viewRenderer->render($template, $viewParams); $from = $this->getEmailSenderAddress($this->config, $email); @@ -236,7 +236,7 @@ public function sendAuthenticationCode( $templateParams = [] ): int { // Make sure we've waited long enough - $recoveryInterval = $this->config->Authentication->recover_interval ?? 60; + $recoveryInterval = $this->config['Authentication']['recover_interval'] ?? 60; $sessionId = $this->sessionManager->getId(); if ( @@ -260,7 +260,7 @@ public function sendAuthenticationCode( $viewParams = $templateParams; $viewParams['code'] = $otp; - $viewParams['title'] = $this->config->Site->title ?? ''; + $viewParams['title'] = $this->config['Site']['title'] ?? ''; $message = $this->viewRenderer->render($template, $viewParams); $from = $this->getEmailSenderAddress($this->config, $email); @@ -310,7 +310,7 @@ public function verifyAuthenticationCode( throw $e; } // Check the maximum attempt limit: - $maxAttempts = max($this->config->Authentication->otp_max_attempts ?? 3, 1); + $maxAttempts = max($this->config['Authentication']['otp_max_attempts'] ?? 3, 1); if ($attempts > $maxAttempts) { throw new AuthException('authentication_error_expired'); } diff --git a/module/VuFind/src/VuFind/Auth/EmailAuthenticatorFactory.php b/module/VuFind/src/VuFind/Auth/EmailAuthenticatorFactory.php index e61276f392d7..d73865ec7bb5 100644 --- a/module/VuFind/src/VuFind/Auth/EmailAuthenticatorFactory.php +++ b/module/VuFind/src/VuFind/Auth/EmailAuthenticatorFactory.php @@ -73,7 +73,7 @@ public function __invoke( $container->get(\VuFind\Mailer\Mailer::class), $container->get('ViewRenderer'), $container->get(\VuFind\Net\UserIpReader::class), - $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'), + $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'), $container->get(\VuFind\Db\Service\PluginManager::class) ->get(\VuFind\Db\Service\AuthHashServiceInterface::class) ); diff --git a/module/VuFind/src/VuFind/Auth/LoginTokenManager.php b/module/VuFind/src/VuFind/Auth/LoginTokenManager.php index 379cd94120f3..171537dd1018 100644 --- a/module/VuFind/src/VuFind/Auth/LoginTokenManager.php +++ b/module/VuFind/src/VuFind/Auth/LoginTokenManager.php @@ -36,7 +36,6 @@ use Laminas\Session\SessionManager; use Laminas\View\Renderer\RendererInterface; use Psr\Log\LoggerAwareInterface; -use VuFind\Config\Config; use VuFind\Config\Feature\EmailSettingsTrait; use VuFind\Cookie\CookieManager; use VuFind\Db\Entity\UserEntityInterface; @@ -104,7 +103,7 @@ class LoginTokenManager implements LoggerAwareInterface, TranslatorAwareInterfac /** * LoginToken constructor. * - * @param Config $config Configuration + * @param array $config Configuration * @param UserServiceInterface $userService User database service * @param LoginTokenServiceInterface $loginTokenService Login Token database service * @param CookieManager $cookieManager Cookie manager @@ -114,7 +113,7 @@ class LoginTokenManager implements LoggerAwareInterface, TranslatorAwareInterfac * @param callable $browscapCB Callback for creating Browscap */ public function __construct( - protected Config $config, + protected array $config, protected UserServiceInterface $userService, protected LoginTokenServiceInterface $loginTokenService, protected CookieManager $cookieManager, @@ -273,7 +272,7 @@ public function deleteUserLoginTokens($userId) */ public function getCookieLifetime(): int { - return (int)($this->config->Authentication->persistent_login_lifetime ?? 14); + return (int)($this->config['Authentication']['persistent_login_lifetime'] ?? 14); } /** @@ -332,7 +331,7 @@ protected function createOrRotateToken( $userId = $user->getId(); try { if ($series) { - $lenient = ($this->config->Authentication->lenient_token_rotation ?? true); + $lenient = ($this->config['Authentication']['lenient_token_rotation'] ?? true); $this->loginTokenService->deleteBySeries($series, $lenient ? $currentTokenId : null); $this->debug("Updating login token $token series $series for user {$userId}"); } else { @@ -364,16 +363,16 @@ protected function createOrRotateToken( */ protected function sendLoginTokenWarningEmail(UserEntityInterface $user) { - if (!($this->config->Authentication->send_login_warnings ?? true)) { + if (!($this->config['Authentication']['send_login_warnings'] ?? true)) { return; } - $title = $this->config->Site->title ?? ''; + $title = $this->config['Site']['title'] ?? ''; if ($toAddr = $user->getEmail()) { $message = $this->viewRenderer->render( 'Email/login-warning.phtml', compact('title') ); - $subject = $this->config->Authentication->persistent_login_warning_email_subject + $subject = $this->config['Authentication']['persistent_login_warning_email_subject'] ?? 'persistent_login_warning_email_subject'; try { diff --git a/module/VuFind/src/VuFind/Auth/LoginTokenManagerFactory.php b/module/VuFind/src/VuFind/Auth/LoginTokenManagerFactory.php index 54e2f1fcd8f2..3c01f2b2d231 100644 --- a/module/VuFind/src/VuFind/Auth/LoginTokenManagerFactory.php +++ b/module/VuFind/src/VuFind/Auth/LoginTokenManagerFactory.php @@ -82,7 +82,7 @@ public function __invoke( $dbServiceManager = $container->get(\VuFind\Db\Service\PluginManager::class); return new $requestedName( - $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'), + $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'), $dbServiceManager->get(UserServiceInterface::class), $dbServiceManager->get(LoginTokenServiceInterface::class), $container->get(\VuFind\Cookie\CookieManager::class), diff --git a/module/VuFind/src/VuFind/Auth/Manager.php b/module/VuFind/src/VuFind/Auth/Manager.php index 12909e4bbc2b..80f2d6fa8a76 100644 --- a/module/VuFind/src/VuFind/Auth/Manager.php +++ b/module/VuFind/src/VuFind/Auth/Manager.php @@ -35,7 +35,6 @@ use Lmc\Rbac\Identity\IdentityInterface; use Lmc\Rbac\Mvc\Identity\IdentityProviderInterface; use Psr\Log\LoggerAwareInterface; -use VuFind\Config\Config; use VuFind\Cookie\CookieManager; use VuFind\Db\Entity\UserEntityInterface; use VuFind\Db\Service\AuditEventServiceInterface; @@ -121,7 +120,7 @@ class Manager implements IdentityProviderInterface, LoggerAwareInterface /** * Constructor. * - * @param Config $config VuFind configuration + * @param array $config VuFind configuration * @param UserServiceInterface $userService User database service * @param UserSessionPersistenceInterface $userSession User session persistence service * @param SessionManager $sessionManager Session manager @@ -134,7 +133,7 @@ class Manager implements IdentityProviderInterface, LoggerAwareInterface * @param AuditEventServiceInterface $auditEventService Event database service */ public function __construct( - protected Config $config, + protected array $config, protected UserServiceInterface $userService, protected UserSessionPersistenceInterface $userSession, protected SessionManager $sessionManager, @@ -148,7 +147,7 @@ public function __construct( ) { // Initialize active authentication setting (defaulting to Database // if no setting passed in): - $method = $this->getPreAuthenticationData()['authMethod'] ?? $config->Authentication->method ?? 'Database'; + $method = $this->getPreAuthenticationData()['authMethod'] ?? $config['Authentication']['method'] ?? 'Database'; // Set the active authentication method and force it legal: $this->setAuthMethod($method, true); } @@ -231,7 +230,7 @@ public function supportsCreation(?string $authMethod = null): bool */ public function supportsRecovery(?string $authMethod = null, ?string $target = null): bool { - return ($this->config->Authentication->recover_password ?? false) + return ($this->config['Authentication']['recover_password'] ?? false) && $this->getAuth($authMethod)->supportsPasswordRecovery($target); } @@ -269,7 +268,7 @@ public function getPasswordRecoveryData(array $params): ?array */ public function supportsEmailChange(?string $authMethod = null): bool { - return $this->config->Authentication->change_email ?? false; + return $this->config['Authentication']['change_email'] ?? false; } /** @@ -282,7 +281,7 @@ public function supportsEmailChange(?string $authMethod = null): bool */ public function supportsPasswordChange(?string $authMethod = null): bool { - return ($this->config->Authentication->change_password ?? false) + return ($this->config['Authentication']['change_password'] ?? false) && $this->getAuth($authMethod)->supportsPasswordChange(); } @@ -296,7 +295,7 @@ public function supportsPasswordChange(?string $authMethod = null): bool */ public function supportsConnectingLibraryCard(?string $authMethod = null): bool { - return ($this->config->Catalog->auth_based_library_cards ?? false) + return ($this->config['Catalog']['auth_based_library_cards'] ?? false) && $this->getAuth($authMethod)->supportsConnectingLibraryCard(); } @@ -309,10 +308,10 @@ public function supportsConnectingLibraryCard(?string $authMethod = null): bool */ public function supportsPersistentLogin(?string $authMethod = null): bool { - if (!empty($this->config->Authentication->persistent_login)) { + if (!empty($this->config['Authentication']['persistent_login'])) { return in_array( strtolower($authMethod ?? $this->getSelectedAuthMethod() ?? ''), - explode(',', strtolower($this->config->Authentication->persistent_login)) + explode(',', strtolower($this->config['Authentication']['persistent_login'])) ); } return false; @@ -325,7 +324,7 @@ public function supportsPersistentLogin(?string $authMethod = null): bool */ public function getPersistentLoginLifetime(): int { - return $this->config->Authentication->persistent_login_lifetime ?? 14; + return $this->config['Authentication']['persistent_login_lifetime'] ?? 14; } /** @@ -516,7 +515,7 @@ public function loginEnabled(): bool { if (null === $this->hideLogin) { // Assume login is enabled unless explicitly turned off: - $this->hideLogin = ($this->config->Authentication->hideLogin ?? false); + $this->hideLogin = ($this->config['Authentication']['hideLogin'] ?? false); if (!$this->hideLogin) { try { @@ -544,7 +543,7 @@ public function loginEnabled(): bool public function ajaxEnabled(): bool { // Assume ajax is enabled unless explicitly turned off: - return $this->config->Authentication->enableAjax ?? true; + return $this->config['Authentication']['enableAjax'] ?? true; } /** @@ -555,7 +554,7 @@ public function ajaxEnabled(): bool public function dropdownEnabled(): bool { // Assume dropdown is disabled unless explicitly turned on: - return $this->config->Authentication->enableDropdown ?? false; + return $this->config['Authentication']['enableDropdown'] ?? false; } /** @@ -740,7 +739,7 @@ public function checkForExpiredCredentials(): bool */ public function inPrivacyMode(): bool { - return $this->config->Authentication->privacy ?? false; + return $this->config['Authentication']['privacy'] ?? false; } /** @@ -838,7 +837,7 @@ public function updateEmail(UserEntityInterface $user, string $email): void { // Depending on verification setting, either do a direct update or else // put the new address into a pending state. - if ($this->config->Authentication->verify_email ?? false) { + if ($this->config['Authentication']['verify_email'] ?? false) { // If new email address is the current address, just reset any pending // email address: $user->setPendingEmail($email === $user->getEmail() ? '' : $email); @@ -996,7 +995,7 @@ public function login(Request $request): ?UserEntityInterface // Attempt catalog login so that any bad credentials are cleared before further processing // (avoids e.g. multiple login attempts by account AJAX checks). if ( - ($this->config->Catalog->checkILSCredentialsOnLogin ?? true) + ($this->config['Catalog']['checkILSCredentialsOnLogin'] ?? true) && $this->ilsAuthenticator && $this->allowsUserIlsLogin() && ($catUsername = $user->getCatUsername()) @@ -1225,7 +1224,7 @@ protected function updateUser(UserEntityInterface $user, ?string $authMethod): v */ public function allowsUserIlsLogin(): bool { - return $this->config->Catalog->allowUserLogin ?? true; + return $this->config['Catalog']['allowUserLogin'] ?? true; } /** diff --git a/module/VuFind/src/VuFind/Auth/ManagerFactory.php b/module/VuFind/src/VuFind/Auth/ManagerFactory.php index 6227f40b23f9..1954fd381ac9 100644 --- a/module/VuFind/src/VuFind/Auth/ManagerFactory.php +++ b/module/VuFind/src/VuFind/Auth/ManagerFactory.php @@ -69,7 +69,7 @@ public function __invoke( throw new \Exception('Unexpected options passed to factory.'); } // Load dependencies: - $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'); + $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'); $dbServiceManager = $container->get(\VuFind\Db\Service\PluginManager::class); $userService = $dbServiceManager->get(\VuFind\Db\Service\UserServiceInterface::class); $sessionManager = $container->get(\Laminas\Session\SessionManager::class); diff --git a/module/VuFind/src/VuFind/Auth/MultiAuth.php b/module/VuFind/src/VuFind/Auth/MultiAuth.php index b8ac52cf046b..5545d0d742de 100644 --- a/module/VuFind/src/VuFind/Auth/MultiAuth.php +++ b/module/VuFind/src/VuFind/Auth/MultiAuth.php @@ -115,7 +115,7 @@ class MultiAuth extends AbstractBase */ protected function validateConfig() { - if (empty($this->config->MultiAuth->method_order)) { + if (empty($this->config['MultiAuth']['method_order'])) { throw new AuthException( 'One or more MultiAuth parameters are missing. ' . 'Check your config.ini!' @@ -126,7 +126,7 @@ protected function validateConfig() /** * Set configuration; throw an exception if it is invalid. * - * @param \VuFind\Config\Config $config Configuration to set + * @param array $config Configuration to set * * @throws AuthException * @return void @@ -134,19 +134,19 @@ protected function validateConfig() public function setConfig($config) { parent::setConfig($config); - if (isset($config->MultiAuth->method_order)) { + if (isset($config['MultiAuth']['method_order'])) { $this->methods = array_map( 'trim', - explode(',', $config->MultiAuth->method_order) + explode(',', $config['MultiAuth']['method_order']) ); } if ( - isset($config->MultiAuth->filters) - && strlen($config->MultiAuth->filters) + isset($config['MultiAuth']['filters']) + && strlen($config['MultiAuth']['filters']) ) { $this->filters = array_map( 'trim', - explode(',', $config->MultiAuth->filters) + explode(',', $config['MultiAuth']['filters']) ); } } diff --git a/module/VuFind/src/VuFind/Auth/PasswordAccess.php b/module/VuFind/src/VuFind/Auth/PasswordAccess.php index 10ac3d1d1e92..5a90561406fe 100644 --- a/module/VuFind/src/VuFind/Auth/PasswordAccess.php +++ b/module/VuFind/src/VuFind/Auth/PasswordAccess.php @@ -52,7 +52,7 @@ class PasswordAccess extends AbstractBase * exception if the configuration is invalid. * * @throws AuthException - * @return \VuFind\Config\Config + * @return array */ public function getConfig() { @@ -76,7 +76,7 @@ public function getConfig() */ public function authenticate($request) { - $config = $this->getConfig()->toArray(); + $config = $this->getConfig(); $requestPassword = trim($request->getPost()->get('password', '')); foreach ($config['PasswordAccess']['access_user_hashed'] ?? [] as $username => $passwordHash) { if (password_verify($requestPassword, $passwordHash)) { diff --git a/module/VuFind/src/VuFind/Auth/Shibboleth.php b/module/VuFind/src/VuFind/Auth/Shibboleth.php index e42e26dd05e0..c91e2ff4c728 100644 --- a/module/VuFind/src/VuFind/Auth/Shibboleth.php +++ b/module/VuFind/src/VuFind/Auth/Shibboleth.php @@ -116,17 +116,17 @@ public function __construct( /** * Set configuration. * - * @param \VuFind\Config\Config $config Configuration to set + * @param array $config Configuration to set * * @return void */ public function setConfig($config) { parent::setConfig($config); - $this->useHeaders = $this->config->Shibboleth->use_headers ?? false; - $this->shibIdentityProvider = $this->config->Shibboleth->idpserverparam + $this->useHeaders = $this->config['Shibboleth']['use_headers'] ?? false; + $this->shibIdentityProvider = $this->config['Shibboleth']['idpserverparam'] ?? self::DEFAULT_IDPSERVERPARAM; - $this->shibSessionId = $this->config->Shibboleth->session_id ?? null; + $this->shibSessionId = $this->config['Shibboleth']['session_id'] ?? null; } /** @@ -140,8 +140,8 @@ public function setConfig($config) protected function validateConfig() { // Throw an exception if the required username setting is missing. - $shib = $this->config->Shibboleth; - if (!isset($shib->username) || empty($shib->username)) { + $shib = $this->config['Shibboleth']; + if (!isset($shib['username']) || empty([$shib['username']])) { throw new AuthException( 'Shibboleth username is missing in your configuration file.' ); @@ -239,17 +239,17 @@ public function authenticate($request) public function getSessionInitiator(string $target): ?string { $config = $this->getConfig(); - $shibTarget = $config->Shibboleth->target ?? $target; + $shibTarget = $config['Shibboleth']['target'] ?? $target; $append = (str_contains($shibTarget, '?')) ? '&' : '?'; // Adding the auth_method parameter makes it possible to handle logins when // using an auth method that proxies others. - $sessionInitiator = $config->Shibboleth->login + $sessionInitiator = $config['Shibboleth']['login'] . '?target=' . urlencode($shibTarget) . urlencode($append . 'auth_method=Shibboleth'); - if (isset($config->Shibboleth->provider_id)) { + if (isset($config['Shibboleth']['provider_id'])) { $sessionInitiator = $sessionInitiator . '&entityID=' . - urlencode($config->Shibboleth->provider_id); + urlencode($config['Shibboleth']['provider_id']); } return $sessionInitiator; @@ -265,7 +265,7 @@ public function isExpired() $config = $this->getConfig(); if ( !isset($this->shibSessionId) - || !($config->Shibboleth->checkExpiredSession ?? true) + || !($config['Shibboleth']['checkExpiredSession'] ?? true) ) { return false; } @@ -284,9 +284,9 @@ public function getLogoutRedirectUrl(string $url): string { // If single log-out is enabled, use a special URL: $config = $this->getConfig(); - if (!empty($config->Shibboleth->logout)) { - $append = (str_contains($config->Shibboleth->logout, '?')) ? '&' : '?'; - $url = $config->Shibboleth->logout . $append . 'return=' . urlencode($url); + if (!empty($config['Shibboleth']['logout'])) { + $append = (str_contains($config['Shibboleth']['logout'], '?')) ? '&' : '?'; + $url = $config['Shibboleth']['logout'] . $append . 'return=' . urlencode($url); } // Send back the redirect URL (possibly modified): @@ -418,4 +418,4 @@ protected function getAttribute($request, $attribute): ?string return $request->getServer()->get($attribute, null); } } -} +} \ No newline at end of file From 5c0a492c329b4983990173e7d69f0fc48f6b12c6 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 3 Sep 2026 15:43:57 -0400 Subject: [PATCH 02/90] composer fix --- module/VuFind/src/VuFind/Auth/AbstractBase.php | 5 ++--- module/VuFind/src/VuFind/Auth/ChoiceAuth.php | 2 +- module/VuFind/src/VuFind/Auth/LoginTokenManager.php | 2 +- module/VuFind/src/VuFind/Auth/Manager.php | 2 +- module/VuFind/src/VuFind/Auth/Shibboleth.php | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/module/VuFind/src/VuFind/Auth/AbstractBase.php b/module/VuFind/src/VuFind/Auth/AbstractBase.php index fd05f62b68d3..7aead78733c6 100644 --- a/module/VuFind/src/VuFind/Auth/AbstractBase.php +++ b/module/VuFind/src/VuFind/Auth/AbstractBase.php @@ -450,9 +450,8 @@ public function getPolicyConfig(string $type): array { $policy = []; $config = $this->getConfig(); - $authConfig = isset($config['Authentication']) - ? $config['Authentication'] - : []; + $authConfig = $config['Authentication'] + ?? []; /* Map settings to the policy array, e.g.: * * password_minimum_length or username_minimum_length => minLength diff --git a/module/VuFind/src/VuFind/Auth/ChoiceAuth.php b/module/VuFind/src/VuFind/Auth/ChoiceAuth.php index 0f70939eaebc..6a3ef4239c45 100644 --- a/module/VuFind/src/VuFind/Auth/ChoiceAuth.php +++ b/module/VuFind/src/VuFind/Auth/ChoiceAuth.php @@ -120,7 +120,7 @@ protected function validateConfig() /** * Set configuration; throw an exception if it is invalid. * - * @param $config Configuration to set + * @param $config Configuration to set * * @throws AuthException * @return void diff --git a/module/VuFind/src/VuFind/Auth/LoginTokenManager.php b/module/VuFind/src/VuFind/Auth/LoginTokenManager.php index 171537dd1018..c6d23085c3c6 100644 --- a/module/VuFind/src/VuFind/Auth/LoginTokenManager.php +++ b/module/VuFind/src/VuFind/Auth/LoginTokenManager.php @@ -103,7 +103,7 @@ class LoginTokenManager implements LoggerAwareInterface, TranslatorAwareInterfac /** * LoginToken constructor. * - * @param array $config Configuration + * @param array $config Configuration * @param UserServiceInterface $userService User database service * @param LoginTokenServiceInterface $loginTokenService Login Token database service * @param CookieManager $cookieManager Cookie manager diff --git a/module/VuFind/src/VuFind/Auth/Manager.php b/module/VuFind/src/VuFind/Auth/Manager.php index 80f2d6fa8a76..347488fd8b85 100644 --- a/module/VuFind/src/VuFind/Auth/Manager.php +++ b/module/VuFind/src/VuFind/Auth/Manager.php @@ -120,7 +120,7 @@ class Manager implements IdentityProviderInterface, LoggerAwareInterface /** * Constructor. * - * @param array $config VuFind configuration + * @param array $config VuFind configuration * @param UserServiceInterface $userService User database service * @param UserSessionPersistenceInterface $userSession User session persistence service * @param SessionManager $sessionManager Session manager diff --git a/module/VuFind/src/VuFind/Auth/Shibboleth.php b/module/VuFind/src/VuFind/Auth/Shibboleth.php index c91e2ff4c728..a778f7281959 100644 --- a/module/VuFind/src/VuFind/Auth/Shibboleth.php +++ b/module/VuFind/src/VuFind/Auth/Shibboleth.php @@ -418,4 +418,4 @@ protected function getAttribute($request, $attribute): ?string return $request->getServer()->get($attribute, null); } } -} \ No newline at end of file +} From de19999b177e980472c27b84fd49a34a5a4d31f0 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 3 Sep 2026 15:48:37 -0400 Subject: [PATCH 03/90] update test --- .../unit-tests/src/VuFindTest/Auth/EmailAuthenticatorTest.php | 3 +-- .../tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/EmailAuthenticatorTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/EmailAuthenticatorTest.php index 25fe078ee537..3ad5b4cb76a9 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/EmailAuthenticatorTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/EmailAuthenticatorTest.php @@ -37,7 +37,6 @@ use PHPUnit\Framework\InvalidArgumentException; use PHPUnit\Framework\MockObject\Exception; use VuFind\Auth\EmailAuthenticator; -use VuFind\Config\Config; use VuFind\Db\Entity\AuthHashEntityInterface; use VuFind\Db\Service\AuthHashServiceInterface; use VuFind\Mailer\Mailer; @@ -89,7 +88,7 @@ protected function getEmailAuthenticator( $mailer ?? $this->createStub(Mailer::class), $renderer ?? $this->createStub(PhpRenderer::class), $userIpReader ?? $this->createStub(UserIpReader::class), - new Config($config), + $config, $authHashService ?? $this->createStub(AuthHashServiceInterface::class) ); $authenticator->setTranslator($this->getMockTranslator([])); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php index 515ea460cad1..ea8ade83009a 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php @@ -35,7 +35,6 @@ use VuFind\Auth\Manager; use VuFind\Auth\PluginManager; use VuFind\Auth\UserSessionPersistenceInterface; -use VuFind\Config\Config; use VuFind\Db\Entity\UserEntityInterface; use VuFind\Db\Service\UserServiceInterface; @@ -561,7 +560,6 @@ protected function getManager( ?SessionManager $sessionManager = null, ?PluginManager $pm = null ): Manager { - $config = new Config($config); $cookies = new \VuFind\Cookie\CookieManager([]); $csrf = new \VuFind\Validator\SessionCsrf( [ From 89800191204adbe82a87e13a5852403f5665f2db Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 3 Sep 2026 15:50:35 -0400 Subject: [PATCH 04/90] logintokenmanagertest --- .../unit-tests/src/VuFindTest/Auth/LoginTokenManagerTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LoginTokenManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LoginTokenManagerTest.php index c4951dbd7777..0f3cf2f9cda1 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LoginTokenManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LoginTokenManagerTest.php @@ -35,7 +35,6 @@ use Laminas\Session\SessionManager; use PHPUnit\Framework\MockObject\MockObject; use VuFind\Auth\LoginTokenManager; -use VuFind\Config\Config; use VuFind\Cookie\CookieManager; use VuFind\Db\Entity\LoginTokenEntityInterface; use VuFind\Db\Entity\UserEntityInterface; @@ -193,7 +192,7 @@ protected function getCookieManager(array $cookies): CookieManager */ protected function getLoginToken($cookieManager, $tokenTable, $userTable, $browscapOk) { - $config = new Config([]); + $config = []; $saveHandler = $this->createMock(SaveHandlerInterface::class); $sessionManager = $this->createMock(SessionManager::class); $sessionManager->method('getSaveHandler')->willReturn($saveHandler); From 242c25a331814cab5ad9952c5e9724f62d759293 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 8 Sep 2026 11:01:00 -0400 Subject: [PATCH 05/90] logintokenmanagertest --- .../unit-tests/src/VuFindTest/Auth/LoginTokenManagerTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LoginTokenManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LoginTokenManagerTest.php index 0f3cf2f9cda1..c4951dbd7777 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LoginTokenManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LoginTokenManagerTest.php @@ -35,6 +35,7 @@ use Laminas\Session\SessionManager; use PHPUnit\Framework\MockObject\MockObject; use VuFind\Auth\LoginTokenManager; +use VuFind\Config\Config; use VuFind\Cookie\CookieManager; use VuFind\Db\Entity\LoginTokenEntityInterface; use VuFind\Db\Entity\UserEntityInterface; @@ -192,7 +193,7 @@ protected function getCookieManager(array $cookies): CookieManager */ protected function getLoginToken($cookieManager, $tokenTable, $userTable, $browscapOk) { - $config = []; + $config = new Config([]); $saveHandler = $this->createMock(SaveHandlerInterface::class); $sessionManager = $this->createMock(SessionManager::class); $sessionManager->method('getSaveHandler')->willReturn($saveHandler); From 7e21c774329b5d7fa727573ec9198b41c192ad5b Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 8 Sep 2026 11:01:50 -0400 Subject: [PATCH 06/90] emailauthenticatortest --- .../unit-tests/src/VuFindTest/Auth/EmailAuthenticatorTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/EmailAuthenticatorTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/EmailAuthenticatorTest.php index 3ad5b4cb76a9..25fe078ee537 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/EmailAuthenticatorTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/EmailAuthenticatorTest.php @@ -37,6 +37,7 @@ use PHPUnit\Framework\InvalidArgumentException; use PHPUnit\Framework\MockObject\Exception; use VuFind\Auth\EmailAuthenticator; +use VuFind\Config\Config; use VuFind\Db\Entity\AuthHashEntityInterface; use VuFind\Db\Service\AuthHashServiceInterface; use VuFind\Mailer\Mailer; @@ -88,7 +89,7 @@ protected function getEmailAuthenticator( $mailer ?? $this->createStub(Mailer::class), $renderer ?? $this->createStub(PhpRenderer::class), $userIpReader ?? $this->createStub(UserIpReader::class), - $config, + new Config($config), $authHashService ?? $this->createStub(AuthHashServiceInterface::class) ); $authenticator->setTranslator($this->getMockTranslator([])); From 1a65b990dd072b3db6b5882131a1f7dad8f4d1e8 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 8 Sep 2026 11:02:26 -0400 Subject: [PATCH 07/90] managertest --- .../VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php index ea8ade83009a..515ea460cad1 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php @@ -35,6 +35,7 @@ use VuFind\Auth\Manager; use VuFind\Auth\PluginManager; use VuFind\Auth\UserSessionPersistenceInterface; +use VuFind\Config\Config; use VuFind\Db\Entity\UserEntityInterface; use VuFind\Db\Service\UserServiceInterface; @@ -560,6 +561,7 @@ protected function getManager( ?SessionManager $sessionManager = null, ?PluginManager $pm = null ): Manager { + $config = new Config($config); $cookies = new \VuFind\Cookie\CookieManager([]); $csrf = new \VuFind\Validator\SessionCsrf( [ From 1d8746b99b66f6f80dac1861751fafc93a83f056 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 8 Sep 2026 11:03:09 -0400 Subject: [PATCH 08/90] managerfactory --- module/VuFind/src/VuFind/Auth/ManagerFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/VuFind/src/VuFind/Auth/ManagerFactory.php b/module/VuFind/src/VuFind/Auth/ManagerFactory.php index 1954fd381ac9..6227f40b23f9 100644 --- a/module/VuFind/src/VuFind/Auth/ManagerFactory.php +++ b/module/VuFind/src/VuFind/Auth/ManagerFactory.php @@ -69,7 +69,7 @@ public function __invoke( throw new \Exception('Unexpected options passed to factory.'); } // Load dependencies: - $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'); + $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'); $dbServiceManager = $container->get(\VuFind\Db\Service\PluginManager::class); $userService = $dbServiceManager->get(\VuFind\Db\Service\UserServiceInterface::class); $sessionManager = $container->get(\Laminas\Session\SessionManager::class); From d3561318c6df7072ae5fa70c7aa5ef42d6727947 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 8 Sep 2026 11:04:15 -0400 Subject: [PATCH 09/90] logintokenmanagerfactory --- module/VuFind/src/VuFind/Auth/LoginTokenManagerFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/VuFind/src/VuFind/Auth/LoginTokenManagerFactory.php b/module/VuFind/src/VuFind/Auth/LoginTokenManagerFactory.php index 3c01f2b2d231..54e2f1fcd8f2 100644 --- a/module/VuFind/src/VuFind/Auth/LoginTokenManagerFactory.php +++ b/module/VuFind/src/VuFind/Auth/LoginTokenManagerFactory.php @@ -82,7 +82,7 @@ public function __invoke( $dbServiceManager = $container->get(\VuFind\Db\Service\PluginManager::class); return new $requestedName( - $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'), + $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'), $dbServiceManager->get(UserServiceInterface::class), $dbServiceManager->get(LoginTokenServiceInterface::class), $container->get(\VuFind\Cookie\CookieManager::class), From 28cf6b48660f293c5a2185a9c0b390d25ede829f Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 8 Sep 2026 11:05:37 -0400 Subject: [PATCH 10/90] emailauthenticatorfactory --- module/VuFind/src/VuFind/Auth/EmailAuthenticatorFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/VuFind/src/VuFind/Auth/EmailAuthenticatorFactory.php b/module/VuFind/src/VuFind/Auth/EmailAuthenticatorFactory.php index d73865ec7bb5..e61276f392d7 100644 --- a/module/VuFind/src/VuFind/Auth/EmailAuthenticatorFactory.php +++ b/module/VuFind/src/VuFind/Auth/EmailAuthenticatorFactory.php @@ -73,7 +73,7 @@ public function __invoke( $container->get(\VuFind\Mailer\Mailer::class), $container->get('ViewRenderer'), $container->get(\VuFind\Net\UserIpReader::class), - $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'), + $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'), $container->get(\VuFind\Db\Service\PluginManager::class) ->get(\VuFind\Db\Service\AuthHashServiceInterface::class) ); From 24f412d158d5836874b465ff80c4abcf14701724 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 8 Sep 2026 11:06:28 -0400 Subject: [PATCH 11/90] manager --- module/VuFind/src/VuFind/Auth/Manager.php | 35 ++++++++++++----------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/module/VuFind/src/VuFind/Auth/Manager.php b/module/VuFind/src/VuFind/Auth/Manager.php index 347488fd8b85..12909e4bbc2b 100644 --- a/module/VuFind/src/VuFind/Auth/Manager.php +++ b/module/VuFind/src/VuFind/Auth/Manager.php @@ -35,6 +35,7 @@ use Lmc\Rbac\Identity\IdentityInterface; use Lmc\Rbac\Mvc\Identity\IdentityProviderInterface; use Psr\Log\LoggerAwareInterface; +use VuFind\Config\Config; use VuFind\Cookie\CookieManager; use VuFind\Db\Entity\UserEntityInterface; use VuFind\Db\Service\AuditEventServiceInterface; @@ -120,7 +121,7 @@ class Manager implements IdentityProviderInterface, LoggerAwareInterface /** * Constructor. * - * @param array $config VuFind configuration + * @param Config $config VuFind configuration * @param UserServiceInterface $userService User database service * @param UserSessionPersistenceInterface $userSession User session persistence service * @param SessionManager $sessionManager Session manager @@ -133,7 +134,7 @@ class Manager implements IdentityProviderInterface, LoggerAwareInterface * @param AuditEventServiceInterface $auditEventService Event database service */ public function __construct( - protected array $config, + protected Config $config, protected UserServiceInterface $userService, protected UserSessionPersistenceInterface $userSession, protected SessionManager $sessionManager, @@ -147,7 +148,7 @@ public function __construct( ) { // Initialize active authentication setting (defaulting to Database // if no setting passed in): - $method = $this->getPreAuthenticationData()['authMethod'] ?? $config['Authentication']['method'] ?? 'Database'; + $method = $this->getPreAuthenticationData()['authMethod'] ?? $config->Authentication->method ?? 'Database'; // Set the active authentication method and force it legal: $this->setAuthMethod($method, true); } @@ -230,7 +231,7 @@ public function supportsCreation(?string $authMethod = null): bool */ public function supportsRecovery(?string $authMethod = null, ?string $target = null): bool { - return ($this->config['Authentication']['recover_password'] ?? false) + return ($this->config->Authentication->recover_password ?? false) && $this->getAuth($authMethod)->supportsPasswordRecovery($target); } @@ -268,7 +269,7 @@ public function getPasswordRecoveryData(array $params): ?array */ public function supportsEmailChange(?string $authMethod = null): bool { - return $this->config['Authentication']['change_email'] ?? false; + return $this->config->Authentication->change_email ?? false; } /** @@ -281,7 +282,7 @@ public function supportsEmailChange(?string $authMethod = null): bool */ public function supportsPasswordChange(?string $authMethod = null): bool { - return ($this->config['Authentication']['change_password'] ?? false) + return ($this->config->Authentication->change_password ?? false) && $this->getAuth($authMethod)->supportsPasswordChange(); } @@ -295,7 +296,7 @@ public function supportsPasswordChange(?string $authMethod = null): bool */ public function supportsConnectingLibraryCard(?string $authMethod = null): bool { - return ($this->config['Catalog']['auth_based_library_cards'] ?? false) + return ($this->config->Catalog->auth_based_library_cards ?? false) && $this->getAuth($authMethod)->supportsConnectingLibraryCard(); } @@ -308,10 +309,10 @@ public function supportsConnectingLibraryCard(?string $authMethod = null): bool */ public function supportsPersistentLogin(?string $authMethod = null): bool { - if (!empty($this->config['Authentication']['persistent_login'])) { + if (!empty($this->config->Authentication->persistent_login)) { return in_array( strtolower($authMethod ?? $this->getSelectedAuthMethod() ?? ''), - explode(',', strtolower($this->config['Authentication']['persistent_login'])) + explode(',', strtolower($this->config->Authentication->persistent_login)) ); } return false; @@ -324,7 +325,7 @@ public function supportsPersistentLogin(?string $authMethod = null): bool */ public function getPersistentLoginLifetime(): int { - return $this->config['Authentication']['persistent_login_lifetime'] ?? 14; + return $this->config->Authentication->persistent_login_lifetime ?? 14; } /** @@ -515,7 +516,7 @@ public function loginEnabled(): bool { if (null === $this->hideLogin) { // Assume login is enabled unless explicitly turned off: - $this->hideLogin = ($this->config['Authentication']['hideLogin'] ?? false); + $this->hideLogin = ($this->config->Authentication->hideLogin ?? false); if (!$this->hideLogin) { try { @@ -543,7 +544,7 @@ public function loginEnabled(): bool public function ajaxEnabled(): bool { // Assume ajax is enabled unless explicitly turned off: - return $this->config['Authentication']['enableAjax'] ?? true; + return $this->config->Authentication->enableAjax ?? true; } /** @@ -554,7 +555,7 @@ public function ajaxEnabled(): bool public function dropdownEnabled(): bool { // Assume dropdown is disabled unless explicitly turned on: - return $this->config['Authentication']['enableDropdown'] ?? false; + return $this->config->Authentication->enableDropdown ?? false; } /** @@ -739,7 +740,7 @@ public function checkForExpiredCredentials(): bool */ public function inPrivacyMode(): bool { - return $this->config['Authentication']['privacy'] ?? false; + return $this->config->Authentication->privacy ?? false; } /** @@ -837,7 +838,7 @@ public function updateEmail(UserEntityInterface $user, string $email): void { // Depending on verification setting, either do a direct update or else // put the new address into a pending state. - if ($this->config['Authentication']['verify_email'] ?? false) { + if ($this->config->Authentication->verify_email ?? false) { // If new email address is the current address, just reset any pending // email address: $user->setPendingEmail($email === $user->getEmail() ? '' : $email); @@ -995,7 +996,7 @@ public function login(Request $request): ?UserEntityInterface // Attempt catalog login so that any bad credentials are cleared before further processing // (avoids e.g. multiple login attempts by account AJAX checks). if ( - ($this->config['Catalog']['checkILSCredentialsOnLogin'] ?? true) + ($this->config->Catalog->checkILSCredentialsOnLogin ?? true) && $this->ilsAuthenticator && $this->allowsUserIlsLogin() && ($catUsername = $user->getCatUsername()) @@ -1224,7 +1225,7 @@ protected function updateUser(UserEntityInterface $user, ?string $authMethod): v */ public function allowsUserIlsLogin(): bool { - return $this->config['Catalog']['allowUserLogin'] ?? true; + return $this->config->Catalog->allowUserLogin ?? true; } /** From af668be8b7dd30a387302a92437a52c8de7e4433 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 8 Sep 2026 11:07:01 -0400 Subject: [PATCH 12/90] emailauthenticator --- .../VuFind/src/VuFind/Auth/EmailAuthenticator.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/module/VuFind/src/VuFind/Auth/EmailAuthenticator.php b/module/VuFind/src/VuFind/Auth/EmailAuthenticator.php index c898a2c7051a..5a313a0cdbdf 100644 --- a/module/VuFind/src/VuFind/Auth/EmailAuthenticator.php +++ b/module/VuFind/src/VuFind/Auth/EmailAuthenticator.php @@ -70,7 +70,7 @@ class EmailAuthenticator implements \VuFind\I18n\Translator\TranslatorAwareInter * @param \VuFind\Mailer\Mailer $mailer Mailer * @param PhpRenderer $viewRenderer View Renderer * @param UserIpReader $userIpReader User IP address reader - * @param array $config Configuration + * @param \VuFind\Config\Config $config Configuration * @param AuthHashServiceInterface $authHashService AuthHash database service */ public function __construct( @@ -79,7 +79,7 @@ public function __construct( protected \VuFind\Mailer\Mailer $mailer, protected PhpRenderer $viewRenderer, protected UserIpReader $userIpReader, - protected array $config, + protected \VuFind\Config\Config $config, protected AuthHashServiceInterface $authHashService ) { } @@ -113,7 +113,7 @@ public function sendAuthenticationLink( $templateParams = [] ) { // Make sure we've waited long enough - $recoveryInterval = $this->config['Authentication']['recover_interval'] ?? 60; + $recoveryInterval = $this->config->Authentication->recover_interval ?? 60; $sessionId = $this->sessionManager->getId(); if ( @@ -145,7 +145,7 @@ public function sendAuthenticationLink( $viewParams['url'] = $serverHelper( $urlHelper($linkRoute, $routeParams, ['query' => $urlParams]) ); - $viewParams['title'] = $this->config['Site']['title']; + $viewParams['title'] = $this->config->Site->title; $message = $this->viewRenderer->render($template, $viewParams); $from = $this->getEmailSenderAddress($this->config, $email); @@ -236,7 +236,7 @@ public function sendAuthenticationCode( $templateParams = [] ): int { // Make sure we've waited long enough - $recoveryInterval = $this->config['Authentication']['recover_interval'] ?? 60; + $recoveryInterval = $this->config->Authentication->recover_interval ?? 60; $sessionId = $this->sessionManager->getId(); if ( @@ -260,7 +260,7 @@ public function sendAuthenticationCode( $viewParams = $templateParams; $viewParams['code'] = $otp; - $viewParams['title'] = $this->config['Site']['title'] ?? ''; + $viewParams['title'] = $this->config->Site->title ?? ''; $message = $this->viewRenderer->render($template, $viewParams); $from = $this->getEmailSenderAddress($this->config, $email); @@ -310,7 +310,7 @@ public function verifyAuthenticationCode( throw $e; } // Check the maximum attempt limit: - $maxAttempts = max($this->config['Authentication']['otp_max_attempts'] ?? 3, 1); + $maxAttempts = max($this->config->Authentication->otp_max_attempts ?? 3, 1); if ($attempts > $maxAttempts) { throw new AuthException('authentication_error_expired'); } From 9abba25018a5763773a5947de47a56acb247f9f5 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 8 Sep 2026 11:07:35 -0400 Subject: [PATCH 13/90] logintokenmanager --- .../VuFind/src/VuFind/Auth/LoginTokenManager.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/module/VuFind/src/VuFind/Auth/LoginTokenManager.php b/module/VuFind/src/VuFind/Auth/LoginTokenManager.php index c6d23085c3c6..379cd94120f3 100644 --- a/module/VuFind/src/VuFind/Auth/LoginTokenManager.php +++ b/module/VuFind/src/VuFind/Auth/LoginTokenManager.php @@ -36,6 +36,7 @@ use Laminas\Session\SessionManager; use Laminas\View\Renderer\RendererInterface; use Psr\Log\LoggerAwareInterface; +use VuFind\Config\Config; use VuFind\Config\Feature\EmailSettingsTrait; use VuFind\Cookie\CookieManager; use VuFind\Db\Entity\UserEntityInterface; @@ -103,7 +104,7 @@ class LoginTokenManager implements LoggerAwareInterface, TranslatorAwareInterfac /** * LoginToken constructor. * - * @param array $config Configuration + * @param Config $config Configuration * @param UserServiceInterface $userService User database service * @param LoginTokenServiceInterface $loginTokenService Login Token database service * @param CookieManager $cookieManager Cookie manager @@ -113,7 +114,7 @@ class LoginTokenManager implements LoggerAwareInterface, TranslatorAwareInterfac * @param callable $browscapCB Callback for creating Browscap */ public function __construct( - protected array $config, + protected Config $config, protected UserServiceInterface $userService, protected LoginTokenServiceInterface $loginTokenService, protected CookieManager $cookieManager, @@ -272,7 +273,7 @@ public function deleteUserLoginTokens($userId) */ public function getCookieLifetime(): int { - return (int)($this->config['Authentication']['persistent_login_lifetime'] ?? 14); + return (int)($this->config->Authentication->persistent_login_lifetime ?? 14); } /** @@ -331,7 +332,7 @@ protected function createOrRotateToken( $userId = $user->getId(); try { if ($series) { - $lenient = ($this->config['Authentication']['lenient_token_rotation'] ?? true); + $lenient = ($this->config->Authentication->lenient_token_rotation ?? true); $this->loginTokenService->deleteBySeries($series, $lenient ? $currentTokenId : null); $this->debug("Updating login token $token series $series for user {$userId}"); } else { @@ -363,16 +364,16 @@ protected function createOrRotateToken( */ protected function sendLoginTokenWarningEmail(UserEntityInterface $user) { - if (!($this->config['Authentication']['send_login_warnings'] ?? true)) { + if (!($this->config->Authentication->send_login_warnings ?? true)) { return; } - $title = $this->config['Site']['title'] ?? ''; + $title = $this->config->Site->title ?? ''; if ($toAddr = $user->getEmail()) { $message = $this->viewRenderer->render( 'Email/login-warning.phtml', compact('title') ); - $subject = $this->config['Authentication']['persistent_login_warning_email_subject'] + $subject = $this->config->Authentication->persistent_login_warning_email_subject ?? 'persistent_login_warning_email_subject'; try { From f165d99b1956936725656f491262d6a4d7effcb3 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 8 Sep 2026 11:16:34 -0400 Subject: [PATCH 14/90] almadatabase --- module/VuFind/src/VuFind/Auth/AlmaDatabase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/VuFind/src/VuFind/Auth/AlmaDatabase.php b/module/VuFind/src/VuFind/Auth/AlmaDatabase.php index 5ba0abe2330d..db527acb9cd8 100644 --- a/module/VuFind/src/VuFind/Auth/AlmaDatabase.php +++ b/module/VuFind/src/VuFind/Auth/AlmaDatabase.php @@ -88,7 +88,7 @@ public function create($request) { // When in privacy mode, don't create an Alma account and delegate // further code execution to the parent. - if ($this->getConfig()->Authentication->privacy) { + if ($this->getConfig()['Authentication']['privacy']) { return parent::create($request); } From 68e998c5464f8c1197a68a0201983a9ef78d0251 Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Thu, 3 Sep 2026 15:43:31 -0400 Subject: [PATCH 15/90] Use config array instead of object in OAI Server code (#5614) --- .../Action/Oai/AbstractOaiServerAction.php | 3 +- module/VuFind/src/VuFind/OAI/Server.php | 51 +++++++++---------- module/VuFind/src/VuFind/OAI/Server/Auth.php | 4 +- 3 files changed, 28 insertions(+), 30 deletions(-) diff --git a/module/VuFind/src/VuFind/Action/Oai/AbstractOaiServerAction.php b/module/VuFind/src/VuFind/Action/Oai/AbstractOaiServerAction.php index b4cb920edea1..a830fa6bc813 100644 --- a/module/VuFind/src/VuFind/Action/Oai/AbstractOaiServerAction.php +++ b/module/VuFind/src/VuFind/Action/Oai/AbstractOaiServerAction.php @@ -34,7 +34,6 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use VuFind\Action\AbstractTemplateRenderingAction; -use VuFind\Config\Config; use VuFind\Http\ServerUrlHelper; use VuFind\I18n\Translator\TranslatorAwareInterface; use VuFind\I18n\Translator\TranslatorAwareTrait; @@ -106,7 +105,7 @@ protected function handleOAI( $request->getQueryParams(), $request->getParsedBody() ); - $server->init(new Config($this->config), $baseURL, $params); + $server->init($this->config, $baseURL, $params); $server->setRecordLinkerHelper($this->recordLinkerViewHelper); $server->setRecordFormatter($this->recordFormatter); $xml = $server->getResponse(); diff --git a/module/VuFind/src/VuFind/OAI/Server.php b/module/VuFind/src/VuFind/OAI/Server.php index 7939e875848c..6c0c13a5fbd6 100644 --- a/module/VuFind/src/VuFind/OAI/Server.php +++ b/module/VuFind/src/VuFind/OAI/Server.php @@ -42,7 +42,6 @@ use function count; use function in_array; -use function intval; use function strlen; /** @@ -249,13 +248,13 @@ public function __construct( /** * Initialize settings. * - * @param \VuFind\Config\Config $config VuFind configuration - * @param string $baseURL The base URL for the OAI server - * @param array $params The incoming OAI-PMH parameters (i.e. $_GET) + * @param array $config VuFind configuration + * @param string $baseURL The base URL for the OAI server + * @param array $params The incoming OAI-PMH parameters (i.e. $_GET) * * @return void */ - public function init(\VuFind\Config\Config $config, $baseURL, array $params) + public function init(array $config, $baseURL, array $params) { $this->baseURL = $baseURL; $parts = parse_url($baseURL); @@ -681,66 +680,66 @@ protected function getMetadataFormats() * constructor and is only a separate method to allow easy override by child * classes). * - * @param \VuFind\Config\Config $config VuFind configuration + * @param array $config VuFind configuration * * @return void */ - protected function initializeSettings(\VuFind\Config\Config $config) + protected function initializeSettings(array $config) { // Override default repository name if configured: - if (isset($config->OAI->repository_name)) { - $this->repositoryName = $config->OAI->repository_name; + if (isset($config['OAI']['repository_name'])) { + $this->repositoryName = $config['OAI']['repository_name']; } // Override default ID namespace if configured: - if (isset($config->OAI->identifier)) { - $this->idNamespace = $config->OAI->identifier; + if (isset($config['OAI']['identifier'])) { + $this->idNamespace = $config['OAI']['identifier']; } // Override page size if configured: - if (isset($config->OAI->page_size)) { - $this->pageSize = $config->OAI->page_size; + if (isset($config['OAI']['page_size'])) { + $this->pageSize = $config['OAI']['page_size']; } // Use either OAI-specific or general email address; we must have SOMETHING. - $this->adminEmail = $config->OAI->admin_email ?? $config->Site->email; + $this->adminEmail = $config['OAI']['admin_email'] ?? $config['Site']['email']; // Use a Solr field to determine sets, if configured: - if (isset($config->OAI->set_field)) { - $this->setField = $config->OAI->set_field; + if (isset($config['OAI']['set_field'])) { + $this->setField = $config['OAI']['set_field']; } // Initialize custom sets queries: - if (isset($config->OAI->set_query)) { - $this->setQueries = $config->OAI->set_query->toArray(); + if (isset($config['OAI']['set_query'])) { + $this->setQueries = (array)$config['OAI']['set_query']; } // Use a default query, if configured: - if (isset($config->OAI->default_query)) { - $this->defaultQuery = $config->OAI->default_query; + if (isset($config['OAI']['default_query'])) { + $this->defaultQuery = $config['OAI']['default_query']; } // Initialize VuFind API format fields: $this->vufindApiFields = array_filter( explode( ',', - $config->OAI->vufind_api_format_fields ?? '' + $config['OAI']['vufind_api_format_fields'] ?? '' ) ); // Initialize filters specific to requested metadataPrefix: - if (isset($config->OAI->record_format_filters)) { + if (isset($config['OAI']['record_format_filters'])) { $this->recordFormatFilters - = $config->OAI->record_format_filters->toArray(); + = (array)$config['OAI']['record_format_filters']; } // Initialize delete lifetime, if set: - if (isset($config->OAI->delete_lifetime)) { - $this->deleteLifetime = intval($config->OAI->delete_lifetime); + if (isset($config['OAI']['delete_lifetime'])) { + $this->deleteLifetime = (int)$config['OAI']['delete_lifetime']; } // Change cursormark behavior if necessary: - $cursor = $config->OAI->use_cursor ?? true; + $cursor = $config['OAI']['use_cursor'] ?? true; if (!$cursor || strtolower($cursor) === 'false') { $this->useCursorMark = false; } diff --git a/module/VuFind/src/VuFind/OAI/Server/Auth.php b/module/VuFind/src/VuFind/OAI/Server/Auth.php index 4ecea60ed875..4ca9320f3b55 100644 --- a/module/VuFind/src/VuFind/OAI/Server/Auth.php +++ b/module/VuFind/src/VuFind/OAI/Server/Auth.php @@ -63,11 +63,11 @@ class Auth extends Base * constructor and is only a separate method to allow easy override by child * classes). * - * @param \VuFind\Config\Config $config VuFind configuration + * @param array $config VuFind configuration * * @return void */ - protected function initializeSettings(\VuFind\Config\Config $config) + protected function initializeSettings(array $config) { // Use some of the same settings as the regular OAI server, but override // others: From e81a514ebb2086ea05d1d85227516bc992eba083 Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Fri, 4 Sep 2026 09:58:21 -0400 Subject: [PATCH 16/90] Use config array instead of object in OpenURL view helper (#5616) --- .../src/VuFind/View/Helper/Root/OpenUrl.php | 47 +++++++++---------- .../View/Helper/Root/OpenUrlFactory.php | 4 +- .../View/Helper/Root/OpenUrlTest.php | 3 +- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/module/VuFind/src/VuFind/View/Helper/Root/OpenUrl.php b/module/VuFind/src/VuFind/View/Helper/Root/OpenUrl.php index d904a54c0d1f..0c9ac496f777 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/OpenUrl.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/OpenUrl.php @@ -29,7 +29,6 @@ namespace VuFind\View\Helper\Root; -use VuFind\Config\Config; use VuFind\Resolver\Driver\PluginManager; use function count; @@ -67,13 +66,13 @@ class OpenUrl * @param Context $context Context helper * @param array $openUrlRules VuFind OpenURL rules * @param PluginManager $pluginManager Resolver plugin manager - * @param ?Config $config VuFind OpenURL config + * @param ?array $config VuFind OpenURL config */ public function __construct( protected Context $context, protected array $openUrlRules, protected PluginManager $pluginManager, - protected ?Config $config = null + protected ?array $config = null ) { } @@ -112,7 +111,7 @@ protected function addImageBasedParams($imagebased, &$params) } if ($imagebased) { - if (!isset($this->config->dynamic_graphic)) { + if (!isset($this->config['dynamic_graphic'])) { // if imagebased linking is forced by the template, but it is not // configured properly, throw an exception throw new \Exception( @@ -129,7 +128,7 @@ protected function addImageBasedParams($imagebased, &$params) // Concatenate image based OpenUrl base and OpenUrl // to a usable image reference - $base = $this->config->dynamic_graphic; + $base = $this->config['dynamic_graphic']; $imageOpenUrl = $params['openUrlImageBasedOverride'] ? $params['openUrlImageBasedOverride'] : $params['openUrl']; $params['openUrlImageBasedSrc'] = $base @@ -150,17 +149,17 @@ protected function addImageBasedParams($imagebased, &$params) */ public function renderTemplate($imagebased = null) { - if (null !== $this->config && isset($this->config->url)) { + if (isset($this->config['url'])) { // Trim off any parameters (for legacy compatibility -- default config // used to include extraneous parameters): - [$base] = explode('?', $this->config->url); + [$base] = explode('?', $this->config['url']); } else { $base = false; } - $embed = (isset($this->config->embed) && !empty($this->config->embed)); + $embed = (!empty($this->config['embed'])); - $embedAutoLoad = $this->config->embed_auto_load ?? false; + $embedAutoLoad = $this->config['embed_auto_load'] ?? false; // ini values 'true'/'false' are provided via ini reader as 1/0 // only check embedAutoLoad for area if the current area passed checkContext if ( @@ -182,7 +181,7 @@ public function renderTemplate($imagebased = null) } // instantiate the resolver plugin to get a proper resolver link - $resolver = $this->config->resolver ?? 'other'; + $resolver = $this->config['resolver'] ?? 'other'; $openurl = $this->recordDriver->getOpenUrl(); if ($this->pluginManager->has($resolver)) { $resolverObj = new \VuFind\Resolver\Connection( @@ -203,14 +202,14 @@ public function renderTemplate($imagebased = null) 'moreOptionsUrl' => $moreOptionsUrl, 'openUrl' => $openurl, 'openUrlBase' => empty($base) ? false : $base, - 'openUrlWindow' => empty($this->config->window_settings) - ? false : $this->config->window_settings, - 'openUrlGraphic' => empty($this->config->graphic) - ? false : $this->config->graphic, - 'openUrlGraphicWidth' => empty($this->config->graphic_width) - ? false : $this->config->graphic_width, - 'openUrlGraphicHeight' => empty($this->config->graphic_height) - ? false : $this->config->graphic_height, + 'openUrlWindow' => empty($this->config['window_settings']) + ? false : $this->config['window_settings'], + 'openUrlGraphic' => empty($this->config['graphic']) + ? false : $this->config['graphic'], + 'openUrlGraphicWidth' => empty($this->config['graphic_width']) + ? false : $this->config['graphic_width'], + 'openUrlGraphicHeight' => empty($this->config['graphic_height']) + ? false : $this->config['graphic_height'], 'openUrlEmbed' => $embed, 'openUrlEmbedAutoLoad' => $embedAutoLoad, ]; @@ -230,9 +229,9 @@ public function getImageBasedLinkingMode() { if ( $this->imageBasedLinkingIsActive() - && isset($this->config->image_based_linking_mode) + && isset($this->config['image_based_linking_mode']) ) { - return $this->config->image_based_linking_mode; + return $this->config['image_based_linking_mode']; } return $this->imageBasedLinkingIsActive() ? 'both' : false; } @@ -244,7 +243,7 @@ public function getImageBasedLinkingMode() */ public function imageBasedLinkingIsActive() { - return isset($this->config->dynamic_graphic); + return isset($this->config['dynamic_graphic']); } /** @@ -269,14 +268,14 @@ public function isActive() protected function checkContext() { // Doesn't matter the target area if no OpenURL resolver is specified: - if (empty($this->config->url)) { + if (empty($this->config['url'])) { return false; } // If a setting exists, return that: $key = 'show_in_' . $this->area; - if (isset($this->config->$key)) { - return $this->config->$key; + if (isset($this->config[$key])) { + return $this->config[$key]; } // If we got this far, use the defaults -- true for results, false for diff --git a/module/VuFind/src/VuFind/View/Helper/Root/OpenUrlFactory.php b/module/VuFind/src/VuFind/View/Helper/Root/OpenUrlFactory.php index 4be9e667839e..c6e713ff1a98 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/OpenUrlFactory.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/OpenUrlFactory.php @@ -68,7 +68,7 @@ public function __invoke( if (!empty($options)) { throw new \Exception('Unexpected options passed to factory.'); } - $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'); + $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'); $pathResolver = $container->get(\VuFind\Config\PathResolver::class); $openUrlRules = json_decode( file_get_contents( @@ -83,7 +83,7 @@ public function __invoke( $helpers->get('context'), $openUrlRules, $resolverPluginManager, - $config->OpenURL ?? null + $config['OpenURL'] ?? null ); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/OpenUrlTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/OpenUrlTest.php index 3492576fc6fb..9b17e2ac55c8 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/OpenUrlTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/OpenUrlTest.php @@ -30,7 +30,6 @@ namespace VuFindTest\View\Helper\Root; -use VuFind\Config\Config; use VuFind\View\Helper\Root\OpenUrl; /** @@ -278,7 +277,7 @@ protected function getOpenUrl($rules = null, $config = [], $mockContext = null) $mockContext = $this->getMockContext(); } $mockPm = $this->createMock(\VuFind\Resolver\Driver\PluginManager::class); - $openUrl = new OpenUrl($mockContext, $rules, $mockPm, new Config($config)); + $openUrl = new OpenUrl($mockContext, $rules, $mockPm, $config); return $openUrl; } } From f519c7e3bd4738b95eca9a3da44abfc8f26c3f0e Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Fri, 4 Sep 2026 11:30:36 -0400 Subject: [PATCH 17/90] Use config array instead of object in AccountCapabilities service (#5617) --- .../src/VuFind/Config/AccountCapabilities.php | 37 ++++++++----------- .../Config/AccountCapabilitiesFactory.php | 2 +- .../src/VuFind/View/Helper/Root/ProxyUrl.php | 17 ++++----- .../View/Helper/Root/ProxyUrlFactory.php | 2 +- .../AjaxHandler/CommentRecordTest.php | 4 +- .../Config/AccountCapabilitiesTest.php | 3 +- .../Helper/Root/RecordDataFormatterTest.php | 2 +- 7 files changed, 29 insertions(+), 38 deletions(-) diff --git a/module/VuFind/src/VuFind/Config/AccountCapabilities.php b/module/VuFind/src/VuFind/Config/AccountCapabilities.php index 8553a04eccda..e9bda551a9e1 100644 --- a/module/VuFind/src/VuFind/Config/AccountCapabilities.php +++ b/module/VuFind/src/VuFind/Config/AccountCapabilities.php @@ -56,10 +56,10 @@ class AccountCapabilities /** * Constructor. * - * @param Config $config Top-level configuration + * @param array $config Top-level configuration * @param callable $getAuth Function to fetch auth manager */ - public function __construct(protected Config $config, callable $getAuth) + public function __construct(protected array $config, callable $getAuth) { $this->authCallback = $getAuth; } @@ -84,8 +84,7 @@ public function getCommentSetting() if (!$this->isAccountAvailable()) { return 'disabled'; } - return isset($this->config->Social->comments) - && $this->config->Social->comments === 'disabled' + return ($this->config['Social']['comments'] ?? 'enabled') === 'disabled' ? 'disabled' : 'enabled'; } @@ -96,8 +95,8 @@ public function getCommentSetting() */ public function getRatingSetting(): string { - return empty($this->config->Social->rating) - || $this->config->Social->rating === 'disabled' + return empty($this->config['Social']['rating']) + || $this->config['Social']['rating'] === 'disabled' ? 'disabled' : 'enabled'; } @@ -108,7 +107,7 @@ public function getRatingSetting(): string */ public function getUserContentPageSize(): int { - return $this->config->Social->user_content_page_size ?? 50; + return $this->config['Social']['user_content_page_size'] ?? 50; } /** @@ -142,8 +141,7 @@ public function getListSetting() if (!$this->isAccountAvailable()) { return 'disabled'; } - $setting = isset($this->config->Social->lists) - ? trim(strtolower($this->config->Social->lists)) : 'enabled'; + $setting = trim(strtolower($this->config['Social']['lists'] ?? 'enabled')); if (!$setting) { $setting = 'disabled'; } @@ -164,8 +162,7 @@ public function getSavedSearchSetting() if (!$this->isAccountAvailable()) { return 'disabled'; } - return isset($this->config->Site->allowSavedSearches) - && !$this->config->Site->allowSavedSearches + return !($this->config['Site']['allowSavedSearches'] ?? true) ? 'disabled' : 'enabled'; } @@ -179,8 +176,7 @@ public function getTagSetting() if (!$this->isAccountAvailable()) { return 'disabled'; } - return isset($this->config->Social->tags) - && $this->config->Social->tags === 'disabled' + return ($this->config['Social']['tags'] ?? 'enabled') === 'disabled' ? 'disabled' : 'enabled'; } @@ -194,7 +190,7 @@ public function getListTagSetting() if (!$this->isAccountAvailable()) { return 'disabled'; } - return $this->config->Social->listTags ?? 'disabled'; + return $this->config['Social']['listTags'] ?? 'disabled'; } /** @@ -204,7 +200,7 @@ public function getListTagSetting() */ public function isScheduledSearchEnabled(): bool { - return $this->config->Account->schedule_searches ?? false; + return $this->config['Account']['schedule_searches'] ?? false; } /** @@ -214,8 +210,7 @@ public function isScheduledSearchEnabled(): bool */ public function getSmsSetting() { - return isset($this->config->Mail->sms) - && $this->config->Mail->sms === 'disabled' + return ($this->config['Mail']['sms'] ?? 'enabled') === 'disabled' ? 'disabled' : 'enabled'; } @@ -226,8 +221,8 @@ public function getSmsSetting() */ public function getEmailActionSetting(): string { - return $this->config?->Mail?->email_action ?? - (($this->config?->Mail?->require_login ?? true) ? 'require_login' : 'enabled'); + return $this->config['Mail']['email_action'] ?? + (($this->config['Mail']['require_login'] ?? true) ? 'require_login' : 'enabled'); } /** @@ -261,7 +256,7 @@ protected function isAccountAvailable() */ public function isRatingRemovalAllowed(): bool { - return (bool)($this->config->Social->remove_rating ?? true); + return (bool)($this->config['Social']['remove_rating'] ?? true); } /** @@ -271,6 +266,6 @@ public function isRatingRemovalAllowed(): bool */ public function libraryCardsEnabled(): bool { - return ($this->config->Catalog->library_cards ?? false) && !$this->getAuth()->inPrivacyMode(); + return ($this->config['Catalog']['library_cards'] ?? false) && !$this->getAuth()->inPrivacyMode(); } } diff --git a/module/VuFind/src/VuFind/Config/AccountCapabilitiesFactory.php b/module/VuFind/src/VuFind/Config/AccountCapabilitiesFactory.php index c79cb8e38e9e..e8aec898b5d3 100644 --- a/module/VuFind/src/VuFind/Config/AccountCapabilitiesFactory.php +++ b/module/VuFind/src/VuFind/Config/AccountCapabilitiesFactory.php @@ -69,7 +69,7 @@ public function __invoke( throw new \Exception('Unexpected options passed to factory.'); } return new $requestedName( - $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'), + $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'), // Pass a callback to return the auth manager to prevent circular dependencies // (we need the auth manager to determine some capabilities, but some of its // dependencies may need to make capability checks as well). diff --git a/module/VuFind/src/VuFind/View/Helper/Root/ProxyUrl.php b/module/VuFind/src/VuFind/View/Helper/Root/ProxyUrl.php index d933c5129e22..91482a95a1d2 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/ProxyUrl.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/ProxyUrl.php @@ -31,7 +31,6 @@ use Exception; use Laminas\Cache\Storage\StorageInterface as CacheAdapter; -use VuFind\Config\Config; use function intval; @@ -55,13 +54,13 @@ class ProxyUrl implements /** * Constructor. * - * @param ?Config $config VuFind configuration + * @param ?array $config VuFind configuration * @param ?CacheAdapter $cache Cache for web service responses */ - public function __construct(protected ?Config $config = null, ?CacheAdapter $cache = null) + public function __construct(protected ?array $config = null, ?CacheAdapter $cache = null) { $this->setCacheStorage($cache); - $this->cacheLifetime = intval($config->EZproxy->prefixLinksWebServiceCacheLifetime ?? 600); + $this->cacheLifetime = intval($config['EZproxy']['prefixLinksWebServiceCacheLifetime'] ?? 600); } /** @@ -73,13 +72,13 @@ public function __construct(protected ?Config $config = null, ?CacheAdapter $cac */ public function __invoke($url) { - $useWebService = $this->config->EZproxy->prefixLinksWebServiceUrl ?? false; + $useWebService = $this->config['EZproxy']['prefixLinksWebServiceUrl'] ?? false; $usePrefix = $useWebService ? $this->checkUrl($url) ?? $this->checkConfig() : $this->checkConfig(); - return ($usePrefix && isset($this->config->EZproxy->host)) - ? $this->config->EZproxy->host . '/login?qurl=' . urlencode($url) + return ($usePrefix && isset($this->config['EZproxy']['host'])) + ? $this->config['EZproxy']['host'] . '/login?qurl=' . urlencode($url) : $url; } @@ -90,7 +89,7 @@ public function __invoke($url) */ protected function checkConfig() { - return $this->config->EZproxy->prefixLinks ?? true; + return $this->config['EZproxy']['prefixLinks'] ?? true; } /** @@ -123,7 +122,7 @@ protected function checkUrl($url) */ protected function queryWebService($domain) { - $prefixLinksWebServiceUrl = $this->config->EZproxy->prefixLinksWebServiceUrl ?? ''; + $prefixLinksWebServiceUrl = $this->config['EZproxy']['prefixLinksWebServiceUrl'] ?? ''; try { $response = $this->httpService->get($prefixLinksWebServiceUrl, ['url' => $domain]); $responseData = trim($response->getContent()); diff --git a/module/VuFind/src/VuFind/View/Helper/Root/ProxyUrlFactory.php b/module/VuFind/src/VuFind/View/Helper/Root/ProxyUrlFactory.php index eb55e5682cbe..e254a0f8107d 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/ProxyUrlFactory.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/ProxyUrlFactory.php @@ -68,7 +68,7 @@ public function __invoke( if (!empty($options)) { throw new \Exception('Unexpected options passed to factory.'); } - $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'); + $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'); $cache = $container->get(\VuFind\Cache\Manager::class) ->getCache('object'); return new $requestedName($config, $cache); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/AjaxHandler/CommentRecordTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/AjaxHandler/CommentRecordTest.php index 391ebf99c8fb..c05c4d261ba1 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/AjaxHandler/CommentRecordTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/AjaxHandler/CommentRecordTest.php @@ -70,9 +70,7 @@ protected function getHandler(bool $enabled = true, ?UserEntityInterface $user = $this->container->set(\VuFind\Auth\Manager::class, $authManager); // Set up capability configuration: - $cfg = new \VuFind\Config\Config( - ['Social' => ['comments' => $enabled ? 'enabled' : 'disabled']] - ); + $cfg = ['Social' => ['comments' => $enabled ? 'enabled' : 'disabled']]; $capabilities = new AccountCapabilities( $cfg, function () use ($authManager) { diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Config/AccountCapabilitiesTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Config/AccountCapabilitiesTest.php index cb8629de8676..50227602f7a8 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Config/AccountCapabilitiesTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Config/AccountCapabilitiesTest.php @@ -31,7 +31,6 @@ use VuFind\Auth\Manager; use VuFind\Config\AccountCapabilities; -use VuFind\Config\Config; /** * Account Capabilities Test Class. @@ -58,7 +57,7 @@ protected function getCapabilities(array $config = [], ?Manager $auth = null): A $getAuth = function () use ($auth) { return $auth; }; - return new AccountCapabilities(new Config($config), $getAuth); + return new AccountCapabilities($config, $getAuth); } /** diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php index 77ad74a57b3f..72411a94f64a 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordDataFormatterTest.php @@ -205,7 +205,7 @@ protected function getViewHelpers( 'url' => $url, 'usertags' => new \VuFind\View\Helper\Root\UserTags( new \VuFind\Config\AccountCapabilities( - new \VuFind\Config\Config([]), + [], fn () => $authManager ) ), From ed4e0144cc17e9106844e199f0c1a0ffef78497b Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Fri, 4 Sep 2026 11:40:20 -0400 Subject: [PATCH 18/90] Eliminate use of intval in ProxyURL view helper (#5619) Co-authored-by: Demian Katz --- module/VuFind/src/VuFind/View/Helper/Root/ProxyUrl.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/module/VuFind/src/VuFind/View/Helper/Root/ProxyUrl.php b/module/VuFind/src/VuFind/View/Helper/Root/ProxyUrl.php index 91482a95a1d2..ec7c99768b97 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/ProxyUrl.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/ProxyUrl.php @@ -32,8 +32,6 @@ use Exception; use Laminas\Cache\Storage\StorageInterface as CacheAdapter; -use function intval; - /** * Proxy URL view helper. * @@ -60,7 +58,7 @@ class ProxyUrl implements public function __construct(protected ?array $config = null, ?CacheAdapter $cache = null) { $this->setCacheStorage($cache); - $this->cacheLifetime = intval($config['EZproxy']['prefixLinksWebServiceCacheLifetime'] ?? 600); + $this->cacheLifetime = (int)($config['EZproxy']['prefixLinksWebServiceCacheLifetime'] ?? 600); } /** From 87756586c739acb5b508fae31826166077d35692 Mon Sep 17 00:00:00 2001 From: Ere Maijala Date: Mon, 7 Sep 2026 15:48:35 +0300 Subject: [PATCH 19/90] Eliminate dependency on slm/locale. (#5624) Moves locale detection to LocaleSettings to simplify it and drop dependency on slm/locale that has not been updated for PHP 8.4+. --- composer.json | 1 - composer.lock | 69 +------- config/application.config.php | 5 - module/VuFind/config/module.config.php | 3 - module/VuFind/src/VuFind/Bootstrapper.php | 23 ++- .../Locale/LocaleDetectorCookieStrategy.php | 60 ------- .../I18n/Locale/LocaleDetectorFactory.php | 131 -------------- .../Locale/LocaleDetectorParamStrategy.php | 68 ------- .../src/VuFind/I18n/Locale/LocaleSettings.php | 159 +++++++++++++++-- .../Translator/LanguageInitializerTrait.php | 2 + .../src/VuFindTest/Mink/BasicTest.php | 5 + .../I18n/Locale/LocaleDetectorFactoryTest.php | 130 -------------- .../I18n/Locale/LocaleSettingsTest.php | 166 +++++++++++++++++- 13 files changed, 338 insertions(+), 484 deletions(-) delete mode 100644 module/VuFind/src/VuFind/I18n/Locale/LocaleDetectorCookieStrategy.php delete mode 100644 module/VuFind/src/VuFind/I18n/Locale/LocaleDetectorFactory.php delete mode 100644 module/VuFind/src/VuFind/I18n/Locale/LocaleDetectorParamStrategy.php delete mode 100644 module/VuFind/tests/unit-tests/src/VuFindTest/I18n/Locale/LocaleDetectorFactoryTest.php diff --git a/composer.json b/composer.json index 6a5b3f4c27c7..d897eed5404c 100644 --- a/composer.json +++ b/composer.json @@ -101,7 +101,6 @@ "psr/log": "^3.0", "ramsey/uuid": "^4.7", "serialssolutions/summon": "1.3.1", - "slm/locale": "1.2.0", "spomky-labs/otphp": "11.5.0", "steverhoades/oauth2-openid-connect-server": "3.0.1", "stripe/stripe-php": "v21.0.0", diff --git a/composer.lock b/composer.lock index 134ac803062b..10ab5e34b0ca 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bc4441bb9db3fcba7271b7b066df42cc", + "content-hash": "7bbfce44f51506a17f8c5d13bdd6d1ad", "packages": [ { "name": "ahand/mobileesp", @@ -9332,73 +9332,6 @@ ], "time": "2026-06-11T10:37:24+00:00" }, - { - "name": "slm/locale", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/basz/SlmLocale.git", - "reference": "1e0ac228c66b6ac0cb07e0097bcade5e813a2843" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/basz/SlmLocale/zipball/1e0ac228c66b6ac0cb07e0097bcade5e813a2843", - "reference": "1e0ac228c66b6ac0cb07e0097bcade5e813a2843", - "shasum": "" - }, - "require": { - "ext-intl": "*", - "laminas/laminas-eventmanager": "^3.1", - "laminas/laminas-http": "^2.7", - "laminas/laminas-modulemanager": "^2.8.2", - "laminas/laminas-router": "^3.0", - "laminas/laminas-servicemanager": "^3.2", - "laminas/laminas-stdlib": "^3.2.1", - "laminas/laminas-view": "^2.9.0", - "php": "^7.2 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.13.0", - "laminas/laminas-mvc": "^3.1", - "php-coveralls/php-coveralls": "^2.4.3", - "phpspec/prophecy-phpunit": "^2.0.1", - "phpunit/phpunit": "^9.5.26" - }, - "suggest": { - "laminas/laminas-mvc": "For using the router in the UriPath strategy" - }, - "type": "library", - "autoload": { - "psr-4": { - "SlmLocale\\": "src/SlmLocale/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jurian Sluiman", - "email": "jurian@juriansluiman.nl", - "homepage": "http://juriansluiman.nl" - } - ], - "description": "Automatic detection of locales for Laminas", - "homepage": "https://github.com/juriansluiman/SlmLocale", - "keywords": [ - "Zend Framework", - "i18n", - "laminas", - "locale", - "zf" - ], - "support": { - "issues": "https://github.com/basz/SlmLocale/issues", - "source": "https://github.com/basz/SlmLocale/tree/1.2.0" - }, - "time": "2024-10-15T05:50:58+00:00" - }, { "name": "spomky-labs/otphp", "version": "11.5.0", diff --git a/config/application.config.php b/config/application.config.php index 9894442f1636..e5ac8a0b15b6 100644 --- a/config/application.config.php +++ b/config/application.config.php @@ -17,17 +17,12 @@ 'Lmc\Rbac\Mvc', 'Laminas\I18n', 'Laminas\Mvc\I18n', - 'SlmLocale', 'VuFindTheme', 'VuFindSearch', 'VuFind', 'VuFindAdmin', 'VuFindApi', ]; -if (!extension_loaded('intl')) { - // Disable SlmLocale module if intl extension is missing: - $modules = array_diff($modules, ['SlmLocale']); -} if (PHP_SAPI == 'cli' && APPLICATION_ENV !== 'testing') { $modules[] = 'VuFindConsole'; } diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index e45dc77884fd..6c316aca9e3e 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -307,9 +307,6 @@ 'Laminas\Mvc\I18n\Translator' => [ 'VuFind\I18n\Translator\TranslatorFactory', ], - 'SlmLocale\Locale\Detector' => [ - 'VuFind\I18n\Locale\LocaleDetectorFactory', - ], ], 'initializers' => [ 'VuFind\ServiceManager\ServiceInitializer', diff --git a/module/VuFind/src/VuFind/Bootstrapper.php b/module/VuFind/src/VuFind/Bootstrapper.php index 06ebedc1b36f..213dbf972995 100644 --- a/module/VuFind/src/VuFind/Bootstrapper.php +++ b/module/VuFind/src/VuFind/Bootstrapper.php @@ -32,8 +32,10 @@ use Laminas\Http\Header\Location; use Laminas\Http\Response; use Laminas\Mvc\MvcEvent; +use Laminas\Psr7Bridge\Psr7ServerRequest; use Laminas\Router\Http\RouteMatch; use Psr\Container\ContainerInterface; +use VuFind\Cookie\CookieManager; use VuFind\I18n\Locale\LocaleSettings; use VuFind\RateLimiter\RateLimiterManager; use VuFind\View\GlobalsContainer; @@ -211,16 +213,25 @@ protected function initGlobals(): void } /** - * Update language in user account, as needed. + * Detect locale and update language in user account, as needed. * * @return void */ protected function initUserLanguage(): void { - $callback = function (/*$event*/): void { - // Store last selected language in user account, if applicable: + // Initialize language at a very high priority so that it's available before everything else: + $callback = function ($event): void { + // Detect language: $settings = $this->container->get(LocaleSettings::class); - $language = $settings->getUserLocale(); + $language = $settings->detectLocale( + PHP_SAPI !== 'cli' ? Psr7ServerRequest::fromLaminas($event->getRequest()) : null + ); + // Update cookie: + $cookies = $this->container->get(CookieManager::class); + if ($language !== $cookies->get('language')) { + $cookies->set('language', $language); + } + // Store last selected language in user account, if applicable: $authManager = $this->container->get(\VuFind\Auth\Manager::class); if ( ($user = $authManager->getUserObject()) @@ -230,8 +241,8 @@ protected function initUserLanguage(): void $this->getDbService(\VuFind\Db\Service\UserServiceInterface::class)->persistEntity($user); } }; - $this->events->attach('dispatch.error', $callback); - $this->events->attach('dispatch', $callback); + $this->events->attach('dispatch.error', $callback, 15000); + $this->events->attach('dispatch', $callback, 15000); } /** diff --git a/module/VuFind/src/VuFind/I18n/Locale/LocaleDetectorCookieStrategy.php b/module/VuFind/src/VuFind/I18n/Locale/LocaleDetectorCookieStrategy.php deleted file mode 100644 index d4540e1bf407..000000000000 --- a/module/VuFind/src/VuFind/I18n/Locale/LocaleDetectorCookieStrategy.php +++ /dev/null @@ -1,60 +0,0 @@ -. - * - * @category VuFind - * @package I18n\Locale - * @author Ere Maijala - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org Main Site - */ - -namespace VuFind\I18n\Locale; - -use SlmLocale\LocaleEvent; -use SlmLocale\Strategy\CookieStrategy; - -/** - * Locale Detector Strategy for language cookie. - * - * @category VuFind - * @package I18n\Locale - * @author Ere Maijala - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org Main Site - */ -class LocaleDetectorCookieStrategy extends CookieStrategy -{ - /** - * Event handler for the 'found' event. - * - * @param LocaleEvent $event Event - * - * @return void - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function found(LocaleEvent $event) - { - // Setting a cookie is handled separately, so we don't need to do anything - // here (see LocaleDetectorFactory). - } -} diff --git a/module/VuFind/src/VuFind/I18n/Locale/LocaleDetectorFactory.php b/module/VuFind/src/VuFind/I18n/Locale/LocaleDetectorFactory.php deleted file mode 100644 index 0ca1f18769b8..000000000000 --- a/module/VuFind/src/VuFind/I18n/Locale/LocaleDetectorFactory.php +++ /dev/null @@ -1,131 +0,0 @@ - 2018. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see - * . - * - * @category VuFind - * @package I18n\Locale - * @author Demian Katz - * @author Sebastian Kehr - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org Main Site - */ - -namespace VuFind\I18n\Locale; - -use Laminas\EventManager\EventInterface; -use Laminas\ServiceManager\Exception\ServiceNotCreatedException; -use Laminas\ServiceManager\Exception\ServiceNotFoundException; -use Laminas\ServiceManager\Factory\DelegatorFactoryInterface; -use Psr\Container\ContainerExceptionInterface as ContainerException; -use Psr\Container\ContainerInterface; -use SlmLocale\LocaleEvent; -use SlmLocale\Strategy\QueryStrategy; -use VuFind\Cookie\CookieManager; - -use function call_user_func; - -/** - * Locale Detector Delegator Factory. - * - * @category VuFind - * @package I18n\Locale - * @author Demian Katz - * @author Sebastian Kehr - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org Main Site - */ -class LocaleDetectorFactory implements DelegatorFactoryInterface -{ - /** - * A factory that creates delegates of a given service. - * - * @param ContainerInterface $container Container - * @param string $name Service name - * @param callable $callback Primary factory - * @param null|array $options Options - * - * @return object - * @throws ServiceNotFoundException if unable to resolve the service. - * @throws ServiceNotCreatedException if an exception is raised when - * creating a service. - * @throws ContainerException&\Throwable if any other error occurs - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function __invoke( - ContainerInterface $container, - $name, - callable $callback, - ?array $options = null - ) { - $detector = call_user_func($callback); - $settings = $container->get(LocaleSettings::class); - $detector->setDefault($settings->getDefaultLocale()); - $detector->setSupported(array_keys($settings->getEnabledLocales())); - // TODO: implement mappings in the future? - //$detector->setMappings($settings->getMappedLocales()); - - foreach ($this->getStrategies($settings) as $strategy) { - $detector->addStrategy($strategy); - } - - $cookies = $container->get(CookieManager::class); - $detector->getEventManager()->attach( - LocaleEvent::EVENT_FOUND, - function (EventInterface $event) use ($cookies): void { - $language = $event->getParam('locale'); - if ($language !== $cookies->get('language')) { - $cookies->set('language', $language); - } - } - ); - - return $detector; - } - - /** - * Generator for retrieving strategies. - * - * @param ?LocaleSettings $settings Locale settings - * - * @return \Generator - */ - protected function getStrategies(?LocaleSettings $settings = null): \Generator - { - yield new LocaleDetectorParamStrategy(); - - $queryStrategy = new QueryStrategy(); - $queryStrategy->setOptions(['query_key' => 'lng']); - yield $queryStrategy; - - $cookieStrategy = new LocaleDetectorCookieStrategy(); - $cookieStrategy->setCookieName('language'); - yield $cookieStrategy; - - // By default, we want to use the HTTP Accept header, so we'll add that - // strategy when no settings are provided, or when the settings tell us - // that browser language detection should be used. - if (!$settings || $settings->browserLanguageDetectionEnabled()) { - yield new \SlmLocale\Strategy\HttpAcceptLanguageStrategy(); - } - } -} diff --git a/module/VuFind/src/VuFind/I18n/Locale/LocaleDetectorParamStrategy.php b/module/VuFind/src/VuFind/I18n/Locale/LocaleDetectorParamStrategy.php deleted file mode 100644 index ee70ad8674fa..000000000000 --- a/module/VuFind/src/VuFind/I18n/Locale/LocaleDetectorParamStrategy.php +++ /dev/null @@ -1,68 +0,0 @@ - 2018. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see - * . - * - * @category VuFind - * @package I18n\Locale - * @author Demian Katz - * @author Sebastian Kehr - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org Main Site - */ - -namespace VuFind\I18n\Locale; - -use SlmLocale\LocaleEvent; -use SlmLocale\Strategy\AbstractStrategy; - -use function in_array; - -/** - * Locale Detector Strategy for VuFind POST Parameter. - * - * @category VuFind - * @package I18n\Locale - * @author Demian Katz - * @author Sebastian Kehr - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org Main Site - */ -class LocaleDetectorParamStrategy extends AbstractStrategy -{ - public const PARAM_NAME = 'mylang'; - - /** - * Attempt to detect the locale from a POST parameter. - * - * @param LocaleEvent $event Event - * - * @return ?string - */ - public function detect(LocaleEvent $event) - { - $request = $event->getRequest(); - $locale = $request->getPost(self::PARAM_NAME); - if (in_array($locale, $event->getSupported())) { - return $locale; - } - } -} diff --git a/module/VuFind/src/VuFind/I18n/Locale/LocaleSettings.php b/module/VuFind/src/VuFind/I18n/Locale/LocaleSettings.php index 53fcbf82cb14..5c44af3abe1e 100644 --- a/module/VuFind/src/VuFind/I18n/Locale/LocaleSettings.php +++ b/module/VuFind/src/VuFind/I18n/Locale/LocaleSettings.php @@ -7,7 +7,7 @@ * * Copyright (C) Villanova University 2018, * Copyright (C) Leipzig University Library 2018. - * Copyright (C) The National Library of Finland 2023. + * Copyright (C) The National Library of Finland 2023-2026. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -33,9 +33,11 @@ namespace VuFind\I18n\Locale; +use Psr\Http\Message\ServerRequestInterface; use VuFind\Config\Config; use function array_key_exists; +use function floatval; use function in_array; /** @@ -56,14 +58,14 @@ class LocaleSettings * * @var string */ - protected $defaultLocale; + protected string $defaultLocale; /** * Associative (code => description) array of enabled locales. * * @var array */ - protected $enabledLocales; + protected array $enabledLocales; /** * Prioritized array of locales to use when strings are missing from the @@ -71,28 +73,35 @@ class LocaleSettings * * @var string[] */ - protected $fallbackLocales; + protected array $fallbackLocales; /** * Array of locales that use right-to-left formatting. * * @var string[] */ - protected $rightToLeftLocales; + protected array $rightToLeftLocales; /** * Array of locales that have been initialized. * * @var string[] */ - protected $initializedLocales = []; + protected array $initializedLocales = []; /** * Should we use auto-detect language based on browser settings? * * @var bool */ - protected $browserDetectLanguage; + protected bool $browserDetectLanguage; + + /** + * Has locale been detected already? + * + * @var bool + */ + protected bool $localeDetected = false; /** * Constructor. @@ -101,10 +110,8 @@ class LocaleSettings */ public function __construct(Config $config) { - $this->enabledLocales = $config->Languages ? $config->Languages->toArray() - : []; - $this->browserDetectLanguage - = (bool)($config->Site->browserDetectLanguage ?? true); + $this->enabledLocales = $config->Languages ? $config->Languages->toArray() : []; + $this->browserDetectLanguage = (bool)($config->Site->browserDetectLanguage ?? true); $this->defaultLocale = $this->parseDefaultLocale($config); $this->fallbackLocales = $this->parseFallbackLocales($config); $this->rightToLeftLocales = $this->parseRightToLeftLocales($config); @@ -263,4 +270,134 @@ public function isLocaleInitialized($locale) { return in_array($locale, $this->initializedLocales); } + + /** + * Detect locale from query string, cookies or the Accept-Language header. + * + * @param ?ServerRequestInterface $request Request, if available + * + * @return string + */ + public function detectLocale(?ServerRequestInterface $request): string + { + if (!class_exists(\Locale::class)) { + error_log('Locale class is missing; please enable intl extension.'); + return $this->getDefaultLocale(); + } + + $locale = null; + if ($request) { + $locale = $this->getLocaleFromQueryString($request); + if (!$locale) { + $locale = $this->getLocaleFromCookie($request); + } + if (!$locale) { + $locale = $this->getLocaleFromAcceptLanguageHeader($request); + } + } + if (!$locale) { + $locale = $this->getDefaultLocale(); + } + \Locale::setDefault($locale); + + return $locale; + } + + /** + * Get locale from query string. + * + * @param ServerRequestInterface $request Request + * + * @return ?string + */ + protected function getLocaleFromQueryString(ServerRequestInterface $request): ?string + { + if ( + ($locale = $request->getQueryParams()['lng'] ?? null) + && isset($this->getEnabledLocales()[$locale]) + ) { + return $locale; + } + return null; + } + + /** + * Get locale from cookies. + * + * @param ServerRequestInterface $request Request + * + * @return ?string + */ + protected function getLocaleFromCookie(ServerRequestInterface $request): ?string + { + if ( + ($locale = $request->getCookieParams()['language'] ?? null) + && isset($this->getEnabledLocales()[$locale]) + ) { + return $locale; + } + return null; + } + + /** + * Get locale from the Accept-Language header. + * + * @param ServerRequestInterface $request Request + * + * @return ?string + */ + protected function getLocaleFromAcceptLanguageHeader(ServerRequestInterface $request): ?string + { + if ( + !$this->browserLanguageDetectionEnabled() + || !($acceptLanguageHeader = $request->getHeader('Accept-Language')[0] ?? null) + ) { + return null; + } + + $enabled = array_keys($this->getEnabledLocales()); + foreach ($this->parseAcceptLanguageHeader($acceptLanguageHeader) as $acceptedLanguage) { + if ('*' === $acceptedLanguage['lng']) { + return $this->getDefaultLocale(); + } + if ($match = \Locale::lookup($enabled, $acceptedLanguage['lng'])) { + return $match; + } + } + + return null; + } + + /** + * Parse and sort the Accept-Language header. + * + * @param string $header Header + * + * @return array + */ + protected function parseAcceptLanguageHeader(string $header): array + { + $sort = function (array $a, array $b): int { + // Compare quality first: + if ($diff = $b['q'] <=> $a['q']) { + return $diff; + } + + // Order: + return $a['idx'] <=> $b['idx']; + }; + + $acceptedLanguages = []; + foreach (array_map('trim', explode(',', $header)) as $idx => $current) { + $parts = explode(';', $current); + $acceptedLanguages[] = [ + 'idx' => $idx, + 'lng' => $parts[0], + 'q' => floatval($parts[1] ?? 1), + ]; + } + usort($acceptedLanguages, $sort); + + return $acceptedLanguages; + } } diff --git a/module/VuFind/src/VuFind/I18n/Translator/LanguageInitializerTrait.php b/module/VuFind/src/VuFind/I18n/Translator/LanguageInitializerTrait.php index 2f400e257ed9..e3917084b2e8 100644 --- a/module/VuFind/src/VuFind/I18n/Translator/LanguageInitializerTrait.php +++ b/module/VuFind/src/VuFind/I18n/Translator/LanguageInitializerTrait.php @@ -131,5 +131,7 @@ protected function addLanguageToTranslator( $language ); } + // Enable translation of native language names: + $translator->addTranslationFile('ExtendedIni', null, 'default', 'native'); } } diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BasicTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BasicTest.php index 16d273b831f4..e9d51273888b 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BasicTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BasicTest.php @@ -96,6 +96,11 @@ public function testLanguage(): void $this->clickCss($page, '.language.dropdown'); $this->clickCss($page, '.language.dropdown li a:not(.active)'); $this->waitForPageLoad($page); + // Check the active language name: + $this->assertSame( + 'Deutsch', + $this->findCssAndGetText($page, '.language.dropdown li a.active') + ); // Check footer help-link $this->assertNotSame( 'Search Tips', diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/I18n/Locale/LocaleDetectorFactoryTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/I18n/Locale/LocaleDetectorFactoryTest.php deleted file mode 100644 index a79b8bda2fac..000000000000 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/I18n/Locale/LocaleDetectorFactoryTest.php +++ /dev/null @@ -1,130 +0,0 @@ -. - * - * @category VuFind - * @package Tests - * @author Demian Katz - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development:testing:unit_tests Wiki - */ - -namespace VuFindTest\I18n\Locale; - -use SlmLocale\Strategy\HttpAcceptLanguageStrategy; -use SlmLocale\Strategy\QueryStrategy; -use VuFind\I18n\Locale\LocaleDetectorCookieStrategy; -use VuFind\I18n\Locale\LocaleDetectorFactory; -use VuFind\I18n\Locale\LocaleDetectorParamStrategy; -use VuFind\I18n\Locale\LocaleSettings; - -use function func_get_args; - -/** - * LocaleDetectorFactory Test Class. - * - * @category VuFind - * @package Tests - * @author Demian Katz - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development:testing:unit_tests Wiki - */ -class LocaleDetectorFactoryTest extends \PHPUnit\Framework\TestCase -{ - use \VuFindTest\Feature\ReflectionTrait; - - /** - * Call getStrategies on a LocaleDetectorFactory and return a list of classes - * constructed as a result. - * - * Parameters passed to this method will be forwarded to getStrategies(). - * - * @return string[] - */ - protected function getStrategyClasses() - { - $factory = new LocaleDetectorFactory(); - $strategies = $this->callMethod($factory, 'getStrategies', func_get_args()); - return array_map('get_class', iterator_to_array($strategies)); - } - - /** - * Test that we get the full strategy list by default. - * - * @return void - */ - public function testStrategyListWithNoSettings(): void - { - $this->assertEquals( - [ - LocaleDetectorParamStrategy::class, - QueryStrategy::class, - LocaleDetectorCookieStrategy::class, - HttpAcceptLanguageStrategy::class, - ], - $this->getStrategyClasses() - ); - } - - /** - * Test that we get the full strategy list when browser language detection is on. - * - * @return void - */ - public function testStrategyListWithBrowserDetection(): void - { - $mockSettings = $this->createMock(LocaleSettings::class); - $mockSettings->expects($this->once()) - ->method('browserLanguageDetectionEnabled') - ->willReturn(true); - $this->assertEquals( - [ - LocaleDetectorParamStrategy::class, - QueryStrategy::class, - LocaleDetectorCookieStrategy::class, - HttpAcceptLanguageStrategy::class, - ], - $this->getStrategyClasses($mockSettings) - ); - } - - /** - * Test that we get an abridged strategy list when browser language detection is - * disabled. - * - * @return void - */ - public function testStrategyListWithoutBrowserDetection(): void - { - $mockSettings = $this->createMock(LocaleSettings::class); - $mockSettings->expects($this->once()) - ->method('browserLanguageDetectionEnabled') - ->willReturn(false); - $this->assertEquals( - [ - LocaleDetectorParamStrategy::class, - QueryStrategy::class, - LocaleDetectorCookieStrategy::class, - ], - $this->getStrategyClasses($mockSettings) - ); - } -} diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/I18n/Locale/LocaleSettingsTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/I18n/Locale/LocaleSettingsTest.php index 71afe726663b..f747014c04e4 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/I18n/Locale/LocaleSettingsTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/I18n/Locale/LocaleSettingsTest.php @@ -6,7 +6,7 @@ * PHP version 8 * * Copyright (C) Villanova University 2021. - * Copyright (C) The National Library of Finland 2023. + * Copyright (C) The National Library of Finland 2023-2026. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -31,6 +31,8 @@ namespace VuFindTest\I18n\Locale; +use GuzzleHttp\Psr7\ServerRequest; +use Psr\Http\Message\ServerRequestInterface; use VuFind\Config\Config; use VuFind\I18n\Locale\LocaleSettings; @@ -213,4 +215,166 @@ public function testFallbackLocaleConfigs(array $expected, string $language, ?st $settings = new LocaleSettings(new Config($config)); $this->assertEquals($expected, $settings->getFallbackLocales()); } + + /** + * Data provider for testDetectLocale. + * + * @return \Iterator + */ + public static function detectLocaleProvider(): \Iterator + { + // Default: + yield 'default' => [ + new ServerRequest('GET', 'http://localhost/'), + [ + 'en' => 'English', + 'de' => 'German', + ], + 'en', + 'en', + ]; + + yield 'query' => [ + (new ServerRequest('GET', 'http://localhost/'))->withQueryParams(['lng' => 'de']), + [ + 'en' => 'English', + 'de' => 'German', + ], + 'en', + 'de', + ]; + yield 'invalid query' => [ + (new ServerRequest('GET', 'http://localhost/'))->withQueryParams(['lng' => 'demo']), + [ + 'en' => 'English', + 'de' => 'German', + ], + 'en', + 'en', + ]; + + yield 'cookie' => [ + (new ServerRequest('GET', 'http://localhost/'))->withCookieParams(['language' => 'de']), + [ + 'en' => 'English', + 'de' => 'German', + ], + 'en', + 'de', + ]; + + yield 'invalid cookie' => [ + (new ServerRequest('GET', 'http://localhost/'))->withCookieParams(['language' => 'boo']), + [ + 'en' => 'English', + 'de' => 'German', + ], + 'en', + 'en', + ]; + + yield 'Accept-Language without priority, en' => [ + (new ServerRequest('GET', 'http://localhost/', ['Accept-Language' => 'en,de'])), + [ + 'en' => 'English', + 'de' => 'German', + ], + 'en', + 'en', + ]; + + yield 'Accept-Language without priority, de' => [ + (new ServerRequest('GET', 'http://localhost/', ['Accept-Language' => 'de,en'])), + [ + 'en' => 'English', + 'de' => 'German', + ], + 'en', + 'de', + ]; + + yield 'Accept-Language with priority' => [ + (new ServerRequest('GET', 'http://localhost/', ['Accept-Language' => 'en;0.8,de'])), + [ + 'en' => 'English', + 'de' => 'German', + ], + 'en', + 'de', + ]; + + yield 'Accept-Language with both priorities' => [ + (new ServerRequest('GET', 'http://localhost/', ['Accept-Language' => 'en;0.8, de;0.5'])), + [ + 'en' => 'English', + 'de' => 'German', + ], + 'en', + 'en', + ]; + + yield 'Accept-Language with reversed priorities' => [ + (new ServerRequest('GET', 'http://localhost/', ['Accept-Language' => 'en;0.5,de;0.8'])), + [ + 'en' => 'English', + 'de' => 'German', + ], + 'en', + 'de', + ]; + + yield 'Accept-Language with asterisk' => [ + (new ServerRequest('GET', 'http://localhost/', ['Accept-Language' => 'de, *;1.1'])), + [ + 'en' => 'English', + 'de' => 'German', + ], + 'en', + 'en', + ]; + + yield 'invalid query and cookie' => [ + (new ServerRequest('GET', 'http://localhost/')) + ->withQueryParams(['lng' => 'bat']) + ->withCookieParams(['language' => 'de']), + [ + 'en' => 'English', + 'de' => 'German', + ], + 'en', + 'de', + ]; + } + + /** + * Test locale detection. + * + * @param ?ServerRequestInterface $request Request + * @param array $enabled Enabled locales + * @param string $default Default locale + * @param string $expected Expected detection result + * + * @return void + */ + #[\PHPUnit\Framework\Attributes\DataProvider('detectLocaleProvider')] + public function testDetectLocale( + ?ServerRequestInterface $request, + array $enabled, + string $default, + string $expected + ): void { + $settings = new LocaleSettings( + new Config( + [ + 'Site' => ['language' => $default], + 'Languages' => $enabled, + ] + ) + ); + + $this->assertSame( + $expected, + $settings->detectLocale($request) + ); + } } From e8e53a24a8026f3843a303d81313e86b4d083c0f Mon Sep 17 00:00:00 2001 From: Maccabee Levine <31278545+maccabeelevine@users.noreply.github.com> Date: Mon, 7 Sep 2026 09:18:59 -0400 Subject: [PATCH 20/90] RateLimiter: Add minimal text to the Turnstile challenge page (#5618) --- languages/en.ini | 2 ++ themes/bootstrap5/templates/turnstile/challenge.phtml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/languages/en.ini b/languages/en.ini index 05b602cb4182..11c55d52fc76 100644 --- a/languages/en.ini +++ b/languages/en.ini @@ -220,6 +220,8 @@ Catalog Results = "Catalog Results" catalog_login_desc = "Enter your library catalog credentials." Categories = "Categories" CD = "CD" +challenge_heading = "Checking your connection..." +challenge_title = "Bot Challenge" Change Email Address = "Change Email Address" Change Password = "Change Password" change_email_disabled = "You are not allowed to change your email address at this time" diff --git a/themes/bootstrap5/templates/turnstile/challenge.phtml b/themes/bootstrap5/templates/turnstile/challenge.phtml index 6a3e49760aff..e335031385fc 100644 --- a/themes/bootstrap5/templates/turnstile/challenge.phtml +++ b/themes/bootstrap5/templates/turnstile/challenge.phtml @@ -1,4 +1,5 @@ headTitle($this->translate('challenge_title')); $this->assetManager()->appendScriptLink($jsLibraryUrl, ['defer' => '', 'async' => '']); $js = << assetManager()->outputInlineScriptString($js)?> +

transEsc('challenge_heading')?>

+
Date: Mon, 7 Sep 2026 19:13:46 +0100 Subject: [PATCH 21/90] Add unit tests for Collections browse actions. (#5633) --- .../AbstractCollectionsActionTestCase.php | 186 ++++++++++++++++++ .../Action/Collections/ByTitleActionTest.php | 170 ++++++++++++++++ .../Action/Collections/HomeActionTest.php | 146 ++++++++++++++ 3 files changed, 502 insertions(+) create mode 100644 module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/AbstractCollectionsActionTestCase.php create mode 100644 module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/ByTitleActionTest.php create mode 100644 module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/HomeActionTest.php diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/AbstractCollectionsActionTestCase.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/AbstractCollectionsActionTestCase.php new file mode 100644 index 000000000000..b308b1512622 --- /dev/null +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/AbstractCollectionsActionTestCase.php @@ -0,0 +1,186 @@ +. + * + * @category VuFind + * @package Tests + * @author Emmanuel Afuadajo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Page + */ + +namespace VuFindTest\Action\Collections; + +use Laminas\Diactoros\Response; +use Laminas\Diactoros\ServerRequest; +use PHPUnit\Framework\TestCase; +use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\ServerRequestInterface; +use VuFind\Action\AbstractAction; +use VuFind\Action\AbstractTemplateRenderingAction; +use VuFind\ActionHelper\HelperInterface; +use VuFind\ActionHelper\PermissionHelper; +use VuFind\ActionHelper\PluginManager as HelperPluginManager; +use VuFind\Http\RouteHelper; +use VuFind\I18n\Sorter; +use VuFind\Search\Results\PluginManager as SearchResultsPluginManager; +use VuFind\Session\Settings as SessionSettings; +use VuFind\View\Renderer\TemplateRendererInterface; +use VuFindSearch\Command\AbstractBase as AbstractCommand; +use VuFindSearch\Command\CommandInterface; +use VuFindSearch\Service as SearchService; + +/** + * Base class for Collections action tests. + * + * @category VuFind + * @package Tests + * @author Emmanuel Afuadajo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Page + */ +abstract class AbstractCollectionsActionTestCase extends TestCase +{ + /** + * Template parameters captured from the renderTemplate() call. + * + * @var array + */ + protected array $capturedTemplateParams = []; + + /** + * Command captured from the search service invoke() call. + * + * @var ?CommandInterface + */ + protected ?CommandInterface $capturedCommand = null; + + /** + * Build a Collections action and wire up its setter-injected dependencies. + * + * @param class-string $class Action class to build + * @param array $config VuFind configuration + * @param SearchService $searchService Search service + * @param HelperInterface[] $helpers Extra action helpers + * + * @return AbstractAction + */ + protected function buildAction( + string $class, + array $config, + SearchService $searchService, + array $helpers = [] + ): AbstractAction { + $action = new $class( + $config, + $searchService, + $this->createStub(SearchResultsPluginManager::class), + $this->createStub(Sorter::class), + ); + $action->setHelperPluginManager($this->getHelperPluginManager($helpers)); + $action->setRouteHelper($this->createStub(RouteHelper::class)); + $action->setSessionSettings($this->createStub(SessionSettings::class)); + if ($action instanceof AbstractTemplateRenderingAction) { + $action->setTemplateRenderer($this->getTemplateRenderer()); + } + return $action; + } + + /** + * Get a helper plugin manager returning the provided helpers, plus a PermissionHelper for access. + * + * @param HelperInterface[] $helpers Extra helpers keyed by class name + * + * @return HelperPluginManager + */ + protected function getHelperPluginManager(array $helpers = []): HelperPluginManager + { + if (!isset($helpers[PermissionHelper::class])) { + $permissionHelper = $this->createMock(PermissionHelper::class); + $permissionHelper->method('getPermissionBehaviorConfig')->willReturn([]); + $helpers[PermissionHelper::class] = $permissionHelper; + } + + $manager = $this->createMock(HelperPluginManager::class); + $manager->method('get')->willReturnCallback( + fn ($name) => $helpers[$name] ?? throw new \Exception("Unexpected helper requested: $name") + ); + return $manager; + } + + /** + * Get a template renderer and capture the parameters passed to renderTemplate(). + * + * @return TemplateRendererInterface + */ + protected function getTemplateRenderer(): TemplateRendererInterface + { + $renderer = $this->createMock(TemplateRendererInterface::class); + $renderer->method('renderTemplate')->willReturnCallback( + function ( + ServerRequestInterface $request, + ResponseInterface $response, + ?string $template = null, + array $params = [], + ): ResponseInterface { + $this->capturedTemplateParams = $params; + return $response; + } + ); + return $renderer; + } + + /** + * Get a mock search service that returns a command with the given result when invoked. The command passed to + * invoke() is captured so tests can assert on the query that was built. + * + * @param mixed $result Result to return from the executed command + * + * @return SearchService + */ + protected function getMockSearchService(mixed $result): SearchService + { + $executedCommand = $this->createMock(AbstractCommand::class); + $executedCommand->method('getResult')->willReturn($result); + $searchService = $this->createMock(SearchService::class); + $searchService->method('invoke')->willReturnCallback( + function (CommandInterface $command) use ($executedCommand): CommandInterface { + $this->capturedCommand = $command; + return $executedCommand; + } + ); + return $searchService; + } + + /** + * Invoke an action with the given query parameters. + * + * @param AbstractAction $action Action to invoke + * @param array $queryParams Query parameters for the request + * + * @return ResponseInterface + */ + protected function invokeAction(AbstractAction $action, array $queryParams = []): ResponseInterface + { + $request = (new ServerRequest())->withQueryParams($queryParams); + return $action($request, new Response()); + } +} diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/ByTitleActionTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/ByTitleActionTest.php new file mode 100644 index 000000000000..62cadbfdbfe4 --- /dev/null +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/ByTitleActionTest.php @@ -0,0 +1,170 @@ +. + * + * @category VuFind + * @package Tests + * @author Emmanuel Afuadajo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Page + */ + +namespace VuFindTest\Action\Collections; + +use Laminas\Diactoros\Response; +use Psr\Http\Message\ResponseInterface; +use VuFind\Action\Collections\ByTitleAction; +use VuFind\ActionHelper\RedirectHelper; +use VuFind\RecordDriver\AbstractBase as RecordDriver; +use VuFindSearch\Command\SearchCommand; +use VuFindSearch\Query\Query; +use VuFindSearch\Response\RecordCollectionInterface; + +/** + * Collections ByTitleAction test class. + * + * @category VuFind + * @package Tests + * @author Emmanuel Afuadajo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Page + */ +class ByTitleActionTest extends AbstractCollectionsActionTestCase +{ + /** + * Get a mock search service whose title lookup returns the given record drivers. + * + * @param array $records Record drivers to return + * + * @return \VuFindSearch\Service + */ + protected function getSearchServiceReturningRecords(array $records): \VuFindSearch\Service + { + $collection = $this->createMock(RecordCollectionInterface::class); + $collection->method('getRecords')->willReturn($records); + return $this->getMockSearchService($collection); + } + + /** + * Test that a single matching collection redirects straight to that collection. + * + * @return void + */ + public function testSingleResultRedirectsToCollection(): void + { + $record = $this->createMock(RecordDriver::class); + $record->method('getUniqueId')->willReturn('coll1'); + $searchService = $this->getSearchServiceReturningRecords([$record]); + + $expectedResponse = new Response(); + $redirectHelper = $this->createMock(RedirectHelper::class); + $redirectHelper->expects($this->once())->method('redirectToRoute') + ->with($this->isInstanceOf(ResponseInterface::class), 'collection', ['id' => 'coll1']) + ->willReturn($expectedResponse); + + $action = $this->buildAction( + ByTitleAction::class, + [], + $searchService, + [RedirectHelper::class => $redirectHelper] + ); + + $result = $this->invokeAction($action, ['title' => 'Unique Collection']); + $this->assertSame($expectedResponse, $result); + } + + /** + * Test that multiple matches render the list of collections. + * + * @return void + */ + public function testMultipleResultsRenderList(): void + { + $records = [$this->createMock(RecordDriver::class), $this->createMock(RecordDriver::class)]; + $searchService = $this->getSearchServiceReturningRecords($records); + + $redirectHelper = $this->createMock(RedirectHelper::class); + $redirectHelper->expects($this->never())->method('redirectToRoute'); + + $action = $this->buildAction( + ByTitleAction::class, + [], + $searchService, + [RedirectHelper::class => $redirectHelper] + ); + + $this->invokeAction($action, ['title' => 'Common Title']); + $this->assertSame($records, $this->capturedTemplateParams['collections']); + } + + /** + * Test that the title input is turned into a hierachy_title search command with the configured browse limit, + * and it escapes embedded quotes. + * + * @return void + */ + public function testTitleBuildsExpectedSearchCommand(): void + { + $searchService = $this->getSearchServiceReturningRecords([]); + $action = $this->buildAction( + ByTitleAction::class, + ['Collections' => ['browseLimit' => 50]], + $searchService, + [RedirectHelper::class => $this->createMock(RedirectHelper::class)] + ); + + $this->invokeAction($action, ['title' => 'Quoth the "Raven"']); + + $command = $this->capturedCommand; + $this->assertInstanceOf(SearchCommand::class, $command); + $this->assertSame(DEFAULT_SEARCH_BACKEND, $command->getTargetIdentifier()); + $this->assertSame(0, $command->getOffset()); + $this->assertSame(50, $command->getLimit()); + + $query = $command->getQuery(); + $this->assertInstanceOf(Query::class, $query); + $this->assertSame('is_hierarchy_title:"Quoth the \"Raven\""', $query->getString()); + $this->assertSame('AllFields', $query->getHandler()); + } + + /** + * Test that no matches render the empty list rather than redirecting. + * + * @return void + */ + public function testNoResultsRenderList(): void + { + $searchService = $this->getSearchServiceReturningRecords([]); + + $redirectHelper = $this->createMock(RedirectHelper::class); + $redirectHelper->expects($this->never())->method('redirectToRoute'); + + $action = $this->buildAction( + ByTitleAction::class, + [], + $searchService, + [RedirectHelper::class => $redirectHelper] + ); + + $this->invokeAction($action, ['title' => 'Nonexistent']); + $this->assertSame([], $this->capturedTemplateParams['collections']); + } +} diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/HomeActionTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/HomeActionTest.php new file mode 100644 index 000000000000..eb1498ebab08 --- /dev/null +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/HomeActionTest.php @@ -0,0 +1,146 @@ +. + * + * @category VuFind + * @package Tests + * @author Emmanuel Afuadajo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Page + */ + +namespace VuFindTest\Action\Collections; + +use VuFind\Action\Collections\HomeAction; + +/** + * Collections HomeAction test class. + * + * @category VuFind + * @package Tests + * @author Emmanuel Afuadajo + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Page + */ +class HomeActionTest extends AbstractCollectionsActionTestCase +{ + /** + * Test that the alphabetic browse formats browse strings into display text and exposes the initial-letter list. + * + * @return void + */ + public function testAlphabeticBrowseFormatsResults(): void + { + $searchService = $this->getMockSearchService([ + 'Browse' => [ + 'totalCount' => 2, + 'offset' => 0, + 'startRow' => 1, + 'items' => [ + ['heading' => 'Collection One{{{_ID_}}}coll1', 'count' => 5], + ['heading' => 'Collection Two{{{_ID_}}}coll2', 'count' => 3], + ], + ], + ]); + $action = $this->buildAction( + HomeAction::class, + ['Collections' => ['browseType' => 'Alphabetic']], + $searchService + ); + + $this->invokeAction($action, ['from' => 'Col']); + $params = $this->capturedTemplateParams; + + $this->assertSame('Col', $params['from']); + $this->assertSame( + [ + ['displayText' => 'Collection One', 'count' => 5, 'value' => 'coll1'], + ['displayText' => 'Collection Two', 'count' => 3, 'value' => 'coll2'], + ], + $params['result'] + ); + + $this->assertSame(array_merge(range('0', '9'), range('A', 'Z')), $params['letters']); + + $this->assertArrayNotHasKey('nextpage', $params); + $this->assertArrayNotHasKey('prevpage', $params); + } + + /** + * Test that the alphabetic browse adds next/previous page links when the result set warrants them. + * + * @return void + */ + public function testAlphabeticBrowseAddsPageLinks(): void + { + $searchService = $this->getMockSearchService([ + 'Browse' => [ + 'totalCount' => 30, + 'offset' => 0, + 'startRow' => 2, + 'items' => [], + ], + ]); + $action = $this->buildAction( + HomeAction::class, + ['Collections' => ['browseType' => 'Alphabetic', 'browseLimit' => 20]], + $searchService + ); + + $this->invokeAction($action, ['page' => 3]); + $params = $this->capturedTemplateParams; + + $this->assertSame(4, $params['nextpage']); + $this->assertSame(2, $params['prevpage']); + } + + /** + * Test that a configured browse delimiter is used when splitting browse strings. + * + * @return void + */ + public function testAlphabeticBrowseUsesConfiguredDelimiter(): void + { + $searchService = $this->getMockSearchService([ + 'Browse' => [ + 'totalCount' => 1, + 'offset' => 0, + 'startRow' => 1, + 'items' => [ + ['heading' => 'Collection One##coll1', 'count' => 2], + ], + ], + ]); + $action = $this->buildAction( + HomeAction::class, + ['Collections' => ['browseType' => 'Alphabetic', 'browseDelimiter' => '##']], + $searchService + ); + + $this->invokeAction($action); + $params = $this->capturedTemplateParams; + + $this->assertSame( + [['displayText' => 'Collection One', 'count' => 2, 'value' => 'coll1']], + $params['result'] + ); + } +} From 44cb3de50b97641848b06f9f156379660e37fc5d Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Mon, 7 Sep 2026 15:01:16 -0400 Subject: [PATCH 22/90] Fix bug: language globals must initialize after language detection. (#5635) --- module/VuFind/src/VuFind/Bootstrapper.php | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/module/VuFind/src/VuFind/Bootstrapper.php b/module/VuFind/src/VuFind/Bootstrapper.php index 213dbf972995..8bb9620f2439 100644 --- a/module/VuFind/src/VuFind/Bootstrapper.php +++ b/module/VuFind/src/VuFind/Bootstrapper.php @@ -197,21 +197,6 @@ protected function initContext(): void $this->events->attach('dispatch', $callback); } - /** - * Set up the initial globals. - * - * @return void - */ - protected function initGlobals(): void - { - $settings = $this->container->get(LocaleSettings::class); - $locale = $settings->getUserLocale(); - $globals = $this->container->get(GlobalsContainer::class); - $globals['userLang'] = $locale; - $globals['allLangs'] = $settings->getEnabledLocales(); - $globals['rtl'] = $settings->isRightToLeftLocale($locale); - } - /** * Detect locale and update language in user account, as needed. * @@ -240,6 +225,11 @@ protected function initUserLanguage(): void $user->setLastLanguage($language); $this->getDbService(\VuFind\Db\Service\UserServiceInterface::class)->persistEntity($user); } + // Populate language-related global values: + $globals = $this->container->get(GlobalsContainer::class); + $globals['userLang'] = $language; + $globals['allLangs'] = $settings->getEnabledLocales(); + $globals['rtl'] = $settings->isRightToLeftLocale($language); }; $this->events->attach('dispatch.error', $callback, 15000); $this->events->attach('dispatch', $callback, 15000); From 3d0126535dad3e20b3d584cf7c0b717817a51881 Mon Sep 17 00:00:00 2001 From: Thomas Wagener Date: Mon, 7 Sep 2026 21:46:02 +0200 Subject: [PATCH 23/90] Fix last search links (#5634) --- .../VuFind/View/Helper/Root/SearchMemory.php | 2 +- .../src/VuFindTest/Mink/RecordActionsTest.php | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/module/VuFind/src/VuFind/View/Helper/Root/SearchMemory.php b/module/VuFind/src/VuFind/View/Helper/Root/SearchMemory.php index 5e0c564d4f9e..304a8faf43df 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/SearchMemory.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/SearchMemory.php @@ -101,8 +101,8 @@ public function getLastSearchLink($link, $prefix = '', $suffix = '') public function getLastSearchUrl(): ?string { if ($lastSearch = $this->getLastSearch()) { - $searchClassId = $lastSearch->getBackendId(); $params = $lastSearch->getParams(); + $searchClassId = $params->getSearchClassId(); // Use last settings for params that are not stored in the search: foreach (['limit', 'view', 'sort'] as $setting) { $value = $this->memory->retrieveLastSetting($searchClassId, $setting); diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/RecordActionsTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/RecordActionsTest.php index 97e279c190cc..a308b8e1b958 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/RecordActionsTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/RecordActionsTest.php @@ -323,6 +323,26 @@ public function testTagSearchSort( $this->assertSelectedSort($page, $expectedSort); } + /** + * Test sorting persists in last search link. + * + * @return void + */ + #[\PHPUnit\Framework\Attributes\Depends('testTagSearchSort')] + public function testTagSearchSortPersistsInLastSearchLink(): void + { + $page = $this->performSearch('five', 'tag'); + $this->clickCss($page, $this->sortControlSelector . ' option', null, 1); + $this->waitForPageLoad($page); + $this->assertSelectedSort($page, 'author'); + $page->clickLink('Dewey browse test'); + $this->assertSame('Dewey browse test', $this->findCssAndGetText($page, 'h1')); + // Click on search results in breadcrumb to go back to search and check that + // author sort is still selected + $page->clickLink('Search Results'); + $this->assertSelectedSort($page, 'author'); + } + /** * Test that default autocomplete behavior is correct on a non-default search handler. * From 02510d8e10d3244b5c7dc3d0115e49659b9300c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20M=C3=BCller?= Date: Mon, 7 Sep 2026 21:50:38 +0200 Subject: [PATCH 24/90] Don't update browser url when navigating tabs in search results (#5518) --- themes/bootstrap5/js/record_tabs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/themes/bootstrap5/js/record_tabs.js b/themes/bootstrap5/js/record_tabs.js index de7096df496f..637bf856be33 100644 --- a/themes/bootstrap5/js/record_tabs.js +++ b/themes/bootstrap5/js/record_tabs.js @@ -43,7 +43,9 @@ VuFind.register('recordTabs', function RecordTabs() { let tabPane = document.querySelector(tabButton.dataset.bsTarget); if (!tabPane) return; let tabUrl = tabPane.dataset.tabUrl; - if (window.history.replaceState && tabUrl) { + // We only want to replace the browser URL when clicking a tab on a record page; + // embedded search results should not change browser history to prevent confusion. + if (window.history.replaceState && tabUrl && !tabPane.closest('.result .long-view')) { window.history.replaceState({}, document.title, tabUrl); } _ajaxLoadTab(tabPane); From 2ffc7619c1af6628b9270a144de76877dae580b2 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Mon, 7 Sep 2026 16:04:48 -0400 Subject: [PATCH 25/90] Test that embedded tabs do not change URL inappropriately. (#5602) --- .../src/VuFindTest/Mink/ListViewsTest.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/ListViewsTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/ListViewsTest.php index 3f835ddc3a75..7776234eea49 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/ListViewsTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/ListViewsTest.php @@ -101,8 +101,15 @@ public function testCommentsInTabMode() ); $page = $this->gotoRecord(); - // Open the user comments tab and confirm that login is required: + // Assert that we are on the search results screen; we want to make sure that clicking on the comments + // tab doesn't manipulate the search URL inappropriately. + $session = $this->getMinkSession(); + $initialUrl = $session->getCurrentUrl(); + $this->assertStringEndsWith('/Search/Results?lookfor=id%3Atestdeweybrowse&type=AllFields', $initialUrl); + + // Open the user comments tab and confirm that URL is unchanged and login is required: $this->clickCss($page, '#tab-button-usercomments-cd588d8723d65ca0ce9439e79755fa0a'); + $this->assertSame($initialUrl, $session->getCurrentUrl()); $this->assertSame( 'You must be logged in first', $this->findCssAndGetText($page, '.comment-form .btn-primary') From 87338ac57f63eea50f05c1cdfe0575b25fdfbf10 Mon Sep 17 00:00:00 2001 From: Thomas Wagener Date: Tue, 8 Sep 2026 14:39:32 +0200 Subject: [PATCH 26/90] Make result backendId nullable (#5632) --- module/VuFind/src/VuFind/Search/Base/Results.php | 8 ++++---- module/VuFind/src/VuFind/Search/Blender/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/Blender2/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/BrowZine/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/EDS/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/EIT/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/EPF/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/LibGuides/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/LibGuidesAZ/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/Pazpar2/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/Primo/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/ProQuestFSG/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/Search2/Results.php | 6 +++--- .../src/VuFind/Search/Search2Collection/Results.php | 6 +++--- module/VuFind/src/VuFind/Search/Solr/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/SolrAuth/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/SolrReserves/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/SolrWeb/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/Summon/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/WorldCat/Results.php | 4 ++-- module/VuFind/src/VuFind/Search/WorldCat2/Results.php | 4 ++-- .../Command/ScheduledSearch/NotifyCommand.php | 6 ++++-- 22 files changed, 50 insertions(+), 48 deletions(-) diff --git a/module/VuFind/src/VuFind/Search/Base/Results.php b/module/VuFind/src/VuFind/Search/Base/Results.php index 4e2c015eb1b9..2bbaa4c5a185 100644 --- a/module/VuFind/src/VuFind/Search/Base/Results.php +++ b/module/VuFind/src/VuFind/Search/Base/Results.php @@ -74,9 +74,9 @@ abstract class Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = ''; + protected ?string $backendId = null; /** * Override (only for use in very rare cases). @@ -464,9 +464,9 @@ public function getErrors(): array /** * Basic 'getter' of search backend identifier. * - * @return string + * @return ?string */ - public function getBackendId(): string + public function getBackendId(): ?string { return $this->backendId; } diff --git a/module/VuFind/src/VuFind/Search/Blender/Results.php b/module/VuFind/src/VuFind/Search/Blender/Results.php index b077a4823a7f..7cfb95f89819 100644 --- a/module/VuFind/src/VuFind/Search/Blender/Results.php +++ b/module/VuFind/src/VuFind/Search/Blender/Results.php @@ -43,9 +43,9 @@ class Results extends \VuFind\Search\Solr\Results /** * Search backend identifiers. * - * @var string + * @var ?string */ - protected string $backendId = 'Blender'; + protected ?string $backendId = 'Blender'; /** * Support method for performAndProcessSearch -- perform a search based on the diff --git a/module/VuFind/src/VuFind/Search/Blender2/Results.php b/module/VuFind/src/VuFind/Search/Blender2/Results.php index 0aeefe472bf5..02fb2b38b516 100644 --- a/module/VuFind/src/VuFind/Search/Blender2/Results.php +++ b/module/VuFind/src/VuFind/Search/Blender2/Results.php @@ -43,7 +43,7 @@ class Results extends \VuFind\Search\Blender\Results /** * Search backend identifiers. * - * @var string + * @var ?string */ - protected string $backendId = 'Blender2'; + protected ?string $backendId = 'Blender2'; } diff --git a/module/VuFind/src/VuFind/Search/BrowZine/Results.php b/module/VuFind/src/VuFind/Search/BrowZine/Results.php index e40df4a93ac6..482c305d5739 100644 --- a/module/VuFind/src/VuFind/Search/BrowZine/Results.php +++ b/module/VuFind/src/VuFind/Search/BrowZine/Results.php @@ -45,9 +45,9 @@ class Results extends \VuFind\Search\Base\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'BrowZine'; + protected ?string $backendId = 'BrowZine'; /** * Returns the stored list of facets for the last search. diff --git a/module/VuFind/src/VuFind/Search/EDS/Results.php b/module/VuFind/src/VuFind/Search/EDS/Results.php index ea4cc6706b07..befe5e195c00 100644 --- a/module/VuFind/src/VuFind/Search/EDS/Results.php +++ b/module/VuFind/src/VuFind/Search/EDS/Results.php @@ -51,9 +51,9 @@ class Results extends \VuFind\Search\Base\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'EDS'; + protected ?string $backendId = 'EDS'; /** * Facet list. diff --git a/module/VuFind/src/VuFind/Search/EIT/Results.php b/module/VuFind/src/VuFind/Search/EIT/Results.php index 8ca077d428d3..53c4135fb88f 100644 --- a/module/VuFind/src/VuFind/Search/EIT/Results.php +++ b/module/VuFind/src/VuFind/Search/EIT/Results.php @@ -49,9 +49,9 @@ class Results extends \VuFind\Search\Base\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'EIT'; + protected ?string $backendId = 'EIT'; /** * Support method for performAndProcessSearch -- perform a search based on the diff --git a/module/VuFind/src/VuFind/Search/EPF/Results.php b/module/VuFind/src/VuFind/Search/EPF/Results.php index a73bbc5d5002..2749300ca79e 100644 --- a/module/VuFind/src/VuFind/Search/EPF/Results.php +++ b/module/VuFind/src/VuFind/Search/EPF/Results.php @@ -50,9 +50,9 @@ class Results extends \VuFind\Search\Base\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'EPF'; + protected ?string $backendId = 'EPF'; /** * Facet list. diff --git a/module/VuFind/src/VuFind/Search/LibGuides/Results.php b/module/VuFind/src/VuFind/Search/LibGuides/Results.php index a7db9602d38a..371ea4ad8f94 100644 --- a/module/VuFind/src/VuFind/Search/LibGuides/Results.php +++ b/module/VuFind/src/VuFind/Search/LibGuides/Results.php @@ -45,9 +45,9 @@ class Results extends \VuFind\Search\Base\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'LibGuides'; + protected ?string $backendId = 'LibGuides'; /** * Support method for performAndProcessSearch -- perform a search based on the diff --git a/module/VuFind/src/VuFind/Search/LibGuidesAZ/Results.php b/module/VuFind/src/VuFind/Search/LibGuidesAZ/Results.php index 1b088b6529ab..cb5292e24fc7 100644 --- a/module/VuFind/src/VuFind/Search/LibGuidesAZ/Results.php +++ b/module/VuFind/src/VuFind/Search/LibGuidesAZ/Results.php @@ -45,7 +45,7 @@ class Results extends \VuFind\Search\LibGuides\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'LibGuidesAZ'; + protected ?string $backendId = 'LibGuidesAZ'; } diff --git a/module/VuFind/src/VuFind/Search/Pazpar2/Results.php b/module/VuFind/src/VuFind/Search/Pazpar2/Results.php index 216c8d8866df..d7698bd04425 100644 --- a/module/VuFind/src/VuFind/Search/Pazpar2/Results.php +++ b/module/VuFind/src/VuFind/Search/Pazpar2/Results.php @@ -45,9 +45,9 @@ class Results extends \VuFind\Search\Base\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'Pazpar2'; + protected ?string $backendId = 'Pazpar2'; /** * Support method for performAndProcessSearch -- perform a search based on the diff --git a/module/VuFind/src/VuFind/Search/Primo/Results.php b/module/VuFind/src/VuFind/Search/Primo/Results.php index 8557473cee81..5a644745c7c5 100644 --- a/module/VuFind/src/VuFind/Search/Primo/Results.php +++ b/module/VuFind/src/VuFind/Search/Primo/Results.php @@ -52,9 +52,9 @@ class Results extends \VuFind\Search\Base\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'Primo'; + protected ?string $backendId = 'Primo'; /** * Support method for performAndProcessSearch -- perform a search based on the diff --git a/module/VuFind/src/VuFind/Search/ProQuestFSG/Results.php b/module/VuFind/src/VuFind/Search/ProQuestFSG/Results.php index 7568b098c69e..3b9a3f5fe966 100644 --- a/module/VuFind/src/VuFind/Search/ProQuestFSG/Results.php +++ b/module/VuFind/src/VuFind/Search/ProQuestFSG/Results.php @@ -45,9 +45,9 @@ class Results extends \VuFind\Search\Base\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'ProQuestFSG'; + protected ?string $backendId = 'ProQuestFSG'; /** * Facets returned in search response. diff --git a/module/VuFind/src/VuFind/Search/Search2/Results.php b/module/VuFind/src/VuFind/Search/Search2/Results.php index 691a47ea69ef..df1db52596d6 100644 --- a/module/VuFind/src/VuFind/Search/Search2/Results.php +++ b/module/VuFind/src/VuFind/Search/Search2/Results.php @@ -41,9 +41,9 @@ class Results extends \VuFind\Search\Solr\Results { /** - * Backend ID. + * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'Search2'; + protected ?string $backendId = 'Search2'; } diff --git a/module/VuFind/src/VuFind/Search/Search2Collection/Results.php b/module/VuFind/src/VuFind/Search/Search2Collection/Results.php index b8b25603c623..8a560b6c5073 100644 --- a/module/VuFind/src/VuFind/Search/Search2Collection/Results.php +++ b/module/VuFind/src/VuFind/Search/Search2Collection/Results.php @@ -41,9 +41,9 @@ class Results extends \VuFind\Search\SolrCollection\Results { /** - * Search backend identifiers. + * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'Search2Collection'; + protected ?string $backendId = 'Search2Collection'; } diff --git a/module/VuFind/src/VuFind/Search/Solr/Results.php b/module/VuFind/src/VuFind/Search/Solr/Results.php index 2e9f851e5b22..9f80af684632 100644 --- a/module/VuFind/src/VuFind/Search/Solr/Results.php +++ b/module/VuFind/src/VuFind/Search/Solr/Results.php @@ -78,9 +78,9 @@ class Results extends \VuFind\Search\Base\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'Solr'; + protected ?string $backendId = 'Solr'; /** * Currently used spelling query, if any. diff --git a/module/VuFind/src/VuFind/Search/SolrAuth/Results.php b/module/VuFind/src/VuFind/Search/SolrAuth/Results.php index 2db8350ae0f1..24bed477b66c 100644 --- a/module/VuFind/src/VuFind/Search/SolrAuth/Results.php +++ b/module/VuFind/src/VuFind/Search/SolrAuth/Results.php @@ -43,7 +43,7 @@ class Results extends \VuFind\Search\Solr\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'SolrAuth'; + protected ?string $backendId = 'SolrAuth'; } diff --git a/module/VuFind/src/VuFind/Search/SolrReserves/Results.php b/module/VuFind/src/VuFind/Search/SolrReserves/Results.php index 8d8dfb89b22f..d650de4e75dd 100644 --- a/module/VuFind/src/VuFind/Search/SolrReserves/Results.php +++ b/module/VuFind/src/VuFind/Search/SolrReserves/Results.php @@ -45,7 +45,7 @@ class Results extends \VuFind\Search\Solr\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'SolrReserves'; + protected ?string $backendId = 'SolrReserves'; } diff --git a/module/VuFind/src/VuFind/Search/SolrWeb/Results.php b/module/VuFind/src/VuFind/Search/SolrWeb/Results.php index a1ad52938eef..235a2854cafb 100644 --- a/module/VuFind/src/VuFind/Search/SolrWeb/Results.php +++ b/module/VuFind/src/VuFind/Search/SolrWeb/Results.php @@ -43,7 +43,7 @@ class Results extends \VuFind\Search\Solr\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'SolrWeb'; + protected ?string $backendId = 'SolrWeb'; } diff --git a/module/VuFind/src/VuFind/Search/Summon/Results.php b/module/VuFind/src/VuFind/Search/Summon/Results.php index 9aff3321df52..7d63324e637f 100644 --- a/module/VuFind/src/VuFind/Search/Summon/Results.php +++ b/module/VuFind/src/VuFind/Search/Summon/Results.php @@ -76,9 +76,9 @@ class Results extends \VuFind\Search\Base\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'Summon'; + protected ?string $backendId = 'Summon'; /** * Support method for performAndProcessSearch -- perform a search based on the diff --git a/module/VuFind/src/VuFind/Search/WorldCat/Results.php b/module/VuFind/src/VuFind/Search/WorldCat/Results.php index cf67b3a5b08e..5731da11221a 100644 --- a/module/VuFind/src/VuFind/Search/WorldCat/Results.php +++ b/module/VuFind/src/VuFind/Search/WorldCat/Results.php @@ -45,9 +45,9 @@ class Results extends \VuFind\Search\Base\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'WorldCat'; + protected ?string $backendId = 'WorldCat'; /** * Support method for performAndProcessSearch -- perform a search based on the diff --git a/module/VuFind/src/VuFind/Search/WorldCat2/Results.php b/module/VuFind/src/VuFind/Search/WorldCat2/Results.php index be03dd8e6dda..38195d8c5e62 100644 --- a/module/VuFind/src/VuFind/Search/WorldCat2/Results.php +++ b/module/VuFind/src/VuFind/Search/WorldCat2/Results.php @@ -47,9 +47,9 @@ class Results extends \VuFind\Search\Base\Results /** * Search backend identifier. * - * @var string + * @var ?string */ - protected string $backendId = 'WorldCat2'; + protected ?string $backendId = 'WorldCat2'; /** * Facet list. diff --git a/module/VuFindConsole/src/VuFindConsole/Command/ScheduledSearch/NotifyCommand.php b/module/VuFindConsole/src/VuFindConsole/Command/ScheduledSearch/NotifyCommand.php index c22277319081..424fa84cd8fa 100644 --- a/module/VuFindConsole/src/VuFindConsole/Command/ScheduledSearch/NotifyCommand.php +++ b/module/VuFindConsole/src/VuFindConsole/Command/ScheduledSearch/NotifyCommand.php @@ -295,9 +295,11 @@ protected function getObjectForSearch($s) } $searchObject = $minSO->deminify($this->resultsManager); if (!$searchObject->getOptions()->supportsScheduledSearch()) { + $backendId = $searchObject->getBackendId(); + $searchId = $searchObject->getSearchId(); $this->err( - 'Unsupported search backend ' . $searchObject->getBackendId() - . ' for search ' . $searchObject->getSearchId() + 'Unsupported search backend ' . ($backendId ?? '') + . ' for search ' . ($searchId ?? '') ); return false; } From 6a3eba5f45643b6a299817ddbda1d88366bc6c4d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Sep 2026 09:28:04 -0400 Subject: [PATCH 27/90] Bump eslint-plugin-jsdoc from 64.2.1 to 64.3.5 (#5629) Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 64.2.1 to 64.3.5. - [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases) - [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v64.2.1...v64.3.5) --- updated-dependencies: - dependency-name: eslint-plugin-jsdoc dependency-version: 64.3.5 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 254 +++++++++++++++++++++++++++++++++++++++++++--- package.json | 2 +- 2 files changed, 239 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index d90d3e23670f..5c3d208d9056 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "@eslint/js": "^10.0.0", "all-iso-language-codes": "^1.0.13", "eslint": "^10.9.1", - "eslint-plugin-jsdoc": "^64.2.1", + "eslint-plugin-jsdoc": "^64.3.5", "eslint-plugin-no-jquery": "^6.0.0", "globals": "^17.11.0" }, @@ -30,9 +30,9 @@ } }, "node_modules/@es-joy/jsdoccomment": { - "version": "0.95.1", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.95.1.tgz", - "integrity": "sha512-LO/RI08Fo9bhXwB7Od9G+1j3eSNq63+ZS5CQO8YLXHbDg6kx6S/DhTeY0+Fc9uZrjK1zZSyTx8Sg5gv5DIoCnA==", + "version": "0.96.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.96.0.tgz", + "integrity": "sha512-nvtxrDqAJOKMPSsMHqshCnHvnCqFnJTsKpTaTSaZoUi9VxGVe2JvgQeAY/Qvh2wyqXByIAqNTgI7h9elXzn0yQ==", "dev": true, "license": "MIT", "dependencies": { @@ -40,7 +40,7 @@ "@typescript-eslint/types": "^8.67.0", "comment-parser": "1.4.8", "esquery": "^1.7.0", - "jsdoc-type-pratt-parser": "~9.1.2" + "jsdoc-type-pratt-parser": "~9.2.0" }, "engines": { "node": "^22.22.2 || >=24.15.0" @@ -566,10 +566,77 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/node": { + "version": "26.4.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.4.1.tgz", + "integrity": "sha512-k97ENvZWtvA6yqz5/FS6a7duDgOPEeOQOc2iKS/nY6mX6qJUKtLnWzQS+Xj6tXweyj6ZcTAK2Qecetnvi9nCLA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~8.3.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.69.0.tgz", + "integrity": "sha512-yi4obFrHMmnsesWehHbkg9zMA7Jt8cXT+mKM08G999pH1yT6nqgsHx7MYm0uY1wAj8CqiBXYRJ7WAT0QdQHQXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.69.0", + "@typescript-eslint/types": "^8.69.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.69.0.tgz", + "integrity": "sha512-ewfspqWvSxKSOaplqAUNbaSFO0eB6w1EtQ+esfYFRm3614Ty4uNtExkcbgd6nWsXphbqKyf9ZYdbZdv2xEoWEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.69.0", + "@typescript-eslint/visitor-keys": "8.69.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.69.0.tgz", + "integrity": "sha512-xNqK7YTDZsLniQMV/4rpFR8Z5JlqeRvVjuG1YgF/mdPVH84HSD19L8CczMA0qg2RfwEV231GHH3VnToJDo4MfQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, "node_modules/@typescript-eslint/types": { - "version": "8.67.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.67.0.tgz", - "integrity": "sha512-sBtgslww8nsMYUjhdPBiSyUqSzT8uR6g93A2QXnQC8+cGdjz0CyaOdqHDRJb1AtORbZCNUJBBeFA/tNR2uQmww==", + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.69.0.tgz", + "integrity": "sha512-K3VrubUPhlo9VDBS6QdI8YB5j7ClpqLRdefcz6PFrhnwicehBweqQ9Evhl4l+FYz0HdDmMqIiSX0aldGRYtDCA==", "dev": true, "license": "MIT", "engines": { @@ -580,6 +647,76 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.69.0.tgz", + "integrity": "sha512-AdFkgqck3Vudb/kWnxlyafU/4aBhHrbQ9locP2N4psXTy5mOBg0SHJumnLvx7r6g1gV4DKvUFwV2nJZBoqOD8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.69.0", + "@typescript-eslint/tsconfig-utils": "8.69.0", + "@typescript-eslint/types": "8.69.0", + "@typescript-eslint/visitor-keys": "8.69.0", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.69.0.tgz", + "integrity": "sha512-tUbx60BBqQa31kXF5MCsOOLL5E/WzUuxIn7YpAvq+eaUlqvk8/NXnXMBNAdLCr0icjkzem7iUA5QqWHe/hJ1aw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.69.0", + "@typescript-eslint/types": "8.69.0", + "@typescript-eslint/typescript-estree": "8.69.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.69.0.tgz", + "integrity": "sha512-+rmdgPA+EXkNgKYvHvFfhrs35utXbwaC5PGpDquSXcoXQDKUA5UjV0LmTucG/4JXkM31BTu4TilHtrN8IVBe8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.69.0", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/acorn": { "version": "8.17.0", "dev": true, @@ -883,14 +1020,15 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "64.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-64.2.1.tgz", - "integrity": "sha512-6GpSYxLPcbMw38S94Cngrgs1Zv8yLinQS1O17OxJVZ6deLbrMRCERUYQKceweSqEuG2kx5Amn4l3aKPkCp4geQ==", + "version": "64.3.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-64.3.5.tgz", + "integrity": "sha512-BqRUwfREoBH+7pzDD+uIQ3aema5P7BnPYcHj3mU0DLm+p/5TEHdimkXgnQfYl0AGgB9PZxZW/Lk7D69FTJSLXw==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@es-joy/jsdoccomment": "~0.95.1", + "@es-joy/jsdoccomment": "~0.96.0", "@es-joy/resolve.exports": "1.2.0", + "@typescript-eslint/utils": "^8.69.0", "are-docs-informative": "^0.1.1", "comment-parser": "1.4.8", "debug": "^4.4.3", @@ -1223,13 +1361,14 @@ "license": "MIT" }, "node_modules/jsdoc-type-pratt-parser": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-9.1.2.tgz", - "integrity": "sha512-9EXymowgk1mb9RY1VxuwKc+AhaxfBk2CV0dWxgGM+l5RURTtiUoAx7MlKwcsiVcEXK5HEPa7FeH/tsRpqjEPRg==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-9.2.1.tgz", + "integrity": "sha512-V4Ww4EHnTcTLSOMoB0FsF72JhQvcAsriCm/LWnxJeGWoxIjEL2l9na11abQok5SYShq8m0Gl02el/xAbTCulvQ==", "dev": true, "license": "MIT", "dependencies": { - "@types/estree": "^1.0.9" + "@types/estree": "^1.0.9", + "@types/node": "^26.4.0" }, "engines": { "node": "^22.22.2 || >=24.15.0" @@ -1615,6 +1754,54 @@ "node": ">=4" } }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "license": "MIT", @@ -1647,6 +1834,19 @@ "nodetouch": "bin/nodetouch.js" } }, + "node_modules/ts-api-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, "node_modules/type-check": { "version": "0.4.0", "dev": true, @@ -1658,10 +1858,32 @@ "node": ">= 0.8.0" } }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/undefsafe": { "version": "2.0.5", "license": "MIT" }, + "node_modules/undici-types": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", + "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", + "dev": true, + "license": "MIT" + }, "node_modules/uri-js": { "version": "4.4.1", "dev": true, diff --git a/package.json b/package.json index 548196b272f2..489278a33176 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@eslint/js": "^10.0.0", "all-iso-language-codes": "^1.0.13", "eslint": "^10.9.1", - "eslint-plugin-jsdoc": "^64.2.1", + "eslint-plugin-jsdoc": "^64.3.5", "eslint-plugin-no-jquery": "^6.0.0", "globals": "^17.11.0" } From 170e81e06acfbe4b7f86cf9f535d2ce2a9e0fd65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Sep 2026 10:13:30 -0400 Subject: [PATCH 28/90] Bump globals from 17.11.0 to 17.12.0 (#5630) Bumps [globals](https://github.com/sindresorhus/globals) from 17.11.0 to 17.12.0. - [Release notes](https://github.com/sindresorhus/globals/releases) - [Commits](https://github.com/sindresorhus/globals/compare/v17.11.0...v17.12.0) --- updated-dependencies: - dependency-name: globals dependency-version: 17.12.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5c3d208d9056..40ea396a6a4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "eslint": "^10.9.1", "eslint-plugin-jsdoc": "^64.3.5", "eslint-plugin-no-jquery": "^6.0.0", - "globals": "^17.11.0" + "globals": "^17.12.0" }, "engines": { "node": ">=22.13.0" @@ -1255,9 +1255,9 @@ } }, "node_modules/globals": { - "version": "17.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-17.11.0.tgz", - "integrity": "sha512-Z2I8hM+PbJDXQDq3Icgpzv+mPdwr68iZUU9d5WW4FuXfDUQfkZaZuvjMv42/5crNyw154+9+VWXbYrUgDXbxNw==", + "version": "17.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.12.0.tgz", + "integrity": "sha512-cezEd/DTyyht9cvSSURyygXPfy04GtWO/5e6ZPvH7fCtjKz9PYOmuawphw1Ctd1f6C+5JypXfGD7ahNMXvevBA==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 489278a33176..48a17bbc698a 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,6 @@ "eslint": "^10.9.1", "eslint-plugin-jsdoc": "^64.3.5", "eslint-plugin-no-jquery": "^6.0.0", - "globals": "^17.11.0" + "globals": "^17.12.0" } } From d122970e5d3f922752c17676b0c8119875eca0e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Sep 2026 10:16:11 -0400 Subject: [PATCH 29/90] Bump phpstan/phpstan from 2.2.9 to 2.2.13 (#5628) Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan-phar-composer-source) from 2.2.9 to 2.2.13. - [Commits](https://github.com/phpstan/phpstan-phar-composer-source/commits) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-version: 2.2.13 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- composer.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index d897eed5404c..92299b240e34 100644 --- a/composer.json +++ b/composer.json @@ -128,7 +128,7 @@ "dmore/chrome-mink-driver": "2.10.0", "friendsofphp/php-cs-fixer": "3.95.23", "phpmd/phpmd": "2.15.0", - "phpstan/phpstan": "2.2.9", + "phpstan/phpstan": "2.2.13", "phpunit/php-code-coverage": "^11", "phpunit/phpcov": "^10", "phpunit/phpunit": "11.5.56", diff --git a/composer.lock b/composer.lock index 10ab5e34b0ca..56e781d91a61 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7bbfce44f51506a17f8c5d13bdd6d1ad", + "content-hash": "263109bf5077212c29ceb9fdee71dd71", "packages": [ { "name": "ahand/mobileesp", @@ -12994,11 +12994,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.2.9", + "version": "2.2.13", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/13d6b4f347bad222da436580c8304fa6f83e6bd0", - "reference": "13d6b4f347bad222da436580c8304fa6f83e6bd0", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9ba9ac76ee9c5cf5b56d58eb5deec6315b7a0260", + "reference": "9ba9ac76ee9c5cf5b56d58eb5deec6315b7a0260", "shasum": "" }, "require": { @@ -13054,7 +13054,7 @@ "type": "github" } ], - "time": "2026-08-22T07:38:16+00:00" + "time": "2026-09-03T20:38:19+00:00" }, { "name": "phpunit/php-code-coverage", From 0dd88d7487ba47cac7a43d5b9f1b9bfabd87a853 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Sep 2026 10:23:24 -0400 Subject: [PATCH 30/90] Bump friendsofphp/php-cs-fixer from 3.95.23 to 3.95.24 (#5625) Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.95.23 to 3.95.24. - [Release notes](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases) - [Changelog](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/CHANGELOG.md) - [Commits](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.95.23...v3.95.24) --- updated-dependencies: - dependency-name: friendsofphp/php-cs-fixer dependency-version: 3.95.24 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 92299b240e34..023947fa967b 100644 --- a/composer.json +++ b/composer.json @@ -126,7 +126,7 @@ "behat/mink": "1.13.0", "behat/mink-selenium2-driver": "1.7.0", "dmore/chrome-mink-driver": "2.10.0", - "friendsofphp/php-cs-fixer": "3.95.23", + "friendsofphp/php-cs-fixer": "3.95.24", "phpmd/phpmd": "2.15.0", "phpstan/phpstan": "2.2.13", "phpunit/php-code-coverage": "^11", diff --git a/composer.lock b/composer.lock index 56e781d91a61..d2a2a60a9342 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "263109bf5077212c29ceb9fdee71dd71", + "content-hash": "2bc2ecac48e2294f4594679cbc6dc6f2", "packages": [ { "name": "ahand/mobileesp", @@ -12563,16 +12563,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.95.23", + "version": "v3.95.24", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "b2932a5af3157a0c28324b1efe5e3b556dee09c4" + "reference": "9a4b8050f8768646bf3693ee7416978ceeca6206" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/b2932a5af3157a0c28324b1efe5e3b556dee09c4", - "reference": "b2932a5af3157a0c28324b1efe5e3b556dee09c4", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/9a4b8050f8768646bf3693ee7416978ceeca6206", + "reference": "9a4b8050f8768646bf3693ee7416978ceeca6206", "shasum": "" }, "require": { @@ -12655,7 +12655,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.95.23" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.95.24" }, "funding": [ { @@ -12663,7 +12663,7 @@ "type": "github" } ], - "time": "2026-08-26T19:54:54+00:00" + "time": "2026-08-31T15:31:12+00:00" }, { "name": "instaclick/php-webdriver", From 4d7f3e4e2da3f91085f0c3fb81dc9e7496ad85f2 Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Tue, 8 Sep 2026 10:37:36 -0400 Subject: [PATCH 31/90] Use config array instead of object for Relais view helper (#5623) --- module/VuFind/src/VuFind/View/Helper/Root/Relais.php | 7 +++---- .../VuFind/src/VuFind/View/Helper/Root/RelaisFactory.php | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/module/VuFind/src/VuFind/View/Helper/Root/Relais.php b/module/VuFind/src/VuFind/View/Helper/Root/Relais.php index 33808b45465f..0d948e2d87ec 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/Relais.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/Relais.php @@ -30,7 +30,6 @@ namespace VuFind\View\Helper\Root; use Laminas\View\Renderer\RendererInterface; -use VuFind\Config\Config; use VuFind\RecordDriver\AbstractBase as RecordDriver; /** @@ -53,7 +52,7 @@ class Relais * @param TransEsc $transEsc TransEsc view helper */ public function __construct( - protected ?Config $config, + protected ?array $config, protected string $loginUrl, protected RendererInterface $view, protected TransEsc $transEsc @@ -98,11 +97,11 @@ public function getSearchLink($driver) public function renderButtonIfActive($driver = null) { // Case 1: API enabled: - if ($this->config->apikey ?? false) { + if ($this->config['apikey'] ?? false) { return $this->view->render('relais/button.phtml'); } // Case 2: Search links enabled: - if ($this->config->loginUrl ?? false && $driver) { + if (($this->config['loginUrl'] ?? false) && $driver) { return '' . ($this->transEsc)('relais_search') . ''; diff --git a/module/VuFind/src/VuFind/View/Helper/Root/RelaisFactory.php b/module/VuFind/src/VuFind/View/Helper/Root/RelaisFactory.php index 8c18633d8dd5..823cd25f47a7 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/RelaisFactory.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/RelaisFactory.php @@ -69,11 +69,11 @@ public function __invoke( if (!empty($options)) { throw new \Exception('Unexpected options passed to factory.'); } - $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'); + $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'); $urlHelper = $container->get('ViewHelperManager')->get('url'); $loginUrl = $urlHelper('relais-login'); return new $requestedName( - $config->Relais ?? null, + $config['Relais'] ?? null, $loginUrl, $container->get(RendererInterface::class), $container->get('ViewHelperManager')->get(TransEsc::class) From c33c539a8b730983cac4fd1c7def770921d91f74 Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Tue, 8 Sep 2026 11:36:50 -0400 Subject: [PATCH 32/90] Use config array instead of object for CSP header generator (#5622) --- .../VuFind/Security/CspHeaderGenerator.php | 12 +-- .../Security/CspHeaderGeneratorFactory.php | 2 +- .../Security/CspHeaderGeneratorTest.php | 8 +- .../VuFindTest/View/Helper/Root/CspTest.php | 80 +++++++++---------- 4 files changed, 43 insertions(+), 59 deletions(-) diff --git a/module/VuFind/src/VuFind/Security/CspHeaderGenerator.php b/module/VuFind/src/VuFind/Security/CspHeaderGenerator.php index 0ab81e8078b6..27a11aa510f2 100644 --- a/module/VuFind/src/VuFind/Security/CspHeaderGenerator.php +++ b/module/VuFind/src/VuFind/Security/CspHeaderGenerator.php @@ -53,13 +53,6 @@ class CspHeaderGenerator implements { use \VuFind\Log\LoggerAwareTrait; - /** - * Configuration for generator from contensecuritypolicy.ini. - * - * @var array - */ - protected $config; - /** * Generated nonce used for one request. * @@ -77,13 +70,12 @@ class CspHeaderGenerator implements /** * CspHeaderGenerator constructor. * - * @param \VuFind\Config\Config $config Configuration + * @param array $config Configuration * @param \VuFind\Security\NonceGenerator $nonceGenerator Nonce generator */ - public function __construct($config, $nonceGenerator) + public function __construct(protected array $config, $nonceGenerator) { $this->nonce = $nonceGenerator->getNonce(); - $this->config = $config->toArray(); } /** diff --git a/module/VuFind/src/VuFind/Security/CspHeaderGeneratorFactory.php b/module/VuFind/src/VuFind/Security/CspHeaderGeneratorFactory.php index 518dfeb3ee5b..05f6ed7993c7 100644 --- a/module/VuFind/src/VuFind/Security/CspHeaderGeneratorFactory.php +++ b/module/VuFind/src/VuFind/Security/CspHeaderGeneratorFactory.php @@ -69,7 +69,7 @@ public function __invoke( throw new \Exception('Unexpected options passed to factory.'); } $config = $container->get(\VuFind\Config\ConfigManagerInterface::class) - ->getConfigObject('contentsecuritypolicy'); + ->getConfigArray('contentsecuritypolicy'); $nonceGenerator = $container->get(NonceGenerator::class); return new $requestedName($config, $nonceGenerator); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Security/CspHeaderGeneratorTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Security/CspHeaderGeneratorTest.php index 6d1096c80bda..b91126d42561 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Security/CspHeaderGeneratorTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Security/CspHeaderGeneratorTest.php @@ -168,14 +168,12 @@ public function testNetworkErrorLoggingHeaderFalsyValues(): void /** * Build the CspHeaderGenerator object. * - * @param array $configData The contentsecuritypolicy.ini config data as an array + * @param array $config The contentsecuritypolicy.ini config data as an array * * @return CspHeaderGenerator */ - protected function buildGenerator($configData) + protected function buildGenerator(array $config): CspHeaderGenerator { - $config = new \VuFind\Config\Config($configData); - $generator = new CspHeaderGenerator($config, $this->createStub(\VuFind\Security\NonceGenerator::class)); - return $generator; + return new CspHeaderGenerator($config, $this->createStub(\VuFind\Security\NonceGenerator::class)); } } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/CspTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/CspTest.php index 9e15f824c0de..0986a8ccd601 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/CspTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/CspTest.php @@ -47,23 +47,21 @@ class CspTest extends \PHPUnit\Framework\TestCase */ public function testDisablePolicyWithCspEnabled(): void { - $config = new \VuFind\Config\Config( - [ - 'CSP' => [ - 'use_nonce' => true, - 'enabled' => [ - 'development' => true, - 'production' => true, - 'testing' => true, - ], + $config = [ + 'CSP' => [ + 'use_nonce' => true, + 'enabled' => [ + 'development' => true, + 'production' => true, + 'testing' => true, ], - 'Directives' => [ - 'script-src' => [ - "'unsafe-inline'", - ], + ], + 'Directives' => [ + 'script-src' => [ + "'unsafe-inline'", ], - ] - ); + ], + ]; $nonceGenerator = new \VuFind\Security\NonceGenerator(); $cspHeaderGenerator = new \VuFind\Security\CspHeaderGenerator($config, $nonceGenerator); @@ -91,21 +89,19 @@ public function testDisablePolicyWithCspEnabled(): void */ public function testDisablePolicyWithCspReportOnly(): void { - $config = new \VuFind\Config\Config( - [ - 'CSP' => [ - 'use_nonce' => true, - 'enabled' => [ - 'testing' => 'report_only', - ], + $config = [ + 'CSP' => [ + 'use_nonce' => true, + 'enabled' => [ + 'testing' => 'report_only', ], - 'Directives' => [ - 'script-src' => [ - "'unsafe-inline'", - ], + ], + 'Directives' => [ + 'script-src' => [ + "'unsafe-inline'", ], - ] - ); + ], + ]; $nonceGenerator = new \VuFind\Security\NonceGenerator(); $cspHeaderGenerator = new \VuFind\Security\CspHeaderGenerator($config, $nonceGenerator); @@ -133,23 +129,21 @@ public function testDisablePolicyWithCspReportOnly(): void */ public function testDisablePolicyWithCspDisabled(): void { - $config = new \VuFind\Config\Config( - [ - 'CSP' => [ - 'use_nonce' => true, - 'enabled' => [ - 'development' => false, - 'production' => false, - 'testing' => false, - ], + $config = [ + 'CSP' => [ + 'use_nonce' => true, + 'enabled' => [ + 'development' => false, + 'production' => false, + 'testing' => false, ], - 'Directives' => [ - 'script-src' => [ - "'unsafe-inline'", - ], + ], + 'Directives' => [ + 'script-src' => [ + "'unsafe-inline'", ], - ] - ); + ], + ]; $nonceGenerator = new \VuFind\Security\NonceGenerator(); $cspHeaderGenerator = new \VuFind\Security\CspHeaderGenerator($config, $nonceGenerator); From d949534dd3b40f7660fe0dbba8f75aa9be2ed5dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Sep 2026 12:58:51 -0400 Subject: [PATCH 33/90] Bump monolog/monolog from 3.10.0 to 3.11.0 (#5627) Bumps [monolog/monolog](https://github.com/Seldaek/monolog) from 3.10.0 to 3.11.0. - [Release notes](https://github.com/Seldaek/monolog/releases) - [Changelog](https://github.com/Seldaek/monolog/blob/main/CHANGELOG.md) - [Commits](https://github.com/Seldaek/monolog/compare/3.10.0...3.11.0) --- updated-dependencies: - dependency-name: monolog/monolog dependency-version: 3.11.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index d2a2a60a9342..efdae8f346a9 100644 --- a/composer.lock +++ b/composer.lock @@ -6819,16 +6819,16 @@ }, { "name": "monolog/monolog", - "version": "3.10.0", + "version": "3.11.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0" + "reference": "147f303310f06334f03f409e49d7ad1e275ff05a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/b321dd6749f0bf7189444158a3ce785cc16d69b0", - "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/147f303310f06334f03f409e49d7ad1e275ff05a", + "reference": "147f303310f06334f03f409e49d7ad1e275ff05a", "shasum": "" }, "require": { @@ -6906,7 +6906,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.10.0" + "source": "https://github.com/Seldaek/monolog/tree/3.11.0" }, "funding": [ { @@ -6918,7 +6918,7 @@ "type": "tidelift" } ], - "time": "2026-01-02T08:56:05+00:00" + "time": "2026-09-02T12:39:56+00:00" }, { "name": "mpdf/mpdf", From 41ef08033c1881949c75da90f072b3e3264405a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Sep 2026 14:06:14 -0400 Subject: [PATCH 34/90] Bump libphonenumber-js from 1.13.8 to 1.13.11 (#5492) * Bump libphonenumber-js from 1.13.8 to 1.13.11 Bumps [libphonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js) from 1.13.8 to 1.13.11. - [Changelog](https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/CHANGELOG.md) - [Commits](https://gitlab.com/catamphetamine/libphonenumber-js/commits/v1.13.11) --- updated-dependencies: - dependency-name: libphonenumber-js dependency-version: 1.13.10 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update vendor files via copyUpdatedDeps --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] --- package-lock.json | 6 ++++-- themes/bootstrap5/js/vendor/libphonenumber.js | 2 +- themes/bootstrap5/package.json | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 40ea396a6a4a..c7bbec624372 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1410,7 +1410,9 @@ } }, "node_modules/libphonenumber-js": { - "version": "1.13.8", + "version": "1.13.11", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.13.11.tgz", + "integrity": "sha512-ETER2kMaIFTI/Nh1a8Gk03dUF/SL0VZqtI+CcVHZxp5WIHYwNS7S+uiYZDYCvLy3lOR4/DAD5jf0h5WkePPpqg==", "license": "MIT" }, "node_modules/locate-path": { @@ -1939,7 +1941,7 @@ "chart.js": "^4.4.0", "jquery": "^3.7.1", "js-cookie": "^3.0.7", - "libphonenumber-js": "^1.12.10", + "libphonenumber-js": "^1.13.11", "nouislider": "^15.8.1", "simple-keyboard": "^3.8.165", "simple-keyboard-layouts": "^3.4.239" diff --git a/themes/bootstrap5/js/vendor/libphonenumber.js b/themes/bootstrap5/js/vendor/libphonenumber.js index 35551eeb5ccf..84701a805e3a 100644 --- a/themes/bootstrap5/js/vendor/libphonenumber.js +++ b/themes/bootstrap5/js/vendor/libphonenumber.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).libphonenumber={})}(this,function(t){"use strict";var e={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[024-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:2[7-9]|3[3-7]|5[12]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-7]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]|50"]],["(\\d{8})","$1",["[5-7]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","8776\\d{4}|(?:[27]\\d|61)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-8]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,0,[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","(?:400|[5-9]\\d\\d)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[4-9]"]]]],ET:["251","00","(?:11|[2-57-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-57-9]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:694\\d|7093)\\d{5}|(?:59|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|80[6-9]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","[235]\\d{8}|800\\d{5,6}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2358]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|80[6-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:59(?:0(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31)|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:3171|5[15][2-6]|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|8(?:16|2[014]|3[126]|6[136]|7[78]|83)(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|3[129]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7(?:[23569]|8[0-57-9])|8[1-6])|7(?:1(?:[013-8]|9[6-9])|3(?:17|2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","8\\d{13}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["20"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["20"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{4})(\\d{5})","$1-$2",["892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8(?:0[0-7]|9)"],"0$1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[5-8]"],"0$1"]],"0",0,0,0,0,"[5-8]"],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["11|2[16]"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","7091\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-37-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[78]\\d{8}|[2-9]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["3[289]|4[246-8]|61|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["2631[0-6]\\d{4}|26(?:2\\d|30|88)\\d{5}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"[3489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[013]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|9[2-9]"]],["(\\d)(\\d{7})","$1 $2",["[267]|904"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[346-9]"]]],"0"],SR:["597","00","(?:[2-5]|[6-9]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[3689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[0-79]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["826"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["83"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["82"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[25]0|37|49|8[09]"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-478])|7[1-9]","[23568]|4(?:0[2-48]|[1-478])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:472[2-47-9]|983[2-57-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[02469]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-2478]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{6,7}|7\\d{6}",[7,8,9,10],[["(\\d{4})(\\d{4,6})","$1 $2",["1(?:2[02]|[89])"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[26]|6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:639\\d|7093)\\d{5}|(?:26|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["26(?:89\\d|9(?:0[0-467]|15|5[0-4]|6\\d|[78]0))\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|5[12]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|5(?:0\\d{3}|2[0-2]))\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function n(t,n){var r=Array.prototype.slice.call(n);return r.push(e),t.apply(this,r)}function r(t,e){t=t.split("-"),e=e.split("-");for(var n=t[0].split("."),r=e[0].split("."),d=0;d<3;d++){var i=Number(n[d]),o=Number(r[d]);if(i>o)return 1;if(o>i)return-1;if(!isNaN(i)&&isNaN(o))return 1;if(isNaN(i)&&!isNaN(o))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]o)return"TOO_SHORT";if(i[i.length-1]=0?"IS_POSSIBLE":"INVALID_LENGTH"}(t,void 0,e,n)}function w(t,e,n){void 0===e&&(e={});var r=new s(n);if(e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.country||t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.selectNumberingPlan(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.countryCallingCode)}}if(r.possibleLengths())return x(t.phone||t.nationalNumber,r);if(t.countryCallingCode&&r.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function x(t,e){return"IS_POSSIBLE"===S(t,void 0,e)}function O(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function E(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return T(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(t,e):void 0}}(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=0}(e,t,n)}):[]}var M="0-90-9٠-٩۰-۹",_="  ­​⁠ ",L="".concat("-‐-―−ー-").concat("//").concat("..").concat(_).concat("()()[]\\[\\]").concat("~⁓∼~"),G="++",B=new RegExp("(["+M+"])");function U(t,e,n,r){if(e){var d=new s(r);d.selectNumberingPlan(e||n);var i=new RegExp(d.IDDPrefix());if(0===t.search(i)){var o=(t=t.slice(t.match(i)[0].length)).match(B);if(!(o&&null!=o[1]&&o[1].length>0&&"0"===o[1]))return t}}}function H(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(t);if(r){var d,i,o,a=r.length-1,u=a>0&&r[a];if(e.nationalPrefixTransformRule()&&u)d=t.replace(n,e.nationalPrefixTransformRule()),a>1&&(i=r[1]);else{var $=r[0];d=t.slice($.length),u&&(i=r[1])}if(u){var l=t.indexOf(r[1]);t.slice(0,l)===e.numberingPlan.nationalPrefix()&&(o=e.numberingPlan.nationalPrefix())}else o=r[0];return{nationalNumber:d,nationalPrefix:o,carrierCode:i}}}return{nationalNumber:t}}function V(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return W(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?W(t,e):void 0}}(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function W(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=2&&at.test(t)}function $t(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,d,i,o,a=[],u=!0,$=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){$=!0,d=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if($)throw d}}return a}}(t,e)||lt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(t,e){if(t){if("string"==typeof t)return ct(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ct(t,e):void 0}}function ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0){var n=t.leadingDigitsPatterns()[t.leadingDigitsPatterns().length-1];if(0!==e.search(n))return!1}return O(e,t.pattern())})}function pt(t,e,n,r){return e?r(t,e,n):t}function gt(t){return gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gt(t)}function bt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function vt(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=t.length)return"";var r=t.indexOf(";",n);return r>=0?t.substring(n,r):t.substring(n)}(t);if(!function(t){return null===t||0!==t.length&&(Vt.test(t)||Wt.test(t))}(d))throw new jt("NOT_A_NUMBER");if(null===d)n=r(t)||"";else{n="","+"===d.charAt(0)&&(n+=d);var i,o=t.indexOf(Kt);i=o>=0?o+4:0;var a=t.indexOf(Yt);n+=t.substring(i,a)}var u=n.indexOf(";isub=");if(u>0&&(n=n.substring(0,u)),""!==n)return n}var Xt=new RegExp("[++"+M+"]"),Jt=new RegExp("[^"+M+"#]+$");function Qt(t,e,n){e=e||{};var r=new s(n);if(e.defaultCountry&&!r.hasCountry(e.defaultCountry)){if(e.v2)throw new jt("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(e.defaultCountry))}var d=function(t,e,n){var r=Zt(t,{extractFormattedPhoneNumber:function(t){return function(t,e,n){if(!t)return;if(t.length>250){if(n)throw new jt("TOO_LONG");return}if(!1===e)return t;var r=t.search(Xt);if(r<0)return;return t.slice(r).replace(Jt,"")}(t,n,e)}});if(!r)return{};if(!ut(r))return function(t){return it.test(t)}(r)?{error:"TOO_SHORT"}:{};var d=function(t){var e=t.search(kt);if(e<0)return{};for(var n=t.slice(0,e),r=t.match(kt),d=1;d17){if(e.v2)throw new jt("TOO_LONG");return{}}if(e.v2){var m=new St(c,l,r.metadata);return $&&(m.country=$),h&&(m.carrierCode=h),o&&(m.ext=o),m.__countryCallingCodeSource=f,m}var y=!!(e.extended?r.hasSelectedNumberingPlan():$)&&O(l,r.nationalNumberPattern());return e.extended?{country:$,countryCallingCode:c,carrierCode:h,valid:y,possible:!!y||!(!0!==e.extended||!r.possibleLengths()||!x(l,r)),phone:l,ext:o}:y?function(t,e,n){var r={country:t,phone:e};n&&(r.ext=n);return r}($,l,o):{}}function zt(t){return zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(t)}function qt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function te(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;Fe(this,t),this.key=e,this.value=n,this.next=r,this.prev=d}),De=function(){return je(function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;Fe(this,t),this.size=0,this.limit=e,this.head=null,this.tail=null,this.cache={}},[{key:"put",value:function(t,e){if(this.ensureLimit(),this.head){var n=new Re(t,e,this.head);this.head.prev=n,this.head=n}else this.head=this.tail=new Re(t,e);this.cache[t]=this.head,this.size++}},{key:"get",value:function(t){if(this.cache[t]){var e=this.cache[t].value;return this.remove(t),this.put(t,e),e}console.log("Item not available in cache for key ".concat(t))}},{key:"ensureLimit",value:function(){this.size===this.limit&&this.remove(this.tail.key)}},{key:"remove",value:function(t){var e=this.cache[t];null!==e.prev?e.prev.next=e.next:this.head=e.next,null!==e.next?e.next.prev=e.prev:this.tail=e.prev,delete this.cache[t],this.size--}},{key:"clear",value:function(){this.head=null,this.tail=null,this.size=0,this.cache={}}}])}();function Me(t){return Me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Me(t)}function _e(t,e,n){return e&&function(t,e){for(var n=0;n=0?e.slice(0,n):e}var He="   ᠎ - \u2028\u2029   ",Ve="[".concat(He,"]"),We="[^".concat(He,"]"),Ke="[".concat("0-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9","]"),Ye="A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Ze="[".concat(Ye,"]"),Xe=new RegExp(Ze),Je="[".concat("$¢-¥֏؋৲৳৻૱௹฿៛₠-₹꠸﷼﹩$¢£¥₩","]"),Qe=new RegExp(Je),ze="[".concat("̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ࣾऀ-ंऺ़ु-ै्॑-ॗॢॣঁ়ু-ৄ্ৢৣਁਂ਼ੁੂੇੈੋ-੍ੑੰੱੵઁં઼ુ-ૅેૈ્ૢૣଁ଼ିୁ-ୄ୍ୖୢୣஂீ்ా-ీె-ైొ-్ౕౖౢౣ಼ಿೆೌ್ೢೣു-ൄ്ൢൣ්ි-ුූัิ-ฺ็-๎ັິ-ູົຼ່-ໍཱ༹༘༙༵༷-ཾྀ-྄྆྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္်ွှၘၙၞ-ၠၱ-ၴႂႅႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧᤨᤲ᤹-᤻ᨘᨗᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀᮁᮢ-ᮥᮨᮩ᯦᮫ᯨᯩᯭᯯ-ᯱᰬ-ᰳᰶ᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᷀-ᷦ᷼-᷿⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〭꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠥꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꨩ-ꨮꨱꨲꨵꨶꩃꩌꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫬꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-︦","]"),qe=new RegExp(ze),tn=new RegExp("[\0-€-ÿĀ-ſḀ-ỿƀ-ɏ̀-ͯ]");function en(t){return!(!Xe.test(t)&&!qe.test(t))&&tn.test(t)}function nn(t){return"%"===t||Qe.test(t)}function rn(t,e,n){var r=!0,d=me(t,n);if(d||(r=!1,d=me(t,{defaultCallingCode:e.countryCallingCode},n)),!d)return"INVALID_NUMBER";if(e.ext){if(d.ext!==e.ext)return"NO_MATCH"}else if(d.ext)return"NO_MATCH";return r&&e.countryCallingCode!==d.countryCallingCode?"NO_MATCH":e.number===d.number?r?"EXACT_MATCH":"NSN_MATCH":0===e.nationalNumber.indexOf(d.nationalNumber)||0===d.nationalNumber.indexOf(e.nationalNumber)?"SHORT_NSN_MATCH":"NO_MATCH"}var dn={POSSIBLE:function(t,e){return e.candidate,e.metadata,!0},VALID:function(t,e){var n=e.candidate;e.defaultCountry;var r=e.metadata;return!(!t.isValid()||!on(t,n,r))},STRICT_GROUPING:function(t,e){var n=e.candidate,r=e.defaultCountry,d=e.metadata;return e.regExpCache,!(!t.isValid()||!on(t,n,d)||un(t,n)||!an(t,{defaultCountry:r,metadata:d}))&&$n()},EXACT_GROUPING:function(t,e){var n=e.candidate,r=e.defaultCountry,d=e.metadata;return e.regExpCache,!(!t.isValid()||!on(t,n,d)||un(t,n)||!an(t,{defaultCountry:r,metadata:d}))&&$n()}};function on(t,e,n){for(var r=0;r=0)}function $n(t,e,n,r,d){throw new Error("This part of code hasn't been ported")}var ln=/[\\/] *x/;function cn(t){return Ue(ln,t)}var sn=/(?:(?:[0-3]?\d\/[01]?\d)|(?:[01]?\d\/[0-3]?\d))\/(?:[12]\d)?\d{2}/,fn=/[12]\d{3}[-/]?[01]\d[-/]?[0-3]\d +[0-2]\d$/,hn=/^:[0-5]\d/;function mn(t,e,n){if(sn.test(t))return!1;if(fn.test(t)){var r=n.slice(e+t.length);if(hn.test(r))return!1}return!0}var yn="(\\[([",pn=")\\])]",gn="[^".concat(yn).concat(pn,"]"),bn="[".concat(yn).concat(G,"]"),vn=new RegExp("^"+bn),Cn=Be(0,3),Nn=new RegExp("^(?:[(\\[([])?(?:"+gn+"+["+pn+"])?"+gn+"+(?:["+yn+"]"+gn+"+["+pn+"])"+Cn+gn+"*$"),Pn=/\d{1,5}-+\d{1,5}\s{0,4}\(\d{1,4}/;function Sn(t,e,n,r){if(Nn.test(t)&&!Pn.test(t)){if("POSSIBLE"!==r){if(e>0&&!vn.test(t)){var d=n[e-1];if(nn(d)||en(d))return!1}var i=e+t.length;if(i=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function On(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n={v2:n.v2,defaultCallingCode:n.defaultCallingCode,defaultCountry:n.defaultCountry&&N(n.defaultCountry,r)?n.defaultCountry:void 0,leniency:n.leniency||(n.extended?"POSSIBLE":"VALID"),maxTries:n.maxTries||Ln},!dn[n.leniency])throw new TypeError('Unknown leniency: "'.concat(n.leniency,'"'));if("POSSIBLE"!==n.leniency&&"VALID"!==n.leniency)throw new TypeError('Invalid `leniency`: "'.concat(n.leniency,'". Supported values: "POSSIBLE", "VALID".'));if(n.maxTries<0)throw new TypeError("`maxTries` must be `>= 0`");this.text=e,this.options=n,this.metadata=r,this.leniency=dn[n.leniency],this.maxTries=n.maxTries,this.PATTERN=new RegExp(Mn,"ig"),this.INNER_MATCHES=An.map(function(t){return new RegExp(t,"g")}),this.state="NOT_READY",this.searchIndex=0,this.regExpCache=new Ge(32)},[{key:"find",value:function(t){var e;for(this.PATTERN.lastIndex=t;this.maxTries>0&&null!==(e=this.PATTERN.exec(this.text));){var n=e[0],r=e.index;if(mn(n=cn(n),r,this.text)){var d=this.parseAndVerify(n,r,this.text)||this.extractInnerMatch(n,r,this.text);if(d){if(this.options.v2)return{startsAt:d.startsAt,endsAt:d.endsAt,number:d.phoneNumber};var i=d.phoneNumber,o={startsAt:d.startsAt,endsAt:d.endsAt,phone:i.nationalNumber};return i.country?o.country=i.country:o.countryCallingCode=i.countryCallingCode,i.ext&&(o.ext=i.ext),o}}this.maxTries--}}},{key:"extractInnerMatch",value:function(t,e,n){for(var r,d=xn(this.INNER_MATCHES);!(r=d()).done;){var i=r.value;i.lastIndex=0;for(var o=!0,a=void 0;this.maxTries>0&&null!==(a=i.exec(t));){if(o){var u=Ue(_n,t.slice(0,a.index)),$=this.parseAndVerify(u,e,n);if($)return $;this.maxTries--,o=!1}var l=Ue(_n,a[1]),c=t.indexOf(l,a.index),s=this.parseAndVerify(l,e+c,n);if(s)return s;this.maxTries--}}}},{key:"parseAndVerify",value:function(t,e,n){if(Sn(t,e,n,this.options.leniency)){var r=me(t,{extended:!0,defaultCountry:this.options.defaultCountry,defaultCallingCode:this.options.defaultCallingCode},this.metadata);if(r&&r.isPossible())return this.leniency(r,{candidate:t,defaultCountry:this.options.defaultCountry,metadata:this.metadata,regExpCache:this.regExpCache})?{startsAt:e,endsAt:e+t.length,phoneNumber:r}:void 0}}},{key:"hasNext",value:function(){return"NOT_READY"===this.state&&(this.lastMatch=this.find(this.searchIndex),this.lastMatch?(this.searchIndex=this.lastMatch.endsAt,this.state="READY"):this.state="DONE"),"READY"===this.state}},{key:"next",value:function(){if(!this.hasNext())throw new Error("No next element");var t=this.lastMatch;return this.lastMatch=null,this.state="NOT_READY",t}}])}();function Bn(){for(var t=ue(arguments),e=t.text,n=t.options,r=t.metadata,d=new Gn(e,n,r),i=[];d.hasNext();)i.push(d.next());return i}function Un(t){return Un="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Un(t)}function Hn(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=Un(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=Un(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Un(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vn(){var t=ue(arguments),e=t.text,n=t.options,r=t.metadata,d=new Gn(e,n,r);return Hn({},Symbol.iterator,function(){return{next:function(){return d.hasNext()?{done:!1,value:d.next()}:{done:!0}}}})}function Wn(t){return Wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wn(t)}function Kn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Yn(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function or(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n1;)1&e&&(n+=t),e>>=1,t+=t;return n+t}function lr(t,e){return")"===t[e]&&e++,function(t){var e=[],n=0;for(;n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Nr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n1&&void 0!==arguments[1]?arguments[1]:{}).allowOverflow;if(!t)throw new Error("String is required");var n=Or(t.split(""),this.matchTree,!0);if(n&&n.match&&delete n.matchedChars,!n||!n.overflow||e)return n}}])}();function Or(t,e,n){if("string"==typeof e){var r=t.join("");return 0===e.indexOf(r)?t.length===e.length?{match:!0,matchedChars:t}:{partialMatch:!0}:0===r.indexOf(e)?n&&t.length>e.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,e.length)}:void 0}if(Array.isArray(e)){for(var d=t.slice(),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ir(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=0)){var n=this.getTemplateForFormat(t,e);return n?(this.setNationalNumberTemplate(n,e),!0):void 0}}},{key:"getSeparatorAfterNationalPrefix",value:function(t){return this.isNANP||t&&t.nationalPrefixFormattingRule()&&Fr.test(t.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(t,e){var n=t.IDDPrefix,r=t.missingPlus;return n?e&&!1===e.spacing?n:n+" ":r?"":"+"}},{key:"getTemplate",value:function(t){if(this.template){for(var e=-1,n=0,r=t.international?this.getInternationalPrefixBeforeCountryCallingCode(t,{spacing:!1}):"";na.length)){var u=new RegExp("^"+o+"$"),$=n.replace(/\d/g,"9");u.test($)&&(a=$);var l,c=this.getFormatFormat(t,r);if(this.shouldTryNationalPrefixFormattingRule(t,{international:r,nationalPrefix:d})){var s=c.replace(z,t.nationalPrefixFormattingRule());if(_t(t.nationalPrefixFormattingRule())===(d||"")+_t("$1")&&(c=s,l=!0,d))for(var f=d.length;f>0;)c=c.replace(/\d/,ar),f--}var h=a.replace(new RegExp(o),c).replace(new RegExp("9","g"),ar);return l||(i?h=$r(ar,i.length)+" "+h:d&&(h=$r(ar,d.length)+this.getSeparatorAfterNationalPrefix(t)+h)),r&&(h=Q(h)),h}}},{key:"formatNextNationalNumberDigits",value:function(t){var e=function(t,e,n){for(var r,d=ir(n.split(""));!(r=d()).done;){var i=r.value;if(t.slice(e+1).search(ur)<0)return;e=t.search(ur),t=t.replace(ur,i)}return[t,e]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,t);if(e)return this.populatedNationalNumberTemplate=e[0],this.populatedNationalNumberTemplatePosition=e[1],lr(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1);this.resetFormat()}},{key:"shouldTryNationalPrefixFormattingRule",value:function(t,e){var n=e.international,r=e.nationalPrefix;if(t.nationalPrefixFormattingRule()){var d=t.usesNationalPrefix();if(d&&r||!d&&!n)return!0}}}])}();function Mr(t){return Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mr(t)}function _r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,d,i,o,a=[],u=!0,$=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){$=!0,d=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if($)throw d}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Lr(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lr(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=3;if(e.appendDigits(t),r&&this.extractIddPrefix(e),this.isWaitingForCountryCallingCode(e)){if(!this.extractCountryCallingCode(e))return}else e.appendNationalSignificantNumberDigits(t);e.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(e.getNationalDigits(),function(t){return e.update(t)})}},{key:"isWaitingForCountryCallingCode",value:function(t){var e=t.international,n=t.callingCode;return e&&!n}},{key:"extractCountryCallingCode",value:function(t){var e=J("+"+t.getDigitsWithoutInternationalPrefix(),t.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),n=e.countryCallingCode,r=e.number;if(n)return t.setCallingCode(n),t.update({nationalSignificantNumber:r}),!0}},{key:"reset",value:function(t){if(t){this.hasSelectedNumberingPlan=!0;var e=t._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=e&&Wr.test(e)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(t,e){if(this.hasSelectedNumberingPlan){var n=H(t,this.metadata),r=n.nationalPrefix,d=n.nationalNumber,i=n.carrierCode;if(d!==t)return this.onExtractedNationalNumber(r,i,d,t,e),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(t,e,n){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(t,n);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var r=H(t,this.metadata),d=r.nationalPrefix,i=r.nationalNumber,o=r.carrierCode;if(i!==e)return this.onExtractedNationalNumber(d,o,i,t,n),!0}}},{key:"onExtractedNationalNumber",value:function(t,e,n,r,d){var i,o=!1,a=r.lastIndexOf(n);if(a<0||a!==r.length-n.length)o=!0;else{var u=r.slice(0,a);u&&u!==t&&(i=u)}d({nationalPrefix:t,carrierCode:e,nationalSignificantNumber:n,nationalSignificantNumberIsModified:o,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:i}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(t){return!!this.extractAnotherNationalSignificantNumber(t.getNationalDigits(),t.nationalSignificantNumber,function(e){return t.update(e)})||(this.extractIddPrefix(t)||this.fixMissingPlus(t)?(this.extractCallingCodeAndNationalSignificantNumber(t),!0):void 0)}},{key:"extractIddPrefix",value:function(t){var e=t.international,n=t.IDDPrefix,r=t.digits;if(t.nationalSignificantNumber,!e&&!n){var d=U(r,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);return void 0!==d&&d!==r?(t.update({IDDPrefix:r.slice(0,r.length-d.length)}),this.startInternationalNumber(t,{country:void 0,callingCode:void 0}),!0):void 0}}},{key:"fixMissingPlus",value:function(t){if(!t.international){var e=X(t.digits,t.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata).countryCallingCode;if(e)return t.update({missingPlus:!0}),this.startInternationalNumber(t,{country:t.country,callingCode:e}),!0}}},{key:"startInternationalNumber",value:function(t,e){var n=e.country,r=e.callingCode;t.startInternationalNumber(n,r),t.nationalSignificantNumber&&(t.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(t){this.extractCountryCallingCode(t)&&this.extractNationalSignificantNumber(t.getNationalDigits(),function(e){return t.update(e)})}}])}();function Yr(t){return Yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yr(t)}function Zr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,d,i,o,a=[],u=!0,$=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){$=!0,d=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if($)throw d}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Xr(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xr(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n1}},{key:"determineTheCountry",value:function(){var t=Y(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata});t!==this.state.country&&(this.state.setCountry(t),t&&this.metadata.selectNumberingPlan(t))}},{key:"getNumberValue",value:function(){var t=this.state,e=t.digits,n=t.callingCode,r=t.country,d=t.nationalSignificantNumber;if(e)return this.isInternational()?n?"+"+n+d:"+"+e:r||n?"+"+(r?this.metadata.countryCallingCode():n)+d:void 0}},{key:"getNumber",value:function(){var t=this.state,e=t.nationalSignificantNumber,n=t.carrierCode,r=t.callingCode;if(e){var d=this._getCountry();if(d||r){if(d&&d===this.defaultCountry){var i=function(t,e,n){var r=n.getCountryCodesForCallingCode(t);if(r.length>1)return K(e,r,n.metadata)}(this.metadata.numberingPlan.callingCode(),e,this.metadata);i&&(d=i)}var o=new St(d||r,e,this.metadata.metadata);return n&&(o.carrierCode=n),o}}}},{key:"isPossible",value:function(){var t=this.getNumber();return!!t&&t.isPossible()}},{key:"isValid",value:function(){var t=this.getNumber();return!!t&&t.isValid()}},{key:"validateLength",value:function(){var t=this.state,e=t.digits,n=t.nationalSignificantNumber;if(!e)return"NOT_A_NUMBER";if(!this.metadata.numberingPlan)return"INVALID_COUNTRY";if(!n)return"TOO_SHORT";var r=S(n,void 0,this.metadata);return"IS_POSSIBLE"!==r?r:void 0}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}])}();function qr(t){return new s(t).getCountries()}function td(t,e,n){if(e[t])return new St(t,e[t],n)}function ed(t,e,n){return n||(n=e,e=void 0),new zr(e,n).input(t)}function nd(){return n($e,arguments)}function rd(t,n){return Gn.call(this,t,n,e)}function dd(t){return zr.call(this,t,e)}function id(){return n(C,arguments)}function od(){return s.call(this,e)}function ad(t){return St.call(this,t,e)}function ud(){var t=ue(arguments);return Qt(t.text,t.options,t.metadata)}function $d(){return n(ud,arguments)}function ld(){var t=function(t){var e,n,r,d,o=t[0],a=t[1],u=t[2],$=t[3],l=t[4];if("string"==typeof o)if("string"==typeof u)n=u,l?(r=$,d=l):d=$,e=Qt(o,{defaultCountry:a,extended:!0},d);else{if("string"!=typeof a)throw new Error("`format` argument not passed to `formatNumber(number, format)`");n=a,$?(r=u,d=$):d=u,e=Qt(o,{extended:!0},d)}else{if(!i(o))throw new TypeError("A phone number must either be a string or an object of shape { phone, [country] }.");e=o,n=a,$?(r=u,d=$):d=u}"International"===n?n="INTERNATIONAL":"National"===n&&(n="NATIONAL");return{input:e,format:n,options:r,metadata:d}}(arguments);return ht(t.input,t.format,t.options,t.metadata)}function cd(){return n(ld,arguments)}function sd(){var t=fd(arguments),e=t.input,n=t.options,r=t.metadata;if(e.phone)return A(e,n,r)}function fd(t){var e,n,r=t[0],d=t[1],o=t[2],a=t[3],u={};if("string"==typeof r)i(d)?(o?(u=d,n=o):n=d,e=ut(r)?Qt(r,void 0,n):{}):(a?(u=o,n=a):n=o,e=ut(r)?Qt(r,{defaultCountry:d},n):{});else{if(!i(r))throw new TypeError("A phone number must either be a string or an object of shape { phone, [country] }.");e=r,o?(u=d,n=o):n=d}return{input:e,options:u,metadata:n}}function hd(){var t=fd(arguments),e=t.input,n=t.options,r=t.metadata;return!!(e.phone||n&&n.v2)&&w(e,n,r)}function md(){var t=fd(arguments),e=t.input,n=t.options,r=t.metadata;return!!e.phone&&k(e,n,r)}function yd(t,e,n){if("string"!=typeof t)throw new TypeError("number must be a string");if("string"!=typeof e)throw new TypeError("country must be a string");return function(t,e,n,r){return n=n||{},t.country===e&&k(t,n,r)}(ut(t)?Qt(t,{defaultCountry:e},n):{},e,void 0,n)}function pd(t){return pd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pd(t)}function gd(t,e,n){return e&&function(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}((t=t.replace(/^tel:/,"tel=")).split(";"));!(r=d()).done;){var i=$t(r.value.split("="),2),o=i[0],a=i[1];switch(o){case"tel":e=a;break;case"ext":n=a;break;case"phone-context":"+"===a[0]&&(e=a+e)}}if(!ut(e))return{};var u={number:e};return n&&(u.ext=n),u},t.searchNumbers=function(){return n(Vn,arguments)},t.searchPhoneNumbers=function(){return n(Sd,arguments)},t.searchPhoneNumbersCustom=Sd,t.searchPhoneNumbersInText=function(){return n(tr,arguments)},t.validatePhoneNumberLength=function(){return n(Ie,arguments)}}); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).libphonenumber={})}(this,function(t){"use strict";var e={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[2-467])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[024-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:2[7-9]|3[3-7]|5[12]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-7]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]|50"]],["(\\d{8})","$1",["[5-7]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","8776\\d{4}|(?:[27]\\d|61)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-8]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,0,[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|3[01]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","(?:400|[5-9]\\d\\d)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[4-9]"]]]],ET:["251","00","(?:11|[2-57-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-57-9]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:694\\d|7093)\\d{5}|(?:59|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|80[6-9]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","[235]\\d{8}|800\\d{5,6}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2358]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[48]\\d{8}|[2-9]\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|4(?:[0-35]|4[16-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[48]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|80[6-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:59(?:0(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1(?:05|[2-9]))","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31)|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:3171|5[15][2-6]|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|8(?:16|2[014]|3[126]|6[136]|7[78]|83)(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|3[129]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7(?:[23569]|8[0-57-9])|8[1-6])|7(?:1(?:[013-8]|9[6-9])|3(?:17|2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","8\\d{13}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["20"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["20"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{4})(\\d{5})","$1-$2",["892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8(?:0[0-7]|9)"],"0$1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[5-8]"],"0$1"]],"0",0,0,0,0,"[5-8]"],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["11|2[16]"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","7091\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-37-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[78]\\d{8}|[2-9]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["3[289]|4[246-8]|61|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["2631[0-6]\\d{4}|26(?:2\\d|30|88)\\d{5}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"[3489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[013]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|9[2-9]"]],["(\\d)(\\d{7})","$1 $2",["[267]|904"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[346-9]"]]],"0"],SR:["597","00","(?:[2-5]|[6-9]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[3689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["826"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["83"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["82"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[25]0|37|49|8[09]"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-478])|7[1-9]","[23568]|4(?:0[2-48]|[1-478])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024","20240"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["20[0-35-7]|4(?:6[45]|[7-9])|[7-9]","20(?:[0135-7]|2[5-9])|4(?:6[45]|[7-9])|[7-9]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[2-4]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:472[2-47-9]|983[2-57-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[02469]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-2478]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{6,7}|7\\d{6}",[7,8,9,10],[["(\\d{4})(\\d{4,6})","$1 $2",["1(?:2[02]|[89])"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[26]|6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:639\\d|7093)\\d{5}|(?:26|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["26(?:89\\d|9(?:0[0-467]|15|5[0-4]|6\\d|[78]0))\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|5[12]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|5(?:0\\d{3}|2[0-2]))\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function n(t,n){var r=Array.prototype.slice.call(n);return r.push(e),t.apply(this,r)}function r(t,e){t=t.split("-"),e=e.split("-");for(var n=t[0].split("."),r=e[0].split("."),d=0;d<3;d++){var i=Number(n[d]),o=Number(r[d]);if(i>o)return 1;if(o>i)return-1;if(!isNaN(i)&&isNaN(o))return 1;if(isNaN(i)&&!isNaN(o))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]o)return"TOO_SHORT";if(i[i.length-1]=0?"IS_POSSIBLE":"INVALID_LENGTH"}(t,void 0,e,n)}function w(t,e,n){void 0===e&&(e={});var r=new s(n);if(e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.country||t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.selectNumberingPlan(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.countryCallingCode)}}if(r.possibleLengths())return x(t.phone||t.nationalNumber,r);if(t.countryCallingCode&&r.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function x(t,e){return"IS_POSSIBLE"===S(t,void 0,e)}function O(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function E(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return T(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(t,e):void 0}}(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=0}(e,t,n)}):[]}var M="0-90-9٠-٩۰-۹",_="  ­​⁠ ",L="".concat("-‐-―−ー-").concat("//").concat("..").concat(_).concat("()()[]\\[\\]").concat("~⁓∼~"),G="++",B=new RegExp("(["+M+"])");function U(t,e,n,r){if(e){var d=new s(r);d.selectNumberingPlan(e||n);var i=new RegExp(d.IDDPrefix());if(0===t.search(i)){var o=(t=t.slice(t.match(i)[0].length)).match(B);if(!(o&&null!=o[1]&&o[1].length>0&&"0"===o[1]))return t}}}function H(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(t);if(r){var d,i,o,a=r.length-1,u=a>0&&r[a];if(e.nationalPrefixTransformRule()&&u)d=t.replace(n,e.nationalPrefixTransformRule()),a>1&&(i=r[1]);else{var $=r[0];d=t.slice($.length),u&&(i=r[1])}if(u){var l=t.indexOf(r[1]);t.slice(0,l)===e.numberingPlan.nationalPrefix()&&(o=e.numberingPlan.nationalPrefix())}else o=r[0];return{nationalNumber:d,nationalPrefix:o,carrierCode:i}}}return{nationalNumber:t}}function V(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return W(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?W(t,e):void 0}}(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function W(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=2&&at.test(t)}function $t(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,d,i,o,a=[],u=!0,$=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){$=!0,d=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if($)throw d}}return a}}(t,e)||lt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(t,e){if(t){if("string"==typeof t)return ct(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ct(t,e):void 0}}function ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0){var n=t.leadingDigitsPatterns()[t.leadingDigitsPatterns().length-1];if(0!==e.search(n))return!1}return O(e,t.pattern())})}function pt(t,e,n,r){return e?r(t,e,n):t}function gt(t){return gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gt(t)}function bt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function vt(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=t.length)return"";var r=t.indexOf(";",n);return r>=0?t.substring(n,r):t.substring(n)}(t);if(!function(t){return null===t||0!==t.length&&(Vt.test(t)||Wt.test(t))}(d))throw new jt("NOT_A_NUMBER");if(null===d)n=r(t)||"";else{n="","+"===d.charAt(0)&&(n+=d);var i,o=t.indexOf(Kt);i=o>=0?o+4:0;var a=t.indexOf(Yt);n+=t.substring(i,a)}var u=n.indexOf(";isub=");if(u>0&&(n=n.substring(0,u)),""!==n)return n}var Xt=new RegExp("[++"+M+"]"),Jt=new RegExp("[^"+M+"#]+$");function Qt(t,e,n){e=e||{};var r=new s(n);if(e.defaultCountry&&!r.hasCountry(e.defaultCountry)){if(e.v2)throw new jt("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(e.defaultCountry))}var d=function(t,e,n){var r=Zt(t,{extractFormattedPhoneNumber:function(t){return function(t,e,n){if(!t)return;if(t.length>250){if(n)throw new jt("TOO_LONG");return}if(!1===e)return t;var r=t.search(Xt);if(r<0)return;return t.slice(r).replace(Jt,"")}(t,n,e)}});if(!r)return{};if(!ut(r))return function(t){return it.test(t)}(r)?{error:"TOO_SHORT"}:{};var d=function(t){var e=t.search(kt);if(e<0)return{};for(var n=t.slice(0,e),r=t.match(kt),d=1;d17){if(e.v2)throw new jt("TOO_LONG");return{}}if(e.v2){var m=new St(c,l,r.metadata);return $&&(m.country=$),h&&(m.carrierCode=h),o&&(m.ext=o),m.__countryCallingCodeSource=f,m}var y=!!(e.extended?r.hasSelectedNumberingPlan():$)&&O(l,r.nationalNumberPattern());return e.extended?{country:$,countryCallingCode:c,carrierCode:h,valid:y,possible:!!y||!(!0!==e.extended||!r.possibleLengths()||!x(l,r)),phone:l,ext:o}:y?function(t,e,n){var r={country:t,phone:e};n&&(r.ext=n);return r}($,l,o):{}}function zt(t){return zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(t)}function qt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function te(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;Fe(this,t),this.key=e,this.value=n,this.next=r,this.prev=d}),De=function(){return je(function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;Fe(this,t),this.size=0,this.limit=e,this.head=null,this.tail=null,this.cache={}},[{key:"put",value:function(t,e){if(this.ensureLimit(),this.head){var n=new Re(t,e,this.head);this.head.prev=n,this.head=n}else this.head=this.tail=new Re(t,e);this.cache[t]=this.head,this.size++}},{key:"get",value:function(t){if(this.cache[t]){var e=this.cache[t].value;return this.remove(t),this.put(t,e),e}console.log("Item not available in cache for key ".concat(t))}},{key:"ensureLimit",value:function(){this.size===this.limit&&this.remove(this.tail.key)}},{key:"remove",value:function(t){var e=this.cache[t];null!==e.prev?e.prev.next=e.next:this.head=e.next,null!==e.next?e.next.prev=e.prev:this.tail=e.prev,delete this.cache[t],this.size--}},{key:"clear",value:function(){this.head=null,this.tail=null,this.size=0,this.cache={}}}])}();function Me(t){return Me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Me(t)}function _e(t,e,n){return e&&function(t,e){for(var n=0;n=0?e.slice(0,n):e}var He="   ᠎ - \u2028\u2029   ",Ve="[".concat(He,"]"),We="[^".concat(He,"]"),Ke="[".concat("0-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9","]"),Ye="A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Ze="[".concat(Ye,"]"),Xe=new RegExp(Ze),Je="[".concat("$¢-¥֏؋৲৳৻૱௹฿៛₠-₹꠸﷼﹩$¢£¥₩","]"),Qe=new RegExp(Je),ze="[".concat("̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ࣾऀ-ंऺ़ु-ै्॑-ॗॢॣঁ়ু-ৄ্ৢৣਁਂ਼ੁੂੇੈੋ-੍ੑੰੱੵઁં઼ુ-ૅેૈ્ૢૣଁ଼ିୁ-ୄ୍ୖୢୣஂீ்ా-ీె-ైొ-్ౕౖౢౣ಼ಿೆೌ್ೢೣു-ൄ്ൢൣ්ි-ුූัิ-ฺ็-๎ັິ-ູົຼ່-ໍཱ༹༘༙༵༷-ཾྀ-྄྆྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္်ွှၘၙၞ-ၠၱ-ၴႂႅႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧᤨᤲ᤹-᤻ᨘᨗᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀᮁᮢ-ᮥᮨᮩ᯦᮫ᯨᯩᯭᯯ-ᯱᰬ-ᰳᰶ᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᷀-ᷦ᷼-᷿⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〭꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠥꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꨩ-ꨮꨱꨲꨵꨶꩃꩌꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫬꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-︦","]"),qe=new RegExp(ze),tn=new RegExp("[\0-€-ÿĀ-ſḀ-ỿƀ-ɏ̀-ͯ]");function en(t){return!(!Xe.test(t)&&!qe.test(t))&&tn.test(t)}function nn(t){return"%"===t||Qe.test(t)}function rn(t,e,n){var r=!0,d=me(t,n);if(d||(r=!1,d=me(t,{defaultCallingCode:e.countryCallingCode},n)),!d)return"INVALID_NUMBER";if(e.ext){if(d.ext!==e.ext)return"NO_MATCH"}else if(d.ext)return"NO_MATCH";return r&&e.countryCallingCode!==d.countryCallingCode?"NO_MATCH":e.number===d.number?r?"EXACT_MATCH":"NSN_MATCH":0===e.nationalNumber.indexOf(d.nationalNumber)||0===d.nationalNumber.indexOf(e.nationalNumber)?"SHORT_NSN_MATCH":"NO_MATCH"}var dn={POSSIBLE:function(t,e){return e.candidate,e.metadata,!0},VALID:function(t,e){var n=e.candidate;e.defaultCountry;var r=e.metadata;return!(!t.isValid()||!on(t,n,r))},STRICT_GROUPING:function(t,e){var n=e.candidate,r=e.defaultCountry,d=e.metadata;return e.regExpCache,!(!t.isValid()||!on(t,n,d)||un(t,n)||!an(t,{defaultCountry:r,metadata:d}))&&$n()},EXACT_GROUPING:function(t,e){var n=e.candidate,r=e.defaultCountry,d=e.metadata;return e.regExpCache,!(!t.isValid()||!on(t,n,d)||un(t,n)||!an(t,{defaultCountry:r,metadata:d}))&&$n()}};function on(t,e,n){for(var r=0;r=0)}function $n(t,e,n,r,d){throw new Error("This part of code hasn't been ported")}var ln=/[\\/] *x/;function cn(t){return Ue(ln,t)}var sn=/(?:(?:[0-3]?\d\/[01]?\d)|(?:[01]?\d\/[0-3]?\d))\/(?:[12]\d)?\d{2}/,fn=/[12]\d{3}[-/]?[01]\d[-/]?[0-3]\d +[0-2]\d$/,hn=/^:[0-5]\d/;function mn(t,e,n){if(sn.test(t))return!1;if(fn.test(t)){var r=n.slice(e+t.length);if(hn.test(r))return!1}return!0}var yn="(\\[([",pn=")\\])]",gn="[^".concat(yn).concat(pn,"]"),bn="[".concat(yn).concat(G,"]"),vn=new RegExp("^"+bn),Cn=Be(0,3),Nn=new RegExp("^(?:[(\\[([])?(?:"+gn+"+["+pn+"])?"+gn+"+(?:["+yn+"]"+gn+"+["+pn+"])"+Cn+gn+"*$"),Pn=/\d{1,5}-+\d{1,5}\s{0,4}\(\d{1,4}/;function Sn(t,e,n,r){if(Nn.test(t)&&!Pn.test(t)){if("POSSIBLE"!==r){if(e>0&&!vn.test(t)){var d=n[e-1];if(nn(d)||en(d))return!1}var i=e+t.length;if(i=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function On(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n={v2:n.v2,defaultCallingCode:n.defaultCallingCode,defaultCountry:n.defaultCountry&&N(n.defaultCountry,r)?n.defaultCountry:void 0,leniency:n.leniency||(n.extended?"POSSIBLE":"VALID"),maxTries:n.maxTries||Ln},!dn[n.leniency])throw new TypeError('Unknown leniency: "'.concat(n.leniency,'"'));if("POSSIBLE"!==n.leniency&&"VALID"!==n.leniency)throw new TypeError('Invalid `leniency`: "'.concat(n.leniency,'". Supported values: "POSSIBLE", "VALID".'));if(n.maxTries<0)throw new TypeError("`maxTries` must be `>= 0`");this.text=e,this.options=n,this.metadata=r,this.leniency=dn[n.leniency],this.maxTries=n.maxTries,this.PATTERN=new RegExp(Mn,"ig"),this.INNER_MATCHES=An.map(function(t){return new RegExp(t,"g")}),this.state="NOT_READY",this.searchIndex=0,this.regExpCache=new Ge(32)},[{key:"find",value:function(t){var e;for(this.PATTERN.lastIndex=t;this.maxTries>0&&null!==(e=this.PATTERN.exec(this.text));){var n=e[0],r=e.index;if(mn(n=cn(n),r,this.text)){var d=this.parseAndVerify(n,r,this.text)||this.extractInnerMatch(n,r,this.text);if(d){if(this.options.v2)return{startsAt:d.startsAt,endsAt:d.endsAt,number:d.phoneNumber};var i=d.phoneNumber,o={startsAt:d.startsAt,endsAt:d.endsAt,phone:i.nationalNumber};return i.country?o.country=i.country:o.countryCallingCode=i.countryCallingCode,i.ext&&(o.ext=i.ext),o}}this.maxTries--}}},{key:"extractInnerMatch",value:function(t,e,n){for(var r,d=xn(this.INNER_MATCHES);!(r=d()).done;){var i=r.value;i.lastIndex=0;for(var o=!0,a=void 0;this.maxTries>0&&null!==(a=i.exec(t));){if(o){var u=Ue(_n,t.slice(0,a.index)),$=this.parseAndVerify(u,e,n);if($)return $;this.maxTries--,o=!1}var l=Ue(_n,a[1]),c=t.indexOf(l,a.index),s=this.parseAndVerify(l,e+c,n);if(s)return s;this.maxTries--}}}},{key:"parseAndVerify",value:function(t,e,n){if(Sn(t,e,n,this.options.leniency)){var r=me(t,{extended:!0,defaultCountry:this.options.defaultCountry,defaultCallingCode:this.options.defaultCallingCode},this.metadata);if(r&&r.isPossible())return this.leniency(r,{candidate:t,defaultCountry:this.options.defaultCountry,metadata:this.metadata,regExpCache:this.regExpCache})?{startsAt:e,endsAt:e+t.length,phoneNumber:r}:void 0}}},{key:"hasNext",value:function(){return"NOT_READY"===this.state&&(this.lastMatch=this.find(this.searchIndex),this.lastMatch?(this.searchIndex=this.lastMatch.endsAt,this.state="READY"):this.state="DONE"),"READY"===this.state}},{key:"next",value:function(){if(!this.hasNext())throw new Error("No next element");var t=this.lastMatch;return this.lastMatch=null,this.state="NOT_READY",t}}])}();function Bn(){for(var t=ue(arguments),e=t.text,n=t.options,r=t.metadata,d=new Gn(e,n,r),i=[];d.hasNext();)i.push(d.next());return i}function Un(t){return Un="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Un(t)}function Hn(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=Un(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=Un(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Un(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vn(){var t=ue(arguments),e=t.text,n=t.options,r=t.metadata,d=new Gn(e,n,r);return Hn({},Symbol.iterator,function(){return{next:function(){return d.hasNext()?{done:!1,value:d.next()}:{done:!0}}}})}function Wn(t){return Wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wn(t)}function Kn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Yn(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function or(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n1;)1&e&&(n+=t),e>>=1,t+=t;return n+t}function lr(t,e){return")"===t[e]&&e++,function(t){var e=[],n=0;for(;n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Nr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n1&&void 0!==arguments[1]?arguments[1]:{}).allowOverflow;if(!t)throw new Error("String is required");var n=Or(t.split(""),this.matchTree,!0);if(n&&n.match&&delete n.matchedChars,!n||!n.overflow||e)return n}}])}();function Or(t,e,n){if("string"==typeof e){var r=t.join("");return 0===e.indexOf(r)?t.length===e.length?{match:!0,matchedChars:t}:{partialMatch:!0}:0===r.indexOf(e)?n&&t.length>e.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,e.length)}:void 0}if(Array.isArray(e)){for(var d=t.slice(),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ir(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=0)){var n=this.getTemplateForFormat(t,e);return n?(this.setNationalNumberTemplate(n,e),!0):void 0}}},{key:"getSeparatorAfterNationalPrefix",value:function(t){return this.isNANP||t&&t.nationalPrefixFormattingRule()&&Fr.test(t.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(t,e){var n=t.IDDPrefix,r=t.missingPlus;return n?e&&!1===e.spacing?n:n+" ":r?"":"+"}},{key:"getTemplate",value:function(t){if(this.template){for(var e=-1,n=0,r=t.international?this.getInternationalPrefixBeforeCountryCallingCode(t,{spacing:!1}):"";na.length)){var u=new RegExp("^"+o+"$"),$=n.replace(/\d/g,"9");u.test($)&&(a=$);var l,c=this.getFormatFormat(t,r);if(this.shouldTryNationalPrefixFormattingRule(t,{international:r,nationalPrefix:d})){var s=c.replace(z,t.nationalPrefixFormattingRule());if(_t(t.nationalPrefixFormattingRule())===(d||"")+_t("$1")&&(c=s,l=!0,d))for(var f=d.length;f>0;)c=c.replace(/\d/,ar),f--}var h=a.replace(new RegExp(o),c).replace(new RegExp("9","g"),ar);return l||(i?h=$r(ar,i.length)+" "+h:d&&(h=$r(ar,d.length)+this.getSeparatorAfterNationalPrefix(t)+h)),r&&(h=Q(h)),h}}},{key:"formatNextNationalNumberDigits",value:function(t){var e=function(t,e,n){for(var r,d=ir(n.split(""));!(r=d()).done;){var i=r.value;if(t.slice(e+1).search(ur)<0)return;e=t.search(ur),t=t.replace(ur,i)}return[t,e]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,t);if(e)return this.populatedNationalNumberTemplate=e[0],this.populatedNationalNumberTemplatePosition=e[1],lr(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1);this.resetFormat()}},{key:"shouldTryNationalPrefixFormattingRule",value:function(t,e){var n=e.international,r=e.nationalPrefix;if(t.nationalPrefixFormattingRule()){var d=t.usesNationalPrefix();if(d&&r||!d&&!n)return!0}}}])}();function Mr(t){return Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mr(t)}function _r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,d,i,o,a=[],u=!0,$=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){$=!0,d=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if($)throw d}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Lr(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lr(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=3;if(e.appendDigits(t),r&&this.extractIddPrefix(e),this.isWaitingForCountryCallingCode(e)){if(!this.extractCountryCallingCode(e))return}else e.appendNationalSignificantNumberDigits(t);e.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(e.getNationalDigits(),function(t){return e.update(t)})}},{key:"isWaitingForCountryCallingCode",value:function(t){var e=t.international,n=t.callingCode;return e&&!n}},{key:"extractCountryCallingCode",value:function(t){var e=J("+"+t.getDigitsWithoutInternationalPrefix(),t.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),n=e.countryCallingCode,r=e.number;if(n)return t.setCallingCode(n),t.update({nationalSignificantNumber:r}),!0}},{key:"reset",value:function(t){if(t){this.hasSelectedNumberingPlan=!0;var e=t._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=e&&Wr.test(e)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(t,e){if(this.hasSelectedNumberingPlan){var n=H(t,this.metadata),r=n.nationalPrefix,d=n.nationalNumber,i=n.carrierCode;if(d!==t)return this.onExtractedNationalNumber(r,i,d,t,e),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(t,e,n){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(t,n);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var r=H(t,this.metadata),d=r.nationalPrefix,i=r.nationalNumber,o=r.carrierCode;if(i!==e)return this.onExtractedNationalNumber(d,o,i,t,n),!0}}},{key:"onExtractedNationalNumber",value:function(t,e,n,r,d){var i,o=!1,a=r.lastIndexOf(n);if(a<0||a!==r.length-n.length)o=!0;else{var u=r.slice(0,a);u&&u!==t&&(i=u)}d({nationalPrefix:t,carrierCode:e,nationalSignificantNumber:n,nationalSignificantNumberIsModified:o,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:i}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(t){return!!this.extractAnotherNationalSignificantNumber(t.getNationalDigits(),t.nationalSignificantNumber,function(e){return t.update(e)})||(this.extractIddPrefix(t)||this.fixMissingPlus(t)?(this.extractCallingCodeAndNationalSignificantNumber(t),!0):void 0)}},{key:"extractIddPrefix",value:function(t){var e=t.international,n=t.IDDPrefix,r=t.digits;if(t.nationalSignificantNumber,!e&&!n){var d=U(r,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);return void 0!==d&&d!==r?(t.update({IDDPrefix:r.slice(0,r.length-d.length)}),this.startInternationalNumber(t,{country:void 0,callingCode:void 0}),!0):void 0}}},{key:"fixMissingPlus",value:function(t){if(!t.international){var e=X(t.digits,t.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata).countryCallingCode;if(e)return t.update({missingPlus:!0}),this.startInternationalNumber(t,{country:t.country,callingCode:e}),!0}}},{key:"startInternationalNumber",value:function(t,e){var n=e.country,r=e.callingCode;t.startInternationalNumber(n,r),t.nationalSignificantNumber&&(t.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(t){this.extractCountryCallingCode(t)&&this.extractNationalSignificantNumber(t.getNationalDigits(),function(e){return t.update(e)})}}])}();function Yr(t){return Yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yr(t)}function Zr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,d,i,o,a=[],u=!0,$=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){$=!0,d=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if($)throw d}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Xr(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xr(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n1}},{key:"determineTheCountry",value:function(){var t=Y(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata});t!==this.state.country&&(this.state.setCountry(t),t&&this.metadata.selectNumberingPlan(t))}},{key:"getNumberValue",value:function(){var t=this.state,e=t.digits,n=t.callingCode,r=t.country,d=t.nationalSignificantNumber;if(e)return this.isInternational()?n?"+"+n+d:"+"+e:r||n?"+"+(r?this.metadata.countryCallingCode():n)+d:void 0}},{key:"getNumber",value:function(){var t=this.state,e=t.nationalSignificantNumber,n=t.carrierCode,r=t.callingCode;if(e){var d=this._getCountry();if(d||r){if(d&&d===this.defaultCountry){var i=function(t,e,n){var r=n.getCountryCodesForCallingCode(t);if(r.length>1)return K(e,r,n.metadata)}(this.metadata.numberingPlan.callingCode(),e,this.metadata);i&&(d=i)}var o=new St(d||r,e,this.metadata.metadata);return n&&(o.carrierCode=n),o}}}},{key:"isPossible",value:function(){var t=this.getNumber();return!!t&&t.isPossible()}},{key:"isValid",value:function(){var t=this.getNumber();return!!t&&t.isValid()}},{key:"validateLength",value:function(){var t=this.state,e=t.digits,n=t.nationalSignificantNumber;if(!e)return"NOT_A_NUMBER";if(!this.metadata.numberingPlan)return"INVALID_COUNTRY";if(!n)return"TOO_SHORT";var r=S(n,void 0,this.metadata);return"IS_POSSIBLE"!==r?r:void 0}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}])}();function qr(t){return new s(t).getCountries()}function td(t,e,n){if(e[t])return new St(t,e[t],n)}function ed(t,e,n){return n||(n=e,e=void 0),new zr(e,n).input(t)}function nd(){return n($e,arguments)}function rd(t,n){return Gn.call(this,t,n,e)}function dd(t){return zr.call(this,t,e)}function id(){return n(C,arguments)}function od(){return s.call(this,e)}function ad(t){return St.call(this,t,e)}function ud(){var t=ue(arguments);return Qt(t.text,t.options,t.metadata)}function $d(){return n(ud,arguments)}function ld(){var t=function(t){var e,n,r,d,o=t[0],a=t[1],u=t[2],$=t[3],l=t[4];if("string"==typeof o)if("string"==typeof u)n=u,l?(r=$,d=l):d=$,e=Qt(o,{defaultCountry:a,extended:!0},d);else{if("string"!=typeof a)throw new Error("`format` argument not passed to `formatNumber(number, format)`");n=a,$?(r=u,d=$):d=u,e=Qt(o,{extended:!0},d)}else{if(!i(o))throw new TypeError("A phone number must either be a string or an object of shape { phone, [country] }.");e=o,n=a,$?(r=u,d=$):d=u}"International"===n?n="INTERNATIONAL":"National"===n&&(n="NATIONAL");return{input:e,format:n,options:r,metadata:d}}(arguments);return ht(t.input,t.format,t.options,t.metadata)}function cd(){return n(ld,arguments)}function sd(){var t=fd(arguments),e=t.input,n=t.options,r=t.metadata;if(e.phone)return A(e,n,r)}function fd(t){var e,n,r=t[0],d=t[1],o=t[2],a=t[3],u={};if("string"==typeof r)i(d)?(o?(u=d,n=o):n=d,e=ut(r)?Qt(r,void 0,n):{}):(a?(u=o,n=a):n=o,e=ut(r)?Qt(r,{defaultCountry:d},n):{});else{if(!i(r))throw new TypeError("A phone number must either be a string or an object of shape { phone, [country] }.");e=r,o?(u=d,n=o):n=d}return{input:e,options:u,metadata:n}}function hd(){var t=fd(arguments),e=t.input,n=t.options,r=t.metadata;return!!(e.phone||n&&n.v2)&&w(e,n,r)}function md(){var t=fd(arguments),e=t.input,n=t.options,r=t.metadata;return!!e.phone&&k(e,n,r)}function yd(t,e,n){if("string"!=typeof t)throw new TypeError("number must be a string");if("string"!=typeof e)throw new TypeError("country must be a string");return function(t,e,n,r){return n=n||{},t.country===e&&k(t,n,r)}(ut(t)?Qt(t,{defaultCountry:e},n):{},e,void 0,n)}function pd(t){return pd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pd(t)}function gd(t,e,n){return e&&function(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}((t=t.replace(/^tel:/,"tel=")).split(";"));!(r=d()).done;){var i=$t(r.value.split("="),2),o=i[0],a=i[1];switch(o){case"tel":e=a;break;case"ext":n=a;break;case"phone-context":"+"===a[0]&&(e=a+e)}}if(!ut(e))return{};var u={number:e};return n&&(u.ext=n),u},t.searchNumbers=function(){return n(Vn,arguments)},t.searchPhoneNumbers=function(){return n(Sd,arguments)},t.searchPhoneNumbersCustom=Sd,t.searchPhoneNumbersInText=function(){return n(tr,arguments)},t.validatePhoneNumberLength=function(){return n(Ie,arguments)}}); //# sourceMappingURL=libphonenumber-js.min.js.map diff --git a/themes/bootstrap5/package.json b/themes/bootstrap5/package.json index a00963daed37..822cc728511d 100644 --- a/themes/bootstrap5/package.json +++ b/themes/bootstrap5/package.json @@ -16,7 +16,7 @@ "chart.js": "^4.4.0", "jquery": "^3.7.1", "js-cookie": "^3.0.7", - "libphonenumber-js": "^1.12.10", + "libphonenumber-js": "^1.13.11", "nouislider": "^15.8.1", "simple-keyboard": "^3.8.165", "simple-keyboard-layouts": "^3.4.239" From 960caa42e662c38639dd67fecf5aa37355ddd775 Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Tue, 8 Sep 2026 16:03:13 -0400 Subject: [PATCH 35/90] Use config array instead of object for Auth Utils (#5637) --- .../src/VuFind/Auth/EmailAuthenticator.php | 14 ++++---- .../VuFind/Auth/EmailAuthenticatorFactory.php | 2 +- .../src/VuFind/Auth/LoginTokenManager.php | 15 ++++---- .../VuFind/Auth/LoginTokenManagerFactory.php | 2 +- module/VuFind/src/VuFind/Auth/Manager.php | 36 +++++++++---------- .../VuFind/src/VuFind/Auth/ManagerFactory.php | 2 +- .../Auth/EmailAuthenticatorTest.php | 3 +- .../VuFindTest/Auth/LoginTokenManagerTest.php | 3 +- .../src/VuFindTest/Auth/ManagerTest.php | 2 -- 9 files changed, 37 insertions(+), 42 deletions(-) diff --git a/module/VuFind/src/VuFind/Auth/EmailAuthenticator.php b/module/VuFind/src/VuFind/Auth/EmailAuthenticator.php index 5a313a0cdbdf..006b8a1f896e 100644 --- a/module/VuFind/src/VuFind/Auth/EmailAuthenticator.php +++ b/module/VuFind/src/VuFind/Auth/EmailAuthenticator.php @@ -70,7 +70,7 @@ class EmailAuthenticator implements \VuFind\I18n\Translator\TranslatorAwareInter * @param \VuFind\Mailer\Mailer $mailer Mailer * @param PhpRenderer $viewRenderer View Renderer * @param UserIpReader $userIpReader User IP address reader - * @param \VuFind\Config\Config $config Configuration + * @param array $config Configuration * @param AuthHashServiceInterface $authHashService AuthHash database service */ public function __construct( @@ -79,7 +79,7 @@ public function __construct( protected \VuFind\Mailer\Mailer $mailer, protected PhpRenderer $viewRenderer, protected UserIpReader $userIpReader, - protected \VuFind\Config\Config $config, + protected array $config, protected AuthHashServiceInterface $authHashService ) { } @@ -113,7 +113,7 @@ public function sendAuthenticationLink( $templateParams = [] ) { // Make sure we've waited long enough - $recoveryInterval = $this->config->Authentication->recover_interval ?? 60; + $recoveryInterval = $this->config['Authentication']['recover_interval'] ?? 60; $sessionId = $this->sessionManager->getId(); if ( @@ -145,7 +145,7 @@ public function sendAuthenticationLink( $viewParams['url'] = $serverHelper( $urlHelper($linkRoute, $routeParams, ['query' => $urlParams]) ); - $viewParams['title'] = $this->config->Site->title; + $viewParams['title'] = $this->config['Site']['title'] ?? ''; $message = $this->viewRenderer->render($template, $viewParams); $from = $this->getEmailSenderAddress($this->config, $email); @@ -236,7 +236,7 @@ public function sendAuthenticationCode( $templateParams = [] ): int { // Make sure we've waited long enough - $recoveryInterval = $this->config->Authentication->recover_interval ?? 60; + $recoveryInterval = $this->config['Authentication']['recover_interval'] ?? 60; $sessionId = $this->sessionManager->getId(); if ( @@ -260,7 +260,7 @@ public function sendAuthenticationCode( $viewParams = $templateParams; $viewParams['code'] = $otp; - $viewParams['title'] = $this->config->Site->title ?? ''; + $viewParams['title'] = $this->config['Site']['title'] ?? ''; $message = $this->viewRenderer->render($template, $viewParams); $from = $this->getEmailSenderAddress($this->config, $email); @@ -310,7 +310,7 @@ public function verifyAuthenticationCode( throw $e; } // Check the maximum attempt limit: - $maxAttempts = max($this->config->Authentication->otp_max_attempts ?? 3, 1); + $maxAttempts = max($this->config['Authentication']['otp_max_attempts'] ?? 3, 1); if ($attempts > $maxAttempts) { throw new AuthException('authentication_error_expired'); } diff --git a/module/VuFind/src/VuFind/Auth/EmailAuthenticatorFactory.php b/module/VuFind/src/VuFind/Auth/EmailAuthenticatorFactory.php index e61276f392d7..d73865ec7bb5 100644 --- a/module/VuFind/src/VuFind/Auth/EmailAuthenticatorFactory.php +++ b/module/VuFind/src/VuFind/Auth/EmailAuthenticatorFactory.php @@ -73,7 +73,7 @@ public function __invoke( $container->get(\VuFind\Mailer\Mailer::class), $container->get('ViewRenderer'), $container->get(\VuFind\Net\UserIpReader::class), - $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'), + $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'), $container->get(\VuFind\Db\Service\PluginManager::class) ->get(\VuFind\Db\Service\AuthHashServiceInterface::class) ); diff --git a/module/VuFind/src/VuFind/Auth/LoginTokenManager.php b/module/VuFind/src/VuFind/Auth/LoginTokenManager.php index 379cd94120f3..c6d23085c3c6 100644 --- a/module/VuFind/src/VuFind/Auth/LoginTokenManager.php +++ b/module/VuFind/src/VuFind/Auth/LoginTokenManager.php @@ -36,7 +36,6 @@ use Laminas\Session\SessionManager; use Laminas\View\Renderer\RendererInterface; use Psr\Log\LoggerAwareInterface; -use VuFind\Config\Config; use VuFind\Config\Feature\EmailSettingsTrait; use VuFind\Cookie\CookieManager; use VuFind\Db\Entity\UserEntityInterface; @@ -104,7 +103,7 @@ class LoginTokenManager implements LoggerAwareInterface, TranslatorAwareInterfac /** * LoginToken constructor. * - * @param Config $config Configuration + * @param array $config Configuration * @param UserServiceInterface $userService User database service * @param LoginTokenServiceInterface $loginTokenService Login Token database service * @param CookieManager $cookieManager Cookie manager @@ -114,7 +113,7 @@ class LoginTokenManager implements LoggerAwareInterface, TranslatorAwareInterfac * @param callable $browscapCB Callback for creating Browscap */ public function __construct( - protected Config $config, + protected array $config, protected UserServiceInterface $userService, protected LoginTokenServiceInterface $loginTokenService, protected CookieManager $cookieManager, @@ -273,7 +272,7 @@ public function deleteUserLoginTokens($userId) */ public function getCookieLifetime(): int { - return (int)($this->config->Authentication->persistent_login_lifetime ?? 14); + return (int)($this->config['Authentication']['persistent_login_lifetime'] ?? 14); } /** @@ -332,7 +331,7 @@ protected function createOrRotateToken( $userId = $user->getId(); try { if ($series) { - $lenient = ($this->config->Authentication->lenient_token_rotation ?? true); + $lenient = ($this->config['Authentication']['lenient_token_rotation'] ?? true); $this->loginTokenService->deleteBySeries($series, $lenient ? $currentTokenId : null); $this->debug("Updating login token $token series $series for user {$userId}"); } else { @@ -364,16 +363,16 @@ protected function createOrRotateToken( */ protected function sendLoginTokenWarningEmail(UserEntityInterface $user) { - if (!($this->config->Authentication->send_login_warnings ?? true)) { + if (!($this->config['Authentication']['send_login_warnings'] ?? true)) { return; } - $title = $this->config->Site->title ?? ''; + $title = $this->config['Site']['title'] ?? ''; if ($toAddr = $user->getEmail()) { $message = $this->viewRenderer->render( 'Email/login-warning.phtml', compact('title') ); - $subject = $this->config->Authentication->persistent_login_warning_email_subject + $subject = $this->config['Authentication']['persistent_login_warning_email_subject'] ?? 'persistent_login_warning_email_subject'; try { diff --git a/module/VuFind/src/VuFind/Auth/LoginTokenManagerFactory.php b/module/VuFind/src/VuFind/Auth/LoginTokenManagerFactory.php index 54e2f1fcd8f2..3c01f2b2d231 100644 --- a/module/VuFind/src/VuFind/Auth/LoginTokenManagerFactory.php +++ b/module/VuFind/src/VuFind/Auth/LoginTokenManagerFactory.php @@ -82,7 +82,7 @@ public function __invoke( $dbServiceManager = $container->get(\VuFind\Db\Service\PluginManager::class); return new $requestedName( - $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'), + $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'), $dbServiceManager->get(UserServiceInterface::class), $dbServiceManager->get(LoginTokenServiceInterface::class), $container->get(\VuFind\Cookie\CookieManager::class), diff --git a/module/VuFind/src/VuFind/Auth/Manager.php b/module/VuFind/src/VuFind/Auth/Manager.php index 12909e4bbc2b..87e61b2e6359 100644 --- a/module/VuFind/src/VuFind/Auth/Manager.php +++ b/module/VuFind/src/VuFind/Auth/Manager.php @@ -121,7 +121,7 @@ class Manager implements IdentityProviderInterface, LoggerAwareInterface /** * Constructor. * - * @param Config $config VuFind configuration + * @param array $config VuFind configuration * @param UserServiceInterface $userService User database service * @param UserSessionPersistenceInterface $userSession User session persistence service * @param SessionManager $sessionManager Session manager @@ -134,7 +134,7 @@ class Manager implements IdentityProviderInterface, LoggerAwareInterface * @param AuditEventServiceInterface $auditEventService Event database service */ public function __construct( - protected Config $config, + protected array $config, protected UserServiceInterface $userService, protected UserSessionPersistenceInterface $userSession, protected SessionManager $sessionManager, @@ -148,7 +148,7 @@ public function __construct( ) { // Initialize active authentication setting (defaulting to Database // if no setting passed in): - $method = $this->getPreAuthenticationData()['authMethod'] ?? $config->Authentication->method ?? 'Database'; + $method = $this->getPreAuthenticationData()['authMethod'] ?? $config['Authentication']['method'] ?? 'Database'; // Set the active authentication method and force it legal: $this->setAuthMethod($method, true); } @@ -204,7 +204,7 @@ protected function makeAuth(string $method): AuthInterface throw new \Exception("Illegal authentication method: $method"); } $auth = $this->pluginManager->get($method); - $auth->setConfig($this->config); + $auth->setConfig(new Config($this->config)); return $auth; } @@ -231,7 +231,7 @@ public function supportsCreation(?string $authMethod = null): bool */ public function supportsRecovery(?string $authMethod = null, ?string $target = null): bool { - return ($this->config->Authentication->recover_password ?? false) + return ($this->config['Authentication']['recover_password'] ?? false) && $this->getAuth($authMethod)->supportsPasswordRecovery($target); } @@ -269,7 +269,7 @@ public function getPasswordRecoveryData(array $params): ?array */ public function supportsEmailChange(?string $authMethod = null): bool { - return $this->config->Authentication->change_email ?? false; + return $this->config['Authentication']['change_email'] ?? false; } /** @@ -282,7 +282,7 @@ public function supportsEmailChange(?string $authMethod = null): bool */ public function supportsPasswordChange(?string $authMethod = null): bool { - return ($this->config->Authentication->change_password ?? false) + return ($this->config['Authentication']['change_password'] ?? false) && $this->getAuth($authMethod)->supportsPasswordChange(); } @@ -296,7 +296,7 @@ public function supportsPasswordChange(?string $authMethod = null): bool */ public function supportsConnectingLibraryCard(?string $authMethod = null): bool { - return ($this->config->Catalog->auth_based_library_cards ?? false) + return ($this->config['Catalog']['auth_based_library_cards'] ?? false) && $this->getAuth($authMethod)->supportsConnectingLibraryCard(); } @@ -309,10 +309,10 @@ public function supportsConnectingLibraryCard(?string $authMethod = null): bool */ public function supportsPersistentLogin(?string $authMethod = null): bool { - if (!empty($this->config->Authentication->persistent_login)) { + if (!empty($this->config['Authentication']['persistent_login'])) { return in_array( strtolower($authMethod ?? $this->getSelectedAuthMethod() ?? ''), - explode(',', strtolower($this->config->Authentication->persistent_login)) + explode(',', strtolower($this->config['Authentication']['persistent_login'])) ); } return false; @@ -325,7 +325,7 @@ public function supportsPersistentLogin(?string $authMethod = null): bool */ public function getPersistentLoginLifetime(): int { - return $this->config->Authentication->persistent_login_lifetime ?? 14; + return $this->config['Authentication']['persistent_login_lifetime'] ?? 14; } /** @@ -516,7 +516,7 @@ public function loginEnabled(): bool { if (null === $this->hideLogin) { // Assume login is enabled unless explicitly turned off: - $this->hideLogin = ($this->config->Authentication->hideLogin ?? false); + $this->hideLogin = ($this->config['Authentication']['hideLogin'] ?? false); if (!$this->hideLogin) { try { @@ -544,7 +544,7 @@ public function loginEnabled(): bool public function ajaxEnabled(): bool { // Assume ajax is enabled unless explicitly turned off: - return $this->config->Authentication->enableAjax ?? true; + return $this->config['Authentication']['enableAjax'] ?? true; } /** @@ -555,7 +555,7 @@ public function ajaxEnabled(): bool public function dropdownEnabled(): bool { // Assume dropdown is disabled unless explicitly turned on: - return $this->config->Authentication->enableDropdown ?? false; + return $this->config['Authentication']['enableDropdown'] ?? false; } /** @@ -740,7 +740,7 @@ public function checkForExpiredCredentials(): bool */ public function inPrivacyMode(): bool { - return $this->config->Authentication->privacy ?? false; + return $this->config['Authentication']['privacy'] ?? false; } /** @@ -838,7 +838,7 @@ public function updateEmail(UserEntityInterface $user, string $email): void { // Depending on verification setting, either do a direct update or else // put the new address into a pending state. - if ($this->config->Authentication->verify_email ?? false) { + if ($this->config['Authentication']['verify_email'] ?? false) { // If new email address is the current address, just reset any pending // email address: $user->setPendingEmail($email === $user->getEmail() ? '' : $email); @@ -996,7 +996,7 @@ public function login(Request $request): ?UserEntityInterface // Attempt catalog login so that any bad credentials are cleared before further processing // (avoids e.g. multiple login attempts by account AJAX checks). if ( - ($this->config->Catalog->checkILSCredentialsOnLogin ?? true) + ($this->config['Catalog']['checkILSCredentialsOnLogin'] ?? true) && $this->ilsAuthenticator && $this->allowsUserIlsLogin() && ($catUsername = $user->getCatUsername()) @@ -1225,7 +1225,7 @@ protected function updateUser(UserEntityInterface $user, ?string $authMethod): v */ public function allowsUserIlsLogin(): bool { - return $this->config->Catalog->allowUserLogin ?? true; + return $this->config['Catalog']['allowUserLogin'] ?? true; } /** diff --git a/module/VuFind/src/VuFind/Auth/ManagerFactory.php b/module/VuFind/src/VuFind/Auth/ManagerFactory.php index 6227f40b23f9..1954fd381ac9 100644 --- a/module/VuFind/src/VuFind/Auth/ManagerFactory.php +++ b/module/VuFind/src/VuFind/Auth/ManagerFactory.php @@ -69,7 +69,7 @@ public function __invoke( throw new \Exception('Unexpected options passed to factory.'); } // Load dependencies: - $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'); + $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'); $dbServiceManager = $container->get(\VuFind\Db\Service\PluginManager::class); $userService = $dbServiceManager->get(\VuFind\Db\Service\UserServiceInterface::class); $sessionManager = $container->get(\Laminas\Session\SessionManager::class); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/EmailAuthenticatorTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/EmailAuthenticatorTest.php index 25fe078ee537..3ad5b4cb76a9 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/EmailAuthenticatorTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/EmailAuthenticatorTest.php @@ -37,7 +37,6 @@ use PHPUnit\Framework\InvalidArgumentException; use PHPUnit\Framework\MockObject\Exception; use VuFind\Auth\EmailAuthenticator; -use VuFind\Config\Config; use VuFind\Db\Entity\AuthHashEntityInterface; use VuFind\Db\Service\AuthHashServiceInterface; use VuFind\Mailer\Mailer; @@ -89,7 +88,7 @@ protected function getEmailAuthenticator( $mailer ?? $this->createStub(Mailer::class), $renderer ?? $this->createStub(PhpRenderer::class), $userIpReader ?? $this->createStub(UserIpReader::class), - new Config($config), + $config, $authHashService ?? $this->createStub(AuthHashServiceInterface::class) ); $authenticator->setTranslator($this->getMockTranslator([])); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LoginTokenManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LoginTokenManagerTest.php index c4951dbd7777..0f3cf2f9cda1 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LoginTokenManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LoginTokenManagerTest.php @@ -35,7 +35,6 @@ use Laminas\Session\SessionManager; use PHPUnit\Framework\MockObject\MockObject; use VuFind\Auth\LoginTokenManager; -use VuFind\Config\Config; use VuFind\Cookie\CookieManager; use VuFind\Db\Entity\LoginTokenEntityInterface; use VuFind\Db\Entity\UserEntityInterface; @@ -193,7 +192,7 @@ protected function getCookieManager(array $cookies): CookieManager */ protected function getLoginToken($cookieManager, $tokenTable, $userTable, $browscapOk) { - $config = new Config([]); + $config = []; $saveHandler = $this->createMock(SaveHandlerInterface::class); $sessionManager = $this->createMock(SessionManager::class); $sessionManager->method('getSaveHandler')->willReturn($saveHandler); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php index 515ea460cad1..ea8ade83009a 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/ManagerTest.php @@ -35,7 +35,6 @@ use VuFind\Auth\Manager; use VuFind\Auth\PluginManager; use VuFind\Auth\UserSessionPersistenceInterface; -use VuFind\Config\Config; use VuFind\Db\Entity\UserEntityInterface; use VuFind\Db\Service\UserServiceInterface; @@ -561,7 +560,6 @@ protected function getManager( ?SessionManager $sessionManager = null, ?PluginManager $pm = null ): Manager { - $config = new Config($config); $cookies = new \VuFind\Cookie\CookieManager([]); $csrf = new \VuFind\Validator\SessionCsrf( [ From 50f832922afb8b0036ab485a9806a409bcfce170 Mon Sep 17 00:00:00 2001 From: 3pleX-dev Date: Wed, 9 Sep 2026 11:45:45 +0100 Subject: [PATCH 36/90] Add unit tests for Collections index browse. (#5636) --- .../AbstractCollectionsActionTestCase.php | 38 +++- .../Action/Collections/HomeActionTest.php | 164 ++++++++++++++++++ 2 files changed, 199 insertions(+), 3 deletions(-) diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/AbstractCollectionsActionTestCase.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/AbstractCollectionsActionTestCase.php index b308b1512622..b925739112ad 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/AbstractCollectionsActionTestCase.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/AbstractCollectionsActionTestCase.php @@ -41,6 +41,8 @@ use VuFind\ActionHelper\PluginManager as HelperPluginManager; use VuFind\Http\RouteHelper; use VuFind\I18n\Sorter; +use VuFind\Search\Base\Params; +use VuFind\Search\Base\Results as SearchResults; use VuFind\Search\Results\PluginManager as SearchResultsPluginManager; use VuFind\Session\Settings as SessionSettings; use VuFind\View\Renderer\TemplateRendererInterface; @@ -80,6 +82,8 @@ abstract class AbstractCollectionsActionTestCase extends TestCase * @param array $config VuFind configuration * @param SearchService $searchService Search service * @param HelperInterface[] $helpers Extra action helpers + * @param ?SearchResults $searchResults Search results returned by the results plugin manager (index browse) + * @param ?Sorter $sorter Sorter (defaults to a stub; pass a real one when sorting matters) * * @return AbstractAction */ @@ -87,13 +91,21 @@ protected function buildAction( string $class, array $config, SearchService $searchService, - array $helpers = [] + array $helpers = [], + ?SearchResults $searchResults = null, + ?Sorter $sorter = null ): AbstractAction { + if (null !== $searchResults) { + $resultsManager = $this->createMock(SearchResultsPluginManager::class); + $resultsManager->method('get')->willReturn($searchResults); + } else { + $resultsManager = $this->createStub(SearchResultsPluginManager::class); + } $action = new $class( $config, $searchService, - $this->createStub(SearchResultsPluginManager::class), - $this->createStub(Sorter::class), + $resultsManager, + $sorter ?? $this->createStub(Sorter::class), ); $action->setHelperPluginManager($this->getHelperPluginManager($helpers)); $action->setRouteHelper($this->createStub(RouteHelper::class)); @@ -170,6 +182,26 @@ function (CommandInterface $command) use ($executedCommand): CommandInterface { return $searchService; } + /** + * Get a mock search results object that returns the hierarchy_browse facet values, for the index browse path. + * + * @param array $facetList Facet entries to return from getFullFieldFacets() + * @param array $filterList Filter list to return from getParams()->getFilterList() + * + * @return SearchResults + */ + protected function getMockSearchResults(array $facetList, array $filterList = []): SearchResults + { + $params = $this->createMock(Params::class); + $params->method('getFilterList')->willReturn($filterList); + $results = $this->createMock(SearchResults::class); + $results->method('getParams')->willReturn($params); + $results->method('getFullFieldFacets')->willReturn( + ['hierarchy_browse' => ['data' => ['list' => $facetList]]] + ); + return $results; + } + /** * Invoke an action with the given query parameters. * diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/HomeActionTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/HomeActionTest.php index eb1498ebab08..33b220311ac0 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/HomeActionTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Action/Collections/HomeActionTest.php @@ -29,7 +29,12 @@ namespace VuFindTest\Action\Collections; +use VuFind\Action\AbstractAction; use VuFind\Action\Collections\HomeAction; +use VuFind\I18n\Sorter; +use VuFind\Search\Base\Params; +use VuFind\Search\Base\Results as SearchResults; +use VuFindSearch\Command\AlphabeticBrowseCommand; /** * Collections HomeAction test class. @@ -143,4 +148,163 @@ public function testAlphabeticBrowseUsesConfiguredDelimiter(): void $params['result'] ); } + + /** + * Test that an empty first page of alphabetic results triggers a retry with the previous page. + * + * @return void + */ + public function testAlphabeticBrowseStepsBackWhenPageEmpty(): void + { + $searchService = $this->getMockSearchService([ + 'Browse' => ['totalCount' => 0, 'offset' => 0, 'startRow' => 0, 'items' => []], + ]); + $action = $this->buildAction( + HomeAction::class, + ['Collections' => ['browseType' => 'Alphabetic']], + $searchService + ); + + $this->invokeAction($action); + + $command = $this->capturedCommand; + $this->assertInstanceOf(AlphabeticBrowseCommand::class, $command); + $this->assertSame(-1, $command->getPage()); + $this->assertSame([], $this->capturedTemplateParams['result']); + } + + /** + * Test that the index browse splits facet values on the delimiter and sorts them alphabetically. + * + * @return void + */ + public function testIndexBrowseFormatsAndSortsFacets(): void + { + $searchResults = $this->getMockSearchResults([ + ['value' => 'Zebra Collection{{{_ID_}}}z1', 'count' => 1], + ['value' => 'Apple Collection{{{_ID_}}}a1', 'count' => 2], + ]); + $action = $this->buildAction( + HomeAction::class, + [], + $this->createStub(\VuFindSearch\Service::class), + searchResults: $searchResults, + sorter: new Sorter(new \Collator('en')) + ); + + $this->invokeAction($action); + $params = $this->capturedTemplateParams; + + $this->assertSame( + [ + ['value' => 'a1', 'count' => 2, 'displayText' => 'Apple Collection'], + ['value' => 'z1', 'count' => 1, 'displayText' => 'Zebra Collection'], + ], + $params['result'] + ); + } + + /** + * Test that index browse filters from the request are applied to the search and passed to the template. + * + * @return void + */ + public function testIndexBrowseAppliesFilters(): void + { + $filterList = [['value' => 'Book', 'field' => 'format']]; + $params = $this->createMock(Params::class); + $params->expects($this->once())->method('addFilter')->with('format:Book'); + $params->method('getFilterList')->willReturn($filterList); + $searchResults = $this->createMock(SearchResults::class); + $searchResults->method('getParams')->willReturn($params); + $searchResults->method('getFullFieldFacets')->willReturn( + ['hierarchy_browse' => ['data' => ['list' => []]]] + ); + $action = $this->buildAction( + HomeAction::class, + [], + $this->createStub(\VuFindSearch\Service::class), + searchResults: $searchResults, + sorter: new Sorter(new \Collator('en')) + ); + + $this->invokeAction($action, ['filter' => ['format:Book']]); + + $this->assertSame($filterList, $this->capturedTemplateParams['filters']); + } + + /** + * Test that index browse offsets the result window by page and adds next/previous page links when "from" is empty. + * + * @return void + */ + public function testIndexBrowsePaginates(): void + { + $this->invokeAction($this->buildThreeItemIndexBrowseAction(), ['page' => 1]); + $params = $this->capturedTemplateParams; + + $this->assertSame(2, $params['nextpage']); + $this->assertSame(0, $params['prevpage']); + $this->assertSame( + [['value' => 'b', 'count' => 1, 'displayText' => 'Beta']], + $params['result'] + ); + } + + /** + * Build a three-item index browse action (browse limit 1). + * + * @return AbstractAction + */ + protected function buildThreeItemIndexBrowseAction(): AbstractAction + { + $searchResults = $this->getMockSearchResults([ + ['value' => 'Alpha{{{_ID_}}}a', 'count' => 1], + ['value' => 'Beta{{{_ID_}}}b', 'count' => 1], + ['value' => 'Gamma{{{_ID_}}}g', 'count' => 1], + ]); + return $this->buildAction( + HomeAction::class, + ['Collections' => ['browseLimit' => 1]], + $this->createStub(\VuFindSearch\Service::class), + searchResults: $searchResults, + sorter: new Sorter(new \Collator('en')) + ); + } + + /** + * Test that a negative page is clamped to the start of the result set. + * + * @return void + */ + public function testIndexBrowseClampsNegativePage(): void + { + $this->invokeAction($this->buildThreeItemIndexBrowseAction(), ['page' => -1]); + $params = $this->capturedTemplateParams; + + $this->assertSame( + [['value' => 'a', 'count' => 1, 'displayText' => 'Alpha']], + $params['result'] + ); + $this->assertSame(0, $params['nextpage']); + $this->assertArrayNotHasKey('prevpage', $params); + } + + /** + * Test that a page beyond the end is clamped to the last item of the result set. + * + * @return void + */ + public function testIndexBrowseClampsPageBeyondEnd(): void + { + $this->invokeAction($this->buildThreeItemIndexBrowseAction(), ['page' => 10]); + $params = $this->capturedTemplateParams; + + $this->assertSame( + [['value' => 'g', 'count' => 1, 'displayText' => 'Gamma']], + $params['result'] + ); + $this->assertSame(9, $params['prevpage']); + $this->assertArrayNotHasKey('nextpage', $params); + } } From 441f7da6ab1b3135bdc7d6fe6fcfc2185abccec4 Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Wed, 9 Sep 2026 06:55:01 -0400 Subject: [PATCH 37/90] Use config array instead of object for Session Handlers (#5640) --- .../src/VuFind/Session/AbstractBase.php | 8 ++--- .../VuFind/Session/AbstractBaseFactory.php | 4 +-- module/VuFind/src/VuFind/Session/File.php | 10 +++---- module/VuFind/src/VuFind/Session/Memcache.php | 18 +++++------ module/VuFind/src/VuFind/Session/Redis.php | 8 ++--- .../src/VuFind/Session/RedisFactory.php | 20 ++++++------- .../src/VuFindTest/Session/DatabaseTest.php | 7 ++--- .../src/VuFindTest/Session/FileTest.php | 30 +++++++++---------- .../src/VuFindTest/Session/MemcacheTest.php | 3 +- .../src/VuFindTest/Session/RedisTest.php | 22 +++++++------- 10 files changed, 59 insertions(+), 71 deletions(-) diff --git a/module/VuFind/src/VuFind/Session/AbstractBase.php b/module/VuFind/src/VuFind/Session/AbstractBase.php index 8166b61a41e9..9fd3d58bb728 100644 --- a/module/VuFind/src/VuFind/Session/AbstractBase.php +++ b/module/VuFind/src/VuFind/Session/AbstractBase.php @@ -71,13 +71,13 @@ abstract class AbstractBase implements HandlerInterface /** * Constructor. * - * @param ?Config $config Session configuration ([Session] section of + * @param ?array $config Session configuration ([Session] section of * config.ini) */ - public function __construct(?Config $config = null) + public function __construct(?array $config = null) { - if (isset($config->lifetime)) { - $this->lifetime = $config->lifetime; + if (isset($config['lifetime'])) { + $this->lifetime = $config['lifetime']; } } diff --git a/module/VuFind/src/VuFind/Session/AbstractBaseFactory.php b/module/VuFind/src/VuFind/Session/AbstractBaseFactory.php index c2601222555b..ba297c2949c5 100644 --- a/module/VuFind/src/VuFind/Session/AbstractBaseFactory.php +++ b/module/VuFind/src/VuFind/Session/AbstractBaseFactory.php @@ -71,8 +71,8 @@ public function __invoke( throw new \Exception('Unexpected options passed to factory.'); } - $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'); - $service = new $requestedName($config->Session ?? null); + $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'); + $service = new $requestedName($config['Session'] ?? null); $service->setDbServiceManager( $container->get(\VuFind\Db\Service\PluginManager::class) ); diff --git a/module/VuFind/src/VuFind/Session/File.php b/module/VuFind/src/VuFind/Session/File.php index 1ac662946688..40d5bc52b732 100644 --- a/module/VuFind/src/VuFind/Session/File.php +++ b/module/VuFind/src/VuFind/Session/File.php @@ -29,8 +29,6 @@ namespace VuFind\Session; -use VuFind\Config\Config; - use function function_exists; use function strlen; @@ -55,16 +53,16 @@ class File extends AbstractBase /** * Constructor. * - * @param ?Config $config Session configuration ([Session] section of + * @param ?array $config Session configuration ([Session] section of * config.ini) */ - public function __construct(?Config $config = null) + public function __construct(?array $config = null) { parent::__construct($config); // Set defaults if nothing set in config file. - if (isset($config->file_save_path)) { - $this->path = $config->file_save_path; + if (isset($config['file_save_path'])) { + $this->path = $config['file_save_path']; } else { $tempdir = function_exists('sys_get_temp_dir') ? sys_get_temp_dir() : DIRECTORY_SEPARATOR . 'tmp'; diff --git a/module/VuFind/src/VuFind/Session/Memcache.php b/module/VuFind/src/VuFind/Session/Memcache.php index c1ddc00e862c..baa3ffa02e57 100644 --- a/module/VuFind/src/VuFind/Session/Memcache.php +++ b/module/VuFind/src/VuFind/Session/Memcache.php @@ -32,8 +32,6 @@ namespace VuFind\Session; -use VuFind\Config\Config; - use function get_class; use function in_array; @@ -58,10 +56,10 @@ class Memcache extends AbstractBase /** * Constructor. * - * @param ?Config $config Session configuration ([Session] section of config.ini) + * @param ?array $config Session configuration ([Session] section of config.ini) * @param \Memcache|\Memcached|null $client Optional Memcache client object */ - public function __construct(?Config $config = null, ?object $client = null) + public function __construct(?array $config = null, ?object $client = null) { parent::__construct($config); $this->connect($config, $client); @@ -70,18 +68,18 @@ public function __construct(?Config $config = null, ?object $client = null) /** * Set up the connection to Memcache. * - * @param ?Config $config Session configuration ([Session] section of config.ini) + * @param ?array $config Session configuration ([Session] section of config.ini) * @param \Memcache|\Memcached|null $client Optional Memcache client object * * @return void */ - protected function connect(?Config $config, ?object $client): void + protected function connect(?array $config, ?object $client): void { // Set defaults if nothing set in config file. - $host = $config->memcache_host ?? 'localhost'; - $port = $config->memcache_port ?? 11211; - $timeout = $config->memcache_connection_timeout ?? 1; - $clientClass = $config->memcache_client ?? \Memcache::class; + $host = $config['memcache_host'] ?? 'localhost'; + $port = $config['memcache_port'] ?? 11211; + $timeout = $config['memcache_connection_timeout'] ?? 1; + $clientClass = $config['memcache_client'] ?? \Memcache::class; // Create/validate client object: if (!in_array($clientClass, [\Memcache::class, \Memcached::class])) { diff --git a/module/VuFind/src/VuFind/Session/Redis.php b/module/VuFind/src/VuFind/Session/Redis.php index f9afe632b3bd..9374088dfd40 100644 --- a/module/VuFind/src/VuFind/Session/Redis.php +++ b/module/VuFind/src/VuFind/Session/Redis.php @@ -35,8 +35,6 @@ namespace VuFind\Session; -use VuFind\Config\Config; - /** * Redis session handler. * @@ -70,13 +68,13 @@ class Redis extends AbstractBase * Constructor. * * @param \Credis_Client $connection Redis connection object - * @param ?Config $config Session configuration ([Session] section of + * @param ?array $config Session configuration ([Session] section of * config.ini) */ - public function __construct(\Credis_Client $connection, ?Config $config = null) + public function __construct(\Credis_Client $connection, ?array $config = null) { parent::__construct($config); - $this->redisVersion = (int)($config->redis_version ?? 3); + $this->redisVersion = (int)($config['redis_version'] ?? 3); $this->connection = $connection; $this->retryOptions['retryCount'] = 2; } diff --git a/module/VuFind/src/VuFind/Session/RedisFactory.php b/module/VuFind/src/VuFind/Session/RedisFactory.php index cc48f0f8f276..f8226b220009 100644 --- a/module/VuFind/src/VuFind/Session/RedisFactory.php +++ b/module/VuFind/src/VuFind/Session/RedisFactory.php @@ -72,7 +72,7 @@ public function __invoke( } $config = $container->get(\VuFind\Config\ConfigManagerInterface::class) - ->getConfigObject('config')->Session ?? null; + ->getConfigArray('config')['Session'] ?? null; $service = new $requestedName($this->getConnection($config), $config); $service->setDbServiceManager( $container->get(\VuFind\Db\Service\PluginManager::class) @@ -83,19 +83,19 @@ public function __invoke( /** * Given a configuration, build the client object. * - * @param \VuFind\Config\Config $config Session configuration + * @param array $config Session configuration * * @return \Credis_Client */ - protected function getConnection(\VuFind\Config\Config $config) + protected function getConnection(array $config) { // Set defaults if nothing set in config file. - $host = $config->redis_host ?? 'localhost'; - $port = $config->redis_port ?? 6379; - $timeout = $config->redis_connection_timeout ?? 0.5; - $password = $config->redis_auth ?? null; - $username = $config->redis_user ?? null; - $redisDb = $config->redis_db ?? 0; + $host = $config['redis_host'] ?? 'localhost'; + $port = $config['redis_port'] ?? 6379; + $timeout = $config['redis_connection_timeout'] ?? 0.5; + $password = $config['redis_auth'] ?? null; + $username = $config['redis_user'] ?? null; + $redisDb = $config['redis_db'] ?? 0; // Create Credis client, the connection is established lazily $client = new \Credis_Client( @@ -107,7 +107,7 @@ protected function getConnection(\VuFind\Config\Config $config) $password, $username ); - if ((bool)($config->redis_standalone ?? true)) { + if ((bool)($config['redis_standalone'] ?? true)) { $client->forceStandalone(); } return $client; diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Session/DatabaseTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Session/DatabaseTest.php index 6b1f46296ffc..2bbf26e6366a 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Session/DatabaseTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Session/DatabaseTest.php @@ -30,7 +30,6 @@ namespace VuFindTest\Session; use PHPUnit\Framework\MockObject\MockObject; -use VuFind\Config\Config; use VuFind\Db\Service\SessionServiceInterface; use VuFind\Session\Database; @@ -67,7 +66,7 @@ public function testRead(): void */ public function testReadWithNonDefaultLifetime(): void { - $handler = $this->getHandler(new Config(['lifetime' => 1000])); + $handler = $this->getHandler(['lifetime' => 1000]); $session = $this->getMockSessionService(); $session->expects($this->once())->method('readSession') ->with('foo', 1000) @@ -123,11 +122,11 @@ public function testDestroy(): void /** * Get the session handler to test. * - * @param ?Config $config Optional configuration + * @param ?array $config Optional configuration * * @return Database */ - protected function getHandler(?Config $config = null): Database + protected function getHandler(?array $config = null): Database { $handler = new Database($config); $this->injectMockDatabaseDependencies($handler); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Session/FileTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Session/FileTest.php index 86cba6d0495b..b1f6f9ecb4ab 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Session/FileTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Session/FileTest.php @@ -78,14 +78,14 @@ public function tearDown(): void * * @return void */ - public function testWriteReadAndDestroy() + public function testWriteReadAndDestroy(): void { $handler = $this->getHandler(); $this->assertTrue($handler->write('foo', 'bar')); - $this->assertEquals('bar', $handler->read('foo')); + $this->assertSame('bar', $handler->read('foo')); $this->setUpDestroyExpectations('foo'); $this->assertTrue($handler->destroy('foo')); - $this->assertEquals('', $handler->read('foo')); + $this->assertSame('', $handler->read('foo')); } /** @@ -93,22 +93,22 @@ public function testWriteReadAndDestroy() * * @return void */ - public function testDisabledWrites() + public function testDisabledWrites(): void { $handler = $this->getHandler(); $handler->disableWrites(); $this->assertTrue($handler->write('foo', 'bar')); - $this->assertEquals('', $handler->read('foo')); + $this->assertSame('', $handler->read('foo')); // Now test re-enabling writes: $handler->enableWrites(); $this->assertTrue($handler->write('foo', 'bar')); - $this->assertEquals('bar', $handler->read('foo')); + $this->assertSame('bar', $handler->read('foo')); // Now clean up after ourselves: $this->setUpDestroyExpectations('foo'); $this->assertTrue($handler->destroy('foo')); - $this->assertEquals('', $handler->read('foo')); + $this->assertSame('', $handler->read('foo')); } /** @@ -116,30 +116,28 @@ public function testDisabledWrites() * * @return void */ - public function testGarbageCollector() + public function testGarbageCollector(): void { $handler = $this->getHandler(); $this->assertTrue($handler->write('foo', 'bar')); - $this->assertEquals('bar', $handler->read('foo')); + $this->assertSame('bar', $handler->read('foo')); // Use a negative garbage collection age so we can purge everything // without having to wait for time to pass in the test! $this->assertEquals(1, $handler->gc(-1)); - $this->assertEquals('', $handler->read('foo')); + $this->assertSame('', $handler->read('foo')); } /** * Get the session handler to test. * - * @param \VuFind\Config\Config $config Optional configuration + * @param ?array $config Optional configuration * - * @return Database + * @return File */ - protected function getHandler($config = null) + protected function getHandler(?array $config = null): File { if (null === $config) { - $config = new \VuFind\Config\Config( - ['file_save_path' => $this->path] - ); + $config = ['file_save_path' => $this->path]; } $handler = new File($config); $this->injectMockDatabaseDependencies($handler); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Session/MemcacheTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Session/MemcacheTest.php index 859df1bc2d3d..8d24d3b7814b 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Session/MemcacheTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Session/MemcacheTest.php @@ -29,7 +29,6 @@ namespace VuFindTest\Session; -use VuFind\Config\Config; use VuFind\Session\Memcache; /** @@ -191,7 +190,7 @@ public function testDestroy(): void */ protected function getHandler(array $config = [], ?\Memcached $client = null): Memcache { - $handler = new Memcache(new Config($config), $client); + $handler = new Memcache($config, $client); $this->injectMockDatabaseDependencies($handler); return $handler; } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Session/RedisTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Session/RedisTest.php index 5b3c1b70b4c0..c2dceb48ec70 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Session/RedisTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Session/RedisTest.php @@ -47,7 +47,7 @@ class RedisTest extends \VuFindTest\Unit\SessionHandlerTestCase * * @return void */ - public function testRead() + public function testRead(): void { $client = $this->createMock(\Credis_Client::class); $client->expects($this->once())->method('__call') @@ -61,7 +61,7 @@ function ($method, $args) { } ); $handler = $this->getHandler($client); - $this->assertEquals('bar', $handler->read('foo')); + $this->assertSame('bar', $handler->read('foo')); } /** @@ -69,7 +69,7 @@ function ($method, $args) { * * @return void */ - public function testWrite() + public function testWrite(): void { $client = $this->createMock(\Credis_Client::class); $client->expects($this->once())->method('__call') @@ -93,7 +93,7 @@ function ($method, $args) { * * @return void */ - public function testDestroyDefault() + public function testDestroyDefault(): void { $client = $this->createMock(\Credis_Client::class); $client->expects($this->once())->method('__call') @@ -117,7 +117,7 @@ function ($method, $args) { * * @return void */ - public function testDestroyNewRedis() + public function testDestroyNewRedis(): void { $client = $this->createMock(\Credis_Client::class); $client->expects($this->once())->method('__call') @@ -130,9 +130,7 @@ function ($method, $args) { return null; } ); - $config = new \VuFind\Config\Config( - ['redis_version' => 4] - ); + $config = ['redis_version' => 4]; $handler = $this->getHandler($client, $config); $this->setUpDestroyExpectations('foo'); @@ -142,12 +140,12 @@ function ($method, $args) { /** * Get the session handler to test. * - * @param \Credis_Client $client Client object - * @param \VuFind\Config\Config $config Optional configuration + * @param \Credis_Client $client Client object + * @param ?array $config Optional configuration * - * @return Database + * @return Redis */ - protected function getHandler($client, $config = null) + protected function getHandler(\Credis_Client $client, ?array $config = null): Redis { $handler = new Redis($client, $config); $this->injectMockDatabaseDependencies($handler); From d01cbb71e9ebbfd427c86eb4ea033476c4c7e816 Mon Sep 17 00:00:00 2001 From: Ere Maijala Date: Wed, 9 Sep 2026 14:19:32 +0300 Subject: [PATCH 38/90] Refactor ErrorController to actions. (#5533) --- module/VuFind/config/module.config.php | 3 - .../Action/Error/PermissionDeniedAction.php | 75 +++++++++++++++++++ .../Error/UnavailableAction.php} | 46 ++++++------ .../src/VuFind/Action/PluginManager.php | 2 + 4 files changed, 98 insertions(+), 28 deletions(-) create mode 100644 module/VuFind/src/VuFind/Action/Error/PermissionDeniedAction.php rename module/VuFind/src/VuFind/{Controller/ErrorController.php => Action/Error/UnavailableAction.php} (56%) diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 6c316aca9e3e..51d656e6fb73 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -169,7 +169,6 @@ 'factories' => [ 'VuFind\Controller\EITController' => 'VuFind\Controller\AbstractBaseFactory', 'VuFind\Controller\EPFController' => 'VuFind\Controller\AbstractBaseFactory', - 'VuFind\Controller\ErrorController' => 'VuFind\Controller\AbstractBaseFactory', 'VuFind\Controller\Search2Controller' => 'VuFind\Controller\AbstractBaseFactory', 'VuFind\Controller\HierarchyController' => 'VuFind\Controller\AbstractBaseFactory', 'VuFind\Controller\HoldsController' => 'VuFind\Controller\HoldsControllerFactory', @@ -207,8 +206,6 @@ 'eit' => 'VuFind\Controller\EITController', 'EPF' => 'VuFind\Controller\EPFController', 'epf' => 'VuFind\Controller\EPFController', - 'Error' => 'VuFind\Controller\ErrorController', - 'error' => 'VuFind\Controller\ErrorController', 'Search2' => 'VuFind\Controller\Search2Controller', 'search2' => 'VuFind\Controller\Search2Controller', 'Hierarchy' => 'VuFind\Controller\HierarchyController', diff --git a/module/VuFind/src/VuFind/Action/Error/PermissionDeniedAction.php b/module/VuFind/src/VuFind/Action/Error/PermissionDeniedAction.php new file mode 100644 index 000000000000..265c6017e0a0 --- /dev/null +++ b/module/VuFind/src/VuFind/Action/Error/PermissionDeniedAction.php @@ -0,0 +1,75 @@ +. + * + * @category VuFind + * @package Action + * @author Demian Katz + * @author Ere Maijala + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ + +namespace VuFind\Action\Error; + +use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\ServerRequestInterface; +use VuFind\Action\AbstractTemplateRenderingAction; + +/** + * "Permission denied" error action. + * + * @category VuFind + * @package Action + * @author Demian Katz + * @author Ere Maijala + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +class PermissionDeniedAction extends AbstractTemplateRenderingAction +{ + /** + * Display error page. + * + * @param ServerRequestInterface $request Server request + * @param ResponseInterface $response Response + * + * @return ResponseInterface + */ + public function action( + ServerRequestInterface $request, + ResponseInterface $response, + ): ResponseInterface { + return $this->renderTemplate($request, $response->withStatus(403), ['msg' => $this->getQueryParam('msg')]); + } + + /** + * Validate any access permission for the action. + * + * @return ?ResponseInterface A response if access is denied, null otherwise + */ + public function validateAccessPermission(): ?ResponseInterface + { + // Access to "permission denied" page is always allowed: + return null; + } +} diff --git a/module/VuFind/src/VuFind/Controller/ErrorController.php b/module/VuFind/src/VuFind/Action/Error/UnavailableAction.php similarity index 56% rename from module/VuFind/src/VuFind/Controller/ErrorController.php rename to module/VuFind/src/VuFind/Action/Error/UnavailableAction.php index 44c10e650ebe..de01a664de45 100644 --- a/module/VuFind/src/VuFind/Controller/ErrorController.php +++ b/module/VuFind/src/VuFind/Action/Error/UnavailableAction.php @@ -1,11 +1,12 @@ . * * @category VuFind - * @package Controller + * @package Action * @author Demian Katz + * @author Ere Maijala * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org Main Site */ -namespace VuFind\Controller; +namespace VuFind\Action\Error; -use Laminas\Mvc\Controller\AbstractActionController; +use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\ServerRequestInterface; +use VuFind\Action\AbstractTemplateRenderingAction; /** - * Error Controller. + * "Unavailable" error action. * * @category VuFind - * @package Controller + * @package Action * @author Demian Katz + * @author Ere Maijala * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org Main Site */ -class ErrorController extends AbstractActionController +class UnavailableAction extends AbstractTemplateRenderingAction { /** - * Display unavailable message. + * Display error page. * - * @return mixed - */ - public function unavailableAction() - { - $this->getResponse()->setStatusCode(503); - return new \Laminas\View\Model\ViewModel(); - } - - /** - * Display permission denied message. + * @param ServerRequestInterface $request Server request + * @param ResponseInterface $response Response * - * @return mixed + * @return ResponseInterface */ - public function permissionDeniedAction() - { - $this->getResponse()->setStatusCode(403); - return new \Laminas\View\Model\ViewModel( - ['msg' => $this->params()->fromQuery('msg')] - ); + public function action( + ServerRequestInterface $request, + ResponseInterface $response, + ): ResponseInterface { + return $this->renderTemplate($request, $response->withStatus(503)); } } diff --git a/module/VuFind/src/VuFind/Action/PluginManager.php b/module/VuFind/src/VuFind/Action/PluginManager.php index 6851766a4216..aa23b71394c6 100644 --- a/module/VuFind/src/VuFind/Action/PluginManager.php +++ b/module/VuFind/src/VuFind/Action/PluginManager.php @@ -113,6 +113,8 @@ class PluginManager extends \VuFind\ServiceManager\AbstractPluginManager 'eitrecord/save' => Record\SaveAction::class, 'eitrecord/sms' => Record\SmsAction::class, + 'error/permissiondenied' => Error\PermissionDeniedAction::class, + 'externalauth/ezproxylogin' => ExternalAuth\EzproxyLoginAction::class, 'missingrecord/home' => MissingRecord\HomeAction::class, From 861a88917a61a689ae4fd5575e5d7bcb468dbaee Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Wed, 9 Sep 2026 07:19:50 -0400 Subject: [PATCH 39/90] Add Mink test for System/available setting. (#5650) --- .../src/VuFindTest/Mink/BasicTest.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BasicTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BasicTest.php index e9d51273888b..7873d160c3e7 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BasicTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BasicTest.php @@ -48,7 +48,22 @@ class BasicTest extends \VuFindTest\Integration\MinkTestCase public function testHomePage(): void { $page = $this->getSearchHomePage(); - $this->assertStringContainsString('VuFind', (string)$page->getContent()); + $content = (string)$page->getContent(); + $this->assertStringContainsString('VuFind', $content); + // Confirm that the system IS available by default (see testUnavailableHomePage below for the other case): + $this->assertStringNotContainsString('System Unavailable', $content); + } + + /** + * Test that the home page can be made unavailable. + * + * @return void + */ + public function testUnavailableHomePage(): void + { + $this->changeConfigs(['config' => ['System' => ['available' => false]]]); + $page = $this->getSearchHomePage(); + $this->assertStringContainsString('System Unavailable', (string)$page->getContent()); } /** From 3b97a9373e6c24acf48f03199ace648a55f0cbfc Mon Sep 17 00:00:00 2001 From: Thomas Wagener Date: Wed, 9 Sep 2026 13:26:06 +0200 Subject: [PATCH 40/90] Fix upgrading in subdirectories (#5649) --- .../VuFind/src/VuFind/Config/Handler/Ini.php | 6 +++ .../VuFind/src/VuFind/Config/PathResolver.php | 26 ++++++++++-- .../configs/upgrade-create-sub-dir/EDS.ini | 2 + .../configs/upgrade-existing-sub-dir/EDS.ini | 2 + .../RecordDataFormatter/DefaultRecord.ini | 1 + .../VuFindTest/Config/ConfigUpgradeTest.php | 41 +++++++++++++++++++ 6 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 module/VuFind/tests/fixtures/configs/upgrade-create-sub-dir/EDS.ini create mode 100644 module/VuFind/tests/fixtures/configs/upgrade-existing-sub-dir/EDS.ini create mode 100644 module/VuFind/tests/fixtures/configs/upgrade-existing-sub-dir/RecordDataFormatter/DefaultRecord.ini diff --git a/module/VuFind/src/VuFind/Config/Handler/Ini.php b/module/VuFind/src/VuFind/Config/Handler/Ini.php index f48790165c8c..f4419afa9fff 100644 --- a/module/VuFind/src/VuFind/Config/Handler/Ini.php +++ b/module/VuFind/src/VuFind/Config/Handler/Ini.php @@ -208,6 +208,12 @@ public function writeConfig( if ($baseLocation !== null && file_exists($baseLocation->getPath()) && $baseLocation->getPath() !== $outfile) { // Copy from base to provide structure + $outfileDirectory = $destinationLocation->getBasePath(); + if (!is_dir($outfileDirectory) && !mkdir($outfileDirectory, recursive: true)) { + throw new FileAccessException( + "Error: Creating directory for {$outfile}." + ); + } if (!copy($baseLocation->getPath(), $outfile)) { throw new FileAccessException( "Error: Problem copying to {$outfile}." diff --git a/module/VuFind/src/VuFind/Config/PathResolver.php b/module/VuFind/src/VuFind/Config/PathResolver.php index 3b1cbc36f29e..7434ecd41c07 100644 --- a/module/VuFind/src/VuFind/Config/PathResolver.php +++ b/module/VuFind/src/VuFind/Config/PathResolver.php @@ -272,7 +272,7 @@ public function getForcedLocalConfigLocation(string $configName): ConfigLocation $baseConfigLocation = $this->getBaseConfigLocation($configName); $destinationLocation = clone $baseConfigLocation; $destinationLocation->setBasePath( - $this->getLocalConfigDirPath() + $this->getLocalConfigDirPath() . ($this->getConfigNameParts($configName)['subDir'] ?? '') ); return $destinationLocation; } @@ -383,11 +383,11 @@ public function getConfigLocationFromSpec( array $dirSpec, ?string $overrideConfigSubdir ): ?ConfigLocationInterface { - $configNameParts = explode('/', $configName, 2); - $subDir = (count($configNameParts) > 1) ? '/' . $configNameParts[0] : ''; + $configNameParts = $this->getConfigNameParts($configName); + $subDir = $configNameParts['subDir'] ?? ''; return $this->getMatchingConfigLocation( $this->buildPath($dirSpec, $overrideConfigSubdir) . $subDir, - $configNameParts[1] ?? $configName + $configNameParts['mainName'] ?? $configName ); } @@ -509,4 +509,22 @@ protected function buildPath( } return $path; } + + /** + * Splits the subdirectory in a config name from the main name and returns those parts. + * + * @param string $configName Config name + * + * @return array + */ + protected function getConfigNameParts(string $configName): array + { + $configNameParts = explode('/', $configName); + if (count($configNameParts) > 1) { + $res = ['mainName' => array_pop($configNameParts)]; + $res['subDir'] = '/' . implode('/', $configNameParts); + return $res; + } + return ['mainName' => $configName]; + } } diff --git a/module/VuFind/tests/fixtures/configs/upgrade-create-sub-dir/EDS.ini b/module/VuFind/tests/fixtures/configs/upgrade-create-sub-dir/EDS.ini new file mode 100644 index 000000000000..0b38d4cd8088 --- /dev/null +++ b/module/VuFind/tests/fixtures/configs/upgrade-create-sub-dir/EDS.ini @@ -0,0 +1,2 @@ +[ItemCoreFilter] +excludeLabel[] = 'Availability' diff --git a/module/VuFind/tests/fixtures/configs/upgrade-existing-sub-dir/EDS.ini b/module/VuFind/tests/fixtures/configs/upgrade-existing-sub-dir/EDS.ini new file mode 100644 index 000000000000..0b38d4cd8088 --- /dev/null +++ b/module/VuFind/tests/fixtures/configs/upgrade-existing-sub-dir/EDS.ini @@ -0,0 +1,2 @@ +[ItemCoreFilter] +excludeLabel[] = 'Availability' diff --git a/module/VuFind/tests/fixtures/configs/upgrade-existing-sub-dir/RecordDataFormatter/DefaultRecord.ini b/module/VuFind/tests/fixtures/configs/upgrade-existing-sub-dir/RecordDataFormatter/DefaultRecord.ini new file mode 100644 index 000000000000..52a7d9b66b84 --- /dev/null +++ b/module/VuFind/tests/fixtures/configs/upgrade-existing-sub-dir/RecordDataFormatter/DefaultRecord.ini @@ -0,0 +1 @@ +; content is not relevant diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Config/ConfigUpgradeTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Config/ConfigUpgradeTest.php index ac1a1d0743c6..f43794f9b146 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Config/ConfigUpgradeTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Config/ConfigUpgradeTest.php @@ -154,4 +154,45 @@ public function testMovingOfRecordDataFormatterConfig(): void $movedConfig ); } + + /** + * Upgrade with subdirectories test provider. + * + * @return \Iterator + */ + public static function upgradeWithSubdirectoryTestProvider(): \Iterator + { + yield 'upgrade-without-exisiting-sub-dir' => [ + 'upgrade-create-sub-dir', + ]; + yield 'upgrade-with-exisiting-sub-dir' => [ + 'upgrade-existing-sub-dir', + ]; + } + + /** + * Test upgrading with config subdirectories. + * + * @param string $fixture Fixture + * + * @return void + */ + #[\PHPUnit\Framework\Attributes\DataProvider('upgradeWithSubdirectoryTestProvider')] + public function testUpgradingInSubdirectoryWithoutExistingDir(string $fixture): void + { + $upgrader = $this->getUpgrader($fixture); + $upgrader->run(self::$targetVersion); + $upgradedConfig = $this->readConfig('RecordDataFormatter/EDS'); + $expectedConfig = $this->readConfig('RecordDataFormatter/EDS', $this->baseDirPath); + $expectedConfig['CoreItems']['extraLineOptions'][] = 'CoreItems_Filter_Label_Availability'; + $expectedConfig['CoreItems_Filter_Label_Availability'] = [ + 'lineIdentifierKey' => 'Label', + 'lineIdentifierValue' => 'Availability', + 'multiEnabled' => false, + ]; + $this->assertEquals( + $expectedConfig, + $upgradedConfig + ); + } } From 7c7546f9f7130262e6923478debfe98e9e69e273 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Sep 2026 15:37:16 +0300 Subject: [PATCH 41/90] Bump stripe/stripe-php from 21.0.0 to 21.3.1 (#5626) Bumps [stripe/stripe-php](https://github.com/stripe/stripe-php) from 21.0.0 to 21.3.1. - [Release notes](https://github.com/stripe/stripe-php/releases) - [Changelog](https://github.com/stripe/stripe-php/blob/master/CHANGELOG.md) - [Commits](https://github.com/stripe/stripe-php/compare/v21.0.0...v21.3.1) --- updated-dependencies: - dependency-name: stripe/stripe-php dependency-version: 21.3.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 023947fa967b..aaa5c33f5910 100644 --- a/composer.json +++ b/composer.json @@ -103,7 +103,7 @@ "serialssolutions/summon": "1.3.1", "spomky-labs/otphp": "11.5.0", "steverhoades/oauth2-openid-connect-server": "3.0.1", - "stripe/stripe-php": "v21.0.0", + "stripe/stripe-php": "v21.3.1", "swagger-api/swagger-ui": "5.32.14", "symfony/console": "6.4.25", "symfony/mailer": "^7.4", diff --git a/composer.lock b/composer.lock index efdae8f346a9..8f8d49a424d3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2bc2ecac48e2294f4594679cbc6dc6f2", + "content-hash": "43090f804f788a9d46684ed8291d55bd", "packages": [ { "name": "ahand/mobileesp", @@ -9450,16 +9450,16 @@ }, { "name": "stripe/stripe-php", - "version": "v21.0.0", + "version": "v21.3.1", "source": { "type": "git", "url": "https://github.com/stripe/stripe-php.git", - "reference": "0498d20d0c33490c38df956dd7cef49b3a2ad6f0" + "reference": "12986995cd5e229cc094d4b57de056f8e2e6e5a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stripe/stripe-php/zipball/0498d20d0c33490c38df956dd7cef49b3a2ad6f0", - "reference": "0498d20d0c33490c38df956dd7cef49b3a2ad6f0", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/12986995cd5e229cc094d4b57de056f8e2e6e5a9", + "reference": "12986995cd5e229cc094d4b57de056f8e2e6e5a9", "shasum": "" }, "require": { @@ -9506,9 +9506,9 @@ ], "support": { "issues": "https://github.com/stripe/stripe-php/issues", - "source": "https://github.com/stripe/stripe-php/tree/v21.0.0" + "source": "https://github.com/stripe/stripe-php/tree/v21.3.1" }, - "time": "2026-07-16T00:34:23+00:00" + "time": "2026-09-01T18:42:58+00:00" }, { "name": "swagger-api/swagger-ui", From 67f63f806b55c2f9cc7a45bdf90927c73c9be6c9 Mon Sep 17 00:00:00 2001 From: Maccabee Levine <31278545+maccabeelevine@users.noreply.github.com> Date: Wed, 9 Sep 2026 07:36:36 -0400 Subject: [PATCH 42/90] Fix stale refreshOnClose when lightbox is closed (#5647) --- themes/bootstrap5/js/lightbox.js | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/bootstrap5/js/lightbox.js b/themes/bootstrap5/js/lightbox.js index 8c82ac4b8e31..8d7a6ddb652a 100644 --- a/themes/bootstrap5/js/lightbox.js +++ b/themes/bootstrap5/js/lightbox.js @@ -576,6 +576,7 @@ VuFind.register('lightbox', function Lightbox() { _currentUrl = false; _lbReferrerUrl = false; _lightboxTitle = false; + VuFind.lightbox.refreshOnClose = false; _modalParams = {}; } From 101a171283e896de6d5bc34c2a1deed5a1681d1f Mon Sep 17 00:00:00 2001 From: Maccabee Levine <31278545+maccabeelevine@users.noreply.github.com> Date: Wed, 9 Sep 2026 09:06:45 -0400 Subject: [PATCH 43/90] Fix arbitrary attributes flag in script rendering (#5648) Assisted-by: Sonnet 5 (Anthropic) Co-authored-by: Demian Katz --- .../VuFindTheme/View/Helper/AssetManager.php | 8 ++-- .../View/Helper/AssetManagerTest.php | 43 +++++++++++++++---- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/module/VuFindTheme/src/VuFindTheme/View/Helper/AssetManager.php b/module/VuFindTheme/src/VuFindTheme/View/Helper/AssetManager.php index 6130c94cf829..615257597c5c 100644 --- a/module/VuFindTheme/src/VuFindTheme/View/Helper/AssetManager.php +++ b/module/VuFindTheme/src/VuFindTheme/View/Helper/AssetManager.php @@ -407,8 +407,8 @@ public function outputInlineScriptString( $resetArbitraryAttributes = $this->applyArbitraryScriptAttributesOption($this->inlineScript, $options); $type = $attrs['type'] ?? 'text/javascript'; unset($attrs['type']); - $this->inlineScript->setScript($script, $type, $attrs); - $result = ($this->inlineScript)(); + $inlineScript->setScript($script, $type, $attrs); + $result = (string)($inlineScript)(); if ($resetArbitraryAttributes !== null) { $this->inlineScript->setAllowArbitraryAttributes($resetArbitraryAttributes); } @@ -438,8 +438,8 @@ public function outputInlineScriptLink( $resetArbitraryAttributes = $this->applyArbitraryScriptAttributesOption($this->inlineScript, $options); $type = $attrs['type'] ?? 'text/javascript'; unset($attrs['type']); - $this->inlineScript->setFile($src, $type, $attrs); - $result = ($this->inlineScript)(); + $inlineScript->setFile($src, $type, $attrs); + $result = (string)($inlineScript)(); if ($resetArbitraryAttributes !== null) { $this->inlineScript->setAllowArbitraryAttributes($resetArbitraryAttributes); } diff --git a/module/VuFindTheme/tests/unit-tests/src/VuFindTest/View/Helper/AssetManagerTest.php b/module/VuFindTheme/tests/unit-tests/src/VuFindTest/View/Helper/AssetManagerTest.php index 607b98b249a3..a6d1af30f6ff 100644 --- a/module/VuFindTheme/tests/unit-tests/src/VuFindTest/View/Helper/AssetManagerTest.php +++ b/module/VuFindTheme/tests/unit-tests/src/VuFindTest/View/Helper/AssetManagerTest.php @@ -30,6 +30,7 @@ namespace VuFindTest\View\Helper; use Laminas\View\Helper\InlineScript; +use PHPUnit\Framework\MockObject\MockObject; use VuFindTest\Feature\ViewTrait; use VuFindTheme\AssetPipeline; use VuFindTheme\ThemeInfo; @@ -62,6 +63,34 @@ public static function outputInlineScriptProvider(): \Iterator yield 'arbitrary MIME type' => [['type' => 'mime/type'], false, 'mime/type']; } + /** + * Mock the Laminas InlineScript helper with functional "allow arbitrary attribute" support to + * test behavior that could lead to subtle bugs. + * + * @return InlineScript&MockObject + */ + public function getMockInlineScriptHelper(): InlineScript&MockObject + { + $inlineScriptHelper = $this->createMock(InlineScript::class); + $currentlyAllowed = false; + $inlineScriptHelper->method('arbitraryAttributesAllowed') + ->willReturnCallback(function () use (&$currentlyAllowed) { + return $currentlyAllowed; + }); + $inlineScriptHelper->method('setAllowArbitraryAttributes') + ->willReturnCallback(function ($flag) use (&$currentlyAllowed): void { + $currentlyAllowed = $flag; + }); + // Note that the invoke method returns the helper itself -- not a string. + // This matches the actual helper's behavior. + $inlineScriptHelper->method('__invoke')->willReturnSelf(); + $inlineScriptHelper->method('__toString') + ->willReturnCallback(function () use (&$currentlyAllowed) { + return 'output:' . ($currentlyAllowed ? '1' : '0'); + }); + return $inlineScriptHelper; + } + /** * Test that outputInlineScriptLink() behaves as expected. * @@ -75,8 +104,7 @@ public static function outputInlineScriptProvider(): \Iterator public function testOutputInlineScriptLink(array $attrs, bool $arbitrary, string $expectedType): void { $script = 'foo.js'; - $inlineScriptHelper = $this->createMock(InlineScript::class); - $inlineScriptHelper->method('arbitraryAttributesAllowed')->willReturn(false); + $inlineScriptHelper = $this->getMockInlineScriptHelper(); $inlineScriptHelper ->expects($arbitrary ? $this->exactly(2) : $this->never()) ->method('setAllowArbitraryAttributes'); @@ -85,7 +113,6 @@ public function testOutputInlineScriptLink(array $attrs, bool $arbitrary, string ->expects($this->once()) ->method('__call') ->with('setFile', [$script, $expectedType, $expectedAttrs]); - $inlineScriptHelper->method('__invoke')->willReturn('output'); $view = $this->getPhpRenderer(['inlineScript' => $inlineScriptHelper]); $assetManager = new AssetManager( $this->createMock(ThemeInfo::class), @@ -96,7 +123,8 @@ public function testOutputInlineScriptLink(array $attrs, bool $arbitrary, string $inlineScriptHelper ); $options = ['allow_arbitrary_attributes' => $arbitrary]; - $this->assertSame('output', $assetManager->outputInlineScriptLink($script, $attrs, $options)); + $expected = 'output:' . ($arbitrary ? '1' : '0'); + $this->assertEquals($expected, $assetManager->outputInlineScriptLink($script, $attrs, $options)); } /** @@ -112,8 +140,7 @@ public function testOutputInlineScriptLink(array $attrs, bool $arbitrary, string public function testOutputInlineScriptString(array $attrs, bool $arbitrary, string $expectedType): void { $script = 'foo'; - $inlineScriptHelper = $this->createMock(InlineScript::class); - $inlineScriptHelper->method('arbitraryAttributesAllowed')->willReturn(false); + $inlineScriptHelper = $this->getMockInlineScriptHelper(); $inlineScriptHelper ->expects($arbitrary ? $this->exactly(2) : $this->never()) ->method('setAllowArbitraryAttributes'); @@ -122,7 +149,6 @@ public function testOutputInlineScriptString(array $attrs, bool $arbitrary, stri ->expects($this->once()) ->method('__call') ->with('setScript', [$script, $expectedType, $expectedAttrs]); - $inlineScriptHelper->method('__invoke')->willReturn('output'); $view = $this->getPhpRenderer(['inlineScript' => $inlineScriptHelper]); $assetManager = new AssetManager( $this->createMock(ThemeInfo::class), @@ -133,7 +159,8 @@ public function testOutputInlineScriptString(array $attrs, bool $arbitrary, stri $inlineScriptHelper ); $options = ['allow_arbitrary_attributes' => $arbitrary]; - $this->assertSame('output', $assetManager->outputInlineScriptString($script, $attrs, $options)); + $expected = 'output:' . ($arbitrary ? '1' : '0'); + $this->assertEquals($expected, $assetManager->outputInlineScriptString($script, $attrs, $options)); } /** From efc5f4430038906a4b6d4569bdea787a1b48196f Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Wed, 9 Sep 2026 09:30:06 -0400 Subject: [PATCH 44/90] Use config array instead of object for WorldCat2 BackendFactory (#5621) --- .../Factory/WorldCat2BackendFactory.php | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/module/VuFind/src/VuFind/Search/Factory/WorldCat2BackendFactory.php b/module/VuFind/src/VuFind/Search/Factory/WorldCat2BackendFactory.php index e0b3a2abbc6a..44d1e3a9d18b 100644 --- a/module/VuFind/src/VuFind/Search/Factory/WorldCat2BackendFactory.php +++ b/module/VuFind/src/VuFind/Search/Factory/WorldCat2BackendFactory.php @@ -38,7 +38,6 @@ use Psr\Container\ContainerExceptionInterface as ContainerException; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; -use VuFind\Config\Config; use VuFind\Http\GuzzleService; use VuFindSearch\Backend\WorldCat2\Backend; use VuFindSearch\Backend\WorldCat2\Connector; @@ -64,19 +63,12 @@ class WorldCat2BackendFactory extends AbstractBackendFactory */ protected LoggerInterface $logger; - /** - * VuFind configuration. - * - * @var Config - */ - protected Config $config; - /** * WorldCat v2 configuration. * - * @var Config + * @var array */ - protected Config $wcConfig; + protected array $wcConfig; /** * Create an object. @@ -101,8 +93,7 @@ public function __invoke( ) { $this->setup($container); $configManager = $this->getService(\VuFind\Config\ConfigManagerInterface::class); - $this->config = $configManager->getConfigObject('config'); - $this->wcConfig = $configManager->getConfigObject('WorldCat2'); + $this->wcConfig = $configManager->getConfigArray('WorldCat2'); if ($this->serviceLocator->has(\VuFind\Log\Logger::class)) { $this->logger = $this->getService(\VuFind\Log\Logger::class); } @@ -162,7 +153,7 @@ protected function createAuthProvider(array $options): GenericProvider */ protected function createConnector(): Connector { - $connectorOptions = $this?->wcConfig?->Connector?->toArray() ?? []; + $connectorOptions = $this->wcConfig['Connector'] ?? []; $connector = new Connector( $this->createHttpClient(), $this->createAuthProvider($connectorOptions), @@ -180,7 +171,7 @@ protected function createConnector(): Connector */ protected function createQueryBuilder(): QueryBuilder { - $exclude = $this->wcConfig->General->exclude_code ?? null; + $exclude = $this->wcConfig['General']['exclude_code'] ?? null; return new QueryBuilder($exclude); } From 576ac4722c52c1650627589ba2826562ec6bedc9 Mon Sep 17 00:00:00 2001 From: Ere Maijala Date: Wed, 9 Sep 2026 16:44:03 +0300 Subject: [PATCH 45/90] KohaRest: Fix status message code check for NotForLoan or Lost status. (#5631) --- .../VuFind/src/VuFind/ILS/Driver/KohaRest.php | 16 +++--- .../VuFindTest/ILS/Driver/KohaRestTest.php | 50 +++++++++++++++++++ 2 files changed, 57 insertions(+), 9 deletions(-) diff --git a/module/VuFind/src/VuFind/ILS/Driver/KohaRest.php b/module/VuFind/src/VuFind/ILS/Driver/KohaRest.php index dee8c95e5c85..12e7585609a7 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/KohaRest.php +++ b/module/VuFind/src/VuFind/ILS/Driver/KohaRest.php @@ -2444,16 +2444,14 @@ protected function getStatusCodeItemCheckedOut($code, $data, $item) */ protected function getStatusCodeItemNotForLoanOrLost($code, $data, $item) { - // NotForLoan and Lost are special: status has a library-specific - // status number. Allow mapping of different status numbers - // separately (e.g. Item::NotForLoan with status number 4 - // is mapped with key Item::NotForLoan4): + // NotForLoan and Lost are special: status has a library-specific status number. Allow mapping of different + // status numbers separately (e.g. Item::NotForLoan with status number 4 is mapped with key Item::NotForLoan4): $statusKey = $code . ($data['status'] ?? '-'); - // Replace ':' in status key if used as status since ':' is - // the namespace separator in translatable strings: - return $this->itemStatusMappings[$statusKey] - ?? $this->getPrefixedMessage($data['code']) - ?? $this->getPrefixedMessage(str_replace(':', '_', $statusKey)); + if (null !== ($status = $this->itemStatusMappings[$statusKey] ?? null)) { + return $status; + } + // Replace ':' in status key if used as status since ':' is the namespace separator in translatable strings: + return $this->getPrefixedMessage($data['code'] ?? str_replace(':', '_', $statusKey)); } /** diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/KohaRestTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/KohaRestTest.php index 550384bd60d2..7c78b780afcd 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/KohaRestTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/ILS/Driver/KohaRestTest.php @@ -29,6 +29,7 @@ namespace VuFindTest\ILS\Driver; +use PHPUnit\Framework\Attributes\DataProvider; use VuFind\ILS\Driver\KohaRest; /** @@ -43,6 +44,7 @@ class KohaRestTest extends \VuFindTest\Unit\ILSDriverTestCase { use \VuFindTest\Feature\FixtureTrait; + use \VuFindTest\Feature\ReflectionTrait; /** * Default test configuration. @@ -217,4 +219,52 @@ public function testPurgeTransactionHistorySelected(): void $this->expectExceptionMessage('Unsupported function'); $this->driver->purgeTransactionHistory(['id' => 'bar'], [1, 2]); } + + /** + * Data provider for testGetStatusCodeItemNotForLoanOrLost. + * + * @return \Generator + */ + public static function getStatusCodeItemNotForLoanOrLostProvider(): \Iterator + { + yield 'no data' => [ + 'Item::NotForLoan', + [], + 'Item__NotForLoan-', + ]; + + yield 'status only' => [ + 'Item::NotForLoan', + [ + 'status' => '-', + ], + 'Item__NotForLoan-', + ]; + + yield 'code only' => [ + 'Item::NotForLoan', + [ + 'code' => 'foo', + ], + 'foo', + ]; + } + + /** + * Test getStatusCodeItemNotForLoanOrLost method. + * + * @param string $code Status code + * @param array $data Status data + * @param string $expected Expected result + * + * @return void + */ + #[DataProvider('getStatusCodeItemNotForLoanOrLostProvider')] + public function testGetStatusCodeItemNotForLoanOrLost(string $code, array $data, string $expected): void + { + $this->assertSame( + $expected, + $this->callMethod($this->driver, 'getStatusCodeItemNotForLoanOrLost', [$code, $data, []]) + ); + } } From ccea50b9b8c6f2fcf4cf30ddc5da1223db9a1db2 Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Wed, 9 Sep 2026 10:15:54 -0400 Subject: [PATCH 46/90] Use config array instead of object on Sitemap Generator (#5641) --- .../VuFind/src/VuFind/Sitemap/Generator.php | 33 +++++++++---------- .../src/VuFind/Sitemap/GeneratorFactory.php | 2 +- .../src/VuFindTest/Sitemap/GeneratorTest.php | 8 ++--- 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/module/VuFind/src/VuFind/Sitemap/Generator.php b/module/VuFind/src/VuFind/Sitemap/Generator.php index 15ae0310e113..c5a2bb07ae29 100644 --- a/module/VuFind/src/VuFind/Sitemap/Generator.php +++ b/module/VuFind/src/VuFind/Sitemap/Generator.php @@ -29,8 +29,6 @@ namespace VuFind\Sitemap; -use VuFind\Config\Config; - use function call_user_func; use function in_array; use function is_callable; @@ -114,27 +112,27 @@ class Generator * Constructor. * * @param string $baseUrl VuFind base URL - * @param Config $config Sitemap configuration settings + * @param array $config Sitemap configuration settings * @param array $locales Enabled locales * @param PluginManager $pluginManager Generator plugin manager */ public function __construct( protected $baseUrl, - protected Config $config, + protected array $config, array $locales, protected PluginManager $pluginManager ) { $this->languages = $this->getSitemapLanguages($locales); - $this->baseSitemapUrl = empty($this->config->SitemapIndex->baseSitemapUrl) - ? $this->baseUrl : $this->config->SitemapIndex->baseSitemapUrl; + $this->baseSitemapUrl = empty($this->config['SitemapIndex']['baseSitemapUrl']) + ? $this->baseUrl : $this->config['SitemapIndex']['baseSitemapUrl']; - $this->frequency = $this->config->Sitemap->frequency ?? 'weekly'; - $this->countPerPage = $this->config->Sitemap->countPerPage ?? 10000; - $this->fileLocation = $this->config->Sitemap->fileLocation ?? '/tmp'; - $this->fileStart = $this->config->Sitemap->fileName ?? 'sitemap'; - if (isset($this->config->SitemapIndex->indexFileName)) { - $this->indexFile = $this->config->SitemapIndex->indexFileName . '.xml'; + $this->frequency = $this->config['Sitemap']['frequency'] ?? 'weekly'; + $this->countPerPage = $this->config['Sitemap']['countPerPage'] ?? 10000; + $this->fileLocation = $this->config['Sitemap']['fileLocation'] ?? '/tmp'; + $this->fileStart = $this->config['Sitemap']['fileName'] ?? 'sitemap'; + if (isset($this->config['SitemapIndex']['indexFileName'])) { + $this->indexFile = $this->config['SitemapIndex']['indexFileName'] . '.xml'; } } @@ -270,8 +268,7 @@ protected function generateWithPlugins(): array }; // If no plugins are defined, use the Index plugin by default: - $plugins = isset($this->config->Sitemap->plugins) - ? $this->config->Sitemap->plugins->toArray() : ['Index']; + $plugins = $this->config['Sitemap']['plugins'] ?? ['Index']; $pluginSitemaps = []; foreach ($plugins as $pluginName) { $plugin = $this->getPlugin($pluginName); @@ -339,7 +336,7 @@ protected function buildIndex(array $sitemaps) // Add a group for a static sitemap file. // See sitemap.ini for more information on this option. - $indexSettings = $this->config->SitemapIndex->toArray(); + $indexSettings = $this->config['SitemapIndex'] ?? []; $baseSitemapFileNames = (array)($indexSettings['baseSitemapFileName'] ?? []); foreach ($baseSitemapFileNames as $baseSitemapFileName) { // Is the value already a fully-formed URL? If so, use it as-is; otherwise, @@ -456,15 +453,15 @@ protected function getPlugin(string $pluginName): Plugin\GeneratorPluginInterfac */ protected function getSitemapLanguages(array $locales): array { - if (empty($this->config->Sitemap->indexLanguageVersions)) { + if (empty($this->config['Sitemap']['indexLanguageVersions'])) { return []; } - if (trim($this->config->Sitemap->indexLanguageVersions) === '*') { + if (trim($this->config['Sitemap']['indexLanguageVersions']) === '*') { $filter = []; } else { $filter = array_map( 'trim', - explode(',', $this->config->Sitemap->indexLanguageVersions) + explode(',', $this->config['Sitemap']['indexLanguageVersions']) ); } $result = []; diff --git a/module/VuFind/src/VuFind/Sitemap/GeneratorFactory.php b/module/VuFind/src/VuFind/Sitemap/GeneratorFactory.php index 5ac2b44789e9..4756be9a556a 100644 --- a/module/VuFind/src/VuFind/Sitemap/GeneratorFactory.php +++ b/module/VuFind/src/VuFind/Sitemap/GeneratorFactory.php @@ -75,7 +75,7 @@ public function __invoke( ); return new $requestedName( $configManager->getConfigArray('config')['Site']['url'] ?? '', - $configManager->getConfigObject('sitemap'), + $configManager->getConfigArray('sitemap'), $enabledLocales, $container->get(\VuFind\Sitemap\PluginManager::class) ); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Sitemap/GeneratorTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Sitemap/GeneratorTest.php index 811032e8afd1..ea389c7d7bc6 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Sitemap/GeneratorTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Sitemap/GeneratorTest.php @@ -30,7 +30,6 @@ namespace VuFindTest\Sitemap; use PHPUnit\Framework\MockObject\MockObject; -use VuFind\Config\Config; use VuFind\Sitemap\Generator; use VuFind\Sitemap\PluginManager; use VuFind\Sitemap\SitemapIndex; @@ -85,7 +84,7 @@ protected function getGenerator( ) { return new Generator( $baseUrl, - new Config($config), + $config, $locales, $objects[PluginManager::class] ?? $this->container->get(PluginManager::class) @@ -211,7 +210,6 @@ public function testBuildIndex(array $config, string $expectationMethod): void // all non-empty configuration sets. $config['Sitemap']['fileLocation'] = $this->getFixturePath('sitemap'); } - $config = new Config($config); $pluginManager = $this->createMock(PluginManager::class); $mockIndex = $this->createMock(SitemapIndex::class); $this->$expectationMethod($mockIndex); @@ -219,12 +217,12 @@ public function testBuildIndex(array $config, string $expectationMethod): void /** * Constructor. * - * @param Config $config Sitemap configuration settings + * @param array $config Sitemap configuration settings * @param PluginManager $pluginManager Generator plugin manager * @param SitemapIndex $mockIndex Mock sitemap index to use */ public function __construct( - Config $config, + array $config, PluginManager $pluginManager, protected $mockIndex ) { From 305b4eb4e5c533cc12255a542d74097e84bda522 Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Wed, 9 Sep 2026 10:30:54 -0400 Subject: [PATCH 47/90] Use config array instead of object for ContentPages Sitemap plugin (#5642) Co-authored-by: Demian Katz --- .../VuFind/Sitemap/Plugin/ContentPages.php | 37 +++---------------- .../Sitemap/Plugin/ContentPagesFactory.php | 2 +- 2 files changed, 6 insertions(+), 33 deletions(-) diff --git a/module/VuFind/src/VuFind/Sitemap/Plugin/ContentPages.php b/module/VuFind/src/VuFind/Sitemap/Plugin/ContentPages.php index 25764b2cc412..771726a9b8c2 100644 --- a/module/VuFind/src/VuFind/Sitemap/Plugin/ContentPages.php +++ b/module/VuFind/src/VuFind/Sitemap/Plugin/ContentPages.php @@ -30,7 +30,6 @@ namespace VuFind\Sitemap\Plugin; use Laminas\Router\RouteStackInterface; -use VuFind\Config\Config; use VuFindTheme\ThemeInfo; use Webmozart\Glob\Glob; @@ -48,20 +47,6 @@ */ class ContentPages extends AbstractGeneratorPlugin { - /** - * Theme informations. - * - * @var ThemeInfo - */ - protected $themeInfo; - - /** - * Router. - * - * @var RouteStackInterface - */ - protected $router; - /** * Base URL for site. * @@ -69,13 +54,6 @@ class ContentPages extends AbstractGeneratorPlugin */ protected $baseUrl; - /** - * Main VuFind configuration (config.ini). - * - * @var Config - */ - protected $config; - /** * Patterns of files to be included. * @@ -111,16 +89,13 @@ class ContentPages extends AbstractGeneratorPlugin * * @param ThemeInfo $themeInfo Theme info * @param RouteStackInterface $router Router - * @param Config $config Main VuFind configuration + * @param array $config Main VuFind configuration (config.ini) */ public function __construct( - ThemeInfo $themeInfo, - RouteStackInterface $router, - Config $config + protected ThemeInfo $themeInfo, + protected RouteStackInterface $router, + protected array $config ) { - $this->themeInfo = $themeInfo; - $this->router = $router; - $this->config = $config; } /** @@ -156,9 +131,7 @@ public function getSitemapName(): string public function getUrls(): \Generator { $nonLanguageFiles = []; - $languages = isset($this->config->Languages) - ? array_keys($this->config->Languages->toArray()) - : []; + $languages = array_keys($this->config['Languages'] ?? []); foreach ($this->includedFiles as $fileSpec) { $files = $this->themeInfo->findInThemes([$fileSpec['path'] . $fileSpec['pattern']]); // Check each file for language suffix and combine the files into a diff --git a/module/VuFind/src/VuFind/Sitemap/Plugin/ContentPagesFactory.php b/module/VuFind/src/VuFind/Sitemap/Plugin/ContentPagesFactory.php index 3931f3ec52ba..fc8fa0731e2d 100644 --- a/module/VuFind/src/VuFind/Sitemap/Plugin/ContentPagesFactory.php +++ b/module/VuFind/src/VuFind/Sitemap/Plugin/ContentPagesFactory.php @@ -68,7 +68,7 @@ public function __invoke( if (!empty($options)) { throw new \Exception('Unexpected options passed to factory.'); } - $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'); + $config = $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'); return new $requestedName( $container->get(\VuFindTheme\ThemeInfo::class), $container->get('HttpRouter'), From 25a46884728b694fb227a910f174dbb44b61cd87 Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Wed, 9 Sep 2026 11:42:30 -0400 Subject: [PATCH 48/90] Use config array instead of object on ResolverLinks and SystemStatus Ajax Handlers (#5646) --- .../src/VuFind/AjaxHandler/GetResolverLinks.php | 15 +++++++-------- .../AjaxHandler/GetResolverLinksFactory.php | 2 +- .../src/VuFind/AjaxHandler/SystemStatus.php | 9 ++++----- .../VuFind/AjaxHandler/SystemStatusFactory.php | 2 +- .../VuFindTest/AjaxHandler/SystemStatusTest.php | 3 +-- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/module/VuFind/src/VuFind/AjaxHandler/GetResolverLinks.php b/module/VuFind/src/VuFind/AjaxHandler/GetResolverLinks.php index ba7fac6053d2..e2e75dea5aa8 100644 --- a/module/VuFind/src/VuFind/AjaxHandler/GetResolverLinks.php +++ b/module/VuFind/src/VuFind/AjaxHandler/GetResolverLinks.php @@ -31,7 +31,6 @@ namespace VuFind\AjaxHandler; use Psr\Http\Message\ServerRequestInterface; -use VuFind\Config\Config; use VuFind\Http\HttpStatus; use VuFind\I18n\Translator\TranslatorAwareInterface; use VuFind\Resolver\Connection; @@ -62,13 +61,13 @@ class GetResolverLinks extends AbstractBase implements TranslatorAwareInterface * @param SessionSettings $ss Session settings * @param ResolverManager $pluginManager Resolver driver plugin manager * @param TemplateRendererInterface $renderer Template renderer - * @param Config $config Top-level VuFind configuration (config.ini) + * @param array $config Top-level VuFind configuration (config.ini) */ public function __construct( SessionSettings $ss, protected ResolverManager $pluginManager, protected TemplateRendererInterface $renderer, - protected Config $config + protected array $config ) { parent::__construct($ss); } @@ -86,7 +85,7 @@ public function handleRequest(ServerRequestInterface $request): array $openUrl = $this->getQueryParam($request, 'openurl', ''); $searchClassId = $this->getQueryParam($request, 'searchClassId', ''); - $resolverType = $this->config->OpenURL->resolver ?? 'generic'; + $resolverType = $this->config['OpenURL']['resolver'] ?? 'generic'; if (!$this->pluginManager->has($resolverType)) { return $this->formatResponse( $this->translate("Could not load driver for $resolverType"), @@ -94,8 +93,8 @@ public function handleRequest(ServerRequestInterface $request): array ); } $resolver = new Connection($this->pluginManager->get($resolverType)); - if (isset($this->config->OpenURL->resolver_cache)) { - $resolver->enableCache($this->config->OpenURL->resolver_cache); + if (isset($this->config['OpenURL']['resolver_cache'])) { + $resolver->enableCache($this->config['OpenURL']['resolver_cache']); } $result = $resolver->fetchLinks($openUrl); @@ -124,10 +123,10 @@ public function handleRequest(ServerRequestInterface $request): array } // Get the OpenURL base: - if (isset($this->config->OpenURL->url)) { + if (isset($this->config['OpenURL']['url'])) { // Trim off any parameters (for legacy compatibility -- default config // used to include extraneous parameters): - [$base] = explode('?', $this->config->OpenURL->url); + [$base] = explode('?', $this->config['OpenURL']['url']); } else { $base = false; } diff --git a/module/VuFind/src/VuFind/AjaxHandler/GetResolverLinksFactory.php b/module/VuFind/src/VuFind/AjaxHandler/GetResolverLinksFactory.php index c718e8174a9e..2c1b5c6fd1f9 100644 --- a/module/VuFind/src/VuFind/AjaxHandler/GetResolverLinksFactory.php +++ b/module/VuFind/src/VuFind/AjaxHandler/GetResolverLinksFactory.php @@ -74,7 +74,7 @@ public function __invoke( $container->get(\VuFind\Session\Settings::class), $container->get(\VuFind\Resolver\Driver\PluginManager::class), $container->get(TemplateRendererInterface::class), - $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config') + $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config') ); } } diff --git a/module/VuFind/src/VuFind/AjaxHandler/SystemStatus.php b/module/VuFind/src/VuFind/AjaxHandler/SystemStatus.php index 9c7ff8e93d81..5e1a29f9c9f1 100644 --- a/module/VuFind/src/VuFind/AjaxHandler/SystemStatus.php +++ b/module/VuFind/src/VuFind/AjaxHandler/SystemStatus.php @@ -34,7 +34,6 @@ use Lmc\Rbac\Mvc\Service\AuthorizationServiceAwareInterface; use Lmc\Rbac\Mvc\Service\AuthorizationServiceAwareTrait; use Psr\Http\Message\ServerRequestInterface; -use VuFind\Config\Config; use VuFind\Db\Service\SessionServiceInterface; use VuFind\Exception\Forbidden; use VuFind\Http\HttpStatus; @@ -60,13 +59,13 @@ class SystemStatus extends AbstractBase implements \Psr\Log\LoggerAwareInterface * * @param SessionManager $sessionManager Session manager * @param ResultsManager $resultsManager Results manager - * @param Config $config Top-level VuFind configuration (config.ini) + * @param array $config Top-level VuFind configuration (config.ini) * @param SessionServiceInterface $sessionService Session database service */ public function __construct( protected SessionManager $sessionManager, protected ResultsManager $resultsManager, - protected Config $config, + protected array $config, protected SessionServiceInterface $sessionService ) { parent::__construct(null); @@ -90,8 +89,8 @@ public function handleRequest(ServerRequestInterface $request): array // Check system status if ( - !empty($this->config->System->healthCheckFile) - && file_exists($this->config->System->healthCheckFile) + !empty($this->config['System']['healthCheckFile']) + && file_exists($this->config['System']['healthCheckFile']) ) { return $this->formatResponse( 'Health check file exists', diff --git a/module/VuFind/src/VuFind/AjaxHandler/SystemStatusFactory.php b/module/VuFind/src/VuFind/AjaxHandler/SystemStatusFactory.php index 1a7225bbc7e7..bf90df4c64fc 100644 --- a/module/VuFind/src/VuFind/AjaxHandler/SystemStatusFactory.php +++ b/module/VuFind/src/VuFind/AjaxHandler/SystemStatusFactory.php @@ -75,7 +75,7 @@ public function __invoke( return new $requestedName( $container->get(\Laminas\Session\SessionManager::class), $container->get(\VuFind\Search\Results\PluginManager::class), - $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('config'), + $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('config'), $servicePluginManager->get(\VuFind\Db\Service\SessionServiceInterface::class) ); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/AjaxHandler/SystemStatusTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/AjaxHandler/SystemStatusTest.php index 7385f830328c..f8f4d9cbdbde 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/AjaxHandler/SystemStatusTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/AjaxHandler/SystemStatusTest.php @@ -32,7 +32,6 @@ use Laminas\Session\SessionManager; use Lmc\Rbac\Mvc\Service\AuthorizationService; use VuFind\AjaxHandler\SystemStatus; -use VuFind\Config\Config; use VuFind\Db\Service\SessionServiceInterface; use VuFind\Search\Results\PluginManager as ResultsManager; use VuFindTest\Unit\AjaxHandlerTestCase; @@ -69,7 +68,7 @@ protected function getHandler( $sessionManager ??= $this->createMock(SessionManager::class); $resultsManager ??= $this->createMock(ResultsManager::class); $sessionService ??= $this->createMock(SessionServiceInterface::class); - $handler = new SystemStatus($sessionManager, $resultsManager, new Config($config), $sessionService); + $handler = new SystemStatus($sessionManager, $resultsManager, $config, $sessionService); $mockAuth = $this->createMock(AuthorizationService::class); $mockAuth->method('isGranted') ->with('access.SystemStatus') From 488570d35da70a7a4a6870108f909c85614c4dfe Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Wed, 9 Sep 2026 13:32:01 -0400 Subject: [PATCH 49/90] Use config array instead of object for SimilarBuilder Backend module (#5653) --- .../Factory/AbstractSolrBackendFactory.php | 2 +- .../Backend/Solr/SimilarBuilder.php | 19 +++++++++---------- .../Backend/Solr/SimilarBuilderTest.php | 6 +++--- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php b/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php index 87d7ece9139e..95044dfec756 100644 --- a/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php +++ b/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php @@ -589,7 +589,7 @@ protected function createLuceneSyntaxHelper(): LuceneSyntaxHelper protected function createSimilarBuilder(): SimilarBuilder { return new SimilarBuilder( - $this->configManager->getConfigObject($this->searchConfig), + $this->configManager->getConfigArray($this->searchConfig), $this->uniqueKey ); } diff --git a/module/VuFindSearch/src/VuFindSearch/Backend/Solr/SimilarBuilder.php b/module/VuFindSearch/src/VuFindSearch/Backend/Solr/SimilarBuilder.php index ecde7f8e3677..c8c83dc0a206 100644 --- a/module/VuFindSearch/src/VuFindSearch/Backend/Solr/SimilarBuilder.php +++ b/module/VuFindSearch/src/VuFindSearch/Backend/Solr/SimilarBuilder.php @@ -83,27 +83,26 @@ class SimilarBuilder implements SimilarBuilderInterface /** * Constructor. * - * @param ?\VuFind\Config\Config $searchConfig Search config - * @param string $uniqueKey Solr field used to store unique identifier + * @param ?array $searchConfig Search config + * @param string $uniqueKey Solr field used to store unique identifier * * @return void */ public function __construct( - ?\VuFind\Config\Config $searchConfig = null, + ?array $searchConfig = null, $uniqueKey = 'id' ) { $this->uniqueKey = $uniqueKey; - if (isset($searchConfig->MoreLikeThis)) { - $mlt = $searchConfig->MoreLikeThis; + if (isset($searchConfig['MoreLikeThis'])) { + $mlt = $searchConfig['MoreLikeThis']; if ( - isset($mlt->useMoreLikeThisHandler) - && $mlt->useMoreLikeThisHandler + $mlt['useMoreLikeThisHandler'] ?? false ) { $this->useHandler = true; - $this->handlerParams = $mlt->params ?? ''; + $this->handlerParams = $mlt['params'] ?? ''; } - if (isset($mlt->count)) { - $this->count = $mlt->count; + if (isset($mlt['count'])) { + $this->count = $mlt['count']; } } } diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/SimilarBuilderTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/SimilarBuilderTest.php index 8a6a511b9a13..47c746463540 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/SimilarBuilderTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Backend/Solr/SimilarBuilderTest.php @@ -101,13 +101,13 @@ public function testMltConfig() 'count' => 10, ], ]; - $sb = new SimilarBuilder(new \VuFind\Config\Config($config)); + $sb = new SimilarBuilder($config); $response = $sb->build('testrecord'); $rows = $response->get('rows'); $this->assertEquals(10, $rows[0]); $config['MoreLikeThis']['useMoreLikeThisHandler'] = true; - $sb = new SimilarBuilder(new \VuFind\Config\Config($config)); + $sb = new SimilarBuilder($config); $response = $sb->build('testrecord'); $rows = $response->get('rows'); $this->assertEquals(10, $rows[0]); @@ -121,7 +121,7 @@ public function testMltConfig() $this->assertEquals(null, $qt); $config['MoreLikeThis']['params'] = 'qf=title,topic'; - $sb = new SimilarBuilder(new \VuFind\Config\Config($config)); + $sb = new SimilarBuilder($config); $response = $sb->build('testrecord'); $q = $response->get('q'); $this->assertEquals('{!mlt qf=title,topic}testrecord', $q[0]); From 43622d2c5e1617d2e5d24aeedf39ab7a646b7952 Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Wed, 9 Sep 2026 16:17:56 -0400 Subject: [PATCH 50/90] Use config array instead of object for LibGuidesProfile Recommend module (#5652) --- .../VuFind/src/VuFind/Recommend/LibGuidesProfile.php | 10 ++++------ .../src/VuFind/Recommend/LibGuidesProfileFactory.php | 2 +- .../src/VuFindTest/Recommend/LibGuidesProfileTest.php | 3 +-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/module/VuFind/src/VuFind/Recommend/LibGuidesProfile.php b/module/VuFind/src/VuFind/Recommend/LibGuidesProfile.php index 8c5af0bd1dde..a058d1489fa3 100644 --- a/module/VuFind/src/VuFind/Recommend/LibGuidesProfile.php +++ b/module/VuFind/src/VuFind/Recommend/LibGuidesProfile.php @@ -30,10 +30,8 @@ namespace VuFind\Recommend; use Laminas\Cache\Storage\StorageInterface as CacheAdapter; -use VuFind\Config\Config; use VuFind\Connection\LibGuides; -use function intval; use function is_string; use function strlen; @@ -105,21 +103,21 @@ class LibGuidesProfile implements * Constructor. * * @param LibGuides $libGuides LibGuides API connection - * @param Config $config LibGuides API configuration object + * @param array $config LibGuides API configuration object * @param CacheAdapter $cache Object cache */ public function __construct( LibGuides $libGuides, - Config $config, + array $config, CacheAdapter $cache ) { $this->libGuides = $libGuides; $this->setCacheStorage($cache); // Cache the data related to profiles for up to 10 minutes: - $this->cacheLifetime = intval($config->GetAccounts->cache_lifetime ?? 600); + $this->cacheLifetime = (int)($config['GetAccounts']['cache_lifetime'] ?? 600); - if ($profile = $config->Profile->toArray()) { + if ($profile = $config['Profile'] ?? []) { $strategies = $profile['strategies'] ?? []; $this->strategies = is_string($strategies) ? [$strategies] : $strategies; diff --git a/module/VuFind/src/VuFind/Recommend/LibGuidesProfileFactory.php b/module/VuFind/src/VuFind/Recommend/LibGuidesProfileFactory.php index 703f908b7139..5b53257ea6e4 100644 --- a/module/VuFind/src/VuFind/Recommend/LibGuidesProfileFactory.php +++ b/module/VuFind/src/VuFind/Recommend/LibGuidesProfileFactory.php @@ -71,7 +71,7 @@ public function __invoke( } return new $requestedName( $container->get(\VuFind\Connection\LibGuides::class), - $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('LibGuidesAPI'), + $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('LibGuidesAPI'), $container->get(\VuFind\Cache\Manager::class) ->getCache('object'), ); diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/LibGuidesProfileTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/LibGuidesProfileTest.php index a77468ee6c37..0d21ea56ec43 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/LibGuidesProfileTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/LibGuidesProfileTest.php @@ -32,7 +32,6 @@ use Laminas\Cache\Storage\StorageInterface as CacheAdapter; use PHPUnit\Framework\MockObject\MockObject; -use VuFind\Config\Config; use VuFind\Config\ConfigManagerInterface; use VuFind\Connection\LibGuides; use VuFind\Recommend\LibGuidesProfile; @@ -201,7 +200,7 @@ protected function buildProfile(array $config): LibGuidesProfile&MockObject // For the target class LibGuidesProfile, only mock the caching methods $libGuidesProfile = $this->getMockBuilder(LibGuidesProfile::class) - ->setConstructorArgs([$this->connector, new Config($config), $this->cacheAdapter]) + ->setConstructorArgs([$this->connector, $config, $this->cacheAdapter]) ->onlyMethods(['getCachedData', 'putCachedData']) ->getMock(); $libGuidesProfile->method('getCachedData')->willReturn(null); From 189323d62424d0f5820d6a0dc7e67733ed7734af Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Thu, 10 Sep 2026 06:33:07 -0400 Subject: [PATCH 51/90] Use config array instead of object for Facet Search Params (#5639) --- .../src/VuFind/Search/Params/FacetLimitTrait.php | 14 ++++++-------- .../Search/Params/FacetRestrictionsTrait.php | 10 ++++------ module/VuFind/src/VuFind/Search/Solr/Params.php | 10 +++++++--- module/VuFind/src/VuFind/Search/Summon/Params.php | 8 ++++++-- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/module/VuFind/src/VuFind/Search/Params/FacetLimitTrait.php b/module/VuFind/src/VuFind/Search/Params/FacetLimitTrait.php index fe702f68b337..13902fcb793e 100644 --- a/module/VuFind/src/VuFind/Search/Params/FacetLimitTrait.php +++ b/module/VuFind/src/VuFind/Search/Params/FacetLimitTrait.php @@ -29,8 +29,6 @@ namespace VuFind\Search\Params; -use VuFind\Config\Config; - use function in_array; /** @@ -68,18 +66,18 @@ trait FacetLimitTrait protected int $hierarchicalFacetLimit = -1; /** - * Initialize facet limit from a Config object. + * Initialize facet limit from a Config array. * - * @param ?Config $config Configuration + * @param ?array $config Configuration * * @return void */ - protected function initFacetLimitsFromConfig(?Config $config = null): void + protected function initFacetLimitsFromConfig(?array $config = null): void { - if (is_numeric($config->facet_limit ?? null)) { - $this->setFacetLimit($config->facet_limit); + if (is_numeric($config['facet_limit'] ?? null)) { + $this->setFacetLimit($config['facet_limit']); } - foreach ($config->facet_limit_by_field ?? [] as $k => $v) { + foreach ($config['facet_limit_by_field'] ?? [] as $k => $v) { $this->facetLimitByField[$k] = $v; } } diff --git a/module/VuFind/src/VuFind/Search/Params/FacetRestrictionsTrait.php b/module/VuFind/src/VuFind/Search/Params/FacetRestrictionsTrait.php index ebbdcf41098c..3ff71556119d 100644 --- a/module/VuFind/src/VuFind/Search/Params/FacetRestrictionsTrait.php +++ b/module/VuFind/src/VuFind/Search/Params/FacetRestrictionsTrait.php @@ -30,8 +30,6 @@ namespace VuFind\Search\Params; -use VuFind\Config\Config; - /** * Trait to add facet limiting settings to a Params object. * @@ -60,16 +58,16 @@ trait FacetRestrictionsTrait /** * Initialize facet prefix and matches from a Config object. * - * @param ?Config $config Configuration + * @param ?array $config Configuration * * @return void */ - protected function initFacetRestrictionsFromConfig(?Config $config = null): void + protected function initFacetRestrictionsFromConfig(?array $config = null): void { - foreach ($config->facet_prefix_by_field ?? [] as $k => $v) { + foreach ($config['facet_prefix_by_field'] ?? [] as $k => $v) { $this->facetPrefixByField[$k] = $v; } - foreach ($config->facet_matches_by_field ?? [] as $k => $v) { + foreach ($config['facet_matches_by_field'] ?? [] as $k => $v) { $this->facetMatchesByField[$k] = $v; } } diff --git a/module/VuFind/src/VuFind/Search/Solr/Params.php b/module/VuFind/src/VuFind/Search/Solr/Params.php index b280b85dcb21..1b17c1472557 100644 --- a/module/VuFind/src/VuFind/Search/Solr/Params.php +++ b/module/VuFind/src/VuFind/Search/Solr/Params.php @@ -178,8 +178,10 @@ public function __construct( // Use basic facet limit by default, if set: $config = $configManager->getConfigObject($options->getFacetsIni()); - $this->initFacetLimitsFromConfig($config->Results_Settings ?? null); - $this->initFacetRestrictionsFromConfig($config->Results_Settings ?? null); + $resultsSettings = isset($config->Results_Settings) + ? $config->Results_Settings->toArray() : null; + $this->initFacetLimitsFromConfig($resultsSettings); + $this->initFacetRestrictionsFromConfig($resultsSettings); if (isset($config->LegacyFields)) { $this->facetAliases = $config->LegacyFields->toArray(); } @@ -442,7 +444,9 @@ protected function initFacetList(string $facetList, string $facetSettings, ?stri { $facetConfigName = $cfgFile ?? $this->getOptions()->getFacetsIni(); $config = ($facetConfigName !== null) ? $this->configManager->getConfigObject($facetConfigName) : []; - $this->initFacetLimitsFromConfig($config->$facetSettings ?? null); + $facetSettingsConfig = isset($config->$facetSettings) + ? $config->$facetSettings->toArray() : null; + $this->initFacetLimitsFromConfig($facetSettingsConfig); return parent::initFacetList($facetList, $facetSettings, $cfgFile); } diff --git a/module/VuFind/src/VuFind/Search/Summon/Params.php b/module/VuFind/src/VuFind/Search/Summon/Params.php index ed8f3658f39e..bdacf4a54367 100644 --- a/module/VuFind/src/VuFind/Search/Summon/Params.php +++ b/module/VuFind/src/VuFind/Search/Summon/Params.php @@ -89,7 +89,9 @@ public function __construct(\VuFind\Search\Base\Options $options, ConfigManagerI { parent::__construct($options, $configManager); $config = $configManager->getConfigObject($options->getFacetsIni()); - $this->initFacetLimitsFromConfig($config->Facet_Settings ?? null); + $facetSettings = isset($config->Facet_Settings) + ? $config->Facet_Settings->toArray() : null; + $this->initFacetLimitsFromConfig($facetSettings); } /** @@ -406,7 +408,9 @@ protected function initFacetList(string $facetList, string $facetSettings, ?stri // can be found in Facet_Settings. $limitSection = ($facetSettings === 'Results_Settings') ? 'Facet_Settings' : $facetSettings; - $this->initFacetLimitsFromConfig($config->$limitSection ?? null); + $facetLimitConfig = isset($config->$limitSection) + ? $config->$limitSection->toArray() : null; + $this->initFacetLimitsFromConfig($facetLimitConfig); return parent::initFacetList($facetList, $facetSettings, $cfgFile); } From d61fd64b021c0bbc8f7ef68610542e80db49e39c Mon Sep 17 00:00:00 2001 From: Ryan Loftus <152215889+rtloftus@users.noreply.github.com> Date: Thu, 10 Sep 2026 06:53:54 -0400 Subject: [PATCH 52/90] Use config array instead of object for Consortial VuFind Recommend module (#5651) --- .../src/VuFind/Recommend/ConsortialVuFind.php | 41 ++++++------------- .../Recommend/ConsortialVuFindFactory.php | 2 +- .../Recommend/ConsortialVuFindTest.php | 3 +- 3 files changed, 14 insertions(+), 32 deletions(-) diff --git a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php index 0e4a1dfbb0bb..8cd43e12f9a0 100644 --- a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php +++ b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php @@ -29,7 +29,6 @@ namespace VuFind\Recommend; -use VuFind\Config\Config; use VuFind\Connection\ExternalVuFind as Connection; use function intval; @@ -67,20 +66,6 @@ class ConsortialVuFind implements RecommendInterface, \Psr\Log\LoggerAwareInterf */ protected $limit = 5; - /** - * Connection to consortial VuFind API. - * - * @var Connection - */ - protected $connection; - - /** - * ConsortialVuFind.ini configuration. - * - * @var Config - */ - protected $config; - /** * Base URL of a search results page. * @@ -119,15 +104,13 @@ class ConsortialVuFind implements RecommendInterface, \Psr\Log\LoggerAwareInterf /** * Constructor. * - * @param Config $config ConsortialVuFind.ini configuration + * @param array $config ConsortialVuFind.ini configuration * @param Connection $connection Connection to consortial VuFind API */ public function __construct( - Config $config, - Connection $connection + protected array $config, + protected Connection $connection ) { - $this->config = $config; - $this->connection = $connection; } /** @@ -146,20 +129,20 @@ public function setConfig($settings) $configSectionName = $settings[2] ?? 'ReShare'; // Read config file - $configSection = $this->config->get($configSectionName); + $configSection = $this->config[$configSectionName] ?? []; if ($configSection) { - $this->resultsBaseUrl = $configSection->results_base_url; - $this->recordBaseUrl = $configSection->record_base_url; - $this->searchFilters = $configSection->filters?->toArray() ?? []; - - // Configure connection - $this->connection->setBaseUrl($configSection->api_base_url); + $this->resultsBaseUrl = $configSection['results_base_url'] ?? null; + $this->recordBaseUrl = $configSection['record_base_url'] ?? null; + $this->searchFilters = $configSection['filters'] ?? []; // Confirm that required configuration is present $this->hasMinimumConfig = $this->resultsBaseUrl && $this->recordBaseUrl - && $configSection->api_base_url; - if (!$this->hasMinimumConfig) { + && ($configSection['api_base_url'] ?? null); + if ($this->hasMinimumConfig) { + // Configure connection + $this->connection->setBaseUrl($configSection['api_base_url']); + } else { $this->logError("Required configuration missing in '$configSectionName' section of ConsortialVuFind.ini."); } diff --git a/module/VuFind/src/VuFind/Recommend/ConsortialVuFindFactory.php b/module/VuFind/src/VuFind/Recommend/ConsortialVuFindFactory.php index 158f00f07825..d7dac5dc5fc6 100644 --- a/module/VuFind/src/VuFind/Recommend/ConsortialVuFindFactory.php +++ b/module/VuFind/src/VuFind/Recommend/ConsortialVuFindFactory.php @@ -71,7 +71,7 @@ public function __invoke( } return new $requestedName( - $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('ExternalVuFind'), + $container->get(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('ExternalVuFind'), $container->get(\VuFind\Connection\ExternalVuFind::class) ); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/ConsortialVuFindTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/ConsortialVuFindTest.php index 4fbd47dce0d6..5c1144194fae 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/ConsortialVuFindTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Recommend/ConsortialVuFindTest.php @@ -30,7 +30,6 @@ namespace VuFindTest\Recommend; -use VuFind\Config\Config; use VuFind\Config\ConfigManagerInterface; use VuFind\Connection\ExternalVuFind; use VuFind\Recommend\ConsortialVuFind; @@ -144,7 +143,7 @@ protected function buildConfig(): array */ protected function buildConsortialVuFind(array $config): ConsortialVuFind { - $consortialVuFind = new ConsortialVuFind(new Config($config), $this->connector); + $consortialVuFind = new ConsortialVuFind($config, $this->connector); $consortialVuFind->setConfig('lookfor:3:ReShare'); $queryResults = $this->buildQueryResults('civil war'); From 6407fde68748e46db3f6b019ac389f788ab34ef1 Mon Sep 17 00:00:00 2001 From: kouralex <1723419+kouralex@users.noreply.github.com> Date: Thu, 10 Sep 2026 14:02:59 +0300 Subject: [PATCH 53/90] Add new translation key/string pair for export format and update obsolete translations (#5611) --- languages/ar.ini | 1 + languages/bn.ini | 1 + languages/ca.ini | 1 + languages/cs.ini | 1 + languages/cy.ini | 1 + languages/da.ini | 1 + languages/de.ini | 1 + languages/el.ini | 1 + languages/en.ini | 1 + languages/es.ini | 1 + languages/eu.ini | 1 + languages/fi.ini | 3 ++- languages/fr.ini | 1 + languages/ga.ini | 1 + languages/gl.ini | 1 + languages/he.ini | 1 + languages/hi.ini | 1 + languages/hr.ini | 1 + languages/hy.ini | 1 + languages/it.ini | 1 + languages/ja.ini | 1 + languages/mi.ini | 1 + languages/mn.ini | 1 + languages/nl.ini | 1 + languages/pl.ini | 1 + languages/pt-br.ini | 1 + languages/pt.ini | 1 + languages/ru.ini | 1 + languages/se.ini | 3 ++- languages/sl.ini | 1 + languages/sv.ini | 3 ++- languages/ta.ini | 1 + languages/tr.ini | 1 + languages/uk.ini | 1 + languages/vi.ini | 1 + languages/zh-cn.ini | 1 + languages/zh.ini | 1 + themes/bootstrap5/templates/cart/export.phtml | 2 +- 38 files changed, 41 insertions(+), 4 deletions(-) diff --git a/languages/ar.ini b/languages/ar.ini index 8f7ee11ac1ad..235bacbde906 100644 --- a/languages/ar.ini +++ b/languages/ar.ini @@ -501,6 +501,7 @@ export_choose_format = "يرجى اختيار تنسيق تصدير." export_download = "تحميل الملف" export_exporting = "إنشاء ملف التصدير" export_fail = "لم يتم تصدير موادك" +export_format_selection_label = "التنسيق" export_invalid_format = "تنسيق التصدير المحدد غير مدعوم بواسطة هذه التسجيلة." export_missing = "بعض البيانات مفقودة. لم يتم تصدير موادك." export_no_formats = "هذه التسجيلة لا تدعم التصدير." diff --git a/languages/bn.ini b/languages/bn.ini index eb8c14ae5a3e..5689041916d5 100644 --- a/languages/bn.ini +++ b/languages/bn.ini @@ -481,6 +481,7 @@ export_choose_format = "অনুগ্রহ করে একটি এক্ export_download = "ডাউনলোড ফাইল" export_exporting = "এক্সপোর্ট করার জন্য ফাইলটি তিরী করা হয়েছে" export_fail = "আপনার উপাদানগুলি রপ্তানি করা হয়নি" +export_format_selection_label = "বিন্যাস" export_invalid_format = "নির্বাচিত রপ্তানি বিন্যাসটি এই রেকর্ডটিকে সমর্থন করে না।" export_missing = "কিছু ডাটা পাওয়া যাচ্ছে না। আপনার উপাদানগুলি এক্সপোর্ট করাযাবে না।" export_no_formats = "এই রেকর্ডটি এক্সপোর্ট করা যাবে না।" diff --git a/languages/ca.ini b/languages/ca.ini index f01a574fddcc..8ba4982ab0f4 100644 --- a/languages/ca.ini +++ b/languages/ca.ini @@ -512,6 +512,7 @@ export_choose_format = "Seleccioni format d'exportació." export_download = "Descarregar arxiu" export_exporting = "Creant fitxer d’exportació" export_fail = "Els vostres ítems no s’han exportat" +export_format_selection_label = "Format" export_invalid_format = "El format d' exportació seleccionat no està suportat per aquest registre." export_missing = "S’han perdut algunes dades. Els vostres ítems no s’han exportat." export_no_formats = "Aquest registre no permet exportacions." diff --git a/languages/cs.ini b/languages/cs.ini index 86d32fd5eb68..a4e09dcb73ef 100644 --- a/languages/cs.ini +++ b/languages/cs.ini @@ -499,6 +499,7 @@ export_choose_format = "Vyberte exportní formát." export_download = "Stáhnout soubor" export_exporting = "Vytvořit exportní soubor" export_fail = "Položky se nebyly exportovány" +export_format_selection_label = "Médium" export_invalid_format = "Tuto položku nelze exportovat ve vybraném formátu." export_missing = "Chybí některé údaje. Položky nebylo možné exportovat." export_no_formats = "Položku nelze exportovat." diff --git a/languages/cy.ini b/languages/cy.ini index 743b29865d77..0b82652e2555 100644 --- a/languages/cy.ini +++ b/languages/cy.ini @@ -384,6 +384,7 @@ export_choose_format = "Dewiswch fformat allforio" export_download = "Lawrlwytho Ffeil" export_exporting = "Creu Ffeil Allfudo" export_fail = "Ni allfudwyd eich eitemau" +export_format_selection_label = "Fformat" export_invalid_format = "Nid yw'r cofnod hwn yn cefnogi'r fformat allforio a ddewiswyd" export_missing = "Roedd peth data ar goll. Ni allfudwyd eich eitemau." export_no_formats = "Nid yw'r cofnod hwn yn cefnogi allforio" diff --git a/languages/da.ini b/languages/da.ini index 6f4dd3327c53..4a078732752b 100644 --- a/languages/da.ini +++ b/languages/da.ini @@ -230,6 +230,7 @@ Export Record = "Eksportér post" export_download = "Download Fil" export_exporting = "Der dannes en eksportfil" export_fail = "Dine emner blev ikke eksporteret" +export_format_selection_label = "Format" export_missing = "Der skete en fejl. Dine emner blev ikke eksporteret." export_save = "Gem Fil" export_selected_favorites = "Eksport valgte favoritter" diff --git a/languages/de.ini b/languages/de.ini index 25ca50f18d7b..843b31146b6b 100644 --- a/languages/de.ini +++ b/languages/de.ini @@ -516,6 +516,7 @@ export_choose_format = "Bitte wählen Sie ein Exportformat." export_download = "Datei herunterladen" export_exporting = "Exportdatei erstellen" export_fail = "Ihre Datensätze wurden nicht exportiert" +export_format_selection_label = "Format" export_invalid_format = "Das ausgewählte Exportformat steht bei diesem Datensatz nicht zur Verfügung." export_missing = "Fehlende Angaben. Ihre Datensätze wurden nicht exportiert." export_no_formats = "Dieser Datensatz kann nicht exportiert werden." diff --git a/languages/el.ini b/languages/el.ini index 96131421bd74..fb7b2fa75deb 100644 --- a/languages/el.ini +++ b/languages/el.ini @@ -501,6 +501,7 @@ export_choose_format = "Επιλέξτε μορφή εξαγωγής." export_download = "Κατέβασμα αρχείου" export_exporting = "Δημιουργία αρχείου εξαγωγής" export_fail = "Δεν έγινε εξαγωγή των τεκμηρίων σας" +export_format_selection_label = "Μορφή" export_invalid_format = "Η μορφή εξαγωγής που επιλέξατε δεν υποστηρίζεται για αυτή την εγγραφή." export_missing = "Ελλιπή στοιχεία. Δεν έγινε εξαγωγή των τεκμηρίων σας" export_no_formats = "Αυτή η εγγραφή δεν είναι δυνατόν να εξαχθεί." diff --git a/languages/en.ini b/languages/en.ini index 11c55d52fc76..a6e4a1b8ea75 100644 --- a/languages/en.ini +++ b/languages/en.ini @@ -517,6 +517,7 @@ export_choose_format = "Please choose an export format." export_download = "Download File" export_exporting = "Creating Export File" export_fail = "Your items were not exported" +export_format_selection_label = "Export format" export_invalid_format = "The selected export format is not supported by this record." export_missing = "Some data was missing. Your items were not exported." export_no_formats = "This record does not support export." diff --git a/languages/es.ini b/languages/es.ini index 1be3dfc64d53..19ca189a01ed 100644 --- a/languages/es.ini +++ b/languages/es.ini @@ -501,6 +501,7 @@ export_choose_format = "Seleccionar formato de exportación." export_download = "Descargar Archivo" export_exporting = "Creando Archivo de Exportación" export_fail = "Sus elementos no fueron exportados." +export_format_selection_label = "Formato" export_invalid_format = "Formato de exportación no válido." export_missing = "Algún dato falta. Sus elementos no fueron exportados" export_no_formats = "Este registro no soporta exportación." diff --git a/languages/eu.ini b/languages/eu.ini index 22c5d37bd784..a3a9b3e34867 100644 --- a/languages/eu.ini +++ b/languages/eu.ini @@ -1121,6 +1121,7 @@ export_choose_format = "Mesedez, aukeratu esportatze formatua." export_download = "fitxategia behera kargatu" export_exporting = "Esportazio fitxategia sortzen" export_fail = "Zure dokumentuak esportatu dira" +export_format_selection_label = "Formatua" export_invalid_format = "Aukeratutako esportatze formatua ezin da aukeratu erregistro honetarako." export_missing = "Daturen bat falta da. Zure dokumentuak ez dira esportatu" export_no_formats = "Esportatzea ezin da erabili erregistro honekin." diff --git a/languages/fi.ini b/languages/fi.ini index 8ba1fc3bc40b..a6fca242818b 100644 --- a/languages/fi.ini +++ b/languages/fi.ini @@ -492,13 +492,14 @@ explain_show_raw = "Näytä raakaversio" explain_sum = "summa" explain_top_relevance = "Parhaan tuloksen osuvuus" Export = "Vienti" -Export Favorites = "Vie suosikit" +Export Favorites = "Vie" Export Items = "Vie tietueet" Export Record = "Vie tietue" export_choose_format = "Valitse vientimuoto." export_download = "Lataa tiedosto" export_exporting = "Luodaan vientitiedostoa" export_fail = "Tietueiden vienti ei onnistunut" +export_format_selection_label = "Vientimuoto" export_invalid_format = "Valittu vientimuoto ei ole käytettävissä tälle aineistolle." export_missing = "Tietoja puuttuu. Tietueiden vienti ei onnistunut." export_no_formats = "Tämä aineisto ei tue vientitoimintoa." diff --git a/languages/fr.ini b/languages/fr.ini index 031591134a1a..f1fb2dc8885d 100644 --- a/languages/fr.ini +++ b/languages/fr.ini @@ -500,6 +500,7 @@ export_choose_format = "Veuillez choisir un format d'export." export_download = "Télécharger le fichier" export_exporting = "Création du fichier d'export" export_fail = "Les données n'ont pas été exportées" +export_format_selection_label = "Format" export_invalid_format = "Ce format d'export n'est pas disponible pour la notice." export_missing = "Certaines informations étaient manquantes, les données n'ont pas été exportées." export_no_formats = "Cette notice ne peut être exportée." diff --git a/languages/ga.ini b/languages/ga.ini index e164eda4e09f..f4ff91753724 100644 --- a/languages/ga.ini +++ b/languages/ga.ini @@ -500,6 +500,7 @@ export_choose_format = "Roghnaigh formáid easpórtála." export_download = "Íoslódáil an comhad" export_exporting = "Comhad easpórtála á chruthú" export_fail = "Níor easpórtáladh do chuid míreanna" +export_format_selection_label = "Formáid" export_invalid_format = "Ní féidir an fhormáid easpórtála atá roghnaithe a úsáid i gcás an taifid seo." export_missing = "Bhí roinnt sonraí in easnamh. Níor easpórtáladh do chuid míreanna." export_no_formats = "Ní féidir an taifead seo a easpórtáil." diff --git a/languages/gl.ini b/languages/gl.ini index 8681f05ea5d6..9d1cf95f4bf2 100644 --- a/languages/gl.ini +++ b/languages/gl.ini @@ -318,6 +318,7 @@ export_choose_format = "Seleccionar formato de exportación" export_download = "Descargar arquivo" export_exporting = "Creando Arquivo de Exportación" export_fail = "Os seus elementos non foron exportados" +export_format_selection_label = "Formato" export_invalid_format = "Formato de exportación non válido" export_missing = "Algún dato falta. Os seus elementos non foron exportados" export_no_formats = "Este rexistro non soporta exportación" diff --git a/languages/he.ini b/languages/he.ini index d2effdecef07..a2c18f434240 100644 --- a/languages/he.ini +++ b/languages/he.ini @@ -248,6 +248,7 @@ export_choose_format = "יש לבחור פורמט יצוא." export_download = "הורדת קובץ" export_exporting = "יוצר קובץ יצוא" export_fail = "הפריטים שלך לא יוצאו" +export_format_selection_label = "פורמט" export_invalid_format = "פורמט היצוא הנבחר לא נתמך עבור הרשומה הזו." export_missing = "חלק מהנתונים חסרים. הפריטים שלך לא יוצאו" export_no_formats = "רשומה זו לא תומכת ביצוא." diff --git a/languages/hi.ini b/languages/hi.ini index 8c090ca93ebc..9ebef933c2bf 100644 --- a/languages/hi.ini +++ b/languages/hi.ini @@ -482,6 +482,7 @@ export_choose_format = "कृपया एक निर्यात प्र export_download = "फ़ाइल डाउनलोड करें" export_exporting = "निर्यात फ़ाइल बनाना" export_fail = "आपके आइटम निर्यात नहीं किए गए थे" +export_format_selection_label = "स्वरूप" export_invalid_format = "चयनित निर्यात प्रारूप इस रिकॉर्ड द्वारा समर्थित नहीं है" export_missing = "कुछ डेटा गायब था। आपके आइटम निर्यात नहीं किए गए थे" export_no_formats = "यह रिकॉर्ड निर्यात का समर्थन नहीं करता है" diff --git a/languages/hr.ini b/languages/hr.ini index 894954ad4171..d5d3be71aa8e 100644 --- a/languages/hr.ini +++ b/languages/hr.ini @@ -481,6 +481,7 @@ export_choose_format = "Odaberi izvozni format." export_download = "Preuzmi datoteku" export_exporting = "Stvaranje izvozne datoteke" export_fail = "Tvoji predmeti nisu izvezeni" +export_format_selection_label = "Format" export_invalid_format = "Ovaj zapis ne podržava odabrani izvozni format." export_missing = "Neki su podaci nedostajali. Tvoji predmeti nisu izvezeni." export_no_formats = "Ovaj zapis ne podržava izvoz." diff --git a/languages/hy.ini b/languages/hy.ini index dfea45bc5226..e95afbb32880 100644 --- a/languages/hy.ini +++ b/languages/hy.ini @@ -500,6 +500,7 @@ export_choose_format = "Խնդրում ենք ընտրել արտահանման export_download = "Ներբեռնել նիշքը" export_exporting = "Արտահանման նիշքի ստեղծում" export_fail = "Ձեր նյութերը չեն արտահանվել" +export_format_selection_label = "Ձևաչափ" export_invalid_format = "Արտահանման ընտրված ձևաչափն այս գրառումը չի աջակցում:" export_missing = "Որոշ տվյալներ բացակայում էին։ Ձեր նյութերը չեն արտահանվել:" export_no_formats = "Այս գրառումը չի աջակցում արտահանմանը:" diff --git a/languages/it.ini b/languages/it.ini index 43d169239fed..ca15cff00b13 100644 --- a/languages/it.ini +++ b/languages/it.ini @@ -479,6 +479,7 @@ export_choose_format = "Scegli un formato di esportazione." export_download = "Scarica" export_exporting = "Crea un file da esportare" export_fail = "L'esportazione è fallita" +export_format_selection_label = "Natura" export_invalid_format = "Questo record non può essere esportato nel formato selezionato." export_missing = "Alcuni dati erano mancanti; l'esportazione è fallita." export_no_formats = "Questo record non può essere esportato." diff --git a/languages/ja.ini b/languages/ja.ini index 75b79dd87156..aebb4b6fb61c 100644 --- a/languages/ja.ini +++ b/languages/ja.ini @@ -467,6 +467,7 @@ export_choose_format = "エクスポート形式を選択してください。" export_download = "ファイルをダウンロード" export_exporting = "エクスポートファイルを作成" export_fail = "エクスポートできませんでした" +export_format_selection_label = "フォーマット" export_invalid_format = "このレコードは選択した形式ではエクスポートできません。" export_missing = "紛失データがあり、エクスポートできませんでした。" export_no_formats = "このレコードはエクスポートできません。" diff --git a/languages/mi.ini b/languages/mi.ini index 37609f7902c2..2bcf5921c9d0 100644 --- a/languages/mi.ini +++ b/languages/mi.ini @@ -407,6 +407,7 @@ export_choose_format = "Me kōwhiri he hōputu kaweake." export_download = "Tikiake kōnae" export_exporting = "E hanga kōnae kaweake ana" export_fail = "Kāore ō tūemi i kawea ake" +export_format_selection_label = "Hōputu" export_invalid_format = "Kāore te hōputu kaweake i tīpakona e tautokona ana e tēnei pūkete." export_missing = 'E ngaro ana ētahi raraunga. "Kāore ō tūemi i kawea ake.' export_no_formats = "Kāore tēnei pūkete e tautoko ana i te kaweake." diff --git a/languages/mn.ini b/languages/mn.ini index 81003f876d3f..da74738e8ed0 100644 --- a/languages/mn.ini +++ b/languages/mn.ini @@ -498,6 +498,7 @@ export_choose_format = "Экспортын формат сонгоно уу." export_download = "Файл татаж авах" export_exporting = "Экспортын файл үүсгэж байна" export_fail = "Таны зүйлсийг экспортлоогүй байна" +export_format_selection_label = "Формат" export_invalid_format = "Сонгосон экспортын форматыг энэ бүртгэлээр дэмждэггүй." export_missing = "Зарим өгөгдөл алга байна. Таны зүйлсийг экспортолсонгүй." export_no_formats = "Энэ бүртгэл экспортыг дэмждэггүй." diff --git a/languages/nl.ini b/languages/nl.ini index 9e3ca08b054f..5f3e4756e5eb 100644 --- a/languages/nl.ini +++ b/languages/nl.ini @@ -397,6 +397,7 @@ export_choose_format = "Kies een format om te exporteren" export_download = "Bestand downloaden" export_exporting = "Export File wordt gemaakt" export_fail = "Jouw items werden niet geëxporteerd" +export_format_selection_label = "Formaat" export_invalid_format = "Het geselecteerde exporteer-format is niet beschikbaar voor dit record" export_missing = "De gegevens waren niet volledig. Jouw items werden niet geëxporteerd." export_no_formats = "Dit record ondersteunt exporteren niet" diff --git a/languages/pl.ini b/languages/pl.ini index a3f355c7a8e0..b0dcee5633d9 100644 --- a/languages/pl.ini +++ b/languages/pl.ini @@ -458,6 +458,7 @@ export_choose_format = "Wybierz format do eksportu." export_download = "Ściągnij plik" export_exporting = "Stwórz plik do eksportu" export_fail = "Zapisy nie zostały eksportowane" +export_format_selection_label = "Format" export_invalid_format = "Wybrany format nie stoi do dyspozycji dla tego zapisu." export_missing = "Brak danych. Nie udało się eksportować zapisów." export_no_formats = "Nie jest możliwe eksportowanie tego zapisu." diff --git a/languages/pt-br.ini b/languages/pt-br.ini index 1910f4984705..f2caf167466e 100644 --- a/languages/pt-br.ini +++ b/languages/pt-br.ini @@ -500,6 +500,7 @@ export_choose_format = "Por favor, escolha um formato de exportação." export_download = "Fazer o download do arquivo" export_exporting = "A gerar o arquivo de exportação" export_fail = "Os itens não foram exportados" +export_format_selection_label = "Formato" export_invalid_format = "O formato de exportação selecionado não é suportado por este registro." export_missing = "Alguns dados foram perdidos. Os itens não foram exportados." export_no_formats = "Este registro não suporta a exportação." diff --git a/languages/pt.ini b/languages/pt.ini index 51ebc0545f0c..2853c4d0d468 100644 --- a/languages/pt.ini +++ b/languages/pt.ini @@ -310,6 +310,7 @@ export_choose_format = "Por favor, escolha um formato de exportação." export_download = "Fazer o download do arquivo" export_exporting = "A gerar o arquivo de exportação" export_fail = "Os itens não foram exportados" +export_format_selection_label = "Formato" export_invalid_format = "O formato de exportação selecionado não é suportado por este registo." export_missing = "Alguns dados foram perdidos. Os itens não foram exportados." export_no_formats = "Este registo não suporta a exportação." diff --git a/languages/ru.ini b/languages/ru.ini index f5742de6bc61..ad88d12cf743 100644 --- a/languages/ru.ini +++ b/languages/ru.ini @@ -517,6 +517,7 @@ export_choose_format = "Выберите формат экспорта." export_download = "Выгрузить файл" export_exporting = "Создание файла экспорта" export_fail = "Ваши документы не экспортированы" +export_format_selection_label = "Формат" export_invalid_format = "Выбранный формат экспорта не поддерживается для данной записи." export_missing = "Пропущены некоторые данные. Ваши документы не поддерживаются." export_no_formats = "Эта запись не поддерживает экспорт." diff --git a/languages/se.ini b/languages/se.ini index a43e5369949c..9b631730b42c 100644 --- a/languages/se.ini +++ b/languages/se.ini @@ -490,13 +490,14 @@ explain_show_raw = "Čájet roavis veršuvnna" explain_sum = "submi" explain_top_relevance = "Buoremus bohtosa deaivilvuohta" Export = "Doalvvo" -Export Favorites = "Doalvvo oiddohiid" +Export Favorites = "Doalvvo" Export Items = "Doalvvo čujuhusaid" Export Record = "Doalvvo čujuhusa" export_choose_format = "Vállje doalvunhámi" export_download = "Ládde fiilla" export_exporting = "Doalvunfiila duddjojuvvo" export_fail = "Merkošiid doalvun ii lihkostuvvan" +export_format_selection_label = "Doalvunformáhtta" export_invalid_format = "Válljejuvvon doalvunhápmi ii leat geavaheamis dán materiálii." export_missing = "Dieđut váilot. Merkošiid doalvun ii lihkostuvvan." export_no_formats = "Dát materiála ii doarjjo doalvundoaimma." diff --git a/languages/sl.ini b/languages/sl.ini index 574588c5d025..34dcdace4288 100644 --- a/languages/sl.ini +++ b/languages/sl.ini @@ -264,6 +264,7 @@ export_choose_format = "Prosimo izberite format za izvoz." export_download = "Potegnite datoteko" export_exporting = "Ustvarjam izvozno datoteko" export_fail = "Vaše knjige/članki niso bili izvoženi" +export_format_selection_label = "Format" export_invalid_format = "Zadetek ne podpira izbrani izvozni format." export_missing = "Manjkajo nekateri podatki. Vaši knjige/članki niso bili izvoženi." export_no_formats = "Ta zadetek ne podpira izvoz." diff --git a/languages/sv.ini b/languages/sv.ini index ad8c80114d31..987ecfdc135e 100644 --- a/languages/sv.ini +++ b/languages/sv.ini @@ -492,13 +492,14 @@ explain_show_raw = "Visa råversion" explain_sum = "summa" explain_top_relevance = "Relevans för toppresultat" Export = "Exportera" -Export Favorites = "Exportera favoriter" +Export Favorites = "Exportera" Export Items = "Exportera" Export Record = "Exportera posten" export_choose_format = "Välj exportformat" export_download = "Ladda ner filen" export_exporting = "Exportfil skapas" export_fail = "Exporten av poster misslyckades" +export_format_selection_label = "Exportformat" export_invalid_format = "Det valda exportformatet är inte i bruk för detta material." export_missing = "Uppgifter saknas. Exporten av poster misslyckades." export_no_formats = "Detta material stöder inte exportfunktionen" diff --git a/languages/ta.ini b/languages/ta.ini index acb47b9d5c75..12770ad9dab5 100644 --- a/languages/ta.ini +++ b/languages/ta.ini @@ -502,6 +502,7 @@ export_choose_format = "ஏற்றுமதி வடிவத்தை தே export_download = "கோப்பை பதிவிறக்கவும்" export_exporting = "ஏற்றுமதி கோப்பு உருவாக்கப்படுகிறது" export_fail = "உங்கள் உருப்படிகள் ஏற்றுமதி செய்யப்படவில்லை" +export_format_selection_label = "வடிவம்" export_invalid_format = "தேர்ந்தெடுக்கப்பட்ட ஏற்றுமதி வடிவம் இந்த பதிவால் ஆதரிக்கப்படவில்லை" export_missing = "சில தரவு இல்லை. உங்கள் உருப்படிகள் ஏற்றுமதி செய்யப்படவில்லை" export_no_formats = "இந்த பதிவு ஏற்றுமதியை ஆதரிக்கவில்லை" diff --git a/languages/tr.ini b/languages/tr.ini index 40d79051f1a8..1424c69a7e56 100644 --- a/languages/tr.ini +++ b/languages/tr.ini @@ -554,6 +554,7 @@ export_choose_format = "Bir ihraç formatı seçiniz." export_download = "Dosya indir" export_exporting = "Aktarım dosyası oluştur" export_fail = "Kayıtlarınız aktarılamadı" +export_format_selection_label = "Materyal Türü" export_invalid_format = "Seçilmiş ihraç formatı bu kayıt tarafından desteklenmiyor." export_missing = "Bazı veriler eksik. Kayıtlarınız aktarılamadı." export_no_formats = "Bu kayıt ihracç desteklemiyor." diff --git a/languages/uk.ini b/languages/uk.ini index 01b1ae3d60e0..3faa75d63a64 100644 --- a/languages/uk.ini +++ b/languages/uk.ini @@ -500,6 +500,7 @@ export_choose_format = "Оберіть формат для екпорту." export_download = "Завантажити файл" export_exporting = "Створити файл для екпорту" export_fail = "Ваші ресурси не були експортовані" +export_format_selection_label = "Формат" export_invalid_format = "Вибраний формат для екпорту не підтримується для цього запису." export_missing = "Деякі дані відсутні. Ваші ресурси не були експортовані." export_no_formats = "Цей запис не підтримує експорт." diff --git a/languages/vi.ini b/languages/vi.ini index 045169caa2ce..3c3b1f3b18cd 100644 --- a/languages/vi.ini +++ b/languages/vi.ini @@ -396,6 +396,7 @@ export_choose_format = "Hãy chọn kiểu xuất." export_download = "Tải tập tin" export_exporting = "Tạo tập tin xuất" export_fail = "Các mục của bạn không được xuất" +export_format_selection_label = "Định dạng" export_invalid_format = "Định dạng xuất đã chọn không được bản ghi này hỗ trợ." export_missing = "Một số dữ liệu bị thiếu. Các mục của bạn chưa được xuất." export_no_formats = "Hồ sơ này không hỗ trợ xuất khẩu." diff --git a/languages/zh-cn.ini b/languages/zh-cn.ini index fcb312ad4678..4aebfb2cfafe 100644 --- a/languages/zh-cn.ini +++ b/languages/zh-cn.ini @@ -349,6 +349,7 @@ Export Record = "导出纪录" export_download = "下载文件" export_exporting = "创建导出的文件" export_fail = "您的项目没有导出" +export_format_selection_label = "格式" export_missing = "一些数据丢失. 您的项目没有导出." export_save = "保存文件" export_selected_favorites = "导出选定的最爱" diff --git a/languages/zh.ini b/languages/zh.ini index f38bcb542e4a..6e85d65ed6fb 100644 --- a/languages/zh.ini +++ b/languages/zh.ini @@ -215,6 +215,7 @@ Export Record = "導出紀錄" export_download = "下載文件" export_exporting = "創建導出的文件" export_fail = "您的項目沒有導出" +export_format_selection_label = "格式" export_missing = "一些數據丟失. 您的項目沒有導出." export_save = "保存文件" export_selected_favorites = "導出選定的最愛" diff --git a/themes/bootstrap5/templates/cart/export.phtml b/themes/bootstrap5/templates/cart/export.phtml index 5f9bdde1e96b..3d91d150cae2 100644 --- a/themes/bootstrap5/templates/cart/export.phtml +++ b/themes/bootstrap5/templates/cart/export.phtml @@ -34,7 +34,7 @@
- +