import{I as e}from"./p-24d800d8.js";import{g as t}from"./p-8b5d3a52.js";import{g as o,D as i}from"./p-2ade684f.js";import"./p-dcc98162.js";import{I as a}from"./p-c45f0189.js";import{I as c,c as s}from"./p-3a41fc0a.js";import{c as r}from"./p-9ec80349.js";import{P as l}from"./p-cec9d403.js";import"./p-262ec334.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-b75ee3ba.js";const n=[{payloadKey:"IS_OPEN_METHOD_CALLED",payloadDescription:"Indicate if the method open of public API VegaNotifyController is called",canAccept:(e,t)=>"VegaNotifyController"===e&&"open"===t,payloadValue:()=>!0},{payloadKey:"IS_CLOSE_METHOD_CALLED",payloadDescription:"Indicate if the method close of public API VegaNotifyController is called",canAccept:(e,t)=>"VegaNotifyController"===e&&"close"===t,payloadValue:()=>!0},{payloadKey:"IS_CLOSEALL_METHOD_CALLED",payloadDescription:"Indicate if the method closeAll of public API VegaNotifyController is called",canAccept:(e,t)=>"VegaNotifyController"===e&&"closeAll"===t,payloadValue:()=>!0}];var p=function(e,t,o,i){var a,c=arguments.length,s=c<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var r=e.length-1;r>=0;r--)(a=e[r])&&(s=(c<3?a(s):c>3?a(t,o,s):a(t,o))||s);return c>3&&s&&Object.defineProperty(t,o,s),s};class d{constructor(){this.resizeObserverSlimmer=r(d,l,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"}],[{callback:t=>{var o;!(t[0].contentRect.height>0)&&(null===(o=this.container)||void 0===o?void 0:o.classList.contains("hydrated"))&&(e.removeZIndex(this.container,"top"),this.container.remove(),this.container=null)},target:()=>this.container}]),this.vegaPublicAPIRuntimeMetricsSlimmer=s(d,["open","close","closeAll"],n)}async open(e){const t=this.createPageNotification(e);return this.getContainer().append(t),t.id}async closeAll(){this.container&&Array.from(this.container.children).forEach((e=>{e.close()}))}async close(e){await document.getElementById(e).close()}connectResizeObserver(){}createPageNotification(e){const a=document.createElement("vega-page-notification");return Object.keys(e).forEach((t=>{void 0!==e[t]&&(a[t]=e[t])})),a.style.marginBottom=o()===i.MOBILE?"12px":"16px",a.id=`vega-page-notification-${t()}`,a}getContainer(){return this.container||(this.container=document.createElement("vega-page-notification-list"),e.setZIndex(this.container,"top"),o()===i.MOBILE?this.container.classList.add("vega-page-notification-list-bottom"):this.container.classList.add("vega-page-notification-list-topRight"),document.body.append(this.container),this.connectResizeObserver()),this.container}}p([a()],d.prototype,"resizeObserverSlimmer",void 0),p([c()],d.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const f=new d;export{f as VegaNotify}