import { b9 as i, M as C, V as e, ea as a, gj as l, a0 as g, d5 as h, go as m, gp as f, gq as p, dc as b, d7 as w, d2 as y, a as M, db as v } from "./684d2f28.js";
import { createContext as k, useContext as r } from "react";
import "react-dom";
const x = i.div`
  .ant-modal-content {
    overflow: hidden;
    background-color: ${(o) => o.$background};

    .ant-modal-body > div {
      background-color: ${(o) => o.$background};
    }
  }
`, V = i.div`
  pointer-events: auto;

  .ant-modal-body > div {
    overflow: overlay;
  }
`, P = k({
  modalWidth: 520
}), S = (o) => /* @__PURE__ */ e(v, {
  ...o,
  emptyRows: 15,
  autoHeight: !0
});
function I(o) {
  const {
    visible: n,
    containerProps: t,
    onCancel: d
  } = o, s = r(h), {
    modalWidth: c = 520
  } = r(P);
  return n ? /* @__PURE__ */ e(V, {
    children: /* @__PURE__ */ e(m, {
      width: c,
      open: n,
      onCancel: d,
      getContainer: () => document.querySelector(`#${f}`) || document.body,
      footer: null,
      styles: {
        body: {
          padding: "0"
        }
      },
      zIndex: p.modal,
      modalRender: (u) => /* @__PURE__ */ e(x, {
        $background: s,
        onClick: () => {
        },
        children: u
      }),
      focusTriggerAfterClose: !1,
      children: /* @__PURE__ */ e(S, {
        ...t,
        hintPlaceholder: b,
        containerPadding: [36, 36],
        items: w(t.items)
      })
    })
  }) : null;
}
const $ = {
  container: y,
  showConfigModal: M(!1)
}, T = new C($, (o, n) => /* @__PURE__ */ e(I, {
  containerProps: o.container,
  visible: o.showConfigModal,
  onCancel: () => n(a("showConfigModal", !1, !1))
})).setPropertyViewFn((o, n) => /* @__PURE__ */ e(l, {
  onClick: () => n(a("showConfigModal", !0, !1)),
  children: g("slotControl.configSlotView")
})).build();
class W extends T {
  propertyView(n) {
    return /* @__PURE__ */ e(l, {
      onClick: () => this.dispatch(this.changeChildAction("showConfigModal", !0)),
      children: n.buttonText
    });
  }
  getPasteValue(n) {
    return {
      ...this.toJsonValue(),
      container: this.children.container.getPasteValue(n)
    };
  }
}
export {
  P as SlotConfigContext,
  W as SlotControl
};
