1 line
1.7 MiB
JavaScript
Raw Normal View History

!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MERMAID_ELK=t():n.MERMAID_ELK=t()}(self,(()=>(()=>{"use strict";var n={109:(n,t,e)=>{e.d(t,{a:()=>s,b:()=>h,c:()=>f,d:()=>l});var a=Object.create,i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,o=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,s=(n,t)=>i(n,"name",{value:t,configurable:!0}),h=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):n)((function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')})),f=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),l=(n,t,e)=>(e=null!=n?a(o(n)):{},((n,t,e,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let e of c(t))!u.call(n,e)&&undefined!==e&&i(n,e,{get:()=>t[e],enumerable:!(a=r(t,e))||a.enumerable});return n})(!t&&n&&n.__esModule?e:i(e,"default",{value:n,enumerable:!0}),n))},804:(n,t,e)=>{e.r(t),e.d(t,{render:()=>Ii});var a=e(109),i=(0,a.c)(((n,t)=>{!function(e){"object"==typeof n&&typeof t<"u"?t.exports=e():"function"==typeof define&&define.amd?define([],e):(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).ELK=e()}((function(){return function(){function n(t,e,i){function r(o,u){if(!e[o]){if(!t[o]){var s="function"==typeof a.b&&a.b;if(!u&&s)return s(o,!0);if(c)return c(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var f=e[o]={exports:{}};t[o][0].call(f.exports,(function(n){return r(t[o][1][n]||n)}),f,f.exports,n,t,e,i)}return e[o].exports}(0,a.a)(r,"o");for(var c="function"==typeof a.b&&a.b,o=0;o<i.length;o++)r(i[o]);return r}return(0,a.a)(n,"r"),n}()({1:[function(n,t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function n(n,t){for(var e=0;e<t.length;e++){var a=t[e];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(n,a.key,a)}}return(0,a.a)(n,"defineProperties"),function(t,e,a){return e&&n(t.prototype,e),a&&n(t,a),t}}();function r(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}(0,a.a)(r,"_classCallCheck");var c=function(){function n(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.defaultLayoutOptions,c=void 0===i?{}:i,u=e.algorithms,s=void 0===u?["layered","stress","mrtree","radial","force","disco","sporeOverlap","sporeCompaction","rectpacking"]:u,h=e.workerFactory,f=e.workerUrl;if(r(this,n),this.defaultLayoutOptions=c,this.initialized=!1,typeof f>"u"&&typeof h>"u")throw new Error("Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.");var l=h;typeof f<"u"&&typeof h>"u"&&(l=(0,a.a)((function(n){return new Worker(n)}),"factory"));var b=l(f);if("function"!=typeof b.postMessage)throw new TypeError("Created worker does not provide the required 'postMessage' function.");this.worker=new o(b),this.worker.postMessage({cmd:"register",algorithms:s}).then((function(n){return t.initialized=!0})).catch(console.err)}return(0,a.a)(n,"ELK"),i(n,[{key:"layout",value:(0,a.a)((function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.layoutOptions,a=void 0===e?this.defaultLayoutOptions:e,i=t.logging,r=void 0!==i&&i,c=t.measureExecutionTime,o=void 0!==c&&c;return n?this.worker.postMessage({cmd:"layout",graph:n,layoutOptions:a,options:{logging:r,measureExecutionTime:o}}):Promise.reject(new Error("Missing mandatory parameter 'graph'."))}),"layout")},{key:"knownLayoutAlgorithms",value:(0,a.a)((function(){return this.worker.postMessage({cmd:"algorithms"})}),"knownLayoutAlgorithms")},{key:"knownLayoutOptions",value:(0,a.a)((function(){return this.worker.postMessage({cmd:"options"})}),"knownLayoutOptions")},{key:"knownLayoutCategories",value:(0,a.a)((function(){return this.worker.postMessage({cmd:"categories"})}),"knownLayoutCategories")},{key:"terminateWorker",value:(0,a.a)((function(){this.worker&&this.worke