import{_ as b,o as t,c as s,d as _,v as w,F as m,r as y,a as i,t as x,i as u,f as v,az as f,k as I,L as S,aA as $,p as T,m as L,b as O}from"./entry.DPwc-EV0.js";import{u as B,_ as M}from"./AdminButtonElement-Ob1JkOmC.mjs";const E={props:{item:{type:Object,required:!0},options:{type:Array},width:{type:Number,default:15}},data(){return{open:!1}},mounted(){window.addEventListener("click",e=>{this.$el.contains(e.target)||(this.open=!1)})},methods:{toggleDots(){this.open=!this.open},handleOptionClick(e){e.action(this.item),this.open=!1}}},D={class:"dots"},j=["onClick"];function z(e,l,o,h,a,d){const r=v;return t(),s("div",D,[_(r,{icon:"mdi:dots-vertical",width:o.width,onClick:d.toggleDots},null,8,["width","onClick"]),a.open?(t(),s("div",{key:0,class:w(["flyout",a.open?"open":"closed"])},[(t(!0),s(m,null,y(o.options,(n,p)=>(t(),s("div",{key:p,class:"label"},[i("div",{onClick:g=>d.handleOptionClick(n)},x(n.label),9,j)]))),128))],2)):u("",!0)])}const N=b(E,[["render",z],["__scopeId","data-v-c0f8c2a4"]]),U={data(){return{cache:!0,cacheBypass:f("cache-bypass")}},mounted(){var e;this.cache=((e=f("cache-bypass"))==null?void 0:e.value)!==!0},methods:{cacheToggle(){this.cache?this.cacheBypass=!0:this.cacheBypass=!1}}},V=e=>(T("data-v-640d8a96"),e=e(),L(),e),H={class:"cache-block"},q={class:"switch"},F=V(()=>i("span",{class:"slider round"},null,-1));function P(e,l,o,h,a,d){return t(),s("div",H,[I(" Cache: "),i("label",q,[S(i("input",{"onUpdate:modelValue":l[0]||(l[0]=r=>a.cache=r),type:"checkbox",onClick:l[1]||(l[1]=(...r)=>d.cacheToggle&&d.cacheToggle(...r))},null,512),[[$,a.cache]]),F])])}const W=b(U,[["render",P],["__scopeId","data-v-640d8a96"]]),G={data(){return{filteredItems:[]}},async created(){const e=await this.$gql.queryStream("getSystemAlertStream",{isActive:!0});if(!e.error){const l=e.data.items,o=[];l.forEach(h=>{f(`dismissAlert${h.id}`).value||o.push(h)}),this.filteredItems=o}},methods:{dismissAlert(e,l){e.isClosing=!0,setTimeout(()=>{this.filteredItems.splice(l,1)},500),f(`dismissAlert${e.id}`,{maxAge:2592e3,path:"/"}).value=`Dismiss Alert: ${e.id}`}}},J={class:"ebm-web-system-alert"},K={class:"alert-body"},Q={class:"alert-title"},R=["innerHTML"],X={key:0,class:"expand",type:"checkbox"};function Y(e,l,o,h,a,d){const r=v;return t(),s("div",J,[(t(!0),s(m,null,y(a.filteredItems,(n,p)=>(t(),s("div",{key:n.id,class:"alert-item"},[i("div",{class:w(["alert-item-content",n.type.toLowerCase(),n.isClosing?"closing":""])},[_(r,{class:"alert-icon",icon:n.type==="Error"||n.type==="Warning"?"mdi:alert":"mdi-alert-circle",width:20},null,8,["icon"]),i("div",K,[i("div",Q,[i("strong",null,x(n.title),1)]),i("div",{class:"alert-description",innerHTML:n.description},null,8,R),n.description.length>220?(t(),s("input",X)):u("",!0)]),_(r,{icon:"mdi:close",width:15,class:"close-alert",onClick:g=>d.dismissAlert(n,p)},null,8,["onClick"])],2)]))),128))])}const Z=b(G,[["render",Y]]),ee={props:{actions:{type:Object},rightActions:{type:Object},moreMenuOptions:{type:Array},enableCacheSwitch:{type:Boolean,default:!1},titleIcon:{type:String},title:{type:String}},data(){return{adminStyles:B(),cmsUser:this.$cmsUser.getUserInfo()}}},te={class:"page-title"},se={class:"left"},oe={class:"title-text-wrapper"},ne={key:0},ce=["innerHTML"],ie={class:"title-actions"},le={class:"title-actions"},ae={class:"right"},re={key:0,class:"more-menu"},de={key:1,class:"cache-toggle"};function _e(e,l,o,h,a,d){var k,C;const r=v,n=M,p=N,g=W,A=Z;return t(),s("div",te,[i("div",se,[i("div",oe,[o.titleIcon?(t(),s("div",ne,[_(r,{icon:o.titleIcon,"icon-color":"white",width:28},null,8,["icon"])])):u("",!0),o.title?(t(),s("div",{key:1,style:{color:"white"},class:"title-text",innerHTML:o.title},null,8,ce)):u("",!0)]),i("div",ie,[(t(!0),s(m,null,y(o.actions,c=>(t(),s("span",{key:c.method,style:{marginLeft:"5px"}},[_(n,{type:"button",icon:c.icon,label:c.label,size:"small",mode:c.mode,disabled:c.disabled,onClick:c.click},null,8,["icon","label","mode","disabled","onClick"])]))),128))])]),i("div",le,[(t(!0),s(m,null,y(o.rightActions,c=>(t(),s("span",{key:c.method,style:{marginLeft:"5px"}},[_(n,{type:"button",icon:c.icon,label:c.label,size:"medium",mode:c.mode,color:c.color??a.adminStyles.primaryColor,disabled:c.disabled,onClick:c.click},null,8,["icon","label","mode","color","disabled","onClick"])]))),128))]),i("div",ae,[(k=o.moreMenuOptions)!=null&&k.length?(t(),s("div",re,[_(p,{item:{},options:o.moreMenuOptions,width:20},null,8,["options"])])):u("",!0),o.enableCacheSwitch?(t(),s("div",de,[(C=a.cmsUser)!=null&&C.username?(t(),O(g,{key:0})):u("",!0)])):u("",!0)]),_(A)])}const ue=b(ee,[["render",_e],["__scopeId","data-v-37f28d77"]]),me=Object.freeze(Object.defineProperty({__proto__:null,default:ue},Symbol.toStringTag,{value:"Module"}));export{me as A,ue as _,N as a};