"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
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));
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var EventCard_exports = {};
__export(EventCard_exports, {
  default: () => EventCard_default
});
module.exports = __toCommonJS(EventCard_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var import_react = __toESM(require("react"));
var import_styled_components = __toESM(require("styled-components"));
var import_prop_types = require("prop-types");
var import_yoga_icons = require("@gympass/yoga-icons");
var import_Card = __toESM(require("../Card"));
var import_Text = require("../../../Text/web/Text");
const Event = (0, import_styled_components.default)(import_Card.default).attrs({ hasShadow: false })`
  display: flex;
  flex-direction: row;

  width: 100%;
  padding: 0;
  overflow: hidden;
`;
const EventInfo = import_styled_components.default.div`
  ${({
  theme: {
    yoga: {
      borders,
      colors,
      components: {
        card: { event, radii }
      }
    }
  }
}) => import_styled_components.css`
    padding: ${event.info.padding.top}px ${event.info.padding.right}px
      ${event.info.padding.bottom}px ${event.info.padding.left}px;

    border: ${borders.small}px solid ${colors.elements.lineAndBorders};
    border-top-right-radius: ${radii}px;
    border-bottom-right-radius: ${radii}px;

    ${import_Text.TextRenderer}, ${import_Text.Text.Small} {
      display: -webkit-inline-box;
      overflow: hidden;

      -webkit-line-clamp: 1;
      -webkit-box-orient: vertical;
      text-overflow: ellipsis;
      text-overflow: -o-ellipsis-lastline;
    }

    ${import_Text.TextRenderer} {
      height: ${event.info.name.height}px;
      margin-bottom: ${event.info.name.marginBottom}px;

      font-weight: ${event.info.name.fontWeight};
      font-size: ${event.info.name.fontSize}px;
    }

    ${import_Text.Text.Small} {
      height: ${event.info.place.height}px;
      margin-bottom: ${event.info.place.marginBottom}px;

      color: ${event.info.place.color};
      font-weight: ${event.info.name.fontWeight};
    }
  `}
`;
const EventTime = import_styled_components.default.div`
  display: flex;
  align-items: center;
`;
const DateInfo = import_styled_components.default.div`
  ${({
  theme: {
    yoga: {
      borders,
      components: {
        card: { event, radii }
      }
    }
  }
}) => `
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    width: 56px;
    background-color: ${event.date.backgroundColor};
    border: ${borders.small}px solid ${event.date.backgroundColor};
    border-top-left-radius: ${radii}px;
    border-bottom-left-radius: ${radii}px;
  `}
`;
const DayOfWeek = (0, import_styled_components.default)(import_Text.Text.Small)`
  ${({
  theme: {
    yoga: {
      components: {
        card: { event }
      }
    }
  }
}) => `
    margin-bottom: ${event.date.dayOfWeek.marginBottom}px;

    font-weight: ${event.date.dayOfWeek.fontWeight};
  `}
`;
const Month = (0, import_styled_components.default)(import_Text.Text.Small)`
  ${({
  theme: {
    yoga: {
      components: {
        card: { event }
      }
    }
  }
}) => `
    font-weight: ${event.date.month.fontWeight};
  `}
`;
const EventCard = (_a) => {
  var _b = _a, {
    event,
    date,
    theme: {
      yoga: {
        components: {
          card: {
            event: { icon }
          }
        }
      }
    }
  } = _b, rest = __objRest(_b, [
    "event",
    "date",
    "theme"
  ]);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Event, __spreadProps(__spreadValues({}, rest), { children: [
    /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DateInfo, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DayOfWeek, { inverted: true, children: date.dayOfWeek }),
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Text.Text.H5, { inverted: true, children: date.day }),
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Month, { inverted: true, children: date.month })
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(EventInfo, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Text.Text, { as: "h3", title: event.name, children: event.name }),
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Text.Text.Small, { title: event.place, children: event.place }),
      /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(EventTime, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_yoga_icons.Time, { fill: icon.fill, style: { marginRight: 5 } }),
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Text.Text.Tiny, { children: event.time })
      ] })
    ] })
  ] }));
};
EventCard.propTypes = {
  /** event information: { name (string), place (string), time (string) } */
  event: (0, import_prop_types.shape)({
    name: import_prop_types.string,
    place: import_prop_types.string,
    time: import_prop_types.string
  }).isRequired,
  /** date information: { day (string), dayOfWeek (string), month (string) } */
  date: (0, import_prop_types.shape)({
    day: import_prop_types.string,
    dayOfWeek: import_prop_types.string,
    month: import_prop_types.string
  }).isRequired
};
EventCard.displayName = "EventCard";
var EventCard_default = (0, import_styled_components.withTheme)(EventCard);
