import { r as registerInstance, c as createEvent, g as getElement, h, d as Host } from './index-c0a4d8bd.js';
import { s as state } from './pn-profile-modal-store-2832b3e3.js';
import { a as arrow_left } from './arrow_left-2c8d8857.js';
import './index-a0a6fb88.js';

const pnProfileModalProfileCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-profile-modal-type[selected=true]:not([selected-profile=\"\"]) pn-profile-modal-profile[selected=false]{display:none}.pn-profile-modal-profile-listitem{overflow:hidden;max-height:10rem;transition:max-height 0.15s ease;opacity:1}.pn-profile-modal-profile-listitem[aria-hidden=true]{max-height:0;opacity:0}.pn-profile-modal-profile-listitem-button{padding:0.8rem;margin:0;background:#ffffff;outline:0;appearance:none;border:0;cursor:pointer;border-radius:0.8rem;transition:background 0.15s ease;text-align:left;width:100%}.pn-profile-modal-profile-listitem-button:hover,.pn-profile-modal-profile-listitem-button:focus,.pn-profile-modal-profile-listitem-button:active{background:#effbff}.pn-profile-modal-profile-listitem[aria-hidden=true] .pn-profile-modal-profile-listitem-button{display:none}.pn-profile-modal-profile-listitem-heading{color:#005d92;font-weight:700;font-size:1.6rem}.pn-profile-modal-profile-listitem-description{color:#5e554a;font-weight:400;font-size:1.2rem}.pn-profile-modal-profile-details{max-height:300rem;transition:max-height 0.15s ease;opacity:1}.pn-profile-modal-profile-details[aria-hidden=true]{max-height:0;opacity:0;overflow:hidden}.pn-profile-modal-profile-details>pn-button{position:relative;margin-left:-1.2rem}.pn-profile-modal-profile-details>pn-button .pn-button-content{font-weight:500}.pn-profile-modal-profile-details-company{border-top:1px solid #d3cecb;border-bottom:1px solid #d3cecb;padding:0.8rem 0.8rem;margin:1.6rem 0}.pn-profile-modal-profile-details-label{font-size:1.4rem;font-weight:500;margin-bottom:1.2rem}.pn-profile-modal-profile-details-company-heading{font-weight:700;font-size:1.6rem}.pn-profile-modal-profile-details-company-description{color:#5e554a;font-weight:400;font-size:1.2rem}.pn-profile-modal-profile-details-list{display:flex;flex-direction:column;gap:1.6rem;padding:0 0}.pn-profile-modal-profile-details-list-label{font-size:1.4rem;font-weight:500;margin:0 0 0 0.8rem}";
const PnProfileModalProfileStyle0 = pnProfileModalProfileCss;

const PnProfileModalProfile = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.urlSelected = createEvent(this, "urlSelected", 7);
        this.showCustomerNumbersEvent = createEvent(this, "showCustomerNumbersEvent", 7);
        this.heading = null;
        this.description = null;
        this.url = null;
        this.selected = false;
        this.showCustomerNumbers = false;
        this.pleaseSelectText = '';
        this.visible = false;
        this.identifier = '';
    }
    get hostElement() { return getElement(this); }
    urlSelected;
    showCustomerNumbersEvent;
    componentWillLoad() {
        this.identifier = this.heading + this.url;
    }
    onProfileOptionClick() {
        this.selected = true;
        if (this.url) {
            this.urlSelected.emit(this.url);
            // TODO: emit event with URL to parent
        }
        else {
            // TODO: Open customer number selection
            state.selectedProfile = this.identifier;
        }
    }
    render() {
        return (h(Host, { key: '15e917fc2ea14b3acd95d8c4585420f541d24753', selected: this.selected + '' }, h("div", { key: '7e14dd73e00b4a212ef78b05632ac2483d5c5b80', class: "pn-profile-modal-profile-listitem", "aria-hidden": !!state.selectedProfile + '' }, h("button", { key: '9adf6d1a07eaf7de1bf4350332f703f45b850e03', class: "pn-profile-modal-profile-listitem-button", onClick: this.onProfileOptionClick.bind(this) }, h("div", { key: '37623c337e9f8993004ab5675939dbadb8b9fc5e', class: "pn-profile-modal-profile-listitem-heading" }, this.heading), h("div", { key: 'a595631e8fa9f9f3464a813075db4b5f7b2c7381', class: "pn-profile-modal-profile-listitem-description" }, this.description))), h("div", { key: 'ee1cc93908696be9706b95e56e57357d8471159a', class: "pn-profile-modal-profile-details", "aria-hidden": !(state.selectedProfile === this.identifier) + '' }, h("pn-button", { key: '8c17659ae0af24c85e6bfd34f685bd3ac42e90e7', appearance: "light", variant: "borderless", icon: arrow_left, "left-icon": "true", small: "true", onClick: () => {
                this.selected = false;
                state.selectedProfile = '';
            } }, state.i18n.toText, " ", state.selectedType), h("div", { key: '5167fbb235356c1bcfb44b98738dc5d317b5229f', class: "pn-profile-modal-profile-details-company" }, h("div", { key: '6bf70e118be76fa69e35edb9fd3781d58d5b3122', class: "pn-profile-modal-profile-details-label" }, state.i18n.choosenCompanyText), h("div", { key: 'b1362bba25cf119e835acc3d769bd450bfa70f6c', class: "pn-profile-modal-profile-details-company-heading" }, this.heading), h("div", { key: 'ab0eedf502f9421515fca32fe99172b481084788', class: "pn-profile-modal-profile-details-company-description" }, this.description)), h("div", { key: 'df41da9a2ac011394d7b0658ebb355a7b194dccb', class: "pn-profile-modal-profile-details-list" }, h("div", { key: 'abbc7bc5fe316fc84cb7062fa890d3e771532943', class: "pn-profile-modal-profile-details-list-label" }, this.pleaseSelectText), h("slot", { key: 'd15ab032e105b8222b3b405cd6e664b654bb6517' })))));
    }
};
PnProfileModalProfile.style = PnProfileModalProfileStyle0;

export { PnProfileModalProfile as pn_profile_modal_profile };

//# sourceMappingURL=pn-profile-modal-profile.entry.js.map