/*!
 * EdGEL: The University of Edinburgh Design System v5.1.0-rc.1 (https://design-system.ed.ac.uk/)
 * Copyright 2014-2023 The University of Edinburgh
 *
 * Bootstrap  v5.3.2 (https://getbootstrap.com/)
 * Copyright 2011-2023 The Bootstrap Authors
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 */
import{_ as e,x as t,c as i}from"./base-C0zcJIOm.js";import{o as r}from"./if-defined-LrWhF3Th.js";import{E as s}from"./menu-0v0uozoL.js";import"./collapse-c6oANqbB.js";import"./collapse-Zfan_b1M.js";import"./selector-engine-L8thDpCF.js";import"./edgel-icon.js";let n,c,a,l,o,u,d,m,b,h=e=>e;class p extends s{_validateMenu(){return this.menu&&this.menu.breadcrumb&&Array.isArray(this.menu.breadcrumb)||(this.menu={breadcrumb:[]}),!0}connectedCallback(){super.connectedCallback(),document.addEventListener("updated.edgel.menu",this._setMenuHtml)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("updated.edgel.menu",this._setMenuHtml)}_processMenu(){this._breadcrumb=this.menu.breadcrumb.slice(0),this._breadcrumb.length&&(this._breadcrumb.at(-1)._active=!0)}_itemLink({url:e,text:i,locked:s,_active:l}){const o=["breadcrumb-item"];l&&o.push("active");const u=this._lockSuffix(s);let d=t(n||(n=h`${0} ${0}`),i,u);return l||(d=t(c||(c=h`<a href=${0}>${0}</a>`),e,d)),t(a||(a=h`
      <li class=${0} aria-current=${0}>
        ${0}
      </li>
    `),o.join(" "),r(l?"page":void 0),d)}_renderMenu(){if(!this._breadcrumb.length)return null;const e=[];for(const t of this._breadcrumb)e.push(this._itemLink(t));return t(l||(l=h`<ol class="breadcrumb">${0}</ol>`),e)}render(){if(this.collapseDisabled=!0,!this.menuHtml&&!this.contactLink)return;let e=t(o||(o=h`<div class="col"></div>`));this.menuHtml&&(e=t(u||(u=h`
        <div class="col">
          <nav aria-label="breadcrumb">
            ${0}
          </nav>
        </div>
      `),this.menuHtml));let i=t(d||(d=h``));return this.contactLink&&this.contactLink.trim()&&(i=t(m||(m=h`
        <div class="col-md-auto">
          <a href=${0} class="btn btn-contact">
            Contact us
          </a>
        </div>
      `),this.contactLink.trim())),t(b||(b=h`
      <div class="row">
        ${0}
        ${0}
      </div>
    `),e,i)}}e(p,"properties",{contactLink:{type:String,attribute:"contact-link"}}),i("edgel-locator",p);
