<script>

</script>

<script setup>
import { computed } from "vue";
import defu from "defu";
import { injectThemeContext, provideThemeContext } from "../composables/useComponentProps";
const _props = defineProps({
  props: { type: Object, required: false },
  b24ui: { type: null, required: false }
});
defineSlots();
const parent = injectThemeContext();
const NAMESPACES = /* @__PURE__ */ new Set(["prose"]);
function normalizeUi(b24ui) {
  if (!b24ui) return {};
  const result = {};
  for (const [key, value] of Object.entries(b24ui)) {
    if (!value || typeof value !== "object") continue;
    if (NAMESPACES.has(key)) {
      const nested = {};
      for (const [childKey, childValue] of Object.entries(value)) {
        if (childValue && typeof childValue === "object") {
          nested[childKey] = { b24ui: childValue };
        }
      }
      result[key] = nested;
    } else {
      result[key] = { b24ui: value };
    }
  }
  return result;
}
provideThemeContext({
  defaults: computed(() => defu(
    _props.props ?? {},
    normalizeUi(_props.b24ui),
    parent.defaults.value
  ))
});
</script>

<template>
  <slot />
</template>
