import { r as registerInstance, h, H as Host, a as getElement } from './index-Co4V4Zk-.js';

const spwBreadcrumbItemCss = () => `html{line-height:1.3;-webkit-text-size-adjust:100%;}h1,h2,h3,h4,h5,h6,p,ul,li{padding:0;margin:0}ul{list-style:none}:host{box-sizing:border-box;line-height:1.3;-webkit-text-size-adjust:100%;font-size:100%}:host *,:host *::before,:host *::after{box-sizing:inherit;font-family:var(--spw-ds-font-main)}body{margin:0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spw-ds-container-xl:1232px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%;padding-left:16px;padding-right:16px;margin-left:auto;margin-right:auto}@media (min-width: 460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width: 768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width: 1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width: 1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}:host{display:contents}.spw-breadcrumb-item{list-style:none;display:inline}.spw-breadcrumb-item__text{font-weight:700;color:var(--spw-color-themes-grey-grey-900)}:host(.spw-breadcrumb-item--dark) .spw-breadcrumb-item__text{color:var(--spw-ds-white)}.spw-breadcrumb-item spw-link{--spw-link-font-weight:400}:host(.spw-breadcrumb-item--light) .spw-breadcrumb-item spw-link{--spw-link-color:var(--spw-color-themes-grey-grey-900);--spw-link-hover-color:var(--spw-color-themes-grey-grey-900);--spw-link-active-color:var(--spw-color-themes-grey-grey-800)}`;

const SpwBreadcrumbItem = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        /** Permet de définir un lien sur l'élément du breadcrumb */
        this.href = '';
        this.surface = 'light';
    }
    surfaceChanged() {
        this.updateSurfaceClass();
    }
    componentWillLoad() {
        this.getSurfaceFromParent();
    }
    getSurfaceFromParent() {
        let parent = this.el.parentElement;
        while (parent) {
            if (parent.tagName.toLowerCase() === 'spw-breadcrumb') {
                this.surface = parent.getAttribute('surface');
                if (!this.surface) {
                    this.surface = 'light';
                }
                this.updateSurfaceClass();
                break;
            }
            if (parent.shadowRoot) {
                parent = parent.shadowRoot.host;
            }
            else {
                parent = parent.parentElement;
            }
        }
    }
    updateSurfaceClass() {
        this.el.classList.remove('spw-breadcrumb-item--light', 'spw-breadcrumb-item--dark');
        this.el.classList.add(`spw-breadcrumb-item--${this.surface}`);
    }
    render() {
        return (h(Host, { key: '68661d36076f8e2ded2e0d3d438157e4bf5eeba7' }, h("div", { key: '9bbabf1f3d7a3d5655b08670e4f021adc48c50c3', role: "listitem", class: `spw-breadcrumb-item spw-breadcrumb-item--${this.surface}` }, this.href ? (h("spw-link", { href: this.href, surface: this.surface }, h("slot", null))) : (h("span", { class: "spw-breadcrumb-item__text", "aria-current": "page" }, h("slot", null))))));
    }
    get el() { return getElement(this); }
    static get watchers() { return {
        "surface": [{
                "surfaceChanged": 0
            }]
    }; }
};
SpwBreadcrumbItem.style = spwBreadcrumbItemCss();

export { SpwBreadcrumbItem as spw_breadcrumb_item };
