import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
import { c as checkoutStore } from './checkout.store.js';
import { d as defineCustomElement$1 } from './form-control-checkbox2.js';

const SaveNewPaymentMethod = /*@__PURE__*/ proxyCustomElement(class SaveNewPaymentMethod extends HTMLElement {
    constructor(registerHost) {
        super();
        if (registerHost !== false) {
            this.__registerHost();
        }
        this.checkboxChanged = createEvent(this, "checkboxChanged", 7);
        this.label = 'Save New Payment Method';
        this.isChecked = false;
        this.handleCheckboxChange = (_name, value) => {
            this.isChecked = value;
            checkoutStore.savePaymentMethod = value;
            this.checkboxChanged.emit(this.isChecked);
        };
    }
    render() {
        return (h(Host, { key: 'a5ecfa60f9f55bdb91343394c1dd5bea542c20ed', hidden: this.hidden }, h("form-control-checkbox", { key: '282476dea11415eeec68336577ff17a5c03baad2', label: this.label || 'Save New Payment Method', name: "saveNewPaymentMethod", checked: this.isChecked, inputHandler: this.handleCheckboxChange })));
    }
}, [256, "save-new-payment-method", {
        "label": [1],
        "hidden": [4],
        "isChecked": [32]
    }]);
function defineCustomElement() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["save-new-payment-method", "form-control-checkbox"];
    components.forEach(tagName => { switch (tagName) {
        case "save-new-payment-method":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, SaveNewPaymentMethod);
            }
            break;
        case "form-control-checkbox":
            if (!customElements.get(tagName)) {
                defineCustomElement$1();
            }
            break;
    } });
}
defineCustomElement();

export { SaveNewPaymentMethod as S, defineCustomElement as d };
