import { ToastContainer as v } from "react-toastify";
export * from "react-toastify";
import { jsx as i } from "react/jsx-runtime";
import { Close as C, CheckCircle as y, CloseCircle as k, InfoCircle as _, Forbidden as z } from "@front.zen/icons";
import { chipClasses as I, styled as T, Box as O, alertClasses as b, formLabelClasses as M, outlinedInputClasses as e, stepConnectorClasses as l, stepLabelClasses as x, autocompleteClasses as f, inputBaseClasses as R, menuClasses as F, buttonBaseClasses as W, menuItemClasses as B, alpha as $, createTheme as P, IconButton as H } from "@mui/material";
import h from "@mui/icons-material/KeyboardArrowDownRounded";
import { mergeDeepRight as L } from "ramda";
import { grey as A, blue as s, green as n, orange as d, red as p } from "@mui/material/colors";
import { Check as N } from "@mui/icons-material";
const j = {
  defaultProps: {
    deleteIcon: /* @__PURE__ */ i(C, {}),
    color: "primary"
  },
  styleOverrides: {
    root: ({ theme: o, ownerState: r }) => ({
      height: r.size === "small" ? 24 : 32,
      [`& .${I.deleteIcon}`]: {
        color: o.palette.neutral[500]
      },
      ...r.variant === "filled" ? {
        color: o.palette.neutral[800],
        backgroundColor: t(o, r, 100),
        "&:hover": {
          backgroundColor: t(o, r, 200)
        },
        ["& .MuiSvgIcon-root"]: {
          color: "#FFFFFF"
        }
      } : {
        backgroundColor: "#FFFFFF",
        borderStyle: "solid",
        borderWidth: "1px",
        borderColor: t(o, r, 500),
        color: t(o, r, 500),
        "&:hover": {
          color: t(o, r, 600),
          borderColor: t(o, r, 600)
        }
      },
      ...r.disabled && {
        color: o.palette.neutral[400],
        backgroundColor: r.variant === "outlined" ? o.palette.neutral[100] : o.palette.neutral[200],
        ...r.variant === "outlined" && {
          border: `1px solid ${o.palette.neutral[300]}`
        }
      }
    })
  }
}, D = ({ active: o, completed: r, className: c }) => /* @__PURE__ */ i(Y, { active: o, className: c, children: r ? /* @__PURE__ */ i(N, { className: "stepIcon-check" }) : /* @__PURE__ */ i("div", { className: "stepIcon-circle" }) }), Y = T(O)(({ theme: o, active: r }) => ({
  color: r ? o.palette.secondary[500] : o.palette.grey[500],
  display: "flex",
  alignItems: "center",
  "& .stepIcon-check": {
    color: "#ffff",
    backgroundColor: o.palette.primary[500],
    width: 40,
    height: 40,
    padding: 8,
    borderRadius: "50%",
    zIndex: 1
  },
  "& .stepIcon-circle": {
    display: "flex",
    alignItems: "center",
    justifyContent: "center",
    width: 40,
    height: 40,
    borderRadius: "50%",
    backgroundColor: "transparent",
    border: "2px solid currentColor",
    zIndex: 1,
    "&::after": {
      position: "absolute",
      content: '""',
      width: r ? 16 : 14,
      height: r ? 16 : 14,
      borderRadius: "50%",
      backgroundColor: "currentColor"
    }
  }
})), E = {
  styleOverrides: {
    tooltip: ({ theme: o, ownerState: r }) => ({
      backgroundColor: o.palette.primary[800],
      borderRadius: 6,
      padding: "4px 8px"
    }),
    arrow: ({ theme: o, ownerState: r }) => ({
      color: o.palette.primary[800]
    })
  }
}, g = {
  default: /* @__PURE__ */ i(y, {}),
  success: /* @__PURE__ */ i(y, {}),
  error: /* @__PURE__ */ i(k, {}),
  info: /* @__PURE__ */ i(_, {}),
  warning: /* @__PURE__ */ i(z, {})
}, u = {
  small: "8px",
  medium: "10px"
}, K = {
  direction: "rtl",
  palette: {
    // TODO: should add PaletteColor fields too
    neutral: A
  },
  typography: {
    fontFamily: "IRANYekanX, roboto",
    h1: {
      fontWeight: 800,
      fontSize: "2.25rem",
      // 32px
      lineHeight: 1.5
    },
    h2: {
      fontWeight: 800,
      fontSize: "1.5rem",
      // 24px
      lineHeight: 1.5
    },
    h3: {
      fontWeight: 400,
      fontSize: "1.5rem",
      // 24px
      lineHeight: 1.5
    },
    h4: {
      fontWeight: 700,
      fontSize: "1.125rem",
      // 18px
      lineHeight: 1.5
    },
    h5: {
      fontWeight: 700,
      fontSize: "1rem",
      // 16px
      lineHeight: 1.5
    },
    body1: {
      fontWeight: 400,
      fontSize: "1rem",
      // 16px
      lineHeight: 1.75
    },
    body2: {
      fontWeight: 400,
      fontSize: "0.875rem",
      // 14px
      lineHeight: 1.75
    },
    subtitle1: {
      fontWeight: 500,
      fontSize: "0.625rem",
      // 10px
      lineHeight: 1.5
    },
    caption: {
      fontWeight: 400,
      fontSize: "0.75rem",
      // 12px
      lineHeight: 1.5
    },
    // Disable h6, subtitle2 and overline variant
    h6: void 0,
    subtitle2: void 0,
    overline: void 0
  },
  shape: {
    borderRadius: 12
  },
  components: {
    MuiCssBaseline: {
      styleOverrides: (o) => `
      .Toastify__toast-container {
      }
  
      .Toastify__toast {
        padding: 0 6px 0 16px;
        border-radius: ${o.shape.borderRadius}px;
        min-width: 320px;
        box-shadow:${o.shadows[12]}
      }
  
      .Toastify__toast-body {
        font-size: ${o.typography.caption.fontSize};
        font-weight: ${o.typography.caption.fontWeight};
        font-family:${o.typography.fontFamily};
      }
     
      .Toastify__progress-bar {
      }
  
      .Toastify__close-button {
        color: ${o.palette.neutral[700]};
        padding-top:6px;
      }
  
      .Toastify__toast-icon {
        width:unset;
        padding : 8px;
        border-radius: 100%;
      }

      .Toastify__toast-container .Toastify__toast-theme--colored {
        color: ${o.palette.neutral[800]};
      }
  
      .Toastify__toast-theme--colored.Toastify__toast--info {
        background: ${s[100]};
        .Toastify__toast-icon {
          background : ${s[50]};
        }
      }
  
      .Toastify__toast-theme--colored.Toastify__toast--success {
        background: ${n[100]};
        .Toastify__toast-icon {
          background : ${n[50]};
        }
      }
  
      .Toastify__toast-theme--colored.Toastify__toast--warning {
        background: ${d[100]};
        .Toastify__toast-icon {
          background : ${d[50]};
        }
      }
  
      .Toastify__toast-theme--colored.Toastify__toast--error {
        background: ${p[100]};
        .Toastify__toast-icon {
          background : ${p[50]};
        }
      }
      `
    },
    MuiAlert: {
      defaultProps: {
        iconMapping: {
          error: g.error,
          warning: g.warning,
          info: g.info,
          success: g.success
        }
      },
      styleOverrides: {
        root: {
          padding: "8px 16px"
        },
        icon: {
          padding: 0
        },
        message: {
          padding: 0
        },
        standardInfo: {
          background: s[50],
          border: `1px solid ${s[200]}`,
          color: s[900],
          [`& .${b.icon}`]: {
            color: s[900]
          }
        },
        standardSuccess: {
          background: n[50],
          border: `1px solid ${n[200]}`,
          color: n[900],
          [`& .${b.icon}`]: {
            color: n[900]
          }
        },
        standardWarning: {
          background: d[50],
          border: `1px solid ${d[200]}`,
          color: d[900],
          [`& .${b.icon}`]: {
            color: d[900]
          }
        },
        standardError: {
          background: p[50],
          border: `1px solid ${p[200]}`,
          color: p[900],
          [`& .${b.icon}`]: {
            color: p[900]
          }
        }
      }
    },
    MuiRadio: {
      styleOverrides: {
        root: ({ ownerState: o }) => ({
          "& .MuiSvgIcon-root": {
            fontSize: o.size === "small" ? 16 : 20
          }
        })
      }
    },
    MuiCheckbox: {
      defaultProps: {
        size: "small"
      }
    },
    MuiFormLabel: {
      styleOverrides: {
        root: ({ theme: o }) => ({
          fontSize: "0.875rem",
          [`&.${M.disabled}`]: {
            color: o.palette.neutral[400]
          }
        })
      }
    },
    MuiInputBase: {
      styleOverrides: {
        root: ({ theme: o }) => ({
          backgroundColor: "#fff",
          [`&.${e.root}.${e.disabled}`]: {
            background: o.palette.neutral[100],
            [`&.${e.notchedOutline}`]: {
              borderColor: o.palette.neutral[200]
            }
          },
          [`&.${e.root}.${e.disabled}:hover .${e.notchedOutline}`]: {
            borderColor: "unset"
          }
        }),
        disabled: ({ theme: o }) => ({
          backgroundColor: o.palette.neutral[100]
        })
      }
    },
    MuiIconButton: {
      styleOverrides: {
        root: ({ theme: o, ownerState: r }) => ({
          borderRadius: o.shape.borderRadius,
          ...r.size === "small" && {
            padding: 4
          }
        })
      }
    },
    MuiButton: {
      styleOverrides: {
        root: ({ ownerState: o, theme: r }) => ({
          ...o.size === "small" && {
            padding: "5px 10px"
          },
          ...o.size === "medium" && {
            padding: "8px 16px"
          },
          ...o.size === "large" && {
            padding: "11px 22px"
          },
          ...o.variant === "text" && o.size === "small" && {
            padding: 5
          },
          ...o.variant === "text" && o.size === "medium" && {
            padding: 8
          },
          ...o.variant === "text" && o.size === "large" && {
            padding: 11
          },
          //outlined buttons have 1px border. so we should decrement padding in all sizes by one.
          ...o.variant === "outlined" && o.size === "small" && {
            padding: "4px 9px"
          },
          ...o.variant === "outlined" && o.size === "medium" && {
            padding: "7px 15px"
          },
          ...o.variant === "outlined" && o.size === "large" && {
            padding: "10px 21px"
          },
          // semiFill variant
          ...o.variant === "semiFill" && {
            backgroundColor: t(r, o, 100),
            color: t(r, o, 500),
            "&:hover": {
              backgroundColor: t(r, o, 200),
              color: t(r, o, 600)
            },
            "&:focus": {
              backgroundColor: t(r, o, 50),
              color: t(r, o, 400)
            },
            ...o.disabled && {
              backgroundColor: r.palette.grey[100],
              color: r.palette.grey[300]
            }
          }
        })
      }
    },
    MuiSelect: {
      defaultProps: {
        IconComponent: h
      }
    },
    MuiStepper: {
      defaultProps: { alternativeLabel: !0 },
      styleOverrides: {
        root: ({ theme: o, ownerState: r }) => ({
          [`& :nth-of-type(${(r.activeStep || 0) + 2})`]: {
            [`& .${l.line}`]: {
              borderImageSource: `linear-gradient(90deg, ${o.palette.grey[400]} 0%,  ${o.palette.secondary[500]} 100%)`
            }
          }
        })
      }
    },
    MuiStepConnector: {
      styleOverrides: {
        root: ({ theme: o }) => ({
          [`&.${l.alternativeLabel}`]: {
            top: 19
          },
          [`&.${l.active}`]: {
            [`& .${l.line}`]: {
              borderImageSource: `linear-gradient(90deg, ${o.palette.secondary[500]} 0%, ${o.palette.primary[500]} 100%);`
            }
          },
          [`&.${l.completed}`]: {
            [`& .${l.line}`]: {
              borderColor: o.palette.primary[500]
            }
          }
        }),
        line: () => ({
          borderRadius: 1,
          borderTopWidth: 2,
          borderImageSlice: 1
        })
      }
    },
    MuiStepLabel: {
      styleOverrides: {
        labelContainer: ({ theme: o }) => ({
          [`& .${x.label}`]: {
            [`&.${x.active}`]: {
              color: o.palette.secondary[500],
              fontWeight: o.typography.fontWeightBold
            },
            [`&.${x.completed}`]: {
              color: o.palette.primary[500]
            }
          }
        })
      },
      defaultProps: {
        StepIconComponent: D
      }
    },
    MuiInputLabel: {
      styleOverrides: {
        root: ({ ownerState: o }) => ({
          fontSize: "0.875rem",
          transform: "translate(14px, 14px) scale(1)",
          ...o.size === "small" && {
            transform: "translate(14px, 9px) scale(1)"
          }
        }),
        shrink: {
          // Change the transform value when the input is focused or filled
          transform: "translate(14px, -6px) scale(0.75)"
        }
      }
    },
    MuiAutocomplete: {
      defaultProps: {
        size: "small",
        popupIcon: /* @__PURE__ */ i(h, {})
      },
      styleOverrides: {
        root: {
          // TODO write comment
          [`& .${e.root} .${f.input}`]: {
            padding: `calc(${u.medium} - 9px) 8px calc(${u.medium} - 9px) 5px`
          },
          [`& .${e.root}.${R.sizeSmall} .${f.input}`]: {
            padding: `calc(${u.small} - 6px) 8px calc(${u.small} - 6px) 8px`
          }
        },
        paper: () => ({
          [`&.${f.paper}`]: {
            padding: "12px 0"
          }
        }),
        listbox: ({ theme: o }) => ({
          [`& .${f.option}`]: {
            padding: "4px 8px",
            margin: "8px 16px",
            color: o.palette.neutral[600],
            borderRadius: o.shape.borderRadius,
            ['&[aria-selected="true"]']: {
              background: o.palette.primary[50],
              color: o.palette.primary[500]
            }
          }
        })
      }
    },
    MuiChip: j,
    MuiTooltip: E,
    MuiList: {
      styleOverrides: {
        root: ({ theme: o }) => ({
          [`&.${F.list}`]: {
            padding: "12px 8px",
            [`& .${W.root}.${B.root}`]: {
              padding: "4px 8px",
              marginBottom: 4,
              color: o.palette.neutral[600],
              borderRadius: o.shape.borderRadius,
              ['&[aria-selected="true"]']: {
                background: o.palette.primary[50],
                color: o.palette.primary[500]
              }
            }
          }
        })
      }
    },
    MuiOutlinedInput: {
      styleOverrides: {
        input: ({ ownerState: o }) => ({
          height: "2em",
          ...!o.multiline && {
            padding: `${u[o.size || "medium"]} 14px`
          }
        }),
        error: ({ theme: o }) => ({
          backgroundColor: o.palette.error[50],
          borderRadius: o.shape.borderRadius,
          borderColor: o.palette.error.main
        }),
        root: ({ theme: o, ownerState: r }) => ({
          lineHeight: "2em",
          fontSize: r.size === "small" ? "0.75rem" : "0.875rem",
          [`& .${e.notchedOutline}`]: {
            fontSize: "0.875rem",
            borderColor: o.palette.neutral[500],
            "& legend": {
              visibility: "visible",
              background: "#fff"
            }
          },
          [`&:not(.${e.error}):hover .${e.notchedOutline}`]: {
            borderColor: t(o, r, "main")
          },
          [`&.${e.focused} .${e.notchedOutline}`]: {
            borderWidth: "1px",
            borderColor: t(o, r, "main"),
            boxShadow: `0 0 8px 0 ${$(t(o, r, "main"), 0.2)}`
          },
          [`&.${e.focused}&.${e.error} .${e.notchedOutline}`]: {
            borderColor: o.palette.error.main,
            boxShadow: `0 0 8px 0 ${$(o.palette.error.main, 0.1)}`
          }
        })
      }
    },
    MuiPaginationItem: {
      styleOverrides: {
        root: ({ theme: o }) => ({
          width: "32px",
          backgroundColor: o.palette.grey[100],
          borderRadius: o.spacing(1.5),
          "&:hover": {
            backgroundColor: o.palette.primary[100]
          },
          "&.Mui-selected , &.Mui-selected:hover": {
            backgroundColor: o.palette.primary[400],
            color: o.palette.common.white
          },
          "&.MuiPaginationItem-ellipsis": {
            backgroundColor: "inherit"
          }
        })
      }
    }
  }
};
function w(o = {}, ...r) {
  const c = L(K, o), a = P(c, ...r);
  return a.shadows = S(a.shadows), a;
}
const S = (o) => Object.assign(o, {
  2: "0px 1px 2px 0px rgba(0,0,0,0.10)",
  // Raised
  8: "0px 4px 8px 0px rgba(0,0,0,0.10)",
  // Overlay
  12: "0px 6px 12px 0px rgba(0,0,0,0.10)",
  // Sticky Nav
  16: "0px 8px 16px 0px rgba(0,0,0,0.10)",
  // Temporary Nav
  24: "0px 12px 24px 0px rgba(0,0,0,0.10)"
  // Pop out
}), t = (o, r, c = "main") => {
  var m;
  const { color: a = "primary" } = r;
  return (m = o.palette) == null ? void 0 : m[a === "inherit" ? "primary" : a === "default" ? "neutral" : a][c];
}, oo = (o) => /* @__PURE__ */ i(
  v,
  {
    icon: (r) => g[r.type],
    theme: "colored",
    rtl: !0,
    hideProgressBar: !0,
    position: "bottom-right",
    closeButton: (r) => /* @__PURE__ */ i("div", { className: "Toastify__close-button", children: /* @__PURE__ */ i(H, { size: "small", sx: { color: "inherit" }, onClick: r.closeToast, children: /* @__PURE__ */ i(C, {}) }) }),
    ...o
  }
);
export {
  oo as ToastContainer,
  w as createTheme,
  g as icons
};
