var __awaiter=this&&this.__awaiter||function(t,e,n,i){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function a(t){try{c(i.next(t))}catch(t){o(t)}}function s(t){try{c(i["throw"](t))}catch(t){o(t)}}function c(t){t.done?n(t.value):r(t.value).then(a,s)}c((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,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(t){return function(e){return c([t,e])}}function c(a){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=e.call(t,n)}catch(t){a=[6,t];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h}from"./index-67f7ec52.js";import{b as benefitsEventTrackingService}from"./event-tracking.service-8d44e7ac.js";import"./api-client-a68152b8.js";import"./index-6869168f.js";import"./index-8f0ba0c8.js";import"./datorama-akita-d2413fd0.js";import"./scheduleArray-b9669898.js";import"./delay-d08c267f.js";import"./filter-aeb65cac.js";var benefitListItemCss="ap-ben-benefit-list-item .btn.btn-success{background-color:#27a88a;border-color:#27a88a}ap-ben-benefit-list-item .btn.btn-success:hover{background-color:#23967b;border-color:#23967b}ap-ben-benefit-list-item .btn.btn-success:not(:disabled):not(.disabled):active{background-color:#23967b;border-color:#23967b}@media (max-width: 575.98px){ap-ben-benefit-list-item .btn.btn-success{display:block;width:100%}}ap-ben-benefit-list-item .benefit-image{-o-object-fit:cover;object-fit:cover;width:100%;max-width:4rem}";var BenefitListItem=function(){function t(t){var e=this;registerInstance(this,t);this.onBenefitButtonClick=function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(this.benefit.url===null)return[2];window.open(this.benefit.url,"_blank");return[4,benefitsEventTrackingService.trackBenefitLinkClickedAsync(this.benefitWithId)];case 1:t.sent();return[2]}}))}))}}t.prototype.render=function(){return h("div",{class:"uiid-view-benefit-item-exist row align-items-top py-3 mx-0"},h("div",{class:"col-4 col-md-2 col-lg-1 px-0"},h("div",{class:"ml-0 my-lg-3 my-sm-2 my-xs-2 mr-3"},this.IconElement())),h("div",{class:"col-12 col-lg-8 text-left px-lg-2 px-0 pt-lg-0 pt-3"},h("h4",{class:"card-title mb-1 text-break"},this.benefit.title),h("span",{class:"benefit-value-description text-break"},this.benefit.subtitle),this.benefit.subtitle&&" - ",h("span",{class:"text-muted"},this.benefit.category),h("p",{class:"mb-0 pt-lg-3 pt-4 text-break"},this.benefit.description)),h("div",{class:"col-12 col-lg-3 px-0 d-flex justify-content-end align-items-start"},this.openAttachmentButton(),this.learnMoreButton()))};Object.defineProperty(t.prototype,"benefit",{get:function(){return this.benefitWithId.benefit},enumerable:false,configurable:true});t.prototype.learnMoreButton=function(){var t=this;if(this.benefit.url===null||this.benefit.url===""){return undefined}return h("button",{type:"button",class:"uiid-validate-benefit-url-exist d-block d-lg-inline-block btn btn-light px-4 py-2 ml-2",onClick:function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.onBenefitButtonClick()]}))}))}},"Learn more")};t.prototype.openAttachmentButton=function(){var t=this;var e;if(this.benefit.attachments===null||((e=this.benefit.attachments)===null||e===void 0?void 0:e.length)===0){return undefined}return h("a",{class:"uiid-validate-benefit-doc-exist d-block d-lg-inline-block btn btn-light px-4 py-2",target:"_blank",href:this.benefit.attachments[0].downloadUrl,onClick:function(e){return benefitsEventTrackingService.trackBenefitAttachmentClickedAsync(t.benefitWithId)}},h("span",null,"View"))};t.prototype.IconElement=function(){if(this.benefit.icon!==null){return h("img",{src:this.benefit.icon.downloadUrl,class:"img-responsive benefit-image",alt:"benefit-icon"})}else{return h("ap-ben-icon",{class:"text-black-50 fa-3x",iconPrefix:"fad",iconId:"award"})}};return t}();BenefitListItem.style=benefitListItemCss;export{BenefitListItem as ap_ben_benefit_list_item};