From 24af74320ff1f057b228243f3f3edcb62b8ff0ed Mon Sep 17 00:00:00 2001 From: Maximilian Taube Date: Wed, 20 May 2026 20:15:36 +0200 Subject: [PATCH 01/17] Initial commit, add base structure, vue frontend --- .gitignore | 9 + AIProviderService.php | 75 ++++++ AIProviders.php | 103 +++++++++ AIProvidersList.php | 57 +++++ API.php | 83 +++++++ Controller.php | 32 +++ LICENSE | 49 ++++ Menu.php | 34 +++ Model/Configuration.php | 345 +++++++++++++++++++++++++++ Provider/AIProvider.php | 87 +++++++ Provider/Claude.php | 27 +++ Provider/CustomProvider.php | 32 +++ Provider/Gemini.php | 27 +++ Provider/OpenAI.php | 27 +++ README.md | 25 +- lang/en.json | 22 ++ plugin.json | 17 ++ templates/index.twig | 5 + vue/dist/AIProviders.umd.js | 347 ++++++++++++++++++++++++++++ vue/dist/AIProviders.umd.js.map | 1 + vue/dist/AIProviders.umd.min.js | 2 + vue/dist/AIProviders.umd.min.js.map | 1 + vue/dist/umd.metadata.json | 6 + vue/src/ManageAIProviders.vue | 241 +++++++++++++++++++ vue/src/index.ts | 16 ++ 25 files changed, 1668 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 AIProviderService.php create mode 100644 AIProviders.php create mode 100644 AIProvidersList.php create mode 100644 API.php create mode 100644 Controller.php create mode 100644 LICENSE create mode 100644 Menu.php create mode 100644 Model/Configuration.php create mode 100644 Provider/AIProvider.php create mode 100644 Provider/Claude.php create mode 100644 Provider/CustomProvider.php create mode 100644 Provider/Gemini.php create mode 100644 Provider/OpenAI.php create mode 100644 lang/en.json create mode 100644 plugin.json create mode 100644 templates/index.twig create mode 100644 vue/dist/AIProviders.umd.js create mode 100644 vue/dist/AIProviders.umd.js.map create mode 100644 vue/dist/AIProviders.umd.min.js create mode 100644 vue/dist/AIProviders.umd.min.js.map create mode 100644 vue/dist/umd.metadata.json create mode 100644 vue/src/ManageAIProviders.vue create mode 100644 vue/src/index.ts diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9283149 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +.DS_Store +.idea/ +/node_modules +tests/System/processed/*xml +/vue/dist/demo.html +/vue/dist/*.common.js +/vue/dist/*.map +/vue/dist/*.development.* +.codex diff --git a/AIProviderService.php b/AIProviderService.php new file mode 100644 index 0000000..f48f47e --- /dev/null +++ b/AIProviderService.php @@ -0,0 +1,75 @@ +configuration = $configuration; + } + + /** + * Returns the configured default provider for server-side plugin use. + */ + public function getDefaultProvider(): AIProvider + { + $providers = AIProviders::getAvailableProviders(); + $providerId = $this->configuration->getDefaultProviderId($providers); + $provider = $providers->getProvider($providerId); + + if ($provider === null) { + throw new InvalidArgumentException(sprintf('Unknown AI provider "%s".', $providerId)); + } + + return $provider; + } + + /** + * Returns the server-side connection config for the default provider. + * + * The returned array may include secrets and must not be exposed in API + * responses, logs, or browser-rendered output. + * + * @return array + */ + public function getDefaultProviderConfiguration(): array + { + $provider = $this->getDefaultProvider(); + + return $this->configuration->getProviderConfiguration($provider->getId()); + } + + /** + * Returns the configured default model capability level. + */ + public function getDefaultCapabilityLevel(): string + { + return $this->configuration->getDefaultCapabilityLevel(); + } +} diff --git a/AIProviders.php b/AIProviders.php new file mode 100644 index 0000000..0ea405d --- /dev/null +++ b/AIProviders.php @@ -0,0 +1,103 @@ + 'addAIProviders', + 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', + ]; + } + + public function addAIProviders(AIProvidersList $providers): void + { + $providers->addProvider(new Provider\Claude()); + $providers->addProvider(new Provider\CustomProvider()); + $providers->addProvider(new Provider\Gemini()); + $providers->addProvider(new Provider\OpenAI()); + } + + /** + * Returns all AI providers registered by active plugins. + */ + public static function getAvailableProviders(): AIProvidersList + { + $providers = new AIProvidersList(); + + /** + * Triggered to let plugins register AI providers. + * + * Plugins can add providers by calling `$providers->addProvider()` with + * a `Piwik\Plugins\AIProviders\Provider\AIProvider` instance. + * + * **Example** + * + * public function registerEvents() + * { + * return ['AIProviders.addAIProviders' => 'addAIProviders']; + * } + * + * public function addAIProviders(AIProvidersList $providers): void + * { + * $providers->addProvider(new MyProvider()); + * } + * + * @param AIProvidersList $providers Provider registry to mutate. + */ + Piwik::postEvent('AIProviders.addAIProviders', [$providers]); + + /** + * Triggered after providers have been registered, so plugins can remove + * or adjust providers before they are shown or used. + * + * @param AIProvidersList $providers Provider registry to mutate. + */ + Piwik::postEvent('AIProviders.filterAIProviders', [$providers]); + + return $providers; + } + + public function getClientSideTranslationKeys(array &$translations): void + { + $translations[] = 'AIProviders_ApiKey'; + $translations[] = 'AIProviders_ApiKeyAlreadyConfigured'; + $translations[] = 'AIProviders_ApiKeyHelp'; + $translations[] = 'AIProviders_ClaudeDescription'; + $translations[] = 'AIProviders_CloudConfigurationHelp'; + $translations[] = 'AIProviders_CustomProviderDescription'; + $translations[] = 'AIProviders_DefaultCapabilityLevel'; + $translations[] = 'AIProviders_DefaultProvider'; + $translations[] = 'AIProviders_EndpointUrl'; + $translations[] = 'AIProviders_EndpointUrlHelp'; + $translations[] = 'AIProviders_GeminiDescription'; + $translations[] = 'General_LoadingData'; + $translations[] = 'AIProviders_InstantCapability'; + $translations[] = 'AIProviders_MenuTitle'; + $translations[] = 'AIProviders_OpenAIDescription'; + $translations[] = 'AIProviders_ProviderConnections'; + $translations[] = 'AIProviders_SettingsSaveSuccess'; + $translations[] = 'AIProviders_ThinkingCapability'; + } +} diff --git a/AIProvidersList.php b/AIProvidersList.php new file mode 100644 index 0000000..e5484ac --- /dev/null +++ b/AIProvidersList.php @@ -0,0 +1,57 @@ + + */ + private $providers = []; + + public function addProvider(AIProvider $provider): void + { + $this->providers[$provider->getId()] = $provider; + } + + public function removeProvider(string $providerId): void + { + unset($this->providers[$providerId]); + } + + public function hasProvider(string $providerId): bool + { + return isset($this->providers[$providerId]); + } + + public function getProvider(string $providerId): ?AIProvider + { + return $this->providers[$providerId] ?? null; + } + + /** + * @return AIProvider[] + */ + public function getProviders(): array + { + return array_values($this->providers); + } +} diff --git a/API.php b/API.php new file mode 100644 index 0000000..733aeb7 --- /dev/null +++ b/API.php @@ -0,0 +1,83 @@ + Provider metadata and masked configuration values. + */ + public function getSettings(): array + { + Piwik::checkUserHasSuperUserAccess(); + + $providers = AIProviders::getAvailableProviders(); + + return $this->getConfiguration()->getSettings($providers); + } + + /** + * Saves AI provider settings from the administration UI. + * + * API keys are accepted only as POST data and are never returned by this API. + * On Matomo Cloud, provider credentials and capability level are ignored so + * only the default provider can be changed. + * + * @param string $defaultProviderId Provider ID to use by default. + * @param string $defaultCapabilityLevel Default model capability level. + * @param string $providerConfigurations JSON object keyed by provider ID with connection settings. + * @return array Updated provider metadata and masked configuration values. + */ + public function saveSettings( + string $defaultProviderId, + string $defaultCapabilityLevel, + #[\SensitiveParameter] + string $providerConfigurations = '{}' + ): array { + Piwik::checkUserHasSuperUserAccess(); + + $providers = AIProviders::getAvailableProviders(); + $configuration = $this->getConfiguration(); + $configuration->saveSettings( + $providers, + $defaultProviderId, + $defaultCapabilityLevel, + $providerConfigurations + ); + + return $configuration->getSettings($providers); + } + + private function getConfiguration(): Configuration + { + return StaticContainer::get(Configuration::class); + } +} diff --git a/Controller.php b/Controller.php new file mode 100644 index 0000000..b30a187 --- /dev/null +++ b/Controller.php @@ -0,0 +1,32 @@ +renderTemplate('index'); + } +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4686f35 --- /dev/null +++ b/LICENSE @@ -0,0 +1,49 @@ +InnoCraft License + +This InnoCraft End User License Agreement (the "InnoCraft EULA") is between you and InnoCraft Ltd (NZBN 6106769) ("InnoCraft"). If you are agreeing to this Agreement not as an individual but on behalf of your company, then "Customer" or "you" means your company, and you are binding your company to this Agreement. InnoCraft may modify this Agreement from time to time, subject to the terms in Section (xii) below. + +By clicking on the "I’ve read and accept the terms & conditions (https://shop.matomo.org/terms-conditions/)" (or similar button) that is presented to you at the time of your Order, or by using or accessing InnoCraft products, you indicate your assent to be bound by this Agreement. + + +InnoCraft EULA + +(i) InnoCraft is the licensor of the Plugin for Matomo Analytics (the "Software"). + +(ii) Subject to the terms and conditions of this Agreement, InnoCraft grants you a limited, worldwide, non-exclusive, non-transferable and non-sublicensable license to install and use the Software only on hardware systems owned, leased or controlled by you, during the applicable License Term. The term of each Software license ("License Term") will be specified in your Order. Your License Term will end upon any breach of this Agreement. + +(iii) Unless otherwise specified in your Order, for each Software license that you purchase, you may install one production instance of the Software in a Matomo Analytics instance owned or operated by you, and accessible via one URL ("Matomo instance"). Additional licenses must be purchased in order to deploy the Software in multiple Matomo instances, including when these multiple Matomo instances are hosted on a single hardware system. + +(iv) Licenses granted by InnoCraft are granted subject to the condition that you must ensure the maximum number of Authorized Users and Authorized Sites that are able to access and use the Software is equal to the number of User and Site Licenses for which the necessary fees have been paid to InnoCraft for the Subscription period. You may upgrade your license at any time on payment of the appropriate fees to InnoCraft in order to increase the maximum number of authorized users or sites. The number of User and Site Licenses granted to you is dependent on the fees paid by you. “User License” means a license granted under this EULA to you to permit an Authorized User to use the Software. “Authorized User” means a person who has an account in the Matomo instance and for which the necessary fees (“Subscription fees”) have been paid to InnoCraft for the current license term. "Site License" means a license granted under this EULA to you to permit an Authorized Site to use the Matomo Marketplace Plugin. “Authorized Sites” means a website or a measurable within Matomo instance and for which the necessary fees (“Subscription fees”) have been paid to InnoCraft for the current license term. These restrictions also apply if you install the Matomo Analytics Platform as part of your WordPress. + +(v) Piwik Analytics was renamed to Matomo Analytics in January 2018. The same terms and conditions as well as any restrictions or grants apply if you are using any version of Piwik. + +(vi) The Software requires a license key in order to operate, which will be delivered to the email addresses specified in your Order when we have received payment of the applicable fees. + +(vii) Any information that InnoCraft may collect from you or your device will be subject to InnoCraft Privacy Policy (https://www.innocraft.com/privacy). + +(viii) You are bound by the Matomo Marketplace Terms and Conditions (https://shop.matomo.org/terms-conditions/). + +(ix) You may not reverse engineer or disassemble or re-distribute the Software in whole or in part, or create any derivative works from or sublicense any rights in the Software, unless otherwise expressly authorized in writing by InnoCraft. + +(x) The Software is protected by copyright and other intellectual property laws and treaties. InnoCraft own all title, copyright and other intellectual property rights in the Software, and the Software is licensed to you directly by InnoCraft, not sold. + +(xi) The Software is provided under an "as is" basis and without any support or maintenance. Nothing in this Agreement shall require InnoCraft to provide you with support or fixes to any bug, failure, mis-performance or other defect in The Software. InnoCraft may provide you, from time to time, according to his sole discretion, with updates of the Software. You hereby warrant to keep the Software up-to-date and install all relevant updates. InnoCraft shall provide any update free of charge. + +(xii) The Software is provided "as is", and InnoCraft hereby disclaim all warranties, including but not limited to any implied warranties of title, non-infringement, merchantability or fitness for a particular purpose. InnoCraft shall not be liable or responsible in any way for any losses or damage of any kind, including lost profits or other indirect or consequential damages, relating to your use of or reliance upon the Software. + +(xiii) We may update or modify this Agreement from time to time, including the referenced Privacy Policy and the Matomo Marketplace Terms and Conditions. If a revision meaningfully reduces your rights, we will use reasonable efforts to notify you (by, for example, sending an email to the billing or technical contact you designate in the applicable Order). If we modify the Agreement during your License Term or Subscription Term, the modified version will be effective upon your next renewal of a License Term. + + +About InnoCraft Ltd + +At InnoCraft Ltd, we create innovating quality products to grow your business and to maximize your success. + +Our software products are built on top of Matomo Analytics: the leading open digital analytics platform used by more than one million websites worldwide. We are the creators and makers of the Matomo Analytics platform. + + +Contact + +Email: contact@innocraft.com +Contact form: https://www.innocraft.com/#contact +Website: https://www.innocraft.com/ +Buy our products: Premium Features for Matomo Analytics https://plugins.matomo.org/premium diff --git a/Menu.php b/Menu.php new file mode 100644 index 0000000..54e7996 --- /dev/null +++ b/Menu.php @@ -0,0 +1,34 @@ +addSystemItem('AIProviders_MenuTitle', $this->urlForAction('index'), 36); + } +} diff --git a/Model/Configuration.php b/Model/Configuration.php new file mode 100644 index 0000000..4f6a2d0 --- /dev/null +++ b/Model/Configuration.php @@ -0,0 +1,345 @@ + Provider metadata and masked configuration values. + */ + public function getSettings(AIProvidersList $providers): array + { + $providerConfigurations = $this->getProviderConfigurations(); + + return [ + 'defaultProviderId' => $this->getDefaultProviderId($providers), + 'defaultCapabilityLevel' => $this->getDefaultCapabilityLevel(), + 'canEditProviderConfiguration' => $this->canEditProviderConfiguration(), + 'canEditCapabilityLevel' => $this->canEditCapabilityLevel(), + 'capabilityLevels' => $this->getCapabilityLevels(), + 'providers' => array_map(function (AIProvider $provider) use ($providerConfigurations): array { + $providerConfiguration = $providerConfigurations[$provider->getId()] ?? []; + + return array_merge($provider->toArray(), [ + 'configuration' => [ + 'hasApiKey' => !empty($providerConfiguration['apiKey']), + 'endpointUrl' => $providerConfiguration['endpointUrl'] ?? '', + ], + ]); + }, $providers->getProviders()), + ]; + } + + /** + * Saves the default provider, capability level, and provider connection settings. + * + * On Matomo Cloud, provider connection settings are managed outside this + * plugin, so only the default provider is persisted. + */ + public function saveSettings( + AIProvidersList $providers, + string $defaultProviderId, + string $defaultCapabilityLevel, + #[\SensitiveParameter] + string $providerConfigurationsJson + ): void { + $this->saveDefaultProviderId($providers, $defaultProviderId); + + if (!$this->canEditCapabilityLevel()) { + return; + } + + $this->saveDefaultCapabilityLevel($defaultCapabilityLevel); + + if (!$this->canEditProviderConfiguration()) { + return; + } + + $submittedProviderConfigurations = $this->decodeProviderConfigurations($providerConfigurationsJson); + $this->saveProviderConfigurations($providers, $submittedProviderConfigurations); + } + + /** + * Returns a server-side provider configuration including the API key. + * + * This method is intended for PHP services in trusted plugins, not for API + * responses or browser output. + * + * @return array + */ + public function getProviderConfiguration(string $providerId): array + { + $providerConfigurations = $this->getProviderConfigurations(); + + return $providerConfigurations[$providerId] ?? [ + 'apiKey' => '', + 'endpointUrl' => '', + ]; + } + + /** + * @return array + */ + public function getCapabilityLevels(): array + { + return [ + self::CAPABILITY_INSTANT => 'AIProviders_InstantCapability', + self::CAPABILITY_THINKING => 'AIProviders_ThinkingCapability', + ]; + } + + public function canEditProviderConfiguration(): bool + { + return !Manager::getInstance()->isPluginActivated('Cloud'); + } + + public function canEditCapabilityLevel(): bool + { + return !Manager::getInstance()->isPluginActivated('Cloud'); + } + + /** + * Returns the configured default provider ID, falling back to the first available provider. + */ + public function getDefaultProviderId(AIProvidersList $providers): string + { + $providerId = Option::get(self::OPTION_DEFAULT_PROVIDER_ID); + + if (!is_string($providerId) || !$providers->hasProvider($providerId)) { + return $providers->hasProvider(self::DEFAULT_PROVIDER_ID) + ? self::DEFAULT_PROVIDER_ID + : $this->getFirstProviderId($providers); + } + + return $providerId; + } + + private function saveDefaultProviderId(AIProvidersList $providers, string $providerId): void + { + $providerId = trim($providerId); + + if (!$providers->hasProvider($providerId)) { + throw new InvalidArgumentException(sprintf('Unknown AI provider "%s".', $providerId)); + } + + Option::set(self::OPTION_DEFAULT_PROVIDER_ID, $providerId); + } + + /** + * Returns the configured default model capability level. + */ + public function getDefaultCapabilityLevel(): string + { + $capabilityLevel = Option::get(self::OPTION_DEFAULT_CAPABILITY_LEVEL); + + if (!is_string($capabilityLevel) || !array_key_exists($capabilityLevel, $this->getCapabilityLevels())) { + return self::CAPABILITY_INSTANT; + } + + return $capabilityLevel; + } + + private function saveDefaultCapabilityLevel(string $capabilityLevel): void + { + $capabilityLevel = trim($capabilityLevel); + + if (!array_key_exists($capabilityLevel, $this->getCapabilityLevels())) { + throw new InvalidArgumentException(sprintf('Unknown AI model capability level "%s".', $capabilityLevel)); + } + + Option::set(self::OPTION_DEFAULT_CAPABILITY_LEVEL, $capabilityLevel); + } + + /** + * @return array> + */ + private function getProviderConfigurations(): array + { + $rawValue = Option::get(self::OPTION_PROVIDER_CONFIGURATIONS); + + if (!is_string($rawValue) || $rawValue === '') { + return []; + } + + $decoded = json_decode($rawValue, true); + + if (!is_array($decoded)) { + return []; + } + + $providerConfigurations = []; + foreach ($decoded as $providerId => $providerConfiguration) { + if (!is_string($providerId) || !is_array($providerConfiguration)) { + continue; + } + + $providerConfigurations[$providerId] = [ + 'apiKey' => isset($providerConfiguration['apiKey']) && is_string($providerConfiguration['apiKey']) + ? $providerConfiguration['apiKey'] + : '', + 'endpointUrl' => isset($providerConfiguration['endpointUrl']) && is_string($providerConfiguration['endpointUrl']) + ? $providerConfiguration['endpointUrl'] + : '', + ]; + } + + return $providerConfigurations; + } + + /** + * @return array> + */ + private function decodeProviderConfigurations( + #[\SensitiveParameter] + string $providerConfigurationsJson + ): array { + $decoded = json_decode($providerConfigurationsJson, true); + + if (!is_array($decoded)) { + throw new InvalidArgumentException('Provider configurations must be a JSON object.'); + } + + return $decoded; + } + + /** + * @param array $submittedProviderConfigurations + */ + private function saveProviderConfigurations( + AIProvidersList $providers, + #[\SensitiveParameter] + array $submittedProviderConfigurations + ): void { + $existingProviderConfigurations = $this->getProviderConfigurations(); + $providerConfigurations = []; + + foreach ($providers->getProviders() as $provider) { + $providerId = $provider->getId(); + $submittedProviderConfiguration = $submittedProviderConfigurations[$providerId] ?? []; + + if (!is_array($submittedProviderConfiguration)) { + throw new InvalidArgumentException(sprintf('Invalid configuration for AI provider "%s".', $providerId)); + } + + $apiKey = $this->getSubmittedApiKey($submittedProviderConfiguration, $existingProviderConfigurations, $providerId); + $endpointUrl = $this->getSubmittedEndpointUrl($submittedProviderConfiguration, $provider); + + if ($apiKey === '' && $endpointUrl === '') { + continue; + } + + $providerConfigurations[$providerId] = [ + 'apiKey' => $apiKey, + 'endpointUrl' => $endpointUrl, + ]; + } + + $encodedProviderConfigurations = json_encode($providerConfigurations); + + if (!is_string($encodedProviderConfigurations)) { + throw new InvalidArgumentException('Provider configurations could not be encoded.'); + } + + Option::set(self::OPTION_PROVIDER_CONFIGURATIONS, $encodedProviderConfigurations); + } + + /** + * @param array $submittedProviderConfiguration + * @param array> $existingProviderConfigurations + */ + private function getSubmittedApiKey( + #[\SensitiveParameter] + array $submittedProviderConfiguration, + #[\SensitiveParameter] + array $existingProviderConfigurations, + string $providerId + ): string { + if ( + isset($submittedProviderConfiguration['apiKey']) + && is_string($submittedProviderConfiguration['apiKey']) + && trim($submittedProviderConfiguration['apiKey']) !== '' + ) { + return trim($submittedProviderConfiguration['apiKey']); + } + + return $existingProviderConfigurations[$providerId]['apiKey'] ?? ''; + } + + /** + * @param array $submittedProviderConfiguration + */ + private function getSubmittedEndpointUrl(array $submittedProviderConfiguration, AIProvider $provider): string + { + if (!$provider->supportsCustomEndpoint()) { + return ''; + } + + $endpointUrl = isset($submittedProviderConfiguration['endpointUrl']) + && is_string($submittedProviderConfiguration['endpointUrl']) + ? trim($submittedProviderConfiguration['endpointUrl']) + : ''; + + if ($endpointUrl === '') { + return ''; + } + + $parsedUrl = parse_url($endpointUrl); + $scheme = is_array($parsedUrl) ? ($parsedUrl['scheme'] ?? '') : ''; + + if ( + !filter_var($endpointUrl, FILTER_VALIDATE_URL) + || !in_array($scheme, ['http', 'https'], true) + ) { + throw new InvalidArgumentException(sprintf( + 'Invalid endpoint URL for AI provider "%s".', + $provider->getId() + )); + } + + return $endpointUrl; + } + + private function getFirstProviderId(AIProvidersList $providers): string + { + $availableProviders = $providers->getProviders(); + + if (empty($availableProviders)) { + throw new InvalidArgumentException('No AI providers are available.'); + } + + return $availableProviders[0]->getId(); + } +} diff --git a/Provider/AIProvider.php b/Provider/AIProvider.php new file mode 100644 index 0000000..903c8f6 --- /dev/null +++ b/Provider/AIProvider.php @@ -0,0 +1,87 @@ +id = $id; + $this->name = $name; + $this->description = $description; + $this->supportsCustomEndpoint = $supportsCustomEndpoint; + } + + public function getId(): string + { + return $this->id; + } + + public function getName(): string + { + return $this->name; + } + + public function getDescription(): string + { + return $this->description; + } + + public function supportsCustomEndpoint(): bool + { + return $this->supportsCustomEndpoint; + } + + /** + * @return array + */ + public function toArray(): array + { + return [ + 'id' => $this->getId(), + 'name' => $this->getName(), + 'description' => $this->getDescription(), + 'supportsCustomEndpoint' => $this->supportsCustomEndpoint(), + ]; + } +} diff --git a/Provider/Claude.php b/Provider/Claude.php new file mode 100644 index 0000000..b452fb2 --- /dev/null +++ b/Provider/Claude.php @@ -0,0 +1,27 @@ +getDefaultProvider(); +$configuration = $service->getDefaultProviderConfiguration(); +$capabilityLevel = $service->getDefaultCapabilityLevel(); +``` + +`$configuration` may include secrets and must not be logged, returned from API methods, or rendered in browser output. diff --git a/lang/en.json b/lang/en.json new file mode 100644 index 0000000..57e4569 --- /dev/null +++ b/lang/en.json @@ -0,0 +1,22 @@ +{ + "AIProviders": { + "ApiKey": "API key", + "ApiKeyAlreadyConfigured": "An API key is already configured. Leave this field empty to keep it.", + "ApiKeyHelp": "Stored API keys are masked and are only available to server-side AI provider services.", + "ClaudeDescription": "Anthropic Claude models.", + "CloudConfigurationHelp": "Provider connections are managed by Matomo Cloud. You can only change the default provider.", + "CustomProviderDescription": "Self-hosted or custom AI provider connection.", + "DefaultCapabilityLevel": "Default model capability level", + "DefaultProvider": "Default provider", + "EndpointUrl": "Endpoint URL", + "EndpointUrlHelp": "Use this for a self-hosted or custom provider endpoint.", + "GeminiDescription": "Google Gemini models.", + "InstantCapability": "Instant", + "MenuTitle": "AI Providers", + "OpenAIDescription": "OpenAI models.", + "PluginDescription": "Configure AI provider connections and default model settings used by Matomo AI features.", + "ProviderConnections": "Provider connections", + "SettingsSaveSuccess": "AI provider settings saved.", + "ThinkingCapability": "Thinking" + } +} diff --git a/plugin.json b/plugin.json new file mode 100644 index 0000000..a5696cc --- /dev/null +++ b/plugin.json @@ -0,0 +1,17 @@ +{ + "name": "AIProviders", + "description": "Configure AI provider connections and default model settings used by Matomo AI features.", + "version": "0.0.1", + "theme": false, + "require": { + "matomo": ">=5.0.0-rc1,<6.0.0-b1" + }, + "authors": [ + { + "name": "InnoCraft", + "email": "contact@innocraft.com", + "homepage": "https://www.innocraft.com" + } + ], + "license": "InnoCraft EULA" +} diff --git a/templates/index.twig b/templates/index.twig new file mode 100644 index 0000000..3f750ae --- /dev/null +++ b/templates/index.twig @@ -0,0 +1,5 @@ +{% extends 'admin.twig' %} + +{% block content %} +
+{% endblock %} diff --git a/vue/dist/AIProviders.umd.js b/vue/dist/AIProviders.umd.js new file mode 100644 index 0000000..3300057 --- /dev/null +++ b/vue/dist/AIProviders.umd.js @@ -0,0 +1,347 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("CoreHome"), require("vue"), require("CorePluginsAdmin")); + else if(typeof define === 'function' && define.amd) + define(["CoreHome", , "CorePluginsAdmin"], factory); + else if(typeof exports === 'object') + exports["AIProviders"] = factory(require("CoreHome"), require("vue"), require("CorePluginsAdmin")); + else + root["AIProviders"] = factory(root["CoreHome"], root["Vue"], root["CorePluginsAdmin"]); +})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "plugins/AIProviders/vue/dist/"; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "fae3"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "19dc": +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__; + +/***/ }), + +/***/ "8bbf": +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__; + +/***/ }), + +/***/ "a5a2": +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__; + +/***/ }), + +/***/ "fae3": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +// ESM COMPAT FLAG +__webpack_require__.r(__webpack_exports__); + +// EXPORTS +__webpack_require__.d(__webpack_exports__, "ManageAIProviders", function() { return /* reexport */ ManageAIProviders; }); + +// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js +// This file is imported into lib/wc client bundles. + +if (typeof window !== 'undefined') { + var currentScript = window.document.currentScript + if (false) { var getCurrentScript; } + + var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/) + if (src) { + __webpack_require__.p = src[1] // eslint-disable-line + } +} + +// Indicate to webpack that this file can be concatenated +/* harmony default export */ var setPublicPath = (null); + +// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} +var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); + +// EXTERNAL MODULE: external "CoreHome" +var external_CoreHome_ = __webpack_require__("19dc"); + +// EXTERNAL MODULE: external "CorePluginsAdmin" +var external_CorePluginsAdmin_ = __webpack_require__("a5a2"); + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/AIProviders/vue/src/ManageAIProviders.vue?vue&type=script&setup=true&lang=ts + + +const _hoisted_1 = { + key: 1 +}; +const _hoisted_2 = { + key: 1 +}; +const _hoisted_3 = { + class: "form-description" +}; + + + +/* harmony default export */ var ManageAIProvidersvue_type_script_setup_true_lang_ts = (/*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + __name: 'ManageAIProviders', + setup(__props) { + const settings = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(null); + const isLoading = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(false); + const isSaving = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(false); + const defaultProviderId = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(''); + const defaultCapabilityLevel = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(''); + const providerConfigurations = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])({}); + const providerOptions = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => { + var _settings$value; + const options = {}; + const providers = ((_settings$value = settings.value) === null || _settings$value === void 0 ? void 0 : _settings$value.providers) || []; + providers.forEach(provider => { + options[provider.id] = provider.name; + }); + return options; + }); + const capabilityLevelOptions = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => { + var _settings$value2; + const options = {}; + Object.entries(((_settings$value2 = settings.value) === null || _settings$value2 === void 0 ? void 0 : _settings$value2.capabilityLevels) || {}).forEach(([id, translationKey]) => { + options[id] = Object(external_CoreHome_["translate"])(translationKey); + }); + return options; + }); + function applySettings(nextSettings) { + settings.value = nextSettings; + defaultProviderId.value = nextSettings.defaultProviderId; + defaultCapabilityLevel.value = nextSettings.defaultCapabilityLevel; + const nextProviderConfigurations = {}; + nextSettings.providers.forEach(provider => { + nextProviderConfigurations[provider.id] = { + apiKey: '', + endpointUrl: provider.configuration.endpointUrl || '' + }; + }); + providerConfigurations.value = nextProviderConfigurations; + } + async function loadSettings() { + isLoading.value = true; + try { + const response = await external_CoreHome_["AjaxHelper"].fetch({ + method: 'AIProviders.getSettings' + }); + applySettings(response); + } finally { + isLoading.value = false; + } + } + function updateApiKey(providerId, apiKey) { + providerConfigurations.value[providerId] = Object.assign(Object.assign({}, providerConfigurations.value[providerId]), {}, { + apiKey + }); + } + function updateEndpointUrl(providerId, endpointUrl) { + providerConfigurations.value[providerId] = Object.assign(Object.assign({}, providerConfigurations.value[providerId]), {}, { + endpointUrl + }); + } + async function saveSettings() { + isSaving.value = true; + try { + const response = await external_CoreHome_["AjaxHelper"].post({ + method: 'AIProviders.saveSettings' + }, { + defaultProviderId: defaultProviderId.value, + defaultCapabilityLevel: defaultCapabilityLevel.value, + providerConfigurations: JSON.stringify(providerConfigurations.value) + }, { + withTokenInUrl: true + }); + applySettings(response); + const notificationInstanceId = external_CoreHome_["NotificationsStore"].show({ + message: Object(external_CoreHome_["translate"])('AIProviders_SettingsSaveSuccess'), + type: 'transient', + id: 'aiProvidersSettings', + context: 'success' + }); + external_CoreHome_["NotificationsStore"].scrollToNotification(notificationInstanceId); + } finally { + isSaving.value = false; + } + } + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["onMounted"])(loadSettings); + return (_ctx, _cache) => { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["ContentBlock"]), { + "content-title": Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_MenuTitle') + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [isLoading.value ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["ActivityIndicator"]), { + key: 0, + loading: isLoading.value + }, null, 8, ["loading"])) : settings.value ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Field"]), { + uicontrol: "select", + name: "defaultProviderId", + modelValue: defaultProviderId.value, + "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => defaultProviderId.value = $event), + title: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultProvider'), + options: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(providerOptions) + }, null, 8, ["modelValue", "title", "options"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Field"]), { + uicontrol: "select", + name: "defaultCapabilityLevel", + modelValue: defaultCapabilityLevel.value, + "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => defaultCapabilityLevel.value = $event), + title: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultCapabilityLevel'), + options: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(capabilityLevelOptions), + disabled: !settings.value.canEditCapabilityLevel + }, null, 8, ["modelValue", "title", "options", "disabled"]), !settings.value.canEditProviderConfiguration ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["Alert"]), { + key: 0, + severity: "info" + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_CloudConfigurationHelp')), 1)]), + _: 1 + })) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), settings.value.canEditProviderConfiguration ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_ProviderConnections')), 1), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(settings.value.providers, provider => { + var _providerConfiguratio, _providerConfiguratio2; + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + key: provider.id, + class: "ai-provider" + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(provider.name), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])(provider.description)), 1), provider.supportsCustomEndpoint ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Field"]), { + key: 0, + uicontrol: "text", + name: `endpointUrl-${provider.id}`, + "model-value": (_providerConfiguratio = providerConfigurations.value[provider.id]) === null || _providerConfiguratio === void 0 ? void 0 : _providerConfiguratio.endpointUrl, + "onUpdate:modelValue": $event => updateEndpointUrl(provider.id, `${$event}`), + title: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_EndpointUrl'), + "inline-help": Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_EndpointUrlHelp'), + autocomplete: "off" + }, null, 8, ["name", "model-value", "onUpdate:modelValue", "title", "inline-help"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Field"]), { + uicontrol: "password", + name: `apiKey-${provider.id}`, + "model-value": (_providerConfiguratio2 = providerConfigurations.value[provider.id]) === null || _providerConfiguratio2 === void 0 ? void 0 : _providerConfiguratio2.apiKey, + "onUpdate:modelValue": $event => updateApiKey(provider.id, `${$event}`), + title: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_ApiKey'), + "inline-help": provider.configuration.hasApiKey ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_ApiKeyAlreadyConfigured') : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_ApiKeyHelp'), + autocomplete: "off" + }, null, 8, ["name", "model-value", "onUpdate:modelValue", "title", "inline-help"]), [[Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["AutoClearPassword"])]])]); + }), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["SaveButton"]), { + onConfirm: _cache[2] || (_cache[2] = $event => saveSettings()), + saving: isSaving.value + }, null, 8, ["saving"])])), [[Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Form"])]]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), + _: 1 + }, 8, ["content-title"]); + }; + } +})); +// CONCATENATED MODULE: ./plugins/AIProviders/vue/src/ManageAIProviders.vue?vue&type=script&setup=true&lang=ts + +// CONCATENATED MODULE: ./plugins/AIProviders/vue/src/ManageAIProviders.vue + + + +/* harmony default export */ var ManageAIProviders = (ManageAIProvidersvue_type_script_setup_true_lang_ts); +// CONCATENATED MODULE: ./plugins/AIProviders/vue/src/index.ts +/*! + * Copyright (C) InnoCraft Ltd - All rights reserved. + * + * NOTICE: All information contained herein is, and remains the property of InnoCraft Ltd. + * The intellectual and technical concepts contained herein are protected by trade secret + * or copyright law. Redistribution of this information or reproduction of this material is + * strictly forbidden unless prior written permission is obtained from InnoCraft Ltd. + * + * You shall use this code only in accordance with the license agreement obtained from + * InnoCraft Ltd. + * + * @link https://www.innocraft.com/ + * @license For license details see https://www.innocraft.com/license + */ + +// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js + + + + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=AIProviders.umd.js.map \ No newline at end of file diff --git a/vue/dist/AIProviders.umd.js.map b/vue/dist/AIProviders.umd.js.map new file mode 100644 index 0000000..aee2ec1 --- /dev/null +++ b/vue/dist/AIProviders.umd.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://AIProviders/webpack/universalModuleDefinition","webpack://AIProviders/webpack/bootstrap","webpack://AIProviders/external \"CoreHome\"","webpack://AIProviders/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://AIProviders/external \"CorePluginsAdmin\"","webpack://AIProviders/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?c296","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?cf17","webpack://AIProviders/./plugins/AIProviders/vue/src/index.ts","webpack://AIProviders/./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js"],"names":[],"mappings":"A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AM,YAAY,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,MAAM,EAAE,CAAE;YAChF,KAAK,EAAE,8DAAM,CAAC,+BAAS,CAAC,CAAC,oBAAoB,CAAC;YAC9C,aAAa,EAAE,QAAQ,CAAC,aAAa,CAAC,SAAS,GACzD,8DAAM,CAAC,+BAAS,CAAC,CAAC,qCAAqC,CAAC,GACxD,8DAAM,CAAC,+BAAS,CAAC,CAAC,wBAAwB,CAAC;YACjC,YAAY,EAAE;WACf,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,qBAAqB,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,EAAE,CACnF,CAAC,8DAAM,CAAC,uCAAkB,CAAC,CAAC,CAC7B,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,EAAE,GAAG,CAAC,EACT,CAAC,IACF,2EAAmB,CAAC,EAAE,EAAE,IAAI,CAAC,EACjC,oEAAY,CAAC,8DAAM,CAAC,wCAAU,CAAC,EAAE;UAC/B,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,GAAI,MAAW,IAAM,YAAY,EAAG,CAAC;UACvE,MAAM,EAAE,QAAQ,CAAC;SAClB,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CACxB,CAAC,GAAG,CACH,CAAC,8DAAM,CAAC,kCAAK,CAAC,CAAC,CAChB,CAAC,GACF,2EAAmB,CAAC,EAAE,EAAE,IAAI,CAAC,CACpC,CAAC;QACF,CAAC,EAAE;OACJ,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC;IAC1B,CAAC;EACD;CAEC,CAAC,E;;AC3PogB,C;;ACAvb;AACL;;AAE3D,yG;;ACHf;;;;;;;;;;;;;AAaG;;;ACbqB;AACF","file":"AIProviders.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"CoreHome\", , \"CorePluginsAdmin\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AIProviders\"] = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse\n\t\troot[\"AIProviders\"] = factory(root[\"CoreHome\"], root[\"Vue\"], root[\"CorePluginsAdmin\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"plugins/AIProviders/vue/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fae3\");\n","module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;","module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__;","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, withDirectives as _withDirectives } from \"vue\"\n\nconst _hoisted_1 = { key: 1 }\nconst _hoisted_2 = { key: 1 }\nconst _hoisted_3 = { class: \"form-description\" }\n\nimport {\n computed,\n onMounted,\n ref,\n} from 'vue';\nimport {\n ActivityIndicator,\n AjaxHelper,\n Alert,\n AutoClearPassword as vAutoClearPassword,\n ContentBlock,\n NotificationsStore,\n translate,\n} from 'CoreHome';\nimport {\n Field,\n Form as vForm,\n SaveButton,\n} from 'CorePluginsAdmin';\n\ninterface ProviderConfiguration {\n apiKey: string;\n endpointUrl: string;\n}\n\ninterface Provider {\n id: string;\n name: string;\n description: string;\n supportsCustomEndpoint: boolean;\n configuration: {\n hasApiKey: boolean;\n endpointUrl: string;\n };\n}\n\ninterface Settings {\n defaultProviderId: string;\n defaultCapabilityLevel: string;\n canEditProviderConfiguration: boolean;\n canEditCapabilityLevel: boolean;\n capabilityLevels: Record;\n providers: Provider[];\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ManageAIProviders',\n setup(__props) {\n\nconst settings = ref(null);\nconst isLoading = ref(false);\nconst isSaving = ref(false);\nconst defaultProviderId = ref('');\nconst defaultCapabilityLevel = ref('');\nconst providerConfigurations = ref>({});\n\nconst providerOptions = computed(() => {\n const options: Record = {};\n const providers = settings.value?.providers || [];\n\n providers.forEach((provider) => {\n options[provider.id] = provider.name;\n });\n\n return options;\n});\n\nconst capabilityLevelOptions = computed(() => {\n const options: Record = {};\n Object.entries(settings.value?.capabilityLevels || {}).forEach(([id, translationKey]) => {\n options[id] = translate(translationKey);\n });\n return options;\n});\n\nfunction applySettings(nextSettings: Settings) {\n settings.value = nextSettings;\n defaultProviderId.value = nextSettings.defaultProviderId;\n defaultCapabilityLevel.value = nextSettings.defaultCapabilityLevel;\n\n const nextProviderConfigurations: Record = {};\n nextSettings.providers.forEach((provider) => {\n nextProviderConfigurations[provider.id] = {\n apiKey: '',\n endpointUrl: provider.configuration.endpointUrl || '',\n };\n });\n providerConfigurations.value = nextProviderConfigurations;\n}\n\nasync function loadSettings() {\n isLoading.value = true;\n\n try {\n const response = await AjaxHelper.fetch({\n method: 'AIProviders.getSettings',\n });\n applySettings(response);\n } finally {\n isLoading.value = false;\n }\n}\n\nfunction updateApiKey(providerId: string, apiKey: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n apiKey,\n };\n}\n\nfunction updateEndpointUrl(providerId: string, endpointUrl: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n endpointUrl,\n };\n}\n\nasync function saveSettings() {\n isSaving.value = true;\n\n try {\n const response = await AjaxHelper.post(\n {\n method: 'AIProviders.saveSettings',\n },\n {\n defaultProviderId: defaultProviderId.value,\n defaultCapabilityLevel: defaultCapabilityLevel.value,\n providerConfigurations: JSON.stringify(providerConfigurations.value),\n },\n {\n withTokenInUrl: true,\n },\n );\n applySettings(response);\n\n const notificationInstanceId = NotificationsStore.show({\n message: translate('AIProviders_SettingsSaveSuccess'),\n type: 'transient',\n id: 'aiProvidersSettings',\n context: 'success',\n });\n NotificationsStore.scrollToNotification(notificationInstanceId);\n } finally {\n isSaving.value = false;\n }\n}\n\nonMounted(loadSettings);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(_unref(ContentBlock), {\n \"content-title\": _unref(translate)('AIProviders_MenuTitle')\n }, {\n default: _withCtx(() => [\n (isLoading.value)\n ? (_openBlock(), _createBlock(_unref(ActivityIndicator), {\n key: 0,\n loading: isLoading.value\n }, null, 8, [\"loading\"]))\n : (settings.value)\n ? _withDirectives((_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_unref(Field), {\n uicontrol: \"select\",\n name: \"defaultProviderId\",\n modelValue: defaultProviderId.value,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((defaultProviderId).value = $event)),\n title: _unref(translate)('AIProviders_DefaultProvider'),\n options: _unref(providerOptions)\n }, null, 8, [\"modelValue\", \"title\", \"options\"]),\n _createVNode(_unref(Field), {\n uicontrol: \"select\",\n name: \"defaultCapabilityLevel\",\n modelValue: defaultCapabilityLevel.value,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => ((defaultCapabilityLevel).value = $event)),\n title: _unref(translate)('AIProviders_DefaultCapabilityLevel'),\n options: _unref(capabilityLevelOptions),\n disabled: !settings.value.canEditCapabilityLevel\n }, null, 8, [\"modelValue\", \"title\", \"options\", \"disabled\"]),\n (!settings.value.canEditProviderConfiguration)\n ? (_openBlock(), _createBlock(_unref(Alert), {\n key: 0,\n severity: \"info\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(translate)('AIProviders_CloudConfigurationHelp')), 1)\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (settings.value.canEditProviderConfiguration)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, [\n _createElementVNode(\"h3\", null, _toDisplayString(_unref(translate)('AIProviders_ProviderConnections')), 1),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(settings.value.providers, (provider) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n key: provider.id,\n class: \"ai-provider\"\n }, [\n _createElementVNode(\"h4\", null, _toDisplayString(provider.name), 1),\n _createElementVNode(\"p\", _hoisted_3, _toDisplayString(_unref(translate)(provider.description)), 1),\n (provider.supportsCustomEndpoint)\n ? (_openBlock(), _createBlock(_unref(Field), {\n key: 0,\n uicontrol: \"text\",\n name: `endpointUrl-${provider.id}`,\n \"model-value\": providerConfigurations.value[provider.id]?.endpointUrl,\n \"onUpdate:modelValue\": ($event: any) => (updateEndpointUrl(provider.id, `${$event}`)),\n title: _unref(translate)('AIProviders_EndpointUrl'),\n \"inline-help\": _unref(translate)('AIProviders_EndpointUrlHelp'),\n autocomplete: \"off\"\n }, null, 8, [\"name\", \"model-value\", \"onUpdate:modelValue\", \"title\", \"inline-help\"]))\n : _createCommentVNode(\"\", true),\n _withDirectives(_createVNode(_unref(Field), {\n uicontrol: \"password\",\n name: `apiKey-${provider.id}`,\n \"model-value\": providerConfigurations.value[provider.id]?.apiKey,\n \"onUpdate:modelValue\": ($event: any) => (updateApiKey(provider.id, `${$event}`)),\n title: _unref(translate)('AIProviders_ApiKey'),\n \"inline-help\": provider.configuration.hasApiKey\n ? _unref(translate)('AIProviders_ApiKeyAlreadyConfigured')\n : _unref(translate)('AIProviders_ApiKeyHelp'),\n autocomplete: \"off\"\n }, null, 8, [\"name\", \"model-value\", \"onUpdate:modelValue\", \"title\", \"inline-help\"]), [\n [_unref(vAutoClearPassword)]\n ])\n ]))\n }), 128))\n ]))\n : _createCommentVNode(\"\", true),\n _createVNode(_unref(SaveButton), {\n onConfirm: _cache[2] || (_cache[2] = ($event: any) => (saveSettings())),\n saving: isSaving.value\n }, null, 8, [\"saving\"])\n ])), [\n [_unref(vForm)]\n ])\n : _createCommentVNode(\"\", true)\n ]),\n _: 1\n }, 8, [\"content-title\"]))\n}\n}\n\n})","export { default } from \"-!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=script&setup=true&lang=ts\"; export * from \"-!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=script&setup=true&lang=ts\"","import script from \"./ManageAIProviders.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./ManageAIProviders.vue?vue&type=script&setup=true&lang=ts\"\n\nexport default script","/*!\n * Copyright (C) InnoCraft Ltd - All rights reserved.\n *\n * NOTICE: All information contained herein is, and remains the property of InnoCraft Ltd.\n * The intellectual and technical concepts contained herein are protected by trade secret\n * or copyright law. Redistribution of this information or reproduction of this material is\n * strictly forbidden unless prior written permission is obtained from InnoCraft Ltd.\n *\n * You shall use this code only in accordance with the license agreement obtained from\n * InnoCraft Ltd.\n *\n * @link https://www.innocraft.com/\n * @license For license details see https://www.innocraft.com/license\n */\n\nexport { default as ManageAIProviders } from './ManageAIProviders.vue';\n","import './setPublicPath'\nexport * from '~entry'\n"],"sourceRoot":""} \ No newline at end of file diff --git a/vue/dist/AIProviders.umd.min.js b/vue/dist/AIProviders.umd.min.js new file mode 100644 index 0000000..671e8d4 --- /dev/null +++ b/vue/dist/AIProviders.umd.min.js @@ -0,0 +1,2 @@ +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["AIProviders"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["AIProviders"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/AIProviders/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"ManageAIProviders",(function(){return f})),"undefined"!==typeof window){var o=window.document.currentScript,r=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var i=n("8bbf"),l=n("19dc"),a=n("a5a2");const c={key:1},u={key:1},d={class:"form-description"};var s=Object(i["defineComponent"])({__name:"ManageAIProviders",setup(e){const t=Object(i["ref"])(null),n=Object(i["ref"])(!1),o=Object(i["ref"])(!1),r=Object(i["ref"])(""),s=Object(i["ref"])(""),f=Object(i["ref"])({}),v=Object(i["computed"])(()=>{var e;const n={},o=(null===(e=t.value)||void 0===e?void 0:e.providers)||[];return o.forEach(e=>{n[e.id]=e.name}),n}),b=Object(i["computed"])(()=>{var e;const n={};return Object.entries((null===(e=t.value)||void 0===e?void 0:e.capabilityLevels)||{}).forEach(([e,t])=>{n[e]=Object(l["translate"])(t)}),n});function p(e){t.value=e,r.value=e.defaultProviderId,s.value=e.defaultCapabilityLevel;const n={};e.providers.forEach(e=>{n[e.id]={apiKey:"",endpointUrl:e.configuration.endpointUrl||""}}),f.value=n}async function j(){n.value=!0;try{const e=await l["AjaxHelper"].fetch({method:"AIProviders.getSettings"});p(e)}finally{n.value=!1}}function O(e,t){f.value[e]=Object.assign(Object.assign({},f.value[e]),{},{apiKey:t})}function m(e,t){f.value[e]=Object.assign(Object.assign({},f.value[e]),{},{endpointUrl:t})}async function y(){o.value=!0;try{const e=await l["AjaxHelper"].post({method:"AIProviders.saveSettings"},{defaultProviderId:r.value,defaultCapabilityLevel:s.value,providerConfigurations:JSON.stringify(f.value)},{withTokenInUrl:!0});p(e);const t=l["NotificationsStore"].show({message:Object(l["translate"])("AIProviders_SettingsSaveSuccess"),type:"transient",id:"aiProvidersSettings",context:"success"});l["NotificationsStore"].scrollToNotification(t)}finally{o.value=!1}}return Object(i["onMounted"])(j),(e,p)=>(Object(i["openBlock"])(),Object(i["createBlock"])(Object(i["unref"])(l["ContentBlock"]),{"content-title":Object(i["unref"])(l["translate"])("AIProviders_MenuTitle")},{default:Object(i["withCtx"])(()=>[n.value?(Object(i["openBlock"])(),Object(i["createBlock"])(Object(i["unref"])(l["ActivityIndicator"]),{key:0,loading:n.value},null,8,["loading"])):t.value?Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",c,[Object(i["createVNode"])(Object(i["unref"])(a["Field"]),{uicontrol:"select",name:"defaultProviderId",modelValue:r.value,"onUpdate:modelValue":p[0]||(p[0]=e=>r.value=e),title:Object(i["unref"])(l["translate"])("AIProviders_DefaultProvider"),options:Object(i["unref"])(v)},null,8,["modelValue","title","options"]),Object(i["createVNode"])(Object(i["unref"])(a["Field"]),{uicontrol:"select",name:"defaultCapabilityLevel",modelValue:s.value,"onUpdate:modelValue":p[1]||(p[1]=e=>s.value=e),title:Object(i["unref"])(l["translate"])("AIProviders_DefaultCapabilityLevel"),options:Object(i["unref"])(b),disabled:!t.value.canEditCapabilityLevel},null,8,["modelValue","title","options","disabled"]),t.value.canEditProviderConfiguration?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createBlock"])(Object(i["unref"])(l["Alert"]),{key:0,severity:"info"},{default:Object(i["withCtx"])(()=>[Object(i["createTextVNode"])(Object(i["toDisplayString"])(Object(i["unref"])(l["translate"])("AIProviders_CloudConfigurationHelp")),1)]),_:1})),t.value.canEditProviderConfiguration?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",u,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(Object(i["unref"])(l["translate"])("AIProviders_ProviderConnections")),1),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(t.value.providers,e=>{var t,n;return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{key:e.id,class:"ai-provider"},[Object(i["createElementVNode"])("h4",null,Object(i["toDisplayString"])(e.name),1),Object(i["createElementVNode"])("p",d,Object(i["toDisplayString"])(Object(i["unref"])(l["translate"])(e.description)),1),e.supportsCustomEndpoint?(Object(i["openBlock"])(),Object(i["createBlock"])(Object(i["unref"])(a["Field"]),{key:0,uicontrol:"text",name:"endpointUrl-"+e.id,"model-value":null===(t=f.value[e.id])||void 0===t?void 0:t.endpointUrl,"onUpdate:modelValue":t=>m(e.id,""+t),title:Object(i["unref"])(l["translate"])("AIProviders_EndpointUrl"),"inline-help":Object(i["unref"])(l["translate"])("AIProviders_EndpointUrlHelp"),autocomplete:"off"},null,8,["name","model-value","onUpdate:modelValue","title","inline-help"])):Object(i["createCommentVNode"])("",!0),Object(i["withDirectives"])(Object(i["createVNode"])(Object(i["unref"])(a["Field"]),{uicontrol:"password",name:"apiKey-"+e.id,"model-value":null===(n=f.value[e.id])||void 0===n?void 0:n.apiKey,"onUpdate:modelValue":t=>O(e.id,""+t),title:Object(i["unref"])(l["translate"])("AIProviders_ApiKey"),"inline-help":e.configuration.hasApiKey?Object(i["unref"])(l["translate"])("AIProviders_ApiKeyAlreadyConfigured"):Object(i["unref"])(l["translate"])("AIProviders_ApiKeyHelp"),autocomplete:"off"},null,8,["name","model-value","onUpdate:modelValue","title","inline-help"]),[[Object(i["unref"])(l["AutoClearPassword"])]])])}),128))])):Object(i["createCommentVNode"])("",!0),Object(i["createVNode"])(Object(i["unref"])(a["SaveButton"]),{onConfirm:p[2]||(p[2]=e=>y()),saving:o.value},null,8,["saving"])])),[[Object(i["unref"])(a["Form"])]]):Object(i["createCommentVNode"])("",!0)]),_:1},8,["content-title"]))}}),f=s}})})); +//# sourceMappingURL=AIProviders.umd.min.js.map \ No newline at end of file diff --git a/vue/dist/AIProviders.umd.min.js.map b/vue/dist/AIProviders.umd.min.js.map new file mode 100644 index 0000000..5a73f5a --- /dev/null +++ b/vue/dist/AIProviders.umd.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://AIProviders/webpack/universalModuleDefinition","webpack://AIProviders/webpack/bootstrap","webpack://AIProviders/external \"CoreHome\"","webpack://AIProviders/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://AIProviders/external \"CorePluginsAdmin\"","webpack://AIProviders/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?cf17"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__19dc__","__WEBPACK_EXTERNAL_MODULE__8bbf__","__WEBPACK_EXTERNAL_MODULE_a5a2__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","currentScript","document","src","match","_hoisted_1","_hoisted_2","_hoisted_3","class","__name","__props","settings","isLoading","isSaving","defaultProviderId","defaultCapabilityLevel","providerConfigurations","providerOptions","options","providers","forEach","provider","id","capabilityLevelOptions","entries","capabilityLevels","translationKey","applySettings","nextSettings","nextProviderConfigurations","apiKey","endpointUrl","configuration","async","loadSettings","response","fetch","method","updateApiKey","providerId","updateEndpointUrl","saveSettings","post","JSON","stringify","withTokenInUrl","notificationInstanceId","show","message","type","context","scrollToNotification","_ctx","_cache","default","loading","uicontrol","modelValue","$event","title","disabled","canEditCapabilityLevel","canEditProviderConfiguration","severity","_","description","supportsCustomEndpoint","autocomplete","hasApiKey","onConfirm","saving"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,kBAAZC,SAA0C,kBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,YAAaA,QAAQ,OAAQA,QAAQ,qBAC7C,oBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,WAAY,CAAE,oBAAqBJ,GACjB,kBAAZC,QACdA,QAAQ,eAAiBD,EAAQG,QAAQ,YAAaA,QAAQ,OAAQA,QAAQ,qBAE9EJ,EAAK,eAAiBC,EAAQD,EAAK,YAAaA,EAAK,OAAQA,EAAK,sBARpE,CASoB,qBAATO,KAAuBA,KAAOC,MAAO,SAASC,EAAmCC,EAAmCC,GAC/H,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUZ,QAGnC,IAAIC,EAASS,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHd,QAAS,IAUV,OANAe,EAAQH,GAAUI,KAAKf,EAAOD,QAASC,EAAQA,EAAOD,QAASW,GAG/DV,EAAOa,GAAI,EAGJb,EAAOD,QA0Df,OArDAW,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASnB,EAASoB,EAAMC,GAC3CV,EAAoBW,EAAEtB,EAASoB,IAClCG,OAAOC,eAAexB,EAASoB,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAS3B,GACX,qBAAX4B,QAA0BA,OAAO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AAcoC,UAChD,mBAAO,eAAP,CAAkB,uCAClB,mBAAO,eAAP,CAAkB,0BACRD,aAAc,OACb,KAAM,EAAG,CAAC,OAAQ,cAAe,sBAAuB,QAAS,gBAAiB,CACnF,CAAC,mBAAO,+BAGV,SAEN,gCAAoB,IAAI,GAC5B,yBAAa,mBAAO,iBAAa,CAC/BE,UAAWhB,EAAO,KAAOA,EAAO,GAAMK,GAAiBjB,KACvD6B,OAAQzD,EAAS5B,OAChB,KAAM,EAAG,CAAC,cACV,CACH,CAAC,mBAAO,cAEV,gCAAoB,IAAI,KAEhC+E,EAAG,GACF,EAAG,CAAC,sBCpPM","file":"AIProviders.umd.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"CoreHome\", , \"CorePluginsAdmin\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AIProviders\"] = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse\n\t\troot[\"AIProviders\"] = factory(root[\"CoreHome\"], root[\"Vue\"], root[\"CorePluginsAdmin\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"plugins/AIProviders/vue/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fae3\");\n","module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;","module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__;","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, withDirectives as _withDirectives } from \"vue\"\n\nconst _hoisted_1 = { key: 1 }\nconst _hoisted_2 = { key: 1 }\nconst _hoisted_3 = { class: \"form-description\" }\n\nimport {\n computed,\n onMounted,\n ref,\n} from 'vue';\nimport {\n ActivityIndicator,\n AjaxHelper,\n Alert,\n AutoClearPassword as vAutoClearPassword,\n ContentBlock,\n NotificationsStore,\n translate,\n} from 'CoreHome';\nimport {\n Field,\n Form as vForm,\n SaveButton,\n} from 'CorePluginsAdmin';\n\ninterface ProviderConfiguration {\n apiKey: string;\n endpointUrl: string;\n}\n\ninterface Provider {\n id: string;\n name: string;\n description: string;\n supportsCustomEndpoint: boolean;\n configuration: {\n hasApiKey: boolean;\n endpointUrl: string;\n };\n}\n\ninterface Settings {\n defaultProviderId: string;\n defaultCapabilityLevel: string;\n canEditProviderConfiguration: boolean;\n canEditCapabilityLevel: boolean;\n capabilityLevels: Record;\n providers: Provider[];\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ManageAIProviders',\n setup(__props) {\n\nconst settings = ref(null);\nconst isLoading = ref(false);\nconst isSaving = ref(false);\nconst defaultProviderId = ref('');\nconst defaultCapabilityLevel = ref('');\nconst providerConfigurations = ref>({});\n\nconst providerOptions = computed(() => {\n const options: Record = {};\n const providers = settings.value?.providers || [];\n\n providers.forEach((provider) => {\n options[provider.id] = provider.name;\n });\n\n return options;\n});\n\nconst capabilityLevelOptions = computed(() => {\n const options: Record = {};\n Object.entries(settings.value?.capabilityLevels || {}).forEach(([id, translationKey]) => {\n options[id] = translate(translationKey);\n });\n return options;\n});\n\nfunction applySettings(nextSettings: Settings) {\n settings.value = nextSettings;\n defaultProviderId.value = nextSettings.defaultProviderId;\n defaultCapabilityLevel.value = nextSettings.defaultCapabilityLevel;\n\n const nextProviderConfigurations: Record = {};\n nextSettings.providers.forEach((provider) => {\n nextProviderConfigurations[provider.id] = {\n apiKey: '',\n endpointUrl: provider.configuration.endpointUrl || '',\n };\n });\n providerConfigurations.value = nextProviderConfigurations;\n}\n\nasync function loadSettings() {\n isLoading.value = true;\n\n try {\n const response = await AjaxHelper.fetch({\n method: 'AIProviders.getSettings',\n });\n applySettings(response);\n } finally {\n isLoading.value = false;\n }\n}\n\nfunction updateApiKey(providerId: string, apiKey: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n apiKey,\n };\n}\n\nfunction updateEndpointUrl(providerId: string, endpointUrl: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n endpointUrl,\n };\n}\n\nasync function saveSettings() {\n isSaving.value = true;\n\n try {\n const response = await AjaxHelper.post(\n {\n method: 'AIProviders.saveSettings',\n },\n {\n defaultProviderId: defaultProviderId.value,\n defaultCapabilityLevel: defaultCapabilityLevel.value,\n providerConfigurations: JSON.stringify(providerConfigurations.value),\n },\n {\n withTokenInUrl: true,\n },\n );\n applySettings(response);\n\n const notificationInstanceId = NotificationsStore.show({\n message: translate('AIProviders_SettingsSaveSuccess'),\n type: 'transient',\n id: 'aiProvidersSettings',\n context: 'success',\n });\n NotificationsStore.scrollToNotification(notificationInstanceId);\n } finally {\n isSaving.value = false;\n }\n}\n\nonMounted(loadSettings);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(_unref(ContentBlock), {\n \"content-title\": _unref(translate)('AIProviders_MenuTitle')\n }, {\n default: _withCtx(() => [\n (isLoading.value)\n ? (_openBlock(), _createBlock(_unref(ActivityIndicator), {\n key: 0,\n loading: isLoading.value\n }, null, 8, [\"loading\"]))\n : (settings.value)\n ? _withDirectives((_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_unref(Field), {\n uicontrol: \"select\",\n name: \"defaultProviderId\",\n modelValue: defaultProviderId.value,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((defaultProviderId).value = $event)),\n title: _unref(translate)('AIProviders_DefaultProvider'),\n options: _unref(providerOptions)\n }, null, 8, [\"modelValue\", \"title\", \"options\"]),\n _createVNode(_unref(Field), {\n uicontrol: \"select\",\n name: \"defaultCapabilityLevel\",\n modelValue: defaultCapabilityLevel.value,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => ((defaultCapabilityLevel).value = $event)),\n title: _unref(translate)('AIProviders_DefaultCapabilityLevel'),\n options: _unref(capabilityLevelOptions),\n disabled: !settings.value.canEditCapabilityLevel\n }, null, 8, [\"modelValue\", \"title\", \"options\", \"disabled\"]),\n (!settings.value.canEditProviderConfiguration)\n ? (_openBlock(), _createBlock(_unref(Alert), {\n key: 0,\n severity: \"info\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(translate)('AIProviders_CloudConfigurationHelp')), 1)\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (settings.value.canEditProviderConfiguration)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, [\n _createElementVNode(\"h3\", null, _toDisplayString(_unref(translate)('AIProviders_ProviderConnections')), 1),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(settings.value.providers, (provider) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n key: provider.id,\n class: \"ai-provider\"\n }, [\n _createElementVNode(\"h4\", null, _toDisplayString(provider.name), 1),\n _createElementVNode(\"p\", _hoisted_3, _toDisplayString(_unref(translate)(provider.description)), 1),\n (provider.supportsCustomEndpoint)\n ? (_openBlock(), _createBlock(_unref(Field), {\n key: 0,\n uicontrol: \"text\",\n name: `endpointUrl-${provider.id}`,\n \"model-value\": providerConfigurations.value[provider.id]?.endpointUrl,\n \"onUpdate:modelValue\": ($event: any) => (updateEndpointUrl(provider.id, `${$event}`)),\n title: _unref(translate)('AIProviders_EndpointUrl'),\n \"inline-help\": _unref(translate)('AIProviders_EndpointUrlHelp'),\n autocomplete: \"off\"\n }, null, 8, [\"name\", \"model-value\", \"onUpdate:modelValue\", \"title\", \"inline-help\"]))\n : _createCommentVNode(\"\", true),\n _withDirectives(_createVNode(_unref(Field), {\n uicontrol: \"password\",\n name: `apiKey-${provider.id}`,\n \"model-value\": providerConfigurations.value[provider.id]?.apiKey,\n \"onUpdate:modelValue\": ($event: any) => (updateApiKey(provider.id, `${$event}`)),\n title: _unref(translate)('AIProviders_ApiKey'),\n \"inline-help\": provider.configuration.hasApiKey\n ? _unref(translate)('AIProviders_ApiKeyAlreadyConfigured')\n : _unref(translate)('AIProviders_ApiKeyHelp'),\n autocomplete: \"off\"\n }, null, 8, [\"name\", \"model-value\", \"onUpdate:modelValue\", \"title\", \"inline-help\"]), [\n [_unref(vAutoClearPassword)]\n ])\n ]))\n }), 128))\n ]))\n : _createCommentVNode(\"\", true),\n _createVNode(_unref(SaveButton), {\n onConfirm: _cache[2] || (_cache[2] = ($event: any) => (saveSettings())),\n saving: isSaving.value\n }, null, 8, [\"saving\"])\n ])), [\n [_unref(vForm)]\n ])\n : _createCommentVNode(\"\", true)\n ]),\n _: 1\n }, 8, [\"content-title\"]))\n}\n}\n\n})","import script from \"./ManageAIProviders.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./ManageAIProviders.vue?vue&type=script&setup=true&lang=ts\"\n\nexport default script"],"sourceRoot":""} \ No newline at end of file diff --git a/vue/dist/umd.metadata.json b/vue/dist/umd.metadata.json new file mode 100644 index 0000000..dce4477 --- /dev/null +++ b/vue/dist/umd.metadata.json @@ -0,0 +1,6 @@ +{ + "dependsOn": [ + "CoreHome", + "CorePluginsAdmin" + ] +} \ No newline at end of file diff --git a/vue/src/ManageAIProviders.vue b/vue/src/ManageAIProviders.vue new file mode 100644 index 0000000..0365d40 --- /dev/null +++ b/vue/src/ManageAIProviders.vue @@ -0,0 +1,241 @@ + + + + + diff --git a/vue/src/index.ts b/vue/src/index.ts new file mode 100644 index 0000000..7d96c84 --- /dev/null +++ b/vue/src/index.ts @@ -0,0 +1,16 @@ +/*! + * Copyright (C) InnoCraft Ltd - All rights reserved. + * + * NOTICE: All information contained herein is, and remains the property of InnoCraft Ltd. + * The intellectual and technical concepts contained herein are protected by trade secret + * or copyright law. Redistribution of this information or reproduction of this material is + * strictly forbidden unless prior written permission is obtained from InnoCraft Ltd. + * + * You shall use this code only in accordance with the license agreement obtained from + * InnoCraft Ltd. + * + * @link https://www.innocraft.com/ + * @license For license details see https://www.innocraft.com/license + */ + +export { default as ManageAIProviders } from './ManageAIProviders.vue'; From a5289c983faed10895cd1db09fc62db7828f0bf1 Mon Sep 17 00:00:00 2001 From: Maximilian Taube Date: Thu, 21 May 2026 19:51:14 +0200 Subject: [PATCH 02/17] update ui, extract vue component, extract types --- AIProviders.php | 27 +- Controller.php | 9 +- Model/Configuration.php | 14 +- Provider/AIProvider.php | 24 +- README.md | 6 + lang/en.json | 30 +- templates/index.twig | 2 + tests/Integration/ConfigurationTest.php | 194 +++++++++++ vue/dist/AIProviders.css | 1 + vue/dist/AIProviders.umd.js | 391 ++++++++++++++++++---- vue/dist/AIProviders.umd.js.map | 2 +- vue/dist/AIProviders.umd.min.js | 2 +- vue/dist/AIProviders.umd.min.js.map | 2 +- vue/src/ManageAIProviders.vue | 410 +++++++++++++++++------- vue/src/components/ProviderCard.vue | 246 ++++++++++++++ vue/src/types.ts | 50 +++ 16 files changed, 1185 insertions(+), 225 deletions(-) create mode 100644 tests/Integration/ConfigurationTest.php create mode 100644 vue/dist/AIProviders.css create mode 100644 vue/src/components/ProviderCard.vue create mode 100644 vue/src/types.ts diff --git a/AIProviders.php b/AIProviders.php index 0ea405d..62f81a3 100644 --- a/AIProviders.php +++ b/AIProviders.php @@ -3,7 +3,7 @@ /** * Copyright (C) InnoCraft Ltd - All rights reserved. * - * NOTICE: All information contained herein is, and remains the property of InnoCraft Ltd. + * NOTICE: All information contained herein is, and remains the property of InnoCraft Ltd. * The intellectual and technical concepts contained herein are protected by trade secret or copyright law. * Redistribution of this information or reproduction of this material is strictly forbidden * unless prior written permission is obtained from InnoCraft Ltd. @@ -34,9 +34,9 @@ public function registerEvents(): array public function addAIProviders(AIProvidersList $providers): void { $providers->addProvider(new Provider\Claude()); - $providers->addProvider(new Provider\CustomProvider()); $providers->addProvider(new Provider\Gemini()); $providers->addProvider(new Provider\OpenAI()); + $providers->addProvider(new Provider\CustomProvider()); } /** @@ -82,22 +82,35 @@ public static function getAvailableProviders(): AIProvidersList public function getClientSideTranslationKeys(array &$translations): void { $translations[] = 'AIProviders_ApiKey'; - $translations[] = 'AIProviders_ApiKeyAlreadyConfigured'; - $translations[] = 'AIProviders_ApiKeyHelp'; + $translations[] = 'AIProviders_ApiKeyAlreadyConfiguredPlaceholder'; + $translations[] = 'AIProviders_ApiKeyPlaceholder'; $translations[] = 'AIProviders_ClaudeDescription'; $translations[] = 'AIProviders_CloudConfigurationHelp'; + $translations[] = 'AIProviders_ConfigurationIntro'; $translations[] = 'AIProviders_CustomProviderDescription'; $translations[] = 'AIProviders_DefaultCapabilityLevel'; + $translations[] = 'AIProviders_DefaultCapabilityLevelHelp'; $translations[] = 'AIProviders_DefaultProvider'; + $translations[] = 'AIProviders_DefaultProviderHelp'; + $translations[] = 'AIProviders_DefaultsTitle'; + $translations[] = 'AIProviders_Disconnect'; + $translations[] = 'AIProviders_DisconnectNotAvailable'; $translations[] = 'AIProviders_EndpointUrl'; - $translations[] = 'AIProviders_EndpointUrlHelp'; + $translations[] = 'AIProviders_EndpointUrlPlaceholder'; $translations[] = 'AIProviders_GeminiDescription'; - $translations[] = 'General_LoadingData'; $translations[] = 'AIProviders_InstantCapability'; + $translations[] = 'AIProviders_InstantCapabilityDescription'; $translations[] = 'AIProviders_MenuTitle'; $translations[] = 'AIProviders_OpenAIDescription'; - $translations[] = 'AIProviders_ProviderConnections'; + $translations[] = 'AIProviders_SelectedConfiguration'; $translations[] = 'AIProviders_SettingsSaveSuccess'; + $translations[] = 'AIProviders_StatusConnected'; + $translations[] = 'AIProviders_StatusNotConnected'; + $translations[] = 'AIProviders_TestConnection'; + $translations[] = 'AIProviders_TestConnectionNotAvailable'; $translations[] = 'AIProviders_ThinkingCapability'; + $translations[] = 'AIProviders_ThinkingCapabilityDescription'; + $translations[] = 'General_Cancel'; + $translations[] = 'General_LoadingData'; } } diff --git a/Controller.php b/Controller.php index b30a187..4902d7a 100644 --- a/Controller.php +++ b/Controller.php @@ -19,11 +19,14 @@ namespace Piwik\Plugins\AIProviders; use Piwik\Piwik; -use Piwik\Plugin\Controller as PluginController; +use Piwik\Plugin\ControllerAdmin; -class Controller extends PluginController +class Controller extends ControllerAdmin { - public function index() + /** + * @throws \Exception + */ + public function index(): string { Piwik::checkUserHasSuperUserAccess(); diff --git a/Model/Configuration.php b/Model/Configuration.php index 4f6a2d0..4c18a80 100644 --- a/Model/Configuration.php +++ b/Model/Configuration.php @@ -3,7 +3,7 @@ /** * Copyright (C) InnoCraft Ltd - All rights reserved. * - * NOTICE: All information contained herein is, and remains the property of InnoCraft Ltd. + * NOTICE: All information contained herein is, and remains the property of InnoCraft Ltd. * The intellectual and technical concepts contained herein are protected by trade secret or copyright law. * Redistribution of this information or reproduction of this material is strictly forbidden * unless prior written permission is obtained from InnoCraft Ltd. @@ -111,13 +111,19 @@ public function getProviderConfiguration(string $providerId): array } /** - * @return array + * @return array */ public function getCapabilityLevels(): array { return [ - self::CAPABILITY_INSTANT => 'AIProviders_InstantCapability', - self::CAPABILITY_THINKING => 'AIProviders_ThinkingCapability', + self::CAPABILITY_INSTANT => [ + 'label' => 'AIProviders_InstantCapability', + 'description' => 'AIProviders_InstantCapabilityDescription', + ], + self::CAPABILITY_THINKING => [ + 'label' => 'AIProviders_ThinkingCapability', + 'description' => 'AIProviders_ThinkingCapabilityDescription', + ], ]; } diff --git a/Provider/AIProvider.php b/Provider/AIProvider.php index 903c8f6..43c14a0 100644 --- a/Provider/AIProvider.php +++ b/Provider/AIProvider.php @@ -20,25 +20,11 @@ abstract class AIProvider { - /** - * @var string - */ - private $id; - - /** - * @var string - */ - private $name; - - /** - * @var string - */ - private $description; - - /** - * @var bool - */ - private $supportsCustomEndpoint; + // TODO: check if this is supported, because typed properties are only available above PHP 7.4 + private string $id; + private string $name; + private string $description; + private bool $supportsCustomEndpoint; public function __construct( string $id, diff --git a/README.md b/README.md index 5144912..6a4ff71 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ Configure AI provider connections and default model settings used by Matomo AI f Built-in providers: Claude, OpenAI, Gemini, and a generic custom provider for OpenAI-compatible endpoints. +## Configuration + +Settings are managed from **Administration > System > AI Providers**. + +The plugin stores the default provider, default capability level, and provider connection settings in Matomo options. API keys are only returned to the administration UI as masked state, not as secret values. + ## Usage from other plugins Do not call this plugin's `API.php` from other plugins. Its public API methods exist only for the administration UI and only expose masked configuration values — adding prompt/completion methods there would expose them over Matomo's HTTP API to anyone with a valid token. diff --git a/lang/en.json b/lang/en.json index 57e4569..82b54e9 100644 --- a/lang/en.json +++ b/lang/en.json @@ -1,22 +1,34 @@ { "AIProviders": { "ApiKey": "API key", - "ApiKeyAlreadyConfigured": "An API key is already configured. Leave this field empty to keep it.", - "ApiKeyHelp": "Stored API keys are masked and are only available to server-side AI provider services.", + "ApiKeyAlreadyConfiguredPlaceholder": "Stored key kept. Enter a new key to replace it.", + "ApiKeyPlaceholder": "Enter your API key", "ClaudeDescription": "Anthropic Claude models.", "CloudConfigurationHelp": "Provider connections are managed by Matomo Cloud. You can only change the default provider.", - "CustomProviderDescription": "Self-hosted or custom AI provider connection.", - "DefaultCapabilityLevel": "Default model capability level", + "ConfigurationIntro": "Configure AI providers and default AI behavior in Matomo.", + "CustomProviderDescription": "Use your own OpenAI compatible endpoint.", + "DefaultCapabilityLevel": "Default capability level", + "DefaultCapabilityLevelHelp": "Choose the default capability Matomo may use. Individual features can override this.", "DefaultProvider": "Default provider", - "EndpointUrl": "Endpoint URL", - "EndpointUrlHelp": "Use this for a self-hosted or custom provider endpoint.", + "DefaultProviderHelp": "Connect providers and pick a default for Matomo to use. Individual features can override it.", + "DefaultsTitle": "Change provider settings and default values", + "Disconnect": "Disconnect", + "DisconnectNotAvailable": "Disconnecting a stored key is not yet available. Save with an empty key to keep the existing one.", + "EndpointUrl": "API base URL", + "EndpointUrlPlaceholder": "Enter your base URL", "GeminiDescription": "Google Gemini models.", "InstantCapability": "Instant", + "InstantCapabilityDescription": "Fast and cost-effective for simple tasks.", "MenuTitle": "AI Providers", - "OpenAIDescription": "OpenAI models.", + "OpenAIDescription": "OpenAI models like GPT-5.5", "PluginDescription": "Configure AI provider connections and default model settings used by Matomo AI features.", - "ProviderConnections": "Provider connections", + "SelectedConfiguration": "%1$s · %2$s", "SettingsSaveSuccess": "AI provider settings saved.", - "ThinkingCapability": "Thinking" + "StatusConnected": "Connected", + "StatusNotConnected": "Not connected", + "TestConnection": "Test connection", + "TestConnectionNotAvailable": "Connection testing is not yet available.", + "ThinkingCapability": "Thinking", + "ThinkingCapabilityDescription": "Better reasoning for complex tasks." } } diff --git a/templates/index.twig b/templates/index.twig index 3f750ae..535ef3c 100644 --- a/templates/index.twig +++ b/templates/index.twig @@ -1,5 +1,7 @@ {% extends 'admin.twig' %} +{% set title %}{{ 'AIProviders_MenuTitle'|translate }}{% endset %} + {% block content %}
{% endblock %} diff --git a/tests/Integration/ConfigurationTest.php b/tests/Integration/ConfigurationTest.php new file mode 100644 index 0000000..e0c34a2 --- /dev/null +++ b/tests/Integration/ConfigurationTest.php @@ -0,0 +1,194 @@ +setSuperUser(); + + $this->api = API::getInstance(); + } + + public function testGetSettingsReturnsDefaultProviderConfiguration(): void + { + $settings = $this->api->getSettings(); + + $this->assertSame('openai', $settings['defaultProviderId']); + $this->assertSame(Configuration::CAPABILITY_INSTANT, $settings['defaultCapabilityLevel']); + $this->assertTrue($settings['canEditProviderConfiguration']); + $this->assertTrue($settings['canEditCapabilityLevel']); + $this->assertCount(4, $settings['providers']); + + $customProvider = $this->getProvider($settings, 'custom-provider'); + $this->assertSame('Custom Provider', $customProvider['name']); + $this->assertTrue($customProvider['supportsCustomEndpoint']); + } + + public function testSaveSettingsStoresApiKeyWithoutReturningIt(): void + { + $settings = $this->api->saveSettings( + 'claude', + Configuration::CAPABILITY_THINKING, + (string) json_encode([ + 'claude' => [ + 'apiKey' => 'secret-claude-key', + 'endpointUrl' => '', + ], + ]) + ); + + $this->assertSame('claude', $settings['defaultProviderId']); + $this->assertSame(Configuration::CAPABILITY_THINKING, $settings['defaultCapabilityLevel']); + + $claude = $this->getProvider($settings, 'claude'); + $this->assertTrue($claude['configuration']['hasApiKey']); + $this->assertArrayNotHasKey('apiKey', $claude['configuration']); + $this->assertStringNotContainsString('secret-claude-key', (string) json_encode($settings)); + } + + public function testSaveSettingsPreservesExistingApiKeyWhenInputIsEmpty(): void + { + $this->api->saveSettings( + 'claude', + Configuration::CAPABILITY_THINKING, + (string) json_encode([ + 'claude' => [ + 'apiKey' => 'secret-claude-key', + 'endpointUrl' => '', + ], + ]) + ); + + $settings = $this->api->saveSettings( + 'openai', + Configuration::CAPABILITY_INSTANT, + (string) json_encode([ + 'claude' => [ + 'apiKey' => '', + 'endpointUrl' => '', + ], + ]) + ); + + $claude = $this->getProvider($settings, 'claude'); + $this->assertTrue($claude['configuration']['hasApiKey']); + } + + public function testServiceReturnsServerSideDefaultProviderConfiguration(): void + { + $this->api->saveSettings( + 'claude', + Configuration::CAPABILITY_THINKING, + (string) json_encode([ + 'claude' => [ + 'apiKey' => 'secret-claude-key', + 'endpointUrl' => '', + ], + ]) + ); + + $service = StaticContainer::get(AIProviderService::class); + + $this->assertSame('claude', $service->getDefaultProvider()->getId()); + $this->assertSame(Configuration::CAPABILITY_THINKING, $service->getDefaultCapabilityLevel()); + $this->assertSame('secret-claude-key', $service->getDefaultProviderConfiguration()['apiKey']); + } + + public function testSaveSettingsRejectsUnknownProvider(): void + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Unknown AI provider'); + + $this->api->saveSettings( + 'unknown-provider', + Configuration::CAPABILITY_INSTANT, + '{}' + ); + } + + public function testGetSettingsRequiresSuperUserAccess(): void + { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('checkUserHasSuperUserAccess'); + + $this->setAnonymousUser(); + $this->api->getSettings(); + } + + /** + * @param array $settings + * @return array + */ + private function getProvider(array $settings, string $providerId): array + { + foreach ($settings['providers'] as $provider) { + if ($provider['id'] === $providerId) { + return $provider; + } + } + + $this->fail(sprintf('Provider "%s" was not found.', $providerId)); + } + + private function setSuperUser(): void + { + FakeAccess::clearAccess(true); + } + + private function setAnonymousUser(): void + { + FakeAccess::clearAccess(); + FakeAccess::$identity = 'anonymous'; + } + + public function provideContainerConfig(): array + { + return [ + 'Piwik\Access' => new FakeAccess(), + ]; + } +} diff --git a/vue/dist/AIProviders.css b/vue/dist/AIProviders.css new file mode 100644 index 0000000..a7b537a --- /dev/null +++ b/vue/dist/AIProviders.css @@ -0,0 +1 @@ +.ai-providers-card{display:flex;flex-direction:column;padding:16px;background:var(--theme-color-background-contrast,#fff);border:1px solid var(--ai-providers-border);border-radius:6px;cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.ai-providers-card:hover{border-color:var(--ai-providers-border-strong)}.ai-providers-card.is-selected{border-color:var(--ai-providers-accent);box-shadow:0 0 0 1px var(--ai-providers-accent) inset}.ai-providers-card .form-group{margin-bottom:12px;border:0}.ai-providers-card .input-field{margin-top:0;margin-bottom:0}.ai-providers-card .matomo-form-field{border:0;margin-left:0;margin-right:0;margin-top:30px}.ai-providers-card .matomo-form-field>.col{padding-left:0!important;padding-right:0!important}.ai-providers-card .input-field.col>label,.ai-providers-card .input-field>label{left:0!important}.ai-providers-card .input-field>input{padding-left:0;margin-left:0;width:100%;box-sizing:border-box}.ai-providers-card-header{margin-bottom:8px}.ai-providers-card-name{color:var(--ai-providers-heading);font-weight:600;font-size:15px}.ai-providers-card-description{margin:0 0 16px}.ai-providers-card-description,.ai-providers-card-status{color:var(--ai-providers-text-muted);font-size:13px;line-height:1.5}.ai-providers-card-status{display:flex;align-items:center;gap:8px;margin:4px 0 0}.ai-providers-card-status.is-connected,.ai-providers-card-status.is-connected .ai-providers-status-icon{color:var(--ai-providers-accent)}.ai-providers-status-icon{font-size:14px;line-height:1;color:var(--ai-providers-border-strong);flex:none}.ai-providers-card-actions{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:12px;margin-top:auto;padding-top:16px}.ai-providers-card-actions .btn,.ai-providers-card-actions .btn-flat{white-space:nowrap}.ai-providers-card-actions .btn-flat[disabled]{pointer-events:none;cursor:not-allowed;color:var(--theme-color-text-on-disabled)}.ai-providers-page{--ai-providers-border:var(--theme-color-border-light,#e0e0e0);--ai-providers-border-strong:var(--theme-color-border,#ccc);--ai-providers-accent:var(--theme-color-brand,#43a047);--ai-providers-text-muted:var(--theme-color-text-light,#666);--ai-providers-heading:var(--theme-color-headline-alternative,#333)}.ai-providers-page h2,.ai-providers-page h3,.ai-providers-page h4{color:var(--ai-providers-heading);margin:0;padding:0}.ai-providers-page-header{margin-bottom:24px}.ai-providers-page-title{font-size:22px;line-height:1.3}.ai-providers-page-subtitle{color:var(--ai-providers-text-muted);font-size:14px;line-height:1.5;margin:4px 0 0}.ai-providers-selected-configuration{display:inline-block;margin-top:8px;height:24px;padding:0 10px;border-radius:12px;background-color:#e4e4e4;color:rgba(0,0,0,.6);line-height:24px;font-size:12px;font-weight:500}.ai-providers-defaults-title{font-size:18px;line-height:1.4;margin-bottom:24px!important}.ai-providers-subsection-title{font-size:15px;font-weight:600;line-height:1.4}.ai-providers-section+.ai-providers-section{margin-top:24px;padding-top:24px;border-top:1px solid var(--ai-providers-border)}.ai-providers-section-help{color:var(--ai-providers-text-muted);margin:4px 0 16px}.ai-providers-capability-cards,.ai-providers-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}.ai-providers-capability-card{display:flex;flex-direction:column;padding:16px;background:var(--theme-color-background-contrast,#fff);border:1px solid var(--ai-providers-border);border-radius:6px;cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.ai-providers-capability-card:hover{border-color:var(--ai-providers-border-strong)}.ai-providers-capability-card.is-selected{border-color:var(--ai-providers-accent);box-shadow:0 0 0 1px var(--ai-providers-accent) inset;background:var(--theme-color-background-tinyContrast,#f7f7f7)}.ai-providers-capability-header{margin-bottom:8px}.ai-providers-capability-label{color:var(--ai-providers-heading);font-weight:600;font-size:15px}.ai-providers-capability-description,.ai-providers-capability-footnote{color:var(--ai-providers-text-muted);font-size:13px;line-height:1.5}.ai-providers-footer{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:12px;margin-top:24px} \ No newline at end of file diff --git a/vue/dist/AIProviders.umd.js b/vue/dist/AIProviders.umd.js index 3300057..535e290 100644 --- a/vue/dist/AIProviders.umd.js +++ b/vue/dist/AIProviders.umd.js @@ -96,6 +96,17 @@ return /******/ (function(modules) { // webpackBootstrap /************************************************************************/ /******/ ({ +/***/ "1047": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ManageAIProviders_vue_vue_type_style_index_0_id_6e2e3ad5_lang_less__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("86b3"); +/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ManageAIProviders_vue_vue_type_style_index_0_id_6e2e3ad5_lang_less__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ManageAIProviders_vue_vue_type_style_index_0_id_6e2e3ad5_lang_less__WEBPACK_IMPORTED_MODULE_0__); +/* unused harmony reexport * */ + + +/***/ }), + /***/ "19dc": /***/ (function(module, exports) { @@ -103,6 +114,20 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__; /***/ }), +/***/ "1f8b": +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), + +/***/ "86b3": +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), + /***/ "8bbf": /***/ (function(module, exports) { @@ -152,22 +177,186 @@ var external_CoreHome_ = __webpack_require__("19dc"); // EXTERNAL MODULE: external "CorePluginsAdmin" var external_CorePluginsAdmin_ = __webpack_require__("a5a2"); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/AIProviders/vue/src/ManageAIProviders.vue?vue&type=script&setup=true&lang=ts +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/AIProviders/vue/src/components/ProviderCard.vue?vue&type=script&lang=ts&setup=true const _hoisted_1 = { - key: 1 -}; -const _hoisted_2 = { - key: 1 + class: "ai-providers-card-header" }; +const _hoisted_2 = ["checked", "value"]; const _hoisted_3 = { - class: "form-description" + class: "ai-providers-card-name" }; +const _hoisted_4 = { + class: "ai-providers-card-description" +}; +const _hoisted_5 = { + class: "ai-providers-card-actions" +}; +const _hoisted_6 = ["disabled"]; +const _hoisted_7 = ["disabled"]; -/* harmony default export */ var ManageAIProvidersvue_type_script_setup_true_lang_ts = (/*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ +/* harmony default export */ var ProviderCardvue_type_script_lang_ts_setup_true = (/*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + __name: 'ProviderCard', + props: { + provider: null, + configuration: null, + selected: { + type: Boolean + }, + canEdit: { + type: Boolean + } + }, + emits: ["select", "update:apiKey", "update:endpointUrl", "test", "disconnect"], + setup(__props, { + emit + }) { + const props = __props; + /* eslint-disable func-call-spacing, no-spaced-func */ + /* eslint-enable func-call-spacing, no-spaced-func */ + const hasPendingKey = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => { + var _props$configuration$, _props$configuration; + return ((_props$configuration$ = (_props$configuration = props.configuration) === null || _props$configuration === void 0 ? void 0 : _props$configuration.apiKey) !== null && _props$configuration$ !== void 0 ? _props$configuration$ : '') !== ''; + }); + return (_ctx, _cache) => { + var _props$configuration2, _props$configuration3; + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("label", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])([{ + 'is-selected': __props.selected + }, "ai-providers-card"]) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + checked: __props.selected, + value: __props.provider.id, + name: "defaultProviderId", + type: "radio", + onChange: _cache[0] || (_cache[0] = $event => emit('select')) + }, null, 40, _hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(__props.provider.name), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])(__props.provider.description)), 1), __props.canEdit ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], { + key: 0 + }, [__props.provider.supportsCustomEndpoint ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Field"]), { + key: 0, + "model-value": (_props$configuration2 = __props.configuration) === null || _props$configuration2 === void 0 ? void 0 : _props$configuration2.endpointUrl, + name: `endpointUrl-${__props.provider.id}`, + title: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_EndpointUrl'), + placeholder: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_EndpointUrlPlaceholder'), + autocomplete: "off", + "full-width": "", + uicontrol: "text", + "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => emit('update:endpointUrl', `${$event}`)) + }, null, 8, ["model-value", "name", "title", "placeholder"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Field"]), { + "model-value": (_props$configuration3 = __props.configuration) === null || _props$configuration3 === void 0 ? void 0 : _props$configuration3.apiKey, + name: `apiKey-${__props.provider.id}`, + placeholder: __props.provider.configuration.hasApiKey ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_ApiKeyAlreadyConfiguredPlaceholder') : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_ApiKeyPlaceholder'), + title: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_ApiKey'), + autocomplete: "new-password", + "full-width": "", + uicontrol: "password", + "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => emit('update:apiKey', `${$event}`)) + }, null, 8, ["model-value", "name", "placeholder", "title"]), [[Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["AutoClearPassword"])]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])([{ + 'is-connected': __props.provider.configuration.hasApiKey + }, "ai-providers-card-status"]) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + "aria-hidden": "true", + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["icon ai-providers-status-icon", __props.provider.configuration.hasApiKey ? 'icon-ok' : 'icon-minus']) + }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(__props.provider.configuration.hasApiKey ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_StatusConnected') : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_StatusNotConnected')), 1)], 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { + class: "btn btn-outline btn-small", + type: "button", + disabled: !Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(hasPendingKey) && !__props.provider.configuration.hasApiKey, + onClick: _cache[3] || (_cache[3] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])($event => emit('test'), ["prevent"])) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_TestConnection')), 9, _hoisted_6), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { + class: "btn-flat", + type: "button", + disabled: !__props.provider.configuration.hasApiKey, + onClick: _cache[4] || (_cache[4] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])($event => emit('disconnect'), ["prevent"])) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_Disconnect')), 9, _hoisted_7)])], 64)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2); + }; + } +})); +// CONCATENATED MODULE: ./plugins/AIProviders/vue/src/components/ProviderCard.vue?vue&type=script&lang=ts&setup=true + +// EXTERNAL MODULE: ./plugins/AIProviders/vue/src/components/ProviderCard.vue?vue&type=style&index=0&id=3702360d&lang=less +var ProviderCardvue_type_style_index_0_id_3702360d_lang_less = __webpack_require__("fd04"); + +// CONCATENATED MODULE: ./plugins/AIProviders/vue/src/components/ProviderCard.vue + + + + + +/* harmony default export */ var ProviderCard = (ProviderCardvue_type_script_lang_ts_setup_true); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/AIProviders/vue/src/ManageAIProviders.vue?vue&type=script&lang=ts&setup=true + + +const ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_1 = { + class: "ai-providers-page" +}; +const ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_2 = { + class: "ai-providers-page-header" +}; +const ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_3 = { + class: "ai-providers-page-title" +}; +const ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_4 = { + class: "ai-providers-page-subtitle" +}; +const ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_5 = { + key: 0, + class: "ai-providers-selected-configuration" +}; +const ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_6 = { + class: "ai-providers" +}; +const ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_7 = { + class: "ai-providers-defaults-title" +}; +const _hoisted_8 = { + class: "ai-providers-section" +}; +const _hoisted_9 = { + class: "ai-providers-subsection-title" +}; +const _hoisted_10 = { + class: "ai-providers-section-help" +}; +const _hoisted_11 = ["aria-label"]; +const _hoisted_12 = { + key: 1, + class: "ai-providers-section" +}; +const _hoisted_13 = { + class: "ai-providers-subsection-title" +}; +const _hoisted_14 = { + class: "ai-providers-section-help" +}; +const _hoisted_15 = ["aria-label"]; +const _hoisted_16 = { + class: "ai-providers-capability-header" +}; +const _hoisted_17 = ["value"]; +const _hoisted_18 = { + class: "ai-providers-capability-label" +}; +const _hoisted_19 = { + key: 0, + class: "ai-providers-capability-description" +}; +const _hoisted_20 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", { + class: "ai-providers-capability-footnote" +}, null, -1); +const _hoisted_21 = { + key: 2, + class: "ai-providers-footer" +}; +const _hoisted_22 = ["disabled"]; + + + + +/* harmony default export */ var ManageAIProvidersvue_type_script_lang_ts_setup_true = (/*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ __name: 'ManageAIProviders', setup(__props) { const settings = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(null); @@ -176,23 +365,39 @@ const _hoisted_3 = { const defaultProviderId = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(''); const defaultCapabilityLevel = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(''); const providerConfigurations = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])({}); - const providerOptions = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => { + const providers = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => { var _settings$value; - const options = {}; - const providers = ((_settings$value = settings.value) === null || _settings$value === void 0 ? void 0 : _settings$value.providers) || []; - providers.forEach(provider => { - options[provider.id] = provider.name; - }); - return options; + return ((_settings$value = settings.value) === null || _settings$value === void 0 ? void 0 : _settings$value.providers) || []; }); - const capabilityLevelOptions = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => { + const canEditCapabilityLevel = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => { var _settings$value2; - const options = {}; - Object.entries(((_settings$value2 = settings.value) === null || _settings$value2 === void 0 ? void 0 : _settings$value2.capabilityLevels) || {}).forEach(([id, translationKey]) => { - options[id] = Object(external_CoreHome_["translate"])(translationKey); - }); - return options; + return !!((_settings$value2 = settings.value) !== null && _settings$value2 !== void 0 && _settings$value2.canEditCapabilityLevel); + }); + const canEditProviderConfiguration = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => { + var _settings$value3; + return !!((_settings$value3 = settings.value) !== null && _settings$value3 !== void 0 && _settings$value3.canEditProviderConfiguration); + }); + const selectedProvider = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => providers.value.find(provider => provider.id === defaultProviderId.value)); + const capabilityLevelOptions = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => { + var _settings$value4; + const capabilityLevels = ((_settings$value4 = settings.value) === null || _settings$value4 === void 0 ? void 0 : _settings$value4.capabilityLevels) || {}; + return Object.entries(capabilityLevels).map(([id, keys]) => ({ + id, + label: Object(external_CoreHome_["translate"])(keys.label), + description: keys.description ? Object(external_CoreHome_["translate"])(keys.description) : '' + })); + }); + const selectedCapabilityLevel = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => capabilityLevelOptions.value.find(capability => capability.id === defaultCapabilityLevel.value)); + const selectedConfigurationLabel = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => { + if (!selectedProvider.value || !selectedCapabilityLevel.value) { + return ''; + } + return Object(external_CoreHome_["translate"])('AIProviders_SelectedConfiguration', selectedProvider.value.name, selectedCapabilityLevel.value.label); }); + /** + * Applies the given settings to the component state. + * @param nextSettings + */ function applySettings(nextSettings) { settings.value = nextSettings; defaultProviderId.value = nextSettings.defaultProviderId; @@ -227,6 +432,36 @@ const _hoisted_3 = { endpointUrl }); } + function disconnectProvider(providerId) { + // PoC: clears the locally entered key. Removing a persisted key requires a + // backend method that isn't wired up yet. + providerConfigurations.value[providerId] = Object.assign(Object.assign({}, providerConfigurations.value[providerId]), {}, { + apiKey: '' + }); + external_CoreHome_["NotificationsStore"].show({ + message: Object(external_CoreHome_["translate"])('AIProviders_DisconnectNotAvailable'), + type: 'transient', + id: `aiProvidersDisconnect-${providerId}`, + context: 'info' + }); + } + function testConnection(providerId) { + // PoC: placeholder until a server-side connection test endpoint exists. + external_CoreHome_["NotificationsStore"].show({ + message: Object(external_CoreHome_["translate"])('AIProviders_TestConnectionNotAvailable'), + type: 'transient', + id: `aiProvidersTest-${providerId}`, + context: 'info' + }); + } + function cancelChanges() { + if (settings.value) { + applySettings(settings.value); + } + } + /** + * Saves the current settings to the server. + */ async function saveSettings() { isSaving.value = true; try { @@ -253,72 +488,77 @@ const _hoisted_3 = { } Object(external_commonjs_vue_commonjs2_vue_root_Vue_["onMounted"])(loadSettings); return (_ctx, _cache) => { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["ContentBlock"]), { - "content-title": Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_MenuTitle') + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("header", ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_MenuTitle')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_ConfigurationIntro')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(selectedConfigurationLabel) ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(selectedConfigurationLabel)), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), isLoading.value ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["ActivityIndicator"]), { + key: 0, + loading: isLoading.value + }, null, 8, ["loading"])) : settings.value ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["ContentBlock"]), { + key: 1 }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [isLoading.value ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["ActivityIndicator"]), { - key: 0, - loading: isLoading.value - }, null, 8, ["loading"])) : settings.value ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Field"]), { - uicontrol: "select", - name: "defaultProviderId", - modelValue: defaultProviderId.value, - "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => defaultProviderId.value = $event), - title: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultProvider'), - options: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(providerOptions) - }, null, 8, ["modelValue", "title", "options"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Field"]), { - uicontrol: "select", - name: "defaultCapabilityLevel", - modelValue: defaultCapabilityLevel.value, - "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => defaultCapabilityLevel.value = $event), - title: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultCapabilityLevel'), - options: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(capabilityLevelOptions), - disabled: !settings.value.canEditCapabilityLevel - }, null, 8, ["modelValue", "title", "options", "disabled"]), !settings.value.canEditProviderConfiguration ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["Alert"]), { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_6, [!Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(canEditProviderConfiguration) ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["Alert"]), { key: 0, severity: "info" }, { default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_CloudConfigurationHelp')), 1)]), _: 1 - })) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), settings.value.canEditProviderConfiguration ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_ProviderConnections')), 1), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(settings.value.providers, provider => { - var _providerConfiguratio, _providerConfiguratio2; - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + })) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultsTitle')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("section", _hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", _hoisted_9, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultProvider')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultProviderHelp')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + "aria-label": Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultProvider'), + class: "ai-providers-cards", + role: "radiogroup" + }, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(providers), provider => { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(ProviderCard, { key: provider.id, - class: "ai-provider" - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(provider.name), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])(provider.description)), 1), provider.supportsCustomEndpoint ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Field"]), { - key: 0, - uicontrol: "text", - name: `endpointUrl-${provider.id}`, - "model-value": (_providerConfiguratio = providerConfigurations.value[provider.id]) === null || _providerConfiguratio === void 0 ? void 0 : _providerConfiguratio.endpointUrl, - "onUpdate:modelValue": $event => updateEndpointUrl(provider.id, `${$event}`), - title: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_EndpointUrl'), - "inline-help": Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_EndpointUrlHelp'), - autocomplete: "off" - }, null, 8, ["name", "model-value", "onUpdate:modelValue", "title", "inline-help"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Field"]), { - uicontrol: "password", - name: `apiKey-${provider.id}`, - "model-value": (_providerConfiguratio2 = providerConfigurations.value[provider.id]) === null || _providerConfiguratio2 === void 0 ? void 0 : _providerConfiguratio2.apiKey, - "onUpdate:modelValue": $event => updateApiKey(provider.id, `${$event}`), - title: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_ApiKey'), - "inline-help": provider.configuration.hasApiKey ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_ApiKeyAlreadyConfigured') : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_ApiKeyHelp'), - autocomplete: "off" - }, null, 8, ["name", "model-value", "onUpdate:modelValue", "title", "inline-help"]), [[Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["AutoClearPassword"])]])]); - }), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["SaveButton"]), { - onConfirm: _cache[2] || (_cache[2] = $event => saveSettings()), - saving: isSaving.value - }, null, 8, ["saving"])])), [[Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Form"])]]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), + "can-edit": Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(canEditProviderConfiguration), + configuration: providerConfigurations.value[provider.id], + provider: provider, + selected: defaultProviderId.value === provider.id, + onDisconnect: $event => disconnectProvider(provider.id), + onSelect: $event => defaultProviderId.value = provider.id, + onTest: $event => testConnection(provider.id), + "onUpdate:apiKey": $event => updateApiKey(provider.id, $event), + "onUpdate:endpointUrl": $event => updateEndpointUrl(provider.id, $event) + }, null, 8, ["can-edit", "configuration", "provider", "selected", "onDisconnect", "onSelect", "onTest", "onUpdate:apiKey", "onUpdate:endpointUrl"]); + }), 128))], 8, _hoisted_11)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(canEditCapabilityLevel) ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("section", _hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", _hoisted_13, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultCapabilityLevel')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultCapabilityLevelHelp')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + "aria-label": Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultCapabilityLevel'), + class: "ai-providers-capability-cards", + role: "radiogroup" + }, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(capabilityLevelOptions), capability => { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("label", { + key: capability.id, + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])([{ + 'is-selected': defaultCapabilityLevel.value === capability.id + }, "ai-providers-capability-card"]) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_16, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => defaultCapabilityLevel.value = $event), + value: capability.id, + name: "defaultCapabilityLevel", + type: "radio" + }, null, 8, _hoisted_17), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelRadio"], defaultCapabilityLevel.value]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_18, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(capability.label), 1)]), capability.description ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_19, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(capability.description), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2); + }), 128))], 8, _hoisted_15), _hoisted_20])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])), [[Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Form"])]])]), _: 1 - }, 8, ["content-title"]); + })) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), settings.value ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_21, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { + disabled: isSaving.value, + class: "btn btn-outline", + type: "button", + onClick: _cache[1] || (_cache[1] = $event => cancelChanges()) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('General_Cancel')), 9, _hoisted_22), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["SaveButton"]), { + saving: isSaving.value, + onConfirm: _cache[2] || (_cache[2] = $event => saveSettings()) + }, null, 8, ["saving"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]); }; } })); -// CONCATENATED MODULE: ./plugins/AIProviders/vue/src/ManageAIProviders.vue?vue&type=script&setup=true&lang=ts +// CONCATENATED MODULE: ./plugins/AIProviders/vue/src/ManageAIProviders.vue?vue&type=script&lang=ts&setup=true +// EXTERNAL MODULE: ./plugins/AIProviders/vue/src/ManageAIProviders.vue?vue&type=style&index=0&id=6e2e3ad5&lang=less +var ManageAIProvidersvue_type_style_index_0_id_6e2e3ad5_lang_less = __webpack_require__("1047"); + // CONCATENATED MODULE: ./plugins/AIProviders/vue/src/ManageAIProviders.vue -/* harmony default export */ var ManageAIProviders = (ManageAIProvidersvue_type_script_setup_true_lang_ts); + + +/* harmony default export */ var ManageAIProviders = (ManageAIProvidersvue_type_script_lang_ts_setup_true); // CONCATENATED MODULE: ./plugins/AIProviders/vue/src/index.ts /*! * Copyright (C) InnoCraft Ltd - All rights reserved. @@ -340,6 +580,17 @@ const _hoisted_3 = { +/***/ }), + +/***/ "fd04": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ProviderCard_vue_vue_type_style_index_0_id_3702360d_lang_less__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1f8b"); +/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ProviderCard_vue_vue_type_style_index_0_id_3702360d_lang_less__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ProviderCard_vue_vue_type_style_index_0_id_3702360d_lang_less__WEBPACK_IMPORTED_MODULE_0__); +/* unused harmony reexport * */ + + /***/ }) /******/ }); diff --git a/vue/dist/AIProviders.umd.js.map b/vue/dist/AIProviders.umd.js.map index aee2ec1..565b3a9 100644 --- a/vue/dist/AIProviders.umd.js.map +++ b/vue/dist/AIProviders.umd.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://AIProviders/webpack/universalModuleDefinition","webpack://AIProviders/webpack/bootstrap","webpack://AIProviders/external \"CoreHome\"","webpack://AIProviders/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://AIProviders/external \"CorePluginsAdmin\"","webpack://AIProviders/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?c296","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?cf17","webpack://AIProviders/./plugins/AIProviders/vue/src/index.ts","webpack://AIProviders/./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAk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ACjC,YAAY,EAAE;WACf,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,qBAAqB,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,EAAE,CACnF,CAAC,8DAAM,CAAC,uCAAkB,CAAC,CAAC,CAC7B,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,EAAE,GAAG,CAAC,EACT,CAAC,IACF,2EAAmB,CAAC,EAAE,EAAE,IAAI,CAAC,EACjC,oEAAY,CAAC,8DAAM,CAAC,wCAAU,CAAC,EAAE;UAC/B,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,GAAI,MAAW,IAAM,YAAY,EAAG,CAAC;UACvE,MAAM,EAAE,QAAQ,CAAC;SAClB,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CACxB,CAAC,GAAG,CACH,CAAC,8DAAM,CAAC,kCAAK,CAAC,CAAC,CAChB,CAAC,GACF,2EAAmB,CAAC,EAAE,EAAE,IAAI,CAAC,CACpC,CAAC;QACF,CAAC,EAAE;OACJ,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC;IAC1B,CAAC;EACD;CAEC,CAAC,E;;AC3PogB,C;;ACAvb;AACL;;AAE3D,yG;;ACHf;;;;;;;;;;;;;AAaG;;;ACbqB;AACF","file":"AIProviders.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"CoreHome\", , \"CorePluginsAdmin\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AIProviders\"] = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse\n\t\troot[\"AIProviders\"] = factory(root[\"CoreHome\"], root[\"Vue\"], root[\"CorePluginsAdmin\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"plugins/AIProviders/vue/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fae3\");\n","module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;","module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__;","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, withDirectives as _withDirectives } from \"vue\"\n\nconst _hoisted_1 = { key: 1 }\nconst _hoisted_2 = { key: 1 }\nconst _hoisted_3 = { class: \"form-description\" }\n\nimport {\n computed,\n onMounted,\n ref,\n} from 'vue';\nimport {\n ActivityIndicator,\n AjaxHelper,\n Alert,\n AutoClearPassword as vAutoClearPassword,\n ContentBlock,\n NotificationsStore,\n translate,\n} from 'CoreHome';\nimport {\n Field,\n Form as vForm,\n SaveButton,\n} from 'CorePluginsAdmin';\n\ninterface ProviderConfiguration {\n apiKey: string;\n endpointUrl: string;\n}\n\ninterface Provider {\n id: string;\n name: string;\n description: string;\n supportsCustomEndpoint: boolean;\n configuration: {\n hasApiKey: boolean;\n endpointUrl: string;\n };\n}\n\ninterface Settings {\n defaultProviderId: string;\n defaultCapabilityLevel: string;\n canEditProviderConfiguration: boolean;\n canEditCapabilityLevel: boolean;\n capabilityLevels: Record;\n providers: Provider[];\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ManageAIProviders',\n setup(__props) {\n\nconst settings = ref(null);\nconst isLoading = ref(false);\nconst isSaving = ref(false);\nconst defaultProviderId = ref('');\nconst defaultCapabilityLevel = ref('');\nconst providerConfigurations = ref>({});\n\nconst providerOptions = computed(() => {\n const options: Record = {};\n const providers = settings.value?.providers || [];\n\n providers.forEach((provider) => {\n options[provider.id] = provider.name;\n });\n\n return options;\n});\n\nconst capabilityLevelOptions = computed(() => {\n const options: Record = {};\n Object.entries(settings.value?.capabilityLevels || {}).forEach(([id, translationKey]) => {\n options[id] = translate(translationKey);\n });\n return options;\n});\n\nfunction applySettings(nextSettings: Settings) {\n settings.value = nextSettings;\n defaultProviderId.value = nextSettings.defaultProviderId;\n defaultCapabilityLevel.value = nextSettings.defaultCapabilityLevel;\n\n const nextProviderConfigurations: Record = {};\n nextSettings.providers.forEach((provider) => {\n nextProviderConfigurations[provider.id] = {\n apiKey: '',\n endpointUrl: provider.configuration.endpointUrl || '',\n };\n });\n providerConfigurations.value = nextProviderConfigurations;\n}\n\nasync function loadSettings() {\n isLoading.value = true;\n\n try {\n const response = await AjaxHelper.fetch({\n method: 'AIProviders.getSettings',\n });\n applySettings(response);\n } finally {\n isLoading.value = false;\n }\n}\n\nfunction updateApiKey(providerId: string, apiKey: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n apiKey,\n };\n}\n\nfunction updateEndpointUrl(providerId: string, endpointUrl: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n endpointUrl,\n };\n}\n\nasync function saveSettings() {\n isSaving.value = true;\n\n try {\n const response = await AjaxHelper.post(\n {\n method: 'AIProviders.saveSettings',\n },\n {\n defaultProviderId: defaultProviderId.value,\n defaultCapabilityLevel: defaultCapabilityLevel.value,\n providerConfigurations: JSON.stringify(providerConfigurations.value),\n },\n {\n withTokenInUrl: true,\n },\n );\n applySettings(response);\n\n const notificationInstanceId = NotificationsStore.show({\n message: translate('AIProviders_SettingsSaveSuccess'),\n type: 'transient',\n id: 'aiProvidersSettings',\n context: 'success',\n });\n NotificationsStore.scrollToNotification(notificationInstanceId);\n } finally {\n isSaving.value = false;\n }\n}\n\nonMounted(loadSettings);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(_unref(ContentBlock), {\n \"content-title\": _unref(translate)('AIProviders_MenuTitle')\n }, {\n default: _withCtx(() => [\n (isLoading.value)\n ? (_openBlock(), _createBlock(_unref(ActivityIndicator), {\n key: 0,\n loading: isLoading.value\n }, null, 8, [\"loading\"]))\n : (settings.value)\n ? _withDirectives((_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_unref(Field), {\n uicontrol: \"select\",\n name: \"defaultProviderId\",\n modelValue: defaultProviderId.value,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((defaultProviderId).value = $event)),\n title: _unref(translate)('AIProviders_DefaultProvider'),\n options: _unref(providerOptions)\n }, null, 8, [\"modelValue\", \"title\", \"options\"]),\n _createVNode(_unref(Field), {\n uicontrol: \"select\",\n name: \"defaultCapabilityLevel\",\n modelValue: defaultCapabilityLevel.value,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => ((defaultCapabilityLevel).value = $event)),\n title: _unref(translate)('AIProviders_DefaultCapabilityLevel'),\n options: _unref(capabilityLevelOptions),\n disabled: !settings.value.canEditCapabilityLevel\n }, null, 8, [\"modelValue\", \"title\", \"options\", \"disabled\"]),\n (!settings.value.canEditProviderConfiguration)\n ? (_openBlock(), _createBlock(_unref(Alert), {\n key: 0,\n severity: \"info\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(translate)('AIProviders_CloudConfigurationHelp')), 1)\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (settings.value.canEditProviderConfiguration)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, [\n _createElementVNode(\"h3\", null, _toDisplayString(_unref(translate)('AIProviders_ProviderConnections')), 1),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(settings.value.providers, (provider) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n key: provider.id,\n class: \"ai-provider\"\n }, [\n _createElementVNode(\"h4\", null, _toDisplayString(provider.name), 1),\n _createElementVNode(\"p\", _hoisted_3, _toDisplayString(_unref(translate)(provider.description)), 1),\n (provider.supportsCustomEndpoint)\n ? (_openBlock(), _createBlock(_unref(Field), {\n key: 0,\n uicontrol: \"text\",\n name: `endpointUrl-${provider.id}`,\n \"model-value\": providerConfigurations.value[provider.id]?.endpointUrl,\n \"onUpdate:modelValue\": ($event: any) => (updateEndpointUrl(provider.id, `${$event}`)),\n title: _unref(translate)('AIProviders_EndpointUrl'),\n \"inline-help\": _unref(translate)('AIProviders_EndpointUrlHelp'),\n autocomplete: \"off\"\n }, null, 8, [\"name\", \"model-value\", \"onUpdate:modelValue\", \"title\", \"inline-help\"]))\n : _createCommentVNode(\"\", true),\n _withDirectives(_createVNode(_unref(Field), {\n uicontrol: \"password\",\n name: `apiKey-${provider.id}`,\n \"model-value\": providerConfigurations.value[provider.id]?.apiKey,\n \"onUpdate:modelValue\": ($event: any) => (updateApiKey(provider.id, `${$event}`)),\n title: _unref(translate)('AIProviders_ApiKey'),\n \"inline-help\": provider.configuration.hasApiKey\n ? _unref(translate)('AIProviders_ApiKeyAlreadyConfigured')\n : _unref(translate)('AIProviders_ApiKeyHelp'),\n autocomplete: \"off\"\n }, null, 8, [\"name\", \"model-value\", \"onUpdate:modelValue\", \"title\", \"inline-help\"]), [\n [_unref(vAutoClearPassword)]\n ])\n ]))\n }), 128))\n ]))\n : _createCommentVNode(\"\", true),\n _createVNode(_unref(SaveButton), {\n onConfirm: _cache[2] || (_cache[2] = ($event: any) => (saveSettings())),\n saving: isSaving.value\n }, null, 8, [\"saving\"])\n ])), [\n [_unref(vForm)]\n ])\n : _createCommentVNode(\"\", true)\n ]),\n _: 1\n }, 8, [\"content-title\"]))\n}\n}\n\n})","export { default } from \"-!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=script&setup=true&lang=ts\"; export * from \"-!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=script&setup=true&lang=ts\"","import script from \"./ManageAIProviders.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./ManageAIProviders.vue?vue&type=script&setup=true&lang=ts\"\n\nexport default script","/*!\n * Copyright (C) InnoCraft Ltd - All rights reserved.\n *\n * NOTICE: All information contained herein is, and remains the property of InnoCraft Ltd.\n * The intellectual and technical concepts contained herein are protected by trade secret\n * or copyright law. Redistribution of this information or reproduction of this material is\n * strictly forbidden unless prior written permission is obtained from InnoCraft Ltd.\n *\n * You shall use this code only in accordance with the license agreement obtained from\n * InnoCraft Ltd.\n *\n * @link https://www.innocraft.com/\n * @license For license details see https://www.innocraft.com/license\n */\n\nexport { default as ManageAIProviders } from './ManageAIProviders.vue';\n","import './setPublicPath'\nexport * from '~entry'\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://AIProviders/webpack/universalModuleDefinition","webpack://AIProviders/webpack/bootstrap","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?2aa5","webpack://AIProviders/external \"CoreHome\"","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?b6ff","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?e54c","webpack://AIProviders/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://AIProviders/external \"CorePluginsAdmin\"","webpack://AIProviders/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?642d","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?59bd","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?5a1c","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?cf17","webpack://AIProviders/./plugins/AIProviders/vue/src/index.ts","webpack://AIProviders/./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?82df"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;AClFA;AAAA;AAAA;;;;;;;;ACAA,mD;;;;;;;ACAA,uC;;;;;;;ACAA,uC;;;;;;;ACAA,mD;;;;;;;ACAA,kD;;;;;;;;;;;;;;;ACAA;;AAEA;AACA;AACA,MAAM,KAAuC,EAAE,yBAQ5C;;AAEH;AACA;AACA,IAAI,qBAAuB;AAC3B;AACA;;AAEA;AACe,sDAAI;;;;;;;;;;;;ACrBsC;AACwY;AAEjc,MAAM,UAAU,GAAG;EAAE,KAAK,EAAE;AAA0B,CAAE;AACxD,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC;AACvC,MAAM,UAAU,GAAG;EAAE,KAAK,EAAE;AAAwB,CAAE;AACtD,MAAM,UAAU,GAAG;EAAE,KAAK,EAAE;AAA+B,CAAE;AAC7D,MAAM,UAAU,GAAG;EAAE,KAAK,EAAE;AAA2B,CAAE;AACzD,MAAM,UAAU,GAAG,CAAC,U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,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,GAAI,MAAW,IAAM,YAAY,EAAG;OACvE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CACxB,CAAC,IACF,2EAAmB,CAAC,EAAE,EAAE,IAAI,CAAC,CAClC,CAAC;IACJ,CAAC;EACD;CAEC,CAAC,E;;AChUogB,C;;;;;ACAvb;AACL;;AAEG;;AAE9D,yG;;ACLf;;;;;;;;;;;;;AAaG;;;ACbqB;AACF;;;;;;;;;ACDtB;AAAA;AAAA","file":"AIProviders.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"CoreHome\", , \"CorePluginsAdmin\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AIProviders\"] = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse\n\t\troot[\"AIProviders\"] = factory(root[\"CoreHome\"], root[\"Vue\"], root[\"CorePluginsAdmin\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"plugins/AIProviders/vue/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fae3\");\n","export * from \"-!../../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--11-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../../../node_modules/less-loader/dist/cjs.js??ref--11-oneOf-1-3!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=style&index=0&id=6e2e3ad5&lang=less\"","module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__;","// extracted by mini-css-extract-plugin","// extracted by mini-css-extract-plugin","module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;","module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__;","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, withDirectives as _withDirectives, normalizeClass as _normalizeClass, createTextVNode as _createTextVNode, withModifiers as _withModifiers, Fragment as _Fragment, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"ai-providers-card-header\" }\nconst _hoisted_2 = [\"checked\", \"value\"]\nconst _hoisted_3 = { class: \"ai-providers-card-name\" }\nconst _hoisted_4 = { class: \"ai-providers-card-description\" }\nconst _hoisted_5 = { class: \"ai-providers-card-actions\" }\nconst _hoisted_6 = [\"disabled\"]\nconst _hoisted_7 = [\"disabled\"]\n\nimport { computed } from 'vue';\nimport { AutoClearPassword as vAutoClearPassword, translate } from 'CoreHome';\nimport { Field } from 'CorePluginsAdmin';\nimport type { Provider, ProviderConfiguration } from '../types';\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ProviderCard',\n props: {\n provider: null,\n configuration: null,\n selected: { type: Boolean },\n canEdit: { type: Boolean }\n },\n emits: [\"select\", \"update:apiKey\", \"update:endpointUrl\", \"test\", \"disconnect\"],\n setup(__props: any, { emit }: { emit: ({\n (e: 'select'): void;\n (e: 'update:apiKey', value: string): void;\n (e: 'update:endpointUrl', value: string): void;\n (e: 'test'): void;\n (e: 'disconnect'): void;\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props as {\n provider: Provider;\n configuration: ProviderConfiguration | undefined;\n selected: boolean;\n canEdit: boolean;\n};\n\n\n\n/* eslint-disable func-call-spacing, no-spaced-func */\n\n/* eslint-enable func-call-spacing, no-spaced-func */\n\nconst hasPendingKey = computed(() => (props.configuration?.apiKey ?? '') !== '');\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"label\", {\n class: _normalizeClass([{ 'is-selected': __props.selected }, \"ai-providers-card\"])\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"input\", {\n checked: __props.selected,\n value: __props.provider.id,\n name: \"defaultProviderId\",\n type: \"radio\",\n onChange: _cache[0] || (_cache[0] = ($event: any) => (emit('select')))\n }, null, 40, _hoisted_2),\n _createElementVNode(\"span\", _hoisted_3, _toDisplayString(__props.provider.name), 1)\n ]),\n _createElementVNode(\"p\", _hoisted_4, _toDisplayString(_unref(translate)(__props.provider.description)), 1),\n (__props.canEdit)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (__props.provider.supportsCustomEndpoint)\n ? (_openBlock(), _createBlock(_unref(Field), {\n key: 0,\n \"model-value\": __props.configuration?.endpointUrl,\n name: `endpointUrl-${__props.provider.id}`,\n title: _unref(translate)('AIProviders_EndpointUrl'),\n placeholder: _unref(translate)('AIProviders_EndpointUrlPlaceholder'),\n autocomplete: \"off\",\n \"full-width\": \"\",\n uicontrol: \"text\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => (emit('update:endpointUrl', `${$event}`)))\n }, null, 8, [\"model-value\", \"name\", \"title\", \"placeholder\"]))\n : _createCommentVNode(\"\", true),\n _withDirectives(_createVNode(_unref(Field), {\n \"model-value\": __props.configuration?.apiKey,\n name: `apiKey-${__props.provider.id}`,\n placeholder: __props.provider.configuration.hasApiKey\n ? _unref(translate)('AIProviders_ApiKeyAlreadyConfiguredPlaceholder')\n : _unref(translate)('AIProviders_ApiKeyPlaceholder'),\n title: _unref(translate)('AIProviders_ApiKey'),\n autocomplete: \"new-password\",\n \"full-width\": \"\",\n uicontrol: \"password\",\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => (emit('update:apiKey', `${$event}`)))\n }, null, 8, [\"model-value\", \"name\", \"placeholder\", \"title\"]), [\n [_unref(vAutoClearPassword)]\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass([{ 'is-connected': __props.provider.configuration.hasApiKey }, \"ai-providers-card-status\"])\n }, [\n _createElementVNode(\"span\", {\n \"aria-hidden\": \"true\",\n class: _normalizeClass([\"icon ai-providers-status-icon\", __props.provider.configuration.hasApiKey ? 'icon-ok' : 'icon-minus'])\n }, null, 2),\n _createTextVNode(\" \" + _toDisplayString(__props.provider.configuration.hasApiKey\n ? _unref(translate)('AIProviders_StatusConnected')\n : _unref(translate)('AIProviders_StatusNotConnected')), 1)\n ], 2),\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"button\", {\n class: \"btn btn-outline btn-small\",\n type: \"button\",\n disabled: !_unref(hasPendingKey) && !__props.provider.configuration.hasApiKey,\n onClick: _cache[3] || (_cache[3] = _withModifiers(($event: any) => (emit('test')), [\"prevent\"]))\n }, _toDisplayString(_unref(translate)('AIProviders_TestConnection')), 9, _hoisted_6),\n _createElementVNode(\"button\", {\n class: \"btn-flat\",\n type: \"button\",\n disabled: !__props.provider.configuration.hasApiKey,\n onClick: _cache[4] || (_cache[4] = _withModifiers(($event: any) => (emit('disconnect')), [\"prevent\"]))\n }, _toDisplayString(_unref(translate)('AIProviders_Disconnect')), 9, _hoisted_7)\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ], 2))\n}\n}\n\n})","export { default } from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"; export * from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"","import script from \"./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ProviderCard.vue?vue&type=style&index=0&id=3702360d&lang=less\"\n\nexport default script","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, createTextVNode as _createTextVNode, withCtx as _withCtx, renderList as _renderList, Fragment as _Fragment, vModelRadio as _vModelRadio, withDirectives as _withDirectives, normalizeClass as _normalizeClass, createVNode as _createVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"ai-providers-page\" }\nconst _hoisted_2 = { class: \"ai-providers-page-header\" }\nconst _hoisted_3 = { class: \"ai-providers-page-title\" }\nconst _hoisted_4 = { class: \"ai-providers-page-subtitle\" }\nconst _hoisted_5 = {\n key: 0,\n class: \"ai-providers-selected-configuration\"\n}\nconst _hoisted_6 = { class: \"ai-providers\" }\nconst _hoisted_7 = { class: \"ai-providers-defaults-title\" }\nconst _hoisted_8 = { class: \"ai-providers-section\" }\nconst _hoisted_9 = { class: \"ai-providers-subsection-title\" }\nconst _hoisted_10 = { class: \"ai-providers-section-help\" }\nconst _hoisted_11 = [\"aria-label\"]\nconst _hoisted_12 = {\n key: 1,\n class: \"ai-providers-section\"\n}\nconst _hoisted_13 = { class: \"ai-providers-subsection-title\" }\nconst _hoisted_14 = { class: \"ai-providers-section-help\" }\nconst _hoisted_15 = [\"aria-label\"]\nconst _hoisted_16 = { class: \"ai-providers-capability-header\" }\nconst _hoisted_17 = [\"value\"]\nconst _hoisted_18 = { class: \"ai-providers-capability-label\" }\nconst _hoisted_19 = {\n key: 0,\n class: \"ai-providers-capability-description\"\n}\nconst _hoisted_20 = /*#__PURE__*/_createElementVNode(\"p\", { class: \"ai-providers-capability-footnote\" }, null, -1)\nconst _hoisted_21 = {\n key: 2,\n class: \"ai-providers-footer\"\n}\nconst _hoisted_22 = [\"disabled\"]\n\nimport { computed, onMounted, ref } from 'vue';\nimport {\n ActivityIndicator,\n AjaxHelper,\n Alert,\n ContentBlock,\n NotificationsStore,\n translate,\n} from 'CoreHome';\nimport { Form as vForm, SaveButton } from 'CorePluginsAdmin';\nimport ProviderCard from './components/ProviderCard.vue';\nimport type { CapabilityLevelOption, ProviderConfiguration, Settings } from './types';\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ManageAIProviders',\n setup(__props) {\n\nconst settings = ref(null);\nconst isLoading = ref(false);\nconst isSaving = ref(false);\nconst defaultProviderId = ref('');\nconst defaultCapabilityLevel = ref('');\nconst providerConfigurations = ref>({});\n\nconst providers = computed(() => settings.value?.providers || []);\nconst canEditCapabilityLevel = computed(() => !!settings.value?.canEditCapabilityLevel);\nconst canEditProviderConfiguration = computed(() => !!settings.value?.canEditProviderConfiguration);\nconst selectedProvider = computed(() => providers.value.find((provider) => (\n provider.id === defaultProviderId.value\n)));\n\nconst capabilityLevelOptions = computed(() => {\n const capabilityLevels = settings.value?.capabilityLevels || {};\n\n return Object.entries(capabilityLevels).map(([id, keys]) => ({\n id,\n label: translate(keys.label),\n description: keys.description ? translate(keys.description) : '',\n }));\n});\nconst selectedCapabilityLevel = computed(() => capabilityLevelOptions.value.find((capability) => (\n capability.id === defaultCapabilityLevel.value\n)));\nconst selectedConfigurationLabel = computed(() => {\n if (!selectedProvider.value || !selectedCapabilityLevel.value) {\n return '';\n }\n\n return translate(\n 'AIProviders_SelectedConfiguration',\n selectedProvider.value.name,\n selectedCapabilityLevel.value.label,\n );\n});\n\n/**\n * Applies the given settings to the component state.\n * @param nextSettings\n */\nfunction applySettings(nextSettings: Settings) {\n settings.value = nextSettings;\n defaultProviderId.value = nextSettings.defaultProviderId;\n defaultCapabilityLevel.value = nextSettings.defaultCapabilityLevel;\n\n const nextProviderConfigurations: Record = {};\n nextSettings.providers.forEach((provider) => {\n nextProviderConfigurations[provider.id] = {\n apiKey: '',\n endpointUrl: provider.configuration.endpointUrl || '',\n };\n });\n providerConfigurations.value = nextProviderConfigurations;\n}\n\nasync function loadSettings() {\n isLoading.value = true;\n\n try {\n const response = await AjaxHelper.fetch({\n method: 'AIProviders.getSettings',\n });\n applySettings(response);\n } finally {\n isLoading.value = false;\n }\n}\n\nfunction updateApiKey(providerId: string, apiKey: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n apiKey,\n };\n}\n\nfunction updateEndpointUrl(providerId: string, endpointUrl: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n endpointUrl,\n };\n}\n\nfunction disconnectProvider(providerId: string) {\n // PoC: clears the locally entered key. Removing a persisted key requires a\n // backend method that isn't wired up yet.\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n apiKey: '',\n };\n NotificationsStore.show({\n message: translate('AIProviders_DisconnectNotAvailable'),\n type: 'transient',\n id: `aiProvidersDisconnect-${providerId}`,\n context: 'info',\n });\n}\n\nfunction testConnection(providerId: string) {\n // PoC: placeholder until a server-side connection test endpoint exists.\n NotificationsStore.show({\n message: translate('AIProviders_TestConnectionNotAvailable'),\n type: 'transient',\n id: `aiProvidersTest-${providerId}`,\n context: 'info',\n });\n}\n\nfunction cancelChanges() {\n if (settings.value) {\n applySettings(settings.value);\n }\n}\n\n/**\n * Saves the current settings to the server.\n */\nasync function saveSettings() {\n isSaving.value = true;\n\n try {\n const response = await AjaxHelper.post(\n {\n method: 'AIProviders.saveSettings',\n },\n {\n defaultProviderId: defaultProviderId.value,\n defaultCapabilityLevel: defaultCapabilityLevel.value,\n providerConfigurations: JSON.stringify(providerConfigurations.value),\n },\n {\n withTokenInUrl: true,\n },\n );\n applySettings(response);\n\n const notificationInstanceId = NotificationsStore.show({\n message: translate('AIProviders_SettingsSaveSuccess'),\n type: 'transient',\n id: 'aiProvidersSettings',\n context: 'success',\n });\n NotificationsStore.scrollToNotification(notificationInstanceId);\n } finally {\n isSaving.value = false;\n }\n}\n\nonMounted(loadSettings);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"header\", _hoisted_2, [\n _createElementVNode(\"h2\", _hoisted_3, _toDisplayString(_unref(translate)('AIProviders_MenuTitle')), 1),\n _createElementVNode(\"p\", _hoisted_4, _toDisplayString(_unref(translate)('AIProviders_ConfigurationIntro')), 1),\n (_unref(selectedConfigurationLabel))\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_5, _toDisplayString(_unref(selectedConfigurationLabel)), 1))\n : _createCommentVNode(\"\", true)\n ]),\n (isLoading.value)\n ? (_openBlock(), _createBlock(_unref(ActivityIndicator), {\n key: 0,\n loading: isLoading.value\n }, null, 8, [\"loading\"]))\n : (settings.value)\n ? (_openBlock(), _createBlock(_unref(ContentBlock), { key: 1 }, {\n default: _withCtx(() => [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", _hoisted_6, [\n (!_unref(canEditProviderConfiguration))\n ? (_openBlock(), _createBlock(_unref(Alert), {\n key: 0,\n severity: \"info\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(translate)('AIProviders_CloudConfigurationHelp')), 1)\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"h3\", _hoisted_7, _toDisplayString(_unref(translate)('AIProviders_DefaultsTitle')), 1),\n _createElementVNode(\"section\", _hoisted_8, [\n _createElementVNode(\"h4\", _hoisted_9, _toDisplayString(_unref(translate)('AIProviders_DefaultProvider')), 1),\n _createElementVNode(\"p\", _hoisted_10, _toDisplayString(_unref(translate)('AIProviders_DefaultProviderHelp')), 1),\n _createElementVNode(\"div\", {\n \"aria-label\": _unref(translate)('AIProviders_DefaultProvider'),\n class: \"ai-providers-cards\",\n role: \"radiogroup\"\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(providers), (provider) => {\n return (_openBlock(), _createBlock(ProviderCard, {\n key: provider.id,\n \"can-edit\": _unref(canEditProviderConfiguration),\n configuration: providerConfigurations.value[provider.id],\n provider: provider,\n selected: defaultProviderId.value === provider.id,\n onDisconnect: ($event: any) => (disconnectProvider(provider.id)),\n onSelect: ($event: any) => (defaultProviderId.value = provider.id),\n onTest: ($event: any) => (testConnection(provider.id)),\n \"onUpdate:apiKey\": ($event: any) => (updateApiKey(provider.id, $event)),\n \"onUpdate:endpointUrl\": ($event: any) => (updateEndpointUrl(provider.id, $event))\n }, null, 8, [\"can-edit\", \"configuration\", \"provider\", \"selected\", \"onDisconnect\", \"onSelect\", \"onTest\", \"onUpdate:apiKey\", \"onUpdate:endpointUrl\"]))\n }), 128))\n ], 8, _hoisted_11)\n ]),\n (_unref(canEditCapabilityLevel))\n ? (_openBlock(), _createElementBlock(\"section\", _hoisted_12, [\n _createElementVNode(\"h4\", _hoisted_13, _toDisplayString(_unref(translate)('AIProviders_DefaultCapabilityLevel')), 1),\n _createElementVNode(\"p\", _hoisted_14, _toDisplayString(_unref(translate)('AIProviders_DefaultCapabilityLevelHelp')), 1),\n _createElementVNode(\"div\", {\n \"aria-label\": _unref(translate)('AIProviders_DefaultCapabilityLevel'),\n class: \"ai-providers-capability-cards\",\n role: \"radiogroup\"\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(capabilityLevelOptions), (capability) => {\n return (_openBlock(), _createElementBlock(\"label\", {\n key: capability.id,\n class: _normalizeClass([{ 'is-selected': defaultCapabilityLevel.value === capability.id }, \"ai-providers-capability-card\"])\n }, [\n _createElementVNode(\"div\", _hoisted_16, [\n _withDirectives(_createElementVNode(\"input\", {\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((defaultCapabilityLevel).value = $event)),\n value: capability.id,\n name: \"defaultCapabilityLevel\",\n type: \"radio\"\n }, null, 8, _hoisted_17), [\n [_vModelRadio, defaultCapabilityLevel.value]\n ]),\n _createElementVNode(\"span\", _hoisted_18, _toDisplayString(capability.label), 1)\n ]),\n (capability.description)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_19, _toDisplayString(capability.description), 1))\n : _createCommentVNode(\"\", true)\n ], 2))\n }), 128))\n ], 8, _hoisted_15),\n _hoisted_20\n ]))\n : _createCommentVNode(\"\", true)\n ])), [\n [_unref(vForm)]\n ])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (settings.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_21, [\n _createElementVNode(\"button\", {\n disabled: isSaving.value,\n class: \"btn btn-outline\",\n type: \"button\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (cancelChanges()))\n }, _toDisplayString(_unref(translate)('General_Cancel')), 9, _hoisted_22),\n _createVNode(_unref(SaveButton), {\n saving: isSaving.value,\n onConfirm: _cache[2] || (_cache[2] = ($event: any) => (saveSettings()))\n }, null, 8, [\"saving\"])\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","export { default } from \"-!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"; export * from \"-!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"","import script from \"./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ManageAIProviders.vue?vue&type=style&index=0&id=6e2e3ad5&lang=less\"\n\nexport default script","/*!\n * Copyright (C) InnoCraft Ltd - All rights reserved.\n *\n * NOTICE: All information contained herein is, and remains the property of InnoCraft Ltd.\n * The intellectual and technical concepts contained herein are protected by trade secret\n * or copyright law. Redistribution of this information or reproduction of this material is\n * strictly forbidden unless prior written permission is obtained from InnoCraft Ltd.\n *\n * You shall use this code only in accordance with the license agreement obtained from\n * InnoCraft Ltd.\n *\n * @link https://www.innocraft.com/\n * @license For license details see https://www.innocraft.com/license\n */\n\nexport { default as ManageAIProviders } from './ManageAIProviders.vue';\n","import './setPublicPath'\nexport * from '~entry'\n","export * from \"-!../../../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--11-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../../../../node_modules/less-loader/dist/cjs.js??ref--11-oneOf-1-3!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ProviderCard.vue?vue&type=style&index=0&id=3702360d&lang=less\""],"sourceRoot":""} \ No newline at end of file diff --git a/vue/dist/AIProviders.umd.min.js b/vue/dist/AIProviders.umd.min.js index 671e8d4..6efe51e 100644 --- a/vue/dist/AIProviders.umd.min.js +++ b/vue/dist/AIProviders.umd.min.js @@ -1,2 +1,2 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["AIProviders"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["AIProviders"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/AIProviders/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"ManageAIProviders",(function(){return f})),"undefined"!==typeof window){var o=window.document.currentScript,r=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var i=n("8bbf"),l=n("19dc"),a=n("a5a2");const c={key:1},u={key:1},d={class:"form-description"};var s=Object(i["defineComponent"])({__name:"ManageAIProviders",setup(e){const t=Object(i["ref"])(null),n=Object(i["ref"])(!1),o=Object(i["ref"])(!1),r=Object(i["ref"])(""),s=Object(i["ref"])(""),f=Object(i["ref"])({}),v=Object(i["computed"])(()=>{var e;const n={},o=(null===(e=t.value)||void 0===e?void 0:e.providers)||[];return o.forEach(e=>{n[e.id]=e.name}),n}),b=Object(i["computed"])(()=>{var e;const n={};return Object.entries((null===(e=t.value)||void 0===e?void 0:e.capabilityLevels)||{}).forEach(([e,t])=>{n[e]=Object(l["translate"])(t)}),n});function p(e){t.value=e,r.value=e.defaultProviderId,s.value=e.defaultCapabilityLevel;const n={};e.providers.forEach(e=>{n[e.id]={apiKey:"",endpointUrl:e.configuration.endpointUrl||""}}),f.value=n}async function j(){n.value=!0;try{const e=await l["AjaxHelper"].fetch({method:"AIProviders.getSettings"});p(e)}finally{n.value=!1}}function O(e,t){f.value[e]=Object.assign(Object.assign({},f.value[e]),{},{apiKey:t})}function m(e,t){f.value[e]=Object.assign(Object.assign({},f.value[e]),{},{endpointUrl:t})}async function y(){o.value=!0;try{const e=await l["AjaxHelper"].post({method:"AIProviders.saveSettings"},{defaultProviderId:r.value,defaultCapabilityLevel:s.value,providerConfigurations:JSON.stringify(f.value)},{withTokenInUrl:!0});p(e);const t=l["NotificationsStore"].show({message:Object(l["translate"])("AIProviders_SettingsSaveSuccess"),type:"transient",id:"aiProvidersSettings",context:"success"});l["NotificationsStore"].scrollToNotification(t)}finally{o.value=!1}}return Object(i["onMounted"])(j),(e,p)=>(Object(i["openBlock"])(),Object(i["createBlock"])(Object(i["unref"])(l["ContentBlock"]),{"content-title":Object(i["unref"])(l["translate"])("AIProviders_MenuTitle")},{default:Object(i["withCtx"])(()=>[n.value?(Object(i["openBlock"])(),Object(i["createBlock"])(Object(i["unref"])(l["ActivityIndicator"]),{key:0,loading:n.value},null,8,["loading"])):t.value?Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",c,[Object(i["createVNode"])(Object(i["unref"])(a["Field"]),{uicontrol:"select",name:"defaultProviderId",modelValue:r.value,"onUpdate:modelValue":p[0]||(p[0]=e=>r.value=e),title:Object(i["unref"])(l["translate"])("AIProviders_DefaultProvider"),options:Object(i["unref"])(v)},null,8,["modelValue","title","options"]),Object(i["createVNode"])(Object(i["unref"])(a["Field"]),{uicontrol:"select",name:"defaultCapabilityLevel",modelValue:s.value,"onUpdate:modelValue":p[1]||(p[1]=e=>s.value=e),title:Object(i["unref"])(l["translate"])("AIProviders_DefaultCapabilityLevel"),options:Object(i["unref"])(b),disabled:!t.value.canEditCapabilityLevel},null,8,["modelValue","title","options","disabled"]),t.value.canEditProviderConfiguration?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createBlock"])(Object(i["unref"])(l["Alert"]),{key:0,severity:"info"},{default:Object(i["withCtx"])(()=>[Object(i["createTextVNode"])(Object(i["toDisplayString"])(Object(i["unref"])(l["translate"])("AIProviders_CloudConfigurationHelp")),1)]),_:1})),t.value.canEditProviderConfiguration?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",u,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(Object(i["unref"])(l["translate"])("AIProviders_ProviderConnections")),1),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(t.value.providers,e=>{var t,n;return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{key:e.id,class:"ai-provider"},[Object(i["createElementVNode"])("h4",null,Object(i["toDisplayString"])(e.name),1),Object(i["createElementVNode"])("p",d,Object(i["toDisplayString"])(Object(i["unref"])(l["translate"])(e.description)),1),e.supportsCustomEndpoint?(Object(i["openBlock"])(),Object(i["createBlock"])(Object(i["unref"])(a["Field"]),{key:0,uicontrol:"text",name:"endpointUrl-"+e.id,"model-value":null===(t=f.value[e.id])||void 0===t?void 0:t.endpointUrl,"onUpdate:modelValue":t=>m(e.id,""+t),title:Object(i["unref"])(l["translate"])("AIProviders_EndpointUrl"),"inline-help":Object(i["unref"])(l["translate"])("AIProviders_EndpointUrlHelp"),autocomplete:"off"},null,8,["name","model-value","onUpdate:modelValue","title","inline-help"])):Object(i["createCommentVNode"])("",!0),Object(i["withDirectives"])(Object(i["createVNode"])(Object(i["unref"])(a["Field"]),{uicontrol:"password",name:"apiKey-"+e.id,"model-value":null===(n=f.value[e.id])||void 0===n?void 0:n.apiKey,"onUpdate:modelValue":t=>O(e.id,""+t),title:Object(i["unref"])(l["translate"])("AIProviders_ApiKey"),"inline-help":e.configuration.hasApiKey?Object(i["unref"])(l["translate"])("AIProviders_ApiKeyAlreadyConfigured"):Object(i["unref"])(l["translate"])("AIProviders_ApiKeyHelp"),autocomplete:"off"},null,8,["name","model-value","onUpdate:modelValue","title","inline-help"]),[[Object(i["unref"])(l["AutoClearPassword"])]])])}),128))])):Object(i["createCommentVNode"])("",!0),Object(i["createVNode"])(Object(i["unref"])(a["SaveButton"]),{onConfirm:p[2]||(p[2]=e=>y()),saving:o.value},null,8,["saving"])])),[[Object(i["unref"])(a["Form"])]]):Object(i["createCommentVNode"])("",!0)]),_:1},8,["content-title"]))}}),f=s}})})); +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["AIProviders"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["AIProviders"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,r){return function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="plugins/AIProviders/vue/dist/",r(r.s="fae3")}({1047:function(e,t,r){"use strict";r("86b3")},"19dc":function(t,r){t.exports=e},"1f8b":function(e,t,r){},"86b3":function(e,t,r){},"8bbf":function(e,r){e.exports=t},a5a2:function(e,t){e.exports=r},fae3:function(e,t,r){"use strict";if(r.r(t),r.d(t,"ManageAIProviders",(function(){return L})),"undefined"!==typeof window){var i=window.document.currentScript,n=i&&i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);n&&(r.p=n[1])}var o=r("8bbf"),a=r("19dc"),c=r("a5a2");const l={class:"ai-providers-card-header"},s=["checked","value"],d={class:"ai-providers-card-name"},u={class:"ai-providers-card-description"},b={class:"ai-providers-card-actions"},p=["disabled"],v=["disabled"];var j=Object(o["defineComponent"])({__name:"ProviderCard",props:{provider:null,configuration:null,selected:{type:Boolean},canEdit:{type:Boolean}},emits:["select","update:apiKey","update:endpointUrl","test","disconnect"],setup(e,{emit:t}){const r=e,i=Object(o["computed"])(()=>{var e,t;return""!==(null!==(e=null===(t=r.configuration)||void 0===t?void 0:t.apiKey)&&void 0!==e?e:"")});return(r,n)=>{var j,O;return Object(o["openBlock"])(),Object(o["createElementBlock"])("label",{class:Object(o["normalizeClass"])([{"is-selected":e.selected},"ai-providers-card"])},[Object(o["createElementVNode"])("div",l,[Object(o["createElementVNode"])("input",{checked:e.selected,value:e.provider.id,name:"defaultProviderId",type:"radio",onChange:n[0]||(n[0]=e=>t("select"))},null,40,s),Object(o["createElementVNode"])("span",d,Object(o["toDisplayString"])(e.provider.name),1)]),Object(o["createElementVNode"])("p",u,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])(e.provider.description)),1),e.canEdit?(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:0},[e.provider.supportsCustomEndpoint?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["unref"])(c["Field"]),{key:0,"model-value":null===(j=e.configuration)||void 0===j?void 0:j.endpointUrl,name:"endpointUrl-"+e.provider.id,title:Object(o["unref"])(a["translate"])("AIProviders_EndpointUrl"),placeholder:Object(o["unref"])(a["translate"])("AIProviders_EndpointUrlPlaceholder"),autocomplete:"off","full-width":"",uicontrol:"text","onUpdate:modelValue":n[1]||(n[1]=e=>t("update:endpointUrl",""+e))},null,8,["model-value","name","title","placeholder"])):Object(o["createCommentVNode"])("",!0),Object(o["withDirectives"])(Object(o["createVNode"])(Object(o["unref"])(c["Field"]),{"model-value":null===(O=e.configuration)||void 0===O?void 0:O.apiKey,name:"apiKey-"+e.provider.id,placeholder:e.provider.configuration.hasApiKey?Object(o["unref"])(a["translate"])("AIProviders_ApiKeyAlreadyConfiguredPlaceholder"):Object(o["unref"])(a["translate"])("AIProviders_ApiKeyPlaceholder"),title:Object(o["unref"])(a["translate"])("AIProviders_ApiKey"),autocomplete:"new-password","full-width":"",uicontrol:"password","onUpdate:modelValue":n[2]||(n[2]=e=>t("update:apiKey",""+e))},null,8,["model-value","name","placeholder","title"]),[[Object(o["unref"])(a["AutoClearPassword"])]]),Object(o["createElementVNode"])("div",{class:Object(o["normalizeClass"])([{"is-connected":e.provider.configuration.hasApiKey},"ai-providers-card-status"])},[Object(o["createElementVNode"])("span",{"aria-hidden":"true",class:Object(o["normalizeClass"])(["icon ai-providers-status-icon",e.provider.configuration.hasApiKey?"icon-ok":"icon-minus"])},null,2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.provider.configuration.hasApiKey?Object(o["unref"])(a["translate"])("AIProviders_StatusConnected"):Object(o["unref"])(a["translate"])("AIProviders_StatusNotConnected")),1)],2),Object(o["createElementVNode"])("div",b,[Object(o["createElementVNode"])("button",{class:"btn btn-outline btn-small",type:"button",disabled:!Object(o["unref"])(i)&&!e.provider.configuration.hasApiKey,onClick:n[3]||(n[3]=Object(o["withModifiers"])(e=>t("test"),["prevent"]))},Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_TestConnection")),9,p),Object(o["createElementVNode"])("button",{class:"btn-flat",type:"button",disabled:!e.provider.configuration.hasApiKey,onClick:n[4]||(n[4]=Object(o["withModifiers"])(e=>t("disconnect"),["prevent"]))},Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_Disconnect")),9,v)])],64)):Object(o["createCommentVNode"])("",!0)],2)}}}),O=(r("fd04"),j);const f={class:"ai-providers-page"},m={class:"ai-providers-page-header"},y={class:"ai-providers-page-title"},g={class:"ai-providers-page-subtitle"},P={key:0,class:"ai-providers-selected-configuration"},C={class:"ai-providers"},k={class:"ai-providers-defaults-title"},A={class:"ai-providers-section"},h={class:"ai-providers-subsection-title"},N={class:"ai-providers-section-help"},E=["aria-label"],V={key:1,class:"ai-providers-section"},S={class:"ai-providers-subsection-title"},B={class:"ai-providers-section-help"},I=["aria-label"],_={class:"ai-providers-capability-header"},D=["value"],w={class:"ai-providers-capability-label"},x={key:0,class:"ai-providers-capability-description"},K=Object(o["createElementVNode"])("p",{class:"ai-providers-capability-footnote"},null,-1),U={key:2,class:"ai-providers-footer"},T=["disabled"];var M=Object(o["defineComponent"])({__name:"ManageAIProviders",setup(e){const t=Object(o["ref"])(null),r=Object(o["ref"])(!1),i=Object(o["ref"])(!1),n=Object(o["ref"])(""),l=Object(o["ref"])(""),s=Object(o["ref"])({}),d=Object(o["computed"])(()=>{var e;return(null===(e=t.value)||void 0===e?void 0:e.providers)||[]}),u=Object(o["computed"])(()=>{var e;return!(null===(e=t.value)||void 0===e||!e.canEditCapabilityLevel)}),b=Object(o["computed"])(()=>{var e;return!(null===(e=t.value)||void 0===e||!e.canEditProviderConfiguration)}),p=Object(o["computed"])(()=>d.value.find(e=>e.id===n.value)),v=Object(o["computed"])(()=>{var e;const r=(null===(e=t.value)||void 0===e?void 0:e.capabilityLevels)||{};return Object.entries(r).map(([e,t])=>({id:e,label:Object(a["translate"])(t.label),description:t.description?Object(a["translate"])(t.description):""}))}),j=Object(o["computed"])(()=>v.value.find(e=>e.id===l.value)),M=Object(o["computed"])(()=>p.value&&j.value?Object(a["translate"])("AIProviders_SelectedConfiguration",p.value.name,j.value.label):"");function L(e){t.value=e,n.value=e.defaultProviderId,l.value=e.defaultCapabilityLevel;const r={};e.providers.forEach(e=>{r[e.id]={apiKey:"",endpointUrl:e.configuration.endpointUrl||""}}),s.value=r}async function H(){r.value=!0;try{const e=await a["AjaxHelper"].fetch({method:"AIProviders.getSettings"});L(e)}finally{r.value=!1}}function q(e,t){s.value[e]=Object.assign(Object.assign({},s.value[e]),{},{apiKey:t})}function F(e,t){s.value[e]=Object.assign(Object.assign({},s.value[e]),{},{endpointUrl:t})}function z(e){s.value[e]=Object.assign(Object.assign({},s.value[e]),{},{apiKey:""}),a["NotificationsStore"].show({message:Object(a["translate"])("AIProviders_DisconnectNotAvailable"),type:"transient",id:"aiProvidersDisconnect-"+e,context:"info"})}function G(e){a["NotificationsStore"].show({message:Object(a["translate"])("AIProviders_TestConnectionNotAvailable"),type:"transient",id:"aiProvidersTest-"+e,context:"info"})}function J(){t.value&&L(t.value)}async function R(){i.value=!0;try{const e=await a["AjaxHelper"].post({method:"AIProviders.saveSettings"},{defaultProviderId:n.value,defaultCapabilityLevel:l.value,providerConfigurations:JSON.stringify(s.value)},{withTokenInUrl:!0});L(e);const t=a["NotificationsStore"].show({message:Object(a["translate"])("AIProviders_SettingsSaveSuccess"),type:"transient",id:"aiProvidersSettings",context:"success"});a["NotificationsStore"].scrollToNotification(t)}finally{i.value=!1}}return Object(o["onMounted"])(H),(e,p)=>(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",f,[Object(o["createElementVNode"])("header",m,[Object(o["createElementVNode"])("h2",y,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_MenuTitle")),1),Object(o["createElementVNode"])("p",g,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_ConfigurationIntro")),1),Object(o["unref"])(M)?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",P,Object(o["toDisplayString"])(Object(o["unref"])(M)),1)):Object(o["createCommentVNode"])("",!0)]),r.value?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["unref"])(a["ActivityIndicator"]),{key:0,loading:r.value},null,8,["loading"])):t.value?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["unref"])(a["ContentBlock"]),{key:1},{default:Object(o["withCtx"])(()=>[Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",C,[Object(o["unref"])(b)?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["unref"])(a["Alert"]),{key:0,severity:"info"},{default:Object(o["withCtx"])(()=>[Object(o["createTextVNode"])(Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_CloudConfigurationHelp")),1)]),_:1})),Object(o["createElementVNode"])("h3",k,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultsTitle")),1),Object(o["createElementVNode"])("section",A,[Object(o["createElementVNode"])("h4",h,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultProvider")),1),Object(o["createElementVNode"])("p",N,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultProviderHelp")),1),Object(o["createElementVNode"])("div",{"aria-label":Object(o["unref"])(a["translate"])("AIProviders_DefaultProvider"),class:"ai-providers-cards",role:"radiogroup"},[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(Object(o["unref"])(d),e=>(Object(o["openBlock"])(),Object(o["createBlock"])(O,{key:e.id,"can-edit":Object(o["unref"])(b),configuration:s.value[e.id],provider:e,selected:n.value===e.id,onDisconnect:t=>z(e.id),onSelect:t=>n.value=e.id,onTest:t=>G(e.id),"onUpdate:apiKey":t=>q(e.id,t),"onUpdate:endpointUrl":t=>F(e.id,t)},null,8,["can-edit","configuration","provider","selected","onDisconnect","onSelect","onTest","onUpdate:apiKey","onUpdate:endpointUrl"]))),128))],8,E)]),Object(o["unref"])(u)?(Object(o["openBlock"])(),Object(o["createElementBlock"])("section",V,[Object(o["createElementVNode"])("h4",S,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultCapabilityLevel")),1),Object(o["createElementVNode"])("p",B,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultCapabilityLevelHelp")),1),Object(o["createElementVNode"])("div",{"aria-label":Object(o["unref"])(a["translate"])("AIProviders_DefaultCapabilityLevel"),class:"ai-providers-capability-cards",role:"radiogroup"},[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(Object(o["unref"])(v),e=>(Object(o["openBlock"])(),Object(o["createElementBlock"])("label",{key:e.id,class:Object(o["normalizeClass"])([{"is-selected":l.value===e.id},"ai-providers-capability-card"])},[Object(o["createElementVNode"])("div",_,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{"onUpdate:modelValue":p[0]||(p[0]=e=>l.value=e),value:e.id,name:"defaultCapabilityLevel",type:"radio"},null,8,D),[[o["vModelRadio"],l.value]]),Object(o["createElementVNode"])("span",w,Object(o["toDisplayString"])(e.label),1)]),e.description?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",x,Object(o["toDisplayString"])(e.description),1)):Object(o["createCommentVNode"])("",!0)],2))),128))],8,I),K])):Object(o["createCommentVNode"])("",!0)])),[[Object(o["unref"])(c["Form"])]])]),_:1})):Object(o["createCommentVNode"])("",!0),t.value?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",U,[Object(o["createElementVNode"])("button",{disabled:i.value,class:"btn btn-outline",type:"button",onClick:p[1]||(p[1]=e=>J())},Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("General_Cancel")),9,T),Object(o["createVNode"])(Object(o["unref"])(c["SaveButton"]),{saving:i.value,onConfirm:p[2]||(p[2]=e=>R())},null,8,["saving"])])):Object(o["createCommentVNode"])("",!0)]))}}),L=(r("1047"),M)},fd04:function(e,t,r){"use strict";r("1f8b")}})})); //# sourceMappingURL=AIProviders.umd.min.js.map \ No newline at end of file diff --git a/vue/dist/AIProviders.umd.min.js.map b/vue/dist/AIProviders.umd.min.js.map index 5a73f5a..46b8bb4 100644 --- a/vue/dist/AIProviders.umd.min.js.map +++ b/vue/dist/AIProviders.umd.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://AIProviders/webpack/universalModuleDefinition","webpack://AIProviders/webpack/bootstrap","webpack://AIProviders/external \"CoreHome\"","webpack://AIProviders/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://AIProviders/external \"CorePluginsAdmin\"","webpack://AIProviders/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?cf17"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__19dc__","__WEBPACK_EXTERNAL_MODULE__8bbf__","__WEBPACK_EXTERNAL_MODULE_a5a2__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","currentScript","document","src","match","_hoisted_1","_hoisted_2","_hoisted_3","class","__name","__props","settings","isLoading","isSaving","defaultProviderId","defaultCapabilityLevel","providerConfigurations","providerOptions","options","providers","forEach","provider","id","capabilityLevelOptions","entries","capabilityLevels","translationKey","applySettings","nextSettings","nextProviderConfigurations","apiKey","endpointUrl","configuration","async","loadSettings","response","fetch","method","updateApiKey","providerId","updateEndpointUrl","saveSettings","post","JSON","stringify","withTokenInUrl","notificationInstanceId","show","message","type","context","scrollToNotification","_ctx","_cache","default","loading","uicontrol","modelValue","$event","title","disabled","canEditCapabilityLevel","canEditProviderConfiguration","severity","_","description","supportsCustomEndpoint","autocomplete","hasApiKey","onConfirm","saving"],"mappings":"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B,KAAM,EAAG,CAAC,cACV,CACH,CAAC,mBAAO,cAEV,gCAAoB,IAAI,KAEhC+E,EAAG,GACF,EAAG,CAAC,sBCpPM","file":"AIProviders.umd.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"CoreHome\", , \"CorePluginsAdmin\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AIProviders\"] = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse\n\t\troot[\"AIProviders\"] = factory(root[\"CoreHome\"], root[\"Vue\"], root[\"CorePluginsAdmin\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"plugins/AIProviders/vue/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fae3\");\n","module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;","module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__;","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, withDirectives as _withDirectives } from \"vue\"\n\nconst _hoisted_1 = { key: 1 }\nconst _hoisted_2 = { key: 1 }\nconst _hoisted_3 = { class: \"form-description\" }\n\nimport {\n computed,\n onMounted,\n ref,\n} from 'vue';\nimport {\n ActivityIndicator,\n AjaxHelper,\n Alert,\n AutoClearPassword as vAutoClearPassword,\n ContentBlock,\n NotificationsStore,\n translate,\n} from 'CoreHome';\nimport {\n Field,\n Form as vForm,\n SaveButton,\n} from 'CorePluginsAdmin';\n\ninterface ProviderConfiguration {\n apiKey: string;\n endpointUrl: string;\n}\n\ninterface Provider {\n id: string;\n name: string;\n description: string;\n supportsCustomEndpoint: boolean;\n configuration: {\n hasApiKey: boolean;\n endpointUrl: string;\n };\n}\n\ninterface Settings {\n defaultProviderId: string;\n defaultCapabilityLevel: string;\n canEditProviderConfiguration: boolean;\n canEditCapabilityLevel: boolean;\n capabilityLevels: Record;\n providers: Provider[];\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ManageAIProviders',\n setup(__props) {\n\nconst settings = ref(null);\nconst isLoading = ref(false);\nconst isSaving = ref(false);\nconst defaultProviderId = ref('');\nconst defaultCapabilityLevel = ref('');\nconst providerConfigurations = ref>({});\n\nconst providerOptions = computed(() => {\n const options: Record = {};\n const providers = settings.value?.providers || [];\n\n providers.forEach((provider) => {\n options[provider.id] = provider.name;\n });\n\n return options;\n});\n\nconst capabilityLevelOptions = computed(() => {\n const options: Record = {};\n Object.entries(settings.value?.capabilityLevels || {}).forEach(([id, translationKey]) => {\n options[id] = translate(translationKey);\n });\n return options;\n});\n\nfunction applySettings(nextSettings: Settings) {\n settings.value = nextSettings;\n defaultProviderId.value = nextSettings.defaultProviderId;\n defaultCapabilityLevel.value = nextSettings.defaultCapabilityLevel;\n\n const nextProviderConfigurations: Record = {};\n nextSettings.providers.forEach((provider) => {\n nextProviderConfigurations[provider.id] = {\n apiKey: '',\n endpointUrl: provider.configuration.endpointUrl || '',\n };\n });\n providerConfigurations.value = nextProviderConfigurations;\n}\n\nasync function loadSettings() {\n isLoading.value = true;\n\n try {\n const response = await AjaxHelper.fetch({\n method: 'AIProviders.getSettings',\n });\n applySettings(response);\n } finally {\n isLoading.value = false;\n }\n}\n\nfunction updateApiKey(providerId: string, apiKey: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n apiKey,\n };\n}\n\nfunction updateEndpointUrl(providerId: string, endpointUrl: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n endpointUrl,\n };\n}\n\nasync function saveSettings() {\n isSaving.value = true;\n\n try {\n const response = await AjaxHelper.post(\n {\n method: 'AIProviders.saveSettings',\n },\n {\n defaultProviderId: defaultProviderId.value,\n defaultCapabilityLevel: defaultCapabilityLevel.value,\n providerConfigurations: JSON.stringify(providerConfigurations.value),\n },\n {\n withTokenInUrl: true,\n },\n );\n applySettings(response);\n\n const notificationInstanceId = NotificationsStore.show({\n message: translate('AIProviders_SettingsSaveSuccess'),\n type: 'transient',\n id: 'aiProvidersSettings',\n context: 'success',\n });\n NotificationsStore.scrollToNotification(notificationInstanceId);\n } finally {\n isSaving.value = false;\n }\n}\n\nonMounted(loadSettings);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(_unref(ContentBlock), {\n \"content-title\": _unref(translate)('AIProviders_MenuTitle')\n }, {\n default: _withCtx(() => [\n (isLoading.value)\n ? (_openBlock(), _createBlock(_unref(ActivityIndicator), {\n key: 0,\n loading: isLoading.value\n }, null, 8, [\"loading\"]))\n : (settings.value)\n ? _withDirectives((_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_unref(Field), {\n uicontrol: \"select\",\n name: \"defaultProviderId\",\n modelValue: defaultProviderId.value,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((defaultProviderId).value = $event)),\n title: _unref(translate)('AIProviders_DefaultProvider'),\n options: _unref(providerOptions)\n }, null, 8, [\"modelValue\", \"title\", \"options\"]),\n _createVNode(_unref(Field), {\n uicontrol: \"select\",\n name: \"defaultCapabilityLevel\",\n modelValue: defaultCapabilityLevel.value,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => ((defaultCapabilityLevel).value = $event)),\n title: _unref(translate)('AIProviders_DefaultCapabilityLevel'),\n options: _unref(capabilityLevelOptions),\n disabled: !settings.value.canEditCapabilityLevel\n }, null, 8, [\"modelValue\", \"title\", \"options\", \"disabled\"]),\n (!settings.value.canEditProviderConfiguration)\n ? (_openBlock(), _createBlock(_unref(Alert), {\n key: 0,\n severity: \"info\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(translate)('AIProviders_CloudConfigurationHelp')), 1)\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (settings.value.canEditProviderConfiguration)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, [\n _createElementVNode(\"h3\", null, _toDisplayString(_unref(translate)('AIProviders_ProviderConnections')), 1),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(settings.value.providers, (provider) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n key: provider.id,\n class: \"ai-provider\"\n }, [\n _createElementVNode(\"h4\", null, _toDisplayString(provider.name), 1),\n _createElementVNode(\"p\", _hoisted_3, _toDisplayString(_unref(translate)(provider.description)), 1),\n (provider.supportsCustomEndpoint)\n ? (_openBlock(), _createBlock(_unref(Field), {\n key: 0,\n uicontrol: \"text\",\n name: `endpointUrl-${provider.id}`,\n \"model-value\": providerConfigurations.value[provider.id]?.endpointUrl,\n \"onUpdate:modelValue\": ($event: any) => (updateEndpointUrl(provider.id, `${$event}`)),\n title: _unref(translate)('AIProviders_EndpointUrl'),\n \"inline-help\": _unref(translate)('AIProviders_EndpointUrlHelp'),\n autocomplete: \"off\"\n }, null, 8, [\"name\", \"model-value\", \"onUpdate:modelValue\", \"title\", \"inline-help\"]))\n : _createCommentVNode(\"\", true),\n _withDirectives(_createVNode(_unref(Field), {\n uicontrol: \"password\",\n name: `apiKey-${provider.id}`,\n \"model-value\": providerConfigurations.value[provider.id]?.apiKey,\n \"onUpdate:modelValue\": ($event: any) => (updateApiKey(provider.id, `${$event}`)),\n title: _unref(translate)('AIProviders_ApiKey'),\n \"inline-help\": provider.configuration.hasApiKey\n ? _unref(translate)('AIProviders_ApiKeyAlreadyConfigured')\n : _unref(translate)('AIProviders_ApiKeyHelp'),\n autocomplete: \"off\"\n }, null, 8, [\"name\", \"model-value\", \"onUpdate:modelValue\", \"title\", \"inline-help\"]), [\n [_unref(vAutoClearPassword)]\n ])\n ]))\n }), 128))\n ]))\n : _createCommentVNode(\"\", true),\n _createVNode(_unref(SaveButton), {\n onConfirm: _cache[2] || (_cache[2] = ($event: any) => (saveSettings())),\n saving: isSaving.value\n }, null, 8, [\"saving\"])\n ])), [\n [_unref(vForm)]\n ])\n : _createCommentVNode(\"\", true)\n ]),\n _: 1\n }, 8, [\"content-title\"]))\n}\n}\n\n})","import script from \"./ManageAIProviders.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./ManageAIProviders.vue?vue&type=script&setup=true&lang=ts\"\n\nexport default script"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://AIProviders/webpack/universalModuleDefinition","webpack://AIProviders/webpack/bootstrap","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?2aa5","webpack://AIProviders/external \"CoreHome\"","webpack://AIProviders/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://AIProviders/external \"CorePluginsAdmin\"","webpack://AIProviders/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?59bd","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?cf17","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?82df"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__19dc__","__WEBPACK_EXTERNAL_MODULE__8bbf__","__WEBPACK_EXTERNAL_MODULE_a5a2__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","currentScript","document","src","match","_hoisted_1","class","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","__name","props","provider","configuration","selected","type","Boolean","canEdit","emits","__props","emit","hasPendingKey","apiKey","_ctx","_cache","checked","id","onChange","$event","description","supportsCustomEndpoint","endpointUrl","title","placeholder","autocomplete","uicontrol","hasApiKey","disabled","onClick","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","settings","isLoading","isSaving","defaultProviderId","defaultCapabilityLevel","providerConfigurations","providers","canEditCapabilityLevel","canEditProviderConfiguration","selectedProvider","find","capabilityLevelOptions","capabilityLevels","entries","map","keys","label","selectedCapabilityLevel","capability","selectedConfigurationLabel","applySettings","nextSettings","nextProviderConfigurations","forEach","async","loadSettings","response","fetch","method","updateApiKey","providerId","updateEndpointUrl","disconnectProvider","show","message","context","testConnection","cancelChanges","saveSettings","post","JSON","stringify","withTokenInUrl","notificationInstanceId","scrollToNotification","loading","default","severity","_","role","ProviderCard","onDisconnect","onSelect","onTest","saving","onConfirm"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,kBAAZC,SAA0C,kBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,YAAaA,QAAQ,OAAQA,QAAQ,qBAC7C,oBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,WAAY,CAAE,oBAAqBJ,GACjB,kBAAZC,QACdA,QAAQ,eAAiBD,EAAQG,QAAQ,YAAaA,QAAQ,OAAQA,QAAQ,qBAE9EJ,EAAK,eAAiBC,EAAQD,EAAK,YAAaA,EAAK,OAAQA,EAAK,sBARpE,CASoB,qBAATO,KAAuBA,KAAOC,MAAO,SAASC,EAAmCC,EAAmCC,GAC/H,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUZ,QAGnC,IAAIC,EAASS,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHd,QAAS,IAUV,OANAe,EAAQH,GAAUI,KAAKf,EAAOD,QAASC,EAAQA,EAAOD,QAASW,GAG/DV,EAAOa,GAAI,EAGJb,EAAOD,QA0Df,OArDAW,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASnB,EAASoB,EAAMC,GAC3CV,EAAoBW,EAAEtB,EAASoB,IAClCG,OAAOC,eAAexB,EAASoB,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAS3B,GAC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C/BuD,OAAQpD,EAAS1E,MACjB+H,UAAWrF,EAAO,KAAOA,EAAO,GAAMI,GAAiBgE,MACtD,KAAM,EAAG,CAAC,cAEf,gCAAoB,IAAI,SCtTjB,G,UAAA,I,kCCLf","file":"AIProviders.umd.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"CoreHome\", , \"CorePluginsAdmin\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AIProviders\"] = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse\n\t\troot[\"AIProviders\"] = factory(root[\"CoreHome\"], root[\"Vue\"], root[\"CorePluginsAdmin\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"plugins/AIProviders/vue/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fae3\");\n","export * from \"-!../../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--11-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../../../node_modules/less-loader/dist/cjs.js??ref--11-oneOf-1-3!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=style&index=0&id=6e2e3ad5&lang=less\"","module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;","module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__;","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, withDirectives as _withDirectives, normalizeClass as _normalizeClass, createTextVNode as _createTextVNode, withModifiers as _withModifiers, Fragment as _Fragment, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"ai-providers-card-header\" }\nconst _hoisted_2 = [\"checked\", \"value\"]\nconst _hoisted_3 = { class: \"ai-providers-card-name\" }\nconst _hoisted_4 = { class: \"ai-providers-card-description\" }\nconst _hoisted_5 = { class: \"ai-providers-card-actions\" }\nconst _hoisted_6 = [\"disabled\"]\nconst _hoisted_7 = [\"disabled\"]\n\nimport { computed } from 'vue';\nimport { AutoClearPassword as vAutoClearPassword, translate } from 'CoreHome';\nimport { Field } from 'CorePluginsAdmin';\nimport type { Provider, ProviderConfiguration } from '../types';\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ProviderCard',\n props: {\n provider: null,\n configuration: null,\n selected: { type: Boolean },\n canEdit: { type: Boolean }\n },\n emits: [\"select\", \"update:apiKey\", \"update:endpointUrl\", \"test\", \"disconnect\"],\n setup(__props: any, { emit }: { emit: ({\n (e: 'select'): void;\n (e: 'update:apiKey', value: string): void;\n (e: 'update:endpointUrl', value: string): void;\n (e: 'test'): void;\n (e: 'disconnect'): void;\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props as {\n provider: Provider;\n configuration: ProviderConfiguration | undefined;\n selected: boolean;\n canEdit: boolean;\n};\n\n\n\n/* eslint-disable func-call-spacing, no-spaced-func */\n\n/* eslint-enable func-call-spacing, no-spaced-func */\n\nconst hasPendingKey = computed(() => (props.configuration?.apiKey ?? '') !== '');\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"label\", {\n class: _normalizeClass([{ 'is-selected': __props.selected }, \"ai-providers-card\"])\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"input\", {\n checked: __props.selected,\n value: __props.provider.id,\n name: \"defaultProviderId\",\n type: \"radio\",\n onChange: _cache[0] || (_cache[0] = ($event: any) => (emit('select')))\n }, null, 40, _hoisted_2),\n _createElementVNode(\"span\", _hoisted_3, _toDisplayString(__props.provider.name), 1)\n ]),\n _createElementVNode(\"p\", _hoisted_4, _toDisplayString(_unref(translate)(__props.provider.description)), 1),\n (__props.canEdit)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (__props.provider.supportsCustomEndpoint)\n ? (_openBlock(), _createBlock(_unref(Field), {\n key: 0,\n \"model-value\": __props.configuration?.endpointUrl,\n name: `endpointUrl-${__props.provider.id}`,\n title: _unref(translate)('AIProviders_EndpointUrl'),\n placeholder: _unref(translate)('AIProviders_EndpointUrlPlaceholder'),\n autocomplete: \"off\",\n \"full-width\": \"\",\n uicontrol: \"text\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => (emit('update:endpointUrl', `${$event}`)))\n }, null, 8, [\"model-value\", \"name\", \"title\", \"placeholder\"]))\n : _createCommentVNode(\"\", true),\n _withDirectives(_createVNode(_unref(Field), {\n \"model-value\": __props.configuration?.apiKey,\n name: `apiKey-${__props.provider.id}`,\n placeholder: __props.provider.configuration.hasApiKey\n ? _unref(translate)('AIProviders_ApiKeyAlreadyConfiguredPlaceholder')\n : _unref(translate)('AIProviders_ApiKeyPlaceholder'),\n title: _unref(translate)('AIProviders_ApiKey'),\n autocomplete: \"new-password\",\n \"full-width\": \"\",\n uicontrol: \"password\",\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => (emit('update:apiKey', `${$event}`)))\n }, null, 8, [\"model-value\", \"name\", \"placeholder\", \"title\"]), [\n [_unref(vAutoClearPassword)]\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass([{ 'is-connected': __props.provider.configuration.hasApiKey }, \"ai-providers-card-status\"])\n }, [\n _createElementVNode(\"span\", {\n \"aria-hidden\": \"true\",\n class: _normalizeClass([\"icon ai-providers-status-icon\", __props.provider.configuration.hasApiKey ? 'icon-ok' : 'icon-minus'])\n }, null, 2),\n _createTextVNode(\" \" + _toDisplayString(__props.provider.configuration.hasApiKey\n ? _unref(translate)('AIProviders_StatusConnected')\n : _unref(translate)('AIProviders_StatusNotConnected')), 1)\n ], 2),\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"button\", {\n class: \"btn btn-outline btn-small\",\n type: \"button\",\n disabled: !_unref(hasPendingKey) && !__props.provider.configuration.hasApiKey,\n onClick: _cache[3] || (_cache[3] = _withModifiers(($event: any) => (emit('test')), [\"prevent\"]))\n }, _toDisplayString(_unref(translate)('AIProviders_TestConnection')), 9, _hoisted_6),\n _createElementVNode(\"button\", {\n class: \"btn-flat\",\n type: \"button\",\n disabled: !__props.provider.configuration.hasApiKey,\n onClick: _cache[4] || (_cache[4] = _withModifiers(($event: any) => (emit('disconnect')), [\"prevent\"]))\n }, _toDisplayString(_unref(translate)('AIProviders_Disconnect')), 9, _hoisted_7)\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ], 2))\n}\n}\n\n})","import script from \"./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ProviderCard.vue?vue&type=style&index=0&id=3702360d&lang=less\"\n\nexport default script","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, createTextVNode as _createTextVNode, withCtx as _withCtx, renderList as _renderList, Fragment as _Fragment, vModelRadio as _vModelRadio, withDirectives as _withDirectives, normalizeClass as _normalizeClass, createVNode as _createVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"ai-providers-page\" }\nconst _hoisted_2 = { class: \"ai-providers-page-header\" }\nconst _hoisted_3 = { class: \"ai-providers-page-title\" }\nconst _hoisted_4 = { class: \"ai-providers-page-subtitle\" }\nconst _hoisted_5 = {\n key: 0,\n class: \"ai-providers-selected-configuration\"\n}\nconst _hoisted_6 = { class: \"ai-providers\" }\nconst _hoisted_7 = { class: \"ai-providers-defaults-title\" }\nconst _hoisted_8 = { class: \"ai-providers-section\" }\nconst _hoisted_9 = { class: \"ai-providers-subsection-title\" }\nconst _hoisted_10 = { class: \"ai-providers-section-help\" }\nconst _hoisted_11 = [\"aria-label\"]\nconst _hoisted_12 = {\n key: 1,\n class: \"ai-providers-section\"\n}\nconst _hoisted_13 = { class: \"ai-providers-subsection-title\" }\nconst _hoisted_14 = { class: \"ai-providers-section-help\" }\nconst _hoisted_15 = [\"aria-label\"]\nconst _hoisted_16 = { class: \"ai-providers-capability-header\" }\nconst _hoisted_17 = [\"value\"]\nconst _hoisted_18 = { class: \"ai-providers-capability-label\" }\nconst _hoisted_19 = {\n key: 0,\n class: \"ai-providers-capability-description\"\n}\nconst _hoisted_20 = /*#__PURE__*/_createElementVNode(\"p\", { class: \"ai-providers-capability-footnote\" }, null, -1)\nconst _hoisted_21 = {\n key: 2,\n class: \"ai-providers-footer\"\n}\nconst _hoisted_22 = [\"disabled\"]\n\nimport { computed, onMounted, ref } from 'vue';\nimport {\n ActivityIndicator,\n AjaxHelper,\n Alert,\n ContentBlock,\n NotificationsStore,\n translate,\n} from 'CoreHome';\nimport { Form as vForm, SaveButton } from 'CorePluginsAdmin';\nimport ProviderCard from './components/ProviderCard.vue';\nimport type { CapabilityLevelOption, ProviderConfiguration, Settings } from './types';\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ManageAIProviders',\n setup(__props) {\n\nconst settings = ref(null);\nconst isLoading = ref(false);\nconst isSaving = ref(false);\nconst defaultProviderId = ref('');\nconst defaultCapabilityLevel = ref('');\nconst providerConfigurations = ref>({});\n\nconst providers = computed(() => settings.value?.providers || []);\nconst canEditCapabilityLevel = computed(() => !!settings.value?.canEditCapabilityLevel);\nconst canEditProviderConfiguration = computed(() => !!settings.value?.canEditProviderConfiguration);\nconst selectedProvider = computed(() => providers.value.find((provider) => (\n provider.id === defaultProviderId.value\n)));\n\nconst capabilityLevelOptions = computed(() => {\n const capabilityLevels = settings.value?.capabilityLevels || {};\n\n return Object.entries(capabilityLevels).map(([id, keys]) => ({\n id,\n label: translate(keys.label),\n description: keys.description ? translate(keys.description) : '',\n }));\n});\nconst selectedCapabilityLevel = computed(() => capabilityLevelOptions.value.find((capability) => (\n capability.id === defaultCapabilityLevel.value\n)));\nconst selectedConfigurationLabel = computed(() => {\n if (!selectedProvider.value || !selectedCapabilityLevel.value) {\n return '';\n }\n\n return translate(\n 'AIProviders_SelectedConfiguration',\n selectedProvider.value.name,\n selectedCapabilityLevel.value.label,\n );\n});\n\n/**\n * Applies the given settings to the component state.\n * @param nextSettings\n */\nfunction applySettings(nextSettings: Settings) {\n settings.value = nextSettings;\n defaultProviderId.value = nextSettings.defaultProviderId;\n defaultCapabilityLevel.value = nextSettings.defaultCapabilityLevel;\n\n const nextProviderConfigurations: Record = {};\n nextSettings.providers.forEach((provider) => {\n nextProviderConfigurations[provider.id] = {\n apiKey: '',\n endpointUrl: provider.configuration.endpointUrl || '',\n };\n });\n providerConfigurations.value = nextProviderConfigurations;\n}\n\nasync function loadSettings() {\n isLoading.value = true;\n\n try {\n const response = await AjaxHelper.fetch({\n method: 'AIProviders.getSettings',\n });\n applySettings(response);\n } finally {\n isLoading.value = false;\n }\n}\n\nfunction updateApiKey(providerId: string, apiKey: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n apiKey,\n };\n}\n\nfunction updateEndpointUrl(providerId: string, endpointUrl: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n endpointUrl,\n };\n}\n\nfunction disconnectProvider(providerId: string) {\n // PoC: clears the locally entered key. Removing a persisted key requires a\n // backend method that isn't wired up yet.\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n apiKey: '',\n };\n NotificationsStore.show({\n message: translate('AIProviders_DisconnectNotAvailable'),\n type: 'transient',\n id: `aiProvidersDisconnect-${providerId}`,\n context: 'info',\n });\n}\n\nfunction testConnection(providerId: string) {\n // PoC: placeholder until a server-side connection test endpoint exists.\n NotificationsStore.show({\n message: translate('AIProviders_TestConnectionNotAvailable'),\n type: 'transient',\n id: `aiProvidersTest-${providerId}`,\n context: 'info',\n });\n}\n\nfunction cancelChanges() {\n if (settings.value) {\n applySettings(settings.value);\n }\n}\n\n/**\n * Saves the current settings to the server.\n */\nasync function saveSettings() {\n isSaving.value = true;\n\n try {\n const response = await AjaxHelper.post(\n {\n method: 'AIProviders.saveSettings',\n },\n {\n defaultProviderId: defaultProviderId.value,\n defaultCapabilityLevel: defaultCapabilityLevel.value,\n providerConfigurations: JSON.stringify(providerConfigurations.value),\n },\n {\n withTokenInUrl: true,\n },\n );\n applySettings(response);\n\n const notificationInstanceId = NotificationsStore.show({\n message: translate('AIProviders_SettingsSaveSuccess'),\n type: 'transient',\n id: 'aiProvidersSettings',\n context: 'success',\n });\n NotificationsStore.scrollToNotification(notificationInstanceId);\n } finally {\n isSaving.value = false;\n }\n}\n\nonMounted(loadSettings);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"header\", _hoisted_2, [\n _createElementVNode(\"h2\", _hoisted_3, _toDisplayString(_unref(translate)('AIProviders_MenuTitle')), 1),\n _createElementVNode(\"p\", _hoisted_4, _toDisplayString(_unref(translate)('AIProviders_ConfigurationIntro')), 1),\n (_unref(selectedConfigurationLabel))\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_5, _toDisplayString(_unref(selectedConfigurationLabel)), 1))\n : _createCommentVNode(\"\", true)\n ]),\n (isLoading.value)\n ? (_openBlock(), _createBlock(_unref(ActivityIndicator), {\n key: 0,\n loading: isLoading.value\n }, null, 8, [\"loading\"]))\n : (settings.value)\n ? (_openBlock(), _createBlock(_unref(ContentBlock), { key: 1 }, {\n default: _withCtx(() => [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", _hoisted_6, [\n (!_unref(canEditProviderConfiguration))\n ? (_openBlock(), _createBlock(_unref(Alert), {\n key: 0,\n severity: \"info\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(translate)('AIProviders_CloudConfigurationHelp')), 1)\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"h3\", _hoisted_7, _toDisplayString(_unref(translate)('AIProviders_DefaultsTitle')), 1),\n _createElementVNode(\"section\", _hoisted_8, [\n _createElementVNode(\"h4\", _hoisted_9, _toDisplayString(_unref(translate)('AIProviders_DefaultProvider')), 1),\n _createElementVNode(\"p\", _hoisted_10, _toDisplayString(_unref(translate)('AIProviders_DefaultProviderHelp')), 1),\n _createElementVNode(\"div\", {\n \"aria-label\": _unref(translate)('AIProviders_DefaultProvider'),\n class: \"ai-providers-cards\",\n role: \"radiogroup\"\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(providers), (provider) => {\n return (_openBlock(), _createBlock(ProviderCard, {\n key: provider.id,\n \"can-edit\": _unref(canEditProviderConfiguration),\n configuration: providerConfigurations.value[provider.id],\n provider: provider,\n selected: defaultProviderId.value === provider.id,\n onDisconnect: ($event: any) => (disconnectProvider(provider.id)),\n onSelect: ($event: any) => (defaultProviderId.value = provider.id),\n onTest: ($event: any) => (testConnection(provider.id)),\n \"onUpdate:apiKey\": ($event: any) => (updateApiKey(provider.id, $event)),\n \"onUpdate:endpointUrl\": ($event: any) => (updateEndpointUrl(provider.id, $event))\n }, null, 8, [\"can-edit\", \"configuration\", \"provider\", \"selected\", \"onDisconnect\", \"onSelect\", \"onTest\", \"onUpdate:apiKey\", \"onUpdate:endpointUrl\"]))\n }), 128))\n ], 8, _hoisted_11)\n ]),\n (_unref(canEditCapabilityLevel))\n ? (_openBlock(), _createElementBlock(\"section\", _hoisted_12, [\n _createElementVNode(\"h4\", _hoisted_13, _toDisplayString(_unref(translate)('AIProviders_DefaultCapabilityLevel')), 1),\n _createElementVNode(\"p\", _hoisted_14, _toDisplayString(_unref(translate)('AIProviders_DefaultCapabilityLevelHelp')), 1),\n _createElementVNode(\"div\", {\n \"aria-label\": _unref(translate)('AIProviders_DefaultCapabilityLevel'),\n class: \"ai-providers-capability-cards\",\n role: \"radiogroup\"\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(capabilityLevelOptions), (capability) => {\n return (_openBlock(), _createElementBlock(\"label\", {\n key: capability.id,\n class: _normalizeClass([{ 'is-selected': defaultCapabilityLevel.value === capability.id }, \"ai-providers-capability-card\"])\n }, [\n _createElementVNode(\"div\", _hoisted_16, [\n _withDirectives(_createElementVNode(\"input\", {\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((defaultCapabilityLevel).value = $event)),\n value: capability.id,\n name: \"defaultCapabilityLevel\",\n type: \"radio\"\n }, null, 8, _hoisted_17), [\n [_vModelRadio, defaultCapabilityLevel.value]\n ]),\n _createElementVNode(\"span\", _hoisted_18, _toDisplayString(capability.label), 1)\n ]),\n (capability.description)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_19, _toDisplayString(capability.description), 1))\n : _createCommentVNode(\"\", true)\n ], 2))\n }), 128))\n ], 8, _hoisted_15),\n _hoisted_20\n ]))\n : _createCommentVNode(\"\", true)\n ])), [\n [_unref(vForm)]\n ])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (settings.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_21, [\n _createElementVNode(\"button\", {\n disabled: isSaving.value,\n class: \"btn btn-outline\",\n type: \"button\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (cancelChanges()))\n }, _toDisplayString(_unref(translate)('General_Cancel')), 9, _hoisted_22),\n _createVNode(_unref(SaveButton), {\n saving: isSaving.value,\n onConfirm: _cache[2] || (_cache[2] = ($event: any) => (saveSettings()))\n }, null, 8, [\"saving\"])\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ManageAIProviders.vue?vue&type=style&index=0&id=6e2e3ad5&lang=less\"\n\nexport default script","export * from \"-!../../../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--11-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../../../../node_modules/less-loader/dist/cjs.js??ref--11-oneOf-1-3!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ProviderCard.vue?vue&type=style&index=0&id=3702360d&lang=less\""],"sourceRoot":""} \ No newline at end of file diff --git a/vue/src/ManageAIProviders.vue b/vue/src/ManageAIProviders.vue index 0365d40..4633e83 100644 --- a/vue/src/ManageAIProviders.vue +++ b/vue/src/ManageAIProviders.vue @@ -13,51 +13,19 @@ @license For license details see https://www.innocraft.com/license --> - + + diff --git a/vue/src/components/ProviderCard.vue b/vue/src/components/ProviderCard.vue new file mode 100644 index 0000000..c2781ea --- /dev/null +++ b/vue/src/components/ProviderCard.vue @@ -0,0 +1,246 @@ + + + + + + + diff --git a/vue/src/types.ts b/vue/src/types.ts new file mode 100644 index 0000000..2e79cdd --- /dev/null +++ b/vue/src/types.ts @@ -0,0 +1,50 @@ +/*! + * Copyright (C) InnoCraft Ltd - All rights reserved. + * + * NOTICE: All information contained herein is, and remains the property of InnoCraft Ltd. + * The intellectual and technical concepts contained herein are protected by trade secret + * or copyright law. Redistribution of this information or reproduction of this material is + * strictly forbidden unless prior written permission is obtained from InnoCraft Ltd. + * + * You shall use this code only in accordance with the license agreement obtained from + * InnoCraft Ltd. + * + * @link https://www.innocraft.com/ + * @license For license details see https://www.innocraft.com/license + */ + +export interface ProviderConfiguration { + apiKey: string; + endpointUrl: string; +} + +export interface Provider { + id: string; + name: string; + description: string; + supportsCustomEndpoint: boolean; + configuration: { + hasApiKey: boolean; + endpointUrl: string; + }; +} + +export interface CapabilityLevel { + label: string; + description: string; +} + +export interface Settings { + defaultProviderId: string; + defaultCapabilityLevel: string; + canEditProviderConfiguration: boolean; + canEditCapabilityLevel: boolean; + capabilityLevels: Record; + providers: Provider[]; +} + +export interface CapabilityLevelOption { + id: string; + label: string; + description: string; +} From 72853c60f48d65a16e00ec4e8cdd6f4edabea08d Mon Sep 17 00:00:00 2001 From: Maximilian Taube Date: Fri, 22 May 2026 11:52:27 +0200 Subject: [PATCH 03/17] Add AI provider prompt completion, Add API and service methods --- AIProviderResponse.php | 68 ++++++ AIProviderService.php | 81 ++++++- AIProviders.php | 9 +- AIProvidersList.php | 2 +- API.php | 91 +++++++- Controller.php | 3 - Model/Configuration.php | 161 +++++++++++--- Provider/AIProvider.php | 231 +++++++++++++++++++- Provider/Claude.php | 40 ++++ Provider/CustomProvider.php | 46 ++++ Provider/Gemini.php | 47 ++++ Provider/OpenAI.php | 40 ++++ README.md | 6 + lang/en.json | 14 +- tests/Integration/ConfigurationTest.php | 180 +++++++++++++++- vue/dist/AIProviders.css | 2 +- vue/dist/AIProviders.umd.js | 274 ++++++++++++++++-------- vue/dist/AIProviders.umd.js.map | 2 +- vue/dist/AIProviders.umd.min.js | 2 +- vue/dist/AIProviders.umd.min.js.map | 2 +- vue/src/ManageAIProviders.vue | 185 +++++++++++++--- vue/src/components/ProviderCard.vue | 228 +++++++++++++------- vue/src/types.ts | 9 + 23 files changed, 1473 insertions(+), 250 deletions(-) create mode 100644 AIProviderResponse.php diff --git a/AIProviderResponse.php b/AIProviderResponse.php new file mode 100644 index 0000000..1ee6a4c --- /dev/null +++ b/AIProviderResponse.php @@ -0,0 +1,68 @@ +providerId = $providerId; + $this->providerName = $providerName; + $this->model = $model; + $this->text = $text; + } + + public function getText(): string + { + return $this->text; + } + + /** + * @return array + */ + public function toArray(): array + { + return [ + 'providerId' => $this->providerId, + 'providerName' => $this->providerName, + 'model' => $this->model, + 'text' => $this->text, + ]; + } +} diff --git a/AIProviderService.php b/AIProviderService.php index f48f47e..111a19f 100644 --- a/AIProviderService.php +++ b/AIProviderService.php @@ -35,7 +35,7 @@ public function __construct(Configuration $configuration) } /** - * Returns the configured default provider for server-side plugin use. + * Returns the configured default provider for trusted PHP callers. */ public function getDefaultProvider(): AIProvider { @@ -72,4 +72,83 @@ public function getDefaultCapabilityLevel(): string { return $this->configuration->getDefaultCapabilityLevel(); } + + /** + * Returns provider status metadata for trusted PHP callers. + * + * @return array + */ + public function getAvailableProviderStatuses(): array + { + $providers = AIProviders::getAvailableProviders(); + $defaultProviderId = $this->configuration->getDefaultProviderId($providers); + + return array_map(function (AIProvider $provider) use ($defaultProviderId): array { + $configuration = $this->configuration->getProviderConfiguration($provider->getId()); + + return [ + 'id' => $provider->getId(), + 'name' => $provider->getName(), + 'description' => $provider->getDescription(), + 'defaultModel' => $provider->getDefaultModel(), + 'isDefault' => $provider->getId() === $defaultProviderId, + 'isConfigured' => trim($configuration['apiKey'] ?? '') !== '', + 'supportsCustomEndpoint' => $provider->supportsCustomEndpoint(), + 'endpointUrl' => $configuration['endpointUrl'] ?? '', + ]; + }, $providers->getProviders()); + } + + /** + * Completes a prompt using the configured default provider or a selected provider. + */ + public function completePrompt(string $prompt, ?string $providerId = null): AIProviderResponse + { + $provider = $providerId !== null && $providerId !== '' + ? $this->getProvider($providerId) + : $this->getDefaultProvider(); + $configuration = $this->configuration->getProviderConfiguration($provider->getId()); + + return $this->completePromptWithProvider($provider, $configuration, $prompt); + } + + /** + * @param array $configuration + */ + public function completePromptWithProvider(AIProvider $provider, array $configuration, string $prompt): AIProviderResponse + { + $text = $provider->completePrompt($configuration, $prompt); + + if (trim($text) === '') { + throw new AIProviderException(sprintf('%s returned an empty response.', $provider->getName())); + } + + return new AIProviderResponse( + $provider->getId(), + $provider->getName(), + $provider->getDefaultModel(), + $text + ); + } + + private function getProvider(string $providerId): AIProvider + { + $providers = AIProviders::getAvailableProviders(); + $provider = $providers->getProvider($providerId); + + if ($provider === null) { + throw new InvalidArgumentException(sprintf('Unknown AI provider "%s".', $providerId)); + } + + return $provider; + } } diff --git a/AIProviders.php b/AIProviders.php index 62f81a3..44c5a12 100644 --- a/AIProviders.php +++ b/AIProviders.php @@ -88,26 +88,31 @@ public function getClientSideTranslationKeys(array &$translations): void $translations[] = 'AIProviders_CloudConfigurationHelp'; $translations[] = 'AIProviders_ConfigurationIntro'; $translations[] = 'AIProviders_CustomProviderDescription'; + $translations[] = 'AIProviders_DefaultBadge'; $translations[] = 'AIProviders_DefaultCapabilityLevel'; $translations[] = 'AIProviders_DefaultCapabilityLevelHelp'; $translations[] = 'AIProviders_DefaultProvider'; $translations[] = 'AIProviders_DefaultProviderHelp'; $translations[] = 'AIProviders_DefaultsTitle'; $translations[] = 'AIProviders_Disconnect'; - $translations[] = 'AIProviders_DisconnectNotAvailable'; + $translations[] = 'AIProviders_Disconnecting'; + $translations[] = 'AIProviders_DisconnectSuccess'; $translations[] = 'AIProviders_EndpointUrl'; $translations[] = 'AIProviders_EndpointUrlPlaceholder'; $translations[] = 'AIProviders_GeminiDescription'; $translations[] = 'AIProviders_InstantCapability'; $translations[] = 'AIProviders_InstantCapabilityDescription'; $translations[] = 'AIProviders_MenuTitle'; + $translations[] = 'AIProviders_NoDefaultProviderWarning'; $translations[] = 'AIProviders_OpenAIDescription'; + $translations[] = 'AIProviders_RequestFailed'; $translations[] = 'AIProviders_SelectedConfiguration'; $translations[] = 'AIProviders_SettingsSaveSuccess'; $translations[] = 'AIProviders_StatusConnected'; $translations[] = 'AIProviders_StatusNotConnected'; $translations[] = 'AIProviders_TestConnection'; - $translations[] = 'AIProviders_TestConnectionNotAvailable'; + $translations[] = 'AIProviders_TestConnectionSuccess'; + $translations[] = 'AIProviders_TestingConnection'; $translations[] = 'AIProviders_ThinkingCapability'; $translations[] = 'AIProviders_ThinkingCapabilityDescription'; $translations[] = 'General_Cancel'; diff --git a/AIProvidersList.php b/AIProvidersList.php index e5484ac..ddd09ba 100644 --- a/AIProvidersList.php +++ b/AIProvidersList.php @@ -48,7 +48,7 @@ public function getProvider(string $providerId): ?AIProvider } /** - * @return AIProvider[] + * @return array */ public function getProviders(): array { diff --git a/API.php b/API.php index 733aeb7..e064c3a 100644 --- a/API.php +++ b/API.php @@ -19,9 +19,11 @@ namespace Piwik\Plugins\AIProviders; use Piwik\Container\StaticContainer; +use Piwik\Common; use Piwik\Piwik; use Piwik\Plugin\API as PluginAPI; use Piwik\Plugins\AIProviders\Model\Configuration; +use Piwik\Plugins\AIProviders\Provider\AIProvider; /** * Exposes AI provider configuration methods for the Matomo administration UI. @@ -47,13 +49,14 @@ public function getSettings(): array /** * Saves AI provider settings from the administration UI. * - * API keys are accepted only as POST data and are never returned by this API. - * On Matomo Cloud, provider credentials and capability level are ignored so - * only the default provider can be changed. + * API keys should be submitted as POST data and are never returned by this + * API. On Matomo Cloud, provider credentials and capability level are + * ignored so only the default provider can be changed. * * @param string $defaultProviderId Provider ID to use by default. * @param string $defaultCapabilityLevel Default model capability level. - * @param string $providerConfigurations JSON object keyed by provider ID with connection settings. + * @param string $providerConfigurations JSON object keyed by provider ID + * with connection settings. * @return array Updated provider metadata and masked configuration values. */ public function saveSettings( @@ -76,8 +79,88 @@ public function saveSettings( return $configuration->getSettings($providers); } + /** + * Tests one provider using the submitted connection settings. + * + * @param string $providerId Provider ID to test. + * @param string $providerConfiguration JSON object with unsaved apiKey + * and endpointUrl values. + * @return array Provider response metadata and completion text. + */ + public function testConnection( + string $providerId, + #[\SensitiveParameter] + string $providerConfiguration = '{}' + ): array { + Piwik::checkUserHasSuperUserAccess(); + + $providers = AIProviders::getAvailableProviders(); + $provider = $this->getProvider($providers->getProvider($providerId), $providerId); + $configuration = $this->getConfiguration()->getProviderConfigurationForUse( + $provider, + $this->decodeProviderConfiguration($providerConfiguration) + ); + + return $this->getAIProviderService() + ->completePromptWithProvider( + $provider, + $configuration, + 'why is the sky blue, answer in 7 words' + ) + ->toArray(); + } + + /** + * Removes a stored provider connection. + * + * @param string $providerId Provider ID to disconnect. + * @return array Updated provider metadata and masked configuration values. + */ + public function disconnectProvider(string $providerId): array + { + Piwik::checkUserHasSuperUserAccess(); + + $providers = AIProviders::getAvailableProviders(); + $this->getProvider($providers->getProvider($providerId), $providerId); + + $configuration = $this->getConfiguration(); + $configuration->removeProviderConfiguration($providerId); + + return $configuration->getSettings($providers); + } + private function getConfiguration(): Configuration { return StaticContainer::get(Configuration::class); } + + private function getAIProviderService(): AIProviderService + { + return StaticContainer::get(AIProviderService::class); + } + + private function getProvider(?AIProvider $provider, string $providerId): AIProvider + { + if ($provider === null) { + throw new \InvalidArgumentException(sprintf('Unknown AI provider "%s".', $providerId)); + } + + return $provider; + } + + /** + * @return array + */ + private function decodeProviderConfiguration( + #[\SensitiveParameter] + string $providerConfigurationJson + ): array { + $decoded = json_decode(Common::unsanitizeInputValue($providerConfigurationJson), true); + + if (!is_array($decoded)) { + throw new \InvalidArgumentException('Provider configuration must be a JSON object.'); + } + + return $decoded; + } } diff --git a/Controller.php b/Controller.php index 4902d7a..ee74c6c 100644 --- a/Controller.php +++ b/Controller.php @@ -23,9 +23,6 @@ class Controller extends ControllerAdmin { - /** - * @throws \Exception - */ public function index(): string { Piwik::checkUserHasSuperUserAccess(); diff --git a/Model/Configuration.php b/Model/Configuration.php index 4c18a80..772aba1 100644 --- a/Model/Configuration.php +++ b/Model/Configuration.php @@ -19,6 +19,7 @@ namespace Piwik\Plugins\AIProviders\Model; use InvalidArgumentException; +use Piwik\Common; use Piwik\Option; use Piwik\Plugin\Manager; use Piwik\Plugins\AIProviders\AIProvidersList; @@ -38,7 +39,14 @@ class Configuration /** * Returns masked AI provider settings for the administration UI. * - * @return array Provider metadata and masked configuration values. + * @return array{ + * defaultProviderId: string, + * defaultCapabilityLevel: string, + * canEditProviderConfiguration: bool, + * canEditCapabilityLevel: bool, + * capabilityLevels: array, + * providers: array> + * } Provider metadata and masked configuration values. */ public function getSettings(AIProvidersList $providers): array { @@ -57,6 +65,7 @@ public function getSettings(AIProvidersList $providers): array 'configuration' => [ 'hasApiKey' => !empty($providerConfiguration['apiKey']), 'endpointUrl' => $providerConfiguration['endpointUrl'] ?? '', + 'isUsable' => $this->isProviderConfiguredForUse($provider, $providerConfiguration), ], ]); }, $providers->getProviders()), @@ -76,20 +85,17 @@ public function saveSettings( #[\SensitiveParameter] string $providerConfigurationsJson ): void { - $this->saveDefaultProviderId($providers, $defaultProviderId); - - if (!$this->canEditCapabilityLevel()) { - return; + $providerConfigurations = $this->getProviderConfigurations(); + if ($this->canEditProviderConfiguration()) { + $submittedProviderConfigurations = $this->decodeProviderConfigurations($providerConfigurationsJson); + $providerConfigurations = $this->saveProviderConfigurations($providers, $submittedProviderConfigurations); } - $this->saveDefaultCapabilityLevel($defaultCapabilityLevel); + $this->saveDefaultProviderId($providers, $defaultProviderId, $providerConfigurations); - if (!$this->canEditProviderConfiguration()) { - return; + if ($this->canEditCapabilityLevel()) { + $this->saveDefaultCapabilityLevel($defaultCapabilityLevel); } - - $submittedProviderConfigurations = $this->decodeProviderConfigurations($providerConfigurationsJson); - $this->saveProviderConfigurations($providers, $submittedProviderConfigurations); } /** @@ -110,6 +116,49 @@ public function getProviderConfiguration(string $providerId): array ]; } + /** + * Returns a validated server-side provider configuration, optionally using + * unsaved values from the admin UI for connection testing. + * + * @param array $submittedProviderConfiguration + * @return array + */ + public function getProviderConfigurationForUse( + AIProvider $provider, + #[\SensitiveParameter] + array $submittedProviderConfiguration = [] + ): array { + $existingProviderConfigurations = $this->getProviderConfigurations(); + $providerId = $provider->getId(); + $submittedProviderConfiguration = array_merge( + $existingProviderConfigurations[$providerId] ?? [], + $submittedProviderConfiguration + ); + + return [ + 'apiKey' => $this->getSubmittedApiKey( + $submittedProviderConfiguration, + $existingProviderConfigurations, + $providerId + ), + 'endpointUrl' => $this->getSubmittedEndpointUrl($submittedProviderConfiguration, $provider), + ]; + } + + public function removeProviderConfiguration(string $providerId): void + { + $providerConfigurations = $this->getProviderConfigurations(); + unset($providerConfigurations[$providerId]); + + $encodedProviderConfigurations = json_encode($providerConfigurations); + + if (!is_string($encodedProviderConfigurations)) { + throw new InvalidArgumentException('Provider configurations could not be encoded.'); + } + + Option::set(self::OPTION_PROVIDER_CONFIGURATIONS, $encodedProviderConfigurations); + } + /** * @return array */ @@ -138,29 +187,69 @@ public function canEditCapabilityLevel(): bool } /** - * Returns the configured default provider ID, falling back to the first available provider. + * Returns the configured default provider ID, falling back to the first configured provider. */ public function getDefaultProviderId(AIProvidersList $providers): string { + $providerConfigurations = $this->getProviderConfigurations(); $providerId = Option::get(self::OPTION_DEFAULT_PROVIDER_ID); - if (!is_string($providerId) || !$providers->hasProvider($providerId)) { - return $providers->hasProvider(self::DEFAULT_PROVIDER_ID) - ? self::DEFAULT_PROVIDER_ID - : $this->getFirstProviderId($providers); + if ( + is_string($providerId) + && $providers->hasProvider($providerId) + && $this->isProviderConfiguredForUse( + $providers->getProvider($providerId), + $providerConfigurations[$providerId] ?? [] + ) + ) { + return $providerId; } - return $providerId; + if ( + $providers->hasProvider(self::DEFAULT_PROVIDER_ID) + && $this->isProviderConfiguredForUse( + $providers->getProvider(self::DEFAULT_PROVIDER_ID), + $providerConfigurations[self::DEFAULT_PROVIDER_ID] ?? [] + ) + ) { + return self::DEFAULT_PROVIDER_ID; + } + + return $this->getFirstConfiguredProviderId($providers, $providerConfigurations); } - private function saveDefaultProviderId(AIProvidersList $providers, string $providerId): void - { + /** + * @param array> $providerConfigurations + */ + private function saveDefaultProviderId( + AIProvidersList $providers, + string $providerId, + array $providerConfigurations + ): void { $providerId = trim($providerId); + if ($providerId === '') { + $providerId = $this->getFirstConfiguredProviderId($providers, $providerConfigurations); + + if ($providerId === '') { + Option::delete(self::OPTION_DEFAULT_PROVIDER_ID); + return; + } + } + if (!$providers->hasProvider($providerId)) { throw new InvalidArgumentException(sprintf('Unknown AI provider "%s".', $providerId)); } + if ( + !$this->isProviderConfiguredForUse( + $providers->getProvider($providerId), + $providerConfigurations[$providerId] ?? [] + ) + ) { + throw new InvalidArgumentException(sprintf('AI provider "%s" is not configured.', $providerId)); + } + Option::set(self::OPTION_DEFAULT_PROVIDER_ID, $providerId); } @@ -232,7 +321,7 @@ private function decodeProviderConfigurations( #[\SensitiveParameter] string $providerConfigurationsJson ): array { - $decoded = json_decode($providerConfigurationsJson, true); + $decoded = json_decode(Common::unsanitizeInputValue($providerConfigurationsJson), true); if (!is_array($decoded)) { throw new InvalidArgumentException('Provider configurations must be a JSON object.'); @@ -243,12 +332,13 @@ private function decodeProviderConfigurations( /** * @param array $submittedProviderConfigurations + * @return array> */ private function saveProviderConfigurations( AIProvidersList $providers, #[\SensitiveParameter] array $submittedProviderConfigurations - ): void { + ): array { $existingProviderConfigurations = $this->getProviderConfigurations(); $providerConfigurations = []; @@ -280,6 +370,8 @@ private function saveProviderConfigurations( } Option::set(self::OPTION_PROVIDER_CONFIGURATIONS, $encodedProviderConfigurations); + + return $providerConfigurations; } /** @@ -338,14 +430,31 @@ private function getSubmittedEndpointUrl(array $submittedProviderConfiguration, return $endpointUrl; } - private function getFirstProviderId(AIProvidersList $providers): string + /** + * @param array> $providerConfigurations + */ + private function getFirstConfiguredProviderId(AIProvidersList $providers, array $providerConfigurations): string { - $availableProviders = $providers->getProviders(); + foreach ($providers->getProviders() as $provider) { + $providerId = $provider->getId(); - if (empty($availableProviders)) { - throw new InvalidArgumentException('No AI providers are available.'); + if ($this->isProviderConfiguredForUse($provider, $providerConfigurations[$providerId] ?? [])) { + return $providerId; + } + } + + return ''; + } + + /** + * @param array $providerConfiguration + */ + private function isProviderConfiguredForUse(?AIProvider $provider, array $providerConfiguration): bool + { + if ($provider === null || empty($providerConfiguration['apiKey'])) { + return false; } - return $availableProviders[0]->getId(); + return !$provider->supportsCustomEndpoint() || !empty($providerConfiguration['endpointUrl']); } } diff --git a/Provider/AIProvider.php b/Provider/AIProvider.php index 43c14a0..f2e188f 100644 --- a/Provider/AIProvider.php +++ b/Provider/AIProvider.php @@ -18,13 +18,33 @@ namespace Piwik\Plugins\AIProviders\Provider; +use Exception; +use Piwik\Http; +use Piwik\Plugins\AIProviders\AIProviderException; + abstract class AIProvider { - // TODO: check if this is supported, because typed properties are only available above PHP 7.4 - private string $id; - private string $name; - private string $description; - private bool $supportsCustomEndpoint; + private const TRANSIENT_ERROR_RETRY_DELAYS = [1, 2]; + + /** + * @var string + */ + private $id; + + /** + * @var string + */ + private $name; + + /** + * @var string + */ + private $description; + + /** + * @var bool + */ + private $supportsCustomEndpoint; public function __construct( string $id, @@ -58,8 +78,34 @@ public function supportsCustomEndpoint(): bool return $this->supportsCustomEndpoint; } + public function getDefaultEndpointUrl(): string + { + return ''; + } + + public function getDefaultModel(): string + { + return ''; + } + /** - * @return array + * Completes the given prompt using the provider. + * + * @param array $configuration + */ + public function completePrompt(array $configuration, string $prompt): string + { + throw new AIProviderException(sprintf('%s does not support prompt completion.', $this->getName())); + } + + /** + * @return array{ + * id: string, + * name: string, + * description: string, + * supportsCustomEndpoint: bool, + * defaultModel: string + * } */ public function toArray(): array { @@ -68,6 +114,179 @@ public function toArray(): array 'name' => $this->getName(), 'description' => $this->getDescription(), 'supportsCustomEndpoint' => $this->supportsCustomEndpoint(), + 'defaultModel' => $this->getDefaultModel(), ]; } + + /** + * @param array $configuration + */ + protected function getApiKey(array $configuration): string + { + $apiKey = trim($configuration['apiKey'] ?? ''); + + if ($apiKey === '') { + throw new AIProviderException(sprintf('No API key is configured for %s.', $this->getName())); + } + + return $apiKey; + } + + /** + * @param array $configuration + */ + protected function getEndpointUrl(array $configuration): string + { + $endpointUrl = $this->supportsCustomEndpoint() + ? trim($configuration['endpointUrl'] ?? '') + : ''; + + if ($endpointUrl === '') { + $endpointUrl = $this->getDefaultEndpointUrl(); + } + + if ($endpointUrl === '') { + throw new AIProviderException(sprintf('No endpoint URL is configured for %s.', $this->getName())); + } + + $parsedUrl = parse_url($endpointUrl); + $scheme = is_array($parsedUrl) ? ($parsedUrl['scheme'] ?? '') : ''; + + if ( + !filter_var($endpointUrl, FILTER_VALIDATE_URL) + || !in_array($scheme, ['http', 'https'], true) + ) { + throw new AIProviderException(sprintf('The endpoint URL for %s is invalid.', $this->getName())); + } + + return $endpointUrl; + } + + /** + * Sends a JSON request to the provider and returns the decoded JSON object. + * + * @param array $headers + * @param array $payload + * @return array + */ + protected function sendJsonRequest(string $url, array $headers, array $payload): array + { + $requestBody = json_encode($payload); + + if (!is_string($requestBody)) { + throw new AIProviderException(sprintf('Could not encode request body for %s.', $this->getName())); + } + + $requestHeaders = ['Content-Type: application/json']; + foreach ($headers as $name => $value) { + $requestHeaders[] = $name . ': ' . $value; + } + + $retryDelays = self::TRANSIENT_ERROR_RETRY_DELAYS; + + for ($attempt = 0; $attempt <= count($retryDelays); $attempt++) { + try { + $response = Http::sendHttpRequestBy( + Http::getTransportMethod(), + $url, + 30, + null, + null, + null, + 0, + false, + false, + false, + true, + 'POST', + null, + null, + $requestBody, + $requestHeaders + ); + } catch (Exception $e) { + throw new AIProviderException(sprintf( + 'Could not connect to %s: %s', + $this->getName(), + $e->getMessage() + ), 0, $e); + } + + if (!is_array($response)) { + throw new AIProviderException(sprintf('%s returned an invalid response.', $this->getName())); + } + + $status = (int) ($response['status'] ?? 0); + $body = is_string($response['data'] ?? null) ? $response['data'] : ''; + $decoded = $body !== '' ? json_decode($body, true) : null; + + if ($status >= 200 && $status < 300) { + if (!is_array($decoded)) { + throw new AIProviderException(sprintf('%s returned invalid JSON.', $this->getName())); + } + + return $decoded; + } + + $providerError = $this->getProviderErrorMessage(is_array($decoded) ? $decoded : []); + + if ($this->isAuthenticationError($providerError)) { + throw new AIProviderException(sprintf( + '%s rejected the API key. Check the key and try again.', + $this->getName() + )); + } + + if ($this->shouldRetryTransientError($status, $attempt, $retryDelays)) { + sleep($retryDelays[$attempt]); + continue; + } + + $errorSuffix = $providerError !== '' ? ': ' . substr($providerError, 0, 300) : ''; + throw new AIProviderException(sprintf('%s request failed%s.', $this->getName(), $errorSuffix)); + } + + throw new AIProviderException(sprintf('%s request failed.', $this->getName())); + } + + /** + * @param array $response + */ + private function getProviderErrorMessage(array $response): string + { + $message = ''; + + if (isset($response['error']) && is_string($response['error'])) { + $message = $response['error']; + } elseif (isset($response['error']) && is_array($response['error'])) { + $error = $response['error']; + if (isset($error['message']) && is_string($error['message'])) { + $message = $error['message']; + } elseif (isset($error['type']) && is_string($error['type'])) { + $message = $error['type']; + } + } + + return $message; + } + + private function isAuthenticationError(string $message): bool + { + $message = strtolower($message); + + return strpos($message, 'api key') !== false + || strpos($message, 'x-api-key') !== false + || strpos($message, 'authentication') !== false + || strpos($message, 'unauthorized') !== false + || strpos($message, 'invalid key') !== false; + } + + /** + * @param int[] $retryDelays + */ + private function shouldRetryTransientError(int $status, int $attempt, array $retryDelays): bool + { + return in_array($status, [500, 503], true) + && array_key_exists($attempt, $retryDelays); + } } diff --git a/Provider/Claude.php b/Provider/Claude.php index b452fb2..2436918 100644 --- a/Provider/Claude.php +++ b/Provider/Claude.php @@ -20,8 +20,48 @@ class Claude extends AIProvider { + private const DEFAULT_MODEL = 'claude-haiku-4-5'; + public function __construct() { parent::__construct('claude', 'Claude', 'AIProviders_ClaudeDescription'); } + + public function getDefaultEndpointUrl(): string + { + return 'https://api.anthropic.com/v1/messages'; + } + + public function getDefaultModel(): string + { + return self::DEFAULT_MODEL; + } + + /** + * @param array $configuration + */ + public function completePrompt(array $configuration, string $prompt): string + { + $response = $this->sendJsonRequest( + $this->getEndpointUrl($configuration), + [ + 'anthropic-version' => '2023-06-01', + 'x-api-key' => $this->getApiKey($configuration), + ], + [ + 'model' => $this->getDefaultModel(), + 'max_tokens' => 80, + 'messages' => [ + [ + 'role' => 'user', + 'content' => $prompt, + ], + ], + ] + ); + + $text = $response['content'][0]['text'] ?? ''; + + return is_string($text) ? trim($text) : ''; + } } diff --git a/Provider/CustomProvider.php b/Provider/CustomProvider.php index 5fdf807..388d0d3 100644 --- a/Provider/CustomProvider.php +++ b/Provider/CustomProvider.php @@ -20,6 +20,8 @@ class CustomProvider extends AIProvider { + private const DEFAULT_MODEL = 'gpt-4.1-mini'; + public function __construct() { parent::__construct( @@ -29,4 +31,48 @@ public function __construct() true ); } + + public function getDefaultModel(): string + { + return self::DEFAULT_MODEL; + } + + /** + * @param array $configuration + */ + public function completePrompt(array $configuration, string $prompt): string + { + // TODO: Add a configurable model name for non-OpenAI compatible servers + // that do not expose an OpenAI model alias. + $response = $this->sendJsonRequest( + $this->getChatCompletionsEndpoint($this->getEndpointUrl($configuration)), + [ + 'Authorization' => 'Bearer ' . $this->getApiKey($configuration), + ], + [ + 'model' => $this->getDefaultModel(), + 'messages' => [ + [ + 'role' => 'user', + 'content' => $prompt, + ], + ], + 'max_tokens' => 80, + 'temperature' => 0.2, + ] + ); + + $text = $response['choices'][0]['message']['content'] ?? ''; + + return is_string($text) ? trim($text) : ''; + } + + private function getChatCompletionsEndpoint(string $endpointUrl): string + { + if (preg_match('#/chat/completions/?$#', $endpointUrl)) { + return $endpointUrl; + } + + return rtrim($endpointUrl, '/') . '/chat/completions'; + } } diff --git a/Provider/Gemini.php b/Provider/Gemini.php index 35bfb8f..46ad8dc 100644 --- a/Provider/Gemini.php +++ b/Provider/Gemini.php @@ -20,8 +20,55 @@ class Gemini extends AIProvider { + private const DEFAULT_MODEL = 'gemini-2.5-flash'; + public function __construct() { parent::__construct('gemini', 'Gemini', 'AIProviders_GeminiDescription'); } + + public function getDefaultEndpointUrl(): string + { + return sprintf( + 'https://generativelanguage.googleapis.com/v1beta/models/%s:generateContent', + $this->getDefaultModel() + ); + } + + public function getDefaultModel(): string + { + return self::DEFAULT_MODEL; + } + + /** + * @param array $configuration + */ + public function completePrompt(array $configuration, string $prompt): string + { + $response = $this->sendJsonRequest( + $this->getEndpointUrl($configuration), + [ + 'x-goog-api-key' => $this->getApiKey($configuration), + ], + [ + 'contents' => [ + [ + 'parts' => [ + [ + 'text' => $prompt, + ], + ], + ], + ], + 'generationConfig' => [ + 'maxOutputTokens' => 80, + 'temperature' => 0.2, + ], + ] + ); + + $text = $response['candidates'][0]['content']['parts'][0]['text'] ?? ''; + + return is_string($text) ? trim($text) : ''; + } } diff --git a/Provider/OpenAI.php b/Provider/OpenAI.php index 7b6eeab..f0425be 100644 --- a/Provider/OpenAI.php +++ b/Provider/OpenAI.php @@ -20,8 +20,48 @@ class OpenAI extends AIProvider { + private const DEFAULT_MODEL = 'gpt-4.1-mini'; + public function __construct() { parent::__construct('openai', 'OpenAI', 'AIProviders_OpenAIDescription'); } + + public function getDefaultEndpointUrl(): string + { + return 'https://api.openai.com/v1/chat/completions'; + } + + public function getDefaultModel(): string + { + return self::DEFAULT_MODEL; + } + + /** + * @param array $configuration + */ + public function completePrompt(array $configuration, string $prompt): string + { + $response = $this->sendJsonRequest( + $this->getEndpointUrl($configuration), + [ + 'Authorization' => 'Bearer ' . $this->getApiKey($configuration), + ], + [ + 'model' => $this->getDefaultModel(), + 'messages' => [ + [ + 'role' => 'user', + 'content' => $prompt, + ], + ], + 'max_tokens' => 80, + 'temperature' => 0.2, + ] + ); + + $text = $response['choices'][0]['message']['content'] ?? ''; + + return is_string($text) ? trim($text) : ''; + } } diff --git a/README.md b/README.md index 6a4ff71..25638b0 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,12 @@ $service = StaticContainer::get(AIProviderService::class); $provider = $service->getDefaultProvider(); $configuration = $service->getDefaultProviderConfiguration(); $capabilityLevel = $service->getDefaultCapabilityLevel(); +$response = $service->completePrompt('why is the sky blue, answer in 7 words'); +$text = $response->getText(); ``` `$configuration` may include secrets and must not be logged, returned from API methods, or rendered in browser output. + +For the current baseline, built-in provider clients use simple text prompts +and fixed low-latency default models. TODO: add configurable model names before +using OpenAI-compatible local gateways that require custom model IDs. diff --git a/lang/en.json b/lang/en.json index 82b54e9..5102e0e 100644 --- a/lang/en.json +++ b/lang/en.json @@ -1,33 +1,39 @@ { "AIProviders": { "ApiKey": "API key", - "ApiKeyAlreadyConfiguredPlaceholder": "Stored key kept. Enter a new key to replace it.", + "ApiKeyAlreadyConfiguredPlaceholder": "Enter a new key to replace the key.", "ApiKeyPlaceholder": "Enter your API key", "ClaudeDescription": "Anthropic Claude models.", "CloudConfigurationHelp": "Provider connections are managed by Matomo Cloud. You can only change the default provider.", "ConfigurationIntro": "Configure AI providers and default AI behavior in Matomo.", "CustomProviderDescription": "Use your own OpenAI compatible endpoint.", + "DefaultBadge": "Default", "DefaultCapabilityLevel": "Default capability level", "DefaultCapabilityLevelHelp": "Choose the default capability Matomo may use. Individual features can override this.", "DefaultProvider": "Default provider", - "DefaultProviderHelp": "Connect providers and pick a default for Matomo to use. Individual features can override it.", + "DefaultProviderHelp": "Connect providers and pick a default for Matomo to use. Individual features may override this and choose their preferred connected provider.", "DefaultsTitle": "Change provider settings and default values", "Disconnect": "Disconnect", - "DisconnectNotAvailable": "Disconnecting a stored key is not yet available. Save with an empty key to keep the existing one.", + "Disconnecting": "Disconnecting...", + "DisconnectSuccess": "AI provider disconnected.", "EndpointUrl": "API base URL", "EndpointUrlPlaceholder": "Enter your base URL", "GeminiDescription": "Google Gemini models.", "InstantCapability": "Instant", "InstantCapabilityDescription": "Fast and cost-effective for simple tasks.", "MenuTitle": "AI Providers", + "NoDefaultProviderWarning": "No AI provider can be set as the default yet. Connect a provider first.", "OpenAIDescription": "OpenAI models like GPT-5.5", "PluginDescription": "Configure AI provider connections and default model settings used by Matomo AI features.", + "RequestFailed": "AI provider request failed: %s", "SelectedConfiguration": "%1$s · %2$s", "SettingsSaveSuccess": "AI provider settings saved.", "StatusConnected": "Connected", "StatusNotConnected": "Not connected", "TestConnection": "Test connection", - "TestConnectionNotAvailable": "Connection testing is not yet available.", + "UnexpectedError": "Unexpected error. Please check the Matomo server logs.", + "TestConnectionSuccess": "%1$s connection works. Response: %2$s", + "TestingConnection": "Testing...", "ThinkingCapability": "Thinking", "ThinkingCapabilityDescription": "Better reasoning for complex tasks." } diff --git a/tests/Integration/ConfigurationTest.php b/tests/Integration/ConfigurationTest.php index e0c34a2..fec73e0 100644 --- a/tests/Integration/ConfigurationTest.php +++ b/tests/Integration/ConfigurationTest.php @@ -19,7 +19,9 @@ namespace Piwik\Plugins\AIProviders\tests\Integration; use Piwik\Container\StaticContainer; +use Piwik\Common; use Piwik\Option; +use Piwik\Piwik; use Piwik\Plugins\AIProviders\API; use Piwik\Plugins\AIProviders\AIProviderService; use Piwik\Plugins\AIProviders\Model\Configuration; @@ -57,7 +59,7 @@ public function testGetSettingsReturnsDefaultProviderConfiguration(): void { $settings = $this->api->getSettings(); - $this->assertSame('openai', $settings['defaultProviderId']); + $this->assertSame('', $settings['defaultProviderId']); $this->assertSame(Configuration::CAPABILITY_INSTANT, $settings['defaultCapabilityLevel']); $this->assertTrue($settings['canEditProviderConfiguration']); $this->assertTrue($settings['canEditCapabilityLevel']); @@ -86,10 +88,28 @@ public function testSaveSettingsStoresApiKeyWithoutReturningIt(): void $claude = $this->getProvider($settings, 'claude'); $this->assertTrue($claude['configuration']['hasApiKey']); + $this->assertTrue($claude['configuration']['isUsable']); $this->assertArrayNotHasKey('apiKey', $claude['configuration']); $this->assertStringNotContainsString('secret-claude-key', (string) json_encode($settings)); } + public function testSaveSettingsAcceptsSanitizedJsonFromApiRequests(): void + { + $settings = $this->api->saveSettings( + 'claude', + Configuration::CAPABILITY_THINKING, + Common::sanitizeInputValue((string) json_encode([ + 'claude' => [ + 'apiKey' => 'secret-claude-key', + 'endpointUrl' => '', + ], + ])) + ); + + $claude = $this->getProvider($settings, 'claude'); + $this->assertTrue($claude['configuration']['hasApiKey']); + } + public function testSaveSettingsPreservesExistingApiKeyWhenInputIsEmpty(): void { $this->api->saveSettings( @@ -104,7 +124,7 @@ public function testSaveSettingsPreservesExistingApiKeyWhenInputIsEmpty(): void ); $settings = $this->api->saveSettings( - 'openai', + 'claude', Configuration::CAPABILITY_INSTANT, (string) json_encode([ 'claude' => [ @@ -138,6 +158,136 @@ public function testServiceReturnsServerSideDefaultProviderConfiguration(): void $this->assertSame('secret-claude-key', $service->getDefaultProviderConfiguration()['apiKey']); } + public function testServiceCompletesPromptUsingConfiguredDefaultProvider(): void + { + $this->api->saveSettings( + 'openai', + Configuration::CAPABILITY_INSTANT, + (string) json_encode([ + 'openai' => [ + 'apiKey' => 'secret-openai-key', + 'endpointUrl' => '', + ], + ]) + ); + $this->mockAIProviderResponse('Because molecules scatter blue light more strongly.'); + + $response = StaticContainer::get(AIProviderService::class) + ->completePrompt('why is the sky blue, answer in 7 words'); + + $this->assertSame('openai', $response->toArray()['providerId']); + $this->assertSame('Because molecules scatter blue light more strongly.', $response->getText()); + } + + public function testApiTestsConnectionWithUnsavedProviderConfiguration(): void + { + $this->mockAIProviderResponse('Because molecules scatter blue light more strongly.'); + + $response = $this->api->testConnection( + 'openai', + Common::sanitizeInputValue((string) json_encode([ + 'apiKey' => 'secret-openai-key', + 'endpointUrl' => '', + ])) + ); + + $this->assertSame('openai', $response['providerId']); + $this->assertSame('Because molecules scatter blue light more strongly.', $response['text']); + } + + public function testApiRetriesTransientProviderErrors(): void + { + $requests = 0; + Piwik::addAction('Http.sendHttpRequest', function ( + string $url, + array $httpEventParams, + ?string &$response, + ?int &$status, + array &$headers + ) use (&$requests): void { + $this->assertSame( + 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent', + $url + ); + $this->assertSame('POST', $httpEventParams['httpMethod']); + + $requests++; + + if ($requests === 1) { + $response = (string) json_encode([ + 'error' => [ + 'code' => 503, + 'message' => 'This model is currently experiencing high demand.', + 'status' => 'UNAVAILABLE', + ], + ]); + $status = 503; + $headers = ['Content-Type' => 'application/json']; + return; + } + + $response = (string) json_encode([ + 'candidates' => [ + [ + 'content' => [ + 'parts' => [ + [ + 'text' => 'Because molecules scatter blue light more strongly.', + ], + ], + ], + ], + ], + ]); + $status = 200; + $headers = ['Content-Type' => 'application/json']; + }); + + $response = $this->api->testConnection( + 'gemini', + Common::sanitizeInputValue((string) json_encode([ + 'apiKey' => 'secret-gemini-key', + 'endpointUrl' => '', + ])) + ); + + $this->assertSame(2, $requests); + $this->assertSame('gemini', $response['providerId']); + $this->assertSame('Because molecules scatter blue light more strongly.', $response['text']); + } + + public function testDisconnectProviderRemovesStoredApiKey(): void + { + $this->api->saveSettings( + 'openai', + Configuration::CAPABILITY_INSTANT, + (string) json_encode([ + 'openai' => [ + 'apiKey' => 'secret-openai-key', + 'endpointUrl' => '', + ], + ]) + ); + + $settings = $this->api->disconnectProvider('openai'); + $openAI = $this->getProvider($settings, 'openai'); + + $this->assertSame('', $settings['defaultProviderId']); + $this->assertFalse($openAI['configuration']['hasApiKey']); + } + + public function testSaveSettingsRejectsUnconfiguredDefaultProvider(): void + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('AI provider "openai" is not configured.'); + + $this->api->saveSettings( + 'openai', + Configuration::CAPABILITY_INSTANT, + '{}' + ); + } + public function testSaveSettingsRejectsUnknownProvider(): void { $this->expectException(\InvalidArgumentException::class); @@ -185,6 +335,32 @@ private function setAnonymousUser(): void FakeAccess::$identity = 'anonymous'; } + private function mockAIProviderResponse(string $text): void + { + Piwik::addAction('Http.sendHttpRequest', function ( + string $url, + array $httpEventParams, + ?string &$response, + ?int &$status, + array &$headers + ) use ($text): void { + $this->assertSame('https://api.openai.com/v1/chat/completions', $url); + $this->assertSame('POST', $httpEventParams['httpMethod']); + + $response = (string) json_encode([ + 'choices' => [ + [ + 'message' => [ + 'content' => $text, + ], + ], + ], + ]); + $status = 200; + $headers = ['Content-Type' => 'application/json']; + }); + } + public function provideContainerConfig(): array { return [ diff --git a/vue/dist/AIProviders.css b/vue/dist/AIProviders.css index a7b537a..02b4641 100644 --- a/vue/dist/AIProviders.css +++ b/vue/dist/AIProviders.css @@ -1 +1 @@ -.ai-providers-card{display:flex;flex-direction:column;padding:16px;background:var(--theme-color-background-contrast,#fff);border:1px solid var(--ai-providers-border);border-radius:6px;cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.ai-providers-card:hover{border-color:var(--ai-providers-border-strong)}.ai-providers-card.is-selected{border-color:var(--ai-providers-accent);box-shadow:0 0 0 1px var(--ai-providers-accent) inset}.ai-providers-card .form-group{margin-bottom:12px;border:0}.ai-providers-card .input-field{margin-top:0;margin-bottom:0}.ai-providers-card .matomo-form-field{border:0;margin-left:0;margin-right:0;margin-top:30px}.ai-providers-card .matomo-form-field>.col{padding-left:0!important;padding-right:0!important}.ai-providers-card .input-field.col>label,.ai-providers-card .input-field>label{left:0!important}.ai-providers-card .input-field>input{padding-left:0;margin-left:0;width:100%;box-sizing:border-box}.ai-providers-card-header{margin-bottom:8px}.ai-providers-card-name{color:var(--ai-providers-heading);font-weight:600;font-size:15px}.ai-providers-card-description{margin:0 0 16px}.ai-providers-card-description,.ai-providers-card-status{color:var(--ai-providers-text-muted);font-size:13px;line-height:1.5}.ai-providers-card-status{display:flex;align-items:center;gap:8px;margin:4px 0 0}.ai-providers-card-status.is-connected,.ai-providers-card-status.is-connected .ai-providers-status-icon{color:var(--ai-providers-accent)}.ai-providers-status-icon{font-size:14px;line-height:1;color:var(--ai-providers-border-strong);flex:none}.ai-providers-card-actions{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:12px;margin-top:auto;padding-top:16px}.ai-providers-card-actions .btn,.ai-providers-card-actions .btn-flat{white-space:nowrap}.ai-providers-card-actions .btn-flat[disabled]{pointer-events:none;cursor:not-allowed;color:var(--theme-color-text-on-disabled)}.ai-providers-page{--ai-providers-border:var(--theme-color-border-light,#e0e0e0);--ai-providers-border-strong:var(--theme-color-border,#ccc);--ai-providers-accent:var(--theme-color-brand,#43a047);--ai-providers-text-muted:var(--theme-color-text-light,#666);--ai-providers-heading:var(--theme-color-headline-alternative,#333)}.ai-providers-page h2,.ai-providers-page h3,.ai-providers-page h4{color:var(--ai-providers-heading);margin:0;padding:0}.ai-providers-page-header{margin-bottom:24px}.ai-providers-page-title{font-size:22px;line-height:1.3}.ai-providers-page-subtitle{color:var(--ai-providers-text-muted);font-size:14px;line-height:1.5;margin:4px 0 0}.ai-providers-selected-configuration{display:inline-block;margin-top:8px;height:24px;padding:0 10px;border-radius:12px;background-color:#e4e4e4;color:rgba(0,0,0,.6);line-height:24px;font-size:12px;font-weight:500}.ai-providers-defaults-title{font-size:18px;line-height:1.4;margin-bottom:24px!important}.ai-providers-subsection-title{font-size:15px;font-weight:600;line-height:1.4}.ai-providers-section+.ai-providers-section{margin-top:24px;padding-top:24px;border-top:1px solid var(--ai-providers-border)}.ai-providers-section-help{color:var(--ai-providers-text-muted);margin:4px 0 16px}.ai-providers-capability-cards,.ai-providers-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}.ai-providers-capability-card{display:flex;flex-direction:column;padding:16px;background:var(--theme-color-background-contrast,#fff);border:1px solid var(--ai-providers-border);border-radius:6px;cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.ai-providers-capability-card:hover{border-color:var(--ai-providers-border-strong)}.ai-providers-capability-card.is-selected{border-color:var(--ai-providers-accent);box-shadow:0 0 0 1px var(--ai-providers-accent) inset;background:var(--theme-color-background-tinyContrast,#f7f7f7)}.ai-providers-capability-header{margin-bottom:8px}.ai-providers-capability-label{color:var(--ai-providers-heading);font-weight:600;font-size:15px}.ai-providers-capability-description,.ai-providers-capability-footnote{color:var(--ai-providers-text-muted);font-size:13px;line-height:1.5}.ai-providers-footer{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:12px;margin-top:24px} \ No newline at end of file +.ai-providers-card{position:relative;display:flex;flex-direction:column;overflow:hidden;background:var(--theme-color-background-contrast,#fff);border:1px solid var(--ai-providers-border);border-radius:8px;cursor:pointer;transition:border-color .12s ease}.ai-providers-card:hover:not(.is-not-usable):not(.is-selected){border-color:var(--ai-providers-border-strong)}.ai-providers-card.is-selected{background:var(--ai-providers-accent);border-color:var(--ai-providers-accent);margin-top:-24px}.ai-providers-card.is-not-usable{cursor:default}.ai-providers-card:active,.ai-providers-card:focus,.ai-providers-card:focus-visible{outline:none;box-shadow:none}.ai-providers-card .form-group{margin-bottom:12px;border:0}.ai-providers-card .input-field{margin-top:0;margin-bottom:0}.ai-providers-card .matomo-form-field{border:0;margin-left:0;margin-right:0;margin-top:32px}.ai-providers-card .matomo-form-field>.col{padding-left:0!important;padding-right:0!important}.ai-providers-card .input-field.col>label,.ai-providers-card .input-field>label{left:0!important}.ai-providers-card .input-field>input{padding-left:0;margin-left:0;width:100%;box-sizing:border-box}.ai-providers-card-inner{display:flex;flex-direction:column;flex:1;padding:16px}.ai-providers-card.is-selected .ai-providers-card-inner{background:var(--theme-color-background-contrast,#fff);border-radius:8px 8px 6px 6px;margin:0 1px 1px}.ai-providers-card-default{min-height:24px;padding:5px 12px;background-color:var(--ai-providers-accent);color:#fff;font-size:10px;font-weight:700;line-height:1.2;text-transform:uppercase}.ai-providers-card-header{display:flex;align-items:center;gap:12px;margin-bottom:8px}.ai-providers-card-name{color:var(--ai-providers-heading);font-weight:600;font-size:15px}.ai-providers-card-description{margin:0 0 16px}.ai-providers-card-description,.ai-providers-card-status{color:var(--ai-providers-text-muted);font-size:13px;line-height:1.5}.ai-providers-card-status{display:flex;align-items:center;gap:8px;margin:4px 0 0}.ai-providers-card-status.is-connected,.ai-providers-card-status.is-connected .ai-providers-status-icon{color:var(--ai-providers-accent)}.ai-providers-status-icon{font-size:14px;line-height:1;color:var(--ai-providers-border-strong);flex:none}.ai-providers-card-actions{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:12px;margin-top:auto;padding-top:16px}.ai-providers-card-actions .btn,.ai-providers-card-actions .btn-flat{white-space:nowrap}.ai-providers-card-actions .btn-flat[disabled]{pointer-events:none;cursor:not-allowed;color:var(--theme-color-text-on-disabled)}.ai-providers-page{--ai-providers-border:var(--theme-color-border-light,#e0e0e0);--ai-providers-border-strong:var(--theme-color-border,#ccc);--ai-providers-accent:var(--theme-color-brand,#43a047);--ai-providers-text-muted:var(--theme-color-text-light,#666);--ai-providers-heading:var(--theme-color-headline-alternative,#333)}.ai-providers-page h2,.ai-providers-page h3,.ai-providers-page h4{color:var(--ai-providers-heading);margin:0;padding:0}.ai-providers-page-header{margin-bottom:24px}.ai-providers-page-title{font-size:22px;line-height:1.3}.ai-providers-page-subtitle{color:var(--ai-providers-text-muted);font-size:14px;line-height:1.5;margin:4px 0 0}.ai-providers-selected-configuration{display:inline-block;margin-top:8px;height:24px;padding:0 10px;border-radius:12px;background-color:#e4e4e4;color:rgba(0,0,0,.6);line-height:24px;font-size:12px;font-weight:500}.ai-providers-defaults-title{font-size:18px;line-height:1.4;margin-bottom:24px!important}.ai-providers-subsection-title{font-size:15px;font-weight:600;line-height:1.4}.ai-providers-section+.ai-providers-section{margin-top:24px;padding-top:24px;border-top:1px solid #ccc}.ai-providers-section-help{color:var(--ai-providers-text-muted);margin:4px 0 16px}.ai-providers-capability-cards,.ai-providers-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}.ai-providers-cards{padding-top:24px;margin-top:32px}.ai-providers-default-warning{margin-top:16px}.ai-providers-capability-card{display:flex;flex-direction:column;padding:16px;background:var(--theme-color-background-contrast,#fff);border:1px solid var(--ai-providers-border);border-radius:6px;cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.ai-providers-capability-card:hover{border-color:var(--ai-providers-border-strong)}.ai-providers-capability-card.is-selected{border-color:var(--ai-providers-accent);box-shadow:0 0 0 1px var(--ai-providers-accent) inset;background:var(--theme-color-background-tinyContrast,#f7f7f7)}.ai-providers-capability-header{margin-bottom:8px}.ai-providers-capability-label{color:var(--ai-providers-heading);font-weight:600;font-size:15px}.ai-providers-capability-description{color:var(--ai-providers-text-muted);font-size:13px;line-height:1.5}.ai-providers-footer{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:12px;margin-top:24px} \ No newline at end of file diff --git a/vue/dist/AIProviders.umd.js b/vue/dist/AIProviders.umd.js index 535e290..48b3534 100644 --- a/vue/dist/AIProviders.umd.js +++ b/vue/dist/AIProviders.umd.js @@ -96,12 +96,12 @@ return /******/ (function(modules) { // webpackBootstrap /************************************************************************/ /******/ ({ -/***/ "1047": +/***/ "00fb": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ManageAIProviders_vue_vue_type_style_index_0_id_6e2e3ad5_lang_less__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("86b3"); -/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ManageAIProviders_vue_vue_type_style_index_0_id_6e2e3ad5_lang_less__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ManageAIProviders_vue_vue_type_style_index_0_id_6e2e3ad5_lang_less__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ManageAIProviders_vue_vue_type_style_index_0_id_3339ef54_lang_less__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2d6a"); +/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ManageAIProviders_vue_vue_type_style_index_0_id_3339ef54_lang_less__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ManageAIProviders_vue_vue_type_style_index_0_id_3339ef54_lang_less__WEBPACK_IMPORTED_MODULE_0__); /* unused harmony reexport * */ @@ -114,17 +114,21 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__; /***/ }), -/***/ "1f8b": +/***/ "2d6a": /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), -/***/ "86b3": -/***/ (function(module, exports, __webpack_require__) { +/***/ "6efa": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ProviderCard_vue_vue_type_style_index_0_id_00c4b20e_lang_less__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a23f"); +/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ProviderCard_vue_vue_type_style_index_0_id_00c4b20e_lang_less__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ProviderCard_vue_vue_type_style_index_0_id_00c4b20e_lang_less__WEBPACK_IMPORTED_MODULE_0__); +/* unused harmony reexport * */ -// extracted by mini-css-extract-plugin /***/ }), @@ -135,6 +139,13 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__; /***/ }), +/***/ "a23f": +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + +/***/ }), + /***/ "a5a2": /***/ (function(module, exports) { @@ -180,21 +191,28 @@ var external_CorePluginsAdmin_ = __webpack_require__("a5a2"); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--15-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./plugins/AIProviders/vue/src/components/ProviderCard.vue?vue&type=script&lang=ts&setup=true -const _hoisted_1 = { - class: "ai-providers-card-header" +const _hoisted_1 = ["aria-checked", "aria-disabled", "tabindex"]; +const _hoisted_2 = { + key: 0, + class: "ai-providers-card-default" }; -const _hoisted_2 = ["checked", "value"]; const _hoisted_3 = { - class: "ai-providers-card-name" + class: "ai-providers-card-inner" }; const _hoisted_4 = { - class: "ai-providers-card-description" + class: "ai-providers-card-header" }; const _hoisted_5 = { + class: "ai-providers-card-name" +}; +const _hoisted_6 = { + class: "ai-providers-card-description" +}; +const _hoisted_7 = { class: "ai-providers-card-actions" }; -const _hoisted_6 = ["disabled"]; -const _hoisted_7 = ["disabled"]; +const _hoisted_8 = ["disabled"]; +const _hoisted_9 = ["disabled"]; @@ -206,8 +224,17 @@ const _hoisted_7 = ["disabled"]; selected: { type: Boolean }, + usableAsDefault: { + type: Boolean + }, canEdit: { type: Boolean + }, + isTesting: { + type: Boolean + }, + isDisconnecting: { + type: Boolean } }, emits: ["select", "update:apiKey", "update:endpointUrl", "test", "disconnect"], @@ -221,19 +248,25 @@ const _hoisted_7 = ["disabled"]; var _props$configuration$, _props$configuration; return ((_props$configuration$ = (_props$configuration = props.configuration) === null || _props$configuration === void 0 ? void 0 : _props$configuration.apiKey) !== null && _props$configuration$ !== void 0 ? _props$configuration$ : '') !== ''; }); + function selectProvider() { + if (props.usableAsDefault) { + emit('select'); + } + } return (_ctx, _cache) => { var _props$configuration2, _props$configuration3; - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("label", { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + "aria-checked": __props.selected, + "aria-disabled": !__props.usableAsDefault, class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])([{ - 'is-selected': __props.selected - }, "ai-providers-card"]) - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - checked: __props.selected, - value: __props.provider.id, - name: "defaultProviderId", - type: "radio", - onChange: _cache[0] || (_cache[0] = $event => emit('select')) - }, null, 40, _hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(__props.provider.name), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])(__props.provider.description)), 1), __props.canEdit ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], { + 'is-selected': __props.selected, + 'is-not-usable': !__props.usableAsDefault + }, "ai-providers-card"]), + role: "radio", + tabindex: __props.usableAsDefault ? 0 : -1, + onClick: _cache[4] || (_cache[4] = $event => selectProvider()), + onKeydown: [_cache[5] || (_cache[5] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withKeys"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])($event => selectProvider(), ["prevent"]), ["enter"])), _cache[6] || (_cache[6] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withKeys"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])($event => selectProvider(), ["prevent"]), ["space"]))] + }, [__props.selected ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultBadge')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(__props.provider.name), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])(__props.provider.description)), 1), __props.canEdit ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], { key: 0 }, [__props.provider.supportsCustomEndpoint ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Field"]), { key: 0, @@ -244,7 +277,7 @@ const _hoisted_7 = ["disabled"]; autocomplete: "off", "full-width": "", uicontrol: "text", - "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => emit('update:endpointUrl', `${$event}`)) + "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => emit('update:endpointUrl', `${$event}`)) }, null, 8, ["model-value", "name", "title", "placeholder"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Field"]), { "model-value": (_props$configuration3 = __props.configuration) === null || _props$configuration3 === void 0 ? void 0 : _props$configuration3.apiKey, name: `apiKey-${__props.provider.id}`, @@ -253,32 +286,32 @@ const _hoisted_7 = ["disabled"]; autocomplete: "new-password", "full-width": "", uicontrol: "password", - "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => emit('update:apiKey', `${$event}`)) + "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => emit('update:apiKey', `${$event}`)) }, null, 8, ["model-value", "name", "placeholder", "title"]), [[Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["AutoClearPassword"])]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])([{ - 'is-connected': __props.provider.configuration.hasApiKey + 'is-connected': __props.provider.configuration.isUsable }, "ai-providers-card-status"]) }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { "aria-hidden": "true", - class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["icon ai-providers-status-icon", __props.provider.configuration.hasApiKey ? 'icon-ok' : 'icon-minus']) - }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(__props.provider.configuration.hasApiKey ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_StatusConnected') : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_StatusNotConnected')), 1)], 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { - class: "btn btn-outline btn-small", + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["icon ai-providers-status-icon", __props.provider.configuration.isUsable ? 'icon-ok' : 'icon-minus']) + }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(__props.provider.configuration.isUsable ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_StatusConnected') : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_StatusNotConnected')), 1)], 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { + class: "btn btn-small", type: "button", - disabled: !Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(hasPendingKey) && !__props.provider.configuration.hasApiKey, - onClick: _cache[3] || (_cache[3] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])($event => emit('test'), ["prevent"])) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_TestConnection')), 9, _hoisted_6), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { + disabled: __props.isTesting || !Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(hasPendingKey) && !__props.provider.configuration.hasApiKey, + onClick: _cache[2] || (_cache[2] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])($event => emit('test'), ["prevent", "stop"])) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(__props.isTesting ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_TestingConnection') : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_TestConnection')), 9, _hoisted_8), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { class: "btn-flat", type: "button", - disabled: !__props.provider.configuration.hasApiKey, - onClick: _cache[4] || (_cache[4] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])($event => emit('disconnect'), ["prevent"])) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_Disconnect')), 9, _hoisted_7)])], 64)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2); + disabled: __props.isDisconnecting || !__props.provider.configuration.hasApiKey, + onClick: _cache[3] || (_cache[3] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])($event => emit('disconnect'), ["prevent", "stop"])) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(__props.isDisconnecting ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_Disconnecting') : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_Disconnect')), 9, _hoisted_9)])], 64)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 42, _hoisted_1); }; } })); // CONCATENATED MODULE: ./plugins/AIProviders/vue/src/components/ProviderCard.vue?vue&type=script&lang=ts&setup=true -// EXTERNAL MODULE: ./plugins/AIProviders/vue/src/components/ProviderCard.vue?vue&type=style&index=0&id=3702360d&lang=less -var ProviderCardvue_type_style_index_0_id_3702360d_lang_less = __webpack_require__("fd04"); +// EXTERNAL MODULE: ./plugins/AIProviders/vue/src/components/ProviderCard.vue?vue&type=style&index=0&id=00c4b20e&lang=less +var ProviderCardvue_type_style_index_0_id_00c4b20e_lang_less = __webpack_require__("6efa"); // CONCATENATED MODULE: ./plugins/AIProviders/vue/src/components/ProviderCard.vue @@ -312,10 +345,10 @@ const ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_6 = { const ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_7 = { class: "ai-providers-defaults-title" }; -const _hoisted_8 = { +const ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_8 = { class: "ai-providers-section" }; -const _hoisted_9 = { +const ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_9 = { class: "ai-providers-subsection-title" }; const _hoisted_10 = { @@ -344,14 +377,11 @@ const _hoisted_19 = { key: 0, class: "ai-providers-capability-description" }; -const _hoisted_20 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", { - class: "ai-providers-capability-footnote" -}, null, -1); -const _hoisted_21 = { +const _hoisted_20 = { key: 2, class: "ai-providers-footer" }; -const _hoisted_22 = ["disabled"]; +const _hoisted_21 = ["disabled"]; @@ -365,10 +395,13 @@ const _hoisted_22 = ["disabled"]; const defaultProviderId = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(''); const defaultCapabilityLevel = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(''); const providerConfigurations = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])({}); + const testingProviders = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])({}); + const disconnectingProviders = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])({}); const providers = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => { var _settings$value; return ((_settings$value = settings.value) === null || _settings$value === void 0 ? void 0 : _settings$value.providers) || []; }); + const hasUsableProvider = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => providers.value.some(provider => provider.configuration.isUsable)); const canEditCapabilityLevel = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => { var _settings$value2; return !!((_settings$value2 = settings.value) !== null && _settings$value2 !== void 0 && _settings$value2.canEditCapabilityLevel); @@ -411,13 +444,52 @@ const _hoisted_22 = ["disabled"]; }); providerConfigurations.value = nextProviderConfigurations; } + function markProviderUsable(providerId) { + if (!settings.value) { + return; + } + const provider = settings.value.providers.find(p => p.id === providerId); + if (provider) { + provider.configuration = Object.assign(Object.assign({}, provider.configuration), {}, { + hasApiKey: true, + isUsable: true + }); + } + if (!defaultProviderId.value) { + defaultProviderId.value = providerId; + } + } + function getCleanErrorMessage(error) { + let message = ''; + if (error && typeof error === 'object' && 'message' in error) { + message = `${error.message}`; + } else { + message = `${error}`; + } + return message.replace(/\s*#\d+\s+[\s\S]*$/, '').replace(/\s+/g, ' ').trim(); + } + function showErrorNotification(error, id) { + const cleaned = getCleanErrorMessage(error); + const isUseful = cleaned && cleaned !== 'Something went wrong'; + const message = isUseful ? Object(external_CoreHome_["translate"])('AIProviders_RequestFailed', cleaned) : Object(external_CoreHome_["translate"])('AIProviders_UnexpectedError'); + return external_CoreHome_["NotificationsStore"].show({ + message, + type: 'transient', + id, + context: 'error' + }); + } async function loadSettings() { isLoading.value = true; try { const response = await external_CoreHome_["AjaxHelper"].fetch({ method: 'AIProviders.getSettings' + }, { + createErrorNotification: false }); applySettings(response); + } catch (error) { + showErrorNotification(error, 'aiProvidersLoadError'); } finally { isLoading.value = false; } @@ -432,27 +504,54 @@ const _hoisted_22 = ["disabled"]; endpointUrl }); } - function disconnectProvider(providerId) { - // PoC: clears the locally entered key. Removing a persisted key requires a - // backend method that isn't wired up yet. - providerConfigurations.value[providerId] = Object.assign(Object.assign({}, providerConfigurations.value[providerId]), {}, { - apiKey: '' - }); - external_CoreHome_["NotificationsStore"].show({ - message: Object(external_CoreHome_["translate"])('AIProviders_DisconnectNotAvailable'), - type: 'transient', - id: `aiProvidersDisconnect-${providerId}`, - context: 'info' - }); + async function disconnectProvider(providerId) { + disconnectingProviders.value[providerId] = true; + try { + const response = await external_CoreHome_["AjaxHelper"].post({ + method: 'AIProviders.disconnectProvider' + }, { + providerId + }, { + withTokenInUrl: true, + createErrorNotification: false + }); + applySettings(response); + external_CoreHome_["NotificationsStore"].show({ + message: Object(external_CoreHome_["translate"])('AIProviders_DisconnectSuccess'), + type: 'transient', + id: `aiProvidersDisconnect-${providerId}`, + context: 'success' + }); + } catch (error) { + showErrorNotification(error, `aiProvidersDisconnectError-${providerId}`); + } finally { + disconnectingProviders.value[providerId] = false; + } } - function testConnection(providerId) { - // PoC: placeholder until a server-side connection test endpoint exists. - external_CoreHome_["NotificationsStore"].show({ - message: Object(external_CoreHome_["translate"])('AIProviders_TestConnectionNotAvailable'), - type: 'transient', - id: `aiProvidersTest-${providerId}`, - context: 'info' - }); + async function testConnection(providerId) { + testingProviders.value[providerId] = true; + try { + const response = await external_CoreHome_["AjaxHelper"].post({ + method: 'AIProviders.testConnection' + }, { + providerId, + providerConfiguration: JSON.stringify(providerConfigurations.value[providerId] || {}) + }, { + withTokenInUrl: true, + createErrorNotification: false + }); + markProviderUsable(providerId); + external_CoreHome_["NotificationsStore"].show({ + message: Object(external_CoreHome_["translate"])('AIProviders_TestConnectionSuccess', response.providerName, response.text), + type: 'transient', + id: `aiProvidersTest-${providerId}`, + context: 'success' + }); + } catch (error) { + showErrorNotification(error, `aiProvidersTestError-${providerId}`); + } finally { + testingProviders.value[providerId] = false; + } } function cancelChanges() { if (settings.value) { @@ -472,7 +571,8 @@ const _hoisted_22 = ["disabled"]; defaultCapabilityLevel: defaultCapabilityLevel.value, providerConfigurations: JSON.stringify(providerConfigurations.value) }, { - withTokenInUrl: true + withTokenInUrl: true, + createErrorNotification: false }); applySettings(response); const notificationInstanceId = external_CoreHome_["NotificationsStore"].show({ @@ -482,6 +582,9 @@ const _hoisted_22 = ["disabled"]; context: 'success' }); external_CoreHome_["NotificationsStore"].scrollToNotification(notificationInstanceId); + } catch (error) { + const notificationInstanceId = showErrorNotification(error, 'aiProvidersSettingsError'); + external_CoreHome_["NotificationsStore"].scrollToNotification(notificationInstanceId); } finally { isSaving.value = false; } @@ -500,7 +603,7 @@ const _hoisted_22 = ["disabled"]; }, { default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_CloudConfigurationHelp')), 1)]), _: 1 - })) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultsTitle')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("section", _hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", _hoisted_9, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultProvider')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultProviderHelp')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + })) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultsTitle')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("section", ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", ManageAIProvidersvue_type_script_lang_ts_setup_true_hoisted_9, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultProvider')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultProviderHelp')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { "aria-label": Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultProvider'), class: "ai-providers-cards", role: "radiogroup" @@ -509,15 +612,25 @@ const _hoisted_22 = ["disabled"]; key: provider.id, "can-edit": Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(canEditProviderConfiguration), configuration: providerConfigurations.value[provider.id], + "is-disconnecting": !!disconnectingProviders.value[provider.id], + "is-testing": !!testingProviders.value[provider.id], provider: provider, selected: defaultProviderId.value === provider.id, + "usable-as-default": provider.configuration.isUsable, onDisconnect: $event => disconnectProvider(provider.id), - onSelect: $event => defaultProviderId.value = provider.id, + onSelect: $event => provider.configuration.isUsable ? defaultProviderId.value = provider.id : null, onTest: $event => testConnection(provider.id), "onUpdate:apiKey": $event => updateApiKey(provider.id, $event), "onUpdate:endpointUrl": $event => updateEndpointUrl(provider.id, $event) - }, null, 8, ["can-edit", "configuration", "provider", "selected", "onDisconnect", "onSelect", "onTest", "onUpdate:apiKey", "onUpdate:endpointUrl"]); - }), 128))], 8, _hoisted_11)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(canEditCapabilityLevel) ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("section", _hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", _hoisted_13, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultCapabilityLevel')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultCapabilityLevelHelp')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + }, null, 8, ["can-edit", "configuration", "is-disconnecting", "is-testing", "provider", "selected", "usable-as-default", "onDisconnect", "onSelect", "onTest", "onUpdate:apiKey", "onUpdate:endpointUrl"]); + }), 128))], 8, _hoisted_11), !Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(hasUsableProvider) ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["Alert"]), { + key: 0, + class: "ai-providers-default-warning", + severity: "warning" + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_NoDefaultProviderWarning')), 1)]), + _: 1 + })) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(canEditCapabilityLevel) ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("section", _hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", _hoisted_13, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultCapabilityLevel')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultCapabilityLevelHelp')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { "aria-label": Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('AIProviders_DefaultCapabilityLevel'), class: "ai-providers-capability-cards", role: "radiogroup" @@ -533,14 +646,14 @@ const _hoisted_22 = ["disabled"]; name: "defaultCapabilityLevel", type: "radio" }, null, 8, _hoisted_17), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelRadio"], defaultCapabilityLevel.value]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_18, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(capability.label), 1)]), capability.description ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_19, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(capability.description), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2); - }), 128))], 8, _hoisted_15), _hoisted_20])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])), [[Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Form"])]])]), + }), 128))], 8, _hoisted_15)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])), [[Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["Form"])]])]), _: 1 - })) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), settings.value ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_21, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { + })) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), settings.value ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_20, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { disabled: isSaving.value, class: "btn btn-outline", type: "button", onClick: _cache[1] || (_cache[1] = $event => cancelChanges()) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('General_Cancel')), 9, _hoisted_22), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["SaveButton"]), { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CoreHome_["translate"])('General_Cancel')), 9, _hoisted_21), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["unref"])(external_CorePluginsAdmin_["SaveButton"]), { saving: isSaving.value, onConfirm: _cache[2] || (_cache[2] = $event => saveSettings()) }, null, 8, ["saving"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]); @@ -549,8 +662,8 @@ const _hoisted_22 = ["disabled"]; })); // CONCATENATED MODULE: ./plugins/AIProviders/vue/src/ManageAIProviders.vue?vue&type=script&lang=ts&setup=true -// EXTERNAL MODULE: ./plugins/AIProviders/vue/src/ManageAIProviders.vue?vue&type=style&index=0&id=6e2e3ad5&lang=less -var ManageAIProvidersvue_type_style_index_0_id_6e2e3ad5_lang_less = __webpack_require__("1047"); +// EXTERNAL MODULE: ./plugins/AIProviders/vue/src/ManageAIProviders.vue?vue&type=style&index=0&id=3339ef54&lang=less +var ManageAIProvidersvue_type_style_index_0_id_3339ef54_lang_less = __webpack_require__("00fb"); // CONCATENATED MODULE: ./plugins/AIProviders/vue/src/ManageAIProviders.vue @@ -580,17 +693,6 @@ var ManageAIProvidersvue_type_style_index_0_id_6e2e3ad5_lang_less = __webpack_re -/***/ }), - -/***/ "fd04": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ProviderCard_vue_vue_type_style_index_0_id_3702360d_lang_less__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1f8b"); -/* harmony import */ var _node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ProviderCard_vue_vue_type_style_index_0_id_3702360d_lang_less__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_cli_service_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_vue_cli_service_node_modules_css_loader_dist_cjs_js_ref_11_oneOf_1_1_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_11_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_11_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_cli_service_node_modules_vue_loader_v16_dist_index_js_ref_1_1_ProviderCard_vue_vue_type_style_index_0_id_3702360d_lang_less__WEBPACK_IMPORTED_MODULE_0__); -/* unused harmony reexport * */ - - /***/ }) /******/ }); diff --git a/vue/dist/AIProviders.umd.js.map b/vue/dist/AIProviders.umd.js.map index 565b3a9..e8bbea0 100644 --- a/vue/dist/AIProviders.umd.js.map +++ b/vue/dist/AIProviders.umd.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://AIProviders/webpack/universalModuleDefinition","webpack://AIProviders/webpack/bootstrap","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?2aa5","webpack://AIProviders/external \"CoreHome\"","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?b6ff","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?e54c","webpack://AIProviders/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://AIProviders/external \"CorePluginsAdmin\"","webpack://AIProviders/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?642d","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?59bd","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?5a1c","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?cf17","webpack://AIProviders/./plugins/AIProviders/vue/src/index.ts","webpack://AIProviders/./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?82df"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;AClFA;AAAA;AAAA;;;;;;;;ACAA,mD;;;;;;;ACAA,uC;;;;;;;ACAA,uC;;;;;;;ACAA,mD;;;;;;;ACAA,kD;;;;;;;;;;;;;;;ACAA;;AAEA;AACA;AACA,MAAM,KAAuC,EAAE,yBAQ5C;;AAEH;AACA;AACA,IAAI,qBAAuB;AAC3B;AACA;;AAEA;AACe,sDAAI;;;;;;;;;;;;ACrBsC;AACwY;AAEjc,MAAM,UAAU,GAAG;EAAE,KAAK,EAAE;AAA0B,CAAE;AACxD,MAAM,UAAU,G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AAa,EAAG;OACtE,EAAE,wEAAgB,CAAC,8DAAM,CAAC,+BAAS,CAAC,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,EACzE,oEAAY,CAAC,8DAAM,CAAC,wCAAU,CAAC,EAAE;QAC/B,MAAM,EAAE,QAAQ,CAAC,KAAK;QACtB,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,GAAI,MAAW,IAAM,YAAY,EAAG;OACvE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CACxB,CAAC,IACF,2EAAmB,CAAC,EAAE,EAAE,IAAI,CAAC,CAClC,CAAC;IACJ,CAAC;EACD;CAEC,CAAC,E;;AChUogB,C;;;;;ACAvb;AACL;;AAEG;;AAE9D,yG;;ACLf;;;;;;;;;;;;;AAaG;;;ACbqB;AACF;;;;;;;;;ACDtB;AAAA;AAAA","file":"AIProviders.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"CoreHome\", , \"CorePluginsAdmin\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AIProviders\"] = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse\n\t\troot[\"AIProviders\"] = factory(root[\"CoreHome\"], root[\"Vue\"], root[\"CorePluginsAdmin\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"plugins/AIProviders/vue/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fae3\");\n","export * from \"-!../../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--11-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../../../node_modules/less-loader/dist/cjs.js??ref--11-oneOf-1-3!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=style&index=0&id=6e2e3ad5&lang=less\"","module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__;","// extracted by mini-css-extract-plugin","// extracted by mini-css-extract-plugin","module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;","module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__;","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, withDirectives as _withDirectives, normalizeClass as _normalizeClass, createTextVNode as _createTextVNode, withModifiers as _withModifiers, Fragment as _Fragment, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"ai-providers-card-header\" }\nconst _hoisted_2 = [\"checked\", \"value\"]\nconst _hoisted_3 = { class: \"ai-providers-card-name\" }\nconst _hoisted_4 = { class: \"ai-providers-card-description\" }\nconst _hoisted_5 = { class: \"ai-providers-card-actions\" }\nconst _hoisted_6 = [\"disabled\"]\nconst _hoisted_7 = [\"disabled\"]\n\nimport { computed } from 'vue';\nimport { AutoClearPassword as vAutoClearPassword, translate } from 'CoreHome';\nimport { Field } from 'CorePluginsAdmin';\nimport type { Provider, ProviderConfiguration } from '../types';\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ProviderCard',\n props: {\n provider: null,\n configuration: null,\n selected: { type: Boolean },\n canEdit: { type: Boolean }\n },\n emits: [\"select\", \"update:apiKey\", \"update:endpointUrl\", \"test\", \"disconnect\"],\n setup(__props: any, { emit }: { emit: ({\n (e: 'select'): void;\n (e: 'update:apiKey', value: string): void;\n (e: 'update:endpointUrl', value: string): void;\n (e: 'test'): void;\n (e: 'disconnect'): void;\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props as {\n provider: Provider;\n configuration: ProviderConfiguration | undefined;\n selected: boolean;\n canEdit: boolean;\n};\n\n\n\n/* eslint-disable func-call-spacing, no-spaced-func */\n\n/* eslint-enable func-call-spacing, no-spaced-func */\n\nconst hasPendingKey = computed(() => (props.configuration?.apiKey ?? '') !== '');\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"label\", {\n class: _normalizeClass([{ 'is-selected': __props.selected }, \"ai-providers-card\"])\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"input\", {\n checked: __props.selected,\n value: __props.provider.id,\n name: \"defaultProviderId\",\n type: \"radio\",\n onChange: _cache[0] || (_cache[0] = ($event: any) => (emit('select')))\n }, null, 40, _hoisted_2),\n _createElementVNode(\"span\", _hoisted_3, _toDisplayString(__props.provider.name), 1)\n ]),\n _createElementVNode(\"p\", _hoisted_4, _toDisplayString(_unref(translate)(__props.provider.description)), 1),\n (__props.canEdit)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (__props.provider.supportsCustomEndpoint)\n ? (_openBlock(), _createBlock(_unref(Field), {\n key: 0,\n \"model-value\": __props.configuration?.endpointUrl,\n name: `endpointUrl-${__props.provider.id}`,\n title: _unref(translate)('AIProviders_EndpointUrl'),\n placeholder: _unref(translate)('AIProviders_EndpointUrlPlaceholder'),\n autocomplete: \"off\",\n \"full-width\": \"\",\n uicontrol: \"text\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => (emit('update:endpointUrl', `${$event}`)))\n }, null, 8, [\"model-value\", \"name\", \"title\", \"placeholder\"]))\n : _createCommentVNode(\"\", true),\n _withDirectives(_createVNode(_unref(Field), {\n \"model-value\": __props.configuration?.apiKey,\n name: `apiKey-${__props.provider.id}`,\n placeholder: __props.provider.configuration.hasApiKey\n ? _unref(translate)('AIProviders_ApiKeyAlreadyConfiguredPlaceholder')\n : _unref(translate)('AIProviders_ApiKeyPlaceholder'),\n title: _unref(translate)('AIProviders_ApiKey'),\n autocomplete: \"new-password\",\n \"full-width\": \"\",\n uicontrol: \"password\",\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => (emit('update:apiKey', `${$event}`)))\n }, null, 8, [\"model-value\", \"name\", \"placeholder\", \"title\"]), [\n [_unref(vAutoClearPassword)]\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass([{ 'is-connected': __props.provider.configuration.hasApiKey }, \"ai-providers-card-status\"])\n }, [\n _createElementVNode(\"span\", {\n \"aria-hidden\": \"true\",\n class: _normalizeClass([\"icon ai-providers-status-icon\", __props.provider.configuration.hasApiKey ? 'icon-ok' : 'icon-minus'])\n }, null, 2),\n _createTextVNode(\" \" + _toDisplayString(__props.provider.configuration.hasApiKey\n ? _unref(translate)('AIProviders_StatusConnected')\n : _unref(translate)('AIProviders_StatusNotConnected')), 1)\n ], 2),\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"button\", {\n class: \"btn btn-outline btn-small\",\n type: \"button\",\n disabled: !_unref(hasPendingKey) && !__props.provider.configuration.hasApiKey,\n onClick: _cache[3] || (_cache[3] = _withModifiers(($event: any) => (emit('test')), [\"prevent\"]))\n }, _toDisplayString(_unref(translate)('AIProviders_TestConnection')), 9, _hoisted_6),\n _createElementVNode(\"button\", {\n class: \"btn-flat\",\n type: \"button\",\n disabled: !__props.provider.configuration.hasApiKey,\n onClick: _cache[4] || (_cache[4] = _withModifiers(($event: any) => (emit('disconnect')), [\"prevent\"]))\n }, _toDisplayString(_unref(translate)('AIProviders_Disconnect')), 9, _hoisted_7)\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ], 2))\n}\n}\n\n})","export { default } from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"; export * from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"","import script from \"./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ProviderCard.vue?vue&type=style&index=0&id=3702360d&lang=less\"\n\nexport default script","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, createTextVNode as _createTextVNode, withCtx as _withCtx, renderList as _renderList, Fragment as _Fragment, vModelRadio as _vModelRadio, withDirectives as _withDirectives, normalizeClass as _normalizeClass, createVNode as _createVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"ai-providers-page\" }\nconst _hoisted_2 = { class: \"ai-providers-page-header\" }\nconst _hoisted_3 = { class: \"ai-providers-page-title\" }\nconst _hoisted_4 = { class: \"ai-providers-page-subtitle\" }\nconst _hoisted_5 = {\n key: 0,\n class: \"ai-providers-selected-configuration\"\n}\nconst _hoisted_6 = { class: \"ai-providers\" }\nconst _hoisted_7 = { class: \"ai-providers-defaults-title\" }\nconst _hoisted_8 = { class: \"ai-providers-section\" }\nconst _hoisted_9 = { class: \"ai-providers-subsection-title\" }\nconst _hoisted_10 = { class: \"ai-providers-section-help\" }\nconst _hoisted_11 = [\"aria-label\"]\nconst _hoisted_12 = {\n key: 1,\n class: \"ai-providers-section\"\n}\nconst _hoisted_13 = { class: \"ai-providers-subsection-title\" }\nconst _hoisted_14 = { class: \"ai-providers-section-help\" }\nconst _hoisted_15 = [\"aria-label\"]\nconst _hoisted_16 = { class: \"ai-providers-capability-header\" }\nconst _hoisted_17 = [\"value\"]\nconst _hoisted_18 = { class: \"ai-providers-capability-label\" }\nconst _hoisted_19 = {\n key: 0,\n class: \"ai-providers-capability-description\"\n}\nconst _hoisted_20 = /*#__PURE__*/_createElementVNode(\"p\", { class: \"ai-providers-capability-footnote\" }, null, -1)\nconst _hoisted_21 = {\n key: 2,\n class: \"ai-providers-footer\"\n}\nconst _hoisted_22 = [\"disabled\"]\n\nimport { computed, onMounted, ref } from 'vue';\nimport {\n ActivityIndicator,\n AjaxHelper,\n Alert,\n ContentBlock,\n NotificationsStore,\n translate,\n} from 'CoreHome';\nimport { Form as vForm, SaveButton } from 'CorePluginsAdmin';\nimport ProviderCard from './components/ProviderCard.vue';\nimport type { CapabilityLevelOption, ProviderConfiguration, Settings } from './types';\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ManageAIProviders',\n setup(__props) {\n\nconst settings = ref(null);\nconst isLoading = ref(false);\nconst isSaving = ref(false);\nconst defaultProviderId = ref('');\nconst defaultCapabilityLevel = ref('');\nconst providerConfigurations = ref>({});\n\nconst providers = computed(() => settings.value?.providers || []);\nconst canEditCapabilityLevel = computed(() => !!settings.value?.canEditCapabilityLevel);\nconst canEditProviderConfiguration = computed(() => !!settings.value?.canEditProviderConfiguration);\nconst selectedProvider = computed(() => providers.value.find((provider) => (\n provider.id === defaultProviderId.value\n)));\n\nconst capabilityLevelOptions = computed(() => {\n const capabilityLevels = settings.value?.capabilityLevels || {};\n\n return Object.entries(capabilityLevels).map(([id, keys]) => ({\n id,\n label: translate(keys.label),\n description: keys.description ? translate(keys.description) : '',\n }));\n});\nconst selectedCapabilityLevel = computed(() => capabilityLevelOptions.value.find((capability) => (\n capability.id === defaultCapabilityLevel.value\n)));\nconst selectedConfigurationLabel = computed(() => {\n if (!selectedProvider.value || !selectedCapabilityLevel.value) {\n return '';\n }\n\n return translate(\n 'AIProviders_SelectedConfiguration',\n selectedProvider.value.name,\n selectedCapabilityLevel.value.label,\n );\n});\n\n/**\n * Applies the given settings to the component state.\n * @param nextSettings\n */\nfunction applySettings(nextSettings: Settings) {\n settings.value = nextSettings;\n defaultProviderId.value = nextSettings.defaultProviderId;\n defaultCapabilityLevel.value = nextSettings.defaultCapabilityLevel;\n\n const nextProviderConfigurations: Record = {};\n nextSettings.providers.forEach((provider) => {\n nextProviderConfigurations[provider.id] = {\n apiKey: '',\n endpointUrl: provider.configuration.endpointUrl || '',\n };\n });\n providerConfigurations.value = nextProviderConfigurations;\n}\n\nasync function loadSettings() {\n isLoading.value = true;\n\n try {\n const response = await AjaxHelper.fetch({\n method: 'AIProviders.getSettings',\n });\n applySettings(response);\n } finally {\n isLoading.value = false;\n }\n}\n\nfunction updateApiKey(providerId: string, apiKey: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n apiKey,\n };\n}\n\nfunction updateEndpointUrl(providerId: string, endpointUrl: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n endpointUrl,\n };\n}\n\nfunction disconnectProvider(providerId: string) {\n // PoC: clears the locally entered key. Removing a persisted key requires a\n // backend method that isn't wired up yet.\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n apiKey: '',\n };\n NotificationsStore.show({\n message: translate('AIProviders_DisconnectNotAvailable'),\n type: 'transient',\n id: `aiProvidersDisconnect-${providerId}`,\n context: 'info',\n });\n}\n\nfunction testConnection(providerId: string) {\n // PoC: placeholder until a server-side connection test endpoint exists.\n NotificationsStore.show({\n message: translate('AIProviders_TestConnectionNotAvailable'),\n type: 'transient',\n id: `aiProvidersTest-${providerId}`,\n context: 'info',\n });\n}\n\nfunction cancelChanges() {\n if (settings.value) {\n applySettings(settings.value);\n }\n}\n\n/**\n * Saves the current settings to the server.\n */\nasync function saveSettings() {\n isSaving.value = true;\n\n try {\n const response = await AjaxHelper.post(\n {\n method: 'AIProviders.saveSettings',\n },\n {\n defaultProviderId: defaultProviderId.value,\n defaultCapabilityLevel: defaultCapabilityLevel.value,\n providerConfigurations: JSON.stringify(providerConfigurations.value),\n },\n {\n withTokenInUrl: true,\n },\n );\n applySettings(response);\n\n const notificationInstanceId = NotificationsStore.show({\n message: translate('AIProviders_SettingsSaveSuccess'),\n type: 'transient',\n id: 'aiProvidersSettings',\n context: 'success',\n });\n NotificationsStore.scrollToNotification(notificationInstanceId);\n } finally {\n isSaving.value = false;\n }\n}\n\nonMounted(loadSettings);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"header\", _hoisted_2, [\n _createElementVNode(\"h2\", _hoisted_3, _toDisplayString(_unref(translate)('AIProviders_MenuTitle')), 1),\n _createElementVNode(\"p\", _hoisted_4, _toDisplayString(_unref(translate)('AIProviders_ConfigurationIntro')), 1),\n (_unref(selectedConfigurationLabel))\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_5, _toDisplayString(_unref(selectedConfigurationLabel)), 1))\n : _createCommentVNode(\"\", true)\n ]),\n (isLoading.value)\n ? (_openBlock(), _createBlock(_unref(ActivityIndicator), {\n key: 0,\n loading: isLoading.value\n }, null, 8, [\"loading\"]))\n : (settings.value)\n ? (_openBlock(), _createBlock(_unref(ContentBlock), { key: 1 }, {\n default: _withCtx(() => [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", _hoisted_6, [\n (!_unref(canEditProviderConfiguration))\n ? (_openBlock(), _createBlock(_unref(Alert), {\n key: 0,\n severity: \"info\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(translate)('AIProviders_CloudConfigurationHelp')), 1)\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"h3\", _hoisted_7, _toDisplayString(_unref(translate)('AIProviders_DefaultsTitle')), 1),\n _createElementVNode(\"section\", _hoisted_8, [\n _createElementVNode(\"h4\", _hoisted_9, _toDisplayString(_unref(translate)('AIProviders_DefaultProvider')), 1),\n _createElementVNode(\"p\", _hoisted_10, _toDisplayString(_unref(translate)('AIProviders_DefaultProviderHelp')), 1),\n _createElementVNode(\"div\", {\n \"aria-label\": _unref(translate)('AIProviders_DefaultProvider'),\n class: \"ai-providers-cards\",\n role: \"radiogroup\"\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(providers), (provider) => {\n return (_openBlock(), _createBlock(ProviderCard, {\n key: provider.id,\n \"can-edit\": _unref(canEditProviderConfiguration),\n configuration: providerConfigurations.value[provider.id],\n provider: provider,\n selected: defaultProviderId.value === provider.id,\n onDisconnect: ($event: any) => (disconnectProvider(provider.id)),\n onSelect: ($event: any) => (defaultProviderId.value = provider.id),\n onTest: ($event: any) => (testConnection(provider.id)),\n \"onUpdate:apiKey\": ($event: any) => (updateApiKey(provider.id, $event)),\n \"onUpdate:endpointUrl\": ($event: any) => (updateEndpointUrl(provider.id, $event))\n }, null, 8, [\"can-edit\", \"configuration\", \"provider\", \"selected\", \"onDisconnect\", \"onSelect\", \"onTest\", \"onUpdate:apiKey\", \"onUpdate:endpointUrl\"]))\n }), 128))\n ], 8, _hoisted_11)\n ]),\n (_unref(canEditCapabilityLevel))\n ? (_openBlock(), _createElementBlock(\"section\", _hoisted_12, [\n _createElementVNode(\"h4\", _hoisted_13, _toDisplayString(_unref(translate)('AIProviders_DefaultCapabilityLevel')), 1),\n _createElementVNode(\"p\", _hoisted_14, _toDisplayString(_unref(translate)('AIProviders_DefaultCapabilityLevelHelp')), 1),\n _createElementVNode(\"div\", {\n \"aria-label\": _unref(translate)('AIProviders_DefaultCapabilityLevel'),\n class: \"ai-providers-capability-cards\",\n role: \"radiogroup\"\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(capabilityLevelOptions), (capability) => {\n return (_openBlock(), _createElementBlock(\"label\", {\n key: capability.id,\n class: _normalizeClass([{ 'is-selected': defaultCapabilityLevel.value === capability.id }, \"ai-providers-capability-card\"])\n }, [\n _createElementVNode(\"div\", _hoisted_16, [\n _withDirectives(_createElementVNode(\"input\", {\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((defaultCapabilityLevel).value = $event)),\n value: capability.id,\n name: \"defaultCapabilityLevel\",\n type: \"radio\"\n }, null, 8, _hoisted_17), [\n [_vModelRadio, defaultCapabilityLevel.value]\n ]),\n _createElementVNode(\"span\", _hoisted_18, _toDisplayString(capability.label), 1)\n ]),\n (capability.description)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_19, _toDisplayString(capability.description), 1))\n : _createCommentVNode(\"\", true)\n ], 2))\n }), 128))\n ], 8, _hoisted_15),\n _hoisted_20\n ]))\n : _createCommentVNode(\"\", true)\n ])), [\n [_unref(vForm)]\n ])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (settings.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_21, [\n _createElementVNode(\"button\", {\n disabled: isSaving.value,\n class: \"btn btn-outline\",\n type: \"button\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (cancelChanges()))\n }, _toDisplayString(_unref(translate)('General_Cancel')), 9, _hoisted_22),\n _createVNode(_unref(SaveButton), {\n saving: isSaving.value,\n onConfirm: _cache[2] || (_cache[2] = ($event: any) => (saveSettings()))\n }, null, 8, [\"saving\"])\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","export { default } from \"-!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"; export * from \"-!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"","import script from \"./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ManageAIProviders.vue?vue&type=style&index=0&id=6e2e3ad5&lang=less\"\n\nexport default script","/*!\n * Copyright (C) InnoCraft Ltd - All rights reserved.\n *\n * NOTICE: All information contained herein is, and remains the property of InnoCraft Ltd.\n * The intellectual and technical concepts contained herein are protected by trade secret\n * or copyright law. Redistribution of this information or reproduction of this material is\n * strictly forbidden unless prior written permission is obtained from InnoCraft Ltd.\n *\n * You shall use this code only in accordance with the license agreement obtained from\n * InnoCraft Ltd.\n *\n * @link https://www.innocraft.com/\n * @license For license details see https://www.innocraft.com/license\n */\n\nexport { default as ManageAIProviders } from './ManageAIProviders.vue';\n","import './setPublicPath'\nexport * from '~entry'\n","export * from \"-!../../../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--11-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../../../../node_modules/less-loader/dist/cjs.js??ref--11-oneOf-1-3!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ProviderCard.vue?vue&type=style&index=0&id=3702360d&lang=less\""],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://AIProviders/webpack/universalModuleDefinition","webpack://AIProviders/webpack/bootstrap","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?2927","webpack://AIProviders/external \"CoreHome\"","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?c18f","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?5951","webpack://AIProviders/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?fa35","webpack://AIProviders/external \"CorePluginsAdmin\"","webpack://AIProviders/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?642d","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?59bd","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?5a1c","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?cf17","webpack://AIProviders/./plugins/AIProviders/vue/src/index.ts","webpack://AIProviders/./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QA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CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,EACzE,oEAAY,CAAC,8DAAM,CAAC,wCAAU,CAAC,EAAE;QAC/B,MAAM,EAAE,QAAQ,CAAC,KAAK;QACtB,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,GAAI,MAAW,IAAM,YAAY,EAAG;OACvE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CACxB,CAAC,IACF,2EAAmB,CAAC,EAAE,EAAE,IAAI,CAAC,CAClC,CAAC;IACJ,CAAC;EACD;CAEC,CAAC,E;;AC3bogB,C;;;;;ACAvb;AACL;;AAEG;;AAE9D,yG;;ACLf;;;;;;;;;;;;;AAaG;;;ACbqB;AACF","file":"AIProviders.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"CoreHome\", , \"CorePluginsAdmin\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AIProviders\"] = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse\n\t\troot[\"AIProviders\"] = factory(root[\"CoreHome\"], root[\"Vue\"], root[\"CorePluginsAdmin\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"plugins/AIProviders/vue/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fae3\");\n","export * from \"-!../../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--11-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../../../node_modules/less-loader/dist/cjs.js??ref--11-oneOf-1-3!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=style&index=0&id=3339ef54&lang=less\"","module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__;","// extracted by mini-css-extract-plugin","export * from \"-!../../../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--11-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../../../../node_modules/less-loader/dist/cjs.js??ref--11-oneOf-1-3!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ProviderCard.vue?vue&type=style&index=0&id=00c4b20e&lang=less\"","module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;","// extracted by mini-css-extract-plugin","module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__;","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, createBlock as _createBlock, createVNode as _createVNode, withDirectives as _withDirectives, normalizeClass as _normalizeClass, createTextVNode as _createTextVNode, withModifiers as _withModifiers, Fragment as _Fragment, withKeys as _withKeys } from \"vue\"\n\nconst _hoisted_1 = [\"aria-checked\", \"aria-disabled\", \"tabindex\"]\nconst _hoisted_2 = {\n key: 0,\n class: \"ai-providers-card-default\"\n}\nconst _hoisted_3 = { class: \"ai-providers-card-inner\" }\nconst _hoisted_4 = { class: \"ai-providers-card-header\" }\nconst _hoisted_5 = { class: \"ai-providers-card-name\" }\nconst _hoisted_6 = { class: \"ai-providers-card-description\" }\nconst _hoisted_7 = { class: \"ai-providers-card-actions\" }\nconst _hoisted_8 = [\"disabled\"]\nconst _hoisted_9 = [\"disabled\"]\n\nimport { computed } from 'vue';\nimport { AutoClearPassword as vAutoClearPassword, translate } from 'CoreHome';\nimport { Field } from 'CorePluginsAdmin';\nimport type { Provider, ProviderConfiguration } from '../types';\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ProviderCard',\n props: {\n provider: null,\n configuration: null,\n selected: { type: Boolean },\n usableAsDefault: { type: Boolean },\n canEdit: { type: Boolean },\n isTesting: { type: Boolean },\n isDisconnecting: { type: Boolean }\n },\n emits: [\"select\", \"update:apiKey\", \"update:endpointUrl\", \"test\", \"disconnect\"],\n setup(__props: any, { emit }: { emit: ({\n (e: 'select'): void;\n (e: 'update:apiKey', value: string): void;\n (e: 'update:endpointUrl', value: string): void;\n (e: 'test'): void;\n (e: 'disconnect'): void;\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props as {\n provider: Provider;\n configuration: ProviderConfiguration | undefined;\n selected: boolean;\n usableAsDefault: boolean;\n canEdit: boolean;\n isTesting: boolean;\n isDisconnecting: boolean;\n};\n\n\n\n/* eslint-disable func-call-spacing, no-spaced-func */\n\n/* eslint-enable func-call-spacing, no-spaced-func */\n\nconst hasPendingKey = computed(() => (props.configuration?.apiKey ?? '') !== '');\n\nfunction selectProvider() {\n if (props.usableAsDefault) {\n emit('select');\n }\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n \"aria-checked\": __props.selected,\n \"aria-disabled\": !__props.usableAsDefault,\n class: _normalizeClass([{ 'is-selected': __props.selected, 'is-not-usable': !__props.usableAsDefault }, \"ai-providers-card\"]),\n role: \"radio\",\n tabindex: __props.usableAsDefault ? 0 : -1,\n onClick: _cache[4] || (_cache[4] = ($event: any) => (selectProvider())),\n onKeydown: [\n _cache[5] || (_cache[5] = _withKeys(_withModifiers(($event: any) => (selectProvider()), [\"prevent\"]), [\"enter\"])),\n _cache[6] || (_cache[6] = _withKeys(_withModifiers(($event: any) => (selectProvider()), [\"prevent\"]), [\"space\"]))\n ]\n }, [\n (__props.selected)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, _toDisplayString(_unref(translate)('AIProviders_DefaultBadge')), 1))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"span\", _hoisted_5, _toDisplayString(__props.provider.name), 1)\n ]),\n _createElementVNode(\"p\", _hoisted_6, _toDisplayString(_unref(translate)(__props.provider.description)), 1),\n (__props.canEdit)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (__props.provider.supportsCustomEndpoint)\n ? (_openBlock(), _createBlock(_unref(Field), {\n key: 0,\n \"model-value\": __props.configuration?.endpointUrl,\n name: `endpointUrl-${__props.provider.id}`,\n title: _unref(translate)('AIProviders_EndpointUrl'),\n placeholder: _unref(translate)('AIProviders_EndpointUrlPlaceholder'),\n autocomplete: \"off\",\n \"full-width\": \"\",\n uicontrol: \"text\",\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => (emit('update:endpointUrl', `${$event}`)))\n }, null, 8, [\"model-value\", \"name\", \"title\", \"placeholder\"]))\n : _createCommentVNode(\"\", true),\n _withDirectives(_createVNode(_unref(Field), {\n \"model-value\": __props.configuration?.apiKey,\n name: `apiKey-${__props.provider.id}`,\n placeholder: __props.provider.configuration.hasApiKey\n ? _unref(translate)('AIProviders_ApiKeyAlreadyConfiguredPlaceholder')\n : _unref(translate)('AIProviders_ApiKeyPlaceholder'),\n title: _unref(translate)('AIProviders_ApiKey'),\n autocomplete: \"new-password\",\n \"full-width\": \"\",\n uicontrol: \"password\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => (emit('update:apiKey', `${$event}`)))\n }, null, 8, [\"model-value\", \"name\", \"placeholder\", \"title\"]), [\n [_unref(vAutoClearPassword)]\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass([{ 'is-connected': __props.provider.configuration.isUsable }, \"ai-providers-card-status\"])\n }, [\n _createElementVNode(\"span\", {\n \"aria-hidden\": \"true\",\n class: _normalizeClass([\"icon ai-providers-status-icon\", __props.provider.configuration.isUsable ? 'icon-ok' : 'icon-minus'])\n }, null, 2),\n _createTextVNode(\" \" + _toDisplayString(__props.provider.configuration.isUsable\n ? _unref(translate)('AIProviders_StatusConnected')\n : _unref(translate)('AIProviders_StatusNotConnected')), 1)\n ], 2),\n _createElementVNode(\"div\", _hoisted_7, [\n _createElementVNode(\"button\", {\n class: \"btn btn-small\",\n type: \"button\",\n disabled: __props.isTesting || (!_unref(hasPendingKey) && !__props.provider.configuration.hasApiKey),\n onClick: _cache[2] || (_cache[2] = _withModifiers(($event: any) => (emit('test')), [\"prevent\",\"stop\"]))\n }, _toDisplayString(__props.isTesting\n ? _unref(translate)('AIProviders_TestingConnection')\n : _unref(translate)('AIProviders_TestConnection')), 9, _hoisted_8),\n _createElementVNode(\"button\", {\n class: \"btn-flat\",\n type: \"button\",\n disabled: __props.isDisconnecting || !__props.provider.configuration.hasApiKey,\n onClick: _cache[3] || (_cache[3] = _withModifiers(($event: any) => (emit('disconnect')), [\"prevent\",\"stop\"]))\n }, _toDisplayString(__props.isDisconnecting\n ? _unref(translate)('AIProviders_Disconnecting')\n : _unref(translate)('AIProviders_Disconnect')), 9, _hoisted_9)\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ])\n ], 42, _hoisted_1))\n}\n}\n\n})","export { default } from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"; export * from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"","import script from \"./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ProviderCard.vue?vue&type=style&index=0&id=00c4b20e&lang=less\"\n\nexport default script","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, createTextVNode as _createTextVNode, withCtx as _withCtx, renderList as _renderList, Fragment as _Fragment, vModelRadio as _vModelRadio, withDirectives as _withDirectives, normalizeClass as _normalizeClass, createVNode as _createVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"ai-providers-page\" }\nconst _hoisted_2 = { class: \"ai-providers-page-header\" }\nconst _hoisted_3 = { class: \"ai-providers-page-title\" }\nconst _hoisted_4 = { class: \"ai-providers-page-subtitle\" }\nconst _hoisted_5 = {\n key: 0,\n class: \"ai-providers-selected-configuration\"\n}\nconst _hoisted_6 = { class: \"ai-providers\" }\nconst _hoisted_7 = { class: \"ai-providers-defaults-title\" }\nconst _hoisted_8 = { class: \"ai-providers-section\" }\nconst _hoisted_9 = { class: \"ai-providers-subsection-title\" }\nconst _hoisted_10 = { class: \"ai-providers-section-help\" }\nconst _hoisted_11 = [\"aria-label\"]\nconst _hoisted_12 = {\n key: 1,\n class: \"ai-providers-section\"\n}\nconst _hoisted_13 = { class: \"ai-providers-subsection-title\" }\nconst _hoisted_14 = { class: \"ai-providers-section-help\" }\nconst _hoisted_15 = [\"aria-label\"]\nconst _hoisted_16 = { class: \"ai-providers-capability-header\" }\nconst _hoisted_17 = [\"value\"]\nconst _hoisted_18 = { class: \"ai-providers-capability-label\" }\nconst _hoisted_19 = {\n key: 0,\n class: \"ai-providers-capability-description\"\n}\nconst _hoisted_20 = {\n key: 2,\n class: \"ai-providers-footer\"\n}\nconst _hoisted_21 = [\"disabled\"]\n\nimport { computed, onMounted, ref } from 'vue';\nimport {\n ActivityIndicator,\n AjaxHelper,\n Alert,\n ContentBlock,\n NotificationsStore,\n translate,\n} from 'CoreHome';\nimport { Form as vForm, SaveButton } from 'CorePluginsAdmin';\nimport ProviderCard from './components/ProviderCard.vue';\nimport type {\n AIProviderResponse,\n CapabilityLevelOption,\n ProviderConfiguration,\n Settings,\n} from './types';\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ManageAIProviders',\n setup(__props) {\n\nconst settings = ref(null);\nconst isLoading = ref(false);\nconst isSaving = ref(false);\nconst defaultProviderId = ref('');\nconst defaultCapabilityLevel = ref('');\nconst providerConfigurations = ref>({});\nconst testingProviders = ref>({});\nconst disconnectingProviders = ref>({});\n\nconst providers = computed(() => settings.value?.providers || []);\nconst hasUsableProvider = computed(() => providers.value.some(\n (provider) => provider.configuration.isUsable,\n));\nconst canEditCapabilityLevel = computed(() => !!settings.value?.canEditCapabilityLevel);\nconst canEditProviderConfiguration = computed(() => !!settings.value?.canEditProviderConfiguration);\nconst selectedProvider = computed(() => providers.value.find((provider) => (\n provider.id === defaultProviderId.value\n)));\n\nconst capabilityLevelOptions = computed(() => {\n const capabilityLevels = settings.value?.capabilityLevels || {};\n\n return Object.entries(capabilityLevels).map(([id, keys]) => ({\n id,\n label: translate(keys.label),\n description: keys.description ? translate(keys.description) : '',\n }));\n});\nconst selectedCapabilityLevel = computed(() => capabilityLevelOptions.value.find((capability) => (\n capability.id === defaultCapabilityLevel.value\n)));\nconst selectedConfigurationLabel = computed(() => {\n if (!selectedProvider.value || !selectedCapabilityLevel.value) {\n return '';\n }\n\n return translate(\n 'AIProviders_SelectedConfiguration',\n selectedProvider.value.name,\n selectedCapabilityLevel.value.label,\n );\n});\n\n/**\n * Applies the given settings to the component state.\n * @param nextSettings\n */\nfunction applySettings(nextSettings: Settings) {\n settings.value = nextSettings;\n defaultProviderId.value = nextSettings.defaultProviderId;\n defaultCapabilityLevel.value = nextSettings.defaultCapabilityLevel;\n\n const nextProviderConfigurations: Record = {};\n nextSettings.providers.forEach((provider) => {\n nextProviderConfigurations[provider.id] = {\n apiKey: '',\n endpointUrl: provider.configuration.endpointUrl || '',\n };\n });\n providerConfigurations.value = nextProviderConfigurations;\n}\n\nfunction markProviderUsable(providerId: string) {\n if (!settings.value) {\n return;\n }\n\n const provider = settings.value.providers.find((p) => p.id === providerId);\n if (provider) {\n provider.configuration = {\n ...provider.configuration,\n hasApiKey: true,\n isUsable: true,\n };\n }\n\n if (!defaultProviderId.value) {\n defaultProviderId.value = providerId;\n }\n}\n\nfunction getCleanErrorMessage(error: unknown) {\n let message = '';\n\n if (error && typeof error === 'object' && 'message' in error) {\n message = `${(error as { message: string }).message}`;\n } else {\n message = `${error}`;\n }\n\n return message\n .replace(/\\s*#\\d+\\s+[\\s\\S]*$/, '')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\nfunction showErrorNotification(error: unknown, id: string) {\n const cleaned = getCleanErrorMessage(error);\n const isUseful = cleaned && cleaned !== 'Something went wrong';\n const message = isUseful\n ? translate('AIProviders_RequestFailed', cleaned)\n : translate('AIProviders_UnexpectedError');\n\n return NotificationsStore.show({\n message,\n type: 'transient',\n id,\n context: 'error',\n });\n}\n\nasync function loadSettings() {\n isLoading.value = true;\n\n try {\n const response = await AjaxHelper.fetch({\n method: 'AIProviders.getSettings',\n }, {\n createErrorNotification: false,\n });\n applySettings(response);\n } catch (error) {\n showErrorNotification(error, 'aiProvidersLoadError');\n } finally {\n isLoading.value = false;\n }\n}\n\nfunction updateApiKey(providerId: string, apiKey: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n apiKey,\n };\n}\n\nfunction updateEndpointUrl(providerId: string, endpointUrl: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n endpointUrl,\n };\n}\n\nasync function disconnectProvider(providerId: string) {\n disconnectingProviders.value[providerId] = true;\n\n try {\n const response = await AjaxHelper.post(\n {\n method: 'AIProviders.disconnectProvider',\n },\n {\n providerId,\n },\n {\n withTokenInUrl: true,\n createErrorNotification: false,\n },\n );\n applySettings(response);\n\n NotificationsStore.show({\n message: translate('AIProviders_DisconnectSuccess'),\n type: 'transient',\n id: `aiProvidersDisconnect-${providerId}`,\n context: 'success',\n });\n } catch (error) {\n showErrorNotification(error, `aiProvidersDisconnectError-${providerId}`);\n } finally {\n disconnectingProviders.value[providerId] = false;\n }\n}\n\nasync function testConnection(providerId: string) {\n testingProviders.value[providerId] = true;\n\n try {\n const response = await AjaxHelper.post(\n {\n method: 'AIProviders.testConnection',\n },\n {\n providerId,\n providerConfiguration: JSON.stringify(providerConfigurations.value[providerId] || {}),\n },\n {\n withTokenInUrl: true,\n createErrorNotification: false,\n },\n );\n\n markProviderUsable(providerId);\n\n NotificationsStore.show({\n message: translate(\n 'AIProviders_TestConnectionSuccess',\n response.providerName,\n response.text,\n ),\n type: 'transient',\n id: `aiProvidersTest-${providerId}`,\n context: 'success',\n });\n } catch (error) {\n showErrorNotification(error, `aiProvidersTestError-${providerId}`);\n } finally {\n testingProviders.value[providerId] = false;\n }\n}\n\nfunction cancelChanges() {\n if (settings.value) {\n applySettings(settings.value);\n }\n}\n\n/**\n * Saves the current settings to the server.\n */\nasync function saveSettings() {\n isSaving.value = true;\n\n try {\n const response = await AjaxHelper.post(\n {\n method: 'AIProviders.saveSettings',\n },\n {\n defaultProviderId: defaultProviderId.value,\n defaultCapabilityLevel: defaultCapabilityLevel.value,\n providerConfigurations: JSON.stringify(providerConfigurations.value),\n },\n {\n withTokenInUrl: true,\n createErrorNotification: false,\n },\n );\n applySettings(response);\n\n const notificationInstanceId = NotificationsStore.show({\n message: translate('AIProviders_SettingsSaveSuccess'),\n type: 'transient',\n id: 'aiProvidersSettings',\n context: 'success',\n });\n NotificationsStore.scrollToNotification(notificationInstanceId);\n } catch (error) {\n const notificationInstanceId = showErrorNotification(error, 'aiProvidersSettingsError');\n NotificationsStore.scrollToNotification(notificationInstanceId);\n } finally {\n isSaving.value = false;\n }\n}\n\nonMounted(loadSettings);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"header\", _hoisted_2, [\n _createElementVNode(\"h2\", _hoisted_3, _toDisplayString(_unref(translate)('AIProviders_MenuTitle')), 1),\n _createElementVNode(\"p\", _hoisted_4, _toDisplayString(_unref(translate)('AIProviders_ConfigurationIntro')), 1),\n (_unref(selectedConfigurationLabel))\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_5, _toDisplayString(_unref(selectedConfigurationLabel)), 1))\n : _createCommentVNode(\"\", true)\n ]),\n (isLoading.value)\n ? (_openBlock(), _createBlock(_unref(ActivityIndicator), {\n key: 0,\n loading: isLoading.value\n }, null, 8, [\"loading\"]))\n : (settings.value)\n ? (_openBlock(), _createBlock(_unref(ContentBlock), { key: 1 }, {\n default: _withCtx(() => [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", _hoisted_6, [\n (!_unref(canEditProviderConfiguration))\n ? (_openBlock(), _createBlock(_unref(Alert), {\n key: 0,\n severity: \"info\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(translate)('AIProviders_CloudConfigurationHelp')), 1)\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"h3\", _hoisted_7, _toDisplayString(_unref(translate)('AIProviders_DefaultsTitle')), 1),\n _createElementVNode(\"section\", _hoisted_8, [\n _createElementVNode(\"h4\", _hoisted_9, _toDisplayString(_unref(translate)('AIProviders_DefaultProvider')), 1),\n _createElementVNode(\"p\", _hoisted_10, _toDisplayString(_unref(translate)('AIProviders_DefaultProviderHelp')), 1),\n _createElementVNode(\"div\", {\n \"aria-label\": _unref(translate)('AIProviders_DefaultProvider'),\n class: \"ai-providers-cards\",\n role: \"radiogroup\"\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(providers), (provider) => {\n return (_openBlock(), _createBlock(ProviderCard, {\n key: provider.id,\n \"can-edit\": _unref(canEditProviderConfiguration),\n configuration: providerConfigurations.value[provider.id],\n \"is-disconnecting\": !!disconnectingProviders.value[provider.id],\n \"is-testing\": !!testingProviders.value[provider.id],\n provider: provider,\n selected: defaultProviderId.value === provider.id,\n \"usable-as-default\": provider.configuration.isUsable,\n onDisconnect: ($event: any) => (disconnectProvider(provider.id)),\n onSelect: ($event: any) => (provider.configuration.isUsable ? defaultProviderId.value = provider.id : null),\n onTest: ($event: any) => (testConnection(provider.id)),\n \"onUpdate:apiKey\": ($event: any) => (updateApiKey(provider.id, $event)),\n \"onUpdate:endpointUrl\": ($event: any) => (updateEndpointUrl(provider.id, $event))\n }, null, 8, [\"can-edit\", \"configuration\", \"is-disconnecting\", \"is-testing\", \"provider\", \"selected\", \"usable-as-default\", \"onDisconnect\", \"onSelect\", \"onTest\", \"onUpdate:apiKey\", \"onUpdate:endpointUrl\"]))\n }), 128))\n ], 8, _hoisted_11),\n (!_unref(hasUsableProvider))\n ? (_openBlock(), _createBlock(_unref(Alert), {\n key: 0,\n class: \"ai-providers-default-warning\",\n severity: \"warning\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(translate)('AIProviders_NoDefaultProviderWarning')), 1)\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true)\n ]),\n (_unref(canEditCapabilityLevel))\n ? (_openBlock(), _createElementBlock(\"section\", _hoisted_12, [\n _createElementVNode(\"h4\", _hoisted_13, _toDisplayString(_unref(translate)('AIProviders_DefaultCapabilityLevel')), 1),\n _createElementVNode(\"p\", _hoisted_14, _toDisplayString(_unref(translate)('AIProviders_DefaultCapabilityLevelHelp')), 1),\n _createElementVNode(\"div\", {\n \"aria-label\": _unref(translate)('AIProviders_DefaultCapabilityLevel'),\n class: \"ai-providers-capability-cards\",\n role: \"radiogroup\"\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(capabilityLevelOptions), (capability) => {\n return (_openBlock(), _createElementBlock(\"label\", {\n key: capability.id,\n class: _normalizeClass([{ 'is-selected': defaultCapabilityLevel.value === capability.id }, \"ai-providers-capability-card\"])\n }, [\n _createElementVNode(\"div\", _hoisted_16, [\n _withDirectives(_createElementVNode(\"input\", {\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((defaultCapabilityLevel).value = $event)),\n value: capability.id,\n name: \"defaultCapabilityLevel\",\n type: \"radio\"\n }, null, 8, _hoisted_17), [\n [_vModelRadio, defaultCapabilityLevel.value]\n ]),\n _createElementVNode(\"span\", _hoisted_18, _toDisplayString(capability.label), 1)\n ]),\n (capability.description)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_19, _toDisplayString(capability.description), 1))\n : _createCommentVNode(\"\", true)\n ], 2))\n }), 128))\n ], 8, _hoisted_15)\n ]))\n : _createCommentVNode(\"\", true)\n ])), [\n [_unref(vForm)]\n ])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (settings.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_20, [\n _createElementVNode(\"button\", {\n disabled: isSaving.value,\n class: \"btn btn-outline\",\n type: \"button\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (cancelChanges()))\n }, _toDisplayString(_unref(translate)('General_Cancel')), 9, _hoisted_21),\n _createVNode(_unref(SaveButton), {\n saving: isSaving.value,\n onConfirm: _cache[2] || (_cache[2] = ($event: any) => (saveSettings()))\n }, null, 8, [\"saving\"])\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","export { default } from \"-!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"; export * from \"-!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--15-2!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"","import script from \"./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ManageAIProviders.vue?vue&type=style&index=0&id=3339ef54&lang=less\"\n\nexport default script","/*!\n * Copyright (C) InnoCraft Ltd - All rights reserved.\n *\n * NOTICE: All information contained herein is, and remains the property of InnoCraft Ltd.\n * The intellectual and technical concepts contained herein are protected by trade secret\n * or copyright law. Redistribution of this information or reproduction of this material is\n * strictly forbidden unless prior written permission is obtained from InnoCraft Ltd.\n *\n * You shall use this code only in accordance with the license agreement obtained from\n * InnoCraft Ltd.\n *\n * @link https://www.innocraft.com/\n * @license For license details see https://www.innocraft.com/license\n */\n\nexport { default as ManageAIProviders } from './ManageAIProviders.vue';\n","import './setPublicPath'\nexport * from '~entry'\n"],"sourceRoot":""} \ No newline at end of file diff --git a/vue/dist/AIProviders.umd.min.js b/vue/dist/AIProviders.umd.min.js index 6efe51e..571e6c2 100644 --- a/vue/dist/AIProviders.umd.min.js +++ b/vue/dist/AIProviders.umd.min.js @@ -1,2 +1,2 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["AIProviders"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["AIProviders"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,r){return function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="plugins/AIProviders/vue/dist/",r(r.s="fae3")}({1047:function(e,t,r){"use strict";r("86b3")},"19dc":function(t,r){t.exports=e},"1f8b":function(e,t,r){},"86b3":function(e,t,r){},"8bbf":function(e,r){e.exports=t},a5a2:function(e,t){e.exports=r},fae3:function(e,t,r){"use strict";if(r.r(t),r.d(t,"ManageAIProviders",(function(){return L})),"undefined"!==typeof window){var i=window.document.currentScript,n=i&&i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);n&&(r.p=n[1])}var o=r("8bbf"),a=r("19dc"),c=r("a5a2");const l={class:"ai-providers-card-header"},s=["checked","value"],d={class:"ai-providers-card-name"},u={class:"ai-providers-card-description"},b={class:"ai-providers-card-actions"},p=["disabled"],v=["disabled"];var j=Object(o["defineComponent"])({__name:"ProviderCard",props:{provider:null,configuration:null,selected:{type:Boolean},canEdit:{type:Boolean}},emits:["select","update:apiKey","update:endpointUrl","test","disconnect"],setup(e,{emit:t}){const r=e,i=Object(o["computed"])(()=>{var e,t;return""!==(null!==(e=null===(t=r.configuration)||void 0===t?void 0:t.apiKey)&&void 0!==e?e:"")});return(r,n)=>{var j,O;return Object(o["openBlock"])(),Object(o["createElementBlock"])("label",{class:Object(o["normalizeClass"])([{"is-selected":e.selected},"ai-providers-card"])},[Object(o["createElementVNode"])("div",l,[Object(o["createElementVNode"])("input",{checked:e.selected,value:e.provider.id,name:"defaultProviderId",type:"radio",onChange:n[0]||(n[0]=e=>t("select"))},null,40,s),Object(o["createElementVNode"])("span",d,Object(o["toDisplayString"])(e.provider.name),1)]),Object(o["createElementVNode"])("p",u,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])(e.provider.description)),1),e.canEdit?(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:0},[e.provider.supportsCustomEndpoint?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["unref"])(c["Field"]),{key:0,"model-value":null===(j=e.configuration)||void 0===j?void 0:j.endpointUrl,name:"endpointUrl-"+e.provider.id,title:Object(o["unref"])(a["translate"])("AIProviders_EndpointUrl"),placeholder:Object(o["unref"])(a["translate"])("AIProviders_EndpointUrlPlaceholder"),autocomplete:"off","full-width":"",uicontrol:"text","onUpdate:modelValue":n[1]||(n[1]=e=>t("update:endpointUrl",""+e))},null,8,["model-value","name","title","placeholder"])):Object(o["createCommentVNode"])("",!0),Object(o["withDirectives"])(Object(o["createVNode"])(Object(o["unref"])(c["Field"]),{"model-value":null===(O=e.configuration)||void 0===O?void 0:O.apiKey,name:"apiKey-"+e.provider.id,placeholder:e.provider.configuration.hasApiKey?Object(o["unref"])(a["translate"])("AIProviders_ApiKeyAlreadyConfiguredPlaceholder"):Object(o["unref"])(a["translate"])("AIProviders_ApiKeyPlaceholder"),title:Object(o["unref"])(a["translate"])("AIProviders_ApiKey"),autocomplete:"new-password","full-width":"",uicontrol:"password","onUpdate:modelValue":n[2]||(n[2]=e=>t("update:apiKey",""+e))},null,8,["model-value","name","placeholder","title"]),[[Object(o["unref"])(a["AutoClearPassword"])]]),Object(o["createElementVNode"])("div",{class:Object(o["normalizeClass"])([{"is-connected":e.provider.configuration.hasApiKey},"ai-providers-card-status"])},[Object(o["createElementVNode"])("span",{"aria-hidden":"true",class:Object(o["normalizeClass"])(["icon ai-providers-status-icon",e.provider.configuration.hasApiKey?"icon-ok":"icon-minus"])},null,2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.provider.configuration.hasApiKey?Object(o["unref"])(a["translate"])("AIProviders_StatusConnected"):Object(o["unref"])(a["translate"])("AIProviders_StatusNotConnected")),1)],2),Object(o["createElementVNode"])("div",b,[Object(o["createElementVNode"])("button",{class:"btn btn-outline btn-small",type:"button",disabled:!Object(o["unref"])(i)&&!e.provider.configuration.hasApiKey,onClick:n[3]||(n[3]=Object(o["withModifiers"])(e=>t("test"),["prevent"]))},Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_TestConnection")),9,p),Object(o["createElementVNode"])("button",{class:"btn-flat",type:"button",disabled:!e.provider.configuration.hasApiKey,onClick:n[4]||(n[4]=Object(o["withModifiers"])(e=>t("disconnect"),["prevent"]))},Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_Disconnect")),9,v)])],64)):Object(o["createCommentVNode"])("",!0)],2)}}}),O=(r("fd04"),j);const f={class:"ai-providers-page"},m={class:"ai-providers-page-header"},y={class:"ai-providers-page-title"},g={class:"ai-providers-page-subtitle"},P={key:0,class:"ai-providers-selected-configuration"},C={class:"ai-providers"},k={class:"ai-providers-defaults-title"},A={class:"ai-providers-section"},h={class:"ai-providers-subsection-title"},N={class:"ai-providers-section-help"},E=["aria-label"],V={key:1,class:"ai-providers-section"},S={class:"ai-providers-subsection-title"},B={class:"ai-providers-section-help"},I=["aria-label"],_={class:"ai-providers-capability-header"},D=["value"],w={class:"ai-providers-capability-label"},x={key:0,class:"ai-providers-capability-description"},K=Object(o["createElementVNode"])("p",{class:"ai-providers-capability-footnote"},null,-1),U={key:2,class:"ai-providers-footer"},T=["disabled"];var M=Object(o["defineComponent"])({__name:"ManageAIProviders",setup(e){const t=Object(o["ref"])(null),r=Object(o["ref"])(!1),i=Object(o["ref"])(!1),n=Object(o["ref"])(""),l=Object(o["ref"])(""),s=Object(o["ref"])({}),d=Object(o["computed"])(()=>{var e;return(null===(e=t.value)||void 0===e?void 0:e.providers)||[]}),u=Object(o["computed"])(()=>{var e;return!(null===(e=t.value)||void 0===e||!e.canEditCapabilityLevel)}),b=Object(o["computed"])(()=>{var e;return!(null===(e=t.value)||void 0===e||!e.canEditProviderConfiguration)}),p=Object(o["computed"])(()=>d.value.find(e=>e.id===n.value)),v=Object(o["computed"])(()=>{var e;const r=(null===(e=t.value)||void 0===e?void 0:e.capabilityLevels)||{};return Object.entries(r).map(([e,t])=>({id:e,label:Object(a["translate"])(t.label),description:t.description?Object(a["translate"])(t.description):""}))}),j=Object(o["computed"])(()=>v.value.find(e=>e.id===l.value)),M=Object(o["computed"])(()=>p.value&&j.value?Object(a["translate"])("AIProviders_SelectedConfiguration",p.value.name,j.value.label):"");function L(e){t.value=e,n.value=e.defaultProviderId,l.value=e.defaultCapabilityLevel;const r={};e.providers.forEach(e=>{r[e.id]={apiKey:"",endpointUrl:e.configuration.endpointUrl||""}}),s.value=r}async function H(){r.value=!0;try{const e=await a["AjaxHelper"].fetch({method:"AIProviders.getSettings"});L(e)}finally{r.value=!1}}function q(e,t){s.value[e]=Object.assign(Object.assign({},s.value[e]),{},{apiKey:t})}function F(e,t){s.value[e]=Object.assign(Object.assign({},s.value[e]),{},{endpointUrl:t})}function z(e){s.value[e]=Object.assign(Object.assign({},s.value[e]),{},{apiKey:""}),a["NotificationsStore"].show({message:Object(a["translate"])("AIProviders_DisconnectNotAvailable"),type:"transient",id:"aiProvidersDisconnect-"+e,context:"info"})}function G(e){a["NotificationsStore"].show({message:Object(a["translate"])("AIProviders_TestConnectionNotAvailable"),type:"transient",id:"aiProvidersTest-"+e,context:"info"})}function J(){t.value&&L(t.value)}async function R(){i.value=!0;try{const e=await a["AjaxHelper"].post({method:"AIProviders.saveSettings"},{defaultProviderId:n.value,defaultCapabilityLevel:l.value,providerConfigurations:JSON.stringify(s.value)},{withTokenInUrl:!0});L(e);const t=a["NotificationsStore"].show({message:Object(a["translate"])("AIProviders_SettingsSaveSuccess"),type:"transient",id:"aiProvidersSettings",context:"success"});a["NotificationsStore"].scrollToNotification(t)}finally{i.value=!1}}return Object(o["onMounted"])(H),(e,p)=>(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",f,[Object(o["createElementVNode"])("header",m,[Object(o["createElementVNode"])("h2",y,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_MenuTitle")),1),Object(o["createElementVNode"])("p",g,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_ConfigurationIntro")),1),Object(o["unref"])(M)?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",P,Object(o["toDisplayString"])(Object(o["unref"])(M)),1)):Object(o["createCommentVNode"])("",!0)]),r.value?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["unref"])(a["ActivityIndicator"]),{key:0,loading:r.value},null,8,["loading"])):t.value?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["unref"])(a["ContentBlock"]),{key:1},{default:Object(o["withCtx"])(()=>[Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",C,[Object(o["unref"])(b)?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["unref"])(a["Alert"]),{key:0,severity:"info"},{default:Object(o["withCtx"])(()=>[Object(o["createTextVNode"])(Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_CloudConfigurationHelp")),1)]),_:1})),Object(o["createElementVNode"])("h3",k,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultsTitle")),1),Object(o["createElementVNode"])("section",A,[Object(o["createElementVNode"])("h4",h,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultProvider")),1),Object(o["createElementVNode"])("p",N,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultProviderHelp")),1),Object(o["createElementVNode"])("div",{"aria-label":Object(o["unref"])(a["translate"])("AIProviders_DefaultProvider"),class:"ai-providers-cards",role:"radiogroup"},[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(Object(o["unref"])(d),e=>(Object(o["openBlock"])(),Object(o["createBlock"])(O,{key:e.id,"can-edit":Object(o["unref"])(b),configuration:s.value[e.id],provider:e,selected:n.value===e.id,onDisconnect:t=>z(e.id),onSelect:t=>n.value=e.id,onTest:t=>G(e.id),"onUpdate:apiKey":t=>q(e.id,t),"onUpdate:endpointUrl":t=>F(e.id,t)},null,8,["can-edit","configuration","provider","selected","onDisconnect","onSelect","onTest","onUpdate:apiKey","onUpdate:endpointUrl"]))),128))],8,E)]),Object(o["unref"])(u)?(Object(o["openBlock"])(),Object(o["createElementBlock"])("section",V,[Object(o["createElementVNode"])("h4",S,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultCapabilityLevel")),1),Object(o["createElementVNode"])("p",B,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultCapabilityLevelHelp")),1),Object(o["createElementVNode"])("div",{"aria-label":Object(o["unref"])(a["translate"])("AIProviders_DefaultCapabilityLevel"),class:"ai-providers-capability-cards",role:"radiogroup"},[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(Object(o["unref"])(v),e=>(Object(o["openBlock"])(),Object(o["createElementBlock"])("label",{key:e.id,class:Object(o["normalizeClass"])([{"is-selected":l.value===e.id},"ai-providers-capability-card"])},[Object(o["createElementVNode"])("div",_,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{"onUpdate:modelValue":p[0]||(p[0]=e=>l.value=e),value:e.id,name:"defaultCapabilityLevel",type:"radio"},null,8,D),[[o["vModelRadio"],l.value]]),Object(o["createElementVNode"])("span",w,Object(o["toDisplayString"])(e.label),1)]),e.description?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",x,Object(o["toDisplayString"])(e.description),1)):Object(o["createCommentVNode"])("",!0)],2))),128))],8,I),K])):Object(o["createCommentVNode"])("",!0)])),[[Object(o["unref"])(c["Form"])]])]),_:1})):Object(o["createCommentVNode"])("",!0),t.value?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",U,[Object(o["createElementVNode"])("button",{disabled:i.value,class:"btn btn-outline",type:"button",onClick:p[1]||(p[1]=e=>J())},Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("General_Cancel")),9,T),Object(o["createVNode"])(Object(o["unref"])(c["SaveButton"]),{saving:i.value,onConfirm:p[2]||(p[2]=e=>R())},null,8,["saving"])])):Object(o["createCommentVNode"])("",!0)]))}}),L=(r("1047"),M)},fd04:function(e,t,r){"use strict";r("1f8b")}})})); +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["AIProviders"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["AIProviders"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,r){return function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="plugins/AIProviders/vue/dist/",r(r.s="fae3")}({"00fb":function(e,t,r){"use strict";r("2d6a")},"19dc":function(t,r){t.exports=e},"2d6a":function(e,t,r){},"6efa":function(e,t,r){"use strict";r("a23f")},"8bbf":function(e,r){e.exports=t},a23f:function(e,t,r){},a5a2:function(e,t){e.exports=r},fae3:function(e,t,r){"use strict";if(r.r(t),r.d(t,"ManageAIProviders",(function(){return L})),"undefined"!==typeof window){var i=window.document.currentScript,n=i&&i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);n&&(r.p=n[1])}var o=r("8bbf"),a=r("19dc"),c=r("a5a2");const l=["aria-checked","aria-disabled","tabindex"],s={key:0,class:"ai-providers-card-default"},d={class:"ai-providers-card-inner"},u={class:"ai-providers-card-header"},b={class:"ai-providers-card-name"},p={class:"ai-providers-card-description"},v={class:"ai-providers-card-actions"},f=["disabled"],j=["disabled"];var O=Object(o["defineComponent"])({__name:"ProviderCard",props:{provider:null,configuration:null,selected:{type:Boolean},usableAsDefault:{type:Boolean},canEdit:{type:Boolean},isTesting:{type:Boolean},isDisconnecting:{type:Boolean}},emits:["select","update:apiKey","update:endpointUrl","test","disconnect"],setup(e,{emit:t}){const r=e,i=Object(o["computed"])(()=>{var e,t;return""!==(null!==(e=null===(t=r.configuration)||void 0===t?void 0:t.apiKey)&&void 0!==e?e:"")});function n(){r.usableAsDefault&&t("select")}return(r,O)=>{var m,y;return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{"aria-checked":e.selected,"aria-disabled":!e.usableAsDefault,class:Object(o["normalizeClass"])([{"is-selected":e.selected,"is-not-usable":!e.usableAsDefault},"ai-providers-card"]),role:"radio",tabindex:e.usableAsDefault?0:-1,onClick:O[4]||(O[4]=e=>n()),onKeydown:[O[5]||(O[5]=Object(o["withKeys"])(Object(o["withModifiers"])(e=>n(),["prevent"]),["enter"])),O[6]||(O[6]=Object(o["withKeys"])(Object(o["withModifiers"])(e=>n(),["prevent"]),["space"]))]},[e.selected?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",s,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultBadge")),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",d,[Object(o["createElementVNode"])("div",u,[Object(o["createElementVNode"])("span",b,Object(o["toDisplayString"])(e.provider.name),1)]),Object(o["createElementVNode"])("p",p,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])(e.provider.description)),1),e.canEdit?(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:0},[e.provider.supportsCustomEndpoint?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["unref"])(c["Field"]),{key:0,"model-value":null===(m=e.configuration)||void 0===m?void 0:m.endpointUrl,name:"endpointUrl-"+e.provider.id,title:Object(o["unref"])(a["translate"])("AIProviders_EndpointUrl"),placeholder:Object(o["unref"])(a["translate"])("AIProviders_EndpointUrlPlaceholder"),autocomplete:"off","full-width":"",uicontrol:"text","onUpdate:modelValue":O[0]||(O[0]=e=>t("update:endpointUrl",""+e))},null,8,["model-value","name","title","placeholder"])):Object(o["createCommentVNode"])("",!0),Object(o["withDirectives"])(Object(o["createVNode"])(Object(o["unref"])(c["Field"]),{"model-value":null===(y=e.configuration)||void 0===y?void 0:y.apiKey,name:"apiKey-"+e.provider.id,placeholder:e.provider.configuration.hasApiKey?Object(o["unref"])(a["translate"])("AIProviders_ApiKeyAlreadyConfiguredPlaceholder"):Object(o["unref"])(a["translate"])("AIProviders_ApiKeyPlaceholder"),title:Object(o["unref"])(a["translate"])("AIProviders_ApiKey"),autocomplete:"new-password","full-width":"",uicontrol:"password","onUpdate:modelValue":O[1]||(O[1]=e=>t("update:apiKey",""+e))},null,8,["model-value","name","placeholder","title"]),[[Object(o["unref"])(a["AutoClearPassword"])]]),Object(o["createElementVNode"])("div",{class:Object(o["normalizeClass"])([{"is-connected":e.provider.configuration.isUsable},"ai-providers-card-status"])},[Object(o["createElementVNode"])("span",{"aria-hidden":"true",class:Object(o["normalizeClass"])(["icon ai-providers-status-icon",e.provider.configuration.isUsable?"icon-ok":"icon-minus"])},null,2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.provider.configuration.isUsable?Object(o["unref"])(a["translate"])("AIProviders_StatusConnected"):Object(o["unref"])(a["translate"])("AIProviders_StatusNotConnected")),1)],2),Object(o["createElementVNode"])("div",v,[Object(o["createElementVNode"])("button",{class:"btn btn-small",type:"button",disabled:e.isTesting||!Object(o["unref"])(i)&&!e.provider.configuration.hasApiKey,onClick:O[2]||(O[2]=Object(o["withModifiers"])(e=>t("test"),["prevent","stop"]))},Object(o["toDisplayString"])(e.isTesting?Object(o["unref"])(a["translate"])("AIProviders_TestingConnection"):Object(o["unref"])(a["translate"])("AIProviders_TestConnection")),9,f),Object(o["createElementVNode"])("button",{class:"btn-flat",type:"button",disabled:e.isDisconnecting||!e.provider.configuration.hasApiKey,onClick:O[3]||(O[3]=Object(o["withModifiers"])(e=>t("disconnect"),["prevent","stop"]))},Object(o["toDisplayString"])(e.isDisconnecting?Object(o["unref"])(a["translate"])("AIProviders_Disconnecting"):Object(o["unref"])(a["translate"])("AIProviders_Disconnect")),9,j)])],64)):Object(o["createCommentVNode"])("",!0)])],42,l)}}}),m=(r("6efa"),O);const y={class:"ai-providers-page"},g={class:"ai-providers-page-header"},P={class:"ai-providers-page-title"},A={class:"ai-providers-page-subtitle"},k={key:0,class:"ai-providers-selected-configuration"},h={class:"ai-providers"},C={class:"ai-providers-defaults-title"},N={class:"ai-providers-section"},E={class:"ai-providers-subsection-title"},S={class:"ai-providers-section-help"},I=["aria-label"],D={key:1,class:"ai-providers-section"},B={class:"ai-providers-subsection-title"},V={class:"ai-providers-section-help"},_=["aria-label"],w={class:"ai-providers-capability-header"},x=["value"],U={class:"ai-providers-capability-label"},T={key:0,class:"ai-providers-capability-description"},K={key:2,class:"ai-providers-footer"},M=["disabled"];var H=Object(o["defineComponent"])({__name:"ManageAIProviders",setup(e){const t=Object(o["ref"])(null),r=Object(o["ref"])(!1),i=Object(o["ref"])(!1),n=Object(o["ref"])(""),l=Object(o["ref"])(""),s=Object(o["ref"])({}),d=Object(o["ref"])({}),u=Object(o["ref"])({}),b=Object(o["computed"])(()=>{var e;return(null===(e=t.value)||void 0===e?void 0:e.providers)||[]}),p=Object(o["computed"])(()=>b.value.some(e=>e.configuration.isUsable)),v=Object(o["computed"])(()=>{var e;return!(null===(e=t.value)||void 0===e||!e.canEditCapabilityLevel)}),f=Object(o["computed"])(()=>{var e;return!(null===(e=t.value)||void 0===e||!e.canEditProviderConfiguration)}),j=Object(o["computed"])(()=>b.value.find(e=>e.id===n.value)),O=Object(o["computed"])(()=>{var e;const r=(null===(e=t.value)||void 0===e?void 0:e.capabilityLevels)||{};return Object.entries(r).map(([e,t])=>({id:e,label:Object(a["translate"])(t.label),description:t.description?Object(a["translate"])(t.description):""}))}),H=Object(o["computed"])(()=>O.value.find(e=>e.id===l.value)),L=Object(o["computed"])(()=>j.value&&H.value?Object(a["translate"])("AIProviders_SelectedConfiguration",j.value.name,H.value.label):"");function q(e){t.value=e,n.value=e.defaultProviderId,l.value=e.defaultCapabilityLevel;const r={};e.providers.forEach(e=>{r[e.id]={apiKey:"",endpointUrl:e.configuration.endpointUrl||""}}),s.value=r}function F(e){if(!t.value)return;const r=t.value.providers.find(t=>t.id===e);r&&(r.configuration=Object.assign(Object.assign({},r.configuration),{},{hasApiKey:!0,isUsable:!0})),n.value||(n.value=e)}function z(e){let t="";return t=e&&"object"===typeof e&&"message"in e?""+e.message:""+e,t.replace(/\s*#\d+\s+[\s\S]*$/,"").replace(/\s+/g," ").trim()}function J(e,t){const r=z(e),i=r&&"Something went wrong"!==r,n=i?Object(a["translate"])("AIProviders_RequestFailed",r):Object(a["translate"])("AIProviders_UnexpectedError");return a["NotificationsStore"].show({message:n,type:"transient",id:t,context:"error"})}async function R(){r.value=!0;try{const e=await a["AjaxHelper"].fetch({method:"AIProviders.getSettings"},{createErrorNotification:!1});q(e)}catch(e){J(e,"aiProvidersLoadError")}finally{r.value=!1}}function $(e,t){s.value[e]=Object.assign(Object.assign({},s.value[e]),{},{apiKey:t})}function G(e,t){s.value[e]=Object.assign(Object.assign({},s.value[e]),{},{endpointUrl:t})}async function W(e){u.value[e]=!0;try{const t=await a["AjaxHelper"].post({method:"AIProviders.disconnectProvider"},{providerId:e},{withTokenInUrl:!0,createErrorNotification:!1});q(t),a["NotificationsStore"].show({message:Object(a["translate"])("AIProviders_DisconnectSuccess"),type:"transient",id:"aiProvidersDisconnect-"+e,context:"success"})}catch(t){J(t,"aiProvidersDisconnectError-"+e)}finally{u.value[e]=!1}}async function Q(e){d.value[e]=!0;try{const t=await a["AjaxHelper"].post({method:"AIProviders.testConnection"},{providerId:e,providerConfiguration:JSON.stringify(s.value[e]||{})},{withTokenInUrl:!0,createErrorNotification:!1});F(e),a["NotificationsStore"].show({message:Object(a["translate"])("AIProviders_TestConnectionSuccess",t.providerName,t.text),type:"transient",id:"aiProvidersTest-"+e,context:"success"})}catch(t){J(t,"aiProvidersTestError-"+e)}finally{d.value[e]=!1}}function X(){t.value&&q(t.value)}async function Y(){i.value=!0;try{const e=await a["AjaxHelper"].post({method:"AIProviders.saveSettings"},{defaultProviderId:n.value,defaultCapabilityLevel:l.value,providerConfigurations:JSON.stringify(s.value)},{withTokenInUrl:!0,createErrorNotification:!1});q(e);const t=a["NotificationsStore"].show({message:Object(a["translate"])("AIProviders_SettingsSaveSuccess"),type:"transient",id:"aiProvidersSettings",context:"success"});a["NotificationsStore"].scrollToNotification(t)}catch(e){const t=J(e,"aiProvidersSettingsError");a["NotificationsStore"].scrollToNotification(t)}finally{i.value=!1}}return Object(o["onMounted"])(R),(e,j)=>(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",y,[Object(o["createElementVNode"])("header",g,[Object(o["createElementVNode"])("h2",P,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_MenuTitle")),1),Object(o["createElementVNode"])("p",A,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_ConfigurationIntro")),1),Object(o["unref"])(L)?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",k,Object(o["toDisplayString"])(Object(o["unref"])(L)),1)):Object(o["createCommentVNode"])("",!0)]),r.value?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["unref"])(a["ActivityIndicator"]),{key:0,loading:r.value},null,8,["loading"])):t.value?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["unref"])(a["ContentBlock"]),{key:1},{default:Object(o["withCtx"])(()=>[Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",h,[Object(o["unref"])(f)?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["unref"])(a["Alert"]),{key:0,severity:"info"},{default:Object(o["withCtx"])(()=>[Object(o["createTextVNode"])(Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_CloudConfigurationHelp")),1)]),_:1})),Object(o["createElementVNode"])("h3",C,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultsTitle")),1),Object(o["createElementVNode"])("section",N,[Object(o["createElementVNode"])("h4",E,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultProvider")),1),Object(o["createElementVNode"])("p",S,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultProviderHelp")),1),Object(o["createElementVNode"])("div",{"aria-label":Object(o["unref"])(a["translate"])("AIProviders_DefaultProvider"),class:"ai-providers-cards",role:"radiogroup"},[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(Object(o["unref"])(b),e=>(Object(o["openBlock"])(),Object(o["createBlock"])(m,{key:e.id,"can-edit":Object(o["unref"])(f),configuration:s.value[e.id],"is-disconnecting":!!u.value[e.id],"is-testing":!!d.value[e.id],provider:e,selected:n.value===e.id,"usable-as-default":e.configuration.isUsable,onDisconnect:t=>W(e.id),onSelect:t=>e.configuration.isUsable?n.value=e.id:null,onTest:t=>Q(e.id),"onUpdate:apiKey":t=>$(e.id,t),"onUpdate:endpointUrl":t=>G(e.id,t)},null,8,["can-edit","configuration","is-disconnecting","is-testing","provider","selected","usable-as-default","onDisconnect","onSelect","onTest","onUpdate:apiKey","onUpdate:endpointUrl"]))),128))],8,I),Object(o["unref"])(p)?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["unref"])(a["Alert"]),{key:0,class:"ai-providers-default-warning",severity:"warning"},{default:Object(o["withCtx"])(()=>[Object(o["createTextVNode"])(Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_NoDefaultProviderWarning")),1)]),_:1}))]),Object(o["unref"])(v)?(Object(o["openBlock"])(),Object(o["createElementBlock"])("section",D,[Object(o["createElementVNode"])("h4",B,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultCapabilityLevel")),1),Object(o["createElementVNode"])("p",V,Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("AIProviders_DefaultCapabilityLevelHelp")),1),Object(o["createElementVNode"])("div",{"aria-label":Object(o["unref"])(a["translate"])("AIProviders_DefaultCapabilityLevel"),class:"ai-providers-capability-cards",role:"radiogroup"},[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(Object(o["unref"])(O),e=>(Object(o["openBlock"])(),Object(o["createElementBlock"])("label",{key:e.id,class:Object(o["normalizeClass"])([{"is-selected":l.value===e.id},"ai-providers-capability-card"])},[Object(o["createElementVNode"])("div",w,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{"onUpdate:modelValue":j[0]||(j[0]=e=>l.value=e),value:e.id,name:"defaultCapabilityLevel",type:"radio"},null,8,x),[[o["vModelRadio"],l.value]]),Object(o["createElementVNode"])("span",U,Object(o["toDisplayString"])(e.label),1)]),e.description?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",T,Object(o["toDisplayString"])(e.description),1)):Object(o["createCommentVNode"])("",!0)],2))),128))],8,_)])):Object(o["createCommentVNode"])("",!0)])),[[Object(o["unref"])(c["Form"])]])]),_:1})):Object(o["createCommentVNode"])("",!0),t.value?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",K,[Object(o["createElementVNode"])("button",{disabled:i.value,class:"btn btn-outline",type:"button",onClick:j[1]||(j[1]=e=>X())},Object(o["toDisplayString"])(Object(o["unref"])(a["translate"])("General_Cancel")),9,M),Object(o["createVNode"])(Object(o["unref"])(c["SaveButton"]),{saving:i.value,onConfirm:j[2]||(j[2]=e=>Y())},null,8,["saving"])])):Object(o["createCommentVNode"])("",!0)]))}}),L=(r("00fb"),H)}})})); //# sourceMappingURL=AIProviders.umd.min.js.map \ No newline at end of file diff --git a/vue/dist/AIProviders.umd.min.js.map b/vue/dist/AIProviders.umd.min.js.map index 46b8bb4..d275a8b 100644 --- a/vue/dist/AIProviders.umd.min.js.map +++ b/vue/dist/AIProviders.umd.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://AIProviders/webpack/universalModuleDefinition","webpack://AIProviders/webpack/bootstrap","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?2aa5","webpack://AIProviders/external \"CoreHome\"","webpack://AIProviders/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://AIProviders/external \"CorePluginsAdmin\"","webpack://AIProviders/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?59bd","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?cf17","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?82df"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__19dc__","__WEBPACK_EXTERNAL_MODULE__8bbf__","__WEBPACK_EXTERNAL_MODULE_a5a2__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","currentScript","document","src","match","_hoisted_1","class","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","__name","props","provider","configuration","selected","type","Boolean","canEdit","emits","__props","emit","hasPendingKey","apiKey","_ctx","_cache","checked","id","onChange","$event","description","supportsCustomEndpoint","endpointUrl","title","placeholder","autocomplete","uicontrol","hasApiKey","disabled","onClick","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","settings","isLoading","isSaving","defaultProviderId","defaultCapabilityLevel","providerConfigurations","providers","canEditCapabilityLevel","canEditProviderConfiguration","selectedProvider","find","capabilityLevelOptions","capabilityLevels","entries","map","keys","label","selectedCapabilityLevel","capability","selectedConfigurationLabel","applySettings","nextSettings","nextProviderConfigurations","forEach","async","loadSettings","response","fetch","method","updateApiKey","providerId","updateEndpointUrl","disconnectProvider","show","message","context","testConnection","cancelChanges","saveSettings","post","JSON","stringify","withTokenInUrl","notificationInstanceId","scrollToNotification","loading","default","severity","_","role","ProviderCard","onDisconnect","onSelect","onTest","saving","onConfirm"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,kBAAZC,SAA0C,kBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,YAAaA,QAAQ,OAAQA,QAAQ,qBAC7C,oBAAX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AAW9C,IAAM,kCAC1F,CACD,gCAAoB,MAAOqB,EAAa,CACtC,4BAAgB,gCAAoB,QAAS,CAC3C,sBAAuBvB,EAAO,KAAOA,EAAO,GAAMI,GAAkB8B,EAAwB5E,MAAQ8C,GACpG9C,MAAO0F,EAAW9C,GAClBtD,KAAM,yBACN2C,KAAM,SACL,KAAM,EAAGiC,GAAc,CACxB,CAAC,iBAAcU,EAAuB5E,SAExC,gCAAoB,OAAQmE,EAAa,6BAAiBuB,EAAWF,OAAQ,KAE9EE,EAAW3C,aACP,yBAAc,gCAAoB,MAAOqB,EAAa,6BAAiBsB,EAAW3C,aAAc,IACjG,gCAAoB,IAAI,IAC3B,KACD,OACH,EAAGiB,GACNK,KAEF,gCAAoB,IAAI,MACzB,CACH,CAAC,mBAAO,gBAGZmD,EAAG,KAEL,gCAAoB,IAAI,GAC7BhD,EAASxE,OACL,yBAAc,gCAAoB,MAAOsE,EAAa,CACrD,gCAAoB,SAAU,CAC5Bf,SAAUmB,EAAS1E,MACnBqB,MAAO,kBACPY,KAAM,SACNuB,QAASd,EAAO,KAAOA,EAAO,GAAMI,GAAiB+D,MACpD,6BAAiB,mBAAO,eAAP,CAAkB,mBAAoB,EAAGtC,GAC7D,yBAAa,mBAAO,iBAAa,CAC/BuD,OAAQpD,EAAS1E,MACjB+H,UAAWrF,EAAO,KAAOA,EAAO,GAAMI,GAAiBgE,MACtD,KAAM,EAAG,CAAC,cAEf,gCAAoB,IAAI,SCtTjB,G,UAAA,I,kCCLf","file":"AIProviders.umd.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"CoreHome\", , \"CorePluginsAdmin\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AIProviders\"] = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse\n\t\troot[\"AIProviders\"] = factory(root[\"CoreHome\"], root[\"Vue\"], root[\"CorePluginsAdmin\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"plugins/AIProviders/vue/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fae3\");\n","export * from \"-!../../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--11-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../../../node_modules/less-loader/dist/cjs.js??ref--11-oneOf-1-3!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=style&index=0&id=6e2e3ad5&lang=less\"","module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;","module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__;","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, withDirectives as _withDirectives, normalizeClass as _normalizeClass, createTextVNode as _createTextVNode, withModifiers as _withModifiers, Fragment as _Fragment, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"ai-providers-card-header\" }\nconst _hoisted_2 = [\"checked\", \"value\"]\nconst _hoisted_3 = { class: \"ai-providers-card-name\" }\nconst _hoisted_4 = { class: \"ai-providers-card-description\" }\nconst _hoisted_5 = { class: \"ai-providers-card-actions\" }\nconst _hoisted_6 = [\"disabled\"]\nconst _hoisted_7 = [\"disabled\"]\n\nimport { computed } from 'vue';\nimport { AutoClearPassword as vAutoClearPassword, translate } from 'CoreHome';\nimport { Field } from 'CorePluginsAdmin';\nimport type { Provider, ProviderConfiguration } from '../types';\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ProviderCard',\n props: {\n provider: null,\n configuration: null,\n selected: { type: Boolean },\n canEdit: { type: Boolean }\n },\n emits: [\"select\", \"update:apiKey\", \"update:endpointUrl\", \"test\", \"disconnect\"],\n setup(__props: any, { emit }: { emit: ({\n (e: 'select'): void;\n (e: 'update:apiKey', value: string): void;\n (e: 'update:endpointUrl', value: string): void;\n (e: 'test'): void;\n (e: 'disconnect'): void;\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props as {\n provider: Provider;\n configuration: ProviderConfiguration | undefined;\n selected: boolean;\n canEdit: boolean;\n};\n\n\n\n/* eslint-disable func-call-spacing, no-spaced-func */\n\n/* eslint-enable func-call-spacing, no-spaced-func */\n\nconst hasPendingKey = computed(() => (props.configuration?.apiKey ?? '') !== '');\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"label\", {\n class: _normalizeClass([{ 'is-selected': __props.selected }, \"ai-providers-card\"])\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"input\", {\n checked: __props.selected,\n value: __props.provider.id,\n name: \"defaultProviderId\",\n type: \"radio\",\n onChange: _cache[0] || (_cache[0] = ($event: any) => (emit('select')))\n }, null, 40, _hoisted_2),\n _createElementVNode(\"span\", _hoisted_3, _toDisplayString(__props.provider.name), 1)\n ]),\n _createElementVNode(\"p\", _hoisted_4, _toDisplayString(_unref(translate)(__props.provider.description)), 1),\n (__props.canEdit)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (__props.provider.supportsCustomEndpoint)\n ? (_openBlock(), _createBlock(_unref(Field), {\n key: 0,\n \"model-value\": __props.configuration?.endpointUrl,\n name: `endpointUrl-${__props.provider.id}`,\n title: _unref(translate)('AIProviders_EndpointUrl'),\n placeholder: _unref(translate)('AIProviders_EndpointUrlPlaceholder'),\n autocomplete: \"off\",\n \"full-width\": \"\",\n uicontrol: \"text\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => (emit('update:endpointUrl', `${$event}`)))\n }, null, 8, [\"model-value\", \"name\", \"title\", \"placeholder\"]))\n : _createCommentVNode(\"\", true),\n _withDirectives(_createVNode(_unref(Field), {\n \"model-value\": __props.configuration?.apiKey,\n name: `apiKey-${__props.provider.id}`,\n placeholder: __props.provider.configuration.hasApiKey\n ? _unref(translate)('AIProviders_ApiKeyAlreadyConfiguredPlaceholder')\n : _unref(translate)('AIProviders_ApiKeyPlaceholder'),\n title: _unref(translate)('AIProviders_ApiKey'),\n autocomplete: \"new-password\",\n \"full-width\": \"\",\n uicontrol: \"password\",\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => (emit('update:apiKey', `${$event}`)))\n }, null, 8, [\"model-value\", \"name\", \"placeholder\", \"title\"]), [\n [_unref(vAutoClearPassword)]\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass([{ 'is-connected': __props.provider.configuration.hasApiKey }, \"ai-providers-card-status\"])\n }, [\n _createElementVNode(\"span\", {\n \"aria-hidden\": \"true\",\n class: _normalizeClass([\"icon ai-providers-status-icon\", __props.provider.configuration.hasApiKey ? 'icon-ok' : 'icon-minus'])\n }, null, 2),\n _createTextVNode(\" \" + _toDisplayString(__props.provider.configuration.hasApiKey\n ? _unref(translate)('AIProviders_StatusConnected')\n : _unref(translate)('AIProviders_StatusNotConnected')), 1)\n ], 2),\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"button\", {\n class: \"btn btn-outline btn-small\",\n type: \"button\",\n disabled: !_unref(hasPendingKey) && !__props.provider.configuration.hasApiKey,\n onClick: _cache[3] || (_cache[3] = _withModifiers(($event: any) => (emit('test')), [\"prevent\"]))\n }, _toDisplayString(_unref(translate)('AIProviders_TestConnection')), 9, _hoisted_6),\n _createElementVNode(\"button\", {\n class: \"btn-flat\",\n type: \"button\",\n disabled: !__props.provider.configuration.hasApiKey,\n onClick: _cache[4] || (_cache[4] = _withModifiers(($event: any) => (emit('disconnect')), [\"prevent\"]))\n }, _toDisplayString(_unref(translate)('AIProviders_Disconnect')), 9, _hoisted_7)\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ], 2))\n}\n}\n\n})","import script from \"./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ProviderCard.vue?vue&type=style&index=0&id=3702360d&lang=less\"\n\nexport default script","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, createTextVNode as _createTextVNode, withCtx as _withCtx, renderList as _renderList, Fragment as _Fragment, vModelRadio as _vModelRadio, withDirectives as _withDirectives, normalizeClass as _normalizeClass, createVNode as _createVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"ai-providers-page\" }\nconst _hoisted_2 = { class: \"ai-providers-page-header\" }\nconst _hoisted_3 = { class: \"ai-providers-page-title\" }\nconst _hoisted_4 = { class: \"ai-providers-page-subtitle\" }\nconst _hoisted_5 = {\n key: 0,\n class: \"ai-providers-selected-configuration\"\n}\nconst _hoisted_6 = { class: \"ai-providers\" }\nconst _hoisted_7 = { class: \"ai-providers-defaults-title\" }\nconst _hoisted_8 = { class: \"ai-providers-section\" }\nconst _hoisted_9 = { class: \"ai-providers-subsection-title\" }\nconst _hoisted_10 = { class: \"ai-providers-section-help\" }\nconst _hoisted_11 = [\"aria-label\"]\nconst _hoisted_12 = {\n key: 1,\n class: \"ai-providers-section\"\n}\nconst _hoisted_13 = { class: \"ai-providers-subsection-title\" }\nconst _hoisted_14 = { class: \"ai-providers-section-help\" }\nconst _hoisted_15 = [\"aria-label\"]\nconst _hoisted_16 = { class: \"ai-providers-capability-header\" }\nconst _hoisted_17 = [\"value\"]\nconst _hoisted_18 = { class: \"ai-providers-capability-label\" }\nconst _hoisted_19 = {\n key: 0,\n class: \"ai-providers-capability-description\"\n}\nconst _hoisted_20 = /*#__PURE__*/_createElementVNode(\"p\", { class: \"ai-providers-capability-footnote\" }, null, -1)\nconst _hoisted_21 = {\n key: 2,\n class: \"ai-providers-footer\"\n}\nconst _hoisted_22 = [\"disabled\"]\n\nimport { computed, onMounted, ref } from 'vue';\nimport {\n ActivityIndicator,\n AjaxHelper,\n Alert,\n ContentBlock,\n NotificationsStore,\n translate,\n} from 'CoreHome';\nimport { Form as vForm, SaveButton } from 'CorePluginsAdmin';\nimport ProviderCard from './components/ProviderCard.vue';\nimport type { CapabilityLevelOption, ProviderConfiguration, Settings } from './types';\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ManageAIProviders',\n setup(__props) {\n\nconst settings = ref(null);\nconst isLoading = ref(false);\nconst isSaving = ref(false);\nconst defaultProviderId = ref('');\nconst defaultCapabilityLevel = ref('');\nconst providerConfigurations = ref>({});\n\nconst providers = computed(() => settings.value?.providers || []);\nconst canEditCapabilityLevel = computed(() => !!settings.value?.canEditCapabilityLevel);\nconst canEditProviderConfiguration = computed(() => !!settings.value?.canEditProviderConfiguration);\nconst selectedProvider = computed(() => providers.value.find((provider) => (\n provider.id === defaultProviderId.value\n)));\n\nconst capabilityLevelOptions = computed(() => {\n const capabilityLevels = settings.value?.capabilityLevels || {};\n\n return Object.entries(capabilityLevels).map(([id, keys]) => ({\n id,\n label: translate(keys.label),\n description: keys.description ? translate(keys.description) : '',\n }));\n});\nconst selectedCapabilityLevel = computed(() => capabilityLevelOptions.value.find((capability) => (\n capability.id === defaultCapabilityLevel.value\n)));\nconst selectedConfigurationLabel = computed(() => {\n if (!selectedProvider.value || !selectedCapabilityLevel.value) {\n return '';\n }\n\n return translate(\n 'AIProviders_SelectedConfiguration',\n selectedProvider.value.name,\n selectedCapabilityLevel.value.label,\n );\n});\n\n/**\n * Applies the given settings to the component state.\n * @param nextSettings\n */\nfunction applySettings(nextSettings: Settings) {\n settings.value = nextSettings;\n defaultProviderId.value = nextSettings.defaultProviderId;\n defaultCapabilityLevel.value = nextSettings.defaultCapabilityLevel;\n\n const nextProviderConfigurations: Record = {};\n nextSettings.providers.forEach((provider) => {\n nextProviderConfigurations[provider.id] = {\n apiKey: '',\n endpointUrl: provider.configuration.endpointUrl || '',\n };\n });\n providerConfigurations.value = nextProviderConfigurations;\n}\n\nasync function loadSettings() {\n isLoading.value = true;\n\n try {\n const response = await AjaxHelper.fetch({\n method: 'AIProviders.getSettings',\n });\n applySettings(response);\n } finally {\n isLoading.value = false;\n }\n}\n\nfunction updateApiKey(providerId: string, apiKey: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n apiKey,\n };\n}\n\nfunction updateEndpointUrl(providerId: string, endpointUrl: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n endpointUrl,\n };\n}\n\nfunction disconnectProvider(providerId: string) {\n // PoC: clears the locally entered key. Removing a persisted key requires a\n // backend method that isn't wired up yet.\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n apiKey: '',\n };\n NotificationsStore.show({\n message: translate('AIProviders_DisconnectNotAvailable'),\n type: 'transient',\n id: `aiProvidersDisconnect-${providerId}`,\n context: 'info',\n });\n}\n\nfunction testConnection(providerId: string) {\n // PoC: placeholder until a server-side connection test endpoint exists.\n NotificationsStore.show({\n message: translate('AIProviders_TestConnectionNotAvailable'),\n type: 'transient',\n id: `aiProvidersTest-${providerId}`,\n context: 'info',\n });\n}\n\nfunction cancelChanges() {\n if (settings.value) {\n applySettings(settings.value);\n }\n}\n\n/**\n * Saves the current settings to the server.\n */\nasync function saveSettings() {\n isSaving.value = true;\n\n try {\n const response = await AjaxHelper.post(\n {\n method: 'AIProviders.saveSettings',\n },\n {\n defaultProviderId: defaultProviderId.value,\n defaultCapabilityLevel: defaultCapabilityLevel.value,\n providerConfigurations: JSON.stringify(providerConfigurations.value),\n },\n {\n withTokenInUrl: true,\n },\n );\n applySettings(response);\n\n const notificationInstanceId = NotificationsStore.show({\n message: translate('AIProviders_SettingsSaveSuccess'),\n type: 'transient',\n id: 'aiProvidersSettings',\n context: 'success',\n });\n NotificationsStore.scrollToNotification(notificationInstanceId);\n } finally {\n isSaving.value = false;\n }\n}\n\nonMounted(loadSettings);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"header\", _hoisted_2, [\n _createElementVNode(\"h2\", _hoisted_3, _toDisplayString(_unref(translate)('AIProviders_MenuTitle')), 1),\n _createElementVNode(\"p\", _hoisted_4, _toDisplayString(_unref(translate)('AIProviders_ConfigurationIntro')), 1),\n (_unref(selectedConfigurationLabel))\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_5, _toDisplayString(_unref(selectedConfigurationLabel)), 1))\n : _createCommentVNode(\"\", true)\n ]),\n (isLoading.value)\n ? (_openBlock(), _createBlock(_unref(ActivityIndicator), {\n key: 0,\n loading: isLoading.value\n }, null, 8, [\"loading\"]))\n : (settings.value)\n ? (_openBlock(), _createBlock(_unref(ContentBlock), { key: 1 }, {\n default: _withCtx(() => [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", _hoisted_6, [\n (!_unref(canEditProviderConfiguration))\n ? (_openBlock(), _createBlock(_unref(Alert), {\n key: 0,\n severity: \"info\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(translate)('AIProviders_CloudConfigurationHelp')), 1)\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"h3\", _hoisted_7, _toDisplayString(_unref(translate)('AIProviders_DefaultsTitle')), 1),\n _createElementVNode(\"section\", _hoisted_8, [\n _createElementVNode(\"h4\", _hoisted_9, _toDisplayString(_unref(translate)('AIProviders_DefaultProvider')), 1),\n _createElementVNode(\"p\", _hoisted_10, _toDisplayString(_unref(translate)('AIProviders_DefaultProviderHelp')), 1),\n _createElementVNode(\"div\", {\n \"aria-label\": _unref(translate)('AIProviders_DefaultProvider'),\n class: \"ai-providers-cards\",\n role: \"radiogroup\"\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(providers), (provider) => {\n return (_openBlock(), _createBlock(ProviderCard, {\n key: provider.id,\n \"can-edit\": _unref(canEditProviderConfiguration),\n configuration: providerConfigurations.value[provider.id],\n provider: provider,\n selected: defaultProviderId.value === provider.id,\n onDisconnect: ($event: any) => (disconnectProvider(provider.id)),\n onSelect: ($event: any) => (defaultProviderId.value = provider.id),\n onTest: ($event: any) => (testConnection(provider.id)),\n \"onUpdate:apiKey\": ($event: any) => (updateApiKey(provider.id, $event)),\n \"onUpdate:endpointUrl\": ($event: any) => (updateEndpointUrl(provider.id, $event))\n }, null, 8, [\"can-edit\", \"configuration\", \"provider\", \"selected\", \"onDisconnect\", \"onSelect\", \"onTest\", \"onUpdate:apiKey\", \"onUpdate:endpointUrl\"]))\n }), 128))\n ], 8, _hoisted_11)\n ]),\n (_unref(canEditCapabilityLevel))\n ? (_openBlock(), _createElementBlock(\"section\", _hoisted_12, [\n _createElementVNode(\"h4\", _hoisted_13, _toDisplayString(_unref(translate)('AIProviders_DefaultCapabilityLevel')), 1),\n _createElementVNode(\"p\", _hoisted_14, _toDisplayString(_unref(translate)('AIProviders_DefaultCapabilityLevelHelp')), 1),\n _createElementVNode(\"div\", {\n \"aria-label\": _unref(translate)('AIProviders_DefaultCapabilityLevel'),\n class: \"ai-providers-capability-cards\",\n role: \"radiogroup\"\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(capabilityLevelOptions), (capability) => {\n return (_openBlock(), _createElementBlock(\"label\", {\n key: capability.id,\n class: _normalizeClass([{ 'is-selected': defaultCapabilityLevel.value === capability.id }, \"ai-providers-capability-card\"])\n }, [\n _createElementVNode(\"div\", _hoisted_16, [\n _withDirectives(_createElementVNode(\"input\", {\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((defaultCapabilityLevel).value = $event)),\n value: capability.id,\n name: \"defaultCapabilityLevel\",\n type: \"radio\"\n }, null, 8, _hoisted_17), [\n [_vModelRadio, defaultCapabilityLevel.value]\n ]),\n _createElementVNode(\"span\", _hoisted_18, _toDisplayString(capability.label), 1)\n ]),\n (capability.description)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_19, _toDisplayString(capability.description), 1))\n : _createCommentVNode(\"\", true)\n ], 2))\n }), 128))\n ], 8, _hoisted_15),\n _hoisted_20\n ]))\n : _createCommentVNode(\"\", true)\n ])), [\n [_unref(vForm)]\n ])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (settings.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_21, [\n _createElementVNode(\"button\", {\n disabled: isSaving.value,\n class: \"btn btn-outline\",\n type: \"button\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (cancelChanges()))\n }, _toDisplayString(_unref(translate)('General_Cancel')), 9, _hoisted_22),\n _createVNode(_unref(SaveButton), {\n saving: isSaving.value,\n onConfirm: _cache[2] || (_cache[2] = ($event: any) => (saveSettings()))\n }, null, 8, [\"saving\"])\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ManageAIProviders.vue?vue&type=style&index=0&id=6e2e3ad5&lang=less\"\n\nexport default script","export * from \"-!../../../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--11-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../../../../node_modules/less-loader/dist/cjs.js??ref--11-oneOf-1-3!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ProviderCard.vue?vue&type=style&index=0&id=3702360d&lang=less\""],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://AIProviders/webpack/universalModuleDefinition","webpack://AIProviders/webpack/bootstrap","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?2927","webpack://AIProviders/external \"CoreHome\"","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?5951","webpack://AIProviders/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://AIProviders/external \"CorePluginsAdmin\"","webpack://AIProviders/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/components/ProviderCard.vue?59bd","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue","webpack://AIProviders/./plugins/AIProviders/vue/src/ManageAIProviders.vue?cf17"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__19dc__","__WEBPACK_EXTERNAL_MODULE__8bbf__","__WEBPACK_EXTERNAL_MODULE_a5a2__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","currentScript","document","src","match","_hoisted_1","_hoisted_2","class","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","__name","props","provider","configuration","selected","type","Boolean","usableAsDefault","canEdit","isTesting","isDisconnecting","emits","__props","emit","hasPendingKey","apiKey","selectProvider","_ctx","_cache","role","tabindex","onClick","$event","onKeydown","description","supportsCustomEndpoint","endpointUrl","id","title","placeholder","autocomplete","uicontrol","hasApiKey","isUsable","disabled","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","settings","isLoading","isSaving","defaultProviderId","defaultCapabilityLevel","providerConfigurations","testingProviders","disconnectingProviders","providers","hasUsableProvider","some","canEditCapabilityLevel","canEditProviderConfiguration","selectedProvider","find","capabilityLevelOptions","capabilityLevels","entries","map","keys","label","selectedCapabilityLevel","capability","selectedConfigurationLabel","applySettings","nextSettings","nextProviderConfigurations","forEach","markProviderUsable","providerId","getCleanErrorMessage","error","message","replace","trim","showErrorNotification","cleaned","isUseful","show","context","async","loadSettings","response","fetch","method","createErrorNotification","updateApiKey","updateEndpointUrl","disconnectProvider","post","withTokenInUrl","testConnection","providerConfiguration","JSON","stringify","providerName","text","cancelChanges","saveSettings","notificationInstanceId","scrollToNotification","loading","default","severity","_","ProviderCard","onDisconnect","onSelect","onTest","saving","onConfirm"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,kBAAZC,SAA0C,kBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,YAAaA,QAAQ,OAAQA,QAAQ,qBAC7C,oBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,WAAY,CAAE,oBAAqBJ,GACjB,kBAAZC,QACdA,QAAQ,eAAiBD,EAAQG,QAAQ,YAAaA,QAAQ,OAAQA,QAAQ,qBAE9EJ,EAAK,eAAiBC,EAAQD,EAAK,YAAaA,EAAK,OAAQA,EAAK,sBARpE,CASoB,qBAATO,KAAuBA,KAAOC,MAAO,SAASC,EAAmCC,EAAmCC,GAC/H,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUZ,QAGnC,IAAIC,EAASS,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHd,QAAS,IAUV,OANAe,EAAQH,GAAUI,KAAKf,EAAOD,QAASC,EAAQA,EAAOD,QAASW,GAG/DV,EAAOa,GAAI,EAGJb,EAAOD,QA0Df,OArDAW,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASnB,EAASoB,EAAMC,GAC3CV,EAAoBW,EAAEtB,EAASoB,IAClCG,OAAOC,eAAexB,EAASoB,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAS3B,GACX,qBAAX4B,QAA0BA,OAAOC,aAC1CN,OAAOC,eAA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,CAAC,cAEf,gCAAoB,IAAI,SCjbjB,G,UAAA","file":"AIProviders.umd.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"CoreHome\", , \"CorePluginsAdmin\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AIProviders\"] = factory(require(\"CoreHome\"), require(\"vue\"), require(\"CorePluginsAdmin\"));\n\telse\n\t\troot[\"AIProviders\"] = factory(root[\"CoreHome\"], root[\"Vue\"], root[\"CorePluginsAdmin\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"plugins/AIProviders/vue/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fae3\");\n","export * from \"-!../../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--11-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../../../node_modules/less-loader/dist/cjs.js??ref--11-oneOf-1-3!../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ManageAIProviders.vue?vue&type=style&index=0&id=3339ef54&lang=less\"","module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__;","export * from \"-!../../../../../node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??ref--11-oneOf-1-0!../../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--11-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--11-oneOf-1-2!../../../../../node_modules/less-loader/dist/cjs.js??ref--11-oneOf-1-3!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ProviderCard.vue?vue&type=style&index=0&id=00c4b20e&lang=less\"","module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;","module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__;","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, createBlock as _createBlock, createVNode as _createVNode, withDirectives as _withDirectives, normalizeClass as _normalizeClass, createTextVNode as _createTextVNode, withModifiers as _withModifiers, Fragment as _Fragment, withKeys as _withKeys } from \"vue\"\n\nconst _hoisted_1 = [\"aria-checked\", \"aria-disabled\", \"tabindex\"]\nconst _hoisted_2 = {\n key: 0,\n class: \"ai-providers-card-default\"\n}\nconst _hoisted_3 = { class: \"ai-providers-card-inner\" }\nconst _hoisted_4 = { class: \"ai-providers-card-header\" }\nconst _hoisted_5 = { class: \"ai-providers-card-name\" }\nconst _hoisted_6 = { class: \"ai-providers-card-description\" }\nconst _hoisted_7 = { class: \"ai-providers-card-actions\" }\nconst _hoisted_8 = [\"disabled\"]\nconst _hoisted_9 = [\"disabled\"]\n\nimport { computed } from 'vue';\nimport { AutoClearPassword as vAutoClearPassword, translate } from 'CoreHome';\nimport { Field } from 'CorePluginsAdmin';\nimport type { Provider, ProviderConfiguration } from '../types';\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ProviderCard',\n props: {\n provider: null,\n configuration: null,\n selected: { type: Boolean },\n usableAsDefault: { type: Boolean },\n canEdit: { type: Boolean },\n isTesting: { type: Boolean },\n isDisconnecting: { type: Boolean }\n },\n emits: [\"select\", \"update:apiKey\", \"update:endpointUrl\", \"test\", \"disconnect\"],\n setup(__props: any, { emit }: { emit: ({\n (e: 'select'): void;\n (e: 'update:apiKey', value: string): void;\n (e: 'update:endpointUrl', value: string): void;\n (e: 'test'): void;\n (e: 'disconnect'): void;\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props as {\n provider: Provider;\n configuration: ProviderConfiguration | undefined;\n selected: boolean;\n usableAsDefault: boolean;\n canEdit: boolean;\n isTesting: boolean;\n isDisconnecting: boolean;\n};\n\n\n\n/* eslint-disable func-call-spacing, no-spaced-func */\n\n/* eslint-enable func-call-spacing, no-spaced-func */\n\nconst hasPendingKey = computed(() => (props.configuration?.apiKey ?? '') !== '');\n\nfunction selectProvider() {\n if (props.usableAsDefault) {\n emit('select');\n }\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n \"aria-checked\": __props.selected,\n \"aria-disabled\": !__props.usableAsDefault,\n class: _normalizeClass([{ 'is-selected': __props.selected, 'is-not-usable': !__props.usableAsDefault }, \"ai-providers-card\"]),\n role: \"radio\",\n tabindex: __props.usableAsDefault ? 0 : -1,\n onClick: _cache[4] || (_cache[4] = ($event: any) => (selectProvider())),\n onKeydown: [\n _cache[5] || (_cache[5] = _withKeys(_withModifiers(($event: any) => (selectProvider()), [\"prevent\"]), [\"enter\"])),\n _cache[6] || (_cache[6] = _withKeys(_withModifiers(($event: any) => (selectProvider()), [\"prevent\"]), [\"space\"]))\n ]\n }, [\n (__props.selected)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, _toDisplayString(_unref(translate)('AIProviders_DefaultBadge')), 1))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"span\", _hoisted_5, _toDisplayString(__props.provider.name), 1)\n ]),\n _createElementVNode(\"p\", _hoisted_6, _toDisplayString(_unref(translate)(__props.provider.description)), 1),\n (__props.canEdit)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (__props.provider.supportsCustomEndpoint)\n ? (_openBlock(), _createBlock(_unref(Field), {\n key: 0,\n \"model-value\": __props.configuration?.endpointUrl,\n name: `endpointUrl-${__props.provider.id}`,\n title: _unref(translate)('AIProviders_EndpointUrl'),\n placeholder: _unref(translate)('AIProviders_EndpointUrlPlaceholder'),\n autocomplete: \"off\",\n \"full-width\": \"\",\n uicontrol: \"text\",\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => (emit('update:endpointUrl', `${$event}`)))\n }, null, 8, [\"model-value\", \"name\", \"title\", \"placeholder\"]))\n : _createCommentVNode(\"\", true),\n _withDirectives(_createVNode(_unref(Field), {\n \"model-value\": __props.configuration?.apiKey,\n name: `apiKey-${__props.provider.id}`,\n placeholder: __props.provider.configuration.hasApiKey\n ? _unref(translate)('AIProviders_ApiKeyAlreadyConfiguredPlaceholder')\n : _unref(translate)('AIProviders_ApiKeyPlaceholder'),\n title: _unref(translate)('AIProviders_ApiKey'),\n autocomplete: \"new-password\",\n \"full-width\": \"\",\n uicontrol: \"password\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => (emit('update:apiKey', `${$event}`)))\n }, null, 8, [\"model-value\", \"name\", \"placeholder\", \"title\"]), [\n [_unref(vAutoClearPassword)]\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass([{ 'is-connected': __props.provider.configuration.isUsable }, \"ai-providers-card-status\"])\n }, [\n _createElementVNode(\"span\", {\n \"aria-hidden\": \"true\",\n class: _normalizeClass([\"icon ai-providers-status-icon\", __props.provider.configuration.isUsable ? 'icon-ok' : 'icon-minus'])\n }, null, 2),\n _createTextVNode(\" \" + _toDisplayString(__props.provider.configuration.isUsable\n ? _unref(translate)('AIProviders_StatusConnected')\n : _unref(translate)('AIProviders_StatusNotConnected')), 1)\n ], 2),\n _createElementVNode(\"div\", _hoisted_7, [\n _createElementVNode(\"button\", {\n class: \"btn btn-small\",\n type: \"button\",\n disabled: __props.isTesting || (!_unref(hasPendingKey) && !__props.provider.configuration.hasApiKey),\n onClick: _cache[2] || (_cache[2] = _withModifiers(($event: any) => (emit('test')), [\"prevent\",\"stop\"]))\n }, _toDisplayString(__props.isTesting\n ? _unref(translate)('AIProviders_TestingConnection')\n : _unref(translate)('AIProviders_TestConnection')), 9, _hoisted_8),\n _createElementVNode(\"button\", {\n class: \"btn-flat\",\n type: \"button\",\n disabled: __props.isDisconnecting || !__props.provider.configuration.hasApiKey,\n onClick: _cache[3] || (_cache[3] = _withModifiers(($event: any) => (emit('disconnect')), [\"prevent\",\"stop\"]))\n }, _toDisplayString(__props.isDisconnecting\n ? _unref(translate)('AIProviders_Disconnecting')\n : _unref(translate)('AIProviders_Disconnect')), 9, _hoisted_9)\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ])\n ], 42, _hoisted_1))\n}\n}\n\n})","import script from \"./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ProviderCard.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ProviderCard.vue?vue&type=style&index=0&id=00c4b20e&lang=less\"\n\nexport default script","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, createTextVNode as _createTextVNode, withCtx as _withCtx, renderList as _renderList, Fragment as _Fragment, vModelRadio as _vModelRadio, withDirectives as _withDirectives, normalizeClass as _normalizeClass, createVNode as _createVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"ai-providers-page\" }\nconst _hoisted_2 = { class: \"ai-providers-page-header\" }\nconst _hoisted_3 = { class: \"ai-providers-page-title\" }\nconst _hoisted_4 = { class: \"ai-providers-page-subtitle\" }\nconst _hoisted_5 = {\n key: 0,\n class: \"ai-providers-selected-configuration\"\n}\nconst _hoisted_6 = { class: \"ai-providers\" }\nconst _hoisted_7 = { class: \"ai-providers-defaults-title\" }\nconst _hoisted_8 = { class: \"ai-providers-section\" }\nconst _hoisted_9 = { class: \"ai-providers-subsection-title\" }\nconst _hoisted_10 = { class: \"ai-providers-section-help\" }\nconst _hoisted_11 = [\"aria-label\"]\nconst _hoisted_12 = {\n key: 1,\n class: \"ai-providers-section\"\n}\nconst _hoisted_13 = { class: \"ai-providers-subsection-title\" }\nconst _hoisted_14 = { class: \"ai-providers-section-help\" }\nconst _hoisted_15 = [\"aria-label\"]\nconst _hoisted_16 = { class: \"ai-providers-capability-header\" }\nconst _hoisted_17 = [\"value\"]\nconst _hoisted_18 = { class: \"ai-providers-capability-label\" }\nconst _hoisted_19 = {\n key: 0,\n class: \"ai-providers-capability-description\"\n}\nconst _hoisted_20 = {\n key: 2,\n class: \"ai-providers-footer\"\n}\nconst _hoisted_21 = [\"disabled\"]\n\nimport { computed, onMounted, ref } from 'vue';\nimport {\n ActivityIndicator,\n AjaxHelper,\n Alert,\n ContentBlock,\n NotificationsStore,\n translate,\n} from 'CoreHome';\nimport { Form as vForm, SaveButton } from 'CorePluginsAdmin';\nimport ProviderCard from './components/ProviderCard.vue';\nimport type {\n AIProviderResponse,\n CapabilityLevelOption,\n ProviderConfiguration,\n Settings,\n} from './types';\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ManageAIProviders',\n setup(__props) {\n\nconst settings = ref(null);\nconst isLoading = ref(false);\nconst isSaving = ref(false);\nconst defaultProviderId = ref('');\nconst defaultCapabilityLevel = ref('');\nconst providerConfigurations = ref>({});\nconst testingProviders = ref>({});\nconst disconnectingProviders = ref>({});\n\nconst providers = computed(() => settings.value?.providers || []);\nconst hasUsableProvider = computed(() => providers.value.some(\n (provider) => provider.configuration.isUsable,\n));\nconst canEditCapabilityLevel = computed(() => !!settings.value?.canEditCapabilityLevel);\nconst canEditProviderConfiguration = computed(() => !!settings.value?.canEditProviderConfiguration);\nconst selectedProvider = computed(() => providers.value.find((provider) => (\n provider.id === defaultProviderId.value\n)));\n\nconst capabilityLevelOptions = computed(() => {\n const capabilityLevels = settings.value?.capabilityLevels || {};\n\n return Object.entries(capabilityLevels).map(([id, keys]) => ({\n id,\n label: translate(keys.label),\n description: keys.description ? translate(keys.description) : '',\n }));\n});\nconst selectedCapabilityLevel = computed(() => capabilityLevelOptions.value.find((capability) => (\n capability.id === defaultCapabilityLevel.value\n)));\nconst selectedConfigurationLabel = computed(() => {\n if (!selectedProvider.value || !selectedCapabilityLevel.value) {\n return '';\n }\n\n return translate(\n 'AIProviders_SelectedConfiguration',\n selectedProvider.value.name,\n selectedCapabilityLevel.value.label,\n );\n});\n\n/**\n * Applies the given settings to the component state.\n * @param nextSettings\n */\nfunction applySettings(nextSettings: Settings) {\n settings.value = nextSettings;\n defaultProviderId.value = nextSettings.defaultProviderId;\n defaultCapabilityLevel.value = nextSettings.defaultCapabilityLevel;\n\n const nextProviderConfigurations: Record = {};\n nextSettings.providers.forEach((provider) => {\n nextProviderConfigurations[provider.id] = {\n apiKey: '',\n endpointUrl: provider.configuration.endpointUrl || '',\n };\n });\n providerConfigurations.value = nextProviderConfigurations;\n}\n\nfunction markProviderUsable(providerId: string) {\n if (!settings.value) {\n return;\n }\n\n const provider = settings.value.providers.find((p) => p.id === providerId);\n if (provider) {\n provider.configuration = {\n ...provider.configuration,\n hasApiKey: true,\n isUsable: true,\n };\n }\n\n if (!defaultProviderId.value) {\n defaultProviderId.value = providerId;\n }\n}\n\nfunction getCleanErrorMessage(error: unknown) {\n let message = '';\n\n if (error && typeof error === 'object' && 'message' in error) {\n message = `${(error as { message: string }).message}`;\n } else {\n message = `${error}`;\n }\n\n return message\n .replace(/\\s*#\\d+\\s+[\\s\\S]*$/, '')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\nfunction showErrorNotification(error: unknown, id: string) {\n const cleaned = getCleanErrorMessage(error);\n const isUseful = cleaned && cleaned !== 'Something went wrong';\n const message = isUseful\n ? translate('AIProviders_RequestFailed', cleaned)\n : translate('AIProviders_UnexpectedError');\n\n return NotificationsStore.show({\n message,\n type: 'transient',\n id,\n context: 'error',\n });\n}\n\nasync function loadSettings() {\n isLoading.value = true;\n\n try {\n const response = await AjaxHelper.fetch({\n method: 'AIProviders.getSettings',\n }, {\n createErrorNotification: false,\n });\n applySettings(response);\n } catch (error) {\n showErrorNotification(error, 'aiProvidersLoadError');\n } finally {\n isLoading.value = false;\n }\n}\n\nfunction updateApiKey(providerId: string, apiKey: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n apiKey,\n };\n}\n\nfunction updateEndpointUrl(providerId: string, endpointUrl: string) {\n providerConfigurations.value[providerId] = {\n ...providerConfigurations.value[providerId],\n endpointUrl,\n };\n}\n\nasync function disconnectProvider(providerId: string) {\n disconnectingProviders.value[providerId] = true;\n\n try {\n const response = await AjaxHelper.post(\n {\n method: 'AIProviders.disconnectProvider',\n },\n {\n providerId,\n },\n {\n withTokenInUrl: true,\n createErrorNotification: false,\n },\n );\n applySettings(response);\n\n NotificationsStore.show({\n message: translate('AIProviders_DisconnectSuccess'),\n type: 'transient',\n id: `aiProvidersDisconnect-${providerId}`,\n context: 'success',\n });\n } catch (error) {\n showErrorNotification(error, `aiProvidersDisconnectError-${providerId}`);\n } finally {\n disconnectingProviders.value[providerId] = false;\n }\n}\n\nasync function testConnection(providerId: string) {\n testingProviders.value[providerId] = true;\n\n try {\n const response = await AjaxHelper.post(\n {\n method: 'AIProviders.testConnection',\n },\n {\n providerId,\n providerConfiguration: JSON.stringify(providerConfigurations.value[providerId] || {}),\n },\n {\n withTokenInUrl: true,\n createErrorNotification: false,\n },\n );\n\n markProviderUsable(providerId);\n\n NotificationsStore.show({\n message: translate(\n 'AIProviders_TestConnectionSuccess',\n response.providerName,\n response.text,\n ),\n type: 'transient',\n id: `aiProvidersTest-${providerId}`,\n context: 'success',\n });\n } catch (error) {\n showErrorNotification(error, `aiProvidersTestError-${providerId}`);\n } finally {\n testingProviders.value[providerId] = false;\n }\n}\n\nfunction cancelChanges() {\n if (settings.value) {\n applySettings(settings.value);\n }\n}\n\n/**\n * Saves the current settings to the server.\n */\nasync function saveSettings() {\n isSaving.value = true;\n\n try {\n const response = await AjaxHelper.post(\n {\n method: 'AIProviders.saveSettings',\n },\n {\n defaultProviderId: defaultProviderId.value,\n defaultCapabilityLevel: defaultCapabilityLevel.value,\n providerConfigurations: JSON.stringify(providerConfigurations.value),\n },\n {\n withTokenInUrl: true,\n createErrorNotification: false,\n },\n );\n applySettings(response);\n\n const notificationInstanceId = NotificationsStore.show({\n message: translate('AIProviders_SettingsSaveSuccess'),\n type: 'transient',\n id: 'aiProvidersSettings',\n context: 'success',\n });\n NotificationsStore.scrollToNotification(notificationInstanceId);\n } catch (error) {\n const notificationInstanceId = showErrorNotification(error, 'aiProvidersSettingsError');\n NotificationsStore.scrollToNotification(notificationInstanceId);\n } finally {\n isSaving.value = false;\n }\n}\n\nonMounted(loadSettings);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"header\", _hoisted_2, [\n _createElementVNode(\"h2\", _hoisted_3, _toDisplayString(_unref(translate)('AIProviders_MenuTitle')), 1),\n _createElementVNode(\"p\", _hoisted_4, _toDisplayString(_unref(translate)('AIProviders_ConfigurationIntro')), 1),\n (_unref(selectedConfigurationLabel))\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_5, _toDisplayString(_unref(selectedConfigurationLabel)), 1))\n : _createCommentVNode(\"\", true)\n ]),\n (isLoading.value)\n ? (_openBlock(), _createBlock(_unref(ActivityIndicator), {\n key: 0,\n loading: isLoading.value\n }, null, 8, [\"loading\"]))\n : (settings.value)\n ? (_openBlock(), _createBlock(_unref(ContentBlock), { key: 1 }, {\n default: _withCtx(() => [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", _hoisted_6, [\n (!_unref(canEditProviderConfiguration))\n ? (_openBlock(), _createBlock(_unref(Alert), {\n key: 0,\n severity: \"info\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(translate)('AIProviders_CloudConfigurationHelp')), 1)\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"h3\", _hoisted_7, _toDisplayString(_unref(translate)('AIProviders_DefaultsTitle')), 1),\n _createElementVNode(\"section\", _hoisted_8, [\n _createElementVNode(\"h4\", _hoisted_9, _toDisplayString(_unref(translate)('AIProviders_DefaultProvider')), 1),\n _createElementVNode(\"p\", _hoisted_10, _toDisplayString(_unref(translate)('AIProviders_DefaultProviderHelp')), 1),\n _createElementVNode(\"div\", {\n \"aria-label\": _unref(translate)('AIProviders_DefaultProvider'),\n class: \"ai-providers-cards\",\n role: \"radiogroup\"\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(providers), (provider) => {\n return (_openBlock(), _createBlock(ProviderCard, {\n key: provider.id,\n \"can-edit\": _unref(canEditProviderConfiguration),\n configuration: providerConfigurations.value[provider.id],\n \"is-disconnecting\": !!disconnectingProviders.value[provider.id],\n \"is-testing\": !!testingProviders.value[provider.id],\n provider: provider,\n selected: defaultProviderId.value === provider.id,\n \"usable-as-default\": provider.configuration.isUsable,\n onDisconnect: ($event: any) => (disconnectProvider(provider.id)),\n onSelect: ($event: any) => (provider.configuration.isUsable ? defaultProviderId.value = provider.id : null),\n onTest: ($event: any) => (testConnection(provider.id)),\n \"onUpdate:apiKey\": ($event: any) => (updateApiKey(provider.id, $event)),\n \"onUpdate:endpointUrl\": ($event: any) => (updateEndpointUrl(provider.id, $event))\n }, null, 8, [\"can-edit\", \"configuration\", \"is-disconnecting\", \"is-testing\", \"provider\", \"selected\", \"usable-as-default\", \"onDisconnect\", \"onSelect\", \"onTest\", \"onUpdate:apiKey\", \"onUpdate:endpointUrl\"]))\n }), 128))\n ], 8, _hoisted_11),\n (!_unref(hasUsableProvider))\n ? (_openBlock(), _createBlock(_unref(Alert), {\n key: 0,\n class: \"ai-providers-default-warning\",\n severity: \"warning\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(translate)('AIProviders_NoDefaultProviderWarning')), 1)\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true)\n ]),\n (_unref(canEditCapabilityLevel))\n ? (_openBlock(), _createElementBlock(\"section\", _hoisted_12, [\n _createElementVNode(\"h4\", _hoisted_13, _toDisplayString(_unref(translate)('AIProviders_DefaultCapabilityLevel')), 1),\n _createElementVNode(\"p\", _hoisted_14, _toDisplayString(_unref(translate)('AIProviders_DefaultCapabilityLevelHelp')), 1),\n _createElementVNode(\"div\", {\n \"aria-label\": _unref(translate)('AIProviders_DefaultCapabilityLevel'),\n class: \"ai-providers-capability-cards\",\n role: \"radiogroup\"\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(capabilityLevelOptions), (capability) => {\n return (_openBlock(), _createElementBlock(\"label\", {\n key: capability.id,\n class: _normalizeClass([{ 'is-selected': defaultCapabilityLevel.value === capability.id }, \"ai-providers-capability-card\"])\n }, [\n _createElementVNode(\"div\", _hoisted_16, [\n _withDirectives(_createElementVNode(\"input\", {\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((defaultCapabilityLevel).value = $event)),\n value: capability.id,\n name: \"defaultCapabilityLevel\",\n type: \"radio\"\n }, null, 8, _hoisted_17), [\n [_vModelRadio, defaultCapabilityLevel.value]\n ]),\n _createElementVNode(\"span\", _hoisted_18, _toDisplayString(capability.label), 1)\n ]),\n (capability.description)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_19, _toDisplayString(capability.description), 1))\n : _createCommentVNode(\"\", true)\n ], 2))\n }), 128))\n ], 8, _hoisted_15)\n ]))\n : _createCommentVNode(\"\", true)\n ])), [\n [_unref(vForm)]\n ])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n (settings.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_20, [\n _createElementVNode(\"button\", {\n disabled: isSaving.value,\n class: \"btn btn-outline\",\n type: \"button\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (cancelChanges()))\n }, _toDisplayString(_unref(translate)('General_Cancel')), 9, _hoisted_21),\n _createVNode(_unref(SaveButton), {\n saving: isSaving.value,\n onConfirm: _cache[2] || (_cache[2] = ($event: any) => (saveSettings()))\n }, null, 8, [\"saving\"])\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ManageAIProviders.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ManageAIProviders.vue?vue&type=style&index=0&id=3339ef54&lang=less\"\n\nexport default script"],"sourceRoot":""} \ No newline at end of file diff --git a/vue/src/ManageAIProviders.vue b/vue/src/ManageAIProviders.vue index 4633e83..719d44d 100644 --- a/vue/src/ManageAIProviders.vue +++ b/vue/src/ManageAIProviders.vue @@ -25,7 +25,12 @@ import { } from 'CoreHome'; import { Form as vForm, SaveButton } from 'CorePluginsAdmin'; import ProviderCard from './components/ProviderCard.vue'; -import type { CapabilityLevelOption, ProviderConfiguration, Settings } from './types'; +import type { + AIProviderResponse, + CapabilityLevelOption, + ProviderConfiguration, + Settings, +} from './types'; const settings = ref(null); const isLoading = ref(false); @@ -33,8 +38,13 @@ const isSaving = ref(false); const defaultProviderId = ref(''); const defaultCapabilityLevel = ref(''); const providerConfigurations = ref>({}); +const testingProviders = ref>({}); +const disconnectingProviders = ref>({}); const providers = computed(() => settings.value?.providers || []); +const hasUsableProvider = computed(() => providers.value.some( + (provider) => provider.configuration.isUsable, +)); const canEditCapabilityLevel = computed(() => !!settings.value?.canEditCapabilityLevel); const canEditProviderConfiguration = computed(() => !!settings.value?.canEditProviderConfiguration); const selectedProvider = computed(() => providers.value.find((provider) => ( @@ -84,14 +94,67 @@ function applySettings(nextSettings: Settings) { providerConfigurations.value = nextProviderConfigurations; } +function markProviderUsable(providerId: string) { + if (!settings.value) { + return; + } + + const provider = settings.value.providers.find((p) => p.id === providerId); + if (provider) { + provider.configuration = { + ...provider.configuration, + hasApiKey: true, + isUsable: true, + }; + } + + if (!defaultProviderId.value) { + defaultProviderId.value = providerId; + } +} + +function getCleanErrorMessage(error: unknown) { + let message = ''; + + if (error && typeof error === 'object' && 'message' in error) { + message = `${(error as { message: string }).message}`; + } else { + message = `${error}`; + } + + return message + .replace(/\s*#\d+\s+[\s\S]*$/, '') + .replace(/\s+/g, ' ') + .trim(); +} + +function showErrorNotification(error: unknown, id: string) { + const cleaned = getCleanErrorMessage(error); + const isUseful = cleaned && cleaned !== 'Something went wrong'; + const message = isUseful + ? translate('AIProviders_RequestFailed', cleaned) + : translate('AIProviders_UnexpectedError'); + + return NotificationsStore.show({ + message, + type: 'transient', + id, + context: 'error', + }); +} + async function loadSettings() { isLoading.value = true; try { const response = await AjaxHelper.fetch({ method: 'AIProviders.getSettings', + }, { + createErrorNotification: false, }); applySettings(response); + } catch (error) { + showErrorNotification(error, 'aiProvidersLoadError'); } finally { isLoading.value = false; } @@ -111,29 +174,72 @@ function updateEndpointUrl(providerId: string, endpointUrl: string) { }; } -function disconnectProvider(providerId: string) { - // PoC: clears the locally entered key. Removing a persisted key requires a - // backend method that isn't wired up yet. - providerConfigurations.value[providerId] = { - ...providerConfigurations.value[providerId], - apiKey: '', - }; - NotificationsStore.show({ - message: translate('AIProviders_DisconnectNotAvailable'), - type: 'transient', - id: `aiProvidersDisconnect-${providerId}`, - context: 'info', - }); +async function disconnectProvider(providerId: string) { + disconnectingProviders.value[providerId] = true; + + try { + const response = await AjaxHelper.post( + { + method: 'AIProviders.disconnectProvider', + }, + { + providerId, + }, + { + withTokenInUrl: true, + createErrorNotification: false, + }, + ); + applySettings(response); + + NotificationsStore.show({ + message: translate('AIProviders_DisconnectSuccess'), + type: 'transient', + id: `aiProvidersDisconnect-${providerId}`, + context: 'success', + }); + } catch (error) { + showErrorNotification(error, `aiProvidersDisconnectError-${providerId}`); + } finally { + disconnectingProviders.value[providerId] = false; + } } -function testConnection(providerId: string) { - // PoC: placeholder until a server-side connection test endpoint exists. - NotificationsStore.show({ - message: translate('AIProviders_TestConnectionNotAvailable'), - type: 'transient', - id: `aiProvidersTest-${providerId}`, - context: 'info', - }); +async function testConnection(providerId: string) { + testingProviders.value[providerId] = true; + + try { + const response = await AjaxHelper.post( + { + method: 'AIProviders.testConnection', + }, + { + providerId, + providerConfiguration: JSON.stringify(providerConfigurations.value[providerId] || {}), + }, + { + withTokenInUrl: true, + createErrorNotification: false, + }, + ); + + markProviderUsable(providerId); + + NotificationsStore.show({ + message: translate( + 'AIProviders_TestConnectionSuccess', + response.providerName, + response.text, + ), + type: 'transient', + id: `aiProvidersTest-${providerId}`, + context: 'success', + }); + } catch (error) { + showErrorNotification(error, `aiProvidersTestError-${providerId}`); + } finally { + testingProviders.value[providerId] = false; + } } function cancelChanges() { @@ -160,6 +266,7 @@ async function saveSettings() { }, { withTokenInUrl: true, + createErrorNotification: false, }, ); applySettings(response); @@ -171,6 +278,9 @@ async function saveSettings() { context: 'success', }); NotificationsStore.scrollToNotification(notificationInstanceId); + } catch (error) { + const notificationInstanceId = showErrorNotification(error, 'aiProvidersSettingsError'); + NotificationsStore.scrollToNotification(notificationInstanceId); } finally { isSaving.value = false; } @@ -230,15 +340,26 @@ onMounted(loadSettings); :key="provider.id" :can-edit="canEditProviderConfiguration" :configuration="providerConfigurations[provider.id]" + :is-disconnecting="!!disconnectingProviders[provider.id]" + :is-testing="!!testingProviders[provider.id]" :provider="provider" :selected="defaultProviderId === provider.id" + :usable-as-default="provider.configuration.isUsable" @disconnect="disconnectProvider(provider.id)" - @select="defaultProviderId = provider.id" + @select="provider.configuration.isUsable ? defaultProviderId = provider.id : null" @test="testConnection(provider.id)" @update:api-key="updateApiKey(provider.id, $event)" @update:endpoint-url="updateEndpointUrl(provider.id, $event)" /> + + + {{ translate('AIProviders_NoDefaultProviderWarning') }} +
- -

- -

@@ -367,7 +484,7 @@ onMounted(loadSettings); .ai-providers-section + .ai-providers-section { margin-top: 24px; padding-top: 24px; - border-top: 1px solid var(--ai-providers-border); + border-top: 1px solid #ccc; } .ai-providers-section-help { @@ -382,6 +499,15 @@ onMounted(loadSettings); gap: 16px; } +.ai-providers-cards { + padding-top: 24px; + margin-top: 32px; +} + +.ai-providers-default-warning { + margin-top: 16px; +} + .ai-providers-capability-card { display: flex; flex-direction: column; @@ -413,8 +539,7 @@ onMounted(loadSettings); font-size: 15px; } -.ai-providers-capability-description, -.ai-providers-capability-footnote { +.ai-providers-capability-description { color: var(--ai-providers-text-muted); font-size: 13px; line-height: 1.5; diff --git a/vue/src/components/ProviderCard.vue b/vue/src/components/ProviderCard.vue index c2781ea..c27f6f6 100644 --- a/vue/src/components/ProviderCard.vue +++ b/vue/src/components/ProviderCard.vue @@ -23,7 +23,10 @@ const props = defineProps<{ provider: Provider; configuration: ProviderConfiguration | undefined; selected: boolean; + usableAsDefault: boolean; canEdit: boolean; + isTesting: boolean; + isDisconnecting: boolean; }>(); /* eslint-disable func-call-spacing, no-spaced-func */ @@ -37,111 +40,147 @@ const emit = defineEmits<{ /* eslint-enable func-call-spacing, no-spaced-func */ const hasPendingKey = computed(() => (props.configuration?.apiKey ?? '') !== ''); + +function selectProvider() { + if (props.usableAsDefault) { + emit('select'); + } +} diff --git a/vue/src/components/ProviderCard.vue b/vue/src/components/ProviderCard.vue index 5cff248..156ec4b 100644 --- a/vue/src/components/ProviderCard.vue +++ b/vue/src/components/ProviderCard.vue @@ -5,7 +5,7 @@ @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later --> -