1import{a as w}from"./chunk-FLSSQY4S.js";import{a as x}from"./chunk-3ZXF4WD3.js";import{A as _,H as p,I as f,J as a,M as i,f as m,k as v,m as d}from"./chunk-VM53P45Q.js";import{c as b,g as t,n as h}from"./chunk-WQ3TMWBQ.js";import{d as e}from"./chunk-SYELWAOX.js";var g=`.pf-c-alert-group { 2 --pf-c-alert-group__item--MarginTop: var(--pf-global--spacer--sm); 3 --pf-c-alert-group--m-toast--Top: var(--pf-global--spacer--2xl); 4 --pf-c-alert-group--m-toast--Right: var(--pf-global--spacer--xl); 5 --pf-c-alert-group--m-toast--MaxWidth: 37.5rem; 6 --pf-c-alert-group--m-toast--ZIndex: var(--pf-global--ZIndex--2xl); 7 --pf-c-alert-group__overflow-button--BorderWidth: 0; 8 --pf-c-alert-group__overflow-button--PaddingTop: var(--pf-global--spacer--lg); 9 --pf-c-alert-group__overflow-button--PaddingRight: var(--pf-global--spacer--md); 10 --pf-c-alert-group__overflow-button--PaddingBottom: var(--pf-global--spacer--lg); 11 --pf-c-alert-group__overflow-button--PaddingLeft: var(--pf-global--spacer--md); 12 --pf-c-alert-group__overflow-button--Color: var(--pf-global--link--Color); 13 --pf-c-alert-group__overflow-button--BoxShadow: var(--pf-global--BoxShadow--lg); 14 --pf-c-alert-group__overflow-button--BackgroundColor: var(--pf-global--BackgroundColor--100); 15 --pf-c-alert-group__overflow-button--hover--Color: var(--pf-global--link--Color--hover); 16 --pf-c-alert-group__overflow-button--hover--BoxShadow: var(--pf-global--BoxShadow--lg), var(--pf-global--BoxShadow--lg-bottom); 17 --pf-c-alert-group__overflow-button--focus--Color: var(--pf-global--link--Color--hover); 18 --pf-c-alert-group__overflow-button--focus--BoxShadow: var(--pf-global--BoxShadow--lg), var(--pf-global--BoxShadow--lg-bottom); 19 --pf-c-alert-group__overflow-button--active--Color: var(--pf-global--link--Color--hover); 20 --pf-c-alert-group__overflow-button--active--BoxShadow: var(--pf-global--BoxShadow--lg), var(--pf-global--BoxShadow--lg-bottom); 21} 22.pf-c-alert-group > * + * { 23 margin-top: var(--pf-c-alert-group__item--MarginTop); 24} 25.pf-c-alert-group.pf-m-toast { 26 position: fixed; 27 top: var(--pf-c-alert-group--m-toast--Top); 28 right: var(--pf-c-alert-group--m-toast--Right); 29 z-index: var(--pf-c-alert-group--m-toast--ZIndex); 30 width: calc(100% - var(--pf-c-alert-group--m-toast--Right) * 2); 31 max-width: var(--pf-c-alert-group--m-toast--MaxWidth); 32} 33 34.pf-c-alert-group__overflow-button { 35 position: relative; 36 width: 100%; 37 padding: var(--pf-c-alert-group__overflow-button--PaddingTop) var(--pf-c-alert-group__overflow-button--PaddingRight) var(--pf-c-alert-group__overflow-button--PaddingBottom) var(--pf-c-alert-group__overflow-button--PaddingLeft); 38 color: var(--pf-c-alert-group__overflow-button--Color); 39 background-color: var(--pf-c-alert-group__overflow-button--BackgroundColor); 40 border-width: var(--pf-c-alert-group__overflow-button--BorderWidth); 41 box-shadow: var(--pf-c-alert-group__overflow-button--BoxShadow); 42} 43.pf-c-alert-group__overflow-button:hover { 44 --pf-c-alert-group__overflow-button--Color: var(--pf-c-alert-group__overflow-button--hover--Color); 45 --pf-c-alert-group__overflow-button--BoxShadow: var(--pf-c-alert-group__overflow-button--hover--BoxShadow); 46} 47.pf-c-alert-group__overflow-button:focus { 48 --pf-c-alert-group__overflow-button--Color: var(--pf-c-alert-group__overflow-button--focus--Color); 49 --pf-c-alert-group__overflow-button--BoxShadow: var(--pf-c-alert-group__overflow-button--focus--BoxShadow); 50} 51.pf-c-alert-group__overflow-button:active { 52 --pf-c-alert-group__overflow-button--Color: var(--pf-c-alert-group__overflow-button--active--Color); 53 --pf-c-alert-group__overflow-button--BoxShadow: var(--pf-c-alert-group__overflow-button--active--BoxShadow); 54}`;var E={error:"fas fa-exclamation-circle",warning:"fas fa-exclamation-triangle",success:"fas fa-check-circle",info:"fas fa-info"},r=class extends p{constructor(){super(...arguments);this.removeAfter=8e3}static get styles(){return[i,x,w,g]}firstUpdated(){setTimeout(()=>{this.message&&this.onRemove&&this.onRemove(this.message)},this.removeAfter)}render(){return t`<li class="pf-c-alert-group__item"> 55 <div 56 class="pf-c-alert pf-m-${this.message?.level} ${this.message?.level==="error"?"pf-m-danger":""}" 57 > 58 <div class="pf-c-alert__icon"> 59 <i class="${this.message?E[this.message.level]:""}"></i> 60 </div> 61 <p class="pf-c-alert__title">${this.message?.message}</p> 62 ${this.message?.description&&t`<div class="pf-c-alert__description"> 63 <p>${this.message.description}</p> 64 </div>`} 65 <div class="pf-c-alert__action"> 66 <button 67 class="pf-c-button pf-m-plain" 68 type="button" 69 @click=${()=>{this.message&&this.onRemove&&this.onRemove(this.message)}} 70 > 71 <i class="fas fa-times" aria-hidden="true"></i> 72 </button> 73 </div> 74 </div> 75 </li>`}};e([a({attribute:!1})],r.prototype,"message",2),e([a({type:Number})],r.prototype,"removeAfter",2),e([a({attribute:!1})],r.prototype,"onRemove",2),r=e([f("ak-message")],r);function J(l,n=!1){let o=document.querySelector("ak-message-container");if(!o)throw new _("failed to find message container");l.message.trim()===""&&(l.message=h("Error")),o.addMessage(l,n),o.requestUpdate()}var s=class extends p{constructor(){super();this.messages=[];window.addEventListener(m,o=>{o.detail.message_type===d&&this.addMessage(o.detail)}),window.addEventListener(v,o=>{this.addMessage(o.detail)})}static get styles(){return[i,g,b` 76 /* Fix spacing between messages */ 77 ak-message { 78 display: block; 79 } 80 `]}addMessage(o,u=!1){u&&this.messages.filter(S=>S.message==o.message).length>0||(this.messages.push(o),this.requestUpdate())}render(){return t`<ul class="pf-c-alert-group pf-m-toast"> 81 ${this.messages.map(o=>t`<ak-message 82 .message=${o} 83 .onRemove=${u=>{this.messages=this.messages.filter(c=>c!==u),this.requestUpdate()}} 84 > 85 </ak-message>`)} 86 </ul>`}};e([a({attribute:!1})],s.prototype,"messages",2),s=e([f("ak-message-container")],s);export{J as a}; 87//# sourceMappingURL=chunk-OFOLEQRI.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.