import{s as e}from"./p-d7041ce0.js";import{U as r}from"./p-2cb36beb.js";import{F as c}from"./p-4caca36a.js";var o={file:c.inMemory(),setColorScheme:function(e){if("dark"===e||"light"===e)localStorage.setItem("bce-color-scheme",e),document.documentElement.setAttribute("color-scheme",e);else{localStorage.removeItem("bce-color-scheme");var r=window.matchMedia("(prefers-color-scheme: dark)");a(r)}},generateId:function(){return r.v4()},FileManager:c},n=function(e,r){for(var c=[],o=2;o<arguments.length;o++)c[o-2]=arguments[o];if(!e.matches(r))return!1;for(var n=0,a=c;n<a.length;n++){var t=a[n],i=e.parentElement;if(!i||!i.matches(t))return!1;e=i}return!0},a=function(e){switch(e.media){case"(prefers-color-scheme: dark)":var r=localStorage.getItem("bce-color-scheme");document.documentElement.setAttribute("color-scheme",r||(e.matches?"dark":"light"))}};const t=function(){window.BCE=window.BCE||o;var r=window.matchMedia("(prefers-color-scheme: dark)");r.addEventListener?r.addEventListener("change",a):r.addListener(a),a(r),e((function(e){if(n(e,"bce-button","bce-fab"))return"bce-fab";if(n(e,"bce-button","bce-menu"))return"bce-menu";if(n(e,"bce-link","bce-link"))return"bce-link";if(n(e,"bce-nav","bce-header"))return"bce-header";if(n(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{t as g};