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

@baklavajs/core

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@baklavajs/core - npm Package Compare versions

Comparing version 1.8.3 to 1.9.1

3

dist/baklavajs-core/src/editor.d.ts

@@ -84,4 +84,5 @@ import { Node } from "./node";

* @param state State to load
* @returns An array of warnings that occured during loading. If the array is empty, the state was successfully loaded.
*/
load(state: IState): void;
load(state: IState): string[];
/**

@@ -88,0 +89,0 @@ * Save a state

@@ -16,2 +16,2 @@ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("BaklavaJS",[],t):"object"==typeof exports?exports.BaklavaJS=t():e.BaklavaJS=t()}("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},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=2)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequentialHook=t.Hook=t.PreventableBaklavaEvent=t.BaklavaEvent=void 0;var o=n(1),r=function(){function e(){this.listeners=new Map}return e.prototype.addListener=function(e,t){this.listeners.set(e,t)},e.prototype.removeListener=function(e){this.listeners.has(e)&&this.listeners.delete(e)},e.prototype.emit=function(e){this.listeners.forEach((function(t){return t(e)}))},e}();t.BaklavaEvent=r;var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.emit=function(e){var t,n;try{for(var r=o.__values(Array.from(this.listeners.values())),i=r.next();!i.done;i=r.next()){if(!1===(0,i.value)(e))return!0}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!1},t}(r);t.PreventableBaklavaEvent=i;var a=function(){function e(){this.tapMap=new Map,this.taps=[]}return e.prototype.tap=function(e,t){this.tapMap.has(e)&&this.untap(e),this.tapMap.set(e,t),this.taps.push(t)},e.prototype.untap=function(e){if(this.tapMap.has(e)){var t=this.tapMap.get(e);this.tapMap.delete(e);var n=this.taps.indexOf(t);n>=0&&this.taps.splice(n,1)}},e}();t.Hook=a;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.execute=function(e){var t,n,r=e;try{for(var i=o.__values(this.taps),a=i.next();!a.done;a=i.next()){r=(0,a.value)(r)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},t}(a);t.SequentialHook=u},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return r})),n.d(t,"__assign",(function(){return i})),n.d(t,"__rest",(function(){return a})),n.d(t,"__decorate",(function(){return u})),n.d(t,"__param",(function(){return s})),n.d(t,"__metadata",(function(){return c})),n.d(t,"__awaiter",(function(){return f})),n.d(t,"__generator",(function(){return l})),n.d(t,"__createBinding",(function(){return d})),n.d(t,"__exportStar",(function(){return p})),n.d(t,"__values",(function(){return h})),n.d(t,"__read",(function(){return v})),n.d(t,"__spread",(function(){return y})),n.d(t,"__spreadArrays",(function(){return m})),n.d(t,"__await",(function(){return b})),n.d(t,"__asyncGenerator",(function(){return _})),n.d(t,"__asyncDelegator",(function(){return w})),n.d(t,"__asyncValues",(function(){return g})),n.d(t,"__makeTemplateObject",(function(){return O})),n.d(t,"__importStar",(function(){return k})),n.d(t,"__importDefault",(function(){return E})),n.d(t,"__classPrivateFieldGet",(function(){return P})),n.d(t,"__classPrivateFieldSet",(function(){return j}));

***************************************************************************** */
var o=function(e,t){return(o=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 r(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function a(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function u(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var u=e.length-1;u>=0;u--)(r=e[u])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t){return function(n,o){t(n,o,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function u(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((o=o.apply(e,t||[])).next())}))}function l(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function d(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}function p(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function m(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,r++)o[r]=i[a];return o}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function _(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=n.apply(e,t||[]),i=[];return o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o;function a(e){r[e]&&(o[e]=function(t){return new Promise((function(n,o){i.push([e,t,n,o])>1||u(e,t)}))})}function u(e,t){try{(n=r[e](t)).value instanceof b?Promise.resolve(n.value.v).then(s,c):f(i[0][2],n)}catch(e){f(i[0][3],e)}var n}function s(e){u("next",e)}function c(e){u("throw",e)}function f(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function w(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,r){t[o]=e[o]?function(t){return(n=!n)?{value:b(e[o](t)),done:"return"===o}:r?r(t):t}:r}}function g(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,r){(function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)})(o,r,(t=e[n](t)).done,t.value)}))}}}function O(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function k(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function P(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function j(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";n.r(t),n.d(t,"Connection",(function(){return a})),n.d(t,"DummyConnection",(function(){return u})),n.d(t,"Editor",(function(){return c})),n.d(t,"Node",(function(){return d})),n.d(t,"NodeBuilder",(function(){return h})),n.d(t,"NodeInterface",(function(){return f})),n.d(t,"NodeOption",(function(){return l}));var o=0;function r(){return Date.now().toString()+(o++).toString()}var i=n(0),a=function(){function e(e,t){if(this.isInDanger=!1,this.destructed=!1,this.events={destruct:new i.BaklavaEvent},!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=r(),this.from=e,this.to=t,this.from.connectionCount++,this.to.connectionCount++}return e.prototype.destruct=function(){this.events.destruct.emit(),this.from.connectionCount--,this.to.connectionCount--,this.destructed=!0},e}(),u=function(e,t){if(!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=r(),this.from=e,this.to=t},s=n(1),c=function(){function e(){this._plugins=new Set,this._nodes=[],this._connections=[],this._nodeTypes=new Map,this._nodeCategories=new Map([["default",[]]]),this.events={beforeRegisterNodeType:new i.PreventableBaklavaEvent,registerNodeType:new i.BaklavaEvent,beforeAddNode:new i.PreventableBaklavaEvent,addNode:new i.BaklavaEvent,beforeRemoveNode:new i.PreventableBaklavaEvent,removeNode:new i.BaklavaEvent,beforeAddConnection:new i.PreventableBaklavaEvent,addConnection:new i.BaklavaEvent,checkConnection:new i.PreventableBaklavaEvent,beforeRemoveConnection:new i.PreventableBaklavaEvent,removeConnection:new i.BaklavaEvent,beforeUsePlugin:new i.PreventableBaklavaEvent,usePlugin:new i.BaklavaEvent},this.hooks={save:new i.SequentialHook,load:new i.SequentialHook}}return Object.defineProperty(e.prototype,"nodes",{get:function(){return this._nodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connections",{get:function(){return this._connections},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nodeTypes",{get:function(){return this._nodeTypes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nodeCategories",{get:function(){return this._nodeCategories},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"plugins",{get:function(){return this._plugins},enumerable:!1,configurable:!0}),e.prototype.registerNodeType=function(e,t,n){void 0===n&&(n="default"),this.events.beforeRegisterNodeType.emit({typeName:e,type:t,category:n})||(this._nodeTypes.set(e,t),this.nodeCategories.has(n)||this._nodeCategories.set(n,[]),this.nodeCategories.get(n).push(e),this.events.registerNodeType.emit({typeName:e,type:t,category:n}))},e.prototype.addNode=function(e){if(!this.events.beforeAddNode.emit(e))return e.registerEditor(this),this._nodes.push(e),this.events.addNode.emit(e),e},e.prototype.removeNode=function(e){var t=this;if(this.nodes.includes(e)){if(this.events.beforeRemoveNode.emit(e))return;this.connections.filter((function(t){return t.from.parent===e||t.to.parent===e})).forEach((function(e){return t.removeConnection(e)})),this._nodes.splice(this.nodes.indexOf(e),1),this.events.removeNode.emit(e)}},e.prototype.addConnection=function(e,t){var n=this.checkConnection(e,t);if(n&&!this.events.beforeAddConnection.emit({from:e,to:t})){var o=new a(n.from,n.to);return this._connections.push(o),this.events.addConnection.emit(o),o}},e.prototype.removeConnection=function(e){if(this.connections.includes(e)){if(this.events.beforeRemoveConnection.emit(e))return;e.destruct(),this._connections.splice(this.connections.indexOf(e),1),this.events.removeConnection.emit(e)}},e.prototype.checkConnection=function(e,t){if(!e||!t)return!1;if(e.parent===t.parent)return!1;if(e.isInput&&!t.isInput){var n=e;e=t,t=n}return!(e.isInput||!t.isInput)&&(!this.connections.some((function(n){return n.from===e&&n.to===t}))&&(!this.events.checkConnection.emit({from:e,to:t})&&new u(e,t)))},e.prototype.load=function(e){for(var t,n,o,r,i=this.connections.length-1;i>=0;i--)this.removeConnection(this.connections[i]);for(i=this.nodes.length-1;i>=0;i--)this.removeNode(this.nodes[i]);try{for(var a=Object(s.__values)(e.nodes),u=a.next();!u.done;u=a.next()){var c=u.value,f=this.nodeTypes.get(c.type);if(f){var l=new f;this.addNode(l),l.load(c)}else console.warn("Node type "+c.type+" is not registered")}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}try{for(var d=Object(s.__values)(e.connections),p=d.next();!p.done;p=d.next()){var h=p.value,v=this.findNodeInterface(h.from),y=this.findNodeInterface(h.to);v?y?this.addConnection(v,y):console.warn("Could not find interface with id "+h.to):console.warn("Could not find interface with id "+h.from)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(o)throw o.error}}this.hooks.load.execute(e)},e.prototype.save=function(){var e={nodes:this.nodes.map((function(e){return e.save()})),connections:this.connections.map((function(e){return{id:e.id,from:e.from.id,to:e.to.id}}))};return this.hooks.save.execute(e)},e.prototype.use=function(e){return!this.events.beforeUsePlugin.emit(e)&&(this._plugins.add(e),e.register(this),this.events.usePlugin.emit(e),!0)},e.prototype.generateId=function(e){return void 0===e&&(e=""),e+r()},e.prototype.findNodeInterface=function(e){var t,n,o,r;try{for(var i=Object(s.__values)(this.nodes),a=i.next();!a.done;a=i.next()){var u=a.value;try{for(var c=(o=void 0,Object(s.__values)(u.interfaces.keys())),f=c.next();!f.done;f=c.next()){var l=f.value;if(u.interfaces.get(l).id===e)return u.interfaces.get(l)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(o)throw o.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e}(),f=function(){function e(e,t){this.events={setConnectionCount:new i.BaklavaEvent,beforeSetValue:new i.PreventableBaklavaEvent,setValue:new i.BaklavaEvent,updated:new i.BaklavaEvent},this.hooks={load:new i.SequentialHook,save:new i.SequentialHook},this._connectionCount=0,this._value=null,this.parent=e,this.isInput=t,this.id="ni_"+r()}return Object.defineProperty(e.prototype,"connectionCount",{get:function(){return this._connectionCount},set:function(e){this._connectionCount=e,this.events.setConnectionCount.emit(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this.events.beforeSetValue.emit(e)||(this._value=e,this.events.setValue.emit(e))},enumerable:!1,configurable:!0}),e.prototype.load=function(e){this.id=e.id,this.value=e.value,this.hooks.load.execute(e)},e.prototype.save=function(){var e={id:this.id,value:this.value};return this.hooks.save.execute(e)},e}(),l=function(){function e(e,t,n){this.events={beforeSetValue:new i.PreventableBaklavaEvent,setValue:new i.BaklavaEvent,updated:new i.BaklavaEvent},this.optionComponent=e,this.sidebarComponent=n,this._value=t}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this.events.beforeSetValue.emit(e)||(this._value=e,this.events.setValue.emit(e))},enumerable:!1,configurable:!0}),e}(),d=function(){function e(){this.id="node_"+r(),this.interfaces=new Map,this.options=new Map,this.state={},this.events={beforeAddInterface:new i.PreventableBaklavaEvent,addInterface:new i.BaklavaEvent,beforeRemoveInterface:new i.PreventableBaklavaEvent,removeInterface:new i.BaklavaEvent,beforeAddOption:new i.PreventableBaklavaEvent,addOption:new i.BaklavaEvent,beforeRemoveOption:new i.PreventableBaklavaEvent,removeOption:new i.BaklavaEvent,update:new i.BaklavaEvent},this.hooks={load:new i.SequentialHook,save:new i.SequentialHook}}return Object.defineProperty(e.prototype,"inputInterfaces",{get:function(){var e={};return this.interfaces.forEach((function(t,n){t.isInput&&(e[n]=t)})),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"outputInterfaces",{get:function(){var e={};return this.interfaces.forEach((function(t,n){t.isInput||(e[n]=t)})),e},enumerable:!1,configurable:!0}),e.prototype.load=function(e){var t=this;this.id=e.id,this.name=e.name,this.state=e.state,e.options.forEach((function(e){var n=Object(s.__read)(e,2),o=n[0],r=n[1];t.options.has(o)&&(t.options.get(o).value=r)})),e.interfaces.forEach((function(e){var n=Object(s.__read)(e,2),o=n[0],r=n[1];t.interfaces.has(o)&&t.interfaces.get(o).load(r)})),this.hooks.load.execute(e)},e.prototype.save=function(){var e={type:this.type,id:this.id,name:this.name,options:Array.from(this.options.entries()).map((function(e){var t=Object(s.__read)(e,2);return[t[0],t[1].value]})),state:this.state,interfaces:Array.from(this.interfaces.entries()).map((function(e){var t=Object(s.__read)(e,2);return[t[0],t[1].save()]}))};return this.hooks.save.execute(e)},e.prototype.calculate=function(e){},e.prototype.addInputInterface=function(e,t,n,o){var r=this;if(void 0===n&&(n=null),!this.events.beforeAddInterface.emit({name:e,isInput:!0,option:t,defaultValue:n})){var i=this.addInterface(!0,e,t);return i.events.setValue.addListener(this,(function(){return r.events.update.emit({name:e,interface:i})})),i.value=n,Object.entries(o||{}).forEach((function(e){var t=Object(s.__read)(e,2),n=t[0],o=t[1];i[n]=o})),this.events.addInterface.emit(i),i}},e.prototype.addOutputInterface=function(e,t){if(!this.events.beforeAddInterface.emit({name:e,isInput:!1})){var n=this.addInterface(!1,e);return Object.entries(t||{}).forEach((function(e){var t=Object(s.__read)(e,2),o=t[0],r=t[1];n[o]=r})),this.events.addInterface.emit(n),n}},e.prototype.removeInterface=function(e){var t=this,n=this.getInterface(e);if(n){if(this.events.beforeRemoveInterface.emit(n))return;if(n.connectionCount>0){if(!this.editorInstance)throw new Error("Interface is connected, but no editor instance is specified. Unable to delete interface");this.editorInstance.connections.filter((function(e){return e.from===n||e.to===n})).forEach((function(e){t.editorInstance.removeConnection(e)}))}this.interfaces.delete(e),this.events.removeInterface.emit(n)}},e.prototype.addOption=function(e,t,n,o,r){var i=this;if(void 0===n&&(n=null),!this.events.beforeAddOption.emit({name:e,component:t,defaultValue:n,sidebarComponent:o})){var a=new l(t,n,o);return Object.entries(r||{}).forEach((function(e){var t=Object(s.__read)(e,2),n=t[0],o=t[1];a[n]=o})),a.events.setValue.addListener(this,(function(){i.events.update.emit({name:e,option:a})})),this.options.set(e,a),this.events.addOption.emit({name:e,option:a}),a}},e.prototype.removeOption=function(e){if(this.options.has(e)){var t=this.options.get(e);if(this.events.beforeRemoveOption.emit({name:e,option:t}))return;this.options.delete(e),this.events.removeOption.emit({name:e,option:t})}},e.prototype.getInterface=function(e){if(!this.interfaces.has(e))throw new Error("No interface named '"+e+"'");return this.interfaces.get(e)},e.prototype.getOptionValue=function(e){if(!this.options.has(e))throw new Error("No option named '"+e+"'");return this.options.get(e).value},e.prototype.setOptionValue=function(e,t){if(!this.options.has(e))throw new Error("No option named '"+e+"'");this.options.get(e).value=t},e.prototype.registerEditor=function(e){this.editorInstance=e},e.prototype.addInterface=function(e,t,n){var o=new f(this,e);return o.option=n,this.interfaces.set(t,o),o},e}();function p(e){return"function"==typeof e?e():e}var h=function(){function e(e,t){this.type="",this.name="",this.intfs=[],this.options=new Map,this.type=e,this.name=e,this.additionalProperties=t}return e.prototype.build=function(){return e=this.type,t=this.name,n=this.additionalProperties,o=this.intfs,r=this.options,i=this.calcFunction,function(a){function u(){var i,u,c=a.call(this)||this;c.type=e,c.name=t,n&&Object.assign(c,n);try{for(var f=Object(s.__values)(o),l=f.next();!l.done;l=f.next()){var d=l.value;d.isInput?c.addInputInterface(d.name,d.option,p(d.defaultValue),d.additionalProperties):c.addOutputInterface(d.name,d.additionalProperties)}}catch(e){i={error:e}}finally{try{l&&!l.done&&(u=f.return)&&u.call(f)}finally{if(i)throw i.error}}return Array.from(r.entries()).forEach((function(e){var t=Object(s.__read)(e,2),n=t[0],o=t[1];c.addOption(n,o.optionComponent,p(o.value),o.sidebarComponent,o.additionalProperties)})),c}return Object(s.__extends)(u,a),u.prototype.calculate=function(e){if(i)return i.call(this,this,e)},u}(d);var e,t,n,o,r,i},e.prototype.setName=function(e){return this.name=e,this},e.prototype.addInputInterface=function(e,t,n,o){return void 0===n&&(n=null),this.checkDefaultValue(n),this.intfs.push({isInput:!0,name:e,option:t,defaultValue:n,additionalProperties:o}),this},e.prototype.addOutputInterface=function(e,t){return this.intfs.push({isInput:!1,name:e,additionalProperties:t}),this},e.prototype.addOption=function(e,t,n,o,r){return void 0===n&&(n=null),this.checkDefaultValue(n),this.options.set(e,{value:n,optionComponent:t,sidebarComponent:o,additionalProperties:r}),this},e.prototype.onCalculate=function(e){return this.calcFunction=e,this},e.prototype.checkDefaultValue=function(e){if("object"==typeof e&&null!==e)throw new Error("If the default value is an object, provide a generator function instead of the object")},e}()}])}));
var o=function(e,t){return(o=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 r(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function a(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function u(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var u=e.length-1;u>=0;u--)(r=e[u])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t){return function(n,o){t(n,o,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function u(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((o=o.apply(e,t||[])).next())}))}function l(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function d(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}function p(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function m(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,r++)o[r]=i[a];return o}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function _(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=n.apply(e,t||[]),i=[];return o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o;function a(e){r[e]&&(o[e]=function(t){return new Promise((function(n,o){i.push([e,t,n,o])>1||u(e,t)}))})}function u(e,t){try{(n=r[e](t)).value instanceof b?Promise.resolve(n.value.v).then(s,c):f(i[0][2],n)}catch(e){f(i[0][3],e)}var n}function s(e){u("next",e)}function c(e){u("throw",e)}function f(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function w(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,r){t[o]=e[o]?function(t){return(n=!n)?{value:b(e[o](t)),done:"return"===o}:r?r(t):t}:r}}function g(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,r){(function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)})(o,r,(t=e[n](t)).done,t.value)}))}}}function O(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function k(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function P(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function j(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";n.r(t),n.d(t,"Connection",(function(){return a})),n.d(t,"DummyConnection",(function(){return u})),n.d(t,"Editor",(function(){return c})),n.d(t,"Node",(function(){return d})),n.d(t,"NodeBuilder",(function(){return h})),n.d(t,"NodeInterface",(function(){return f})),n.d(t,"NodeOption",(function(){return l}));var o=0;function r(){return Date.now().toString()+(o++).toString()}var i=n(0),a=function(){function e(e,t){if(this.isInDanger=!1,this.destructed=!1,this.events={destruct:new i.BaklavaEvent},!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=r(),this.from=e,this.to=t,this.from.connectionCount++,this.to.connectionCount++}return e.prototype.destruct=function(){this.events.destruct.emit(),this.from.connectionCount--,this.to.connectionCount--,this.destructed=!0},e}(),u=function(e,t){if(!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=r(),this.from=e,this.to=t},s=n(1),c=function(){function e(){this._plugins=new Set,this._nodes=[],this._connections=[],this._nodeTypes=new Map,this._nodeCategories=new Map([["default",[]]]),this.events={beforeRegisterNodeType:new i.PreventableBaklavaEvent,registerNodeType:new i.BaklavaEvent,beforeAddNode:new i.PreventableBaklavaEvent,addNode:new i.BaklavaEvent,beforeRemoveNode:new i.PreventableBaklavaEvent,removeNode:new i.BaklavaEvent,beforeAddConnection:new i.PreventableBaklavaEvent,addConnection:new i.BaklavaEvent,checkConnection:new i.PreventableBaklavaEvent,beforeRemoveConnection:new i.PreventableBaklavaEvent,removeConnection:new i.BaklavaEvent,beforeUsePlugin:new i.PreventableBaklavaEvent,usePlugin:new i.BaklavaEvent},this.hooks={save:new i.SequentialHook,load:new i.SequentialHook}}return Object.defineProperty(e.prototype,"nodes",{get:function(){return this._nodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connections",{get:function(){return this._connections},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nodeTypes",{get:function(){return this._nodeTypes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nodeCategories",{get:function(){return this._nodeCategories},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"plugins",{get:function(){return this._plugins},enumerable:!1,configurable:!0}),e.prototype.registerNodeType=function(e,t,n){void 0===n&&(n="default"),this.events.beforeRegisterNodeType.emit({typeName:e,type:t,category:n})||(this._nodeTypes.set(e,t),this.nodeCategories.has(n)||this._nodeCategories.set(n,[]),this.nodeCategories.get(n).push(e),this.events.registerNodeType.emit({typeName:e,type:t,category:n}))},e.prototype.addNode=function(e){if(!this.events.beforeAddNode.emit(e))return e.registerEditor(this),this._nodes.push(e),this.events.addNode.emit(e),e},e.prototype.removeNode=function(e){var t=this;if(this.nodes.includes(e)){if(this.events.beforeRemoveNode.emit(e))return;this.connections.filter((function(t){return t.from.parent===e||t.to.parent===e})).forEach((function(e){return t.removeConnection(e)})),this._nodes.splice(this.nodes.indexOf(e),1),this.events.removeNode.emit(e)}},e.prototype.addConnection=function(e,t){var n=this.checkConnection(e,t);if(n&&!this.events.beforeAddConnection.emit({from:e,to:t})){var o=new a(n.from,n.to);return this._connections.push(o),this.events.addConnection.emit(o),o}},e.prototype.removeConnection=function(e){if(this.connections.includes(e)){if(this.events.beforeRemoveConnection.emit(e))return;e.destruct(),this._connections.splice(this.connections.indexOf(e),1),this.events.removeConnection.emit(e)}},e.prototype.checkConnection=function(e,t){if(!e||!t)return!1;if(e.parent===t.parent)return!1;if(e.isInput&&!t.isInput){var n=e;e=t,t=n}return!(e.isInput||!t.isInput)&&(!this.connections.some((function(n){return n.from===e&&n.to===t}))&&(!this.events.checkConnection.emit({from:e,to:t})&&new u(e,t)))},e.prototype.load=function(e){for(var t,n,o,r,i=[],a=this.connections.length-1;a>=0;a--)this.removeConnection(this.connections[a]);for(a=this.nodes.length-1;a>=0;a--)this.removeNode(this.nodes[a]);try{for(var u=Object(s.__values)(e.nodes),c=u.next();!c.done;c=u.next()){var f=c.value,l=this.nodeTypes.get(f.type);if(l){var d=new l;this.addNode(d),d.load(f)}else i.push("Node type "+f.type+" is not registered")}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}try{for(var p=Object(s.__values)(e.connections),h=p.next();!h.done;h=p.next()){var v=h.value,y=this.findNodeInterface(v.from),m=this.findNodeInterface(v.to);if(y)if(m){var b=this.addConnection(y,m);b?b.id=v.id:i.push("Unable to create connection from "+v.from+" to "+v.to)}else i.push("Could not find interface with id "+v.to);else i.push("Could not find interface with id "+v.from)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(o)throw o.error}}return this.hooks.load.execute(e),i.forEach((function(e){return console.warn(e)})),i},e.prototype.save=function(){var e={nodes:this.nodes.map((function(e){return e.save()})),connections:this.connections.map((function(e){return{id:e.id,from:e.from.id,to:e.to.id}}))};return this.hooks.save.execute(e)},e.prototype.use=function(e){return!this.events.beforeUsePlugin.emit(e)&&(this._plugins.add(e),e.register(this),this.events.usePlugin.emit(e),!0)},e.prototype.generateId=function(e){return void 0===e&&(e=""),e+r()},e.prototype.findNodeInterface=function(e){var t,n,o,r;try{for(var i=Object(s.__values)(this.nodes),a=i.next();!a.done;a=i.next()){var u=a.value;try{for(var c=(o=void 0,Object(s.__values)(u.interfaces.keys())),f=c.next();!f.done;f=c.next()){var l=f.value;if(u.interfaces.get(l).id===e)return u.interfaces.get(l)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(o)throw o.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e}(),f=function(){function e(e,t){this.events={setConnectionCount:new i.BaklavaEvent,beforeSetValue:new i.PreventableBaklavaEvent,setValue:new i.BaklavaEvent,updated:new i.BaklavaEvent},this.hooks={load:new i.SequentialHook,save:new i.SequentialHook},this._connectionCount=0,this._value=null,this.parent=e,this.isInput=t,this.id="ni_"+r()}return Object.defineProperty(e.prototype,"connectionCount",{get:function(){return this._connectionCount},set:function(e){this._connectionCount=e,this.events.setConnectionCount.emit(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this.events.beforeSetValue.emit(e)||(this._value=e,this.events.setValue.emit(e))},enumerable:!1,configurable:!0}),e.prototype.load=function(e){this.id=e.id,this.value=e.value,this.hooks.load.execute(e)},e.prototype.save=function(){var e={id:this.id,value:this.value};return this.hooks.save.execute(e)},e}(),l=function(){function e(e,t,n){this.events={beforeSetValue:new i.PreventableBaklavaEvent,setValue:new i.BaklavaEvent,updated:new i.BaklavaEvent},this.optionComponent=e,this.sidebarComponent=n,this._value=t}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this.events.beforeSetValue.emit(e)||(this._value=e,this.events.setValue.emit(e))},enumerable:!1,configurable:!0}),e}(),d=function(){function e(){this.id="node_"+r(),this.interfaces=new Map,this.options=new Map,this.state={},this.events={beforeAddInterface:new i.PreventableBaklavaEvent,addInterface:new i.BaklavaEvent,beforeRemoveInterface:new i.PreventableBaklavaEvent,removeInterface:new i.BaklavaEvent,beforeAddOption:new i.PreventableBaklavaEvent,addOption:new i.BaklavaEvent,beforeRemoveOption:new i.PreventableBaklavaEvent,removeOption:new i.BaklavaEvent,update:new i.BaklavaEvent},this.hooks={load:new i.SequentialHook,save:new i.SequentialHook}}return Object.defineProperty(e.prototype,"inputInterfaces",{get:function(){var e={};return this.interfaces.forEach((function(t,n){t.isInput&&(e[n]=t)})),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"outputInterfaces",{get:function(){var e={};return this.interfaces.forEach((function(t,n){t.isInput||(e[n]=t)})),e},enumerable:!1,configurable:!0}),e.prototype.load=function(e){var t=this;this.id=e.id,this.name=e.name,this.state=e.state,e.options.forEach((function(e){var n=Object(s.__read)(e,2),o=n[0],r=n[1];t.options.has(o)&&(t.options.get(o).value=r)})),e.interfaces.forEach((function(e){var n=Object(s.__read)(e,2),o=n[0],r=n[1];t.interfaces.has(o)&&t.interfaces.get(o).load(r)})),this.hooks.load.execute(e)},e.prototype.save=function(){var e={type:this.type,id:this.id,name:this.name,options:Array.from(this.options.entries()).map((function(e){var t=Object(s.__read)(e,2);return[t[0],t[1].value]})),state:this.state,interfaces:Array.from(this.interfaces.entries()).map((function(e){var t=Object(s.__read)(e,2);return[t[0],t[1].save()]}))};return this.hooks.save.execute(e)},e.prototype.calculate=function(e){},e.prototype.addInputInterface=function(e,t,n,o){var r=this;if(void 0===n&&(n=null),!this.events.beforeAddInterface.emit({name:e,isInput:!0,option:t,defaultValue:n})){var i=this.addInterface(!0,e,t);return i.events.setValue.addListener(this,(function(){return r.events.update.emit({name:e,interface:i})})),i.value=n,Object.entries(o||{}).forEach((function(e){var t=Object(s.__read)(e,2),n=t[0],o=t[1];i[n]=o})),this.events.addInterface.emit(i),i}},e.prototype.addOutputInterface=function(e,t){if(!this.events.beforeAddInterface.emit({name:e,isInput:!1})){var n=this.addInterface(!1,e);return Object.entries(t||{}).forEach((function(e){var t=Object(s.__read)(e,2),o=t[0],r=t[1];n[o]=r})),this.events.addInterface.emit(n),n}},e.prototype.removeInterface=function(e){var t=this,n=this.getInterface(e);if(n){if(this.events.beforeRemoveInterface.emit(n))return;if(n.connectionCount>0){if(!this.editorInstance)throw new Error("Interface is connected, but no editor instance is specified. Unable to delete interface");this.editorInstance.connections.filter((function(e){return e.from===n||e.to===n})).forEach((function(e){t.editorInstance.removeConnection(e)}))}this.interfaces.delete(e),this.events.removeInterface.emit(n)}},e.prototype.addOption=function(e,t,n,o,r){var i=this;if(void 0===n&&(n=null),!this.events.beforeAddOption.emit({name:e,component:t,defaultValue:n,sidebarComponent:o})){var a=new l(t,n,o);return Object.entries(r||{}).forEach((function(e){var t=Object(s.__read)(e,2),n=t[0],o=t[1];a[n]=o})),a.events.setValue.addListener(this,(function(){i.events.update.emit({name:e,option:a})})),this.options.set(e,a),this.events.addOption.emit({name:e,option:a}),a}},e.prototype.removeOption=function(e){if(this.options.has(e)){var t=this.options.get(e);if(this.events.beforeRemoveOption.emit({name:e,option:t}))return;this.options.delete(e),this.events.removeOption.emit({name:e,option:t})}},e.prototype.getInterface=function(e){if(!this.interfaces.has(e))throw new Error("No interface named '"+e+"'");return this.interfaces.get(e)},e.prototype.getOptionValue=function(e){if(!this.options.has(e))throw new Error("No option named '"+e+"'");return this.options.get(e).value},e.prototype.setOptionValue=function(e,t){if(!this.options.has(e))throw new Error("No option named '"+e+"'");this.options.get(e).value=t},e.prototype.registerEditor=function(e){this.editorInstance=e},e.prototype.addInterface=function(e,t,n){var o=new f(this,e);return o.option=n,this.interfaces.set(t,o),o},e}();function p(e){return"function"==typeof e?e():e}var h=function(){function e(e,t){this.type="",this.name="",this.intfs=[],this.options=new Map,this.type=e,this.name=e,this.additionalProperties=t}return e.prototype.build=function(){return e=this.type,t=this.name,n=this.additionalProperties,o=this.intfs,r=this.options,i=this.calcFunction,function(a){function u(){var i,u,c=a.call(this)||this;c.type=e,c.name=t,n&&Object.assign(c,n);try{for(var f=Object(s.__values)(o),l=f.next();!l.done;l=f.next()){var d=l.value;d.isInput?c.addInputInterface(d.name,d.option,p(d.defaultValue),d.additionalProperties):c.addOutputInterface(d.name,d.additionalProperties)}}catch(e){i={error:e}}finally{try{l&&!l.done&&(u=f.return)&&u.call(f)}finally{if(i)throw i.error}}return Array.from(r.entries()).forEach((function(e){var t=Object(s.__read)(e,2),n=t[0],o=t[1];c.addOption(n,o.optionComponent,p(o.value),o.sidebarComponent,o.additionalProperties)})),c}return Object(s.__extends)(u,a),u.prototype.calculate=function(e){if(i)return i.call(this,this,e)},u}(d);var e,t,n,o,r,i},e.prototype.setName=function(e){return this.name=e,this},e.prototype.addInputInterface=function(e,t,n,o){return void 0===n&&(n=null),this.checkDefaultValue(n),this.intfs.push({isInput:!0,name:e,option:t,defaultValue:n,additionalProperties:o}),this},e.prototype.addOutputInterface=function(e,t){return this.intfs.push({isInput:!1,name:e,additionalProperties:t}),this},e.prototype.addOption=function(e,t,n,o,r){return void 0===n&&(n=null),this.checkDefaultValue(n),this.options.set(e,{value:n,optionComponent:t,sidebarComponent:o,additionalProperties:r}),this},e.prototype.onCalculate=function(e){return this.calcFunction=e,this},e.prototype.checkDefaultValue=function(e){if("object"==typeof e&&null!==e)throw new Error("If the default value is an object, provide a generator function instead of the object")},e}()}])}));
{
"name": "@baklavajs/core",
"version": "1.8.3",
"version": "1.9.1",
"description": "Core logic of BaklavaJS, a graph editor / node editor for the web",

@@ -38,3 +38,2 @@ "author": "newcat <freddy.wagner@web.de>",

"ts-loader": "^8.0.14",
"typedoc": "^0.20.17",
"typescript": "^4.1.3",

@@ -49,3 +48,3 @@ "webpack": "^4.42.1",

},
"gitHead": "184b31576333dcc212450ec3295f65ce1940142b"
"gitHead": "16ba1018c9a96e94e7596944218729faf228ce1d"
}
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