import{Host,h}from"@stencil/core";import{getFormattedRemainingTime}from"../../../../store/upsell/getters";export class ScUpsellCountdownTimer{constructor(){this.timeRemaining=1/0,this.formattedTime=void 0,this.showIcon=!0}componentDidLoad(){this.updateCountdown()}updateCountdown(){this.formattedTime=getFormattedRemainingTime(),setInterval((()=>{this.formattedTime=getFormattedRemainingTime()}),1e3)}render(){return h(Host,{key:"727b55154fbf1fe61aa56ad7d6d0ed9a0a0909b6",role:"timer",class:{"sc-upsell-countdown-timer":!0}},this.showIcon&&h("sc-icon",{key:"302324b2900e8c7488c75e6502395e700f364e06",name:"clock"}),h("span",{key:"73bc4a1a8d8a0f54f459aba3f3169dc58d39aaa6"},h("slot",{key:"01c95848cd1822ca64c74de17b55be7a4150e252",name:"offer-expire-text"})," ",h("strong",{key:"38ecb7b7c6b098bbe5e65642a628cf22a702d374"},this.formattedTime)))}static get is(){return"sc-upsell-countdown-timer"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["sc-upsell-countdown-timer.css"]}}static get styleUrls(){return{$:["sc-upsell-countdown-timer.css"]}}static get properties(){return{showIcon:{type:"boolean",mutable:!1,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Whether to show the icon."},attribute:"show-icon",reflect:!1,defaultValue:"true"}}}static get states(){return{timeRemaining:{},formattedTime:{}}}}