@hailer-oy/birds-eye
Version:
This component library directory contains all the react components for Hailer Bird's Eye! Developing these componets happens [here](https://github.com/KvanttoriOy/birds-eye/tree/master/birds-eye-components), only copy your changes in lib from there to src
3 lines (2 loc) • 29.3 kB
JavaScript
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),n=e(t),r=require("d3"),a=require("react-icons/cg"),o=e(require("dom-to-image")),i=require("react-icons/md"),c=e(require("react-to-print"));require("highlight.js/styles/atom-one-light.css");var l=e(require("react-highlight"));function u(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}u('@import url("https://fonts.googleapis.com/css2?family=Nunito&family=Nunito+Sans&display=swap");');var s=function(e,t){return r.drag().on("start",(function(t){t.active||e.alphaTarget(.3).restart(),t.subject.fx=t.subject.x,t.subject.fy=t.subject.y})).on("drag",(function(e,n){e.subject.fx=e.x,e.subject.fy=e.y,function(e,t){e.each((function(e){t!=e&&(e.fx=e.x,e.fy=e.y)}))}(t,n)}))},d=function(e){for(var t=0,n=0;n<e.length;n++)"ABCDEFGHJKLMNOPQRSTUVWXYZ/()".includes(e.charAt(n))?t+=1.5:"Iabcdefghjkmnopqrstuvwxyz0123456789".includes(e.charAt(n))?t+=1:"il ".includes(e.charAt(n))?t+=.85:t+=2;return t};u(".be_transparent{opacity:.2}#be_graph{height:100%;transform:scale(3) translate(-350px,-200px);transform-origin:top left;width:100%}.be_ForceChartFigure{margin:0;overflow:clip;padding:0;width:100%}");var f=function(e){var a=e.data,o=e.updateNode,i=function(e,n){var i=t.useRef(null);return t.useEffect((function(){return function(e,t,n){var a=t.links.map((function(e){return Object.create(e)})),o=t.nodes.map((function(e){return Object.create(e)}));(function(e,t,n,a,o,i){var c=a.append("g").attr("stroke","#666666").attr("stroke-opacity",.6).selectAll("path").data(n).join("path").attr("marker-end","url(#arrow)").attr("id",(function(e){return e.id})).style("stroke-width",.5),l=a.append("g").selectAll("g").data(t).enter().append("g").attr("id",(function(e){return"g"+e.id})),u=l.append("circle").attr("r",2).attr("cursor","pointer").attr("id",(function(e){return e.id})).attr("fill",(function(e){return"dataset"===e.group?"var(--primary-500, #253c56)":"undefined"===e.group?"#922a2a":"var(--accent-800, #138637)"})).on("click",(function(e){return i(e.target.id)})).call(s(e,l)),f=l.append("rect").attr("height","4").attr("fill","#FFFF").attr("opacity","1").attr("stroke-width",".2").attr("stroke","rgba(0, 0, 0, 0.5").attr("rx",1.5).attr("ry",1.5).call(s(e,l)),m=l.append("text").attr("font-size","0.2rem").attr("fill","#333333").attr("font-weight","bold").text((function(e){return e.name}));l.append("title").text((function(e){return e.name})),a.append("svg:defs").append("svg:marker").attr("id","arrow").attr("viewBox","0 -5 10 10").attr("refX",25).attr("markerWidth",2.8).attr("markerHeight",2.8).attr("orient","auto").append("svg:path").attr("d","M0,-5L10,0L0,5"),a.append("svg:defs").append("svg:marker").attr("id","arrow-red").attr("viewBox","0 -5 10 10").attr("refX",25).attr("markerWidth",2.8).attr("markerHeight",2.8).attr("orient","auto").attr("fill","red").append("svg:path").attr("d","M0,-5L10,0L0,5"),e.on("tick",(function(){c.attr("d",(function(e){return"M"+e.source.x+","+e.source.y+","+e.target.x+","+e.target.y})),f.attr("x",(function(e){return e.x-.92*d(e.name)})).attr("y",(function(e){return e.y-8})).attr("width",(function(e){return 1.9*d(e.name)})),u.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),m.attr("x",(function(e){return function(e){return e.x-e.name.length*Math.pow(.994,e.name.length)+e.name.length/10}(e)})).attr("y",(function(e){return e.y-4.8}))})),o.attr("width",500).attr("height",600),function(e){return r.zoom().scaleExtent([1/4,8]).on("zoom",(function(t){e.attr("transform",t.transform)}))}(a)(o)})(r.forceSimulation(o).force("collision",r.forceCollide().radius(15)).force("charge",r.forceManyBody().strength(-80)).force("link",r.forceLink(a).id((function(e){return e.id}))).force("center",r.forceCenter(600,400)).force("x",r.forceX()).force("y",r.forceY()),o,a,e.append("g"),e,n),e.node()}(r.select("#be_graph"),a,o),function(){r.selectAll("#be_graph > *").remove()}}),n),i}(0,[a]);return n.createElement("div",{className:"be_ForceChart"},n.createElement("figure",{className:"be_ForceChartFigure"},n.createElement("svg",{ref:i,id:"be_graph"})))};function m(e,t,n,r,a,o,i){try{var c=e[o](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,a)}function p(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){m(o,r,a,i,c,"next",e)}function c(e){m(o,r,a,i,c,"throw",e)}i(void 0)}))}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var b,g=(function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",i=r.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var a=Object.create((t&&t.prototype instanceof d?t:d).prototype),o=new _(r||[]);return a._invoke=function(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=x(i,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,o),a}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var s={};function d(){}function f(){}function m(){}var p={};c(p,a,(function(){return this}));var h=Object.getPrototypeOf,b=h&&h(h(k([])));b&&b!==t&&n.call(b,a)&&(p=b);var g=m.prototype=d.prototype=Object.create(p);function v(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){var r;this._invoke=function(a,o){function i(){return new t((function(r,i){!function r(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,i,c)}),(function(e){r("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return r("throw",e,i,c)}))}c(l.arg)}(a,o,r,i)}))}return r=r?r.then(i,i):i()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return s;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,s;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,s):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function k(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:N}}function N(){return{value:void 0,done:!0}}return f.prototype=m,c(g,"constructor",m),c(m,"constructor",f),f.displayName=c(m,i,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,i,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},v(y.prototype),c(y.prototype,o,(function(){return this})),e.AsyncIterator=y,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new y(l(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},v(g),c(g,i,"Generator"),c(g,a,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=k,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,s):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),s},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),s}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;w(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(b={exports:{}}),b.exports);u(".be_InfoBox{background:var(--background-primary,#fff);border:1px solid var(--border-color,rgba(0,0,0,.12));border-radius:10px;box-shadow:var(--box-shadow);color:var(--text-high,rgba(0,0,0,.87));height:25vh;height:100%;position:inherit;text-align:left}.be_header{font-family:Nunito;font-size:1.1em;margin:0 24px 0 0;word-break:break-all}.be_phases{border-radius:8px;font-family:Nunito Sans;font-size:.9em;height:calc(100% - 24px);overflow:auto;scrollbar-width:thin;text-align:left}.be_close-button{color:var(--background-primary,#fff);height:24px}.be_close-button:hover{cursor:pointer}.be_closeDot{align-items:center;background-color:var(--text-low,#9e9e9e);border-radius:50%;display:flex;height:24px;justify-content:center;margin:12px;position:absolute;right:0;top:0;width:24px}.be_closeDot:hover{background-color:var(--text-medium,#666)}");var v=function(e){var t=e.phaseName;return n.createElement("p",null,null!=t?t:"Unknown phase")},y=function(e){var t,r=e.node,o=e.setNode,i=e.data.nodes.find((function(e){return e.id===r})),c=null!=(t=null==i?void 0:i.name)?t:"";if(""===c)return null;var l,u=(l=null==i?void 0:i.phases)?l.map((function(e){return e.name})):null;return n.createElement("div",{className:"be_InfoBox"},n.createElement("div",{className:"be_closeDot"},n.createElement(a.CgClose,{className:"be_close-button",onClick:function(){return o(""),void function(){for(var e=document.getElementsByClassName("be_transparent");e.length;)e[0].classList.remove("be_transparent")}()}})),n.createElement("h3",{className:"be_header"}," ",c," "),n.createElement("div",{className:"be_phases"},n.createElement("p",null,n.createElement("b",null,"Phases:")),u?null==u?void 0:u.map((function(e,t){return n.createElement(v,{key:t,phaseName:e})})):"No node information"))},x=function(){var e=p(g.mark((function e(t){var n;return g.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=document.getElementById("be_chart")){e.next=4;break}return console.error("Failed getting birds-eye chart element ref!"),e.abrupt("return");case 4:return e.next=6,o.toSvg(n);case 6:E(e.sent,t);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),E=function(){var e=p(g.mark((function e(t,n){var r,a,o;return g.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return r=e.sent,e.next=5,r.blob();case 5:a=URL.createObjectURL(e.sent),(o=document.createElement("a")).href=a,o.download=n,document.body.appendChild(o),o.click(),document.body.removeChild(o);case 13:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();u(":root{--be_box-shadow:0 1px 2px 0 rgba(0,0,0,0.22)}.be_legend{height:-moz-fit-content;height:fit-content;margin:24px;max-width:412px;min-width:200px;position:absolute;width:32%;z-index:1}.be_InfoBox,.be_legendTextContainer{padding:12px;width:100%}.be_legendTextContainer{background:var(--background-primary,#fff);border:1px solid var(--border-color,rgba(0,0,0,.12));border-radius:10px;box-shadow:var(--be_box-shadow);display:grid;flex-direction:column;font-family:Nunito Sans;list-style:none}.be_downloadButton{background-color:var(--accent-800,#138637);border-radius:24px;border-style:none;justify-self:end;margin:8px 0;padding:8px 16px;width:-moz-fit-content;width:fit-content}.be_downloadButton:hover{background-color:var(--accent-500,#29b455);cursor:pointer}.be_downloadButton>p{color:var(--background-primary,#fff);font-size:1.2em;font-weight:700;margin:0;padding:0;text-decoration:none}.be_desc{font-size:.9rem;left:7px;position:relative;top:-5px}.be_dot{background-color:#bbb;border-radius:50%;display:inline-block;height:15px;width:15px}.be_legend p{font-family:Nunito Sans}.be_legend h1,.be_legend h2,.be_legend h3,.be_legend h4,.be_networkName{font-family:Nunito}.be_networkName{font-size:1.5em;font-weight:700;margin:8px;text-align:center}.be_headerForUpper{font-family:Nunito;font-size:1.3em;margin:0}");var w=function(e){var r=e.data,a=e.node,o=e.setNode,i=t.useState(!1),c=i[0],l=i[1],u=function(){var e=p(g.mark((function e(t){return g.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:l(!0),setTimeout(p(g.mark((function e(){return g.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x("Workspace map of "+t+" - "+(new Date).toDateString());case 2:l(!1);case 3:case"end":return e.stop()}}),e)}))),5);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return n.createElement("legend",{className:"be_legend"},n.createElement("ul",{className:"be_legendTextContainer"},n.createElement("div",null,n.createElement("p",{className:"be_headerForUpper"},n.createElement("b",null,"How to use Bird's eye:")),n.createElement("p",{style:{fontSize:".9em"}},"Click a Dataset or a Workflow to see phase information and connections"," "),n.createElement("p",{style:{fontSize:".9em"}},"Close the phase window to return to normal view")),n.createElement("li",null,n.createElement("span",{className:"be_dot",style:{background:"var(--primary-500, #253c56)",marginBottom:"3px"}}),n.createElement("span",{className:"be_desc"},"Dataset")),n.createElement("li",null,n.createElement("span",{className:"be_dot",style:{background:"var(--accent-800, #138637)",marginBottom:"3px"}}),n.createElement("span",{className:"be_desc"},"Workflow")),n.createElement("button",{className:"be_downloadButton",onClick:function(){u(r.name)}},n.createElement("p",null,c?"Generating...":"Download Map"))),n.createElement(y,{data:r,node:a,setNode:o}))};u(".be_Map{display:flex;flex-wrap:wrap}#be_chart{width:100%}"),u(".be_sidebar{background:var(--container-background,#253c56);bottom:0;color:#aeb7c0;left:0;overflow-y:auto;padding:20px;position:sticky;right:0;top:0;width:500px}.be_sidebar-header{align-items:center;display:flex;flex-direction:row;justify-content:space-between}.be_sidebar-header>button{align-items:center;background:none;border:none;border-radius:100%;color:#fff;cursor:pointer;display:flex;font-size:1.1em;height:48px;justify-content:center;padding:5px;transition:background-color .15s;width:48px}.be_sidebar-header>button:hover{background:hsla(0,0%,100%,.034)}.be_sidebar-header>button>svg{height:24px;width:24px}.be_doc{overflow:auto;padding:5%;scroll-behavior:smooth;width:100%}@media print{.be_doc{padding:0;transform:scale(.99)}}.be_chapter{line-height:2.2em;list-style:none outside none;padding-left:0}.be_chapter a{color:#c2c9d1;text-decoration:none}.be_chapter a:hover{color:#8dabd1;cursor:pointer}.be_chapter li{color:var(--sidebar-non-existant);display:flex}.be_chapter li.chapter-item{line-height:1.5em;margin-top:.6em}.be_section{line-height:1.9em;list-style:none outside none;padding-left:20px}");var _=function(e){var t=e.children,r=e.contentRef;return n.createElement("div",{className:"be_sidebar no-print"},n.createElement("div",{className:"be_sidebar-header"},n.createElement("h2",null,"Table of Contents"),n.createElement(c,{trigger:function(){return n.createElement("button",{title:"Print PDF"},n.createElement(i.MdPrint,null))},content:function(){return r.current}})),n.createElement("ol",{className:"be_chapter"},t))};u(".be_Functions{display:flex;height:100vh}.be_code-block{background:var(--background-secondary,#f6f8fa);border-radius:6px;padding:16px}.be_code-block *{font-family:monospace}.be_fields{margin-bottom:90px}");var k=function(e){return e.match(/^[0-9a-fA-F]{24}$/)?null:e},N=function(e,t){var n=e.find((function(e){return e.id===t}));if(null==n)throw new Error("No process found!");return n},L=function(e,t){var n,r;return null!=(n=null==(r=t.find((function(t){return t.id===e})))?void 0:r.name)?n:k(e)},j=function(e,t){return t.find((function(t){return t.id===e}))},F=function(e){var t=e.node,r=e.nodes,a=t.functions&&t.functions.map((function(e,a){var o,i,c=(e.functionVariables?Object.keys(e.functionVariables):[]).map((function(a){return(Array.isArray(e.functionVariables[a])?e.functionVariables[a]:[e.functionVariables[a]]).map((function(e,o){var i;return n.createElement("tr",{key:a+" - "+o+" -"+e.data[(null==(i=e.data)?void 0:i.length)-1]},n.createElement("td",null,a),n.createElement("td",null,function(e,t,n){var r,a;switch(e.type){case"=":return a=null!=(r=e.data[e.data.length-1])?r:"","Field: "+L(a,t.fields);case">":return function(){var r,a=e.data,o=a[0],i=a[1],c=null==(r=j(o,t.fields))?void 0:r.data;if(c)for(var l,u=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return h(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,void 0):void 0}}(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(c);!(l=u()).done;){var s=l.value;try{var d=N(n,s);if(j(i,d.fields))return"Linked to Field: "+L(i,d.fields)+" from "+d.name+" in "+L(o,t.fields)}catch(e){console.log("Failing process ID: ",s)}}return"Couldn't find dependency"}();case"<":return function(){var t=e.data,r=t[0],a=t[1];try{var o=N(n,r);return"Linked from field: "+L(a,o.fields)+" of "+o.name}catch(e){console.log("Failing process ID: ",r)}return"Couldn't find dependency"}();default:return function(){var t,r=e.data,a=r[0],o=r[1];try{var i,c=N(n,a);return c?o?"Phase Id: "+(null==(t=o,i=c.phases.find((function(e){return e.id===t})))?void 0:i.name)+" of "+c.name:"Process Id: "+c.name:"Unknown process"}catch(e){console.log("Failing process ID: ",a)}return"Unknown process"}()}}(e,t,r)))}))})).flat();return n.createElement("article",{key:t.id+"-"+e.label+"-"+a},n.createElement("h3",{id:t.name+"-"+e.label},e.label),n.createElement("p",null,null!=(o=e.description)?o:""),n.createElement("div",{className:"be_code-block"},n.createElement(l,{className:"language-javascript"},null!=(i=e.function)?i:"Functions enabled but no functions found")),c.length?n.createElement(n.Fragment,null,n.createElement("h4",null,"Dependencies"),n.createElement("table",{className:"be_fields"},n.createElement("thead",null,n.createElement("tr",null,n.createElement("th",null,"Name"),n.createElement("th",null,"Assigned to"))),n.createElement("tbody",null,c))):null)}));return n.createElement("section",{className:"be_process-section"},n.createElement("h2",{id:t.name},t.name),n.createElement("hr",null),a)};function T(e,t){var n,r=document.getElementById(t),a=null!=(n=null==r?void 0:r.offsetTop)?n:0,o=document.querySelector(e);o&&(o.scrollTop=a)}var C=function(e){var t=e.node,r=t.functions&&t.functions.map((function(e,r){return n.createElement("li",{key:"toc"+t.id+"-"+e.label+"-"+r,className:"be_chapter-item"},n.createElement("a",{onClick:function(){return T(".be_doc",t.name+"-"+e.label)}},e.label))}));return n.createElement(n.Fragment,null,n.createElement("li",{className:"be_chapter-item"},n.createElement("a",{onClick:function(){return T(".be_doc",""+t.name)}},t.name)),n.createElement("li",{className:"be_chapter-item"},n.createElement("ol",null,r)))},S=function(e){var t=e.node,r=e.fields,a=e.phases,o=e.type;return n.createElement("section",{key:t.id},n.createElement("h2",{id:t.name+"-"+e.index},t.name),n.createElement("h3",null,"Fields"),n.createElement("table",{className:"be_fields"},n.createElement("thead",null,n.createElement("tr",null,n.createElement("th",null,"Name"),n.createElement("th",null,"Type"),n.createElement("th",null,"Description"),n.createElement("th",null,"Placeholder"),n.createElement("th",null,"Default Value"),n.createElement("th",null,"Required"),n.createElement("th",null,"Options"),n.createElement("th",null,"Field ID"))),n.createElement("tbody",null,r)),n.createElement("h3",null,"dataset"===o?"Categories":"Phases"),n.createElement("table",{className:"be_fields"},n.createElement("thead",null,n.createElement("tr",null,n.createElement("th",null,"Name"),"dataset"===o?null:n.createElement("th",null,"Linked To"),n.createElement("th",null,"Phase ID"))),n.createElement("tbody",null,a)),n.createElement("hr",{style:{marginTop:"100px"}}))};u(".be_Processes{display:flex;height:100vh}.be_fields{border-collapse:collapse;font-family:Arial,Helvetica,sans-serif;width:100%}.be_fields td,.be_fields th{border:1.5px solid #ddd;padding:8px}.be_fields tr:nth-child(2n){background:var(--background-primary-alt,#f2f2f2)}.be_fields th{background-color:var(--container-background,#253c56);color:#aeb7c0;padding-bottom:12px;padding-top:12px;text-align:left}.be_function-icon{background-color:var(--background-secondary,#eaebf1);border-radius:50%;color:var(--text-high,#000);display:inline-block;height:24px;line-height:24px;margin-left:8px;padding:2px;text-align:center;width:24px}");var A=function(e){var t=e.nodes,r=e.type,a=t.filter((function(e){return e.group===r})).map((function(e,a){var o,i,c=null==(o=e.fields)?void 0:o.map((function(e){var r;return e.data&&e.id?(r=e.data.map((function(e){return function(e,t){var n,r;return null!=(n=null==(r=e.find((function(e){return e.id===t})))?void 0:r.name)?n:k(t)}(t,e)})).filter((function(e){return e})).join(", "),n.createElement("tr",{key:e.id},n.createElement("td",null,e.name),n.createElement("td",null,function(e){switch(e){case"text":return"Text";case"numeric":return"Numeric";case"textarea":return"Text Area";case"textpredefinedoptions":return"Predefined Options";case"textunit":return"Text with Unit";case"numericunit":return"Numeric with Unit";case"date":return"Date";case"daterange":return"Date Range";case"datetimerange":return"Date & Time Range";case"datetime":return"Date & Time";case"time":return"Time";case"timerange":return"Time Range";case"country":return"Country";case"contacts":return"Contact";case"users":return"User";case"teams":return"Team";case"activitylink":return"Activity Link";case"linkedfrom":return"Linked Activities";case"subheader":return"Subheader";default:return"Unknown Field Type"}}(e.type),e.functionEnabled?n.createElement("div",{className:"be_function-icon"},"ƒ"):null),n.createElement("td",null,e.description||"-"),n.createElement("td",null,e.placeholder||"-"),n.createElement("td",null,e.defaultValue||"-"),n.createElement("td",null,e.required?"Yes":"No"),n.createElement("td",null,"activitylink"===e.type?"Linked To: "+r:r||"-"),n.createElement("td",null,e.id))):(console.warn("Found corrupted field!",e),null)})),l=[];return e.phases&&(l=null==(i=e.phases)?void 0:i.map((function(t){var a,o;return t.id?n.createElement("tr",{key:t.id},n.createElement("td",null,t.name),"dataset"===r?null:n.createElement("td",null,null!=(a=t.linkedTo)&&a.length?null==(o=t.linkedTo)?void 0:o.map((function(t){var n,r=null==(n=e.phases)?void 0:n.find((function(e){return e.id===t}));return(null==r?void 0:r.name)||"undefined"})).join(", "):"-"),n.createElement("td",null,t.id)):(console.warn("Found corrupted phase!",t),null)}))),n.createElement(S,{key:"comp-"+e.id+"-"+a,node:e,fields:c,phases:l,index:a,type:r})}));return n.createElement("div",{id:"be_"+r,className:"be_Tables"},n.createElement("h1",null,"workflow"===r?"Workflows":"Datasets"),n.createElement("hr",null),a)},D=function(e){return e.map((function(e,t){return n.createElement("li",{className:"be_chapter-item",key:"be_chapter-item-"+t},n.createElement("a",{onClick:function(){return T(".be_doc",e.name+"-"+t)}},e.name))})).flat()};exports.Functions=function(e){var r=e.nodes,a=e.network,o=r.filter((function(e){return e.functions&&e.functions.length>0})),i=t.useRef(null),c=o.map((function(e,t){return n.createElement(C,{key:"toc"+e.id+"-"+t,node:e})})),l=o.map((function(e,t){return n.createElement(F,{key:e.id+"-"+t,node:e,nodes:r})}));return n.createElement("div",{className:"be_Functions"},n.createElement(_,{contentRef:i},c),n.createElement("div",{className:"be_doc",ref:i},n.createElement("h1",null,a," functions"),l))},exports.Map=function(e){var a=e.data,o=t.useState(""),i=o[1];return n.createElement("div",{className:"be_Map"},n.createElement(w,{data:a,node:o[0],setNode:i}),n.createElement("div",{id:"be_chart"},n.createElement(f,{data:a,updateNode:function(e){i(e),a&&function(e,t){var n=e.nodes,a=e.links,o=a.filter((function(e){return e.source===t||e.target===t})),i=n.filter((function(e){return o.find((function(t){return t.source===e.id||t.target===e.id}))}));r.selectAll("#be_graph > g > g path").attr("class",(function(){return"be_transparent"})),a.forEach((function(e){r.select("#"+e.id).attr("class",(function(){return o.some((function(t){return t.id===e.id}))?"":"be_transparent"}))})),n.forEach((function(e){r.select("#g"+e.id).attr("class",(function(){return i.some((function(t){return t.id===e.id}))?"":"be_transparent"}))})),r.select("#g"+t).attr("class","")}(a,e)}})))},exports.Processes=function(e){var r=e.nodes,a=r.filter((function(e){return"workflow"===e.group})),o=r.filter((function(e){return"dataset"===e.group})),i=D(a),c=D(o),l=t.useRef(null);return n.createElement("div",{className:"be_Processes"},n.createElement(_,{contentRef:l},n.createElement("li",{className:"be_chapter-item"},n.createElement("a",{onClick:function(){return T(".be_doc","be_workflow")},style:{fontSize:"1.2em"}},"Workflows")),n.createElement("li",{className:"be_chapter-item"},n.createElement("ol",null,i)),n.createElement("li",{className:"be_chapter-item"},n.createElement("a",{onClick:function(){return T(".be_doc","be_dataset")},style:{fontSize:"1.2em"}},"Datasets")),n.createElement("li",{className:"be_chapter-item"},n.createElement("ol",null,c))),n.createElement("div",{className:"be_doc",ref:l},n.createElement(A,{nodes:r,type:"workflow"}),n.createElement(A,{nodes:r,type:"dataset"})))};
//# sourceMappingURL=birds-eye.cjs.production.min.js.map