text: /**
   * Copyright 2019 The Pennsylvania State University
   * @license Apache-2.0, see License.md for full text.
   */
  import{LitElement as e,html as t,css as i}from"../../../../../lit/index.js";import{store as r}from"../../core/haxcms-site-store.js";import"../../../../simple-icon/lib/simple-icon-lite.js";import"../../../../simple-icon/lib/simple-icons.js";import{autorun as s,toJS as o}from"../../../../../mobx/dist/mobx.esm.js";class SiteBreadcrumb extends e{static get styles(){return[i`
          :host {
            display: block;
            font-size: var(--site-breadcrumb-font-size, 16px);
            color: var(--site-breadcrumb-color, #383f45);
          }
          a {
            display: inline-flex;
            font-size: var(--site-breadcrumb-font-size, 16px);
            color: inherit;
            display: inline-flex;
            padding: 0 8px 0 0;
            vertical-align: text-top;
            text-decoration: var(--site-breadcrumb-text-decoration, underline);
          }
          button {
            margin: 0;
            padding: 0;
            font-size: var(--site-breadcrumb-font-size, 16px);
            font-family: inherit;
            min-width: unset;
            display: inline-flex;
            text-transform: unset;
            background-color: transparent;
            border: none;
            letter-spacing: inherit;
            cursor: pointer;
            color: inherit;
          }
          a:hover,
          a:focus,
          a:active,
          button:hover,
          button:focus,
          button:active {
            background-color: var(--site-breadcrumb-hover-bg, transparent);
            color: var(--site-breadcrumb-hover-color, #222222);
          }
          span {
            margin: 0;
            font-size: var(--site-breadcrumb-font-size, 16px);
            padding: 0 8px 0 0;
            height: 24px;
            display: inline-flex;
          }
          simple-icon-lite {
            display: inline-flex;
            --simple-icon-height: 24px;
            --simple-icon-width: 24px;
            padding: 0 8px 0 0;
            color: inherit;
          }
        `]}static get tag(){return"site-breadcrumb"}constructor(){super(),this.__disposer=[]}render(){return t`
        <div
          id="space"
          itemscope
          itemtype="http://data-vocabulary.org/Breadcrumb"
        ></div>
      `}firstUpdated(e){super.firstUpdated&&super.firstUpdated(e),s((e=>{this.manifest=o(r.routerManifest),this.__disposer.push(e)})),s((e=>{this.editMode=o(r.editMode),this.__disposer.push(e)})),s((e=>{this._activeItemChanged(o(r.activeItem)),this.__disposer.push(e)}))}_activeItemChanged(e){const t=e;if(t&&this.shadowRoot&&this.shadowRoot.querySelector("#space")){for(;null!==this.shadowRoot.querySelector("#space").firstChild;)this.shadowRoot.querySelector("#space").removeChild(this.shadowRoot.querySelector("#space").firstChild);var i=[{title:t.title,slug:null}];let e=t;for(;e&&null!=e.parent;)e=this.manifest.items.find((t=>t.id==e.parent)),e&&i.unshift({title:e.title,slug:e.slug});for(var r in i){let e=document.createElement("simple-icon-lite");if(e.icon="icons:chevron-right",null!=i[r].slug){let t=document.createElement("button");if(t.innerText=i[r].title,t.noink=!0,this.editMode)t.setAttribute("disabled","disabled"),this.shadowRoot.querySelector("#space").appendChild(t);else{let e=document.createElement("a");e.setAttribute("href",i[r].slug),e.setAttribute("tabindex","-1"),e.setAttribute("itemprop","url"),e.appendChild(t),this.shadowRoot.querySelector("#space").appendChild(e)}this.shadowRoot.querySelector("#space").appendChild(e)}else{let e=document.createElement("span");e.innerText=i[r].title,this.shadowRoot.querySelector("#space").appendChild(e)}}}}disconnectedCallback(){for(var e in this.__disposer)this.__disposer[e].dispose();super.disconnectedCallback()}}window.customElements.define(SiteBreadcrumb.tag,SiteBreadcrumb);export{SiteBreadcrumb};