!function(){if(!window.MBEventBus){var n={},e={VERSION_CODE:100,subscribeEvent:function(e,r){if(e&&"string"==typeof e&&"function"==typeof r){n[e]&&n[e].length||window.MBBridge&&window.MBBridge.call("app.event.subscribe",{eventName:e});var t=n[e]||[];n[e]=t;for(var a=0;a<t.length;a++){if((o=t[a])&&o.callback==r)return o.id}var o={id:e+"_"+i(),callback:r};return t.push(o),o.id}},unsubscribeEvent:function e(r,i){if(r&&"string"==typeof r&&n[r]){if(!i)return window.MBBridge&&window.MBBridge.call("app.event.unsubscribe",{eventName:r}).catch(()=>{}),void(n[r]=[]);for(var t=n[r],a=0;a<t.length;a++){var o=t[a];if(o.id==i||o.callback==i){1===t.length&&e(r),t.splice(a,1);break}}}},notifyEvent:function(e,r){var i=n[e];if("function"!=typeof i){if(Array.isArray(i))for(var t=0;t<i.length;t++){var a=i[t];a&&a.callback&&a.callback(r)}}else i(r)},sendEvent:function(n){if(window.MBBridge)return window.MBBridge.call("app.container.sendEvent",n)}};window.MBEventBus=e;try{var r=new CustomEvent("mbEvent-ready",{detail:{ready:"Fulfilled"}});window.dispatchEvent(r)}catch(n){}}function i(){for(var n="_",e=0;e<10;e++)n+=String.fromCharCode(Math.floor(26*Math.random()+"a".charCodeAt(0)));return n}}();
