import { fi as d, w as l, V as i, X as h, dZ as V, aH as g, a5 as p, gY as b, gZ as C, g_ as S, g$ as f, h0 as m, v as P, c3 as T, D, M as A, fD as H, _ as y, x as v, z as R, h1 as c, e5 as w, e6 as U, a4 as r, s as x } from "./56c67d3b.js";
import { ContainerBodyChildComp as E } from "./eb28a942.js";
import "react";
import "react-dom";
const W = {
  header: d,
  sider: d,
  body: l(x(E), {
    0: {
      view: {
        layout: {},
        items: {}
      }
    }
  }),
  showApp: i,
  contentApp: h,
  baseUrl: h,
  footer: d,
  showHeader: i.DEFAULT_TRUE,
  showSider: i.DEFAULT_TRUE,
  innerSider: i.DEFAULT_TRUE,
  siderCollapsible: l(i, !1),
  siderCollapsed: l(i, !1),
  siderRight: l(i, !1),
  siderWidth: l(h, "20%"),
  siderCollapsedWidth: l(h, "0"),
  showFooter: i,
  horizontalGridCells: V,
  autoHeight: g,
  siderScrollbars: l(i, !1),
  contentScrollbars: l(i, !1),
  mainScrollbars: l(i, !1),
  style: p(b, "style"),
  headerStyle: p(C, "headerStyle"),
  siderStyle: p(S, "siderStyle"),
  bodyStyle: p(f, "bodyStyle"),
  footerStyle: p(m, "footerStyle"),
  appliedThemeId: P("")
}, F = T(new A(W, (s, e) => (H(s, e), {
  ...s,
  dispatch: e
})).build(), D);
class M extends F {
  // scrollbars: any;
  allContainers() {
    return [this.children.header, this.children.sider, ...Object.values(this.children.body.getView()).map((e) => e.children.view), this.children.footer];
  }
  realSimpleContainer(e) {
    return y.isNil(e) ? this.children.body.getView()[0].children.view : this.allContainers().find((t) => t.realSimpleContainer(e));
  }
  getCompTree() {
    return v(this.allContainers().map((e) => e.getCompTree()));
  }
  findContainer(e) {
    for (const t of this.allContainers()) {
      const o = t.findContainer(e);
      if (o)
        return o === t ? this : o;
    }
  }
  getPasteValue(e) {
    return {
      ...this.toJsonValue(),
      header: this.children.header.getPasteValue(e),
      sider: this.children.sider.getPasteValue(e),
      body: y.mapValues(this.children.body.getView(), (t) => ({
        ...t.toJsonValue(),
        view: t.children.view.getPasteValue(e)
      })),
      footer: this.children.footer.getPasteValue(e)
    };
  }
  autoHeight() {
    return this.children.autoHeight.getView();
  }
  exposingNode() {
    const e = {};
    return R(this.getCompTree(), (t) => {
      const o = t.children.comp;
      let a = o.exposingNode();
      if (c(a) && !a.children.hasOwnProperty("formDataKey")) {
        const n = o.children.formDataKey;
        n && (a = w({
          ...a.children,
          formDataKey: n.exposingNode()
        }));
      }
      return e[t.children.name.getView()] = a, !0;
    }), U(this, "exposing_node", w(e), u);
  }
  getPropertyView() {
    return [this.areaPropertyView(), this.gridPropertyView(), this.heightPropertyView()];
  }
  areaPropertyView() {
    return [this.children.showHeader.propertyView({
      label: r("prop.showHeader")
    }), this.children.showSider.propertyView({
      label: r("prop.showSider")
    }), this.children.siderRight.propertyView({
      label: r("prop.siderRight")
    }), this.children.innerSider.propertyView({
      label: r("prop.innerSider")
    }), this.children.siderCollapsible.propertyView({
      label: r("prop.siderCollapsible")
    }), this.children.siderCollapsed.propertyView({
      label: r("prop.siderCollapsed")
    }), this.children.showFooter.propertyView({
      label: r("prop.showFooter")
    }), this.children.siderWidth.propertyView({
      label: r("prop.siderWidth"),
      tooltip: r("prop.siderWidthTooltip")
    }), this.children.siderCollapsedWidth.propertyView({
      label: r("prop.siderCollapsedWidth"),
      tooltip: r("prop.siderCollapsedWidthTooltip")
    })];
  }
  heightPropertyView() {
    return [this.children.autoHeight.getPropertyView(), this.children.siderScrollbars.propertyView({
      label: r("prop.siderScrollbar")
    }), !this.children.autoHeight.getView() && this.children.contentScrollbars.propertyView({
      label: r("prop.showVerticalScrollbar")
    }), !this.children.autoHeight.getView() && (!this.children.siderScrollbars.getView() || !this.children.contentScrollbars.getView()) && this.children.mainScrollbars.propertyView({
      label: r("prop.mainScrollbar")
    })];
  }
  gridPropertyView() {
    return [this.children.horizontalGridCells.propertyView({
      label: r("prop.horizontalGridCells")
    })];
  }
  appSelectorPropertyView() {
    return [this.children.showApp.propertyView({
      label: r("prop.showApp"),
      tooltip: r("prop.showAppTooltip")
    }), this.children.showApp.getView() && this.children.contentApp.propertyView({
      label: r("prop.appID")
    }), this.children.showApp.getView() && this.children.baseUrl.propertyView({
      label: r("prop.baseURL")
    })];
  }
  stylePropertyView() {
    return this.children.style.getPropertyView();
  }
  headerStylePropertyView() {
    return this.children.headerStyle.getPropertyView();
  }
  siderStylePropertyView() {
    return this.children.siderStyle.getPropertyView();
  }
  bodyStylePropertyView() {
    return this.children.bodyStyle.getPropertyView();
  }
  footerStylePropertyView() {
    return this.children.footerStyle.getPropertyView();
  }
}
function u(s, e) {
  if (s === e)
    return !0;
  if (s && e && c(s) && c(e)) {
    const t = s.children, o = e.children, a = Object.keys(t);
    return a.length === Object.keys(o).length && a.every((n) => u(t[n], o[n]));
  }
  return !1;
}
export {
  M as PageLayoutComp
};
