define("retentioneering-event-bridge",["@jupyter-widgets/base"],e=>(()=>{"use strict";var t={55:t=>{t.exports=e}},r={};function i(e){var d=r[e];if(void 0!==d)return d.exports;var s=r[e]={exports:{}};return t[e](s,s.exports,i),s.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};i.r(d),i.d(d,{EventBridgeModel:()=>l,EventBridgeView:()=>a,default:()=>u});var s=i(55);const o="retentioneering-event-bridge",n="^0.0.1";class l extends s.DOMWidgetModel{defaults(){return{...super.defaults(),_model_name:"EventBridgeModel",_view_name:"EventBridgeView",_model_module:o,_view_module:o,_model_module_version:n,_view_module_version:n,bridge_id:""}}}class a extends s.DOMWidgetView{constructor(e){super(e),this.listeners=new Set,this.id=""}render(){var e,t,r;this.id=this.model.model_id||(null===(t=(e=this.model).get)||void 0===t?void 0:t.call(e,"bridge_id"))||"";const i=globalThis;i.IpyBridge=null!==(r=i.IpyBridge)&&void 0!==r?r:{},i.IpyBridge[this.id]={send:e=>this.send(e),subscribe:e=>(this.listeners.add(e),()=>this.listeners.delete(e))},this.model.on("msg:custom",e=>{for(const t of Array.from(this.listeners))try{t(e)}catch(e){console.error(e)}}),this.listenTo(this.model,"destroy",()=>{this.listeners.clear(),i.IpyBridge&&i.IpyBridge[this.id]&&delete i.IpyBridge[this.id]}),this.el.style.display="none"}}const u={EventBridgeModel:l,EventBridgeView:a};return d})());