"use strict";const e=require("@tempots/dom"),m=require("@tempots/ui"),p={mark:e.makeProviderMark("Theme"),create:({defaultAppearance:r="system",appearancePreferenceKey:s="bui-appearance"}={})=>{const c=m.useAppearance(),a=e.localStorageProp({key:s,defaultValue:r}),o=()=>{c.dispose(),a.dispose()};return{value:{appearance:e.computedOf(c,a)((t,n)=>n==="system"?t:n),appearancePreference:a,setAppearancePreference:t=>{a.set(t)}},dispose:o}}},u=()=>e.Use(p,({appearance:r})=>e.Portal("html",e.attr.class(r.map(s=>s))));exports.Theme=p;exports.ThemeAppearance=u;
