import { b9 as b, w as r, bv as d, cf as f, cK as P, cZ as V, bB as x, et as v, U as D, V as e, cy as $, eu as S, P as a, bh as u, bi as s, bj as i, a0 as n, bg as h, bl as E, bn as B, bo as H, bG as k } from "./684d2f28.js";
import { useRef as N, useState as R, useContext as m } from "react";
import { formDataChildren as j, FormDataPropertyView as z } from "./00dac55d.js";
import "react-dom";
const F = b.div`
  background: ${(o) => o.$src && `url(${o.$src})`} no-repeat 50% 50%;
  background-size: contain;
`, M = b.div`
  &,
  .ant-carousel {
    height: 100%;
    background-color: ${(o) => o.$bg};
  }
`;
let c = function() {
  const o = {
    autoPlay: r(d, !0),
    data: r(f, JSON.stringify(["https://temp.im/403x192", "https://temp.im/403x192"])),
    onEvent: P,
    showDots: r(d, !0),
    dotPosition: r(V, "bottom"),
    style: x(v),
    ...j
  };
  return new D(o, (t) => {
    const l = N(null), [y, g] = R(0), C = () => {
      l.current && g(l.current.clientHeight);
    };
    return /* @__PURE__ */ e(M, {
      ref: l,
      $bg: t.style.background,
      children: /* @__PURE__ */ e($, {
        onResize: C,
        children: /* @__PURE__ */ e(S, {
          dots: t.showDots,
          dotPosition: t.dotPosition,
          autoplay: t.autoPlay,
          afterChange: () => t.onEvent("change"),
          children: t.data.map((p, w) => /* @__PURE__ */ e("div", {
            children: /* @__PURE__ */ e(F, {
              $src: p,
              style: {
                height: y
              }
            })
          }, w))
        })
      })
    });
  }).setPropertyViewFn((t) => /* @__PURE__ */ a(u, {
    children: [/* @__PURE__ */ e(s, {
      name: i.basic,
      children: t.data.propertyView({
        label: n("data")
      })
    }), ["logic", "both"].includes(m(h).editorModeStatus) && /* @__PURE__ */ a(u, {
      children: [/* @__PURE__ */ e(z, {
        ...t
      }), /* @__PURE__ */ a(s, {
        name: i.interaction,
        children: [t.onEvent.getPropertyView(), E(t), t.autoPlay.propertyView({
          label: n("carousel.autoPlay")
        })]
      })]
    }), ["layout", "both"].includes(m(h).editorModeStatus) && /* @__PURE__ */ a(u, {
      children: [/* @__PURE__ */ a(s, {
        name: i.layout,
        children: [t.showDots.propertyView({
          label: n("carousel.showDots")
        }), t.dotPosition.propertyView({
          label: n("carousel.dotPosition"),
          radioButton: !0
        })]
      }), /* @__PURE__ */ e(s, {
        name: i.style,
        children: t.style.getPropertyView()
      })]
    })]
  })).build();
}();
c = class extends c {
  autoHeight() {
    return !1;
  }
};
const J = B(c, [new H("data", n("data")), k]);
export {
  J as CarouselComp
};
