import { inject, onMounted, watch } from "vue";
import { r as rtlRegistryKey } from "./keys-D5Pj1dmf.mjs";
const useRtl = () => {
  const rtlPlugin = inject(rtlRegistryKey, null);
  onMounted(() => {
    watch(
      () => rtlPlugin?.locale.value,
      (newValue) => {
        const html = document.documentElement;
        html.setAttribute("lang", newValue ?? "");
      },
      { immediate: true }
    );
    watch(
      () => rtlPlugin?.isRtl.value,
      (newValue) => {
        const html = document.documentElement;
        html.setAttribute("dir", newValue ?? false ? "rtl" : "ltr");
      },
      { immediate: true }
    );
  });
  return { ...rtlPlugin };
};
export {
  useRtl as u
};
//# sourceMappingURL=useRtl-B6hKZO1m.mjs.map
