var __awaiter=this&&this.__awaiter||function(e,n,t,r){function i(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r["throw"](e))}catch(e){o(e)}}function l(e){e.done?t(e.value):i(e.value).then(a,s)}l((r=r.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(n){return l([e,n])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(t)try{if(r=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;i=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){t.label=a[1];break}if(a[0]===6&&t.label<o[1]){t.label=o[1];o=a;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(a);break}if(o[2])t.ops.pop();t.trys.pop();continue}a=n.call(e,t)}catch(e){a=[6,e];i=0}finally{r=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-ecdfb761.js";import{C as CalendarUtils}from"./calendar-470c802a.js";import{S as SozlukApi}from"./index-3bf9b308.js";import{s as sozlukEntries,d as MentornityAnnouncementWrapperI18nKey,e as mentornityAnnouncementWrapperI18nDefault}from"./sozluk-entries-1e8f5234.js";import"./index-a3ca021c.js";import"./_commonjsHelpers-27f122dd.js";import"./moment-65eca6b3.js";import"./i18n-09a07b97.js";import"./i18n-0e757ca5.js";var MentornityAnnouncementsMailingReport=function(){function e(e){var n=this;registerInstance(this,e);this.openSelectUsersDialog=createEvent(this,"openSelectUsersDialog",7);this.openAnnouncementReport=createEvent(this,"openAnnouncementReport",7);this.setDictionaryLanguage=function(){return __awaiter(n,void 0,void 0,(function(){var e,n;return __generator(this,(function(t){switch(t.label){case 0:e=(new SozlukApi).setLanguage(this.item.language).setContents(sozlukEntries);n=this;return[4,e.getContent(MentornityAnnouncementWrapperI18nKey,mentornityAnnouncementWrapperI18nDefault)];case 1:n.strings=t.sent();return[2]}}))}))}}e.prototype.componentWillLoad=function(){this.setDictionaryLanguage()};e.prototype.render=function(){var e=this;var n,t,r,i,o,a,s;var l=this.strings;if(!l)return;var c=((t=(n=this.item)===null||n===void 0?void 0:n.targetList)===null||t===void 0?void 0:t.length)>0;var u=((i=(r=this.item)===null||r===void 0?void 0:r.sentEmailsAt)===null||i===void 0?void 0:i.length)>0&&CalendarUtils.format(((o=this.item)===null||o===void 0?void 0:o.sentEmailsAt[((s=(a=this.item)===null||a===void 0?void 0:a.sentEmailsAt)===null||s===void 0?void 0:s.length)-1])*1e3,"DD-MM-YYYY - ".concat(CalendarUtils.timeFormat==="12-hour"?"hh:mm A":"HH:mm"));return h(Host,null,c?h("div",{class:"d-flex align-items-center"},h("p",{class:"m-0"},SozlukApi.build(l.sentOn,{date:u})),h("strong",{class:"m-0 ml-3",style:{cursor:"pointer"},onClick:function(){return e.openAnnouncementReport.emit(e.item)}},h("dvn-icon",{iconName:"uil uil-envelope-check"}),l.checkReport)):h("div",{class:"d-flex align-items-center"},h("dvn-button",{tint:"primary",leaned:true,scale:"small",onClick:function(){return e.openSelectUsersDialog.emit(e.item)}},l.sendNow),h("p",{class:"m-0 ml-3"},l.notSent)))};return e}();export{MentornityAnnouncementsMailingReport as mentornity_announcements_mailing_report};