import { X as u, Y as t, w as c, cI as y, a2 as m, Z as n, eo as p, az as f, O as l, U as C, F as a, a6 as s, G as v, a7 as o, a8 as i, af as r, a9 as w, aa as h, ac as S, ab as g, ep as b } from "./603b75d9.js";
import { useContext as d } from "react";
import { mediaCommonChildren as P, mediaMethods as E } from "./f1dd0ef6.js";
import "react-dom";
const x = u.div`
${(e) => e.$style};
rotate:${(e) => e.$style.rotation};
${(e) => e.$animationStyle};
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

  div > audio {
    object-fit: contain;
    pointer-events: auto;
    height: 100%;
    width: 100%;
    :focus-visible {
      outline: 0px;
    }
  }
`, V = [{
  label: t("audio.play"),
  value: "play",
  description: t("audio.playDesc")
}, {
  label: t("audio.pause"),
  value: "pause",
  description: t("audio.pauseDesc")
}, {
  label: t("audio.ended"),
  value: "ended",
  description: t("audio.endedDesc")
}], $ = (e) => /* @__PURE__ */ a(x, {
  ref: e.containerRef,
  $style: e.style,
  $animationStyle: e.animationStyle,
  children: /* @__PURE__ */ a(b, {
    audioRef: e.viewRef,
    url: e.src.value,
    onPlay: () => e.onEvent("play"),
    onPause: () => e.onEvent("pause"),
    onEnded: () => e.onEvent("ended"),
    autoPlay: e.autoPlay,
    loop: e.loop
  })
}), A = {
  src: c(y, t("audio.defaultSrcUrl")),
  onEvent: m(V),
  style: n(p, "style"),
  animationStyle: n(f, "animationStyle"),
  autoPlay: l,
  loop: l,
  ...P
};
let D = function() {
  return new C(A, (e) => /* @__PURE__ */ a($, {
    ...e
  })).setPropertyViewFn((e) => /* @__PURE__ */ s(v, {
    children: [/* @__PURE__ */ a(o, {
      name: i.basic,
      children: e.src.propertyView({
        label: t("audio.src"),
        tooltip: t("audio.srcDesc")
      })
    }), (d(r).editorModeStatus === "logic" || d(r).editorModeStatus === "both") && /* @__PURE__ */ s(o, {
      name: i.interaction,
      children: [e.onEvent.getPropertyView(), w(e), e.autoPlay.propertyView({
        label: t("audio.autoPlay")
      }), e.loop.propertyView({
        label: t("audio.loop")
      })]
    }), /* @__PURE__ */ a(o, {
      name: i.style,
      children: e.style.getPropertyView()
    }), /* @__PURE__ */ a(o, {
      name: i.animationStyle,
      hasTooltip: !0,
      children: e.animationStyle.getPropertyView()
    })]
  })).setExposeMethodConfigs(E()).build();
}();
const N = h(D, [new S("src", t("audio.srcDesc")), g]);
export {
  N as AudioComp
};
