Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_chunk = require("../chunk-BN4qSVkS.cjs");
const require_components_Icon_Icon = require("./Icon/Icon.cjs");
let _emotion_styled = require("@emotion/styled");
_emotion_styled = require_chunk.__toESM(_emotion_styled);
let _emotion_react = require("@emotion/react");
let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
//#region src/components/Loading.tsx
const loadingKinds = ["primary", "secondary"];
function Loading({ center = true, size = 60, ml = 0, mt = 0, kind = "primary", color = void 0 }) {
	return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(LoadingWrapper, {
		center,
		ml,
		mt,
		children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(Rotate, { children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(require_components_Icon_Icon.Icon, {
			name: resolveLoadingProp(null, kind, "defaultIconName", (0, _emotion_react.useTheme)()),
			width: size,
			color
		}) })
	});
}
const LoadingWrapper = _emotion_styled.default.div`
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  margin-left: ${({ ml }) => ml}px;
  margin-top: ${({ mt }) => mt}px;

  ${({ center }) => center && `
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 !important;
  `}
`;
const Rotate = _emotion_styled.default.div`
  display: inline-flex;
  animation: rotate 0.5s linear infinite;

  @keyframes rotate {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
`;
function resolveLoadingProp(prop, kind, defaultKey, theme) {
	return prop || theme.loading.kinds[kind]?.[defaultKey] || theme.loading[defaultKey];
}
//#endregion
exports.Loading = Loading;
exports.LoadingWrapper = LoadingWrapper;
exports.loadingKinds = loadingKinds;
