var __awaiter=this&&this.__awaiter||function(n,t,r,e){function i(n){return n instanceof r?n:new r((function(t){t(n)}))}return new(r||(r=Promise))((function(r,a){function u(n){try{c(e.next(n))}catch(n){a(n)}}function o(n){try{c(e["throw"](n))}catch(n){a(n)}}function c(n){n.done?r(n.value):i(n.value).then(u,o)}c((e=e.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},e,i,a,u;return u={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function o(n){return function(t){return c([n,t])}}function c(o){if(e)throw new TypeError("Generator is already executing.");while(u&&(u=0,o[0]&&(r=0)),r)try{if(e=1,i&&(a=o[0]&2?i["return"]:o[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;if(i=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;i=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){r.label=o[1];break}if(o[0]===6&&r.label<a[1]){r.label=a[1];a=o;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(o);break}if(a[2])r.ops.pop();r.trys.pop();continue}o=t.call(n,r)}catch(n){o=[6,n];i=0}finally{e=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-6722281a.system.js","./p-4d03a77e.system.js"],(function(n){"use strict";var t,r,e;return{setters:[function(n){t=n.b},function(n){r=n.j;e=n.k}],execute:function(){var i=this;var a=0;var u="backdrop";var o=n("p",(function(n){if(t.hasDocument){s(document)}var r=a++;n.overlayIndex=r;if(!n.el.hasAttribute("id")){n.el.id="bal-overlay-".concat(r)}}));var c=n("g",(function(n,t){if(t===undefined){t="bal-modal,bal-snackbar,bal-toast"}return Array.from(n.querySelectorAll(t)).filter((function(n){return n.overlayIndex>0}))}));var f=n("a",(function(n,t,r){var e=c(n,t);return r===undefined?e[e.length-1]:e.find((function(n){return n.id===r}))}));var s=function(n){if(a===0){a=1;n.addEventListener("keyup",(function(t){if(t.key==="Escape"){var r=f(n);if(r){r.dismiss(undefined,u)}}}))}};var v=n("d",(function(n,t,r,e){return __awaiter(i,void 0,void 0,(function(){var i;return __generator(this,(function(a){switch(a.label){case 0:if(!n.presented){return[2,false]}a.label=1;case 1:a.trys.push([1,3,,4]);n.el.style.setProperty("pointer-events","none");n.willDismiss.emit({data:t,role:r});return[4,e()];case 2:a.sent();n.presented=false;n.didDismiss.emit({data:t,role:r});return[3,4];case 3:i=a.sent();n.presented=false;console.error(i);return[3,4];case 4:n.el.remove();return[2,true]}}))}))}));var l=n("e",(function(n,t){var r;var e=new Promise((function(n){return r=n}));d(n,t,(function(n){r(n.detail)}));return e}));var d=function(n,t,i){var a=function(r){e(n,t,a);i(r)};r(n,t,a)}}}}));