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:"3495b25a833e88d6df38835205553916686f12d4",role:"timer",class:{"sc-upsell-countdown-timer":!0}},this.showIcon&&h("sc-icon",{key:"9246ab5676b92a97aab09ae7d11836e9a9f6e9de",name:"clock"}),h("span",{key:"11f0acad5ae4a6314b0c287ab1b823c96136d1b6"},h("slot",{key:"56e61e0eba3b2d3ba734cca54bb30c4a687d04b8",name:"offer-expire-text"})," ",h("strong",{key:"c9bb94d600a46f85e7e4a1f90a78cc9f6db1cf19"},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:{}}}}