diff --git a/apps/theming/lib/Controller/UserThemeController.php b/apps/theming/lib/Controller/UserThemeController.php index 091331706a786..635dad3473645 100644 --- a/apps/theming/lib/Controller/UserThemeController.php +++ b/apps/theming/lib/Controller/UserThemeController.php @@ -156,7 +156,8 @@ public function getBackground(): Http\Response { * @NoAdminRequired */ public function setBackground(string $type = 'default', string $value = ''): JSONResponse { - $currentVersion = (int)$this->config->getUserValue($this->userId, Application::APP_ID, 'backgroundVersion', '0'); + $currentVersion = (int)$this->config->getUserValue($this->userId, Application::APP_ID, 'userCacheBuster', '0'); + try { switch ($type) { case 'shipped': @@ -179,14 +180,14 @@ public function setBackground(string $type = 'default', string $value = ''): JSO } catch (\Throwable $e) { return new JSONResponse(['error' => $e->getMessage()], Http::STATUS_INTERNAL_SERVER_ERROR); } + $currentVersion++; - $this->config->setUserValue($this->userId, Application::APP_ID, 'backgroundVersion', (string)$currentVersion); - // FIXME replace with user-specific cachebuster increase https://github.com/nextcloud/server/issues/34472 - $this->themingDefaults->increaseCacheBuster(); + $this->config->setUserValue($this->userId, Application::APP_ID, 'userCacheBuster', (string)$currentVersion); + return new JSONResponse([ 'type' => $type, 'value' => $value, - 'version' => $this->config->getUserValue($this->userId, Application::APP_ID, 'backgroundVersion', $currentVersion) + 'version' => $currentVersion, ]); } } diff --git a/apps/theming/lib/ImageManager.php b/apps/theming/lib/ImageManager.php index 6f9892af10e38..60b695f1c90b7 100644 --- a/apps/theming/lib/ImageManager.php +++ b/apps/theming/lib/ImageManager.php @@ -66,14 +66,13 @@ public function __construct(IConfig $config, IURLGenerator $urlGenerator, ICacheFactory $cacheFactory, ILogger $logger, - ITempManager $tempManager - ) { + ITempManager $tempManager) { $this->config = $config; - $this->appData = $appData; $this->urlGenerator = $urlGenerator; $this->cacheFactory = $cacheFactory; $this->logger = $logger; $this->tempManager = $tempManager; + $this->appData = $appData; } public function getImageUrl(string $key, bool $useSvg = true): string { @@ -106,10 +105,12 @@ public function getImageUrlAbsolute(string $key, bool $useSvg = true): string { */ public function getImage(string $key, bool $useSvg = true): ISimpleFile { $logo = $this->config->getAppValue('theming', $key . 'Mime', ''); - $folder = $this->appData->getFolder('images'); + $folder = $this->getRootFolder()->getFolder('images'); + if ($logo === '' || !$folder->fileExists($key)) { throw new NotFoundException(); } + if (!$useSvg && $this->shouldReplaceIcons()) { if (!$folder->fileExists($key . '.png')) { try { @@ -127,6 +128,7 @@ public function getImage(string $key, bool $useSvg = true): ISimpleFile { return $folder->getFile($key . '.png'); } } + return $folder->getFile($key); } @@ -158,9 +160,9 @@ public function getCustomImages(): array { public function getCacheFolder(): ISimpleFolder { $cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0'); try { - $folder = $this->appData->getFolder($cacheBusterValue); + $folder = $this->getRootFolder()->getFolder($cacheBusterValue); } catch (NotFoundException $e) { - $folder = $this->appData->newFolder($cacheBusterValue); + $folder = $this->getRootFolder()->newFolder($cacheBusterValue); $this->cleanup(); } return $folder; @@ -202,13 +204,13 @@ public function setCachedImage(string $filename, string $data): ISimpleFile { public function delete(string $key): void { /* ignore exceptions, since we don't want to fail hard if something goes wrong during cleanup */ try { - $file = $this->appData->getFolder('images')->getFile($key); + $file = $this->getRootFolder()->getFolder('images')->getFile($key); $file->delete(); } catch (NotFoundException $e) { } catch (NotPermittedException $e) { } try { - $file = $this->appData->getFolder('images')->getFile($key . '.png'); + $file = $this->getRootFolder()->getFolder('images')->getFile($key . '.png'); $file->delete(); } catch (NotFoundException $e) { } catch (NotPermittedException $e) { @@ -219,9 +221,9 @@ public function updateImage(string $key, string $tmpFile): string { $this->delete($key); try { - $folder = $this->appData->getFolder('images'); + $folder = $this->getRootFolder()->getFolder('images'); } catch (NotFoundException $e) { - $folder = $this->appData->newFolder('images'); + $folder = $this->getRootFolder()->newFolder('images'); } $target = $folder->newFile($key); @@ -288,7 +290,7 @@ private function getSupportedUploadImageFormats(string $key): array { */ public function cleanup() { $currentFolder = $this->getCacheFolder(); - $folders = $this->appData->getDirectoryListing(); + $folders = $this->getRootFolder()->getDirectoryListing(); foreach ($folders as $folder) { if ($folder->getName() !== 'images' && $folder->getName() !== $currentFolder->getName()) { $folder->delete(); @@ -316,4 +318,12 @@ public function shouldReplaceIcons() { $cache->set('shouldReplaceIcons', $value); return $value; } + + private function getRootFolder(): ISimpleFolder { + try { + return $this->appData->getFolder('global'); + } catch (NotFoundException $e) { + return $this->appData->newFolder('global'); + } + } } diff --git a/apps/theming/lib/Jobs/MigrateBackgroundImages.php b/apps/theming/lib/Jobs/MigrateBackgroundImages.php index 97806fa600ac9..b816a4c8775af 100644 --- a/apps/theming/lib/Jobs/MigrateBackgroundImages.php +++ b/apps/theming/lib/Jobs/MigrateBackgroundImages.php @@ -34,6 +34,7 @@ use OCP\Files\AppData\IAppDataFactory; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; +use OCP\Files\SimpleFS\ISimpleFolder; use OCP\IConfig; class MigrateBackgroundImages extends QueuedJob { @@ -57,7 +58,6 @@ protected function run($argument): void { return; } - $themingData = $this->appDataFactory->get(Application::APP_ID); $dashboardData = $this->appDataFactory->get('dashboard'); $userIds = $this->config->getUsersForUserValue('theming', 'background', 'custom'); @@ -79,11 +79,8 @@ protected function run($argument): void { // migration $file = $dashboardData->getFolder($userId)->getFile('background.jpg'); - try { - $targetDir = $themingData->getFolder($userId); - } catch (NotFoundException $e) { - $targetDir = $themingData->newFolder($userId); - } + $targetDir = $this->getUserFolder($userId); + if (!$targetDir->fileExists('background.jpg')) { $targetDir->newFile('background.jpg', $file->getContent()); } @@ -104,4 +101,23 @@ protected function run($argument): void { $this->jobList->add(self::class); } } + + /** + * Get the root location for users theming data + */ + protected function getUserFolder(string $userId): ISimpleFolder { + $themingData = $this->appDataFactory->get(Application::APP_ID); + + try { + $rootFolder = $themingData->getFolder('users'); + } catch (NotFoundException $e) { + $rootFolder = $themingData->newFolder('users'); + } + + try { + return $rootFolder->getFolder($userId); + } catch (NotFoundException $e) { + return $rootFolder->newFolder($userId); + } + } } diff --git a/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php b/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php index 1d28a1d4399a5..a6e0923e64311 100644 --- a/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php +++ b/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php @@ -89,11 +89,6 @@ public function handle(Event $event): void { $this->config->getUserValue($userId, Application::APP_ID, 'background', 'default'), ); - $this->initialState->provideInitialState( - 'backgroundVersion', - $this->config->getUserValue($userId, Application::APP_ID, 'backgroundVersion', 0), - ); - $this->initialState->provideInitialState( 'themingDefaultBackground', $this->config->getAppValue('theming', 'backgroundMime', ''), diff --git a/apps/theming/lib/Service/BackgroundService.php b/apps/theming/lib/Service/BackgroundService.php index 36623735728ba..3daac7e7215dc 100644 --- a/apps/theming/lib/Service/BackgroundService.php +++ b/apps/theming/lib/Service/BackgroundService.php @@ -136,19 +136,19 @@ class BackgroundService { private string $userId; private IAppDataFactory $appDataFactory; - public function __construct( - IRootFolder $rootFolder, - IAppDataFactory $appDataFactory, - IConfig $config, - ?string $userId - ) { + public function __construct(IRootFolder $rootFolder, + IAppData $appData, + IConfig $config, + ?string $userId, + IAppDataFactory $appDataFactory) { if ($userId === null) { return; } + $this->rootFolder = $rootFolder; - $this->appData = $appDataFactory->get(Application::APP_ID); $this->config = $config; $this->userId = $userId; + $this->appData = $appData; $this->appDataFactory = $appDataFactory; } @@ -167,12 +167,15 @@ public function setDefaultBackground(): void { public function setFileBackground($path): void { $this->config->setUserValue($this->userId, Application::APP_ID, 'background', 'custom'); $userFolder = $this->rootFolder->getUserFolder($this->userId); + /** @var File $file */ $file = $userFolder->get($path); $image = new \OCP\Image(); + if ($image->loadFromFileHandle($file->fopen('r')) === false) { throw new InvalidArgumentException('Invalid image file'); } + $this->getAppDataFolder()->newFile('background.jpg', $file->fopen('r')); } @@ -207,14 +210,21 @@ public function getBackground(): ?ISimpleFile { } /** + * Storing the data in appdata/theming/users/USERID + * * @return ISimpleFolder * @throws NotPermittedException */ private function getAppDataFolder(): ISimpleFolder { try { - return $this->appData->getFolder($this->userId); + $rootFolder = $this->appData->getFolder('users'); + } catch (NotFoundException $e) { + $rootFolder = $this->appData->newFolder('users'); + } + try { + return $rootFolder->getFolder($this->userId); } catch (NotFoundException $e) { - return $this->appData->newFolder($this->userId); + return $rootFolder->newFolder($this->userId); } } } diff --git a/apps/theming/lib/Service/ThemeInjectionService.php b/apps/theming/lib/Service/ThemeInjectionService.php index fec14de96cf5f..27b65457e7fd0 100644 --- a/apps/theming/lib/Service/ThemeInjectionService.php +++ b/apps/theming/lib/Service/ThemeInjectionService.php @@ -22,8 +22,11 @@ */ namespace OCA\Theming\Service; +use OCA\Theming\AppInfo\Application; use OCA\Theming\Themes\DefaultTheme; +use OCP\IConfig; use OCP\IURLGenerator; +use OCP\IUserSession; use OCP\Util; class ThemeInjectionService { @@ -31,13 +34,23 @@ class ThemeInjectionService { private IURLGenerator $urlGenerator; private ThemesService $themesService; private DefaultTheme $defaultTheme; + private IConfig $config; + private ?string $userId; public function __construct(IURLGenerator $urlGenerator, ThemesService $themesService, - DefaultTheme $defaultTheme) { + DefaultTheme $defaultTheme, + IConfig $config, + IUserSession $userSession) { $this->urlGenerator = $urlGenerator; $this->themesService = $themesService; $this->defaultTheme = $defaultTheme; + $this->config = $config; + if ($userSession->getUser() !== null) { + $this->userId = $userSession->getUser()->getUID(); + } else { + $this->userId = null; + } } public function injectHeaders() { @@ -50,13 +63,13 @@ public function injectHeaders() { // Default theme fallback $this->addThemeHeader($defaultTheme->getId()); - + // Themes applied by media queries foreach($mediaThemes as $theme) { $this->addThemeHeader($theme->getId(), true, $theme->getMediaQuery()); } - // Themes + // Themes foreach($this->themesService->getThemes() as $theme) { // Ignore default theme as already processed first if ($theme->getId() === $this->defaultTheme->getId()) { @@ -68,15 +81,24 @@ public function injectHeaders() { /** * Inject theme header into rendered page - * + * * @param string $themeId the theme ID * @param bool $plain request the :root syntax * @param string $media media query to use in the element */ private function addThemeHeader(string $themeId, bool $plain = true, string $media = null) { + $cacheBuster = $this->config->getAppValue('theming', 'cachebuster', '0'); + if ($this->userId !== null) { + // need to bust the cache for the CSS file when the user background changed as its + // URL is served in those files + $userCacheBuster = $this->config->getUserValue($this->userId, Application::APP_ID, 'userCacheBuster', '0'); + $cacheBuster .= $this->userId . '_' . $userCacheBuster; + } + $linkToCSS = $this->urlGenerator->linkToRoute('theming.Theming.getThemeStylesheet', [ 'themeId' => $themeId, 'plain' => $plain, + 'v' => substr(sha1($cacheBuster), 0, 8), ]); Util::addHeader('link', [ 'rel' => 'stylesheet', diff --git a/apps/theming/lib/Themes/DefaultTheme.php b/apps/theming/lib/Themes/DefaultTheme.php index 4dce1dca809b3..aae4c4eca4cad 100644 --- a/apps/theming/lib/Themes/DefaultTheme.php +++ b/apps/theming/lib/Themes/DefaultTheme.php @@ -239,9 +239,11 @@ public function getCSSVariables(): array { $user = $this->userSession->getUser(); if ($appManager->isEnabledForUser(Application::APP_ID) && $user !== null) { $themingBackground = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'background', 'default'); + $currentVersion = (int)$this->config->getUserValue($user->getUID(), Application::APP_ID, 'userCacheBuster', '0'); if ($themingBackground === 'custom') { - $variables['--image-main-background'] = "url('" . $this->urlGenerator->linkToRouteAbsolute('theming.userTheme.getBackground') . "')"; + $cacheBuster = substr(sha1($user->getUID() . '_' . $currentVersion), 0, 8); + $variables['--image-main-background'] = "url('" . $this->urlGenerator->linkToRouteAbsolute('theming.userTheme.getBackground') . "?v=$cacheBuster')"; } elseif (isset(BackgroundService::SHIPPED_BACKGROUNDS[$themingBackground])) { $variables['--image-main-background'] = "url('" . $this->urlGenerator->linkTo(Application::APP_ID, "/img/background/$themingBackground") . "')"; } elseif (substr($themingBackground, 0, 1) === '#') { diff --git a/apps/theming/src/UserThemes.vue b/apps/theming/src/UserThemes.vue index 1eeeb3c5b2158..f9e729afecbdf 100644 --- a/apps/theming/src/UserThemes.vue +++ b/apps/theming/src/UserThemes.vue @@ -88,7 +88,6 @@ const enforceTheme = loadState('theming', 'enforceTheme', '') const shortcutsDisabled = loadState('theming', 'shortcutsDisabled', false) const background = loadState('theming', 'background') -const backgroundVersion = loadState('theming', 'backgroundVersion') const themingDefaultBackground = loadState('theming', 'themingDefaultBackground') const shippedBackgroundList = loadState('theming', 'shippedBackgrounds') @@ -109,7 +108,6 @@ export default { enforceTheme, shortcutsDisabled, background, - backgroundVersion, themingDefaultBackground, } }, @@ -169,10 +167,10 @@ export default { methods: { updateBackground(data) { this.background = (data.type === 'custom' || data.type === 'default') ? data.type : data.value - this.backgroundVersion = data.version this.updateGlobalStyles() this.$emit('update:background') }, + updateGlobalStyles() { // Override primary-invert-if-bright and color-primary-text if background is set const isBackgroundBright = shippedBackgroundList[this.background]?.theming === 'dark' diff --git a/apps/theming/tests/ImageManagerTest.php b/apps/theming/tests/ImageManagerTest.php index ead9ca113e6f9..ffb023c970fc2 100644 --- a/apps/theming/tests/ImageManagerTest.php +++ b/apps/theming/tests/ImageManagerTest.php @@ -56,6 +56,8 @@ class ImageManagerTest extends TestCase { private $logger; /** @var ITempManager|MockObject */ private $tempManager; + /** @var ISimpleFolder|MockObject */ + private $rootFolder; protected function setUp(): void { parent::setUp(); @@ -65,6 +67,7 @@ protected function setUp(): void { $this->cacheFactory = $this->createMock(ICacheFactory::class); $this->logger = $this->createMock(ILogger::class); $this->tempManager = $this->createMock(ITempManager::class); + $this->rootFolder = $this->createMock(ISimpleFolder::class); $this->imageManager = new ImageManager( $this->config, $this->appData, @@ -73,6 +76,11 @@ protected function setUp(): void { $this->logger, $this->tempManager ); + $this->appData + ->expects($this->any()) + ->method('getFolder') + ->with('global') + ->willReturn($this->rootFolder); } private function checkImagick() { @@ -120,7 +128,7 @@ public function mockGetImage($key, $file) { ->willReturn($newFile); $newFile->expects($this->once()) ->method('putContent'); - $this->appData->expects($this->once()) + $this->rootFolder->expects($this->once()) ->method('getFolder') ->with('images') ->willReturn($folder); @@ -200,7 +208,7 @@ public function testGetCacheFolder() { ->method('getAppValue') ->with('theming', 'cachebuster', '0') ->willReturn('0'); - $this->appData->expects($this->once()) + $this->rootFolder->expects($this->once()) ->method('getFolder') ->with('0') ->willReturn($folder); @@ -212,18 +220,18 @@ public function testGetCacheFolderCreate() { ->method('getAppValue') ->with('theming', 'cachebuster', '0') ->willReturn('0'); - $this->appData->expects($this->exactly(2)) + $this->rootFolder->expects($this->exactly(2)) ->method('getFolder') ->with('0') ->willReturnOnConsecutiveCalls( $this->throwException(new NotFoundException()), $folder, ); - $this->appData->expects($this->once()) + $this->rootFolder->expects($this->once()) ->method('newFolder') ->with('0') ->willReturn($folder); - $this->appData->expects($this->once()) + $this->rootFolder->expects($this->once()) ->method('getDirectoryListing') ->willReturn([]); $this->assertEquals($folder, $this->imageManager->getCacheFolder()); @@ -291,7 +299,7 @@ private function setupCacheFolder() { ->method('getAppValue') ->with('theming', 'cachebuster', '0') ->willReturn('0'); - $this->appData->expects($this->once()) + $this->rootFolder->expects($this->once()) ->method('getFolder') ->with('0') ->willReturn($folder); @@ -316,10 +324,10 @@ public function testCleanup() { ->method('getAppValue') ->with('theming','cachebuster','0') ->willReturn('2'); - $this->appData->expects($this->once()) + $this->rootFolder->expects($this->once()) ->method('getDirectoryListing') ->willReturn($folders); - $this->appData->expects($this->once()) + $this->rootFolder->expects($this->once()) ->method('getFolder') ->with('2') ->willReturn($folders[2]); @@ -346,24 +354,26 @@ public function testUpdateImage($key, $tmpFile, $folderExists, $shouldConvert) { $folder->expects($this->any()) ->method('getFile') ->willReturn($oldFile); + if ($folderExists) { - $this->appData + $this->rootFolder ->expects($this->any()) ->method('getFolder') ->with('images') ->willReturn($folder); } else { - $this->appData + $this->rootFolder ->expects($this->any()) ->method('getFolder') ->with('images') ->willThrowException(new NotFoundException()); - $this->appData + $this->rootFolder ->expects($this->any()) ->method('newFolder') ->with('images') ->willReturn($folder); } + $folder->expects($this->once()) ->method('newFile') ->with($key) diff --git a/dist/theming-theming-settings.js b/dist/theming-theming-settings.js index e0bd3b3dc8033..00add4c57d460 100644 --- a/dist/theming-theming-settings.js +++ b/dist/theming-theming-settings.js @@ -1,3 +1,3 @@ /*! For license information please see theming-theming-settings.js.LICENSE.txt */ -!function(){"use strict";var n,e={53184:function(n,e,r){var a=r(20144),o=r(79753),i=r(16453),c=r(4820),s=r(20571),u=r.n(s),l=r(13299),d=r.n(l),g=function(n){return(0,o.generateFilePath)("theming","","img/background/")+n},h=function(n){var e,t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=(null===(e=window.OCA)||void 0===e||null===(t=e.Theming)||void 0===t?void 0:t.enabledThemes)||[],c=0===i.length||"default"===i[0]?window.matchMedia("(prefers-color-scheme: dark)").matches:-1!==i.join("").indexOf("dark");return"default"===n?a&&"backgroundColor"!==a?(0,o.generateUrl)("/apps/theming/image/background")+"?v="+window.OCA.Theming.cacheBuster:g(c?"eduardo-neves-pedra-azul.jpg":"kamil-porembinski-clouds.jpg"):"custom"===n?(0,o.generateUrl)("/apps/theming/background")+"?v="+r:g(n)},p=r(20296),m=r.n(p),f=r(69867),A=r.n(f),v=r(15168),b=r.n(v);function k(n,e,t,r,a,o,i){try{var c=n[o](i),s=c.value}catch(n){return void t(n)}c.done?e(s):Promise.resolve(s).then(r,a)}function C(n){return function(){var e=this,t=arguments;return new Promise((function(r,a){var o=n.apply(e,t);function i(n){k(o,r,a,i,c,"next",n)}function c(n){k(o,r,a,i,c,"throw",n)}i(void 0)}))}}function y(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t.6},calculateLuma:function(n){var e,t,r=(e=this.hexToRGB(n),t=3,function(n){if(Array.isArray(n))return n}(e)||function(n,e){var t=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=t){var r,a,o=[],i=!0,c=!1;try{for(t=t.call(n);!(i=(r=t.next()).done)&&(o.push(r.value),!e||o.length!==e);i=!0);}catch(n){c=!0,a=n}finally{try{i||null==t.return||t.return()}finally{if(c)throw a}}return o}}(e,t)||function(n,e){if(n){if("string"==typeof n)return y(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?y(n,e):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return(.2126*r[0]+.7152*r[1]+.0722*r[2])/255},hexToRGB:function(n){var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:null},update:function(n){var e=this;return C(regeneratorRuntime.mark((function t(){var r,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r="custom"===n.type||"default"===n.type?n.type:n.value,e.backgroundImage=h(r,n.version,e.themingDefaultBackground),"color"!==n.type&&("default"!==n.type||"backgroundColor"!==e.themingDefaultBackground)){t.next=6;break}return e.$emit("update:background",n),e.loading=!1,t.abrupt("return");case 6:(a=new Image).onload=function(){e.$emit("update:background",n),e.loading=!1},a.src=e.backgroundImage;case 9:case"end":return t.stop()}}),t)})))()},setDefault:function(){var n=this;return C(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.loading="default",e.next=3,c.default.post((0,o.generateUrl)("/apps/theming/background/default"));case 3:t=e.sent,n.update(t.data);case 5:case"end":return e.stop()}}),e)})))()},setShipped:function(n){var e=this;return C(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading=n,t.next=3,c.default.post((0,o.generateUrl)("/apps/theming/background/shipped"),{value:n});case 3:r=t.sent,e.update(r.data);case 5:case"end":return t.stop()}}),t)})))()},setFile:function(n){var e=this;return C(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading="custom",t.next=3,c.default.post((0,o.generateUrl)("/apps/theming/background/custom"),{value:n});case 3:r=t.sent,e.update(r.data);case 5:case"end":return t.stop()}}),t)})))()},debouncePickColor:m()((function(){this.pickColor.apply(this,arguments)}),200),pickColor:function(n){var e=this;return C(regeneratorRuntime.mark((function t(){var r,a,i,s,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading="color",s=(null==n||null===(r=n.target)||void 0===r||null===(a=r.dataset)||void 0===a?void 0:a.color)||(null===(i=e.Theming)||void 0===i?void 0:i.color)||"#0082c9",t.next=4,c.default.post((0,o.generateUrl)("/apps/theming/background/color"),{value:s});case 4:u=t.sent,e.update(u.data);case 6:case"end":return t.stop()}}),t)})))()},pickFile:function(){var n=this;window.OC.dialogs.filepicker(t("theming","Insert from {productName}",{productName:OC.theme.name}),(function(e,t){t===OC.dialogs.FILEPICKER_TYPE_CHOOSE&&n.setFile(e)}),!1,["image/png","image/gif","image/jpeg","image/svg"],!0,OC.dialogs.FILEPICKER_TYPE_CHOOSE)}}},_=x,S=r(93379),T=r.n(S),B=r(7795),I=r.n(B),E=r(90569),P=r.n(E),O=r(3565),D=r.n(O),j=r(19216),R=r.n(j),U=r(44589),q=r.n(U),Z=r(95066),F={};F.styleTagTransform=q(),F.setAttributes=D(),F.insert=P().bind(null,"head"),F.domAPI=I(),F.insertStyleElement=R(),T()(Z.Z,F),Z.Z&&Z.Z.locals&&Z.Z.locals;var L=r(51900),G=(0,L.Z)(_,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",{staticClass:"background-selector"},[t("button",{staticClass:"background filepicker",class:{active:"custom"===n.background},attrs:{tabindex:"0"},on:{click:n.pickFile}},[n._v("\n\t\t"+n._s(n.t("theming","Pick from Files"))+"\n\t")]),n._v(" "),t("button",{staticClass:"background default",class:{"icon-loading":"default"===n.loading,active:"default"===n.background},attrs:{tabindex:"0"},on:{click:n.setDefault}},[n._v("\n\t\t"+n._s(n.t("theming","Default image"))+"\n\t")]),n._v(" "),t("NcColorPicker",{on:{input:n.debouncePickColor},model:{value:n.Theming.color,callback:function(e){n.$set(n.Theming,"color",e)},expression:"Theming.color"}},[t("button",{staticClass:"background color",class:{active:n.background===n.Theming.color},style:{backgroundColor:n.Theming.color,color:n.invertTextColor(n.Theming.color)?"#000000":"#ffffff"},attrs:{tabindex:"0","data-color":n.Theming.color,"data-color-bright":n.invertTextColor(n.Theming.color)}},[n._v("\n\t\t\t"+n._s(n.t("theming","Custom color"))+"\n\t\t")])]),n._v(" "),t("button",{staticClass:"background color",class:{active:n.background===n.Theming.defaultColor},style:{color:n.invertTextColor(n.Theming.defaultColor)?"#000000":"#ffffff"},attrs:{tabindex:"0","data-color":n.Theming.defaultColor,"data-color-bright":n.invertTextColor(n.Theming.defaultColor)},on:{click:n.debouncePickColor}},[n._v("\n\t\t"+n._s(n.t("theming","Plain background"))+"\n\t")]),n._v(" "),n._l(n.shippedBackgrounds,(function(e){return t("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.details.attribution,expression:"shippedBackground.details.attribution"}],key:e.name,staticClass:"background",class:{"icon-loading":n.loading===e.name,active:n.background===e.name},style:{"background-image":"url("+e.preview+")"},attrs:{tabindex:"0","data-color-bright":"dark"===e.details.theming},on:{click:function(t){return n.setShipped(e.name)}}})}))],2)}),[],!1,null,"57fc0570",null).exports,N={name:"ItemPreview",components:{NcCheckboxRadioSwitch:u()},props:{enforced:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},theme:{type:Object,required:!0},type:{type:String,default:""},unique:{type:Boolean,default:!1}},computed:{switchType:function(){return this.unique?"switch":"radio"},name:function(){return this.unique?null:this.type},img:function(){return(0,o.generateFilePath)("theming","img",this.theme.id+".jpg")},checked:{get:function(){return this.selected},set:function(n){console.debug("Changed theme",this.theme.id,n),this.unique?this.$emit("change",{enabled:!0===n,id:this.theme.id}):this.$emit("change",{enabled:!0,id:this.theme.id})}}},methods:{onToggle:function(){"radio"!==this.switchType?this.checked=!this.checked:this.checked=!0}}},$=r(83005),K={};K.styleTagTransform=q(),K.setAttributes=D(),K.insert=P().bind(null,"head"),K.domAPI=I(),K.insertStyleElement=R(),T()($.Z,K),$.Z&&$.Z.locals&&$.Z.locals;var W=(0,L.Z)(N,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",{staticClass:"theming__preview",class:"theming__preview--"+n.theme.id},[t("div",{staticClass:"theming__preview-image",style:{backgroundImage:"url("+n.img+")"},on:{click:n.onToggle}}),n._v(" "),t("div",{staticClass:"theming__preview-description"},[t("h3",[n._v(n._s(n.theme.title))]),n._v(" "),t("p",[n._v(n._s(n.theme.description))]),n._v(" "),n.enforced?t("span",{staticClass:"theming__preview-warning",attrs:{role:"note"}},[n._v("\n\t\t\t"+n._s(n.t("theming","Theme selection is enforced"))+"\n\t\t")]):n._e(),n._v(" "),t("NcCheckboxRadioSwitch",{staticClass:"theming__preview-toggle",attrs:{checked:n.checked,disabled:n.enforced,name:n.name,type:n.switchType},on:{"update:checked":function(e){n.checked=e}}},[n._v("\n\t\t\t"+n._s(n.theme.enableLabel)+"\n\t\t")])],1)])}),[],!1,null,"37ca8ab2",null).exports;function M(n){return function(n){if(Array.isArray(n))return z(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||function(n,e){if(n){if("string"==typeof n)return z(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?z(n,e):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t")},guidelinesLink:function(){return''},descriptionDetail:function(){return t("theming","If you find any issues, do not hesitate to report them on {issuetracker}our issue tracker{linkend}. And if you want to get involved, come join {designteam}our design team{linkend}!").replace("{issuetracker}",this.issuetrackerLink).replace("{designteam}",this.designteamLink).replace(/\{linkend\}/g,"")},issuetrackerLink:function(){return''},designteamLink:function(){return''}},watch:{shortcutsDisabled:function(n){this.changeShortcutsDisabled(n)}},mounted:function(){this.updateGlobalStyles()},methods:{updateBackground:function(n){this.background="custom"===n.type||"default"===n.type?n.type:n.value,this.backgroundVersion=n.version,this.updateGlobalStyles(),this.$emit("update:background")},updateGlobalStyles:function(){var n;"dark"===(null===(n=tn[this.background])||void 0===n?void 0:n.theming)?(document.querySelector("#header").style.setProperty("--primary-invert-if-bright","invert(100%)"),document.querySelector("#header").style.setProperty("--color-primary-text","#000000")):(document.querySelector("#header").style.setProperty("--primary-invert-if-bright","no"),document.querySelector("#header").style.setProperty("--color-primary-text","#ffffff"))},changeTheme:function(n){var e=n.enabled,t=n.id;this.themes.forEach((function(n){n.id===t&&e?n.enabled=!0:n.enabled=!1})),this.updateBodyAttributes(),this.selectItem(e,t)},changeFont:function(n){var e=n.enabled,t=n.id;this.fonts.forEach((function(n){n.id===t&&e?n.enabled=!0:n.enabled=!1})),this.updateBodyAttributes(),this.selectItem(e,t)},changeShortcutsDisabled:function(n){return H(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n){e.next=5;break}return e.next=3,(0,c.default)({url:(0,o.generateOcsUrl)("apps/provisioning_api/api/v1/config/users/{appId}/{configKey}",{appId:"theming",configKey:"shortcuts_disabled"}),data:{configValue:"yes"},method:"POST"});case 3:e.next=7;break;case 5:return e.next=7,(0,c.default)({url:(0,o.generateOcsUrl)("apps/provisioning_api/api/v1/config/users/{appId}/{configKey}",{appId:"theming",configKey:"shortcuts_disabled"}),method:"DELETE"});case 7:case"end":return e.stop()}}),e)})))()},updateBodyAttributes:function(){var n=this.themes.filter((function(n){return!0===n.enabled})).map((function(n){return n.id})),e=this.fonts.filter((function(n){return!0===n.enabled})).map((function(n){return n.id}));this.themes.forEach((function(n){document.body.toggleAttribute("data-theme-".concat(n.id),n.enabled)})),this.fonts.forEach((function(n){document.body.toggleAttribute("data-theme-".concat(n.id),n.enabled)})),document.body.setAttribute("data-themes",[].concat(M(n),M(e)).join(","))},selectItem:function(n,e){return H(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,!n){r.next=6;break}return r.next=4,(0,c.default)({url:(0,o.generateOcsUrl)("apps/theming/api/v1/theme/{themeId}/enable",{themeId:e}),method:"PUT"});case 4:r.next=8;break;case 6:return r.next=8,(0,c.default)({url:(0,o.generateOcsUrl)("apps/theming/api/v1/theme/{themeId}",{themeId:e}),method:"DELETE"});case 8:r.next=14;break;case 10:r.prev=10,r.t0=r.catch(0),console.error(r.t0,r.t0.response),OC.Notification.showTemporary(t("theming",r.t0.response.data.ocs.meta.message+". Unable to apply the setting."));case 14:case"end":return r.stop()}}),r,null,[[0,10]])})))()}}},an=r(22955),on={};on.styleTagTransform=q(),on.setAttributes=D(),on.insert=P().bind(null,"head"),on.domAPI=I(),on.insertStyleElement=R(),T()(an.Z,on),an.Z&&an.Z.locals&&an.Z.locals;var cn=(0,L.Z)(rn,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("section",[t("NcSettingsSection",{staticClass:"theming",attrs:{title:n.t("theming","Appearance and accessibility"),"limit-width":!1}},[t("p",{domProps:{innerHTML:n._s(n.description)}}),n._v(" "),t("p",{domProps:{innerHTML:n._s(n.descriptionDetail)}}),n._v(" "),t("div",{staticClass:"theming__preview-list"},n._l(n.themes,(function(e){return t("ItemPreview",{key:e.id,attrs:{enforced:e.id===n.enforceTheme,selected:n.selectedTheme.id===e.id,theme:e,unique:1===n.themes.length,type:"theme"},on:{change:n.changeTheme}})})),1),n._v(" "),t("div",{staticClass:"theming__preview-list"},n._l(n.fonts,(function(e){return t("ItemPreview",{key:e.id,attrs:{selected:e.enabled,theme:e,unique:1===n.fonts.length,type:"font"},on:{change:n.changeFont}})})),1)]),n._v(" "),t("NcSettingsSection",{attrs:{title:n.t("theming","Keyboard shortcuts")}},[t("p",[n._v(n._s(n.t("theming","In some cases keyboard shortcuts can interfer with accessibility tools. In order to allow focusing on your tool correctly you can disable all keyboard shortcuts here. This will also disable all available shortcuts in apps.")))]),n._v(" "),t("NcCheckboxRadioSwitch",{staticClass:"theming__preview-toggle",attrs:{checked:n.shortcutsDisabled,name:"shortcuts_disabled",type:"switch"},on:{"update:checked":function(e){n.shortcutsDisabled=e},change:n.changeShortcutsDisabled}},[n._v("\n\t\t\t"+n._s(n.t("theming","Disable all keyboard shortcuts"))+"\n\t\t")])],1),n._v(" "),t("NcSettingsSection",{staticClass:"background",attrs:{title:n.t("theming","Background")}},[t("p",[n._v(n._s(n.t("theming","Set a custom background")))]),n._v(" "),t("BackgroundSettings",{staticClass:"background__grid",attrs:{background:n.background,"theming-default-background":n.themingDefaultBackground},on:{"update:background":n.updateBackground}})],1)],1)}),[],!1,null,"205ad124",null).exports;function sn(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t=o)&&Object.keys(a.O).every((function(n){return a.O[n](t[s])}))?t.splice(s--,1):(c=!1,o0&&n[l-1][2]>o;l--)n[l]=n[l-1];n[l]=[t,r,o]},a.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return a.d(e,{a:e}),e},a.d=function(n,e){for(var t in e)a.o(e,t)&&!a.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"==typeof window)return window}}(),a.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},a.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},a.nmd=function(n){return n.paths=[],n.children||(n.children=[]),n},a.j=6755,function(){a.b=document.baseURI||self.location.href;var n={6755:0};a.O.j=function(e){return 0===n[e]};var e=function(e,t){var r,o,i=t[0],c=t[1],s=t[2],u=0;if(i.some((function(e){return 0!==n[e]}))){for(r in c)a.o(c,r)&&(a.m[r]=c[r]);if(s)var l=s(a)}for(e&&e(t);u1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=(null===(e=window.OCA)||void 0===e||null===(t=e.Theming)||void 0===t?void 0:t.enabledThemes)||[],c=0===i.length||"default"===i[0]?window.matchMedia("(prefers-color-scheme: dark)").matches:-1!==i.join("").indexOf("dark");return"default"===n?a&&"backgroundColor"!==a?(0,o.generateUrl)("/apps/theming/image/background")+"?v="+window.OCA.Theming.cacheBuster:g(c?"eduardo-neves-pedra-azul.jpg":"kamil-porembinski-clouds.jpg"):"custom"===n?(0,o.generateUrl)("/apps/theming/background")+"?v="+r:g(n)},p=r(20296),m=r.n(p),f=r(69867),A=r.n(f),v=r(15168),b=r.n(v);function k(n,e,t,r,a,o,i){try{var c=n[o](i),s=c.value}catch(n){return void t(n)}c.done?e(s):Promise.resolve(s).then(r,a)}function C(n){return function(){var e=this,t=arguments;return new Promise((function(r,a){var o=n.apply(e,t);function i(n){k(o,r,a,i,c,"next",n)}function c(n){k(o,r,a,i,c,"throw",n)}i(void 0)}))}}function y(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t.6},calculateLuma:function(n){var e,t,r=(e=this.hexToRGB(n),t=3,function(n){if(Array.isArray(n))return n}(e)||function(n,e){var t=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=t){var r,a,o=[],i=!0,c=!1;try{for(t=t.call(n);!(i=(r=t.next()).done)&&(o.push(r.value),!e||o.length!==e);i=!0);}catch(n){c=!0,a=n}finally{try{i||null==t.return||t.return()}finally{if(c)throw a}}return o}}(e,t)||function(n,e){if(n){if("string"==typeof n)return y(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?y(n,e):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return(.2126*r[0]+.7152*r[1]+.0722*r[2])/255},hexToRGB:function(n){var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:null},update:function(n){var e=this;return C(regeneratorRuntime.mark((function t(){var r,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r="custom"===n.type||"default"===n.type?n.type:n.value,e.backgroundImage=h(r,n.version,e.themingDefaultBackground),"color"!==n.type&&("default"!==n.type||"backgroundColor"!==e.themingDefaultBackground)){t.next=6;break}return e.$emit("update:background",n),e.loading=!1,t.abrupt("return");case 6:(a=new Image).onload=function(){e.$emit("update:background",n),e.loading=!1},a.src=e.backgroundImage;case 9:case"end":return t.stop()}}),t)})))()},setDefault:function(){var n=this;return C(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.loading="default",e.next=3,c.default.post((0,o.generateUrl)("/apps/theming/background/default"));case 3:t=e.sent,n.update(t.data);case 5:case"end":return e.stop()}}),e)})))()},setShipped:function(n){var e=this;return C(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading=n,t.next=3,c.default.post((0,o.generateUrl)("/apps/theming/background/shipped"),{value:n});case 3:r=t.sent,e.update(r.data);case 5:case"end":return t.stop()}}),t)})))()},setFile:function(n){var e=this;return C(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading="custom",t.next=3,c.default.post((0,o.generateUrl)("/apps/theming/background/custom"),{value:n});case 3:r=t.sent,e.update(r.data);case 5:case"end":return t.stop()}}),t)})))()},debouncePickColor:m()((function(){this.pickColor.apply(this,arguments)}),200),pickColor:function(n){var e=this;return C(regeneratorRuntime.mark((function t(){var r,a,i,s,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading="color",s=(null==n||null===(r=n.target)||void 0===r||null===(a=r.dataset)||void 0===a?void 0:a.color)||(null===(i=e.Theming)||void 0===i?void 0:i.color)||"#0082c9",t.next=4,c.default.post((0,o.generateUrl)("/apps/theming/background/color"),{value:s});case 4:u=t.sent,e.update(u.data);case 6:case"end":return t.stop()}}),t)})))()},pickFile:function(){var n=this;window.OC.dialogs.filepicker(t("theming","Insert from {productName}",{productName:OC.theme.name}),(function(e,t){t===OC.dialogs.FILEPICKER_TYPE_CHOOSE&&n.setFile(e)}),!1,["image/png","image/gif","image/jpeg","image/svg"],!0,OC.dialogs.FILEPICKER_TYPE_CHOOSE)}}},_=x,S=r(93379),T=r.n(S),B=r(7795),I=r.n(B),E=r(90569),P=r.n(E),O=r(3565),D=r.n(O),j=r(19216),R=r.n(j),U=r(44589),q=r.n(U),Z=r(95066),F={};F.styleTagTransform=q(),F.setAttributes=D(),F.insert=P().bind(null,"head"),F.domAPI=I(),F.insertStyleElement=R(),T()(Z.Z,F),Z.Z&&Z.Z.locals&&Z.Z.locals;var L=r(51900),G=(0,L.Z)(_,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",{staticClass:"background-selector"},[t("button",{staticClass:"background filepicker",class:{active:"custom"===n.background},attrs:{tabindex:"0"},on:{click:n.pickFile}},[n._v("\n\t\t"+n._s(n.t("theming","Pick from Files"))+"\n\t")]),n._v(" "),t("button",{staticClass:"background default",class:{"icon-loading":"default"===n.loading,active:"default"===n.background},attrs:{tabindex:"0"},on:{click:n.setDefault}},[n._v("\n\t\t"+n._s(n.t("theming","Default image"))+"\n\t")]),n._v(" "),t("NcColorPicker",{on:{input:n.debouncePickColor},model:{value:n.Theming.color,callback:function(e){n.$set(n.Theming,"color",e)},expression:"Theming.color"}},[t("button",{staticClass:"background color",class:{active:n.background===n.Theming.color},style:{backgroundColor:n.Theming.color,color:n.invertTextColor(n.Theming.color)?"#000000":"#ffffff"},attrs:{tabindex:"0","data-color":n.Theming.color,"data-color-bright":n.invertTextColor(n.Theming.color)}},[n._v("\n\t\t\t"+n._s(n.t("theming","Custom color"))+"\n\t\t")])]),n._v(" "),t("button",{staticClass:"background color",class:{active:n.background===n.Theming.defaultColor},style:{color:n.invertTextColor(n.Theming.defaultColor)?"#000000":"#ffffff"},attrs:{tabindex:"0","data-color":n.Theming.defaultColor,"data-color-bright":n.invertTextColor(n.Theming.defaultColor)},on:{click:n.debouncePickColor}},[n._v("\n\t\t"+n._s(n.t("theming","Plain background"))+"\n\t")]),n._v(" "),n._l(n.shippedBackgrounds,(function(e){return t("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.details.attribution,expression:"shippedBackground.details.attribution"}],key:e.name,staticClass:"background",class:{"icon-loading":n.loading===e.name,active:n.background===e.name},style:{"background-image":"url("+e.preview+")"},attrs:{tabindex:"0","data-color-bright":"dark"===e.details.theming},on:{click:function(t){return n.setShipped(e.name)}}})}))],2)}),[],!1,null,"57fc0570",null).exports,N={name:"ItemPreview",components:{NcCheckboxRadioSwitch:u()},props:{enforced:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},theme:{type:Object,required:!0},type:{type:String,default:""},unique:{type:Boolean,default:!1}},computed:{switchType:function(){return this.unique?"switch":"radio"},name:function(){return this.unique?null:this.type},img:function(){return(0,o.generateFilePath)("theming","img",this.theme.id+".jpg")},checked:{get:function(){return this.selected},set:function(n){console.debug("Changed theme",this.theme.id,n),this.unique?this.$emit("change",{enabled:!0===n,id:this.theme.id}):this.$emit("change",{enabled:!0,id:this.theme.id})}}},methods:{onToggle:function(){"radio"!==this.switchType?this.checked=!this.checked:this.checked=!0}}},$=r(83005),K={};K.styleTagTransform=q(),K.setAttributes=D(),K.insert=P().bind(null,"head"),K.domAPI=I(),K.insertStyleElement=R(),T()($.Z,K),$.Z&&$.Z.locals&&$.Z.locals;var W=(0,L.Z)(N,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",{staticClass:"theming__preview",class:"theming__preview--"+n.theme.id},[t("div",{staticClass:"theming__preview-image",style:{backgroundImage:"url("+n.img+")"},on:{click:n.onToggle}}),n._v(" "),t("div",{staticClass:"theming__preview-description"},[t("h3",[n._v(n._s(n.theme.title))]),n._v(" "),t("p",[n._v(n._s(n.theme.description))]),n._v(" "),n.enforced?t("span",{staticClass:"theming__preview-warning",attrs:{role:"note"}},[n._v("\n\t\t\t"+n._s(n.t("theming","Theme selection is enforced"))+"\n\t\t")]):n._e(),n._v(" "),t("NcCheckboxRadioSwitch",{staticClass:"theming__preview-toggle",attrs:{checked:n.checked,disabled:n.enforced,name:n.name,type:n.switchType},on:{"update:checked":function(e){n.checked=e}}},[n._v("\n\t\t\t"+n._s(n.theme.enableLabel)+"\n\t\t")])],1)])}),[],!1,null,"37ca8ab2",null).exports;function M(n){return function(n){if(Array.isArray(n))return z(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||function(n,e){if(n){if("string"==typeof n)return z(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?z(n,e):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t")},guidelinesLink:function(){return''},descriptionDetail:function(){return t("theming","If you find any issues, do not hesitate to report them on {issuetracker}our issue tracker{linkend}. And if you want to get involved, come join {designteam}our design team{linkend}!").replace("{issuetracker}",this.issuetrackerLink).replace("{designteam}",this.designteamLink).replace(/\{linkend\}/g,"")},issuetrackerLink:function(){return''},designteamLink:function(){return''}},watch:{shortcutsDisabled:function(n){this.changeShortcutsDisabled(n)}},mounted:function(){this.updateGlobalStyles()},methods:{updateBackground:function(n){this.background="custom"===n.type||"default"===n.type?n.type:n.value,this.updateGlobalStyles(),this.$emit("update:background")},updateGlobalStyles:function(){var n;"dark"===(null===(n=en[this.background])||void 0===n?void 0:n.theming)?(document.querySelector("#header").style.setProperty("--primary-invert-if-bright","invert(100%)"),document.querySelector("#header").style.setProperty("--color-primary-text","#000000")):(document.querySelector("#header").style.setProperty("--primary-invert-if-bright","no"),document.querySelector("#header").style.setProperty("--color-primary-text","#ffffff"))},changeTheme:function(n){var e=n.enabled,t=n.id;this.themes.forEach((function(n){n.id===t&&e?n.enabled=!0:n.enabled=!1})),this.updateBodyAttributes(),this.selectItem(e,t)},changeFont:function(n){var e=n.enabled,t=n.id;this.fonts.forEach((function(n){n.id===t&&e?n.enabled=!0:n.enabled=!1})),this.updateBodyAttributes(),this.selectItem(e,t)},changeShortcutsDisabled:function(n){return H(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n){e.next=5;break}return e.next=3,(0,c.default)({url:(0,o.generateOcsUrl)("apps/provisioning_api/api/v1/config/users/{appId}/{configKey}",{appId:"theming",configKey:"shortcuts_disabled"}),data:{configValue:"yes"},method:"POST"});case 3:e.next=7;break;case 5:return e.next=7,(0,c.default)({url:(0,o.generateOcsUrl)("apps/provisioning_api/api/v1/config/users/{appId}/{configKey}",{appId:"theming",configKey:"shortcuts_disabled"}),method:"DELETE"});case 7:case"end":return e.stop()}}),e)})))()},updateBodyAttributes:function(){var n=this.themes.filter((function(n){return!0===n.enabled})).map((function(n){return n.id})),e=this.fonts.filter((function(n){return!0===n.enabled})).map((function(n){return n.id}));this.themes.forEach((function(n){document.body.toggleAttribute("data-theme-".concat(n.id),n.enabled)})),this.fonts.forEach((function(n){document.body.toggleAttribute("data-theme-".concat(n.id),n.enabled)})),document.body.setAttribute("data-themes",[].concat(M(n),M(e)).join(","))},selectItem:function(n,e){return H(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,!n){r.next=6;break}return r.next=4,(0,c.default)({url:(0,o.generateOcsUrl)("apps/theming/api/v1/theme/{themeId}/enable",{themeId:e}),method:"PUT"});case 4:r.next=8;break;case 6:return r.next=8,(0,c.default)({url:(0,o.generateOcsUrl)("apps/theming/api/v1/theme/{themeId}",{themeId:e}),method:"DELETE"});case 8:r.next=14;break;case 10:r.prev=10,r.t0=r.catch(0),console.error(r.t0,r.t0.response),OC.Notification.showTemporary(t("theming",r.t0.response.data.ocs.meta.message+". Unable to apply the setting."));case 14:case"end":return r.stop()}}),r,null,[[0,10]])})))()}}},rn=r(15004),an={};an.styleTagTransform=q(),an.setAttributes=D(),an.insert=P().bind(null,"head"),an.domAPI=I(),an.insertStyleElement=R(),T()(rn.Z,an),rn.Z&&rn.Z.locals&&rn.Z.locals;var on=(0,L.Z)(tn,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("section",[t("NcSettingsSection",{staticClass:"theming",attrs:{title:n.t("theming","Appearance and accessibility"),"limit-width":!1}},[t("p",{domProps:{innerHTML:n._s(n.description)}}),n._v(" "),t("p",{domProps:{innerHTML:n._s(n.descriptionDetail)}}),n._v(" "),t("div",{staticClass:"theming__preview-list"},n._l(n.themes,(function(e){return t("ItemPreview",{key:e.id,attrs:{enforced:e.id===n.enforceTheme,selected:n.selectedTheme.id===e.id,theme:e,unique:1===n.themes.length,type:"theme"},on:{change:n.changeTheme}})})),1),n._v(" "),t("div",{staticClass:"theming__preview-list"},n._l(n.fonts,(function(e){return t("ItemPreview",{key:e.id,attrs:{selected:e.enabled,theme:e,unique:1===n.fonts.length,type:"font"},on:{change:n.changeFont}})})),1)]),n._v(" "),t("NcSettingsSection",{attrs:{title:n.t("theming","Keyboard shortcuts")}},[t("p",[n._v(n._s(n.t("theming","In some cases keyboard shortcuts can interfer with accessibility tools. In order to allow focusing on your tool correctly you can disable all keyboard shortcuts here. This will also disable all available shortcuts in apps.")))]),n._v(" "),t("NcCheckboxRadioSwitch",{staticClass:"theming__preview-toggle",attrs:{checked:n.shortcutsDisabled,name:"shortcuts_disabled",type:"switch"},on:{"update:checked":function(e){n.shortcutsDisabled=e},change:n.changeShortcutsDisabled}},[n._v("\n\t\t\t"+n._s(n.t("theming","Disable all keyboard shortcuts"))+"\n\t\t")])],1),n._v(" "),t("NcSettingsSection",{staticClass:"background",attrs:{title:n.t("theming","Background")}},[t("p",[n._v(n._s(n.t("theming","Set a custom background")))]),n._v(" "),t("BackgroundSettings",{staticClass:"background__grid",attrs:{background:n.background,"theming-default-background":n.themingDefaultBackground},on:{"update:background":n.updateBackground}})],1)],1)}),[],!1,null,"92936166",null).exports;function cn(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t=o)&&Object.keys(a.O).every((function(n){return a.O[n](t[s])}))?t.splice(s--,1):(c=!1,o0&&n[l-1][2]>o;l--)n[l]=n[l-1];n[l]=[t,r,o]},a.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return a.d(e,{a:e}),e},a.d=function(n,e){for(var t in e)a.o(e,t)&&!a.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"==typeof window)return window}}(),a.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},a.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},a.nmd=function(n){return n.paths=[],n.children||(n.children=[]),n},a.j=6755,function(){a.b=document.baseURI||self.location.href;var n={6755:0};a.O.j=function(e){return 0===n[e]};var e=function(e,t){var r,o,i=t[0],c=t[1],s=t[2],u=0;if(i.some((function(e){return 0!==n[e]}))){for(r in c)a.o(c,r)&&(a.m[r]=c[r]);if(s)var l=s(a)}for(e&&e(t);u 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","/**\n * @copyright Copyright (c) 2020 Julius Härtl \n *\n * @author Julius Härtl \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport { generateFilePath } from '@nextcloud/router'\n\nexport const prefixWithBaseUrl = (url) => generateFilePath('theming', '', 'img/background/') + url\n","/**\n * @copyright Copyright (c) 2020 Julius Härtl \n *\n * @author Avior \n * @author Julien Veyssier \n * @author Julius Härtl \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport { generateUrl } from '@nextcloud/router'\nimport { prefixWithBaseUrl } from './prefixWithBaseUrl.js'\n\nexport const getBackgroundUrl = (background, time = 0, themingDefaultBackground = '') => {\n\tconst enabledThemes = window.OCA?.Theming?.enabledThemes || []\n\tconst isDarkTheme = (enabledThemes.length === 0 || enabledThemes[0] === 'default')\n\t\t? window.matchMedia('(prefers-color-scheme: dark)').matches\n\t\t: enabledThemes.join('').indexOf('dark') !== -1\n\n\tif (background === 'default') {\n\t\tif (themingDefaultBackground && themingDefaultBackground !== 'backgroundColor') {\n\t\t\treturn generateUrl('/apps/theming/image/background') + '?v=' + window.OCA.Theming.cacheBuster\n\t\t}\n\n\t\tif (isDarkTheme) {\n\t\t\treturn prefixWithBaseUrl('eduardo-neves-pedra-azul.jpg')\n\t\t}\n\n\t\treturn prefixWithBaseUrl('kamil-porembinski-clouds.jpg')\n\t} else if (background === 'custom') {\n\t\treturn generateUrl('/apps/theming/background') + '?v=' + time\n\t}\n\n\treturn prefixWithBaseUrl(background)\n}\n","\n\n\n\n\n\n\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./BackgroundSettings.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./BackgroundSettings.vue?vue&type=script&lang=js&\"","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./BackgroundSettings.vue?vue&type=style&index=0&id=57fc0570&scoped=true&lang=scss&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./BackgroundSettings.vue?vue&type=style&index=0&id=57fc0570&scoped=true&lang=scss&\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./BackgroundSettings.vue?vue&type=template&id=57fc0570&scoped=true&\"\nimport script from \"./BackgroundSettings.vue?vue&type=script&lang=js&\"\nexport * from \"./BackgroundSettings.vue?vue&type=script&lang=js&\"\nimport style0 from \"./BackgroundSettings.vue?vue&type=style&index=0&id=57fc0570&scoped=true&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"57fc0570\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"background-selector\"},[_c('button',{staticClass:\"background filepicker\",class:{ active: _vm.background === 'custom' },attrs:{\"tabindex\":\"0\"},on:{\"click\":_vm.pickFile}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('theming', 'Pick from Files'))+\"\\n\\t\")]),_vm._v(\" \"),_c('button',{staticClass:\"background default\",class:{ 'icon-loading': _vm.loading === 'default', active: _vm.background === 'default' },attrs:{\"tabindex\":\"0\"},on:{\"click\":_vm.setDefault}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('theming', 'Default image'))+\"\\n\\t\")]),_vm._v(\" \"),_c('NcColorPicker',{on:{\"input\":_vm.debouncePickColor},model:{value:(_vm.Theming.color),callback:function ($$v) {_vm.$set(_vm.Theming, \"color\", $$v)},expression:\"Theming.color\"}},[_c('button',{staticClass:\"background color\",class:{ active: _vm.background === _vm.Theming.color},style:({ backgroundColor: _vm.Theming.color, color: _vm.invertTextColor(_vm.Theming.color) ? '#000000' : '#ffffff'}),attrs:{\"tabindex\":\"0\",\"data-color\":_vm.Theming.color,\"data-color-bright\":_vm.invertTextColor(_vm.Theming.color)}},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.t('theming', 'Custom color'))+\"\\n\\t\\t\")])]),_vm._v(\" \"),_c('button',{staticClass:\"background color\",class:{ active: _vm.background === _vm.Theming.defaultColor },style:({ color: _vm.invertTextColor(_vm.Theming.defaultColor) ? '#000000' : '#ffffff'}),attrs:{\"tabindex\":\"0\",\"data-color\":_vm.Theming.defaultColor,\"data-color-bright\":_vm.invertTextColor(_vm.Theming.defaultColor)},on:{\"click\":_vm.debouncePickColor}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('theming', 'Plain background'))+\"\\n\\t\")]),_vm._v(\" \"),_vm._l((_vm.shippedBackgrounds),function(shippedBackground){return _c('button',{directives:[{name:\"tooltip\",rawName:\"v-tooltip\",value:(shippedBackground.details.attribution),expression:\"shippedBackground.details.attribution\"}],key:shippedBackground.name,staticClass:\"background\",class:{ 'icon-loading': _vm.loading === shippedBackground.name, active: _vm.background === shippedBackground.name },style:({ 'background-image': 'url(' + shippedBackground.preview + ')' }),attrs:{\"tabindex\":\"0\",\"data-color-bright\":shippedBackground.details.theming === 'dark'},on:{\"click\":function($event){return _vm.setShipped(shippedBackground.name)}}})})],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ItemPreview.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ItemPreview.vue?vue&type=script&lang=js&\"","\n\n\n\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ItemPreview.vue?vue&type=style&index=0&id=37ca8ab2&lang=scss&scoped=true&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ItemPreview.vue?vue&type=style&index=0&id=37ca8ab2&lang=scss&scoped=true&\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./ItemPreview.vue?vue&type=template&id=37ca8ab2&scoped=true&\"\nimport script from \"./ItemPreview.vue?vue&type=script&lang=js&\"\nexport * from \"./ItemPreview.vue?vue&type=script&lang=js&\"\nimport style0 from \"./ItemPreview.vue?vue&type=style&index=0&id=37ca8ab2&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"37ca8ab2\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"theming__preview\",class:'theming__preview--' + _vm.theme.id},[_c('div',{staticClass:\"theming__preview-image\",style:({ backgroundImage: 'url(' + _vm.img + ')' }),on:{\"click\":_vm.onToggle}}),_vm._v(\" \"),_c('div',{staticClass:\"theming__preview-description\"},[_c('h3',[_vm._v(_vm._s(_vm.theme.title))]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.theme.description))]),_vm._v(\" \"),(_vm.enforced)?_c('span',{staticClass:\"theming__preview-warning\",attrs:{\"role\":\"note\"}},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.t('theming', 'Theme selection is enforced'))+\"\\n\\t\\t\")]):_vm._e(),_vm._v(\" \"),_c('NcCheckboxRadioSwitch',{staticClass:\"theming__preview-toggle\",attrs:{\"checked\":_vm.checked,\"disabled\":_vm.enforced,\"name\":_vm.name,\"type\":_vm.switchType},on:{\"update:checked\":function($event){_vm.checked=$event}}},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.theme.enableLabel)+\"\\n\\t\\t\")])],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n","import mod from \"-!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UserThemes.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UserThemes.vue?vue&type=script&lang=js&\"","\n import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/sass-loader/dist/cjs.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UserThemes.vue?vue&type=style&index=0&id=205ad124&lang=scss&scoped=true&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/sass-loader/dist/cjs.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UserThemes.vue?vue&type=style&index=0&id=205ad124&lang=scss&scoped=true&\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./UserThemes.vue?vue&type=template&id=205ad124&scoped=true&\"\nimport script from \"./UserThemes.vue?vue&type=script&lang=js&\"\nexport * from \"./UserThemes.vue?vue&type=script&lang=js&\"\nimport style0 from \"./UserThemes.vue?vue&type=style&index=0&id=205ad124&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"205ad124\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',[_c('NcSettingsSection',{staticClass:\"theming\",attrs:{\"title\":_vm.t('theming', 'Appearance and accessibility'),\"limit-width\":false}},[_c('p',{domProps:{\"innerHTML\":_vm._s(_vm.description)}}),_vm._v(\" \"),_c('p',{domProps:{\"innerHTML\":_vm._s(_vm.descriptionDetail)}}),_vm._v(\" \"),_c('div',{staticClass:\"theming__preview-list\"},_vm._l((_vm.themes),function(theme){return _c('ItemPreview',{key:theme.id,attrs:{\"enforced\":theme.id === _vm.enforceTheme,\"selected\":_vm.selectedTheme.id === theme.id,\"theme\":theme,\"unique\":_vm.themes.length === 1,\"type\":\"theme\"},on:{\"change\":_vm.changeTheme}})}),1),_vm._v(\" \"),_c('div',{staticClass:\"theming__preview-list\"},_vm._l((_vm.fonts),function(theme){return _c('ItemPreview',{key:theme.id,attrs:{\"selected\":theme.enabled,\"theme\":theme,\"unique\":_vm.fonts.length === 1,\"type\":\"font\"},on:{\"change\":_vm.changeFont}})}),1)]),_vm._v(\" \"),_c('NcSettingsSection',{attrs:{\"title\":_vm.t('theming', 'Keyboard shortcuts')}},[_c('p',[_vm._v(_vm._s(_vm.t('theming', 'In some cases keyboard shortcuts can interfer with accessibility tools. In order to allow focusing on your tool correctly you can disable all keyboard shortcuts here. This will also disable all available shortcuts in apps.')))]),_vm._v(\" \"),_c('NcCheckboxRadioSwitch',{staticClass:\"theming__preview-toggle\",attrs:{\"checked\":_vm.shortcutsDisabled,\"name\":\"shortcuts_disabled\",\"type\":\"switch\"},on:{\"update:checked\":function($event){_vm.shortcutsDisabled=$event},\"change\":_vm.changeShortcutsDisabled}},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.t('theming', 'Disable all keyboard shortcuts'))+\"\\n\\t\\t\")])],1),_vm._v(\" \"),_c('NcSettingsSection',{staticClass:\"background\",attrs:{\"title\":_vm.t('theming', 'Background')}},[_c('p',[_vm._v(_vm._s(_vm.t('theming', 'Set a custom background')))]),_vm._v(\" \"),_c('BackgroundSettings',{staticClass:\"background__grid\",attrs:{\"background\":_vm.background,\"theming-default-background\":_vm.themingDefaultBackground},on:{\"update:background\":_vm.updateBackground}})],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * @copyright Copyright (c) 2018 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport Vue from 'vue'\nimport App from './UserThemes.vue'\n\n// bind to window\nVue.prototype.OC = OC\nVue.prototype.t = t\n\nconst View = Vue.extend(App)\nconst theming = new View()\ntheming.$mount('#theming')\n\ntheming.$on('update:background', () => {\n\t// Refresh server-side generated theming CSS\n\t[...document.head.querySelectorAll('link.theme')].forEach(theme => {\n\t\tconst url = new URL(theme.href)\n\t\turl.searchParams.set('v', Date.now())\n\t\tconst newTheme = theme.cloneNode()\n\t\tnewTheme.href = url.toString()\n\t\tnewTheme.onload = () => theme.remove()\n\t\tdocument.head.append(newTheme)\n\t})\n})\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".theming p[data-v-205ad124]{max-width:800px}.theming[data-v-205ad124] a{font-weight:bold}.theming[data-v-205ad124] a:hover,.theming[data-v-205ad124] a:focus{text-decoration:underline}.theming__preview-list[data-v-205ad124]{--gap: 30px;display:grid;margin-top:var(--gap);column-gap:var(--gap);row-gap:var(--gap);grid-template-columns:1fr 1fr}.background__grid[data-v-205ad124]{margin-top:30px}@media(max-width: 1440px){.theming__preview-list[data-v-205ad124]{display:flex;flex-direction:column}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./apps/theming/src/UserThemes.vue\"],\"names\":[],\"mappings\":\"AA+RC,4BACC,eAAA,CAID,4BACC,gBAAA,CAEA,oEAEC,yBAAA,CAIF,wCACC,WAAA,CAEA,YAAA,CACA,qBAAA,CACA,qBAAA,CACA,kBAAA,CACA,6BAAA,CAKD,mCACC,eAAA,CAIF,0BACC,wCACC,YAAA,CACA,qBAAA,CAAA\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n.theming {\\n\\t// Limit width of settings sections for readability\\n\\tp {\\n\\t\\tmax-width: 800px;\\n\\t}\\n\\n\\t// Proper highlight for links and focus feedback\\n\\t&::v-deep a {\\n\\t\\tfont-weight: bold;\\n\\n\\t\\t&:hover,\\n\\t\\t&:focus {\\n\\t\\t\\ttext-decoration: underline;\\n\\t\\t}\\n\\t}\\n\\n\\t&__preview-list {\\n\\t\\t--gap: 30px;\\n\\n\\t\\tdisplay: grid;\\n\\t\\tmargin-top: var(--gap);\\n\\t\\tcolumn-gap: var(--gap);\\n\\t\\trow-gap: var(--gap);\\n\\t\\tgrid-template-columns: 1fr 1fr;\\n\\t}\\n}\\n\\n.background {\\n\\t&__grid {\\n\\t\\tmargin-top: 30px;\\n\\t}\\n}\\n\\n@media (max-width: 1440px) {\\n\\t.theming__preview-list {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".background-selector[data-v-57fc0570]{display:flex;flex-wrap:wrap;justify-content:center}.background-selector .background[data-v-57fc0570]{width:176px;height:96px;margin:8px;background-size:cover;background-position:center center;text-align:center;border-radius:var(--border-radius-large);border:2px solid var(--color-main-background);overflow:hidden}.background-selector .background.current[data-v-57fc0570]{background-image:var(--color-background-dark)}.background-selector .background.filepicker[data-v-57fc0570],.background-selector .background.default[data-v-57fc0570],.background-selector .background.color[data-v-57fc0570]{border-color:var(--color-border)}.background-selector .background.color[data-v-57fc0570]{background-color:var(--color-primary-default);color:var(--color-primary-text)}.background-selector .background.active[data-v-57fc0570],.background-selector .background[data-v-57fc0570]:hover,.background-selector .background[data-v-57fc0570]:focus{border:2px solid var(--color-primary)}.background-selector .background.active[data-v-57fc0570]:not(.icon-loading):after{background-image:var(--icon-checkmark-white);background-repeat:no-repeat;background-position:center;background-size:44px;content:\\\"\\\";display:block;height:100%}.background-selector .background.active:not(.icon-loading)[data-color-bright][data-v-57fc0570]:after{background-image:var(--icon-checkmark-dark)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./apps/theming/src/components/BackgroundSettings.vue\"],\"names\":[],\"mappings\":\"AA6NA,sCACC,YAAA,CACA,cAAA,CACA,sBAAA,CA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;\\n\\t\\tmargin: 8px;\\n\\t\\tbackground-size: cover;\\n\\t\\tbackground-position: center center;\\n\\t\\ttext-align: center;\\n\\t\\tborder-radius: var(--border-radius-large);\\n\\t\\tborder: 2px solid var(--color-main-background);\\n\\t\\toverflow: hidden;\\n\\n\\t\\t&.current {\\n\\t\\t\\tbackground-image: var(--color-background-dark);\\n\\t\\t}\\n\\n\\t\\t&.filepicker, &.default, &.color {\\n\\t\\t\\tborder-color: var(--color-border);\\n\\t\\t}\\n\\n\\t\\t&.color {\\n\\t\\t\\tbackground-color: var(--color-primary-default);\\n\\t\\t\\tcolor: var(--color-primary-text);\\n\\t\\t}\\n\\n\\t\\t&.active,\\n\\t\\t&:hover,\\n\\t\\t&:focus {\\n\\t\\t\\tborder: 2px solid var(--color-primary);\\n\\t\\t}\\n\\n\\t\\t&.active:not(.icon-loading) {\\n\\t\\t\\t&:after {\\n\\t\\t\\t\\tbackground-image: var(--icon-checkmark-white);\\n\\t\\t\\t\\tbackground-repeat: no-repeat;\\n\\t\\t\\t\\tbackground-position: center;\\n\\t\\t\\t\\tbackground-size: 44px;\\n\\t\\t\\t\\tcontent: '';\\n\\t\\t\\t\\tdisplay: block;\\n\\t\\t\\t\\theight: 100%;\\n\\t\\t\\t}\\n\\n\\t\\t\\t&[data-color-bright]:after {\\n\\t\\t\\t\\tbackground-image: var(--icon-checkmark-dark);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".theming__preview[data-v-37ca8ab2]{--ratio: 16;position:relative;display:flex;justify-content:flex-start;max-width:800px}.theming__preview[data-v-37ca8ab2],.theming__preview *[data-v-37ca8ab2]{user-select:none}.theming__preview-image[data-v-37ca8ab2]{flex-basis:calc(16px*var(--ratio));flex-shrink:0;height:calc(10px*var(--ratio));margin-right:var(--gap);cursor:pointer;border-radius:var(--border-radius);background-repeat:no-repeat;background-position:top left;background-size:cover}.theming__preview-description[data-v-37ca8ab2]{display:flex;flex-direction:column}.theming__preview-description label[data-v-37ca8ab2]{padding:12px 0}.theming__preview--default[data-v-37ca8ab2]{grid-column:span 2}.theming__preview-warning[data-v-37ca8ab2]{color:var(--color-warning)}@media(max-width: 682.6666666667px){.theming__preview[data-v-37ca8ab2]{flex-direction:column}.theming__preview-image[data-v-37ca8ab2]{margin:0}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./apps/theming/src/components/ItemPreview.vue\"],\"names\":[],\"mappings\":\"AAiGA,mCAEC,WAAA,CAEA,iBAAA,CACA,YAAA,CACA,0BAAA,CACA,eAAA,CAEA,wEAEC,gBAAA,CAGD,yCACC,kCAAA,CACA,aAAA,CACA,8BAAA,CACA,uBAAA,CACA,cAAA,CACA,kCAAA,CACA,2BAAA,CACA,4BAAA,CACA,qBAAA,CAGD,+CACC,YAAA,CACA,qBAAA,CAEA,qDACC,cAAA,CAIF,4CACC,kBAAA,CAGD,2CACC,0BAAA,CAIF,oCACC,mCACC,qBAAA,CAEA,yCACC,QAAA,CAAA\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n.theming__preview {\\n\\t// We make previews on 16/10 screens\\n\\t--ratio: 16;\\n\\n\\tposition: relative;\\n\\tdisplay: flex;\\n\\tjustify-content: flex-start;\\n\\tmax-width: 800px;\\n\\n\\t&,\\n\\t* {\\n\\t\\tuser-select: none;\\n\\t}\\n\\n\\t&-image {\\n\\t\\tflex-basis: calc(16px * var(--ratio));\\n\\t\\tflex-shrink: 0;\\n\\t\\theight: calc(10px * var(--ratio));\\n\\t\\tmargin-right: var(--gap);\\n\\t\\tcursor: pointer;\\n\\t\\tborder-radius: var(--border-radius);\\n\\t\\tbackground-repeat: no-repeat;\\n\\t\\tbackground-position: top left;\\n\\t\\tbackground-size: cover;\\n\\t}\\n\\n\\t&-description {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\n\\t\\tlabel {\\n\\t\\t\\tpadding: 12px 0;\\n\\t\\t}\\n\\t}\\n\\n\\t&--default {\\n\\t\\tgrid-column: span 2;\\n\\t}\\n\\n\\t&-warning {\\n\\t\\tcolor: var(--color-warning);\\n\\t}\\n}\\n\\n@media (max-width: (1024px / 1.5)) {\\n\\t.theming__preview {\\n\\t\\tflex-direction: column;\\n\\n\\t\\t&-image {\\n\\t\\t\\tmargin: 0;\\n\\t\\t}\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.amdD = function () {\n\tthrow new Error('define cannot be used indirect');\n};","__webpack_require__.amdO = {};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 6755;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t6755: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [7874], function() { return __webpack_require__(53184); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","prefixWithBaseUrl","url","generateFilePath","getBackgroundUrl","background","time","themingDefaultBackground","enabledThemes","window","OCA","Theming","isDarkTheme","length","matchMedia","matches","join","indexOf","generateUrl","cacheBuster","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","_vm","this","_h","$createElement","_c","_self","staticClass","class","active","attrs","on","pickFile","_v","_s","t","loading","setDefault","debouncePickColor","model","value","callback","$$v","$set","expression","color","style","backgroundColor","invertTextColor","defaultColor","_l","shippedBackground","directives","name","rawName","details","key","preview","theming","$event","setShipped","theme","id","backgroundImage","img","onToggle","title","description","_e","checked","enforced","switchType","enableLabel","console","debug","availableThemes","domProps","descriptionDetail","enforceTheme","selectedTheme","themes","changeTheme","enabled","fonts","changeFont","shortcutsDisabled","changeShortcutsDisabled","updateBackground","Vue","OC","App","$mount","$on","document","head","querySelectorAll","forEach","URL","href","searchParams","set","Date","now","newTheme","cloneNode","toString","onload","remove","append","___CSS_LOADER_EXPORT___","push","module","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","loaded","__webpack_modules__","call","m","amdD","Error","amdO","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","Object","keys","every","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","g","globalThis","Function","e","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","nmd","paths","children","b","baseURI","self","location","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","chunkLoadingGlobal","bind","nc","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"theming-theming-settings.js?v=2d6f75fbf75c0b292481","mappings":";6BAAIA,kHCwBSC,EAAoB,SAACC,GAAD,OAASC,EAAAA,EAAAA,kBAAiB,UAAW,GAAI,mBAAqBD,GCGlFE,EAAmB,SAACC,GAAwD,QAA5CC,EAA4C,uDAArC,EAAGC,EAAkC,uDAAP,GAC3EC,GAAgB,UAAAC,OAAOC,WAAP,mBAAYC,eAAZ,eAAqBH,gBAAiB,GACtDI,EAAwC,IAAzBJ,EAAcK,QAAqC,YAArBL,EAAc,GAC9DC,OAAOK,WAAW,gCAAgCC,SACN,IAA5CP,EAAcQ,KAAK,IAAIC,QAAQ,QAElC,MAAmB,YAAfZ,EACCE,GAAyD,oBAA7BA,GACxBW,EAAAA,EAAAA,aAAY,kCAAoC,MAAQT,OA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rB,KAAM,GAaPtD,EAAoBY,EAAES,EAAI,SAASkC,GAAW,OAAoC,IAA7BD,EAAgBC,IAGrE,IAAIC,EAAuB,SAASC,EAA4BC,GAC/D,IAKIzD,EAAUsD,EALVzC,EAAW4C,EAAK,GAChBC,EAAcD,EAAK,GACnBE,EAAUF,EAAK,GAGIvC,EAAI,EAC3B,GAAGL,EAAS+C,MAAK,SAAShH,GAAM,OAA+B,IAAxByG,EAAgBzG,MAAe,CACrE,IAAIoD,KAAY0D,EACZ3D,EAAoBiC,EAAE0B,EAAa1D,KACrCD,EAAoBQ,EAAEP,GAAY0D,EAAY1D,IAGhD,GAAG2D,EAAS,IAAI/C,EAAS+C,EAAQ5D,GAGlC,IADGyD,GAA4BA,EAA2BC,GACrDvC,EAAIL,EAASvH,OAAQ4H,IACzBoC,EAAUzC,EAASK,GAChBnB,EAAoBiC,EAAEqB,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOvD,EAAoBY,EAAEC,IAG1BiD,EAAqBV,KAA4B,sBAAIA,KAA4B,uBAAK,GAC1FU,EAAmB/E,QAAQyE,EAAqBO,KAAK,KAAM,IAC3DD,EAAmBjE,KAAO2D,EAAqBO,KAAK,KAAMD,EAAmBjE,KAAKkE,KAAKD,OClDvF9D,EAAoBgE,QAAK7D,ECGzB,IAAI8D,EAAsBjE,EAAoBY,OAAET,EAAW,CAAC,OAAO,WAAa,OAAOH,EAAoB,UAC3GiE,EAAsBjE,EAAoBY,EAAEqD","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/apps/theming/src/helpers/prefixWithBaseUrl.js","webpack:///nextcloud/apps/theming/src/helpers/getBackgroundUrl.js","webpack:///nextcloud/apps/theming/src/components/BackgroundSettings.vue","webpack:///nextcloud/apps/theming/src/components/BackgroundSettings.vue?vue&type=script&lang=js&","webpack://nextcloud/./apps/theming/src/components/BackgroundSettings.vue?065d","webpack://nextcloud/./apps/theming/src/components/BackgroundSettings.vue?65db","webpack:///nextcloud/apps/theming/src/components/BackgroundSettings.vue?vue&type=template&id=57fc0570&scoped=true&","webpack:///nextcloud/apps/theming/src/components/ItemPreview.vue?vue&type=script&lang=js&","webpack:///nextcloud/apps/theming/src/components/ItemPreview.vue","webpack://nextcloud/./apps/theming/src/components/ItemPreview.vue?f1c6","webpack://nextcloud/./apps/theming/src/components/ItemPreview.vue?8797","webpack:///nextcloud/apps/theming/src/components/ItemPreview.vue?vue&type=template&id=37ca8ab2&scoped=true&","webpack:///nextcloud/apps/theming/src/UserThemes.vue","webpack:///nextcloud/apps/theming/src/UserThemes.vue?vue&type=script&lang=js&","webpack://nextcloud/./apps/theming/src/UserThemes.vue?743b","webpack://nextcloud/./apps/theming/src/UserThemes.vue?7eb2","webpack:///nextcloud/apps/theming/src/UserThemes.vue?vue&type=template&id=92936166&scoped=true&","webpack:///nextcloud/apps/theming/src/settings.js","webpack:///nextcloud/apps/theming/src/UserThemes.vue?vue&type=style&index=0&id=92936166&lang=scss&scoped=true&","webpack:///nextcloud/apps/theming/src/components/BackgroundSettings.vue?vue&type=style&index=0&id=57fc0570&scoped=true&lang=scss&","webpack:///nextcloud/apps/theming/src/components/ItemPreview.vue?vue&type=style&index=0&id=37ca8ab2&lang=scss&scoped=true&","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/amd define","webpack:///nextcloud/webpack/runtime/amd options","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","/**\n * @copyright Copyright (c) 2020 Julius Härtl \n *\n * @author Julius Härtl \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport { generateFilePath } from '@nextcloud/router'\n\nexport const prefixWithBaseUrl = (url) => generateFilePath('theming', '', 'img/background/') + url\n","/**\n * @copyright Copyright (c) 2020 Julius Härtl \n *\n * @author Avior \n * @author Julien Veyssier \n * @author Julius Härtl \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport { generateUrl } from '@nextcloud/router'\nimport { prefixWithBaseUrl } from './prefixWithBaseUrl.js'\n\nexport const getBackgroundUrl = (background, time = 0, themingDefaultBackground = '') => {\n\tconst enabledThemes = window.OCA?.Theming?.enabledThemes || []\n\tconst isDarkTheme = (enabledThemes.length === 0 || enabledThemes[0] === 'default')\n\t\t? window.matchMedia('(prefers-color-scheme: dark)').matches\n\t\t: enabledThemes.join('').indexOf('dark') !== -1\n\n\tif (background === 'default') {\n\t\tif (themingDefaultBackground && themingDefaultBackground !== 'backgroundColor') {\n\t\t\treturn generateUrl('/apps/theming/image/background') + '?v=' + window.OCA.Theming.cacheBuster\n\t\t}\n\n\t\tif (isDarkTheme) {\n\t\t\treturn prefixWithBaseUrl('eduardo-neves-pedra-azul.jpg')\n\t\t}\n\n\t\treturn prefixWithBaseUrl('kamil-porembinski-clouds.jpg')\n\t} else if (background === 'custom') {\n\t\treturn generateUrl('/apps/theming/background') + '?v=' + time\n\t}\n\n\treturn prefixWithBaseUrl(background)\n}\n","\n\n\n\n\n\n\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./BackgroundSettings.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./BackgroundSettings.vue?vue&type=script&lang=js&\"","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./BackgroundSettings.vue?vue&type=style&index=0&id=57fc0570&scoped=true&lang=scss&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./BackgroundSettings.vue?vue&type=style&index=0&id=57fc0570&scoped=true&lang=scss&\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./BackgroundSettings.vue?vue&type=template&id=57fc0570&scoped=true&\"\nimport script from \"./BackgroundSettings.vue?vue&type=script&lang=js&\"\nexport * from \"./BackgroundSettings.vue?vue&type=script&lang=js&\"\nimport style0 from \"./BackgroundSettings.vue?vue&type=style&index=0&id=57fc0570&scoped=true&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"57fc0570\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"background-selector\"},[_c('button',{staticClass:\"background filepicker\",class:{ active: _vm.background === 'custom' },attrs:{\"tabindex\":\"0\"},on:{\"click\":_vm.pickFile}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('theming', 'Pick from Files'))+\"\\n\\t\")]),_vm._v(\" \"),_c('button',{staticClass:\"background default\",class:{ 'icon-loading': _vm.loading === 'default', active: _vm.background === 'default' },attrs:{\"tabindex\":\"0\"},on:{\"click\":_vm.setDefault}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('theming', 'Default image'))+\"\\n\\t\")]),_vm._v(\" \"),_c('NcColorPicker',{on:{\"input\":_vm.debouncePickColor},model:{value:(_vm.Theming.color),callback:function ($$v) {_vm.$set(_vm.Theming, \"color\", $$v)},expression:\"Theming.color\"}},[_c('button',{staticClass:\"background color\",class:{ active: _vm.background === _vm.Theming.color},style:({ backgroundColor: _vm.Theming.color, color: _vm.invertTextColor(_vm.Theming.color) ? '#000000' : '#ffffff'}),attrs:{\"tabindex\":\"0\",\"data-color\":_vm.Theming.color,\"data-color-bright\":_vm.invertTextColor(_vm.Theming.color)}},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.t('theming', 'Custom color'))+\"\\n\\t\\t\")])]),_vm._v(\" \"),_c('button',{staticClass:\"background color\",class:{ active: _vm.background === _vm.Theming.defaultColor },style:({ color: _vm.invertTextColor(_vm.Theming.defaultColor) ? '#000000' : '#ffffff'}),attrs:{\"tabindex\":\"0\",\"data-color\":_vm.Theming.defaultColor,\"data-color-bright\":_vm.invertTextColor(_vm.Theming.defaultColor)},on:{\"click\":_vm.debouncePickColor}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('theming', 'Plain background'))+\"\\n\\t\")]),_vm._v(\" \"),_vm._l((_vm.shippedBackgrounds),function(shippedBackground){return _c('button',{directives:[{name:\"tooltip\",rawName:\"v-tooltip\",value:(shippedBackground.details.attribution),expression:\"shippedBackground.details.attribution\"}],key:shippedBackground.name,staticClass:\"background\",class:{ 'icon-loading': _vm.loading === shippedBackground.name, active: _vm.background === shippedBackground.name },style:({ 'background-image': 'url(' + shippedBackground.preview + ')' }),attrs:{\"tabindex\":\"0\",\"data-color-bright\":shippedBackground.details.theming === 'dark'},on:{\"click\":function($event){return _vm.setShipped(shippedBackground.name)}}})})],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ItemPreview.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ItemPreview.vue?vue&type=script&lang=js&\"","\n\n\n\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ItemPreview.vue?vue&type=style&index=0&id=37ca8ab2&lang=scss&scoped=true&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ItemPreview.vue?vue&type=style&index=0&id=37ca8ab2&lang=scss&scoped=true&\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./ItemPreview.vue?vue&type=template&id=37ca8ab2&scoped=true&\"\nimport script from \"./ItemPreview.vue?vue&type=script&lang=js&\"\nexport * from \"./ItemPreview.vue?vue&type=script&lang=js&\"\nimport style0 from \"./ItemPreview.vue?vue&type=style&index=0&id=37ca8ab2&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"37ca8ab2\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"theming__preview\",class:'theming__preview--' + _vm.theme.id},[_c('div',{staticClass:\"theming__preview-image\",style:({ backgroundImage: 'url(' + _vm.img + ')' }),on:{\"click\":_vm.onToggle}}),_vm._v(\" \"),_c('div',{staticClass:\"theming__preview-description\"},[_c('h3',[_vm._v(_vm._s(_vm.theme.title))]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.theme.description))]),_vm._v(\" \"),(_vm.enforced)?_c('span',{staticClass:\"theming__preview-warning\",attrs:{\"role\":\"note\"}},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.t('theming', 'Theme selection is enforced'))+\"\\n\\t\\t\")]):_vm._e(),_vm._v(\" \"),_c('NcCheckboxRadioSwitch',{staticClass:\"theming__preview-toggle\",attrs:{\"checked\":_vm.checked,\"disabled\":_vm.enforced,\"name\":_vm.name,\"type\":_vm.switchType},on:{\"update:checked\":function($event){_vm.checked=$event}}},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.theme.enableLabel)+\"\\n\\t\\t\")])],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n","import mod from \"-!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UserThemes.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UserThemes.vue?vue&type=script&lang=js&\"","\n import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/sass-loader/dist/cjs.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UserThemes.vue?vue&type=style&index=0&id=92936166&lang=scss&scoped=true&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/sass-loader/dist/cjs.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UserThemes.vue?vue&type=style&index=0&id=92936166&lang=scss&scoped=true&\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./UserThemes.vue?vue&type=template&id=92936166&scoped=true&\"\nimport script from \"./UserThemes.vue?vue&type=script&lang=js&\"\nexport * from \"./UserThemes.vue?vue&type=script&lang=js&\"\nimport style0 from \"./UserThemes.vue?vue&type=style&index=0&id=92936166&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"92936166\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',[_c('NcSettingsSection',{staticClass:\"theming\",attrs:{\"title\":_vm.t('theming', 'Appearance and accessibility'),\"limit-width\":false}},[_c('p',{domProps:{\"innerHTML\":_vm._s(_vm.description)}}),_vm._v(\" \"),_c('p',{domProps:{\"innerHTML\":_vm._s(_vm.descriptionDetail)}}),_vm._v(\" \"),_c('div',{staticClass:\"theming__preview-list\"},_vm._l((_vm.themes),function(theme){return _c('ItemPreview',{key:theme.id,attrs:{\"enforced\":theme.id === _vm.enforceTheme,\"selected\":_vm.selectedTheme.id === theme.id,\"theme\":theme,\"unique\":_vm.themes.length === 1,\"type\":\"theme\"},on:{\"change\":_vm.changeTheme}})}),1),_vm._v(\" \"),_c('div',{staticClass:\"theming__preview-list\"},_vm._l((_vm.fonts),function(theme){return _c('ItemPreview',{key:theme.id,attrs:{\"selected\":theme.enabled,\"theme\":theme,\"unique\":_vm.fonts.length === 1,\"type\":\"font\"},on:{\"change\":_vm.changeFont}})}),1)]),_vm._v(\" \"),_c('NcSettingsSection',{attrs:{\"title\":_vm.t('theming', 'Keyboard shortcuts')}},[_c('p',[_vm._v(_vm._s(_vm.t('theming', 'In some cases keyboard shortcuts can interfer with accessibility tools. In order to allow focusing on your tool correctly you can disable all keyboard shortcuts here. This will also disable all available shortcuts in apps.')))]),_vm._v(\" \"),_c('NcCheckboxRadioSwitch',{staticClass:\"theming__preview-toggle\",attrs:{\"checked\":_vm.shortcutsDisabled,\"name\":\"shortcuts_disabled\",\"type\":\"switch\"},on:{\"update:checked\":function($event){_vm.shortcutsDisabled=$event},\"change\":_vm.changeShortcutsDisabled}},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.t('theming', 'Disable all keyboard shortcuts'))+\"\\n\\t\\t\")])],1),_vm._v(\" \"),_c('NcSettingsSection',{staticClass:\"background\",attrs:{\"title\":_vm.t('theming', 'Background')}},[_c('p',[_vm._v(_vm._s(_vm.t('theming', 'Set a custom background')))]),_vm._v(\" \"),_c('BackgroundSettings',{staticClass:\"background__grid\",attrs:{\"background\":_vm.background,\"theming-default-background\":_vm.themingDefaultBackground},on:{\"update:background\":_vm.updateBackground}})],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * @copyright Copyright (c) 2018 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport Vue from 'vue'\nimport App from './UserThemes.vue'\n\n// bind to window\nVue.prototype.OC = OC\nVue.prototype.t = t\n\nconst View = Vue.extend(App)\nconst theming = new View()\ntheming.$mount('#theming')\n\ntheming.$on('update:background', () => {\n\t// Refresh server-side generated theming CSS\n\t[...document.head.querySelectorAll('link.theme')].forEach(theme => {\n\t\tconst url = new URL(theme.href)\n\t\turl.searchParams.set('v', Date.now())\n\t\tconst newTheme = theme.cloneNode()\n\t\tnewTheme.href = url.toString()\n\t\tnewTheme.onload = () => theme.remove()\n\t\tdocument.head.append(newTheme)\n\t})\n})\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".theming p[data-v-92936166]{max-width:800px}.theming[data-v-92936166] a{font-weight:bold}.theming[data-v-92936166] a:hover,.theming[data-v-92936166] a:focus{text-decoration:underline}.theming__preview-list[data-v-92936166]{--gap: 30px;display:grid;margin-top:var(--gap);column-gap:var(--gap);row-gap:var(--gap);grid-template-columns:1fr 1fr}.background__grid[data-v-92936166]{margin-top:30px}@media(max-width: 1440px){.theming__preview-list[data-v-92936166]{display:flex;flex-direction:column}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./apps/theming/src/UserThemes.vue\"],\"names\":[],\"mappings\":\"AA6RC,4BACC,eAAA,CAID,4BACC,gBAAA,CAEA,oEAEC,yBAAA,CAIF,wCACC,WAAA,CAEA,YAAA,CACA,qBAAA,CACA,qBAAA,CACA,kBAAA,CACA,6BAAA,CAKD,mCACC,eAAA,CAIF,0BACC,wCACC,YAAA,CACA,qBAAA,CAAA\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n.theming {\\n\\t// Limit width of settings sections for readability\\n\\tp {\\n\\t\\tmax-width: 800px;\\n\\t}\\n\\n\\t// Proper highlight for links and focus feedback\\n\\t&::v-deep a {\\n\\t\\tfont-weight: bold;\\n\\n\\t\\t&:hover,\\n\\t\\t&:focus {\\n\\t\\t\\ttext-decoration: underline;\\n\\t\\t}\\n\\t}\\n\\n\\t&__preview-list {\\n\\t\\t--gap: 30px;\\n\\n\\t\\tdisplay: grid;\\n\\t\\tmargin-top: var(--gap);\\n\\t\\tcolumn-gap: var(--gap);\\n\\t\\trow-gap: var(--gap);\\n\\t\\tgrid-template-columns: 1fr 1fr;\\n\\t}\\n}\\n\\n.background {\\n\\t&__grid {\\n\\t\\tmargin-top: 30px;\\n\\t}\\n}\\n\\n@media (max-width: 1440px) {\\n\\t.theming__preview-list {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".background-selector[data-v-57fc0570]{display:flex;flex-wrap:wrap;justify-content:center}.background-selector .background[data-v-57fc0570]{width:176px;height:96px;margin:8px;background-size:cover;background-position:center center;text-align:center;border-radius:var(--border-radius-large);border:2px solid var(--color-main-background);overflow:hidden}.background-selector .background.current[data-v-57fc0570]{background-image:var(--color-background-dark)}.background-selector .background.filepicker[data-v-57fc0570],.background-selector .background.default[data-v-57fc0570],.background-selector .background.color[data-v-57fc0570]{border-color:var(--color-border)}.background-selector .background.color[data-v-57fc0570]{background-color:var(--color-primary-default);color:var(--color-primary-text)}.background-selector .background.active[data-v-57fc0570],.background-selector .background[data-v-57fc0570]:hover,.background-selector .background[data-v-57fc0570]:focus{border:2px solid var(--color-primary)}.background-selector .background.active[data-v-57fc0570]:not(.icon-loading):after{background-image:var(--icon-checkmark-white);background-repeat:no-repeat;background-position:center;background-size:44px;content:\\\"\\\";display:block;height:100%}.background-selector .background.active:not(.icon-loading)[data-color-bright][data-v-57fc0570]:after{background-image:var(--icon-checkmark-dark)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./apps/theming/src/components/BackgroundSettings.vue\"],\"names\":[],\"mappings\":\"AA6NA,sCACC,YAAA,CACA,cAAA,CACA,sBAAA,CAEA,kDACC,WAAA,CACA,WAAA,CACA,UAAA,CACA,qBAAA,CACA,iCAAA,CACA,iBAAA,CACA,wCAAA,CACA,6CAAA,CACA,eAAA,CAEA,0DACC,6CAAA,CAGD,+KACC,gCAAA,CAGD,wDACC,6CAAA,CACA,+BAAA,CAGD,yKAGC,qCAAA,CAIA,kFACC,4CAAA,CACA,2BAAA,CACA,0BAAA,CACA,oBAAA,CACA,UAAA,CACA,aAAA,CACA,WAAA,CAGD,qGACC,2CAAA\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n.background-selector {\\n\\tdisplay: flex;\\n\\tflex-wrap: wrap;\\n\\tjustify-content: center;\\n\\n\\t.background {\\n\\t\\twidth: 176px;\\n\\t\\theight: 96px;\\n\\t\\tmargin: 8px;\\n\\t\\tbackground-size: cover;\\n\\t\\tbackground-position: center center;\\n\\t\\ttext-align: center;\\n\\t\\tborder-radius: var(--border-radius-large);\\n\\t\\tborder: 2px solid var(--color-main-background);\\n\\t\\toverflow: hidden;\\n\\n\\t\\t&.current {\\n\\t\\t\\tbackground-image: var(--color-background-dark);\\n\\t\\t}\\n\\n\\t\\t&.filepicker, &.default, &.color {\\n\\t\\t\\tborder-color: var(--color-border);\\n\\t\\t}\\n\\n\\t\\t&.color {\\n\\t\\t\\tbackground-color: var(--color-primary-default);\\n\\t\\t\\tcolor: var(--color-primary-text);\\n\\t\\t}\\n\\n\\t\\t&.active,\\n\\t\\t&:hover,\\n\\t\\t&:focus {\\n\\t\\t\\tborder: 2px solid var(--color-primary);\\n\\t\\t}\\n\\n\\t\\t&.active:not(.icon-loading) {\\n\\t\\t\\t&:after {\\n\\t\\t\\t\\tbackground-image: var(--icon-checkmark-white);\\n\\t\\t\\t\\tbackground-repeat: no-repeat;\\n\\t\\t\\t\\tbackground-position: center;\\n\\t\\t\\t\\tbackground-size: 44px;\\n\\t\\t\\t\\tcontent: '';\\n\\t\\t\\t\\tdisplay: block;\\n\\t\\t\\t\\theight: 100%;\\n\\t\\t\\t}\\n\\n\\t\\t\\t&[data-color-bright]:after {\\n\\t\\t\\t\\tbackground-image: var(--icon-checkmark-dark);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".theming__preview[data-v-37ca8ab2]{--ratio: 16;position:relative;display:flex;justify-content:flex-start;max-width:800px}.theming__preview[data-v-37ca8ab2],.theming__preview *[data-v-37ca8ab2]{user-select:none}.theming__preview-image[data-v-37ca8ab2]{flex-basis:calc(16px*var(--ratio));flex-shrink:0;height:calc(10px*var(--ratio));margin-right:var(--gap);cursor:pointer;border-radius:var(--border-radius);background-repeat:no-repeat;background-position:top left;background-size:cover}.theming__preview-description[data-v-37ca8ab2]{display:flex;flex-direction:column}.theming__preview-description label[data-v-37ca8ab2]{padding:12px 0}.theming__preview--default[data-v-37ca8ab2]{grid-column:span 2}.theming__preview-warning[data-v-37ca8ab2]{color:var(--color-warning)}@media(max-width: 682.6666666667px){.theming__preview[data-v-37ca8ab2]{flex-direction:column}.theming__preview-image[data-v-37ca8ab2]{margin:0}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./apps/theming/src/components/ItemPreview.vue\"],\"names\":[],\"mappings\":\"AAiGA,mCAEC,WAAA,CAEA,iBAAA,CACA,YAAA,CACA,0BAAA,CACA,eAAA,CAEA,wEAEC,gBAAA,CAGD,yCACC,kCAAA,CACA,aAAA,CACA,8BAAA,CACA,uBAAA,CACA,cAAA,CACA,kCAAA,CACA,2BAAA,CACA,4BAAA,CACA,qBAAA,CAGD,+CACC,YAAA,CACA,qBAAA,CAEA,qDACC,cAAA,CAIF,4CACC,kBAAA,CAGD,2CACC,0BAAA,CAIF,oCACC,mCACC,qBAAA,CAEA,yCACC,QAAA,CAAA\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n.theming__preview {\\n\\t// We make previews on 16/10 screens\\n\\t--ratio: 16;\\n\\n\\tposition: relative;\\n\\tdisplay: flex;\\n\\tjustify-content: flex-start;\\n\\tmax-width: 800px;\\n\\n\\t&,\\n\\t* {\\n\\t\\tuser-select: none;\\n\\t}\\n\\n\\t&-image {\\n\\t\\tflex-basis: calc(16px * var(--ratio));\\n\\t\\tflex-shrink: 0;\\n\\t\\theight: calc(10px * var(--ratio));\\n\\t\\tmargin-right: var(--gap);\\n\\t\\tcursor: pointer;\\n\\t\\tborder-radius: var(--border-radius);\\n\\t\\tbackground-repeat: no-repeat;\\n\\t\\tbackground-position: top left;\\n\\t\\tbackground-size: cover;\\n\\t}\\n\\n\\t&-description {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\n\\t\\tlabel {\\n\\t\\t\\tpadding: 12px 0;\\n\\t\\t}\\n\\t}\\n\\n\\t&--default {\\n\\t\\tgrid-column: span 2;\\n\\t}\\n\\n\\t&-warning {\\n\\t\\tcolor: var(--color-warning);\\n\\t}\\n}\\n\\n@media (max-width: (1024px / 1.5)) {\\n\\t.theming__preview {\\n\\t\\tflex-direction: column;\\n\\n\\t\\t&-image {\\n\\t\\t\\tmargin: 0;\\n\\t\\t}\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.amdD = function () {\n\tthrow new Error('define cannot be used indirect');\n};","__webpack_require__.amdO = {};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 6755;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t6755: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [7874], function() { return __webpack_require__(35400); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","prefixWithBaseUrl","url","generateFilePath","getBackgroundUrl","background","time","themingDefaultBackground","enabledThemes","window","OCA","Theming","isDarkTheme","length","matchMedia","matches","join","indexOf","generateUrl","cacheBuster","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","_vm","this","_h","$createElement","_c","_self","staticClass","class","active","attrs","on","pickFile","_v","_s","t","loading","setDefault","debouncePickColor","model","value","callback","$$v","$set","expression","color","style","backgroundColor","invertTextColor","defaultColor","_l","shippedBackground","directives","name","rawName","details","key","preview","theming","$event","setShipped","theme","id","backgroundImage","img","onToggle","title","description","_e","checked","enforced","switchType","enableLabel","console","debug","availableThemes","domProps","descriptionDetail","enforceTheme","selectedTheme","themes","changeTheme","enabled","fonts","changeFont","shortcutsDisabled","changeShortcutsDisabled","updateBackground","Vue","OC","App","$mount","$on","document","head","querySelectorAll","forEach","URL","href","searchParams","set","Date","now","newTheme","cloneNode","toString","onload","remove","append","___CSS_LOADER_EXPORT___","push","module","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","loaded","__webpack_modules__","call","m","amdD","Error","amdO","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","Object","keys","every","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","g","globalThis","Function","e","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","nmd","paths","children","b","baseURI","self","location","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","chunkLoadingGlobal","bind","nc","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/private/Files/SimpleFS/SimpleFolder.php b/lib/private/Files/SimpleFS/SimpleFolder.php index 263c25a88739f..1f267119871a1 100644 --- a/lib/private/Files/SimpleFS/SimpleFolder.php +++ b/lib/private/Files/SimpleFS/SimpleFolder.php @@ -91,4 +91,19 @@ public function newFile(string $name, $content = null): ISimpleFile { return new SimpleFile($file); } } + + public function getFolder(string $name): ISimpleFolder { + $folder = $this->folder->get($name); + + if (!($folder instanceof Folder)) { + throw new NotFoundException(); + } + + return new SimpleFolder($folder); + } + + public function newFolder(string $path): ISimpleFolder { + $folder = $this->folder->newFolder($path); + return new SimpleFolder($folder); + } } diff --git a/lib/public/Files/SimpleFS/ISimpleFolder.php b/lib/public/Files/SimpleFS/ISimpleFolder.php index 3c8e6e88ab358..ca60cc4c418cb 100644 --- a/lib/public/Files/SimpleFS/ISimpleFolder.php +++ b/lib/public/Files/SimpleFS/ISimpleFolder.php @@ -80,4 +80,21 @@ public function delete(): void; * @since 11.0.0 */ public function getName(): string; + + /** + * Get the folder named $name from the current folder + * + * @throws NotFoundException + * @since 25.0.0 + */ + public function getFolder(string $name): ISimpleFolder; + + /** + * Creates a new folder with $name in the current folder + * + * @param string|resource|null $content @since 19.0.0 + * @throws NotPermittedException + * @since 25.0.0 + */ + public function newFolder(string $path): ISimpleFolder; } diff --git a/tests/lib/Files/SimpleFS/SimpleFolderTest.php b/tests/lib/Files/SimpleFS/SimpleFolderTest.php index 50714b8356efb..9710b6f438b97 100644 --- a/tests/lib/Files/SimpleFS/SimpleFolderTest.php +++ b/tests/lib/Files/SimpleFS/SimpleFolderTest.php @@ -28,6 +28,7 @@ use OCP\Files\Folder; use OCP\Files\NotFoundException; use OCP\Files\SimpleFS\ISimpleFile; +use OCP\Files\SimpleFS\ISimpleFolder; use Test\Traits\MountProviderTrait; use Test\Traits\UserTrait; @@ -109,4 +110,22 @@ public function testGetDirectoryListing() { $this->assertInstanceOf(ISimpleFile::class, $result[0]); $this->assertInstanceOf(ISimpleFile::class, $result[1]); } + + public function testGetFolder() { + $this->folder->newFolder('exists'); + + $result = $this->simpleFolder->getFolder('exists'); + $this->assertInstanceOf(ISimpleFolder::class, $result); + + $this->expectException(NotFoundException::class); + $this->simpleFolder->getFolder('not-exists'); + } + + public function testNewFolder() { + $result = $this->simpleFolder->newFolder('folder'); + $this->assertInstanceOf(ISimpleFolder::class, $result); + $result->newFile('file'); + + $this->assertTrue($this->folder->nodeExists('folder')); + } }