import { X as g, af as k, di as I, F as i, dj as x, dk as p, a6 as f, aw as v, dl as w, du as C, av as P, dh as S, ig as B, dt as W } from "./603b75d9.js";
import { useContext as z, useState as H, useEffect as R } from "react";
import "react-dom";
const u = (e) => P`
    border-color: ${e.border};
    border-width: ${e.borderWidth};
    border-radius: ${e.radius};
    overflow: hidden;
    padding: ${e.padding};
    
    ${S(e)}
  `, O = g.div`
  display: flex;
  flex-flow: column;
  height: 100%;
  border: 1px solid #d7d9e0;
  border-radius: 4px;
  ${(e) => e.$style && u(e.$style)}
`, j = g(B)`;
  ${(e) => e.$style && u(e.$style)}
`, G = g(W)`
  border-top: ${(e) => `${e.$showBorder ? e.$borderWidth : 0} solid ${e.$borderColor}`};
  flex: 1;
  ${(e) => e.$backgroundColor && `background-color: ${e.$backgroundColor};`}
  border-radius: 0;
  ${(e) => e.$backgroundImage && `background-image: ${e.$backgroundImage};`}
  ${(e) => e.$backgroundImageRepeat && `background-repeat: ${e.$backgroundImageRepeat};`}
  ${(e) => e.$backgroundImageSize && `background-size: ${e.$backgroundImageSize};`}
  ${(e) => e.$backgroundImagePosition && `background-position: ${e.$backgroundImagePosition};`}
  ${(e) => e.$backgroundImageOrigin && `background-origin: ${e.$backgroundImageOrigin};`}
`;
function F(e) {
  const {
    container: t,
    icon: n
  } = e, l = t.showVerticalScrollbar, {
    items: $,
    ...b
  } = t.body[0].children.view.getView(), {
    style: o,
    headerStyle: V,
    bodyStyle: r,
    footerStyle: E
  } = t, h = z(k).getAppSettings().maxWidth;
  I(h);
  let [d, m] = H({
    value: "star",
    index: 0
  });
  return R(() => {
    var c, s;
    if ((c = n.props) != null && c.value) {
      let a = (s = n.props) == null ? void 0 : s.value;
      m({
        index: parseInt(a == null ? void 0 : a.split("_")[0]),
        value: a == null ? void 0 : a.split("_")[1]
      });
    }
  }, [n.props]), /* @__PURE__ */ i("div", {
    style: {
      padding: o.margin,
      height: "100%"
    },
    children: /* @__PURE__ */ i(O, {
      $style: o,
      children: /* @__PURE__ */ i(x.Provider, {
        value: r.background,
        children: /* @__PURE__ */ i(p, {
          style: {
            height: t.autoHeight ? "auto" : "100%",
            margin: "0px",
            padding: "0px"
          },
          hideScrollbar: !l,
          children: /* @__PURE__ */ f("div", {
            style: {
              position: "relative",
              height: "100%"
            },
            children: [/* @__PURE__ */ i(j, {
              $style: o,
              type: d == null ? void 0 : d.value,
              noise: !1,
              index: d.index,
              styles: {
                position: "absolute",
                top: "0",
                left: "50%",
                transform: "translateX(-50%)",
                width: v(o.margin),
                height: "100%"
              }
            }), /* @__PURE__ */ i(G, {
              $showBorder: !1,
              ...b,
              items: w($),
              autoHeight: t.autoHeight,
              emptyRows: 14,
              minHeight: "142px",
              hintPlaceholder: e.hintPlaceholder ?? C,
              $backgroundColor: (r == null ? void 0 : r.background) || "transparent",
              $borderColor: o == null ? void 0 : o.border,
              $borderWidth: o == null ? void 0 : o.borderWidth,
              $backgroundImage: r == null ? void 0 : r.backgroundImage,
              $backgroundImageRepeat: r == null ? void 0 : r.backgroundImageRepeat,
              $backgroundImageSize: r == null ? void 0 : r.backgroundImageSize,
              $backgroundImagePosition: r == null ? void 0 : r.backgroundImagePosition,
              $backgroundImageOrigin: r == null ? void 0 : r.backgroundImageOrigin,
              style: {
                zIndex: 999
              }
            })]
          })
        })
      })
    })
  });
}
export {
  F as ShapeTriContainer
};
