import{proxyCustomElement,HTMLElement}from"@stencil/core/internal/client";const ScCheckoutUnsavedChangesWarning=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.state=void 0}componentDidLoad(){window.addEventListener("beforeunload",(e=>this.warnIfUnsavedChanges(e)),{capture:!0})}warnIfUnsavedChanges(e){if(["updating","finalizing","confirming"].includes(this.state))return console.log({e:e}),e.preventDefault(),e.returnValue=wp.i18n.__("Your payment is processing. Exiting this page could cause an error in your order. Please do not navigate away from this page.","surecart"),e.returnValue}},[1,"sc-checkout-unsaved-changes-warning",{state:[1]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["sc-checkout-unsaved-changes-warning"].forEach((e=>{"sc-checkout-unsaved-changes-warning"===e&&(customElements.get(e)||customElements.define(e,ScCheckoutUnsavedChangesWarning))}))}export{ScCheckoutUnsavedChangesWarning as S,defineCustomElement as d};