"use strict";(self.webpackChunk_kb_labs_workflow_entry=self.webpackChunk_kb_labs_workflow_entry||[]).push([["50"],{6026(e,s){var t=Symbol.for("react.transitional.element");function r(e,s,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==s.key&&(o=""+s.key),"key"in s)for(var i in r={},s)"key"!==i&&(r[i]=s[i]);else r=s;return{$$typeof:t,type:e,key:o,ref:void 0!==(s=r.ref)?s:null,props:r}}s.Fragment=Symbol.for("react.fragment"),s.jsx=r,s.jsxs=r},4552(e,s,t){e.exports=t(6026)},4332(e,s,t){t.r(s),t.d(s,{EventBusProvider:()=>u,StudioEventBus:()=>i,eventBus:()=>n,useEventBusContext:()=>h});var r=t(2913),o=t(4552),i=class{subscriptions=new Map;history=[];devToolsObserver;subscribe(e,s,t,r){let o={event:e,handler:s,pluginId:t,pageId:r};return this.subscriptions.has(e)||this.subscriptions.set(e,new Set),this.subscriptions.get(e).add(o),()=>{this.subscriptions.get(e)?.delete(o)}}publish(e,s,t,r){let o={sourcePluginId:t,sourcePageId:r,timestamp:Date.now()},i={event:e,payload:s,meta:o};this.history.push(i),this.history.length>100&&this.history.shift(),this.devToolsObserver?.(i);let n=this.subscriptions.get(e);if(n)for(let t of n)try{t.handler(s,o)}catch(s){console.error(`[StudioEventBus] Handler error for "${e}" in ${t.pluginId}:${t.pageId}:`,s)}}unsubscribeAll(e,s){for(let[,t]of this.subscriptions)for(let r of t)r.pluginId===e&&r.pageId===s&&t.delete(r)}getHistory(){return this.history}setDevToolsObserver(e){this.devToolsObserver=e}clearDevToolsObserver(){this.devToolsObserver=void 0}reset(){this.subscriptions.clear(),this.history=[]}},n=new i,l=(0,r.createContext)(n);function u({children:e,bus:s}){return(0,o.jsx)(l.Provider,{value:s??n,children:e})}function h(){return(0,r.useContext)(l)}}}]);
//# sourceMappingURL=50.js.map