import{Host,h}from"@stencil/core";import{state}from"../../../../store/upsell/index";import{isBusy}from"../../../../store/upsell/getters";import{preview,trackOffer}from"../../../../store/upsell/mutations";import{__}from"@wordpress/i18n";export class ScUpsell{componentWillLoad(){trackOffer(),preview()}render(){var e,s,t,c,o,a,i,d,l;const n=null===(e=state.checkout)||void 0===e?void 0:e.manual_payment_method;return h(Host,{key:"1feeb596433d726d63270185da07147edbe176bf"},h("slot",{key:"608c578c002d6110330b5a35abfd02f881312597"}),isBusy()&&h("sc-block-ui",{key:"1ccc19bf67f8d75ef28458dca3b822efb7de139b",style:{"z-index":"30","--sc-block-ui-position":"fixed"}}),h("sc-dialog",{key:"e981a4d81227e05733867672e963823c31085e37",open:"complete"===state.loading,style:{"--body-spacing":"var(--sc-spacing-xxx-large)"},noHeader:!0,onScRequestClose:e=>e.preventDefault()},h("div",{key:"4bf2098a19b643fc4def3dbcdb2af8ce4c3d5f86",class:"confirm__icon"},h("div",{key:"63bae6940fafb5174ba5c4d7598b3bb2e283ca73",class:"confirm__icon-container"},h("sc-icon",{key:"10cfc2b97369c5a86b0424c8bc518dee044bd967",name:"check"}))),h("sc-dashboard-module",{key:"2637af85cdcb7d8b8ba1c049e336a6dcaa000fb5",heading:(null===(t=null===(s=null==state?void 0:state.text)||void 0===s?void 0:s.success)||void 0===t?void 0:t.title)||__("Thank you!","surecart"),style:{"--sc-dashboard-module-spacing":"var(--sc-spacing-x-large)",textAlign:"center"}},h("span",{key:"f96732f4eb36344e38ac05cafa9bde7a5edd8a71",slot:"description"},(null===(o=null===(c=null==state?void 0:state.text)||void 0===c?void 0:c.success)||void 0===o?void 0:o.description)||__("Your purchase was successful. A receipt is on its way to your inbox.","surecart")),!!(null==n?void 0:n.name)&&!!(null==n?void 0:n.instructions)&&h("sc-alert",{key:"16d04726310a1497245adff3532f26706a2d6d8e",type:"info",open:!0,style:{"text-align":"left"}},h("span",{key:"7755e292059e830e38a856d848cab863b2129595",slot:"title"},null==n?void 0:n.name),h("div",{key:"983d1b8c3e79d6c387473b84217e3b2886fb7cbf",innerHTML:null==n?void 0:n.instructions})),h("sc-button",{key:"bb2eb1b40154a8cf0b20fa499ce50d35094eff31",href:null===(i=null===(a=null===window||void 0===window?void 0:window.scData)||void 0===a?void 0:a.pages)||void 0===i?void 0:i.dashboard,size:"large",type:"primary",autofocus:!0},(null===(l=null===(d=null==state?void 0:state.text)||void 0===d?void 0:d.success)||void 0===l?void 0:l.button)||__("Continue","surecart"),h("sc-icon",{key:"8ec97a67c191a466cd7396a439174686effa5bc5",name:"arrow-right",slot:"suffix"})))))}static get is(){return"sc-upsell"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["sc-upsell.scss"]}}static get styleUrls(){return{$:["sc-upsell.css"]}}}