import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
import { S as States } from './utils.js';
import { l as luxon } from './luxon.js';
import { d as defineCustomElement$d } from './mds-avatar2.js';
import { d as defineCustomElement$c } from './mds-img2.js';
import { d as defineCustomElement$b } from './mds-text2.js';
import { d as defineCustomElement$a } from './sw-addon-reminder-body2.js';
import { d as defineCustomElement$9 } from './sw-addon-reminder-footer2.js';
import { d as defineCustomElement$8 } from './sw-addon-reminder-header2.js';
import { d as defineCustomElement$7 } from './sw-badge-error2.js';
import { d as defineCustomElement$6 } from './sw-description-input2.js';
import { d as defineCustomElement$5 } from './sw-input-button2.js';
import { d as defineCustomElement$4 } from './sw-input-select2.js';
import { d as defineCustomElement$3 } from './sw-obligatory-field2.js';
import { d as defineCustomElement$2 } from './sw-options-menu2.js';
import { d as defineCustomElement$1 } from './sw-searchbox2.js';

const swAddonReminderCss = ".pointer-events-none{pointer-events:none !important}.collapse{visibility:collapse !important}.static{position:static !important}.fixed{position:fixed !important}.absolute{position:absolute !important}.relative{position:relative !important}.sticky{position:sticky !important}.top-4{top:1rem !important}.left-5{left:1.25rem !important}.bottom-0{bottom:0px !important}.right-0{right:0px !important}.my-3{margin-top:0.75rem !important;margin-bottom:0.75rem !important}.mx-6{margin-left:1.5rem !important;margin-right:1.5rem !important}.mb-2{margin-bottom:0.5rem !important}.ml-2{margin-left:0.5rem !important}.mr-10{margin-right:2.5rem !important}.ml-10{margin-left:2.5rem !important}.mr-2{margin-right:0.5rem !important}.mr-4{margin-right:1rem !important}.ml-4{margin-left:1rem !important}.block{display:block !important}.inline{display:inline !important}.flex{display:flex !important}.table{display:table !important}.hidden{display:none !important}.h-screen{height:100vh !important}.h-full{height:100% !important}.h-auto{height:auto !important}.min-h-\\[200px\\]{min-height:200px !important}.min-h-\\[50px\\]{min-height:50px !important}.w-screen{width:100vw !important}.w-\\[200px\\]{width:200px !important}.w-full{width:100% !important}.w-10{width:2.5rem !important}.w-\\[40px\\]{width:40px !important}.w-auto{width:auto !important}.w-24{width:6rem !important}.min-w-\\[200px\\]{min-width:200px !important}.max-w-\\[100px\\]{max-width:100px !important}.flex-none{flex:none !important}.grow{flex-grow:1 !important}.transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important}.cursor-pointer{cursor:pointer !important}.cursor-grab{cursor:grab !important}.flex-row{flex-direction:row !important}.flex-col{flex-direction:column !important}.items-center{align-items:center !important}.justify-between{justify-content:space-between !important}.whitespace-pre-wrap{white-space:pre-wrap !important}.rounded-md{border-radius:0.375rem !important}.rounded-lg{border-radius:0.5rem !important}.rounded-b-md{border-bottom-right-radius:0.375rem !important;border-bottom-left-radius:0.375rem !important}.rounded-t-md{border-top-left-radius:0.375rem !important;border-top-right-radius:0.375rem !important}.border{border-width:1px !important}.bg-brand-maggioli-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--brand-maggioli-05), var(--tw-bg-opacity)) !important}.bg-brand-synbee-eolo-v1-18{--tw-bg-opacity:1 !important;background-color:rgba(var(--brand-synbee-eolo-v1-18), var(--tw-bg-opacity)) !important}.bg-brand-synbee-eolo-v1-17{--tw-bg-opacity:1 !important;background-color:rgba(var(--brand-synbee-eolo-v1-17), var(--tw-bg-opacity)) !important}.bg-brand-synbee-eolo-04{--tw-bg-opacity:1 !important;background-color:rgba(var(--brand-synbee-eolo-04), var(--tw-bg-opacity)) !important}.bg-brand-synbee-eolo-v1-06{--tw-bg-opacity:1 !important;background-color:rgba(var(--brand-synbee-eolo-v1-06), var(--tw-bg-opacity)) !important}.bg-label-amaranth-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-amaranth-05), var(--tw-bg-opacity)) !important}.bg-label-aqua-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-aqua-05), var(--tw-bg-opacity)) !important}.bg-label-blue-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-blue-05), var(--tw-bg-opacity)) !important}.bg-label-green-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-green-05), var(--tw-bg-opacity)) !important}.bg-label-lime-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-lime-05), var(--tw-bg-opacity)) !important}.bg-label-orange-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-orange-05), var(--tw-bg-opacity)) !important}.bg-label-orchid-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-orchid-05), var(--tw-bg-opacity)) !important}.bg-label-sky-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-sky-05), var(--tw-bg-opacity)) !important}.bg-label-yellow-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-yellow-05), var(--tw-bg-opacity)) !important}.bg-label-violet-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--label-violet-05), var(--tw-bg-opacity)) !important}.bg-status-error-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--status-error-05), var(--tw-bg-opacity)) !important}.bg-status-info-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--status-info-05), var(--tw-bg-opacity)) !important}.bg-status-success-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--status-success-05), var(--tw-bg-opacity)) !important}.bg-status-warning-05{--tw-bg-opacity:1 !important;background-color:rgba(var(--status-warning-05), var(--tw-bg-opacity)) !important}.fill-label-blue-05{fill:rgb(var(--label-blue-05)) !important}.fill-label-green-06{fill:rgb(var(--label-green-06)) !important}.p-4{padding:1rem !important}.py-2{padding-top:0.5rem !important;padding-bottom:0.5rem !important}.py-3{padding-top:0.75rem !important;padding-bottom:0.75rem !important}.pr-6{padding-right:1.5rem !important}.pl-5{padding-left:1.25rem !important}.pr-4{padding-right:1rem !important}.pt-10{padding-top:2.5rem !important}.text-base{font-size:1rem !important;line-height:1.5rem !important}.text-sm{font-size:0.875rem !important;line-height:1.25rem !important}.font-bold{font-weight:700 !important}.font-normal{font-weight:400 !important}.lowercase{text-transform:lowercase !important}.text-brand-synbee-eolo-v1-06{--tw-text-opacity:1 !important;color:rgba(var(--brand-synbee-eolo-v1-06), var(--tw-text-opacity)) !important}.text-brand-synbee-eolo-v1-04{--tw-text-opacity:1 !important;color:rgba(var(--brand-synbee-eolo-v1-04), var(--tw-text-opacity)) !important}.text-adjust-tone-04{--tw-text-opacity:1 !important;color:rgba(var(--adjust-tone-04), var(--tw-text-opacity)) !important}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) !important;--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important}:host{display:flex;background-color:rgb(var(--tone-neutral));min-height:560px;border-radius:0.5rem;margin-bottom:30px;position:relative}.reminder-container{display:flex;flex-direction:column;background-color:inherit;height:auto;width:100%;border-radius:10px}.badge-error{position:center;width:-moz-fit-content;width:fit-content;margin:auto 20%}.hidden{display:none}.active\\:cursor-grabbing:active{cursor:grabbing !important}";

const SwAddonReminder = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.__attachShadow();
    this.undoReminderOutEmitter = createEvent(this, "undoReminderOutEmitter", 7);
    this.outputDataEmitter = createEvent(this, "outputDataEmitter", 7);
    this.deleteAddonReminderEmitter = createEvent(this, "deleteAddonReminderEmitter", 7);
    this.collapseReminder = createEvent(this, "collapseReminder", 7);
    this.reminderDoneSetter = createEvent(this, "reminderDoneSetter", 7);
    this.editOutputDataEmitter = createEvent(this, "editOutputDataEmitter", 7);
    this.isFirstTime = true;
    this.submitAlreadyTriggered = false;
    this.badgeErrorOn = false;
    this.sendDataForCalendar = false;
    this.withoutFooter = false;
    this.doneFlag = undefined;
    this.deleteSub = false;
    this.reminderInfoDTO = undefined;
    this.userInfo = {
      name: "Nome",
      surname: "Cognome",
      date: "creato oggi",
      image: "assets/img/user.svg",
    };
    this.state = "";
    this.taskId = 722;
    this.idPluginAction = 9;
    this.baseUrl = "https://app.synbee.it";
    this.idPluginActionExternal = 22;
    this.reminderDone = false;
    this.status = States.create;
    this.reminderInfoState = undefined;
    this.reminderInfo = {
      name: "Nuova Action Promemoria",
      description: "",
      hour: "00",
      minute: "00",
      duration: "00",
      date: "",
    };
  }
  catchUndoReminder() {
    if (this.status === States.edit) {
      this.status = States.view;
    }
    else {
      this.undoReminderOutEmitter.emit(true);
    }
  }
  catchCloseAction(ev) {
    this.collapseReminder.emit(ev.detail);
  }
  //create reminder from calendar:
  sendOutputDataFromCalendar() {
    let outputToChange = { ...this.reminderInfo };
    let arrayDate = this.reminderInfo.date.split("/");
    let month;
    if (arrayDate[1]) {
      if (arrayDate[1].startsWith("0")) {
        month = parseInt(arrayDate[1].replace("0", ""));
        month = month - 1;
      }
      else {
        month = parseInt(arrayDate[1]);
        month = month - 1;
      }
    }
    let newHour = parseInt(this.reminderInfo.hour.startsWith("0")
      ? this.reminderInfo.hour.replace("0", "")
      : this.reminderInfo.hour) +
      parseInt(this.reminderInfo.duration.startsWith("0")
        ? this.reminderInfo.duration.replace("0", "")
        : this.reminderInfo.duration);
    outputToChange.dateTime = new Date(arrayDate[2], month, arrayDate[0], this.reminderInfo.hour.startsWith("0")
      ? this.reminderInfo.hour.replace("0", "")
      : this.reminderInfo.hour, this.reminderInfo.minute);
    outputToChange.dateTimeEnd = new Date(arrayDate[2], month, arrayDate[0], newHour, this.reminderInfo.minute);
    let startDate = luxon.DateTime.fromJSDate(outputToChange.dateTime).toISO({
      includeOffset: false,
    });
    let endDate = luxon.DateTime.fromJSDate(outputToChange.dateTimeEnd).toISO({ includeOffset: false });
    let body = {
      name: outputToChange.name,
      description: outputToChange.description,
      startDate: startDate,
      endDate: endDate,
    };
    if (this.taskId !== null) {
      fetch(`${this.baseUrl}/services/eolo-api-gateway/external-api/${this.taskId}/${this.idPluginAction}`, {
        method: "POST",
        body: JSON.stringify(body),
        headers: {
          "Content-Type": "application/json",
        },
      })
        .then((response) => response.json())
        .then((response) => {
        this.outputDataEmitter.emit(response);
      });
    }
  }
  // create reminder:
  sendOutputData(ev) {
    let outputToChange = { ...ev.detail };
    let arrayDate = ev.detail.date.split("/");
    let month;
    if (arrayDate[1]) {
      if (arrayDate[1].startsWith("0")) {
        month = parseInt(arrayDate[1].replace("0", ""));
        month = month - 1;
      }
      else {
        month = parseInt(arrayDate[1]);
        month = month - 1;
      }
    }
    let newHour = parseInt(ev.detail.hour.startsWith("0")
      ? ev.detail.hour.replace("0", "")
      : ev.detail.hour) +
      parseInt(ev.detail.duration.startsWith("0")
        ? ev.detail.duration.replace("0", "")
        : ev.detail.duration);
    outputToChange.dateTime = new Date(arrayDate[2], month, arrayDate[0], ev.detail.hour.startsWith("0")
      ? ev.detail.hour.replace("0", "")
      : ev.detail.hour, ev.detail.minute);
    outputToChange.dateTimeEnd = new Date(arrayDate[2], month, arrayDate[0], newHour, ev.detail.minute);
    let startDate = luxon.DateTime.fromJSDate(outputToChange.dateTime).toISO({
      includeOffset: false,
    });
    let endDate = luxon.DateTime.fromJSDate(outputToChange.dateTimeEnd).toISO({ includeOffset: false });
    let body = {
      name: outputToChange.name,
      description: outputToChange.description,
      startDate: startDate,
      endDate: endDate,
    };
    fetch(`${this.baseUrl}/services/eolo-api-gateway/external-api/${this.taskId}/${this.idPluginAction}`, {
      method: "POST",
      body: JSON.stringify(body),
      headers: {
        "Content-Type": "application/json",
      },
    })
      .then((response) => response.json())
      .then((response) => {
      this.outputDataEmitter.emit(response);
    });
  }
  // edit reminder:
  editOutputData(ev) {
    let outputToChange = { ...ev.detail };
    let arrayDate = ev.detail.date.split("/");
    let month;
    if (arrayDate[1]) {
      if (arrayDate[1].startsWith("0")) {
        month = parseInt(arrayDate[1].replace("0", ""));
        month = month - 1;
      }
      else {
        month = parseInt(arrayDate[1]);
        month = month - 1;
      }
    }
    let newHour = parseInt(ev.detail.hour.startsWith("0")
      ? ev.detail.hour.replace("0", "")
      : ev.detail.hour) +
      parseInt(ev.detail.duration.startsWith("0")
        ? ev.detail.duration.replace("0", "")
        : ev.detail.duration);
    outputToChange.dateTime = new Date(arrayDate[2], month, arrayDate[0], ev.detail.hour.startsWith("0")
      ? ev.detail.hour.replace("0", "")
      : ev.detail.hour, ev.detail.minute);
    outputToChange.dateTimeEnd = new Date(arrayDate[2], month, arrayDate[0], newHour, ev.detail.minute);
    let startDate = luxon.DateTime.fromJSDate(outputToChange.dateTime).toISO({
      includeOffset: false,
    });
    let endDate = luxon.DateTime.fromJSDate(outputToChange.dateTimeEnd).toISO({ includeOffset: false });
    let body = {
      name: outputToChange.name,
      description: outputToChange.description,
      startDate: startDate,
      endDate: endDate,
      actionRead: this.reminderDone,
    };
    fetch(`${this.baseUrl}/services/eolo-api-gateway/external-api/${this.idPluginAction}/${this.idPluginActionExternal}`, {
      method: "PUT",
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify(body),
    })
      .then((response) => response.json())
      .then((response) => {
      return this.editOutputDataEmitter.emit(response);
    })
      .catch((err) => {
      console.log(err);
    });
  }
  catchErrorFromUncomplitedDate(ev) {
    this.submitAlreadyTriggered = true;
    this.badgeErrorOn = ev.detail === true;
  }
  setReminderDone(ev) {
    this.reminderDone = ev.detail;
    this.isFirstTime = false;
    this.reminderDoneSetter.emit(this.reminderDone);
    let outputToChange = { ...this.reminderInfo };
    let arrayDate = outputToChange.date.split("/");
    let month;
    if (arrayDate[1]) {
      if (arrayDate[1].startsWith("0")) {
        month = parseInt(arrayDate[1].replace("0", ""));
        month = month - 1;
      }
      else {
        month = parseInt(arrayDate[1]);
        month = month - 1;
      }
    }
    let newHour = parseInt(outputToChange.hour.startsWith("0")
      ? outputToChange.hour.replace("0", "")
      : outputToChange.hour) +
      parseInt(outputToChange.duration.startsWith("0")
        ? outputToChange.duration.replace("0", "")
        : outputToChange.duration);
    outputToChange.dateTime = new Date(parseInt(arrayDate[2]), month, parseInt(arrayDate[0]), outputToChange.hour.startsWith("0")
      ? parseInt(outputToChange.hour.replace("0", ""))
      : parseInt(outputToChange.hour), parseInt(outputToChange.minute));
    outputToChange.dateTimeEnd = new Date(parseInt(arrayDate[2]), month, parseInt(arrayDate[0]), newHour, parseInt(outputToChange.minute));
    let startDate = luxon.DateTime.fromJSDate(outputToChange.dateTime).toISO({
      includeOffset: false,
    });
    let endDate = luxon.DateTime.fromJSDate(outputToChange.dateTimeEnd).toISO({ includeOffset: false });
    let body = {
      name: outputToChange.name,
      description: outputToChange.description,
      startDate: startDate,
      endDate: endDate,
      actionRead: this.reminderDone,
    };
    fetch(`${this.baseUrl}/services/eolo-api-gateway/external-api/${this.idPluginAction}/${this.idPluginActionExternal}`, {
      method: "PUT",
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify(body),
    })
      .then((response) => response.json())
      .then((response) => {
      return this.editOutputDataEmitter.emit(response);
    })
      .catch((err) => {
      console.log(err);
    });
  }
  // delete reminder:
  changeStat(ev) {
    if (ev.detail === "edit") {
      this.status = States.edit;
    }
    else {
      fetch(`${this.baseUrl}/services/eolo-api-gateway/external-api/${this.idPluginAction}/${this.idPluginActionExternal}`, {
        method: "DELETE",
        headers: {
          "Content-Type": "application/json",
        },
      })
        .then(() => {
        console.log("removed");
        return this.deleteAddonReminderEmitter.emit(true);
      })
        .catch((err) => {
        console.log(err);
      });
    }
  }
  createReminder() {
    this.status = States.view;
  }
  takeInfoFromBody(ev) {
    let reminder = { ...this.reminderInfo };
    if (ev.detail.hour) {
      reminder.hour = ev.detail.hour;
    }
    if (ev.detail.minute) {
      reminder.minute = ev.detail.minute;
    }
    if (ev.detail.duration) {
      reminder.duration = ev.detail.duration;
    }
    if (ev.detail.description) {
      reminder.description = ev.detail.description;
    }
    if (ev.detail.date) {
      reminder.date = ev.detail.date;
    }
    this.reminderInfo = { ...reminder };
  }
  takeInfoFromHeder(ev) {
    let reminder = { ...this.reminderInfo };
    reminder.name = ev.detail;
    this.reminderInfo = { ...reminder };
  }
  deleteFromActionClose() {
    if (this.deleteSub) {
      fetch(`${this.baseUrl}/services/eolo-api-gateway/external-api/${this.idPluginAction}/${this.idPluginActionExternal}`, {
        method: "DELETE",
        headers: {
          "Content-Type": "application/json",
        },
      })
        .then(() => {
        console.log("removed");
        return this.deleteAddonReminderEmitter.emit(true);
      })
        .catch((err) => {
        console.log(err);
      });
    }
  }
  stateDetectionChange() {
    if (this.state === "view") {
      this.status = States.view;
    }
  }
  validationOfData(newValue) {
    if (this.submitAlreadyTriggered) {
      if (this.withoutFooter) {
        if (newValue.endDate &&
          newValue.startDate &&
          newValue.name &&
          newValue.description) {
          this.badgeErrorOn = false;
          this.validation = true;
        }
        else {
          this.validation = false;
          this.badgeErrorOn = true;
        }
      }
      else {
        if (newValue.hour &&
          newValue.minute &&
          newValue.duration &&
          newValue.description &&
          newValue.date &&
          newValue.name &&
          this.reminderInfo.date) {
          this.badgeErrorOn = false;
          this.validation = true;
        }
        else {
          this.validation = false;
          this.badgeErrorOn = true;
        }
      }
    }
  }
  componentShouldUpdate() {
    if (this.sendDataForCalendar) {
      this.validationOfData(this.reminderInfoDTO);
      if (this.validation) {
        this.sendOutputDataFromCalendar();
      }
      else {
        this.badgeErrorOn = true;
      }
    }
  }
  componentWillRender() {
    if (this.isFirstTime) {
      this.reminderDone = this.doneFlag;
      if (this.state) {
        if (this.state === "view") {
          this.status = States.view;
          // qui faccio il mapper de merda:
          this.reminderInfo.name = this.reminderInfoDTO.name;
          this.reminderInfo.description = this.reminderInfoDTO.description;
          let startDate = new Date(this.reminderInfoDTO.startDate);
          let endDate = new Date(this.reminderInfoDTO.endDate);
          this.reminderInfo.date = luxon.DateTime.fromJSDate(startDate)
            .toLocal()
            .toFormat("dd/MM/yyyy");
          if (startDate.getHours() < 10) {
            this.reminderInfo.hour = "0" + String(startDate.getHours());
            this.reminderInfo.minute = String(startDate.getMinutes());
          }
          else {
            this.reminderInfo.hour = String(startDate.getHours());
            this.reminderInfo.minute = String(startDate.getMinutes());
          }
          if (endDate.getHours() + startDate.getHours() >= 24) {
            this.reminderInfo.duration =
              String(24 - Math.abs(endDate.getHours() - startDate.getHours()));
          }
          else {
            this.reminderInfo.duration = String(endDate.getHours() - startDate.getHours());
          }
          if (this.reminderInfo.duration.length === 1) {
            this.reminderInfo.duration = "0" + this.reminderInfo.duration;
          }
        }
        else if (this.state === "create") {
          this.status = States.create;
          this.reminderInfo.description = "";
          // pre impostare il titolo del promemoria
          // this.reminderInfo.name = 'Titolo del promemoria'
        }
        else {
          this.status = States.edit;
        }
      }
      else {
        this.status = States.create;
      }
      this.isFirstTime = false;
    }
    // this.reminderDone = this.doneFlag;
    if (this.deleteSub) {
      this.deleteFromActionClose();
    }
    if (this.withoutFooter) {
      let date = this.reminderInfoDTO.startDate;
      if (!this.reminderInfoDTO.startDate.includes("/")) {
        this.reminderInfo.date = luxon.DateTime.fromJSDate(new Date(date))
          .toLocal()
          .toFormat("dd/MM/yyyy");
      }
    }
    //   else{
    //     if(this.state === 'view' && this.reminderInfoDTO){
    //       this.reminderInfo.name = this.reminderInfoDTO.name;
    //       this.reminderInfo.description = this.reminderInfoDTO.description;
    //       let startDate: Date = new Date(this.reminderInfoDTO.startDate);
    //       let endDate: Date = new Date(this.reminderInfoDTO.endDate);
    //       this.reminderInfo.date =  DateTime.fromJSDate(startDate).toLocal().toFormat('dd/MM/yyyy');
    //       if (startDate.getHours() < 10) {
    //         this.reminderInfo.hour = '0' + String(startDate.getHours());
    //         this.reminderInfo.minute = String(startDate.getMinutes());
    //       } else {
    //         this.reminderInfo.hour = String(startDate.getHours());
    //         this.reminderInfo.minute = String(startDate.getMinutes());
    //       }
    //       this.reminderInfo.duration = String(endDate.getHours() - startDate.getHours());
    //       if (this.reminderInfo.duration.length === 1) {
    //         this.reminderInfo.duration = '0' + this.reminderInfo.duration;
    //       }
    //       this.state = 'view'
    //   }
    // }
  }
  render() {
    return (h("div", { class: "reminder-container" }, h("sw-addon-reminder-header", { withoutFooter: this.withoutFooter, addonReminderTitle: this.reminderInfo.name, creationDate: this.reminderInfo.date, state: this.status }), h("sw-addon-reminder-body", { withoutFooter: this.withoutFooter, date: this.reminderInfo.date, reminderDoneValue: this.reminderDone, addonReminderInfoFromParent: this.reminderInfo, state: this.status, descriptionText: this.reminderInfo.description }), h("sw-addon-reminder-footer", { class: !this.withoutFooter ? "footer" : "hidden", reminderDoneProp: this.reminderDone, author: this.userInfo, submitValidation: this.validation, reminderAddonInfo: this.reminderInfo, state: this.status }), h("div", { class: { "badge-error": true, hidden: !this.badgeErrorOn } }, h("sw-badge-error", null))));
  }
  static get watchers() { return {
    "deleteSub": ["deleteFromActionClose"],
    "state": ["stateDetectionChange"],
    "reminderInfo": ["validationOfData"]
  }; }
  static get style() { return swAddonReminderCss; }
}, [1, "sw-addon-reminder", {
    "sendDataForCalendar": [1028, "send-data-for-calendar"],
    "withoutFooter": [1028, "without-footer"],
    "doneFlag": [1028, "done-flag"],
    "deleteSub": [1028, "delete-sub"],
    "reminderInfoDTO": [1040],
    "userInfo": [1040],
    "state": [1025],
    "taskId": [1026, "task-id"],
    "idPluginAction": [1026, "id-plugin-action"],
    "baseUrl": [1025, "base-url"],
    "idPluginActionExternal": [1026, "id-plugin-action-external"],
    "badgeErrorOn": [32],
    "reminderDone": [32],
    "status": [32],
    "reminderInfoState": [32],
    "reminderInfo": [32]
  }, [[0, "undoReminderEmitter", "catchUndoReminder"], [0, "closeReminderEmitter", "catchCloseAction"], [0, "createReminderEmitterFromSubmit", "sendOutputData"], [0, "editReminderEmitterFromSubmit", "editOutputData"], [0, "errorEmitter", "catchErrorFromUncomplitedDate"], [3, "reminderDoneEmitter", "setReminderDone"], [3, "changeStatusToAddonReminder", "changeStat"], [3, "createReminderEmitter", "createReminder"], [3, "addonReminderInfoFromBodyEmitter", "takeInfoFromBody"], [3, "addonReminderInfoFromHeaderEmitter", "takeInfoFromHeder"]]]);
function defineCustomElement() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["sw-addon-reminder", "mds-avatar", "mds-img", "mds-text", "sw-addon-reminder-body", "sw-addon-reminder-footer", "sw-addon-reminder-header", "sw-badge-error", "sw-description-input", "sw-input-button", "sw-input-select", "sw-obligatory-field", "sw-options-menu", "sw-searchbox"];
  components.forEach(tagName => { switch (tagName) {
    case "sw-addon-reminder":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, SwAddonReminder);
      }
      break;
    case "mds-avatar":
      if (!customElements.get(tagName)) {
        defineCustomElement$d();
      }
      break;
    case "mds-img":
      if (!customElements.get(tagName)) {
        defineCustomElement$c();
      }
      break;
    case "mds-text":
      if (!customElements.get(tagName)) {
        defineCustomElement$b();
      }
      break;
    case "sw-addon-reminder-body":
      if (!customElements.get(tagName)) {
        defineCustomElement$a();
      }
      break;
    case "sw-addon-reminder-footer":
      if (!customElements.get(tagName)) {
        defineCustomElement$9();
      }
      break;
    case "sw-addon-reminder-header":
      if (!customElements.get(tagName)) {
        defineCustomElement$8();
      }
      break;
    case "sw-badge-error":
      if (!customElements.get(tagName)) {
        defineCustomElement$7();
      }
      break;
    case "sw-description-input":
      if (!customElements.get(tagName)) {
        defineCustomElement$6();
      }
      break;
    case "sw-input-button":
      if (!customElements.get(tagName)) {
        defineCustomElement$5();
      }
      break;
    case "sw-input-select":
      if (!customElements.get(tagName)) {
        defineCustomElement$4();
      }
      break;
    case "sw-obligatory-field":
      if (!customElements.get(tagName)) {
        defineCustomElement$3();
      }
      break;
    case "sw-options-menu":
      if (!customElements.get(tagName)) {
        defineCustomElement$2();
      }
      break;
    case "sw-searchbox":
      if (!customElements.get(tagName)) {
        defineCustomElement$1();
      }
      break;
  } });
}
defineCustomElement();

export { SwAddonReminder as S, defineCustomElement as d };
