import { h } from "@stencil/core";
export class BpSdkPendingProcess {
    constructor() {
        this.pendingProcesses = undefined;
        this.useExternal = false;
    }
    resetState() { }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-pending-process');
        customElements.whenDefined('bp-sdk-external-pending-process').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-pending-process", { pendingProcesses: this.pendingProcesses });
    }
    renderInternal() {
        var _a;
        const classNaming = (process) => `bp-sdk-pending-process-item__${process.state}`;
        return ((_a = this.pendingProcesses) === null || _a === void 0 ? void 0 : _a.length) ?
            (h("div", { class: "bp-sdk-pending-process__container" }, this.pendingProcesses.map(process => (h("div", { class: classNaming(process) }, h("p", null, process.job_type), h("p", { class: "small-print" }, process.state))))))
            : null;
    }
    static get is() { return "bp-sdk-pending-process"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-pending-process.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-pending-process.css"]
        };
    }
    static get properties() {
        return {
            "pendingProcesses": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "IApplicationFormProcesses[]",
                    "resolved": "IApplicationFormProcesses[]",
                    "references": {
                        "IApplicationFormProcesses": {
                            "location": "import",
                            "path": "@boldpenguin/sdk-types",
                            "id": "../sdk-types/dist/types.d.ts::IApplicationFormProcesses"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                }
            }
        };
    }
    static get states() {
        return {
            "useExternal": {}
        };
    }
}
