var __extends=this&&this.__extends||function(){var t=function(n,i){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i))t[i]=n[i]};return t(n,i)};return function(n,i){if(typeof i!=="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");t(n,i);function e(){this.constructor=n}n.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)}}();var __awaiter=this&&this.__awaiter||function(t,n,i,e){function r(t){return t instanceof i?t:new i((function(n){n(t)}))}return new(i||(i=Promise))((function(i,u){function s(t){try{f(e.next(t))}catch(t){u(t)}}function o(t){try{f(e["throw"](t))}catch(t){u(t)}}function f(t){t.done?i(t.value):r(t.value).then(s,o)}f((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},e,r,u,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(n){return f([t,n])}}function f(o){if(e)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(i=0)),i)try{if(e=1,r&&(u=o[0]&2?r["return"]:o[0]?r["throw"]||((u=r["return"])&&u.call(r),0):r.next)&&!(u=u.call(r,o[1])).done)return u;if(r=0,u)o=[o[0]&2,u.value];switch(o[0]){case 0:case 1:u=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;r=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(u=i.trys,u=u.length>0&&u[u.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!u||o[1]>u[0]&&o[1]<u[3])){i.label=o[1];break}if(o[0]===6&&i.label<u[1]){i.label=u[1];u=o;break}if(u&&i.label<u[2]){i.label=u[2];i.ops.push(o);break}if(u[2])i.ops.pop();i.trys.pop();continue}o=n.call(t,i)}catch(t){o=[6,t];r=0}finally{e=u=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-a4f1fe2b.system.js","./p-df0014ec.system.js","./p-379464d8.system.js"],(function(t){"use strict";var n,i,e,r,u,s,o;return{setters:[function(t){n=t.L;i=t.a},function(t){e=t.b},function(t){r=t.d;u=t.i;s=t.j;o=t.r}],execute:function(){t("L",a);var f=function(t){__extends(n,t);function n(){var n=t.apply(this,arguments)||this;n.onFocusin=function(t){n.notify({ev:t,isFocusIn:true,isFocusOut:false})};n.onFocusout=function(t){return __awaiter(n,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return[4,r()];case 1:i.sent();if(e.hasDocument&&this.el){n=document.activeElement;if(n&&!u(this.el,n)){this.notify({ev:t,isFocusIn:false,isFocusOut:true})}}return[2]}}))}))};return n}n.prototype.connect=function(n){t.prototype.connect.call(this,n);if(this.el){s(this.el,"focusin",this.onFocusin);s(this.el,"focusout",this.onFocusout)}};n.prototype.disconnect=function(){t.prototype.disconnect.call(this);if(this.el){o(this.el,"focusin",this.onFocusin);o(this.el,"focusout",this.onFocusout)}};return n}(n);var c=function(t){__extends(n,t);function n(){var n=t.call(this,(function(t,n){if(n){if(n.isFocusIn){if(t.hasFocus===false){t.focusInListener(n.ev)}t.hasFocus=true}if(n.isFocusOut){t.focusOutListener(n.ev);t.hasFocus=false}}}))||this;n.listener=new f;return n}n.prototype.attach=function(n){var i=this;t.prototype.attach.call(this,n);this.listener.connect(n.el);this.listener.add((function(n){return t.prototype.notify.call(i,n)}))};n.prototype.detach=function(){t.prototype.detach.call(this);this.listener.disconnect()};return n}(i);function a(){return function(t,n,i){var e=t.connectedCallback,r=t.disconnectedCallback;t.connectedCallback=function(){if(!this._balFocusSubject){this._balFocusSubject=new c;this._balFocusSubject.attach(this)}return e&&e.call(this)};t.disconnectedCallback=function(){if(this._balFocusSubject){this._balFocusSubject.detach();this._balFocusSubject=undefined}return r&&r.call(this)}}}}}}));