New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@remixproject/engine

Package Overview
Dependencies
Maintainers
3
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remixproject/engine - npm Package Compare versions

Comparing version 0.1.2-5 to 0.1.2-6

dist/examples/engine/remix-plugin-engine.d.ts

2

dist/index.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.pluginEngine=t():e.pluginEngine=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function u(e){try{a(r.throw(e))}catch(e){o(e)}}function a(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e){this.profile=e,this.requestQueue=[]}return Object.defineProperty(e.prototype,"name",{get:function(){return this.profile.name},enumerable:!0,configurable:!0}),e.prototype.activate=function(){this.onActivation&&this.onActivation()},e.prototype.deactivate=function(){this.onDeactivation&&this.onDeactivation()},e.prototype.callPluginMethod=function(e,t){if(!(e in this))throw new Error("Method "+e+" is not implemented by "+this.profile.name);return this[e].apply(this,t)},e.prototype.addRequest=function(e,t,n){var o=this;return new Promise(function(s,u){o.profile.methods&&o.profile.methods.includes(t)||u(new Error("Method "+t+" is not exposed by "+o.profile.name)),o.requestQueue.push(function(){return r(o,void 0,void 0,function(){var r,o;return i(this,function(i){switch(i.label){case 0:this.currentRequest=e,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.callPluginMethod(t,n)];case 2:return r=i.sent(),s(r),[3,4];case 3:return o=i.sent(),u(o),[3,4];case 4:return delete this.currentRequest,this.requestQueue.shift(),0!==this.requestQueue.length&&this.requestQueue[0](),[2]}})})}),1===o.requestQueue.length&&o.requestQueue[0]()})},e.prototype.on=function(e,t,n){throw new Error('Method "on" from '+this.name+" should be hooked by PluginEngine")},e.prototype.call=function(e,t){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];return r(this,void 0,void 0,function(){return i(this,function(e){throw new Error('Method "call" from '+this.name+" should be hooked by PluginEngine")})})},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];throw new Error('Method "emit" from '+this.name+" should be hooked by PluginEngine")},e}();t.Plugin=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(16))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(17))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(18))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(19))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(20))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(21))},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.isView=function(e){return!!e.location};var s=function(e){function t(t){var n=e.call(this,t)||this;return n.profile=t,n}return i(t,e),t.prototype.activate=function(){this.call(this.profile.location,"addHost",this.name,this.render()),e.prototype.activate.call(this)},t.prototype.deactivate=function(){this.call(this.profile.location,"removeHost",this.name)},t}(o.Plugin);t.ViewPlugin=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(9))},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(10)),r(n(23))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(11))},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function u(e){try{a(r.throw(e))}catch(e){o(e)}}function a(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},u=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(12),c=function(e){function t(t,n){void 0===n&&(n={});var r=e.call(this)||this;return r.plugins={},r.methods={},r.events={},r.listeners={},r.settings=function(e){return o({autoActivate:!1,natives:[]},e)}(n),r.register(Object.keys(t).map(function(e){return t[e]})),r}return i(t,e),Object.defineProperty(t.prototype,"actives",{get:function(){return Object.keys(this.methods)},enumerable:!0,configurable:!0}),t.prototype.isRegistered=function(e){return!!this.plugins[e]},t.prototype.isActive=function(e){return!!this.methods[e]},t.prototype.isNative=function(e){return!e.url||this.settings.natives.includes(e.name)},t.prototype.setSettings=function(e,t){var n;this.settings=o({},this.settings,"string"==typeof e?((n={})[e]=t,n):e)},t.prototype.register=function(e){var t=this;Array.isArray(e)?e.forEach(function(e){return t.registerOne(e)}):this.registerOne(e)},t.prototype.registerOne=function(e){if(!this.plugins[e.name]){if(!e.profile)throw new Error("Plugin "+e.name+" doesn't match the plugin interface");this.plugins[e.name]=e,this.onRegistration&&this.onRegistration(e),e.onRegistation&&e.onRegistation()}},t.prototype.activate=function(e){var t=this;Array.isArray(e)?e.forEach(function(e){return t.activateOne(e)}):this.activateOne(e)},t.prototype.activateOne=function(e){var t=this;if(!this.isActive(e)){if(!this.isRegistered(e))throw new Error("Plugin "+e+" is not register yet. It cannot be activated");var n=this.plugins[e];this.methods[e]={},n.profile.methods&&n.profile.methods.forEach(function(r){t.methods[e][r]=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];return n.addRequest(e,r,t)}}),n.call=i.bind(this),this.events[e]={},n.on=c.bind(this),n.emit=function(t){for(var n=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var o=a.listenEvent(e,t);this.listeners[o]&&(this.listeners[o]||[]).forEach(function(i){var s;if(!n.events[i][o])throw new Error("Plugin "+i+" should be listening on event "+t+" from "+e+". But no callback have been found");(s=n.events[i])[o].apply(s,r)})}.bind(this);var r=Object.keys(this.plugins).reduce(function(e,n){var r;return o({},e,((r={})[n]=t.plugins[n].profile.methods.reduce(function(e,r){var s;return o({},e,((s={})[r]=i.bind(t,n,r),s))},{on:c.bind(t,n)}),r))},{});n.app=Object.freeze(r),this.onActivation&&this.onActivation(n),n.activate()}function i(t,r){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];return s(this,void 0,void 0,function(){var o,s,a,c;return u(this,function(u){switch(u.label){case 0:if(!this.isRegistered(t))throw new Error("Cannot call "+t+" from "+e+", because "+t+" is not registered");return o=this.plugins[t],s=this.isNative(n.profile),!this.settings.permissionHandler||s?[3,2]:o.profile.permission?[4,this.settings.permissionHandler.askPermission(n.profile,o.profile)]:[3,2];case 1:if(!u.sent())throw new Error('Plugin "'+e+'" don\'t have permission to call method "'+r+'" of plugin "'+t+'"');u.label=2;case 2:if(!this.isActive(t)){if(!this.settings.autoActivate||!s)throw new Error("Cannot call "+t+" from "+e+", because "+t+" is not activated yet");this.settings.permissionHandler&&this.settings.permissionHandler.onActivation(n.profile,o.profile),this.activateOne(t)}if(!this.methods[t][r])throw new Error("Cannot call method "+r+" of "+t+" from "+e+", because "+r+" is not exposed");return a={from:e},[2,(c=this.methods[t])[r].apply(c,[a].concat(i))]}})})}function c(t,n,r){var i=a.listenEvent(t,n);this.events[e][i]||(this.events[e][i]=r),this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].includes(e)||this.listeners[i].push(e)}},t.prototype.deactivate=function(e){var t=this;Array.isArray(e)?e.forEach(function(e){return t.deactivateOne(e)}):this.deactivateOne(e)},t.prototype.deactivateOne=function(e){var t=this,n=this.plugins[e],r=function(){throw new Error("Plugin "+e+" is currently deactivated. Activate it to use this method")};n.call=r,n.on=r,n.emit=r,delete this.methods[e],delete this.events[e],Object.keys(this.listeners).forEach(function(n){t.listeners[n].forEach(function(r,i){r===e&&t.listeners[n].splice(i,1)})}),delete n.app,this.onDeactivation&&this.onDeactivation(n),n.deactivate()},t}(function(){});t.PluginEngine=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(13))},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(14)),r(n(15))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callEvent=function(e,t,n){return"["+e+"] "+t+"-"+n},t.listenEvent=function(e,t){return"["+e+"] "+t}},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(1)),r(n(2)),r(n(3)),r(n(4)),r(n(5)),r(n(6)),r(n(22))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compilerProfile={name:"compiler",methods:["compile","getCompilationResult"],events:["compilationFinished"]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.editorProfile={name:"editor",methods:["discardHighlight","highlight"]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filSystemProfile={name:"fs",methods:["getCurrentFile","getFile","getFolder","setFile","switchFile"],events:["currentFileChanged"]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.networkProfile={name:"network",methods:["addNetwork","detectNetwork","getEndpoint","getNetworkProvider","removeNetwork"],events:["providerChanged"]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.udappProfile={name:"udapp",methods:["createVMAccount","getAccounts","sendTransaction"],events:["newTransaction"]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.themeProfile={name:"theme",methods:[],events:["themeChanged"]}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(3),s=n(2),u=n(4),a=n(5),c=n(6);t.remixApi=Object.freeze({solidity:r({},i.compilerProfile,{name:"solidity"}),fileManager:r({},o.filSystemProfile,{name:"fileManager"}),editor:s.editorProfile,network:u.networkProfile,udapp:a.udappProfile,theme:c.themeProfile}),t.remixProfiles=Object.freeze({solidity:r({},i.compilerProfile,{name:"solidity"}),fileManager:r({},o.filSystemProfile,{name:"fileManager"}),editor:s.editorProfile,network:u.networkProfile,udapp:a.udappProfile,theme:c.themeProfile})},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(0)),r(n(24)),r(n(25)),r(n(26)),r(n(7))},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function u(e){try{a(r.throw(e))}catch(e){o(e)}}function a(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=function(e){function t(t){var n=e.call(this,t)||this;return n.profile=t,n.entities={},n}return i(t,e),t.prototype.focus=function(e){return o(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:if(!this.entities[e])throw new Error("Cannot display plugin "+e+'. It\'s not activated yet, or not a "view" plugin.');return this.active=e,[4,this.onFocus(this.entities[e],e)];case 1:return t.sent(),this.emit("viewFocused",e),[2]}})})},t.prototype.addView=function(e,t){return o(this,void 0,void 0,function(){return s(this,function(n){switch(n.label){case 0:return this.entities[e]=t,[4,this.onViewAdded(t,e)];case 1:return n.sent(),this.emit("viewAdded",e),[2]}})})},t.prototype.removeView=function(e){return o(this,void 0,void 0,function(){var t;return s(this,function(n){switch(n.label){case 0:return t=this.entities[e],delete this.entities[e],[4,this.onViewRemoved(t,e)];case 1:return n.sent(),this.emit("viewRemoved",e),[2]}})})},t}(n(0).Plugin);t.HostPlugin=u},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function u(e){try{a(r.throw(e))}catch(e){o(e)}}function a(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,u)}a((r=r.apply(e,t||[])).next())})},u=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(t){var n=e.call(this,t)||this;return n.profile=t,n.listener=["message",function(e){return n.getMessage(e)},!1],n.id=0,n.iframe=document.createElement("iframe"),n.pendingRequest={},n}return i(t,e),t.prototype.deactivate=function(){this.iframe.remove(),window.removeEventListener.apply(window,this.listener),e.prototype.deactivate.call(this)},t.prototype.callPluginMethod=function(e,t){var n=this,r=this.id++,i=this.currentRequest,o=this.name;return this.postMessage({id:r,action:"request",key:e,payload:t,requestInfo:i,name:o}),new Promise(function(e,t){n.pendingRequest[r]=function(n,r){return r?t(r):e(n)}})},t.prototype.getMessage=function(e){return s(this,void 0,void 0,function(){var t,n,r,i,s,a,c,l,f=this;return u(this,function(u){switch(u.label){case 0:if(e.origin!==this.origin)return[2];switch((t=e.data).action){case"listen":return[3,1];case"notification":return[3,2];case"request":return[3,3];case"response":return[3,8]}return[3,9];case 1:return n=t.name,r=t.key,this.on(n,r,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return f.postMessage({action:"notification",name:n,key:r,payload:e})}),[3,10];case 2:return t.payload?(this.emit.apply(this,[t.key].concat(t.payload)),[3,10]):[3,10];case 3:i="response",u.label=4;case 4:return u.trys.push([4,6,,7]),[4,this.call(t.name,t.key,t.payload)];case 5:return c=u.sent(),l=void 0,this.postMessage(o({},t,{action:i,payload:c,error:l})),[3,7];case 6:return s=u.sent(),c=void 0,l=s.message,this.postMessage(o({},t,{action:i,payload:c,error:l})),[3,7];case 7:return[3,10];case 8:return a=t.id,c=t.payload,l=t.error,this.pendingRequest[a](c,l),delete this.pendingRequest[a],[3,10];case 9:throw new Error("Message should be a notification, request or response");case 10:return[2]}})})},t.prototype.postMessage=function(e){if(!this.source)throw new Error("No window attached to Iframe yet");this.source.postMessage(e,this.origin)},t.prototype.render=function(){var e=this;if(this.iframe.contentWindow)throw new Error(this.name+" plugin is already rendered");return this.iframe.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),this.iframe.setAttribute("seamless","true"),this.iframe.src=this.profile.url,this.iframe.onload=function(){if(!e.iframe.contentWindow)throw new Error(e.name+" plugin is cannot find url "+e.profile.url);window.addEventListener.apply(window,e.listener),e.origin=new URL(e.iframe.src).origin,e.source=e.iframe.contentWindow,e.postMessage({action:"request",name:e.name,key:"handshake"})},this.iframe},t}(n(7).ViewPlugin);t.IframePlugin=a},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,n){var r=e.call(this,n)||this;return r.library=t,r.profile=n,n.methods.forEach(function(e){if(!t[e])throw new Error("Method "+e+" is exposed by LibraryPlugin "+n.name+". But library doesn't expose this method")}),r}return i(t,e),t.prototype.activate=function(){var t=this;if(e.prototype.activate.call(this),this.profile.notifications){if(!this.library.events||!this.library.events.emit)throw new Error("Library of plugin "+this.name+" should listen on notifications.\n But doesn't expose the right interface (library.events.emit)");Object.keys(this.profile.notifications).forEach(function(e){t.profile.notifications[e].forEach(function(n){t.on(e,n,function(r){var i;return(i=t.library.events).emit.apply(i,["["+e+"] "+n].concat(r))})})})}if(this.profile.events){if(!this.library.events||!this.library.events.emit)throw new Error("Library of plugin "+this.name+" should emit events but doesn't expose the right interface (library.events.emit)");this.profile.events.forEach(function(e){t.library.events.on(e,function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.emit.apply(t,[e].concat(n))})})}},t.prototype.callPluginMethod=function(e,t){var n;if(!this.library[e])throw new Error("LibraryPlugin "+this.name+" doesn't expose method "+e);return(n=this.library)[e].apply(n,t)},t}(n(0).Plugin);t.LibraryPlugin=o}])}])}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.pluginEngine=t():e.pluginEngine=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e){this.profile=e,this.requestQueue=[]}return Object.defineProperty(e.prototype,"name",{get:function(){return this.profile.name},enumerable:!0,configurable:!0}),e.prototype.activate=function(){this.onActivation&&this.onActivation()},e.prototype.deactivate=function(){this.onDeactivation&&this.onDeactivation()},e.prototype.callPluginMethod=function(e,t){if(!(e in this))throw new Error("Method "+e+" is not implemented by "+this.profile.name);return this[e].apply(this,t)},e.prototype.addRequest=function(e,t,n){var o=this;return new Promise(function(s,a){o.profile.methods&&o.profile.methods.includes(t)||a(new Error("Method "+t+" is not exposed by "+o.profile.name)),o.requestQueue.push(function(){return r(o,void 0,void 0,function(){var r,o;return i(this,function(i){switch(i.label){case 0:this.currentRequest=e,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.callPluginMethod(t,n)];case 2:return r=i.sent(),s(r),[3,4];case 3:return o=i.sent(),a(o),[3,4];case 4:return delete this.currentRequest,this.requestQueue.shift(),0!==this.requestQueue.length&&this.requestQueue[0](),[2]}})})}),1===o.requestQueue.length&&o.requestQueue[0]()})},e.prototype.on=function(e,t,n){throw new Error('Method "on" from '+this.name+" should be hooked by PluginEngine")},e.prototype.call=function(e,t){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];return r(this,void 0,void 0,function(){return i(this,function(e){throw new Error('Method "call" from '+this.name+" should be hooked by PluginEngine")})})},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];throw new Error('Method "emit" from '+this.name+" should be hooked by PluginEngine")},e}();t.Plugin=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(16))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(17))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(18))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(19))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(20))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(21))},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(0);t.isView=function(e){return!!e.location};var u=function(e){function t(t){var n=e.call(this,t)||this;return n.profile=t,n}return i(t,e),t.prototype.activate=function(){return o(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return[4,this.call(this.profile.location,"addView",this.profile,this.render())];case 1:return t.sent(),e.prototype.activate.call(this),[2]}})})},t.prototype.deactivate=function(){this.call(this.profile.location,"removeView",this.profile)},t}(a.Plugin);t.ViewPlugin=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(9))},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(10)),r(n(23))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(11))},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(12),c=function(e){function t(t,n){void 0===n&&(n={});var r=e.call(this)||this;return r.plugins={},r.methods={},r.events={},r.listeners={},r.settings=function(e){return o({autoActivate:!1,natives:[]},e)}(n),r.register(Object.keys(t).map(function(e){return t[e]})),r}return i(t,e),Object.defineProperty(t.prototype,"actives",{get:function(){return Object.keys(this.methods)},enumerable:!0,configurable:!0}),t.prototype.isRegistered=function(e){return!!this.plugins[e]},t.prototype.isActive=function(e){return!!this.methods[e]},t.prototype.isNative=function(e){return!e.url||this.settings.natives.includes(e.name)},t.prototype.setSettings=function(e,t){var n;this.settings=o({},this.settings,"string"==typeof e?((n={})[e]=t,n):e)},t.prototype.register=function(e){var t=this;Array.isArray(e)?e.forEach(function(e){return t.registerOne(e)}):this.registerOne(e)},t.prototype.registerOne=function(e){if(!this.plugins[e.name]){if(!e.profile)throw new Error("Plugin "+e.name+" doesn't match the plugin interface");this.plugins[e.name]=e,this.onRegistration&&this.onRegistration(e),e.onRegistation&&e.onRegistation()}},t.prototype.activate=function(e){var t=this;Array.isArray(e)?e.forEach(function(e){return t.activateOne(e)}):this.activateOne(e)},t.prototype.activateOne=function(e){var t=this;if(!this.isActive(e)){if(!this.isRegistered(e))throw new Error("Plugin "+e+" is not register yet. It cannot be activated");var n=this.plugins[e];this.methods[e]={},n.profile.methods&&n.profile.methods.forEach(function(r){t.methods[e][r]=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];return n.addRequest(e,r,t)}}),n.call=i.bind(this),this.events[e]={},n.on=c.bind(this),n.emit=function(t){for(var n=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var o=u.listenEvent(e,t);this.listeners[o]&&(this.listeners[o]||[]).forEach(function(i){var s;if(!n.events[i][o])throw new Error("Plugin "+i+" should be listening on event "+t+" from "+e+". But no callback have been found");(s=n.events[i])[o].apply(s,r)})}.bind(this);var r=Object.keys(this.plugins).reduce(function(e,n){var r;return o({},e,((r={})[n]=t.plugins[n].profile.methods.reduce(function(e,r){var s;return o({},e,((s={})[r]=i.bind(t,n,r),s))},{on:c.bind(t,n)}),r))},{});n.app=Object.freeze(r),this.onActivation&&this.onActivation(n),n.activate()}function i(t,r){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];return s(this,void 0,void 0,function(){var o,s,u,c;return a(this,function(a){switch(a.label){case 0:if(!this.isRegistered(t))throw new Error("Cannot call "+t+" from "+e+", because "+t+" is not registered");return o=this.plugins[t],s=this.isNative(n.profile),!this.settings.permissionHandler||s?[3,2]:o.profile.permission?[4,this.settings.permissionHandler.askPermission(n.profile,o.profile)]:[3,2];case 1:if(!a.sent())throw new Error('Plugin "'+e+'" don\'t have permission to call method "'+r+'" of plugin "'+t+'"');a.label=2;case 2:if(!this.isActive(t)){if(!this.settings.autoActivate||!s)throw new Error("Cannot call "+t+" from "+e+", because "+t+" is not activated yet");this.settings.permissionHandler&&this.settings.permissionHandler.onActivation(n.profile,o.profile),this.activateOne(t)}if(!this.methods[t][r])throw new Error("Cannot call method "+r+" of "+t+" from "+e+", because "+r+" is not exposed");return u={from:e},[2,(c=this.methods[t])[r].apply(c,[u].concat(i))]}})})}function c(t,n,r){var i=u.listenEvent(t,n);this.events[e][i]||(this.events[e][i]=r),this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].includes(e)||this.listeners[i].push(e)}},t.prototype.deactivate=function(e){var t=this;Array.isArray(e)?e.forEach(function(e){return t.deactivateOne(e)}):this.deactivateOne(e)},t.prototype.deactivateOne=function(e){var t=this,n=this.plugins[e],r=function(){throw new Error("Plugin "+e+" is currently deactivated. Activate it to use this method")};n.call=r,n.on=r,n.emit=r,delete this.methods[e],delete this.events[e],Object.keys(this.listeners).forEach(function(n){t.listeners[n].forEach(function(r,i){r===e&&t.listeners[n].splice(i,1)})}),delete n.app,this.onDeactivation&&this.onDeactivation(n),n.deactivate()},t}(function(){});t.PluginEngine=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(13))},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(14)),r(n(15))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callEvent=function(e,t,n){return"["+e+"] "+t+"-"+n},t.listenEvent=function(e,t){return"["+e+"] "+t}},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(1)),r(n(2)),r(n(3)),r(n(4)),r(n(5)),r(n(6)),r(n(22))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compilerProfile={name:"compiler",methods:["compile","getCompilationResult"],events:["compilationFinished"]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.editorProfile={name:"editor",methods:["discardHighlight","highlight"]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filSystemProfile={name:"fs",methods:["getCurrentFile","getFile","getFolder","setFile","switchFile"],events:["currentFileChanged"]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.networkProfile={name:"network",methods:["addNetwork","detectNetwork","getEndpoint","getNetworkProvider","removeNetwork"],events:["providerChanged"]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.udappProfile={name:"udapp",methods:["createVMAccount","getAccounts","sendTransaction"],events:["newTransaction"]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.themeProfile={name:"theme",methods:[],events:["themeChanged"]}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(3),s=n(2),a=n(4),u=n(5),c=n(6);t.remixApi=Object.freeze({solidity:r({},i.compilerProfile,{name:"solidity"}),fileManager:r({},o.filSystemProfile,{name:"fileManager"}),editor:s.editorProfile,network:a.networkProfile,udapp:u.udappProfile,theme:c.themeProfile}),t.remixProfiles=Object.freeze({solidity:r({},i.compilerProfile,{name:"solidity"}),fileManager:r({},o.filSystemProfile,{name:"fileManager"}),editor:s.editorProfile,network:a.networkProfile,udapp:u.udappProfile,theme:c.themeProfile})},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(0)),r(n(24)),r(n(25)),r(n(26)),r(n(7))},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t){var n=e.call(this,t)||this;return n.profile=t,n.entities={},n}return i(t,e),t}(n(0).Plugin);t.HostPlugin=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=function(e){function t(t){var n=e.call(this,t)||this;return n.profile=t,n.listener=["message",function(e){return n.getMessage(e)},!1],n.id=0,n.iframe=document.createElement("iframe"),n.pendingRequest={},n}return i(t,e),t.prototype.deactivate=function(){this.iframe.remove(),window.removeEventListener.apply(window,this.listener),e.prototype.deactivate.call(this)},t.prototype.callPluginMethod=function(e,t){var n=this,r=this.id++,i=this.currentRequest,o=this.name;return this.postMessage({id:r,action:"request",key:e,payload:t,requestInfo:i,name:o}),new Promise(function(e,t){n.pendingRequest[r]=function(n,r){return r?t(r):e(n)}})},t.prototype.getMessage=function(e){return s(this,void 0,void 0,function(){var t,n,r,i,s,u,c,l,f=this;return a(this,function(a){switch(a.label){case 0:if(e.origin!==this.origin)return[2];switch((t=e.data).action){case"listen":return[3,1];case"notification":return[3,2];case"request":return[3,3];case"response":return[3,8]}return[3,9];case 1:return n=t.name,r=t.key,this.on(n,r,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return f.postMessage({action:"notification",name:n,key:r,payload:e})}),[3,10];case 2:return t.payload?(this.emit.apply(this,[t.key].concat(t.payload)),[3,10]):[3,10];case 3:i="response",a.label=4;case 4:return a.trys.push([4,6,,7]),[4,this.call(t.name,t.key,t.payload)];case 5:return c=a.sent(),l=void 0,this.postMessage(o({},t,{action:i,payload:c,error:l})),[3,7];case 6:return s=a.sent(),c=void 0,l=s.message,this.postMessage(o({},t,{action:i,payload:c,error:l})),[3,7];case 7:return[3,10];case 8:return u=t.id,c=t.payload,l=t.error,this.pendingRequest[u](c,l),delete this.pendingRequest[u],[3,10];case 9:throw new Error("Message should be a notification, request or response");case 10:return[2]}})})},t.prototype.postMessage=function(e){if(!this.source)throw new Error("No window attached to Iframe yet");this.source.postMessage(e,this.origin)},t.prototype.render=function(){var e=this;if(this.iframe.contentWindow)throw new Error(this.name+" plugin is already rendered");return this.iframe.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),this.iframe.setAttribute("seamless","true"),this.iframe.src=this.profile.url,this.iframe.onload=function(){if(!e.iframe.contentWindow)throw new Error(e.name+" plugin is cannot find url "+e.profile.url);window.addEventListener.apply(window,e.listener),e.origin=new URL(e.iframe.src).origin,e.source=e.iframe.contentWindow,e.postMessage({action:"request",name:e.name,key:"handshake"})},this.iframe},t}(n(7).ViewPlugin);t.IframePlugin=u},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,n){var r=e.call(this,n)||this;return r.library=t,r.profile=n,n.methods.forEach(function(e){if(!t[e])throw new Error("Method "+e+" is exposed by LibraryPlugin "+n.name+". But library doesn't expose this method")}),r}return i(t,e),t.prototype.activate=function(){var t=this;if(e.prototype.activate.call(this),this.profile.notifications){if(!this.library.events||!this.library.events.emit)throw new Error("Library of plugin "+this.name+" should listen on notifications.\n But doesn't expose the right interface (library.events.emit)");Object.keys(this.profile.notifications).forEach(function(e){t.profile.notifications[e].forEach(function(n){t.on(e,n,function(r){var i;return(i=t.library.events).emit.apply(i,["["+e+"] "+n].concat(r))})})})}if(this.profile.events){if(!this.library.events||!this.library.events.emit)throw new Error("Library of plugin "+this.name+" should emit events but doesn't expose the right interface (library.events.emit)");this.profile.events.forEach(function(e){t.library.events.on(e,function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.emit.apply(t,[e].concat(n))})})}},t.prototype.callPluginMethod=function(e,t){var n;if(!this.library[e])throw new Error("LibraryPlugin "+this.name+" doesn't expose method "+e);return(n=this.library)[e].apply(n,t)},t}(n(0).Plugin);t.LibraryPlugin=o}])}])});
{
"name": "@remixproject/engine",
"version": "0.1.2-5",
"version": "0.1.2-6",
"description": "Plugin Engine that power Remix IDE",

@@ -5,0 +5,0 @@ "contributors": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc