'use strict';

var index = require('./index-BEF5cZxd.js');
var props = require('./props-CPENhBnM.js');
var constants = require('./constants-ymB2dvwV.js');
var template = require('./template-Cj6PcLmR.js');
var wcag = require('./wcag-Bvzxnp5D.js');
var gov_log = require('./gov.log-C5EH15b_.js');
var utils = require('./utils-NnC78QR3.js');
require('./colors-DgrrxjsX.js');
require('./sizes-D5zsw2g5.js');
require('./string.utils-BG4pUfEi.js');
require('./helpers.types-vap8QfRH.js');

const GovWizard = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.govChange = index.createEvent(this, "gov-change");
        this.hydrated = false;
        /**
         * Size of wizard
         */
        this.size = "m";
        this.h = template.govHost(this.host);
    }
    validateSize(newValue) {
        props.validateProp(constants.WizardSizes, newValue, constants.WizardClass.root);
    }
    componentWillLoad() {
        this.validateSize(this.size);
    }
    componentDidLoad() {
        this.host.querySelectorAll(constants.WizardItemClass.root).forEach((child) => {
            child.setAttribute("size", this.size);
            /*
            child.addEventListener('gov-change', (e: GovWizardItemCustomEvent<GovWizardItemChangeEvent>) => {
                e.stopPropagation()
                this.govChange.emit(e.detail)
            })
            */
        });
    }
    async componentDidRender() {
        if (gov_log.canValidateWcagOnRender()) {
            await utils.delay(500);
            await this.validateWcag();
        }
    }
    connectedCallback() {
        this.hydrated = true;
    }
    render() {
        return (index.h(index.Host, { key: '0b400b9a4f82a9477e87a314eb54928b66038912', class: this.h.classes(constants.WizardClass.root), role: "list", size: this.size, hydrated: this.hydrated }, index.h("slot", { key: '27f601048d97c94aca98594c98028209081b5690' })));
    }
    /**
     * Validate the WCAG attributes of the component
     */
    async validateWcag() {
        wcag.validateAccessibleLabel(this.wcagLabel, this.wcagLabelledBy, constants.WizardClass.root);
    }
    get host() { return index.getElement(this); }
    static get watchers() { return {
        "size": ["validateSize"]
    }; }
};

exports.gov_wizard = GovWizard;
//# sourceMappingURL=gov-wizard.entry.cjs.js.map

//# sourceMappingURL=gov-wizard.cjs.entry.js.map