var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stdin_exports = {};
__export(stdin_exports, {
  WrapContent: () => WrapContent
});
module.exports = __toCommonJS(stdin_exports);
var import_vue = require("vue");
var import_pro_provider = require("@antdv/pro-provider");
var import_pro_utils = require("@antdv/pro-utils");
var import_ant_design_vue = require("ant-design-vue");
var import_vue2 = require("vue");
const WrapContent = (0, import_vue2.defineComponent)({
  name: "WrapContent",
  inheritAttrs: false,
  props: {
    hasPageContainer: (0, import_pro_utils.numberType)(),
    isChildrenLayout: (0, import_pro_utils.boolType)(),
    prefixCls: (0, import_pro_utils.stringType)(),
    style: (0, import_pro_utils.objectType)(),
    location: (0, import_pro_utils.anyType)(),
    contentHeight: (0, import_pro_utils.oneOfType)([Number, String]),
    ErrorBoundary: (0, import_pro_utils.anyType)(),
    hasHeader: (0, import_pro_utils.boolType)()
  },
  setup(props, {
    slots
  }) {
    const {
      hashId
    } = import_pro_provider.ProProvider.useContext();
    return () => {
      var _a;
      const {
        style,
        prefixCls,
        hasPageContainer = 0
      } = props;
      const children = (_a = slots.default) == null ? void 0 : _a.call(slots);
      const contentClassName = (0, import_pro_utils.classNames)(`${prefixCls}-content`, hashId, {
        [`${prefixCls}-has-header`]: props.hasHeader,
        [`${prefixCls}-content-has-page-container`]: hasPageContainer > 0
      });
      const ErrorComponent = props.ErrorBoundary || import_pro_utils.ErrorBoundary;
      return props.ErrorBoundary === false ? (0, import_vue.createVNode)(import_ant_design_vue.Layout.Content, {
        "class": contentClassName,
        "style": style
      }, {
        default: () => [children]
      }) : (0, import_vue.createVNode)(ErrorComponent, null, {
        default: () => [(0, import_vue.createVNode)(import_ant_design_vue.Layout.Content, {
          "class": contentClassName,
          "style": style
        }, {
          default: () => [children]
        })]
      });
    };
  }
});
