"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("./query-assigned-elements-8EurZY45.js"),h=require("./property-DYTC_2-m.js"),r=require("./state-C3HoXfoa.js"),_=require("./query-Dv2F3m_t.js"),g=require("./dialog-DnrVj2jp.js"),e=require("./class-map-DTzB8z-1.js");require("./icon.js");require("./icon-button.js");const p=':host{--mdc-dialog-content-ink-color: var(--cv-theme-on-surface-variant);--mdc-dialog-heading-ink-color: var(--cv-theme-on-surface);--mdc-dialog-min-width: 96vw;--mdc-theme-surface: var(--cv-theme-surface-container-lowest);--mdc-typography-body1-font-family: var( --cv-typography-subtitle1-font-family );--mdc-typography-headline6-font-size: var( --cv-typography-headline6-font-size );--mdc-typography-headline6-font-weight: var( --cv-typography-headline1-font-weight )}:host .mdc-dialog.error .status-dialog__state{background-color:var(--cv-theme-negative-8)}:host .mdc-dialog.error .status-dialog__state cv-icon{color:var(--cv-theme-negative)}:host .mdc-dialog.positive .status-dialog__state{background-color:var(--cv-theme-positive-8)}:host .mdc-dialog.positive .status-dialog__state cv-icon{color:var(--cv-theme-positive)}:host .mdc-dialog.warning .status-dialog__state{background-color:var(--cv-theme-caution-8)}:host .mdc-dialog.warning .status-dialog__state cv-icon{color:var(--cv-theme-caution)}:host .mdc-dialog .mdc-dialog__surface{max-width:calc(100vw - 40px)}:host .mdc-dialog .mdc-dialog__content{padding:0 16px}:host .mdc-dialog .mdc-dialog__content.padding-bottom{padding-bottom:2rem}:host .mdc-dialog__actions{flex-shrink:0;padding:16px}:host .mdc-dialog__content{flex-grow:1}:host .mdc-dialog__title{flex:1;line-height:var(--cv-typography-body1-line-height);margin:0;padding:0 40px 0 0}:host .mdc-dialog__title:before{display:none}:host .mdc-dialog.mdc-dialog--scrollable .mdc-dialog__title,:host .mdc-dialog.mdc-dialog--scrollable .mdc-dialog__actions{border:none}.status-dialog__arrow-icon{margin-top:2px}.status-dialog__arrow-icon.open{transform:rotate(0);transition:transform .25s ease-out}.status-dialog__arrow-icon.close{transform:rotate(180deg);transition:transform .25s ease-in}.status-dialog__container{display:flex}.status-dialog__content{display:flex;flex:1;flex-direction:column}.status-dialog__container,.status-dialog__content{max-height:calc(100% - 32px);overflow-y:auto}.status-dialog__details{display:none}.status-dialog__details.visible{display:block}.status-dialog__heading{--mdc-icon-button-size: 40px;align-items:start;box-sizing:border-box;display:inline-flex;justify-content:space-between;padding:18px 16px;width:100%}.status-dialog__heading.no-heading{justify-content:flex-end}.status-dialog__heading .status-dialog__close-icon{position:absolute;right:8px;top:10px}.status-dialog__state{--mdc-icon-size: 32px;padding:14px 16px 0}.status-dialog__state cv-icon{font-variation-settings:"FILL" 1}.status-dialog__toggle-details{align-items:center;color:var(--cv-theme-primary);cursor:pointer;display:inline-flex;font-size:14px;font-style:normal;font-weight:400;letter-spacing:.25px;line-height:20px;padding:16px 0}@media screen and (min-width: 600px){:host{--mdc-dialog-min-width: 575px}:host .mdc-dialog .mdc-dialog__surface{max-width:575px}}@media screen and (max-width: 480px){:host .status-dialog__container{flex-direction:column}:host .status-dialog__heading .status-dialog__close-icon{top:18px}:host .status-dialog__state{padding:4px}:host .status-dialog__state cv-icon{display:none}:host .mdc-dialog.error .status-dialog__state{background-color:var(--cv-theme-negative)}:host .mdc-dialog.positive .status-dialog__state{background-color:var(--cv-theme-positive)}:host .mdc-dialog.warning .status-dialog__state{background-color:var(--cv-theme-caution)}}';var u=Object.defineProperty,v=Object.getOwnPropertyDescriptor,d=(l,t,a,o)=>{for(var i=o>1?void 0:o?v(t,a):t,n=l.length-1,c;n>=0;n--)(c=l[n])&&(i=(o?c(t,a,i):c(i))||i);return o&&i&&u(t,a,i),i};exports.CovalentStatusDialog=class extends g.CovalentDialog$1{constructor(){super(...arguments),this.state="error",this.expandDetails=!1,this.showDetailsLink=!1}firstUpdated(){if(super.firstUpdated(),this._details){const t=this._details.assignedNodes({flatten:!0});this.showDetailsLink=t.some(a=>a.nodeType===Node.ELEMENT_NODE)}}toggleDetails(){this.expandDetails=!this.expandDetails}_getStatusIcon(){switch(this.state){case"positive":return"check";default:return this.state}}renderDetails(){const t={"status-dialog__details":!0,visible:this.expandDetails},a={open:!this.expandDetails,close:this.expandDetails},o=s.x`<cv-icon
      class="${e.o(a)} status-dialog__arrow-icon"
      >arrow_drop_down</cv-icon
    >`;return s.x`${this.showDetailsLink?s.x`<div>
            <span
              class="status-dialog__toggle-details"
              @click="${this.toggleDetails}"
              >${this.expandDetails?"Hide details":"Show details"} ${o}
            </span>
          </div>`:""}
      <slot
        name="details"
        id="details"
        class="${e.o(t)}"
      ></slot>`}renderHeading(){const t={"status-dialog__heading":!0,"no-heading":!this.heading};let a=s.x``;return this.heading&&(a=s.x`<h2 id="title" class="mdc-dialog__title">
        ${this.heading}
      </h2>`),s.x`<span class="${e.o(t)}">
      ${a}
      <cv-icon-button
        class="status-dialog__close-icon"
        icon="close"
        @click=${this.close}
      ></cv-icon-button>
    </span>`}render(){const t={"mdc-dialog--stacked":this.stacked,error:this.state==="error",positive:this.state==="positive",warning:this.state==="warning"},a=this.renderHeading(),o=this.renderDetails(),i={"mdc-dialog__actions":!this.hideActions},n={"mdc-dialog__content":!0,"padding-bottom":this.hideActions};return s.x` <div
      class="mdc-dialog ${e.o(t)}"
      role="alertdialog"
      aria-modal="true"
      aria-labelledby="title"
      aria-describedby="content"
    >
      <div class="mdc-dialog__container">
        <div class="mdc-dialog__surface">
          <div class="status-dialog__container">
            <div class="status-dialog__state">
              <cv-icon>${this._getStatusIcon()}<cv-icon>
            </div>
            <div class="status-dialog__content">
              ${a}
              <div id="content" class="${e.o(n)}">
                <slot id="contentSlot"></slot>
                ${o}
              </div>
              <footer id="actions" class="${e.o(i)}">
                <span>
                  <slot name="secondaryAction"></slot>
                </span>
                <span>
                  <slot name="primaryAction"></slot>
                </span>
              </footer>
            </div>
          </div>
        </div>
      </div>
      <div class="mdc-dialog__scrim"></div>
    </div>`}};exports.CovalentStatusDialog.styles=[g.styles,s.i`
      ${s.r(p)}
    `];d([_.i("#details")],exports.CovalentStatusDialog.prototype,"_details",2);d([h.n({type:String})],exports.CovalentStatusDialog.prototype,"state",2);d([r.t()],exports.CovalentStatusDialog.prototype,"expandDetails",2);d([r.t()],exports.CovalentStatusDialog.prototype,"showDetailsLink",2);exports.CovalentStatusDialog=d([s.e("cv-status-dialog")],exports.CovalentStatusDialog);const m=exports.CovalentStatusDialog;exports.default=m;
