import{s as e}from"./p-fdd3ce28.js";import{U as r,g as o,s as c}from"./p-f1210c25.js";import{F as t}from"./p-fd8baa6a.js";const a=e=>{if("(prefers-color-scheme: dark)"!==e.media)return;const r=n();document.documentElement.setAttribute("color-scheme","auto"===r?e.matches?"dark":"light":r)},n=()=>localStorage.getItem("bce-color-scheme")||"auto";var s={file:t.inMemory(),FileManager:t,generateId:function(){return r.v4()},getColorScheme:n,getColorShade:o,setColorScheme:e=>{if("dark"===e||"light"===e)localStorage.setItem("bce-color-scheme",e),document.documentElement.setAttribute("color-scheme",e);else{localStorage.removeItem("bce-color-scheme");const e=window.matchMedia("(prefers-color-scheme: dark)");a(e)}},setColorShade:c},i=function(e,r){for(var o=[],c=2;c<arguments.length;c++)o[c-2]=arguments[c];if(!e.matches(r))return!1;for(var t=0,a=o;t<a.length;t++){var n=a[t],s=e.parentElement;if(!s||!s.matches(n))return!1;e=s}return!0};const f=function(){window.BCE=window.BCE||s,(()=>{const e=window.matchMedia("(prefers-color-scheme: dark)");e.addEventListener?e.addEventListener("change",a):e.addListener(a),a(e)})(),e((function(e){if(i(e,"bce-button","bce-fab"))return"bce-fab";if(i(e,"bce-button","bce-menu"))return"bce-menu";if(i(e,"bce-link","bce-link"))return"bce-link";if(i(e,"bce-nav","bce-header"))return"bce-header";if(i(e,"bce-nav","bce-side-bar"))return"bce-side-bar";var r=e.closest("bce-root");return e.getAttribute("mode")||r&&r.mode||"default"}))};export{f as g};