var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
import { useStyle as useAntdStyle } from "@antdv/pro-provider";
const [sm, md, lg, xl] = [576, 768, 992, 1200].map(
  (bp) => `@media (max-width: ${bp}px)`
);
const genPageContainerStyle = (token) => {
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
  return {
    [token.componentCls]: {
      "position": "relative",
      "&-children-container": {
        paddingBlockStart: 0,
        paddingBlockEnd: (_b = (_a = token.layout) == null ? void 0 : _a.pageContainer) == null ? void 0 : _b.paddingBlockPageContainerContent,
        paddingInline: (_d = (_c = token.layout) == null ? void 0 : _c.pageContainer) == null ? void 0 : _d.paddingInlinePageContainerContent
      },
      "&-children-container-no-header": {
        paddingBlockStart: (_f = (_e = token.layout) == null ? void 0 : _e.pageContainer) == null ? void 0 : _f.paddingBlockPageContainerContent
      },
      "&-affix": {
        [`${token.antCls}-affix`]: {
          [`${token.componentCls}-warp`]: {
            backgroundColor: (_h = (_g = token.layout) == null ? void 0 : _g.pageContainer) == null ? void 0 : _h.colorBgPageContainerFixed,
            transition: "background-color 0.3s",
            boxShadow: "0 2px 8px #f0f1f2"
          }
        }
      },
      "& &-warp-page-header": {
        paddingBlockStart: ((_k = (_j = (_i = token.layout) == null ? void 0 : _i.pageContainer) == null ? void 0 : _j.paddingBlockPageContainerContent) != null ? _k : 40) / 4,
        paddingBlockEnd: ((_n = (_m = (_l = token.layout) == null ? void 0 : _l.pageContainer) == null ? void 0 : _m.paddingBlockPageContainerContent) != null ? _n : 40) / 2,
        paddingInlineStart: (_p = (_o = token.layout) == null ? void 0 : _o.pageContainer) == null ? void 0 : _p.paddingInlinePageContainerContent,
        paddingInlineEnd: (_r = (_q = token.layout) == null ? void 0 : _q.pageContainer) == null ? void 0 : _r.paddingInlinePageContainerContent,
        [`& ~ ${token.proComponentsCls}-grid-content`]: {
          [`${token.proComponentsCls}-page-container-children-content`]: {
            paddingBlock: ((_u = (_t = (_s = token.layout) == null ? void 0 : _s.pageContainer) == null ? void 0 : _t.paddingBlockPageContainerContent) != null ? _u : 24) / 3
          }
        },
        [`${token.antCls}-page-header-breadcrumb`]: {
          paddingBlockStart: ((_x = (_w = (_v = token.layout) == null ? void 0 : _v.pageContainer) == null ? void 0 : _w.paddingBlockPageContainerContent) != null ? _x : 40) / 4 + 10
        },
        [`${token.antCls}-page-header-heading`]: {
          paddingBlockStart: ((_A = (_z = (_y = token.layout) == null ? void 0 : _y.pageContainer) == null ? void 0 : _z.paddingBlockPageContainerContent) != null ? _A : 40) / 4
        },
        [`${token.antCls}-page-header-footer`]: {
          marginBlockStart: ((_D = (_C = (_B = token.layout) == null ? void 0 : _B.pageContainer) == null ? void 0 : _C.paddingBlockPageContainerContent) != null ? _D : 40) / 4
        }
      },
      "&-detail": {
        display: "flex",
        [sm]: {
          display: "block"
        }
      },
      "&-main": {
        width: "100%"
      },
      "&-row": {
        display: "flex",
        width: "100%",
        [md]: {
          display: "block"
        }
      },
      "&-content": {
        flex: "auto",
        width: "100%"
      },
      "&-extraContent": {
        flex: "0 1 auto",
        minWidth: "242px",
        marginInlineStart: 88,
        textAlign: "end",
        [xl]: {
          marginInlineStart: 44
        },
        [lg]: {
          marginInlineStart: 20
        },
        [md]: {
          marginInlineStart: 0,
          textAlign: "start"
        },
        [sm]: {
          marginInlineStart: 0
        }
      }
    }
  };
};
function useStyle(prefixCls, componentsToken) {
  return useAntdStyle("ProLayoutPageContainer", (token) => {
    var _a;
    const proCardToken = __spreadProps(__spreadValues({}, token), {
      componentCls: `.${prefixCls.value}`,
      layout: __spreadProps(__spreadValues({}, token == null ? void 0 : token.layout), {
        pageContainer: __spreadValues(__spreadValues({}, (_a = token == null ? void 0 : token.layout) == null ? void 0 : _a.pageContainer), componentsToken)
      })
    });
    return [genPageContainerStyle(proCardToken)];
  });
}
export {
  useStyle
};
