'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var headerText = require('./headerText-2eeecf55.js');
var paragraphText = require('./paragraphText-6f209f78.js');
var TsIcon = require('./TsIcon.js');
var TsBadge = require('./TsBadge.js');
var TsAvatar = require('./TsAvatar.js');
var TsButton = require('./TsButton.js');
var index = require('./index-146a6084.js');
var vue = require('vue');
require('./TsImageLoader.js');
require('./_commonjsHelpers-b3309d7b.js');
require('http');
require('https');
require('stream');
require('assert');
require('tty');
require('util');
require('os');
require('has-flag');
require('zlib');
require('form-data');

var script = {
    components: {
        TsHeaderText: headerText.script,
        TsParagraphText: paragraphText.script,
        TsIcon: TsIcon["default"],
        TsBadge: TsBadge["default"],
        TsAvatar: TsAvatar["default"],
        TsButton: TsButton["default"],
    },
    props: {
        cardLinecolor: {
            type: String,
            default: "purple",
        },
        customClass: {
            type: String,
            default: "w-full col-span-full",
        },
        badgeColor: {
            type: String,
            default: "purple",
        },
        avatarUrl: {
            type: String,
            default: "/images/avatar2.png",
        },
        showButton: {
            type: Boolean,
            default: false,
        },
        sessionIsClose: {
            type: Boolean,
            default: false,
        },
        paymentPending: {
            type: Boolean,
            default: false,
        },
        data: {
            type: Object,
        },
        status: {
            type: String,
            default: "pending",
        },
    },
    name: "TsSessionCard",
    setup() {
        return {
            Logic: index.Logic,
        };
    },
};

const _hoisted_1 = { class: "flex flex-row items-center justify-between" };
const _hoisted_2 = {
  key: 0,
  class: /*#__PURE__*/vue.normalizeClass(`flex flex-row items-center space-x-2 text-errorColor text-xs`)
};
const _hoisted_3 = { class: "flex flex-row items-center space-x-2 pt-1 text-xs text-paragraphText" };
const _hoisted_4 = {
  key: 1,
  class: "pt-2 w-full text-left justify-start"
};
const _hoisted_5 = /*#__PURE__*/vue.createTextVNode(" Enter Session ");

function render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_ts_header_text = vue.resolveComponent("ts-header-text");
  const _component_ts_badge = vue.resolveComponent("ts-badge");
  const _component_ts_icon = vue.resolveComponent("ts-icon");
  const _component_ts_avatar = vue.resolveComponent("ts-avatar");
  const _component_ts_paragraph_text = vue.resolveComponent("ts-paragraph-text");
  const _component_ts_button = vue.resolveComponent("ts-button");
  const _component_router_link = vue.resolveComponent("router-link");

  return ($props.data)
    ? (vue.openBlock(), vue.createBlock(_component_router_link, {
        key: 0,
        to: `/sessions/${$props.data?.id}`,
        class: vue.normalizeClass(`${$props.customClass} px-3 py-3 flex flex-col space-y-1 border-[1px] border-gray-200 rounded
	${$props.cardLinecolor == 'purple' ? '!border-l-primaryPurple' : ''}
	${$props.cardLinecolor == 'green' ? '!border-l-primaryGreen' : ''}
	${$props.cardLinecolor == 'yellow' ? '!border-l-primaryYellow' : ''}
	${$props.cardLinecolor == 'red' ? '!border-l-errorColor' : ''} 
	${$props.cardLinecolor == 'gray' ? '!border-l-primaryGray' : ''} !border-l-[4px] `)
      }, {
        default: vue.withCtx(() => [
          vue.createElementVNode("div", _hoisted_1, [
            vue.createVNode(_component_ts_header_text, { size: "base" }, {
              default: vue.withCtx(() => [
                vue.createTextVNode(vue.toDisplayString($props.data?.topic), 1 /* TEXT */)
              ]),
              _: 1 /* STABLE */
            }),
            vue.createVNode(_component_ts_badge, { color: $props.badgeColor }, {
              default: vue.withCtx(() => [
                vue.createTextVNode(vue.toDisplayString($props.data?.students.length == 1 ? "Private" : "Shared"), 1 /* TEXT */)
              ]),
              _: 1 /* STABLE */
            }, 8 /* PROPS */, ["color"])
          ]),
          ($props.status == 'pending')
            ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, [
                vue.createVNode(_component_ts_icon, {
                  name: "pending-card",
                  "custom-class": "h-[12px]"
                }),
                vue.createElementVNode("span", null, vue.toDisplayString($props.data?.paid.length) + "/" + vue.toDisplayString($props.data?.students.length) + " payment pending ", 1 /* TEXT */)
              ]))
            : vue.createCommentVNode("v-if", true),
          vue.createElementVNode("span", {
            class: vue.normalizeClass(`flex flex-row items-center space-x-2 text-xs ${
        $props.sessionIsClose ? 'text-errorColor' : 'text-paragraphTextLight'
      } `)
          }, [
            ($props.sessionIsClose)
              ? (vue.openBlock(), vue.createBlock(_component_ts_icon, {
                  key: 0,
                  name: "calender-red",
                  "custom-class": "h-[12px]"
                }))
              : (vue.openBlock(), vue.createBlock(_component_ts_icon, {
                  key: 1,
                  name: "calender",
                  "custom-class": "h-[12px]"
                })),
            vue.createElementVNode("span", null, vue.toDisplayString($setup.Logic.common.fomartDate($props.data?.startedAt || 0, "MMM D")), 1 /* TEXT */),
            vue.createElementVNode("span", {
              class: vue.normalizeClass(`h-[5px] w-[5px] ${
          $props.sessionIsClose ? 'bg-errorColor' : 'bg-paragraphTextLight'
        }  rounded-full`)
            }, null, 2 /* CLASS */),
            vue.createElementVNode("span", null, [
              ($props.status != 'previous')
                ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
                    vue.createTextVNode(vue.toDisplayString($setup.Logic.common.fomartDate($props.data?.startedAt || 0, "HH:mm a")) + " - " + vue.toDisplayString($setup.Logic.common.fomartDate(
              $props.data?.startedAt || 0 + ($props.data?.lengthInMinutes || 0) * 60000,
              "HH:mm a"
            )), 1 /* TEXT */)
                  ], 64 /* STABLE_FRAGMENT */))
                : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
                    vue.createTextVNode(vue.toDisplayString($props.data.lengthInMinutes / 60) + " hour" + vue.toDisplayString($props.data.lengthInMinutes > 60 ? "s" : ""), 1 /* TEXT */)
                  ], 64 /* STABLE_FRAGMENT */))
            ])
          ], 2 /* CLASS */),
          vue.createElementVNode("span", _hoisted_3, [
            vue.createVNode(_component_ts_avatar, {
              "photo-url": $props.data?.tutor.bio.photo?.link || '',
              size: "17"
            }, null, 8 /* PROPS */, ["photo-url"]),
            vue.createVNode(_component_ts_paragraph_text, { faded: true }, {
              default: vue.withCtx(() => [
                vue.createTextVNode(vue.toDisplayString($props.data?.tutor.bio.name.full), 1 /* TEXT */)
              ]),
              _: 1 /* STABLE */
            })
          ]),
          ($props.showButton)
            ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
                vue.createVNode(_component_ts_button, { "bg-color": "bg-primaryPurple" }, {
                  default: vue.withCtx(() => [
                    _hoisted_5
                  ]),
                  _: 1 /* STABLE */
                })
              ]))
            : vue.createCommentVNode("v-if", true)
        ]),
        _: 1 /* STABLE */
      }, 8 /* PROPS */, ["to", "class"]))
    : vue.createCommentVNode("v-if", true)
}

script.render = render;
script.__file = "src/components/TsSessionCard/index.vue";

exports["default"] = script;
