import{a as e}from"./theme-4HA_bZul.js";import{t}from"./options-CDXBc9UM.js";function n(){let e=window.electronApi?.window;if(!e)return;let n=window.getComputedStyle(document.body);r(e),i(e,n),t.get(`nativeTitleBarVisible`)!==`true`&&a(e,n)}function r(t){let n=`system`,r=e();r!==`auto`&&(n=r),t.setNativeThemeSource(n)}function i(e,t){let n=t.getPropertyValue(`--background-material`).trim();if(window.glob.platform===`win32`){let t=[`auto`,`none`,`mica`,`acrylic`,`tabbed`].find(e=>n===e);t&&e.setBackgroundMaterial(t)}if(window.glob.platform===`darwin`){let t=[`popover`,`tooltip`,`titlebar`,`selection`,`menu`,`sidebar`,`header`,`sheet`,`window`,`hud`,`fullscreen-ui`,`content`,`under-window`,`under-page`].find(e=>n===e);t&&e.setVibrancy(t)}}function a(e,t){if(window.glob.platform===`win32`){let n=t.getPropertyValue(`--native-titlebar-background`),r=t.getPropertyValue(`--native-titlebar-foreground`);n&&r&&e.setTitleBarOverlay({color:n,symbolColor:r})}if(window.glob.platform===`darwin`){let n=parseInt(t.getPropertyValue(`--native-titlebar-darwin-x-offset`),10),r=parseInt(t.getPropertyValue(`--native-titlebar-darwin-y-offset`),10);e.setWindowButtonPosition({x:n,y:r})}}export{n as t};