'use client';
"use strict";
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);

// src/components/Error/ErrorNotFoundResponse.tsx
var ErrorNotFoundResponse_exports = {};
__export(ErrorNotFoundResponse_exports, {
  ErrorNotFoundResponse: () => ErrorNotFoundResponse
});
module.exports = __toCommonJS(ErrorNotFoundResponse_exports);

// src/components/Error/ErrorLayout.tsx
var import_react_icons = require("@paalan/react-icons");
var import_lib13 = require("@paalan/react-shared/lib");

// src/base/Box/Box.tsx
var import_system = require("@paalan/react-shared/system");
var import_utils = require("@paalan/react-shared/utils");
var import_jsx_runtime = require("react/jsx-runtime");
var Box = (0, import_utils.forwardRef)((props, ref) => {
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_system.StyledComponent, { ...props, ref });
});
Box.withComponent = import_system.WithStyledComponent;

// src/base/Center/Center.tsx
var import_lib = require("@paalan/react-shared/lib");
var import_utils2 = require("@paalan/react-shared/utils");
var import_jsx_runtime2 = require("react/jsx-runtime");
var Center = (0, import_utils2.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box, { className: (0, import_lib.cn)("flex items-center justify-center", className), ...restProps, ref, children });
});

// src/base/Container/Container.tsx
var import_lib2 = require("@paalan/react-shared/lib");
var import_utils3 = require("@paalan/react-shared/utils");
var import_jsx_runtime3 = require("react/jsx-runtime");
var Container = (0, import_utils3.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box, { className: (0, import_lib2.cn)("container", className), ...restProps, ref, children });
});

// src/base/Flex/Flex.tsx
var import_lib3 = require("@paalan/react-shared/lib");
var import_utils4 = require("@paalan/react-shared/utils");
var import_jsx_runtime4 = require("react/jsx-runtime");
var Flex = (0, import_utils4.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Box, { className: (0, import_lib3.cn)("flex", className), ...restProps, ref, children });
});

// src/base/Grid/Grid.tsx
var import_lib4 = require("@paalan/react-shared/lib");
var import_utils5 = require("@paalan/react-shared/utils");
var import_jsx_runtime5 = require("react/jsx-runtime");
var Grid = (0, import_utils5.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box, { className: (0, import_lib4.cn)("grid", className), ...restProps, ref, children });
});
var GridItem = (0, import_utils5.forwardRef)((props, ref) => {
  const { children, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box, { ...restProps, ref, children });
});

// src/base/HStack/HStack.tsx
var import_lib5 = require("@paalan/react-shared/lib");
var import_utils6 = require("@paalan/react-shared/utils");
var import_jsx_runtime6 = require("react/jsx-runtime");
var HStack = (0, import_utils6.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box, { className: (0, import_lib5.cn)("flex flex-row items-center gap-2", className), ...restProps, ref, children });
});

// src/base/Heading/Heading.tsx
var import_lib6 = require("@paalan/react-shared/lib");
var import_utils7 = require("@paalan/react-shared/utils");
var import_jsx_runtime7 = require("react/jsx-runtime");
var headingSizes = {
  h1: "text-3xl font-bold",
  h2: "text-2xl font-bold",
  h3: "text-xl font-semibold",
  h4: "text-lg font-semibold",
  h5: "text-base font-semibold",
  h6: "text-sm font-semibold"
};
var Heading = (0, import_utils7.forwardRef)((props, ref) => {
  const { children, as: headTag = "h1", className, ...restProps } = props;
  const size = headingSizes[headTag];
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Box, { as: headTag, ...restProps, ref, className: (0, import_lib6.cn)(size, className), children });
});

// src/base/Paper/Paper.tsx
var import_lib7 = require("@paalan/react-shared/lib");
var import_utils8 = require("@paalan/react-shared/utils");
var import_class_variance_authority = require("class-variance-authority");
var import_jsx_runtime8 = require("react/jsx-runtime");
var paperVariants = (0, import_class_variance_authority.cva)("bg-background text-foreground", {
  variants: {
    shadow: {
      default: "shadow",
      sm: "shadow-sm",
      md: "shadow-md",
      lg: "shadow-lg",
      xl: "shadow-xl",
      "2xl": "shadow-2xl",
      inner: "shadow-inner",
      none: "shadow-none"
    }
  },
  defaultVariants: {
    shadow: "default"
  }
});
var Paper = (0, import_utils8.forwardRef)(
  ({ withBorder, shadow, className, ...props }, ref) => {
    return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
      Box,
      {
        ref,
        className: (0, import_lib7.cn)(paperVariants({ shadow }), withBorder ? "border border-border" : "", className),
        ...props
      }
    );
  }
);

// src/base/Portal/Portal.tsx
var import_react = require("react");
var import_react_hooks = require("@paalan/react-hooks");
var import_utils9 = require("@paalan/react-shared/utils");
var import_react_dom = require("react-dom");
var import_jsx_runtime9 = require("react/jsx-runtime");
var createPortalNode = (props) => {
  const node = document.createElement("div");
  node.setAttribute("data-portal", "true");
  if (typeof props.className === "string") {
    node.classList.add(...props.className.split(" "));
  }
  if (typeof props.style === "object") {
    Object.assign(node.style, props.style);
  }
  if (typeof props.id === "string") {
    node.setAttribute("id", props.id);
  }
  return node;
};
var defaultProps = {};
var Portal = (0, import_react.forwardRef)((props, ref) => {
  const { children, target, ...others } = { ...defaultProps, ...props };
  const [mounted, setMounted] = (0, import_react.useState)(false);
  const nodeRef = (0, import_react.useRef)(null);
  (0, import_react_hooks.useIsomorphicEffect)(() => {
    setMounted(true);
    nodeRef.current = !target ? createPortalNode(others) : typeof target === "string" ? document.querySelector(target) : target;
    if (!nodeRef.current) return;
    (0, import_utils9.assignRef)(ref, nodeRef.current);
    if (!target && nodeRef.current) {
      document.body.appendChild(nodeRef.current);
    }
    return () => {
      if (!target && nodeRef.current) {
        document.body.removeChild(nodeRef.current);
      }
    };
  }, [target]);
  if (!mounted || !nodeRef.current) {
    return null;
  }
  return (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children }), nodeRef.current);
});
Portal.displayName = "Portal";

// src/base/Stack/Stack.tsx
var import_lib8 = require("@paalan/react-shared/lib");
var import_utils10 = require("@paalan/react-shared/utils");
var import_jsx_runtime10 = require("react/jsx-runtime");
var Stack = (0, import_utils10.forwardRef)((props, ref) => {
  const { children, className, direction, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Box, { className: (0, import_lib8.cn)("flex flex-col gap-2", className), flexDirection: direction, ...restProps, ref, children });
});

// src/base/Text/Text.tsx
var import_lib9 = require("@paalan/react-shared/lib");
var import_utils11 = require("@paalan/react-shared/utils");
var import_jsx_runtime11 = require("react/jsx-runtime");
var Text = (0, import_utils11.forwardRef)((props, ref) => {
  const { children, className, as = "p", ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box, { as, ref, className: (0, import_lib9.cn)("", className), ...restProps, children });
});

// src/base/Typography/Typography.tsx
var import_lib10 = require("@paalan/react-shared/lib");
var import_utils12 = require("@paalan/react-shared/utils");
var import_jsx_runtime12 = require("react/jsx-runtime");
var H1 = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "h1",
    ref,
    className: (0, import_lib10.cn)("scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl", className),
    ...props
  }
));
H1.displayName = "H1";
var H2 = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "h2",
    ref,
    className: (0, import_lib10.cn)(
      "mt-10 scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight transition-colors first:mt-0",
      className
    ),
    ...props
  }
));
H2.displayName = "H2";
var H3 = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "h3",
    ref,
    className: (0, import_lib10.cn)("mt-8 scroll-m-20 text-2xl font-semibold tracking-tight", className),
    ...props
  }
));
H3.displayName = "H3";
var H4 = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "h4", ref, className: (0, import_lib10.cn)("scroll-m-20 text-xl font-semibold tracking-tight", className), ...props }));
H4.displayName = "H4";
var H5 = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "h5", ref, className: (0, import_lib10.cn)("scroll-m-20 text-lg font-semibold tracking-tight", className), ...props }));
H5.displayName = "H5";
var H6 = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "h6", ref, className: (0, import_lib10.cn)("scroll-m-20 text-base font-semibold tracking-tight", className), ...props }));
H6.displayName = "H6";
var P = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "p", ref, className: (0, import_lib10.cn)("leading-7 [&:not(:first-child)]:mt-4", className), ...props }));
P.displayName = "P";
var BlockQuote = (0, import_utils12.forwardRef)(
  ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
    Box,
    {
      as: "blockquote",
      ref,
      className: (0, import_lib10.cn)(
        "mt-6 border-l-2 border-slate-300 pl-6 italic text-slate-800 dark:border-slate-600 dark:text-slate-200",
        className
      ),
      ...props
    }
  )
);
BlockQuote.displayName = "BlockQuote";
var TableLayout = (0, import_utils12.forwardRef)(
  ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "table", ref, className: (0, import_lib10.cn)("w-full", className), ...props })
);
TableLayout.displayName = "Table";
var THead = (0, import_utils12.forwardRef)(
  ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "thead", ref, className: (0, import_lib10.cn)("", className), ...props })
);
THead.displayName = "THead";
var TBody = (0, import_utils12.forwardRef)(
  ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "tbody", ref, className: (0, import_lib10.cn)("", className), ...props })
);
TBody.displayName = "TBody";
var TR = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "tr",
    ref,
    className: (0, import_lib10.cn)(
      "m-0 border-t border-slate-300 p-0 even:bg-slate-100 dark:border-slate-700 dark:even:bg-slate-800",
      className
    ),
    ...props
  }
));
TR.displayName = "TR";
var TD = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "td",
    ref,
    className: (0, import_lib10.cn)(
      "border border-slate-200 px-4 py-2 text-left dark:border-slate-700 [&[align=center]]:text-center [&[align=right]]:text-right",
      className
    ),
    ...props
  }
));
TD.displayName = "TD";
var TH = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "th",
    ref,
    className: (0, import_lib10.cn)(
      "border border-slate-200 px-4 py-2 text-left font-bold dark:border-slate-700 [&[align=center]]:text-center [&[align=right]]:text-right",
      className
    ),
    ...props
  }
));
TH.displayName = "TH";
var UL = (0, import_utils12.forwardRef)(({ className, unstyled = false, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "ul",
    ref,
    className: (0, import_lib10.cn)(
      {
        "m-4 list-disc [&>li]:mt-2": !unstyled
      },
      className
    ),
    ...props
  }
));
UL.displayName = "UL";
var OL = (0, import_utils12.forwardRef)(({ className, unstyled = false, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "ol",
    ref,
    className: (0, import_lib10.cn)(
      {
        "m-4 list-decimal [&>li]:mt-2": !unstyled
      },
      className
    ),
    ...props
  }
));
OL.displayName = "OL";
var LI = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "li", ref, className: (0, import_lib10.cn)("", className), ...props }));
LI.displayName = "LI";
var Code = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
  Box,
  {
    as: "code",
    ref,
    className: (0, import_lib10.cn)("relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-normal", className),
    ...props
  }
));
Code.displayName = "Code";
var Lead = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "p", ref, className: (0, import_lib10.cn)("text-xl text-muted-foreground", className), ...props }));
Lead.displayName = "Lead";
var Large = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "div", ref, className: (0, import_lib10.cn)("text-lg font-semibold", className), ...props }));
Large.displayName = "Large";
var Small = (0, import_utils12.forwardRef)(
  ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "small", ref, className: (0, import_lib10.cn)("text-sm font-medium leading-none", className), ...props })
);
Small.displayName = "Small";
var Subtle = (0, import_utils12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "p", ref, className: (0, import_lib10.cn)("text-sm text-muted-foreground", className), ...props }));
Subtle.displayName = "Subtle";
var Strong = (0, import_utils12.forwardRef)(
  ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Box, { as: "strong", ref, className: (0, import_lib10.cn)("font-semibold", className), ...props })
);
Strong.displayName = "Strong";

// src/base/VStack/VStack.tsx
var import_lib11 = require("@paalan/react-shared/lib");
var import_utils13 = require("@paalan/react-shared/utils");
var import_jsx_runtime13 = require("react/jsx-runtime");
var VStack = (0, import_utils13.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Box, { className: (0, import_lib11.cn)("flex flex-col items-stretch gap-2", className), ...restProps, ref, children });
});

// src/base/Wrap/Wrap.tsx
var import_lib12 = require("@paalan/react-shared/lib");
var import_utils14 = require("@paalan/react-shared/utils");
var import_jsx_runtime14 = require("react/jsx-runtime");
var Wrap = (0, import_utils14.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Box, { className: (0, import_lib12.cn)("flex flex-wrap gap-2", className), ...restProps, ref, children });
});
var WrapItem = (0, import_utils14.forwardRef)((props, ref) => {
  const { children, className, ...restProps } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Box, { className: (0, import_lib12.cn)("flex flex-none items-start", className), ...restProps, ref, children });
});

// src/components/Error/ErrorLayout.tsx
var import_jsx_runtime15 = require("react/jsx-runtime");
var ErrorLayout = ({
  children,
  heading,
  icon,
  showIcon,
  subHeading,
  className,
  headingClassName,
  subHeadingClassName,
  error
}) => {
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Center, { className: (0, import_lib13.cn)("min-h-[75vh] flex-col gap-6 text-center text-red-500", className), children: [
    showIcon ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Box, { className: "rounded-full  bg-red-100 p-5", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_icons.Cross1Icon, { className: "size-8 text-red-500" }) }) : icon,
    (heading || subHeading || error) && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(VStack, { className: "max-w-2xl", children: [
      heading && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Heading, { as: "h2", className: (0, import_lib13.cn)("text-lg md:text-xl", headingClassName), children: heading }),
      subHeading && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { className: (0, import_lib13.cn)("text-base md:text-lg", subHeadingClassName), children: subHeading }),
      error && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Stack, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { className: "text-xs md:text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { as: "pre", children: error.message }) }),
        /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { className: "text-xs md:text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { as: "pre", children: error.stack }) })
      ] })
    ] }),
    children
  ] });
};

// src/components/Error/ErrorNotFoundResponse.tsx
var import_jsx_runtime16 = require("react/jsx-runtime");
var ErrorNotFoundResponse = ({
  children,
  heading = "Page doesn't exist",
  subHeading = "Probably you got here by accident. If you think there is something wrong on our side, please contact us!",
  ...props
}) => {
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ErrorLayout, { heading, subHeading, ...props, children });
};
