"use strict";const index=require("./index-8acc3c89.js");var createDeferredPromise=function(){var e;return{promise:new Promise((function(n){e=n})),resolve:e}},openWormhole=function(e,n,o){void 0===o&&(o=!0);var r="Function"===e.constructor.name?e.prototype:e,t=r.componentWillLoad;r.componentWillLoad=function(){var e=this,r=index.getElement(this),i=createDeferredPromise(),c=new CustomEvent("openWormhole",{bubbles:!0,composed:!0,detail:{consumer:this,fields:n,updater:function(n,o){(n in r?r:e)[n]=o},onOpen:i}});r.dispatchEvent(c);var s=function(){if(t)return t.call(e)};return o?i.promise.then((function(){return s()})):s()}};exports.openWormhole=openWormhole;