'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-7a477838.js');
const typographyVariation_enum = require('./typography-variation.enum-8fd8bed4.js');
require('./badge-notification-shape.enum-ff802554.js');
require('./badge-status-variation.enum-0a5adc21.js');
require('./code-example-variation.enum-1611825e.js');
require('./form-input-search-variation.enum-e0e025b1.js');
require('./button-variation.enum-bc521499.js');
require('./calendar-week-view-heading-level.enum-fd0c841b.js');
require('./code-variation.enum-c4a4e6fd.js');
require('./expandable-accordion-header-level.enum-45483252.js');
require('./expandable-faq-item-variation.enum-89427195.js');
require('./expandable-faq-variation.enum-af923f49.js');
require('./footer-card-variation.enum-99555edc.js');
require('./form-checkbox-variation.enum-d2ca879e.js');
require('./form-file-upload-variation.enum-634cfae8.js');
require('./form-input-type.enum-9c8ee12a.js');
require('./form-input-variation.enum-c750520c.js');
require('./form-select-variation.enum-528c1bf0.js');
require('./form-textarea-variation.enum-9c90d40f.js');
require('./form-validation-message-variation.enum-855ae0be.js');
require('./info-card-multi-type.enum-14746572.js');
require('./info-card-variation.enum-64cef637.js');
const layoutBlockVariation_enum = require('./layout-block-variation.enum-f6102119.js');
require('./layout-columns-variation.enum-65675649.js');
require('./link-button-variation.enum-137785e3.js');
require('./list-type.enum-aea4d012.js');
require('./loader-skeleton-variation.enum-d52ba55e.js');
require('./loader-spinner-size.enum-db2973f0.js');
require('./logo-variation.enum-607fadb4.js');
require('./media-figure-alignment.enum-3885aba5.js');
require('./navigation-sidebar-variation.enum-1c0c3064.js');
require('./progress-indicator-variation.enum-7cf8e0e4.js');
require('./progress-list-item-variation.enum-90e4c874.js');
require('./progress-list-variation.enum-06d5ce27.js');
require('./progressbar-variation.enum-aff9fa80.js');
require('./quote-image-inner-position.enum-e64e7a6d.js');
require('./table-variation.enum-25df2ad7.js');
require('./tag-media-icon.enum-372563c5.js');
require('./tag-size.enum-387c516c.js');
require('./tools-feedback-banner-type.enum-de373ba0.js');
require('./tools-feedback-rating-variation.enum-2f71e84d.js');
require('./tools-theme-provider.brand.enum-bc855272.js');
require('./typography-heading-jumbo-variation.enum-8677e099.js');
require('./typography-meta-variation.enum-13ac3538.js');
require('./typography-time-variation.enum-bce1d87e.js');
require('./util-breakpoint-observer-breakpoints.enum-e96d3a84.js');

const formReceiptCss = ".sc-digi-form-receipt-h{--digi--receipt--background-color:var(--digi--color--background--pop-out);--digi--receipt--margin:var(--digi--padding--small);--digi--receipt--padding-top:var(--digi--padding--large);--digi--receipt--padding-bottom:var(--digi--padding--largest);--digi--receipt--padding-top--desktop:var(--digi--padding--largest-2);--digi--receipt--padding-bottom--desktop:var(--digi--padding--largest-3);--digi--receipt--padding-horizontal:var(--digi--padding--medium);--digi--receipt--heading--color:var(--digi--color--text--primary);--digi--receipt--heading--font-size:var(--digi--typography--heading-2--font-size--mobile);--digi--receipt--heading--font-size--desktop:var(--digi--typography--heading-1--font-size--desktop-large);--digi--receipt--heading--font-weight:var(--digi--typography--heading-2--font-weight--mobile);--digi--receipt--heading--font-weight--desktop:var(--digi--typography--heading-1--font-weight--desktop);--digi--receipt--heading--font-family:var(--digi--global--typography--font-family--default)}.sc-digi-form-receipt-h .digi-form-receipt.sc-digi-form-receipt{background-color:var(--digi--receipt--background-color);display:grid;padding-top:var(--digi--receipt--padding-top);padding-bottom:var(--digi--receipt--padding-bottom)}@media (min-width: 61.9375rem){.sc-digi-form-receipt-h .digi-form-receipt.sc-digi-form-receipt{padding-top:var(--digi--receipt--padding-top--desktop);padding-bottom:var(--digi--receipt--padding-bottom--desktop)}}.sc-digi-form-receipt-h .digi-form-receipt--grid.sc-digi-form-receipt{padding-left:var(--digi--receipt--padding-horizontal);padding-right:var(--digi--receipt--padding-horizontal)}.sc-digi-form-receipt-h .digi-form-receipt--center.sc-digi-form-receipt .digi-form-receipt__content.sc-digi-form-receipt{display:flex;flex-direction:column;align-items:center}.sc-digi-form-receipt-h .digi-form-receipt__content.sc-digi-form-receipt{grid-column:1;grid-row:1}.sc-digi-form-receipt-h .digi-form-receipt__body.sc-digi-form-receipt{display:flex;flex-direction:column}.sc-digi-form-receipt-h .digi-form-receipt__heading.sc-digi-form-receipt{font-family:var(--digi--receipt--heading--font-family);font-size:var(--digi--receipt--heading--font-size);font-weight:var(--digi--receipt--heading--font-weight);margin-top:0;margin-bottom:0;display:block;color:var(--digi--receipt--heading--color)}@media (min-width: 61.9375rem){.sc-digi-form-receipt-h .digi-form-receipt__heading.sc-digi-form-receipt{font-size:var(--digi--receipt--heading--font-size--desktop);font-weight:var(--digi--receipt--heading--font-weight--desktop)}}.sc-digi-form-receipt-h .digi-form-receipt__icon.sc-digi-form-receipt{width:2.125rem;height:1.75rem;margin-bottom:var(--digi--receipt--margin)}@media (min-width: 61.9375rem){.sc-digi-form-receipt-h .digi-form-receipt__icon.sc-digi-form-receipt{width:2.75rem;height:2.25rem}}.sc-digi-form-receipt-h .digi-form-receipt__infographic-primary.sc-digi-form-receipt{fill:var(--digi--color--infographic--brand--primary)}.sc-digi-form-receipt-h .digi-form-receipt__slot-wrapper.sc-digi-form-receipt{display:flex;flex-direction:column;gap:1rem}.sc-digi-form-receipt-h .digi-form-receipt__slot-wrapper-has-content.sc-digi-form-receipt{padding-top:1.5rem}.sc-digi-form-receipt-s .digi-form-receipt__slot-wrapper-center-text{text-align:center}";
const DigiFormReceiptStyle0 = formReceiptCss;

const FormReceipt = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.afText = '';
        this.afVariation = typographyVariation_enum.FormReceiptVariation.FULLWIDTH;
        this.afType = typographyVariation_enum.FormReceiptType.CENTER;
        this.afHeadingLevel = typographyVariation_enum.FormReceiptHeadingLevel.H2;
        this.hasDefaultSlot = false;
    }
    componentDidLoad() {
        this.checkSlotContent();
    }
    checkSlotContent() {
        var _a;
        const slotWrapper = (_a = this.hostElement) === null || _a === void 0 ? void 0 : _a.querySelector('.digi-form-receipt__slot-wrapper');
        if (!slotWrapper)
            return;
        this.hasDefaultSlot = slotWrapper.innerHTML.trim() !== '';
        if (this.afType === typographyVariation_enum.FormReceiptType.CENTER) {
            const typographyElements = slotWrapper.querySelectorAll(':scope > .hydrated');
            const buttonElements = slotWrapper.querySelectorAll(':scope > .sc-digi-button-h');
            buttonElements.forEach((element) => {
                element.classList.add('digi-form-receipt__slot-wrapper-center-text');
            });
            typographyElements.forEach((element) => {
                const typography = element.querySelector(':scope > .digi-typography');
                if (typography) {
                    typography.classList.add('digi-form-receipt__slot-wrapper-center-text');
                }
            });
        }
    }
    get cssModifiers() {
        return {
            'digi-form-receipt--fullwidth': this.afVariation === typographyVariation_enum.FormReceiptVariation.FULLWIDTH,
            'digi-form-receipt--grid': this.afVariation === typographyVariation_enum.FormReceiptVariation.GRID,
            'digi-form-receipt--center': this.afType === typographyVariation_enum.FormReceiptType.CENTER,
            'digi-form-receipt--start': this.afType === typographyVariation_enum.FormReceiptType.START
        };
    }
    get slotContent() {
        return (index.h("div", { class: {
                'digi-form-receipt__slot-wrapper': true,
                'digi-form-receipt__slot-wrapper-has-content': this.hasDefaultSlot
            } }, index.h("slot", null)));
    }
    get content() {
        return (index.h("div", { class: "digi-form-receipt__content" }, index.h("svg", { class: "digi-form-receipt__icon", "aria-hidden": "true", version: "1.1", viewBox: "0 0 35 29" }, index.h("title", null, "Check mark"), index.h("g", { fill: "none", "fill-rule": "evenodd" }, index.h("g", { transform: "translate(-170 -32)" }, index.h("g", { transform: "translate(170 32.325)" }, index.h("g", { transform: "translate(0 .77495)" }, index.h("mask", { id: "b", fill: "white" }, index.h("polygon", { points: "0 0 26.685 0 26.685 27.689 0 27.689" })), index.h("path", { d: "m13.711 27.689c-7.5602 0-13.711-6.2103-13.711-13.844 0-7.6345 6.151-13.845 13.711-13.845 3.1693 0 6.2611 1.1179 8.7048 3.1478l-1.5894 1.9509c-1.9972-1.6592-4.5241-2.5724-7.1155-2.5724-6.181 0-11.209 5.0773-11.209 11.319 0 6.2406 5.0283 11.318 11.209 11.318 4.7924 0 9.0551-3.0733 10.607-7.6478l2.3668 0.81853c-1.8983 5.5958-7.1124 9.3556-12.974 9.3556", fill: "#333", mask: "url(#b)" })), index.h("g", { transform: "translate(4.2177)" }, index.h("mask", { id: "a", fill: "white" }, index.h("polygon", { points: "0 0 30.425 0 30.425 23.496 0 23.496" })), index.h("path", { class: "digi-form-receipt__infographic-primary", d: "m30.191 3.2545-19.95 20.007c-0.31227 0.31253-0.81758 0.31253-1.1292 0l-8.878-8.9033c-0.31164-0.31316-0.31164-0.81992 0-1.1324l1.8818-1.8878c0.31164-0.31253 0.81758-0.31253 1.1292 0l6.4315 6.4499 17.504-17.553c0.31164-0.31316 0.81695-0.31316 1.1292 0l1.8818 1.8872c0.31164 0.31253 0.31164 0.81929 0 1.1324", fill: "#95C13E", mask: "url(#a)" })))))), index.h(this.afHeadingLevel, { class: "digi-form-receipt__heading", tabIndex: -1 }, this.afText), this.slotContent));
    }
    render() {
        return (index.h("div", { key: 'd202410625db1ed892a364374b1516df522df2f6', class: Object.assign({ 'digi-form-receipt': true }, this.cssModifiers) }, this.afVariation === typographyVariation_enum.FormReceiptVariation.FULLWIDTH ? (index.h("digi-layout-block", { afVariation: layoutBlockVariation_enum.LayoutBlockVariation.TRANSPARENT }, this.content)) : (this.content)));
    }
    get hostElement() { return index.getElement(this); }
};
FormReceipt.style = DigiFormReceiptStyle0;

exports.digi_form_receipt = FormReceipt;
