import { a3 as u, a4 as t, w as y, d0 as c, a9 as m, a5 as n, ex as p, aG as f, V as l, U as C, H as a, ad as s, I as h, ae as o, af as i, am as r, ag as v, ah as w, aj as g, ai as S, ey as P } from "./56c67d3b.js";
import { useContext as d } from "react";
import { mediaCommonChildren as b, mediaMethods as x } from "./4afc263f.js";
import "react-dom";
const E = 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(E, {
  ref: e.containerRef,
  $style: e.style,
  $animationStyle: e.animationStyle,
  children: /* @__PURE__ */ a(P, {
    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: y(c, t("audio.defaultSrcUrl")),
  onEvent: m(V),
  style: n(p, "style"),
  animationStyle: n(f, "animationStyle"),
  autoPlay: l,
  loop: l,
  ...b
};
let D = function() {
  return new C(A, (e) => /* @__PURE__ */ a($, {
    ...e
  })).setPropertyViewFn((e) => /* @__PURE__ */ s(h, {
    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(), v(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(x()).build();
}();
const N = w(D, [new g("src", t("audio.srcDesc")), S]);
export {
  N as AudioComp
};
