!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babylonjs")):"function"==typeof define&&define.amd?define("babylonjs-node-editor",["babylonjs"],t):"object"==typeof exports?exports["babylonjs-node-editor"]=t(require("babylonjs")):e.NODEEDITOR=t(e.BABYLON)}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));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=127)}([function(t,n){t.exports=e},function(e,t,n){"use strict";e.exports=n(128)},function(e,t,n){e.exports=n(135)()},function(e,t,n){var r;try{r={cloneDeep:n(267),constant:n(62),defaults:n(268),each:n(92),filter:n(95),find:n(269),flatten:n(122),forEach:n(93),forIn:n(274),has:n(106),isUndefined:n(107),last:n(275),map:n(108),mapValues:n(276),max:n(277),merge:n(279),min:n(285),minBy:n(286),now:n(287),pick:n(288),range:n(293),reduce:n(110),sortBy:n(296),uniqueId:n(301),values:n(115),zipObject:n(302)}}catch(e){}r||(r=window._),e.exports=r},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return b});var r=n(70),o=n(2),i=n.n(o),a=n(1),l=n.n(a);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function d(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0||!Array.isArray(t)&&t?c({},e,t):{}}function v(e){return null===e?null:"object"===s(e)&&e.prefix&&e.iconName?e:Array.isArray(e)&&2===e.length?{prefix:e[0],iconName:e[1]}:"string"==typeof e?{prefix:"fas",iconName:e}:void 0}function b(e){var t=e.icon,n=e.mask,o=e.symbol,i=e.className,a=e.title,l=v(t),s=g("classes",[].concat(d(function(e){var t,n=(c(t={"fa-spin":e.spin,"fa-pulse":e.pulse,"fa-fw":e.fixedWidth,"fa-inverse":e.inverse,"fa-border":e.border,"fa-li":e.listItem,"fa-flip-horizontal":"horizontal"===e.flip||"both"===e.flip,"fa-flip-vertical":"vertical"===e.flip||"both"===e.flip},"fa-".concat(e.size),null!==e.size),c(t,"fa-rotate-".concat(e.rotation),null!==e.rotation),c(t,"fa-pull-".concat(e.pull),null!==e.pull),t);return Object.keys(n).map(function(e){return n[e]?e:null}).filter(function(e){return e})}(e)),d(i.split(" ")))),p=g("transform","string"==typeof e.transform?r.b.transform(e.transform):e.transform),f=g("mask",v(n)),h=Object(r.a)(l,u({},s,p,f,{symbol:o,title:a}));if(!h)return function(){var e;!m&&console&&"function"==typeof console.error&&(e=console).error.apply(e,arguments)}("Could not find icon",l),null;var w=h.abstract,x={};return Object.keys(e).forEach(function(t){b.defaultProps.hasOwnProperty(t)||(x[t]=e[t])}),y(w[0],x)}b.displayName="FontAwesomeIcon",b.propTypes={border:i.a.bool,className:i.a.string,mask:i.a.oneOfType([i.a.object,i.a.array,i.a.string]),fixedWidth:i.a.bool,inverse:i.a.bool,flip:i.a.oneOf(["horizontal","vertical","both"]),icon:i.a.oneOfType([i.a.object,i.a.array,i.a.string]),listItem:i.a.bool,pull:i.a.oneOf(["right","left"]),pulse:i.a.bool,rotation:i.a.oneOf([90,180,270]),size:i.a.oneOf(["lg","xs","sm","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:i.a.bool,symbol:i.a.oneOfType([i.a.bool,i.a.string]),title:i.a.string,transform:i.a.oneOfType([i.a.string,i.a.object])},b.defaultProps={border:!1,className:"",mask:null,fixedWidth:!1,inverse:!1,flip:null,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,symbol:!1,title:"",transform:null};var y=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof n)return n;var o=(n.children||[]).map(function(n){return e(t,n)}),i=Object.keys(n.attributes||{}).reduce(function(e,t){var r=n.attributes[t];switch(t){case"class":e.attrs.className=r,delete n.attributes.class;break;case"style":e.attrs.style=r.split(";").map(function(e){return e.trim()}).filter(function(e){return e}).reduce(function(e,t){var n,r=t.indexOf(":"),o=h.camelize(t.slice(0,r)),i=t.slice(r+1).trim();return o.startsWith("webkit")?e[(n=o,n.charAt(0).toUpperCase()+n.slice(1))]=i:e[o]=i,e},{});break;default:0===t.indexOf("aria-")||0===t.indexOf("data-")?e.attrs[t.toLowerCase()]=r:e.attrs[h.camelize(t)]=r}return e},{attrs:{}}),a=r.style,l=void 0===a?{}:a,s=p(r,["style"]);return i.attrs.style=u({},i.attrs.style,l),t.apply(void 0,[n.tag,u({},i.attrs,s)].concat(d(o)))}.bind(null,l.a.createElement)}).call(this,n(19))},function(e,t,n){"use strict";var r=n(3),o=n(10).Graph;function i(e,t,n,o){var i;do{i=r.uniqueId(o)}while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function a(e){return r.max(r.map(e.nodes(),function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n}))}e.exports={addDummyNode:i,simplify:function(e){var t=(new o).setGraph(e.graph());return r.forEach(e.nodes(),function(n){t.setNode(n,e.node(n))}),r.forEach(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),t},asNonCompoundGraph:function(e){var t=new o({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),r.forEach(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t},successorWeights:function(e){var t=r.map(e.nodes(),function(t){var n={};return r.forEach(e.outEdges(t),function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),function(t){var n={};return r.forEach(e.inEdges(t),function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,o=e.x,i=e.y,a=t.x-o,l=t.y-i,s=e.width/2,c=e.height/2;if(!a&&!l)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(l)*s>Math.abs(a)*c?(l<0&&(c=-c),n=c*a/l,r=c):(a<0&&(s=-s),n=s,r=s*l/a);return{x:o+n,y:i+r}},buildLayerMatrix:function(e){var t=r.map(r.range(a(e)+1),function(){return[]});return r.forEach(e.nodes(),function(n){var o=e.node(n),i=o.rank;r.isUndefined(i)||(t[i][o.order]=n)}),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),function(t){return e.node(t).rank}));r.forEach(e.nodes(),function(n){var o=e.node(n);r.has(o,"rank")&&(o.rank-=t)})},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),function(t){return e.node(t).rank})),n=[];r.forEach(e.nodes(),function(r){var o=e.node(r).rank-t;n[o]||(n[o]=[]),n[o].push(r)});var o=0,i=e.graph().nodeRankFactor;r.forEach(n,function(t,n){r.isUndefined(t)&&n%i!=0?--o:o&&r.forEach(t,function(t){e.node(t).rank+=o})})},addBorderNode:function(e,t,n,r){var o={width:0,height:0};arguments.length>=4&&(o.rank=n,o.order=r);return i(e,"border",o,t)},maxRank:a,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},function(e,t,n){var r;try{r={clone:n(155),constant:n(62),each:n(92),filter:n(95),has:n(106),isArray:n(4),isEmpty:n(231),isFunction:n(28),isUndefined:n(107),keys:n(15),map:n(108),reduce:n(110),size:n(234),transform:n(240),union:n(241),values:n(115)}}catch(e){}r||(r=window._),e.exports=r},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(129)},function(e,t,n){var r;try{r=n(153)}catch(e){}r||(r=window.graphlib),e.exports=r},function(e,t,n){var r=n(75),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(28),o=n(56);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(211),o=n(221),i=n(18),a=n(4),l=n(228);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?a(e)?o(e[0],e[1]):r(e):l(e)}},function(e,t,n){var r=n(78),o=n(58),i=n(13);e.exports=function(e){return i(e)?r(e):o(e)}},function(e,t,n){var r=n(166),o=n(171);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(21),o=n(167),i=n(168),a="[object Null]",l="[object Undefined]",s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?l:a:s&&s in Object(e)?o(e):i(e)}},function(e,t){e.exports=function(e){return e}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(11).Symbol;e.exports=r},function(e,t,n){(function(e){var r=n(11),o=n(187),i=t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,l=a&&a.exports===i?r.Buffer:void 0,s=(l?l.isBuffer:void 0)||o;e.exports=s}).call(this,n(55)(e))},function(e,t,n){var r=n(78),o=n(191),i=n(13);e.exports=function(e){return i(e)?r(e,!0):o(e)}},function(e,t,n){var r=n(196),o=n(52),i=n(197),a=n(87),l=n(198),s=n(17),c=n(76),u=c(r),p=c(o),d=c(i),f=c(a),h=c(l),m=s;(r&&"[object DataView]"!=m(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=m(new o)||i&&"[object Promise]"!=m(i.resolve())||a&&"[object Set]"!=m(new a)||l&&"[object WeakMap]"!=m(new l))&&(m=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case u:return"[object DataView]";case p:return"[object Map]";case d:return"[object Promise]";case f:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=m},function(e,t,n){var r=n(17),o=n(12),i="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||o(e)&&r(e)==i}},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"});return[n].concat(i).concat([o]).join("\n")}var a;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o=0&&u.splice(t,1)}function g(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),v(t,e.attrs),h(e,t),t}function v(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function b(e,t){var n,r,o,i;if(t.transform&&e.css){if(!(i=t.transform(e.css)))return function(){};e.css=i}if(t.singleton){var a=c++;n=s||(s=g(t)),r=x.bind(null,n,a,!1),o=x.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(t,e.attrs),h(e,t),t}(t),r=function(e,t,n){var r=n.css,o=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||i)&&(r=p(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(a),l&&URL.revokeObjectURL(l)}.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(t),r=function(e,t){var n=t.css,r=t.media;r&&e.setAttribute("media",r);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=f(e,t);return d(n,t),function(e){for(var r=[],o=0;o-1&&e%1==0&&e0&&l.push({label:"Mesh attribute",value:1}),n.length>0&&l.push({label:"System value",value:2});return o.createElement("div",null,o.createElement(W,{globalState:this.props.globalState,block:this.props.block}),o.createElement(v,{title:"PROPERTIES"},t.isUniform&&!t.isSystemValue&&t.animationType===a.AnimatedInputBlockTypes.None&&o.createElement(D,{label:"Type",options:[{label:"None",value:0},{label:"Visible in the inspector",value:1},{label:"Constant",value:2}],target:t,noDirectUpdate:!0,getSelection:function(e){return e.visibleInInspector?1:e.isConstant?2:0},onSelect:function(n){switch(n){case 0:t.visibleInInspector=!1,t.isConstant=!1;break;case 1:t.visibleInInspector=!0,t.isConstant=!1;break;case 2:t.visibleInInspector=!1,t.isConstant=!0}e.forceUpdate(),e.props.globalState.onUpdateRequiredObservable.notifyObservers(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}}),t.visibleInInspector&&o.createElement(F,{globalState:this.props.globalState,label:"Group",propertyName:"groupInInspector",target:this.props.block,onChange:function(){e.forceUpdate(),e.props.globalState.onUpdateRequiredObservable.notifyObservers(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}}),o.createElement(D,{label:"Mode",options:l,target:t,noDirectUpdate:!0,getSelection:function(e){return e.isAttribute?1:e.isSystemValue?2:0},onSelect:function(o){switch(o){case 0:t.isUniform=!0,t.setAsSystemValue(null),e.setDefaultValue();break;case 1:t.setAsAttribute(r[0].value);break;case 2:t.setAsSystemValue(n[0].value)}e.forceUpdate(),e.props.globalState.onUpdateRequiredObservable.notifyObservers(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}}),t.isAttribute&&o.createElement(D,{label:"Attribute",valuesAreStrings:!0,options:r,target:t,propertyName:"name",onSelect:function(n){t.setAsAttribute(n),e.forceUpdate(),e.props.globalState.onUpdateRequiredObservable.notifyObservers(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}}),t.isUniform&&i.length>0&&o.createElement(D,{label:"Animation type",options:i,target:t,propertyName:"animationType",onSelect:function(t){e.forceUpdate(),e.props.globalState.onUpdateRequiredObservable.notifyObservers(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}}),t.isUniform&&!t.isSystemValue&&t.animationType===a.AnimatedInputBlockTypes.None&&this.renderValue(this.props.globalState),t.isUniform&&t.isSystemValue&&o.createElement(D,{label:"System value",options:n,target:t,propertyName:"systemValue",onSelect:function(n){t.setAsSystemValue(n),e.forceUpdate(),e.props.globalState.onUpdateRequiredObservable.notifyObservers(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}})))},t}(o.Component),q=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.render=function(){var e=this;return o.createElement(o.Fragment,null,o.createElement(W,{globalState:this.props.globalState,block:this.props.block}),o.createElement(v,{title:"PROPERTIES"},o.createElement(k,{label:"Transform as direction",onSelect:function(t){var n=e.props.block;n.complementW=t?0:1,e.props.globalState.onRebuildRequiredObservable.notifyObservers()},isSelected:function(){return 0===e.props.block.complementW}})))},t}(o.Component),Z=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.render=function(){var e=this;return o.createElement(o.Fragment,null,o.createElement(W,{globalState:this.props.globalState,block:this.props.block}),o.createElement(v,{title:"PROPERTIES"},o.createElement(k,{label:"Invert X axis",target:this.props.block,propertyName:"invertX",onValueChanged:function(){return e.props.globalState.onRebuildRequiredObservable.notifyObservers()}}),o.createElement(k,{label:"Invert Y axis",target:this.props.block,propertyName:"invertY",onValueChanged:function(){return e.props.globalState.onRebuildRequiredObservable.notifyObservers()}})))},t}(o.Component),Q=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.render=function(){var e=this;return o.createElement(o.Fragment,null,o.createElement(W,{globalState:this.props.globalState,block:this.props.block}),o.createElement(v,{title:"PROPERTIES"},o.createElement(k,{label:"Use Manhattan Distance",target:this.props.block,propertyName:"manhattanDistance",onValueChanged:function(){return e.props.globalState.onRebuildRequiredObservable.notifyObservers()}})))},t}(o.Component),K=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.forceRebuild=function(){this.props.globalState.onUpdateRequiredObservable.notifyObservers(),this.props.globalState.onRebuildRequiredObservable.notifyObservers()},t.prototype.render=function(){var e=this,t=this.props.block;return o.createElement("div",null,o.createElement(W,{globalState:this.props.globalState,block:this.props.block}),o.createElement(v,{title:"PROPERTIES"},o.createElement(E,{globalState:this.props.globalState,label:"Minimum",propertyName:"minimum",target:t,onChange:function(){return e.forceRebuild()}}),o.createElement(E,{globalState:this.props.globalState,label:"Maximum",propertyName:"maximum",target:t,onChange:function(){return e.forceRebuild()}})))},t}(o.Component),$=function(e){function t(t){var n=e.call(this,t)||this;return n.state={gradient:t.step.step},n}return u(t,e),t.prototype.updateColor=function(e){this.props.step.color=a.Color3.FromHexString(e),this.props.onUpdateStep(),this.forceUpdate()},t.prototype.updateStep=function(e){this.props.step.step=e,this.setState({gradient:e}),this.props.onUpdateStep()},t.prototype.onPointerUp=function(){this.props.onCheckForReOrder()},t.prototype.render=function(){var e=this,t=this.props.step;return o.createElement("div",{className:"gradient-step"},o.createElement("div",{className:"step"},"#"+this.props.lineIndex),o.createElement("input",{type:"color",value:t.color.toHexString(),onChange:function(t){return e.updateColor(t.target.value)}}),o.createElement("div",{className:"step-value"},t.step.toFixed(2)),o.createElement("div",{className:"step-slider"},o.createElement("input",{className:"range",type:"range",step:.01,min:0,max:1,value:t.step,onPointerUp:function(t){return e.onPointerUp()},onChange:function(t){return e.updateStep(parseFloat(t.target.value))}})),o.createElement("div",{className:"gradient-delete",onClick:function(){return e.props.onDelete()}},o.createElement(d.a,{icon:g})))},t}(o.Component),J=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.forceRebuild=function(){this.props.globalState.onUpdateRequiredObservable.notifyObservers(),this.props.globalState.onRebuildRequiredObservable.notifyObservers()},t.prototype.deleteStep=function(e){var t=this.props.block,n=t.colorSteps.indexOf(e);n>-1&&(t.colorSteps.splice(n,1),this.forceRebuild(),this.forceUpdate())},t.prototype.addNewStep=function(){var e=this.props.block,t=new a.GradientBlockColorStep(1,a.Color3.White());e.colorSteps.push(t),this.forceRebuild(),this.forceUpdate()},t.prototype.checkForReOrder=function(){this.props.block.colorSteps.sort(function(e,t){return e.step===t.step?0:e.step>t.step?1:-1}),this.props.globalState.onUpdateRequiredObservable.notifyObservers(),this.forceUpdate()},t.prototype.render=function(){var e=this,t=this.props.block;return o.createElement("div",null,o.createElement(W,{globalState:this.props.globalState,block:this.props.block}),o.createElement(v,{title:"STEPS"},o.createElement(w,{label:"Add new step",onClick:function(){return e.addNewStep()}}),t.colorSteps.map(function(t,n){return o.createElement($,{globalState:e.props.globalState,onCheckForReOrder:function(){return e.checkForReOrder()},onUpdateStep:function(){return e.forceRebuild()},key:"step-"+n,lineIndex:n,step:t,onDelete:function(){return e.deleteStep(t)}})})))},t}(o.Component),ee=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this,t=this.props.globalState.nodeMaterial.getScene(),n=t.lights.map(function(e){return{label:e.name,value:e.name}});n.splice(0,0,{label:"All",value:""});var r=this.props.block;return o.createElement("div",null,o.createElement(W,{globalState:this.props.globalState,block:this.props.block}),o.createElement(v,{title:"PROPERTIES"},o.createElement(D,{label:"Light",defaultIfNull:0,noDirectUpdate:!0,valuesAreStrings:!0,options:n,target:r,propertyName:"name",onSelect:function(n){r.light=""===n?null:t.getLightByName(n),e.forceUpdate(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}})))},t}(o.Component),te=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this,t=this.props.globalState.nodeMaterial.getScene(),n=t.lights.map(function(e){return{label:e.name,value:e.name}}),r=this.props.block;return o.createElement("div",null,o.createElement(W,{globalState:this.props.globalState,block:this.props.block}),o.createElement(v,{title:"PROPERTIES"},o.createElement(D,{label:"Light",noDirectUpdate:!0,valuesAreStrings:!0,options:n,target:r,propertyName:"name",onSelect:function(n){r.light=t.getLightByName(n),e.forceUpdate(),e.props.globalState.onRebuildRequiredObservable.notifyObservers()}})))},t}(o.Component),ne=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.forceRebuild=function(){this.props.globalState.onUpdateRequiredObservable.notifyObservers(),this.props.globalState.onRebuildRequiredObservable.notifyObservers()},t.prototype.render=function(){var e=this,t=this.props.block;return o.createElement("div",null,o.createElement(W,{globalState:this.props.globalState,block:this.props.block}),o.createElement(v,{title:"PROPERTIES"},o.createElement(N,{globalState:this.props.globalState,label:"From",propertyName:"sourceRange",target:t,onChange:function(){return e.forceRebuild()}}),o.createElement(N,{globalState:this.props.globalState,label:"To",propertyName:"targetRange",target:t,onChange:function(){return e.forceRebuild()}})))},t}(o.Component),re=function(e){function t(t){var n=e.call(this,t)||this,r=n.textureBlock.texture;return n.state={isEmbedded:!r||"data"===r.name.substring(0,4),loadAsCubeTexture:r&&r.isCube},n}return u(t,e),Object.defineProperty(t.prototype,"textureBlock",{get:function(){return this.props.block},enumerable:!0,configurable:!0}),t.prototype.UNSAFE_componentWillUpdate=function(e,t){if(e.block!==this.props.block){var n=e.block.texture;t.isEmbedded=!n||"data"===n.name.substring(0,4),t.loadAsCubeTexture=n&&n.isCube}},t.prototype._generateRandomForCache=function(){return"xxxxxxxxxxxxxxxxxxxx".replace(/[x]/g,function(e){return(10*Math.random()|0).toString()})},t.prototype.updateAfterTextureLoad=function(){this.props.globalState.onUpdateRequiredObservable.notifyObservers(),this.props.globalState.onRebuildRequiredObservable.notifyObservers(),this.forceUpdate()},t.prototype.removeTexture=function(){var e=this.textureBlock.texture;e&&(e.dispose(),e=null,this.textureBlock.texture=null),this.updateAfterTextureLoad()},t.prototype._prepareTexture=function(){var e=this.textureBlock.texture;e&&e.isCube!==this.state.loadAsCubeTexture&&(e.dispose(),e=null),e||(this.state.loadAsCubeTexture?(this.textureBlock.texture=new a.CubeTexture("",this.props.globalState.nodeMaterial.getScene()),(e=this.textureBlock.texture).coordinatesMode=a.Texture.CUBIC_MODE):(this.textureBlock.texture=new a.Texture(null,this.props.globalState.nodeMaterial.getScene(),!1,this.textureBlock instanceof a.ReflectionTextureBlock),(e=this.textureBlock.texture).coordinatesMode=a.Texture.EQUIRECTANGULAR_MODE))},t.prototype.replaceTexture=function(e){var t=this;this._prepareTexture();var n=this.textureBlock.texture;a.Tools.ReadFile(e,function(r){var o=new Blob([r],{type:"octet/stream"}),i=new FileReader;i.readAsDataURL(o),i.onloadend=function(){var r=i.result,o=void 0;e.name.toLowerCase().indexOf(".dds")>0?o=".dds":e.name.toLowerCase().indexOf(".env")>0&&(o=".env"),n.updateURL(r,o,function(){return t.updateAfterTextureLoad()})}},void 0,!0)},t.prototype.replaceTextureWithUrl=function(e){var t=this;this._prepareTexture();var n=this.textureBlock.texture;if(n.isCube||this.textureBlock instanceof a.ReflectionTextureBlock){var r=void 0;e.toLowerCase().indexOf(".dds")>0?r=".dds":e.toLowerCase().indexOf(".env")>0&&(r=".env"),n.updateURL(e,r,function(){return t.updateAfterTextureLoad()})}else n.updateURL(e,null,function(){return t.updateAfterTextureLoad()})},t.prototype.render=function(){var e=this,t="",n=this.textureBlock.texture;n&&n.name&&"data"!==n.name.substring(0,4)&&(t=n.name),t=t.replace(/\?nocache=\d+/,"");var r=this.textureBlock instanceof a.ReflectionTextureBlock,i=[{label:"Cubic",value:a.Texture.CUBIC_MODE},{label:"Equirectangular",value:a.Texture.EQUIRECTANGULAR_MODE},{label:"Explicit",value:a.Texture.EXPLICIT_MODE},{label:"Fixed equirectangular",value:a.Texture.FIXED_EQUIRECTANGULAR_MODE},{label:"Fixed mirrored equirectangular",value:a.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE},{label:"Planar",value:a.Texture.PLANAR_MODE},{label:"Projection",value:a.Texture.PROJECTION_MODE},{label:"Skybox",value:a.Texture.SKYBOX_MODE},{label:"Spherical",value:a.Texture.SPHERICAL_MODE}];return o.createElement("div",null,o.createElement(W,{globalState:this.props.globalState,block:this.props.block}),o.createElement(v,{title:"PROPERTIES"},o.createElement(k,{label:"Auto select UV",propertyName:"autoSelectUV",target:this.props.block,onValueChanged:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(k,{label:"Convert to gamma space",propertyName:"convertToGammaSpace",target:this.props.block,onValueChanged:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&r&&o.createElement(D,{label:"Reflection mode",options:i,target:n,propertyName:"coordinatesMode",onSelect:function(t){n.coordinatesMode=t,e.forceUpdate(),e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(k,{label:"Clamp U",isSelected:function(){return n.wrapU===a.Texture.CLAMP_ADDRESSMODE},onSelect:function(t){n.wrapU=t?a.Texture.CLAMP_ADDRESSMODE:a.Texture.WRAP_ADDRESSMODE,e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(k,{label:"Clamp V",isSelected:function(){return n.wrapV===a.Texture.CLAMP_ADDRESSMODE},onSelect:function(t){n.wrapV=t?a.Texture.CLAMP_ADDRESSMODE:a.Texture.WRAP_ADDRESSMODE,e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(E,{globalState:this.props.globalState,label:"Offset U",target:n,propertyName:"uOffset",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(E,{globalState:this.props.globalState,label:"Offset V",target:n,propertyName:"vOffset",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(E,{globalState:this.props.globalState,label:"Scale U",target:n,propertyName:"uScale",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(E,{globalState:this.props.globalState,label:"Scale V",target:n,propertyName:"vScale",onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(T,{label:"Rotation U",target:n,propertyName:"uAng",minimum:0,maximum:2*Math.PI,useEuler:!0,step:.1,onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(T,{label:"Rotation V",target:n,propertyName:"vAng",minimum:0,maximum:2*Math.PI,useEuler:!0,step:.1,onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}}),n&&!r&&o.createElement(T,{label:"Rotation W",target:n,propertyName:"wAng",minimum:0,maximum:2*Math.PI,useEuler:!0,step:.1,onChange:function(){e.props.globalState.onUpdateRequiredObservable.notifyObservers()}})),o.createElement(v,{title:"SOURCE"},o.createElement(k,{label:"Embed static texture",isSelected:function(){return e.state.isEmbedded},onSelect:function(t){e.setState({isEmbedded:t}),e.textureBlock.texture=null,e.updateAfterTextureLoad()}}),r&&o.createElement(k,{label:"Load as cube texture",isSelected:function(){return e.state.loadAsCubeTexture},onSelect:function(t){return e.setState({loadAsCubeTexture:t})}}),this.state.isEmbedded&&o.createElement(_,{label:"Upload",onClick:function(t){return e.replaceTexture(t)},accept:".jpg, .png, .tga, .dds, .env"}),!this.state.isEmbedded&&o.createElement(F,{label:"Link",globalState:this.props.globalState,value:t,onChange:function(t){return e.replaceTextureWithUrl(t)}}),!this.state.isEmbedded&&t&&o.createElement(w,{label:"Refresh",onClick:function(){return e.replaceTextureWithUrl(t+"?nocache="+e._generateRandomForCache())}}),n&&o.createElement(w,{label:"Remove",onClick:function(){return e.removeTexture()}})))},t}(o.Component),oe=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.render=function(){var e=this,t=this.props.block,n=[{label:"Cos",value:a.TrigonometryBlockOperations.Cos},{label:"Sin",value:a.TrigonometryBlockOperations.Sin},{label:"Abs",value:a.TrigonometryBlockOperations.Abs},{label:"Exp",value:a.TrigonometryBlockOperations.Exp},{label:"Exp2",value:a.TrigonometryBlockOperations.Exp2},{label:"Round",value:a.TrigonometryBlockOperations.Round},{label:"Ceiling",value:a.TrigonometryBlockOperations.Ceiling},{label:"Floor",value:a.TrigonometryBlockOperations.Floor},{label:"ArcCos",value:a.TrigonometryBlockOperations.ArcCos},{label:"ArcSin",value:a.TrigonometryBlockOperations.ArcSin},{label:"ArcTan",value:a.TrigonometryBlockOperations.ArcTan},{label:"Tan",value:a.TrigonometryBlockOperations.Tan},{label:"Log",value:a.TrigonometryBlockOperations.Log},{label:"Fract",value:a.TrigonometryBlockOperations.Fract},{label:"Sign",value:a.TrigonometryBlockOperations.Sign},{label:"Radians to degrees",value:a.TrigonometryBlockOperations.Degrees},{label:"Degrees to radians",value:a.TrigonometryBlockOperations.Radians}];return n.sort(function(e,t){return e.label.localeCompare(t.label)}),o.createElement("div",null,o.createElement(W,{globalState:this.props.globalState,block:this.props.block}),o.createElement(v,{title:"PROPERTIES"},o.createElement(D,{label:"Operation",options:n,target:t,propertyName:"operation",onSelect:function(t){e.props.globalState.onUpdateRequiredObservable.notifyObservers(),e.props.globalState.onRebuildRequiredObservable.notifyObservers(),e.forceUpdate()}})))},t}(o.Component),ie=function(){function e(){}return e.RegisteredControls={},e}();ie.RegisteredControls.TransformBlock=q,ie.RegisteredControls.InputBlock=G,ie.RegisteredControls.PerturbNormalBlock=Z,ie.RegisteredControls.WorleyNoise3DBlock=Q,ie.RegisteredControls.ClampBlock=K,ie.RegisteredControls.GradientBlock=J,ie.RegisteredControls.LightBlock=ee,ie.RegisteredControls.LightInformationBlock=te,ie.RegisteredControls.RemapBlock=ne,ie.RegisteredControls.TextureBlock=re,ie.RegisteredControls.ReflectionTextureBlock=re,ie.RegisteredControls.TrigonometryBlock=oe;var ae=function(){function e(){}return e.GetBlockFromString=function(e,t,n){switch(e){case"DesaturateBlock":return new a.DesaturateBlock("Desaturate");case"RefractBlock":return new a.RefractBlock("Refract");case"ReflectBlock":return new a.ReflectBlock("Reflect");case"DerivativeBlock":return new a.DerivativeBlock("Derivative");case"Rotate2dBlock":return new a.Rotate2dBlock("Rotate2d");case"NormalBlendBlock":return new a.NormalBlendBlock("NormalBlend");case"WorleyNoise3DBlock":return new a.WorleyNoise3DBlock("WorleyNoise3D");case"SimplexPerlin3DBlock":return new a.SimplexPerlin3DBlock("SimplexPerlin3D");case"BonesBlock":return new a.BonesBlock("Bones");case"InstancesBlock":return new a.InstancesBlock("Instances");case"MorphTargetsBlock":return new a.MorphTargetsBlock("MorphTargets");case"DiscardBlock":return new a.DiscardBlock("Discard");case"ImageProcessingBlock":return new a.ImageProcessingBlock("ImageProcessing");case"ColorMergerBlock":return new a.ColorMergerBlock("ColorMerger");case"VectorMergerBlock":return new a.VectorMergerBlock("VectorMerger");case"ColorSplitterBlock":return new a.ColorSplitterBlock("ColorSplitter");case"VectorSplitterBlock":return new a.VectorSplitterBlock("VectorSplitter");case"TextureBlock":return new a.TextureBlock("Texture");case"ReflectionTextureBlock":return new a.ReflectionTextureBlock("Reflection texture");case"LightBlock":return new a.LightBlock("Lights");case"FogBlock":return new a.FogBlock("Fog");case"VertexOutputBlock":return new a.VertexOutputBlock("VertexOutput");case"FragmentOutputBlock":return new a.FragmentOutputBlock("FragmentOutput");case"AddBlock":return new a.AddBlock("Add");case"ClampBlock":return new a.ClampBlock("Clamp");case"ScaleBlock":return new a.ScaleBlock("Scale");case"CrossBlock":return new a.CrossBlock("Cross");case"DotBlock":return new a.DotBlock("Dot");case"PowBlock":return new a.PowBlock("Pow");case"MultiplyBlock":return new a.MultiplyBlock("Multiply");case"TransformBlock":return new a.TransformBlock("Transform");case"TrigonometryBlock":return new a.TrigonometryBlock("Trigonometry");case"RemapBlock":return new a.RemapBlock("Remap");case"NormalizeBlock":return new a.NormalizeBlock("Normalize");case"FresnelBlock":return new a.FresnelBlock("Fresnel");case"LerpBlock":return new a.LerpBlock("Lerp");case"NLerpBlock":return new a.NLerpBlock("NLerp");case"DivideBlock":return new a.DivideBlock("Divide");case"SubtractBlock":return new a.SubtractBlock("Subtract");case"StepBlock":return new a.StepBlock("Step");case"SmoothStepBlock":return new a.SmoothStepBlock("Smooth step");case"OneMinusBlock":return new a.OneMinusBlock("One minus");case"ReciprocalBlock":return new a.ReciprocalBlock("Reciprocal");case"ViewDirectionBlock":return new a.ViewDirectionBlock("View direction");case"LightInformationBlock":var r=new a.LightInformationBlock("Light information");return r.light=t.lights.length?t.lights[0]:null,r;case"MaxBlock":return new a.MaxBlock("Max");case"MinBlock":return new a.MinBlock("Min");case"LengthBlock":return new a.LengthBlock("Length");case"DistanceBlock":return new a.DistanceBlock("Distance");case"NegateBlock":return new a.NegateBlock("Negate");case"PerturbNormalBlock":return new a.PerturbNormalBlock("Perturb normal");case"RandomNumberBlock":return new a.RandomNumberBlock("Random number");case"ReplaceColorBlock":return new a.ReplaceColorBlock("Replace color");case"PosterizeBlock":return new a.PosterizeBlock("Posterize");case"ArcTan2Block":return new a.ArcTan2Block("ArcTan2");case"GradientBlock":return new a.GradientBlock("Gradient");case"FrontFacingBlock":return new a.FrontFacingBlock("Front facing");case"CosBlock":var o=new a.TrigonometryBlock("Cos");return o.operation=a.TrigonometryBlockOperations.Cos,o;case"SinBlock":var i=new a.TrigonometryBlock("Sin");return i.operation=a.TrigonometryBlockOperations.Sin,i;case"AbsBlock":var l=new a.TrigonometryBlock("Abs");return l.operation=a.TrigonometryBlockOperations.Abs,l;case"SqrtBlock":var s=new a.TrigonometryBlock("Sqrt");return s.operation=a.TrigonometryBlockOperations.Sqrt,s;case"ArcCosBlock":var c=new a.TrigonometryBlock("ArcCos");return c.operation=a.TrigonometryBlockOperations.ArcCos,c;case"ArcSinBlock":var u=new a.TrigonometryBlock("ArcSin");return u.operation=a.TrigonometryBlockOperations.ArcSin,u;case"TanBlock":var p=new a.TrigonometryBlock("Tan");return p.operation=a.TrigonometryBlockOperations.Tan,p;case"ArcTanBlock":var d=new a.TrigonometryBlock("ArcTan");return d.operation=a.TrigonometryBlockOperations.ArcTan,d;case"FractBlock":var f=new a.TrigonometryBlock("Fract");return f.operation=a.TrigonometryBlockOperations.Fract,f;case"SignBlock":var h=new a.TrigonometryBlock("Sign");return h.operation=a.TrigonometryBlockOperations.Sign,h;case"LogBlock":var m=new a.TrigonometryBlock("Log");return m.operation=a.TrigonometryBlockOperations.Log,m;case"ExpBlock":var g=new a.TrigonometryBlock("Exp");return g.operation=a.TrigonometryBlockOperations.Exp,g;case"Exp2Block":var v=new a.TrigonometryBlock("Exp2");return v.operation=a.TrigonometryBlockOperations.Exp2,v;case"DegreesToRadiansBlock":var b=new a.TrigonometryBlock("Degrees to radians");return b.operation=a.TrigonometryBlockOperations.Radians,b;case"RadiansToDegreesBlock":var y=new a.TrigonometryBlock("Radians to degrees");return y.operation=a.TrigonometryBlockOperations.Degrees,y;case"RoundBlock":var w=new a.TrigonometryBlock("Round");return w.operation=a.TrigonometryBlockOperations.Round,w;case"CeilingBlock":var x=new a.TrigonometryBlock("Ceiling");return x.operation=a.TrigonometryBlockOperations.Ceiling,x;case"FloorBlock":var _=new a.TrigonometryBlock("Floor");return _.operation=a.TrigonometryBlockOperations.Floor,_;case"SawToothWaveBlock":var C=new a.WaveBlock("SawTooth wave");return C.kind=a.WaveBlockKind.SawTooth,C;case"SquareWaveBlock":var k=new a.WaveBlock("Square wave");return k.kind=a.WaveBlockKind.Square,k;case"TriangleWaveBlock":var E=new a.WaveBlock("Triangle wave");return E.kind=a.WaveBlockKind.Triangle,E;case"WorldMatrixBlock":return(Y=new a.InputBlock("World")).setAsSystemValue(a.NodeMaterialSystemValues.World),Y;case"WorldViewMatrixBlock":var S=new a.InputBlock("World x View");return S.setAsSystemValue(a.NodeMaterialSystemValues.WorldView),S;case"WorldViewProjectionMatrixBlock":var T=new a.InputBlock("World x View x Projection");return T.setAsSystemValue(a.NodeMaterialSystemValues.WorldViewProjection),T;case"ViewMatrixBlock":var P=new a.InputBlock("View");return P.setAsSystemValue(a.NodeMaterialSystemValues.View),P;case"ViewProjectionMatrixBlock":var N=new a.InputBlock("View x Projection");return N.setAsSystemValue(a.NodeMaterialSystemValues.ViewProjection),N;case"ProjectionMatrixBlock":var B=new a.InputBlock("Projection");return B.setAsSystemValue(a.NodeMaterialSystemValues.Projection),B;case"CameraPositionBlock":var O=new a.InputBlock("Camera position");return O.setAsSystemValue(a.NodeMaterialSystemValues.CameraPosition),O;case"FogColorBlock":var M=new a.InputBlock("Fog color");return M.setAsSystemValue(a.NodeMaterialSystemValues.FogColor),M;case"PositionBlock":var L=new a.InputBlock("position");return L.setAsAttribute("position"),L;case"UVBlock":var R=new a.InputBlock("uv");return R.setAsAttribute("uv"),R;case"ColorBlock":var I=new a.InputBlock("color");return I.setAsAttribute("color"),I;case"NormalBlock":var j=new a.InputBlock("normal");return j.setAsAttribute("normal"),j;case"TangentBlock":var A=new a.InputBlock("tangent");return A.setAsAttribute("tangent"),A;case"MatrixIndicesBlock":var D=new a.InputBlock("matricesIndices");return D.setAsAttribute("matricesIndices"),D;case"MatrixWeightsBlock":var z=new a.InputBlock("matricesWeights");return z.setAsAttribute("matricesWeights"),z;case"TimeBlock":var U=new a.InputBlock("Time",void 0,a.NodeMaterialBlockConnectionPointTypes.Float);return U.animationType=a.AnimatedInputBlockTypes.Time,U;case"DeltaTimeBlock":var F=new a.InputBlock("Delta time");return F.setAsSystemValue(a.NodeMaterialSystemValues.DeltaTime),F;case"WorldPositionBlock":var V=n.getInputBlockByPredicate(function(e){return e.isAttribute&&"position"===e.name});V||(V=new a.InputBlock("position")).setAsAttribute("position"),(Y=n.getInputBlockByPredicate(function(e){return e.isSystemValue&&e.systemValue===a.NodeMaterialSystemValues.World}))||(Y=new a.InputBlock("World")).setAsSystemValue(a.NodeMaterialSystemValues.World);var W=new a.TransformBlock("World position");return V.connectTo(W),Y.connectTo(W),W;case"WorldNormalBlock":var H=n.getInputBlockByPredicate(function(e){return e.isAttribute&&"normal"===e.name});H||(H=new a.InputBlock("normal")).setAsAttribute("normal"),(Y=n.getInputBlockByPredicate(function(e){return e.isSystemValue&&e.systemValue===a.NodeMaterialSystemValues.World}))||(Y=new a.InputBlock("World")).setAsSystemValue(a.NodeMaterialSystemValues.World);W=new a.TransformBlock("World normal");return H.connectTo(W),Y.connectTo(W),W;case"WorldTangentBlock":var Y,X=n.getInputBlockByPredicate(function(e){return e.isAttribute&&"tangent"===e.name});X||(X=new a.InputBlock("tangent")).setAsAttribute("tangent"),(Y=n.getInputBlockByPredicate(function(e){return e.isSystemValue&&e.systemValue===a.NodeMaterialSystemValues.World}))||(Y=new a.InputBlock("World")).setAsSystemValue(a.NodeMaterialSystemValues.World);W=new a.TransformBlock("World tangent");return X.connectTo(W),Y.connectTo(W),W}return null},e.GetColorFromConnectionNodeType=function(e){var t="#880000";switch(e){case a.NodeMaterialBlockConnectionPointTypes.Float:t="#cb9e27";break;case a.NodeMaterialBlockConnectionPointTypes.Vector2:t="#16bcb1";break;case a.NodeMaterialBlockConnectionPointTypes.Vector3:case a.NodeMaterialBlockConnectionPointTypes.Color3:t="#b786cb";break;case a.NodeMaterialBlockConnectionPointTypes.Vector4:case a.NodeMaterialBlockConnectionPointTypes.Color4:t="#be5126";break;case a.NodeMaterialBlockConnectionPointTypes.Matrix:t="#591990"}return t},e.GetConnectionNodeTypeFromString=function(e){switch(e){case"Float":return a.NodeMaterialBlockConnectionPointTypes.Float;case"Vector2":return a.NodeMaterialBlockConnectionPointTypes.Vector2;case"Vector3":return a.NodeMaterialBlockConnectionPointTypes.Vector3;case"Vector4":return a.NodeMaterialBlockConnectionPointTypes.Vector4;case"Matrix":return a.NodeMaterialBlockConnectionPointTypes.Matrix;case"Color3":return a.NodeMaterialBlockConnectionPointTypes.Color3;case"Color4":return a.NodeMaterialBlockConnectionPointTypes.Color4}return a.NodeMaterialBlockConnectionPointTypes.AutoDetect},e.GetStringFromConnectionNodeType=function(e){switch(e){case a.NodeMaterialBlockConnectionPointTypes.Float:return"Float";case a.NodeMaterialBlockConnectionPointTypes.Vector2:return"Vector2";case a.NodeMaterialBlockConnectionPointTypes.Vector3:return"Vector3";case a.NodeMaterialBlockConnectionPointTypes.Vector4:return"Vector4";case a.NodeMaterialBlockConnectionPointTypes.Color3:return"Color3";case a.NodeMaterialBlockConnectionPointTypes.Color4:return"Color4";case a.NodeMaterialBlockConnectionPointTypes.Matrix:return"Matrix"}return""},e}(),le=function(){function e(){}return e.prototype.getHeaderClass=function(e){var t=e;return t.isConstant?"constant":t.visibleInInspector?"inspector":""},e.prototype.shouldDisplayPortLabels=function(e){return!1},e.prototype.getHeaderText=function(e){var t=e,n=t.name+" ("+x.GetBaseType(t.output.type)+")";return t.isAttribute&&(n=x.GetBaseType(t.output.type)),n},e.prototype.getBackgroundColor=function(e){var t="",n=e;switch(n.type){case a.NodeMaterialBlockConnectionPointTypes.Color3:case a.NodeMaterialBlockConnectionPointTypes.Color4:if(n.value){t=n.value.toHexString();break}default:t=ae.GetColorFromConnectionNodeType(n.type)}return t},e.prototype.updatePreviewContent=function(e,t){var n="",r=e;if(r.isAttribute)n="mesh."+r.name;else if(r.isSystemValue)switch(r.systemValue){case a.NodeMaterialSystemValues.World:n="World";break;case a.NodeMaterialSystemValues.WorldView:n="World x View";break;case a.NodeMaterialSystemValues.WorldViewProjection:n="World x View x Projection";break;case a.NodeMaterialSystemValues.View:n="View";break;case a.NodeMaterialSystemValues.ViewProjection:n="View x Projection";break;case a.NodeMaterialSystemValues.Projection:n="Projection";break;case a.NodeMaterialSystemValues.CameraPosition:n="Camera position";break;case a.NodeMaterialSystemValues.FogColor:n="Fog color";break;case a.NodeMaterialSystemValues.DeltaTime:n="Delta time"}else switch(r.type){case a.NodeMaterialBlockConnectionPointTypes.Float:n=r.animationType!==a.AnimatedInputBlockTypes.None?a.AnimatedInputBlockTypes[r.animationType]:r.value.toFixed(2);break;case a.NodeMaterialBlockConnectionPointTypes.Vector2:var o=r.value;n="("+o.x.toFixed(2)+", "+o.y.toFixed(2)+")";break;case a.NodeMaterialBlockConnectionPointTypes.Vector3:var i=r.value;n="("+i.x.toFixed(2)+", "+i.y.toFixed(2)+", "+i.z.toFixed(2)+")";break;case a.NodeMaterialBlockConnectionPointTypes.Vector4:var l=r.value;n="("+l.x.toFixed(2)+", "+l.y.toFixed(2)+", "+l.z.toFixed(2)+", "+l.w.toFixed(2)+")"}t.innerHTML=n,t.classList.add("input-block")},e}(),se=function(){function e(){}return e.prototype.getHeaderClass=function(e){return""},e.prototype.shouldDisplayPortLabels=function(e){return!0},e.prototype.getHeaderText=function(e){return e.name},e.prototype.getBackgroundColor=function(e){return"rgb(106, 44, 131)"},e.prototype.updatePreviewContent=function(e,t){t.classList.add("output-block")},e}(),ce=function(){function e(){}return e.prototype.getHeaderClass=function(e){return""},e.prototype.shouldDisplayPortLabels=function(e){return!1},e.prototype.getHeaderText=function(e){return e.name},e.prototype.getBackgroundColor=function(e){return"#4086BB"},e.prototype.updatePreviewContent=function(e,t){var n=e;t.classList.add("clamp-block"),t.innerHTML="["+n.minimum+", "+n.maximum+"]"},e}(),ue=function(){function e(){}return e.prototype.getHeaderClass=function(e){return""},e.prototype.shouldDisplayPortLabels=function(e){return!1},e.prototype.getHeaderText=function(e){return e.name},e.prototype.getBackgroundColor=function(e){var t=e.colorSteps.map(function(e){return"rgb("+255*e.color.r+", "+255*e.color.g+", "+255*e.color.b+") "+100*e.step+"%"});return t.length?"linear-gradient(90deg, "+t.join(", ")+")":"black"},e.prototype.updatePreviewContent=function(e,t){t.classList.add("gradient-block")},e}(),pe=function(){function e(){}return e.prototype.getHeaderClass=function(e){return""},e.prototype.shouldDisplayPortLabels=function(e){return!0},e.prototype.getHeaderText=function(e){return e.name},e.prototype.getBackgroundColor=function(e){return"#4086BB"},e.prototype._extractInputValue=function(e){var t=e.connectedPoint.ownerBlock;if(t.isInput){var n=t;if(n.isUniform&&!n.isSystemValue)return n.value}return"?"},e.prototype.updatePreviewContent=function(e,t){var n=e,r=n.sourceMin.isConnected?this._extractInputValue(n.sourceMin):n.sourceRange.x,o=n.sourceMax.isConnected?this._extractInputValue(n.sourceMax):n.sourceRange.y,i=n.targetMin.isConnected?this._extractInputValue(n.targetMin):n.targetRange.x,a=n.targetMax.isConnected?this._extractInputValue(n.targetMax):n.targetRange.y;t.classList.add("remap-block"),t.innerHTML="["+r+", "+o+"] -> ["+i+", "+a+"]"},e}(),de=function(){function e(){}return e.prototype.getHeaderClass=function(e){return""},e.prototype.shouldDisplayPortLabels=function(e){return!1},e.prototype.getHeaderText=function(e){return e.name},e.prototype.getBackgroundColor=function(e){return"#405C86"},e.prototype.updatePreviewContent=function(e,t){var n=e;t.classList.add("trigonometry-block"),t.innerHTML=a.TrigonometryBlockOperations[n.operation]},e}(),fe=function(e){function t(t){var n=e.call(this,t)||this;return n.state={displayRed:!0,displayGreen:!0,displayBlue:!0,displayAlpha:!0,face:0},n}return u(t,e),t.prototype.shouldComponentUpdate=function(e,t){return!0},t.prototype.componentDidMount=function(){this.updatePreview()},t.prototype.componentDidUpdate=function(){this.updatePreview()},t.prototype.updatePreview=function(){t.UpdatePreview(this.refs.canvas,this.props.texture,this.props.width,this.state,void 0,this.props.globalState)},t.UpdatePreview=function(e,n,r,o,i,l){!n.isReady()&&n._texture&&n._texture.onLoadedObservable.addOnce(function(){t.UpdatePreview(e,n,r,o,i,l)});var s,c=n.getScene(),u=c.getEngine(),p=n.getSize(),d=p.width/p.height,f=r/d|1;if(n.isCube){var h=new a.PassCubePostProcess("pass",1,null,a.Texture.NEAREST_SAMPLINGMODE,u,!1,a.Constants.TEXTURETYPE_UNSIGNED_INT);h.face=o.face,s=h}else s=new a.PassPostProcess("pass",1,null,a.Texture.NEAREST_SAMPLINGMODE,u,!1,a.Constants.TEXTURETYPE_UNSIGNED_INT);if(!s.getEffect().isReady())return s.dispose(),void setTimeout(function(){return t.UpdatePreview(e,n,r,o,i,l)},250);l&&(l.blockMutationUpdates=!0);var m=new a.RenderTargetTexture("temp",{width:r,height:f},c,!1);s.onApply=function(e){e.setTexture("textureSampler",n)};var g=m.getInternalTexture();if(g){c.postProcessManager.directRender([s],g);var v=4*r,b=f/2,y=u.readPixels(0,0,r,f);if(!(n.isCube||o.displayRed&&o.displayGreen&&o.displayBlue))for(var w=0;we.x||t.righte.y||t.bottomt.right||e.bottomt.bottom);n.isSelected=r}),this._onFrameCreatedObserver=this._globalState.onFrameCreated.add(function(e){n._ownerCanvas.frames.some(function(e){return-1!==e.nodes.indexOf(n)})||n.isOverlappingFrame(e)&&e.nodes.push(n)})}return Object.defineProperty(e.prototype,"isVisible",{get:function(){return this._isVisible},set:function(e){this._isVisible=e,e?this._visual.classList.remove("hidden"):this._visual.classList.add("hidden");for(var t=0,n=this._links;t-1&&this._ownerCanvas.selectedNodes.splice(t,1)}},enumerable:!0,configurable:!0}),e.prototype.isOverlappingFrame=function(e){var t=this._visual.getBoundingClientRect(),n=e.element.getBoundingClientRect();return n.width-=5,n.height-=5,!(n.rightt.right||n.bottomt.bottom)},e.prototype.getPortForConnectionPoint=function(e){for(var t=0,n=this._inputPorts;t0){var e=o._commentsElement.offsetHeight+40;o._minFrameHeight=e}},this._onRightHandlePointerDown=function(e){var t=o;o.initResizing(e),t._resizingDirection=ve.Right,t.mouseXLimit=e.clientX-(t.width-t._minFrameWidth),t._ownerCanvas.hostCanvas.addEventListener("pointerup",t._onRightHandlePointerUp),t._ownerCanvas.hostCanvas.addEventListener("pointermove",t._onRightHandlePointerMove)},this._onRightHandlePointerMove=function(e){var t=(o.element.offsetWidth-o._minFrameWidth)*o._ownerCanvas.zoom,n=o._mouseStartPointX-t;o._moveRightHandle(e,n)},this._moveRightHandle=function(e,t){var n=o;if(n.mouseXLimit){if(n._resizingDirection!==ve.Right||null===n._mouseStartPointX||null===n._mouseStartPointY||e.clientXt)return;if(n._resizingDirection===ve.Left){e.stopPropagation();var r=(e.clientX-n._mouseStartPointX)/n._ownerCanvas.zoom;n._expandLeft(r),n._mouseStartPointX=e.clientX}}},this._onLeftHandlePointerUp=function(e){var t=o;t._resizingDirection===ve.Left&&(t.x=parseFloat(t.element.style.left.replace("px","")),t.width=parseFloat(t.element.style.width.replace("px","")),t._ownerCanvas.hostCanvas.removeEventListener("pointerup",t._onLeftHandlePointerUp),t._ownerCanvas.hostCanvas.removeEventListener("pointermove",t._onLeftHandlePointerMove),t.cleanUpResizing(e))},this._onTopHandlePointerDown=function(e){var t=o;o.initResizing(e),t._resizingDirection=ve.Top,t._ownerCanvas.hostCanvas.addEventListener("pointerup",t._onTopHandlePointerUp),t._ownerCanvas.hostCanvas.addEventListener("pointermove",t._onTopHandlePointerMove)},this._onTopHandlePointerMove=function(e){var t=(o.element.offsetHeight-o._minFrameHeight)*o._ownerCanvas.zoom,n=o._mouseStartPointY+t;o._moveTopHandle(e,n)},this._moveTopHandle=function(e,t){var n=o;if(!(n._resizingDirection!==ve.Top||null===n._mouseStartPointX||null===n._mouseStartPointY||e.clientY>t)&&n._resizingDirection===ve.Top){e.stopPropagation();var r=(e.clientY-n._mouseStartPointY)/n._ownerCanvas.zoom;n._expandTop(r),n._mouseStartPointY=e.clientY}},this._onTopHandlePointerUp=function(e){var t=o;t._resizingDirection===ve.Top&&(t.y=parseFloat(t.element.style.top.replace("px","")),t.height=parseFloat(t.element.style.height.replace("px","")),t._ownerCanvas.hostCanvas.removeEventListener("pointerup",t._onTopHandlePointerUp),t._ownerCanvas.hostCanvas.removeEventListener("pointermove",t._onTopHandlePointerMove),t.cleanUpResizing(e))},this._id=e._FrameCounter++,this._ownerCanvas=n;var i=n.frameContainer;this.element=i.ownerDocument.createElement("div"),this.element.classList.add("frame-box"),i.appendChild(this.element),this._headerElement=i.ownerDocument.createElement("div"),this._headerElement.classList.add("frame-box-header"),this._headerElement.addEventListener("dblclick",function(){o.isCollapsed=!o.isCollapsed}),this.element.appendChild(this._headerElement),this._borderElement=i.ownerDocument.createElement("div"),this._borderElement.classList.add("frame-box-border"),this.element.appendChild(this._borderElement);var l=i.ownerDocument.createElement("div");l.className="handle right-handle",this.element.appendChild(l),l.addEventListener("pointerdown",this._onRightHandlePointerDown);var s=i.ownerDocument.createElement("div");s.className="handle left-handle",this.element.appendChild(s),s.addEventListener("pointerdown",this._onLeftHandlePointerDown);var c=i.ownerDocument.createElement("div");c.className="handle bottom-handle",this.element.appendChild(c),c.addEventListener("pointerdown",this._onBottomHandlePointerDown);var u=i.ownerDocument.createElement("div");u.className="handle top-handle",this.element.appendChild(u),u.addEventListener("pointerdown",this._onTopHandlePointerDown),this._headerTextElement=i.ownerDocument.createElement("div"),this._headerTextElement.classList.add("frame-box-header-title"),this._headerElement.appendChild(this._headerTextElement),this._headerCollapseElement=i.ownerDocument.createElement("div"),this._headerCollapseElement.classList.add("frame-box-header-collapse"),this._headerCollapseElement.classList.add("frame-box-header-button"),this._headerCollapseElement.title="Collapse",this._headerCollapseElement.ondragstart=function(){return!1},this._headerCollapseElement.addEventListener("pointerdown",function(e){o._headerCollapseElement.classList.add("down"),e.stopPropagation()}),this._headerCollapseElement.addEventListener("pointerup",function(e){e.stopPropagation(),o._headerCollapseElement.classList.remove("down"),o.isCollapsed=!o.isCollapsed}),this._headerCollapseElement.innerHTML=this.CollapseSVG,this._headerElement.appendChild(this._headerCollapseElement),this._headerCloseElement=i.ownerDocument.createElement("div"),this._headerCloseElement.classList.add("frame-box-header-close"),this._headerCloseElement.classList.add("frame-box-header-button"),this._headerCloseElement.title="Close",this._headerCloseElement.ondragstart=function(){return!1},this._headerCloseElement.addEventListener("pointerdown",function(e){e.stopPropagation()}),this._headerCloseElement.addEventListener("pointerup",function(e){e.stopPropagation(),o.dispose()}),this._headerCloseElement.innerHTML=this.CloseSVG,this._headerElement.appendChild(this._headerCloseElement),this._portContainer=i.ownerDocument.createElement("div"),this._portContainer.classList.add("port-container"),this.element.appendChild(this._portContainer),this._outputPortContainer=i.ownerDocument.createElement("div"),this._outputPortContainer.classList.add("outputsContainer"),this._portContainer.appendChild(this._outputPortContainer),this._inputPortContainer=i.ownerDocument.createElement("div"),this._inputPortContainer.classList.add("inputsContainer"),this._portContainer.appendChild(this._inputPortContainer),this.name="Frame",this.color=a.Color3.FromInts(72,72,72),t&&(this.x=parseFloat(t.style.left.replace("px","")),this.y=parseFloat(t.style.top.replace("px","")),this.width=parseFloat(t.style.width.replace("px","")),this.height=parseFloat(t.style.height.replace("px","")),this.cleanAccumulation()),this._headerTextElement.addEventListener("pointerdown",function(e){return o._onDown(e)}),this._headerTextElement.addEventListener("pointerup",function(e){return o._onUp(e)}),this._headerTextElement.addEventListener("pointermove",function(e){return o._onMove(e)}),this._onSelectionChangedObserver=n.globalState.onSelectionChangedObservable.add(function(e){e===o?o.element.classList.add("selected"):o.element.classList.remove("selected")}),this._commentsElement=document.createElement("div"),this._commentsElement.className="frame-comments",this._commentsElement.style.color="white",this._commentsElement.style.fontSize="16px",this.element.appendChild(this._commentsElement),r||this.refresh()}return Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCollapsed",{get:function(){return this._isCollapsed},set:function(e){if(this._isCollapsed!==e){if(this._isCollapsed=e,this._ownerCanvas._frameIsMoving=!0,e){this.element.classList.add("collapsed"),this._moveFrame((this.width-this.CollapsedWidth)/2,0);for(var t=0,n=this._nodes;tthis._minFrameWidth?e:this._minFrameWidth;this._width=t;var n=this._ownerCanvas.getGridPositionCeil(t+this._gridAlignedX);this.element.style.width=n-this._gridAlignedX+"px"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(e){if(this._height!==e){this._height=e;var t=this._ownerCanvas.getGridPositionCeil(e+this._gridAlignedY);this.element.style.height=t-this._gridAlignedY+"px"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comments",{get:function(){return this._comments},set:function(e){e&&!this._comments&&e.length>0?(this.element.style.gridTemplateRows="40px min-content 1fr",this._borderElement.style.gridRow="1 / span 3",this._portContainer.style.gridRow="3",this._commentsElement.classList.add("has-comments")):e||(this.element.style.gridTemplateRows="40px calc(100% - 40px)",this._borderElement.style.gridRow="1 / span 2",this._portContainer.style.gridRow="2",this._commentsElement.classList.remove("has-comments")),(""===e||e&&e.length>=0)&&(this._commentsElement.innerText=e),this.height=this._borderElement.offsetHeight,this._comments=e,this.updateMinHeightWithComments()},enumerable:!0,configurable:!0}),e.prototype.refresh=function(){this._nodes=[],this._ownerCanvas.globalState.onFrameCreated.notifyObservers(this)},e.prototype.addNode=function(e){-1===this.nodes.indexOf(e)&&this.nodes.push(e)},e.prototype.removeNode=function(e){var t=this.nodes.indexOf(e);t>-1&&this.nodes.splice(t,1)},e.prototype.syncNode=function(e){this.isCollapsed||(e.isOverlappingFrame(this)?this.addNode(e):this.removeNode(e))},e.prototype.cleanAccumulation=function(){for(var e=0,t=this._nodes;e20&&(this._mouseStartPointX=t,this.element.style.width=n+e+"px"),this.updateMinHeightWithComments(),this.height=this._borderElement.offsetHeight},e.prototype._expandBottom=function(e){var t=parseFloat(this.element.style.height.replace("px",""));this.element.style.height=t+e+"px"},e.prototype._expandLeft=function(e){var t=parseFloat(this.element.style.width.replace("px","")),n=parseFloat(this.element.style.left.replace("px",""));this.element.style.width=t-e+"px",this.element.style.left=n+e+"px",this.updateMinHeightWithComments(),this.height=this._borderElement.offsetHeight},e.prototype._expandTop=function(e){var t=parseFloat(this.element.style.height.replace("px","")),n=parseFloat(this.element.style.top.replace("px",""));this.element.style.height=t-e+"px",this.element.style.top=n+e+"px"},e.prototype.dispose=function(){this.isCollapsed=!1,this._onSelectionChangedObserver&&this._ownerCanvas.globalState.onSelectionChangedObservable.remove(this._onSelectionChangedObserver),this.element.parentElement.removeChild(this.element),this._ownerCanvas.frames.splice(this._ownerCanvas.frames.indexOf(this),1),this.onExpandStateChanged.clear()},e.prototype.serialize=function(){return{x:this._x,y:this._y,width:this._width,height:this._height,color:this._color.asArray(),name:this.name,isCollapsed:this.isCollapsed,blocks:this.nodes.map(function(e){return e.block.uniqueId}),comments:this._comments}},e.prototype.export=function(){var e=this._ownerCanvas.globalState,t=C.Serialize(e.nodeMaterial,e,this.nodes.map(function(e){return e.block}));x.DownloadAsFile(e.hostDocument,t,this._name+".json")},e.Parse=function(t,n,r){var o=new e(null,n,!0),i=!!t.isCollapsed;if(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height,o.name=t.name,o.color=a.Color3.FromArray(t.color),o.comments=t.comments,t.blocks&&r)for(var l=function(){var e=r[u],t=n.nodes.filter(function(t){return t.block.uniqueId===e});t.length&&o.nodes.push(t[0])},s=0,c=t.blocks;s-1&&this._links.splice(t,1),e.dispose()},t.prototype.appendBlock=function(e){var t=new ye(e,this.props.globalState);return t.appendVisual(this._graphCanvas,this),this._nodes.push(t),t},t.prototype.distributeGraph=function(){var e=this;this.x=0,this.y=0,this.zoom=1;var t=new ze.graphlib.Graph;t.setGraph({}),t.setDefaultEdgeLabel(function(){return{}}),t.graph().rankdir="LR",this._nodes.forEach(function(n){e._frames.some(function(e){return-1!==e.nodes.indexOf(n)})||t.setNode(n.id.toString(),{id:n.id,type:"node",width:n.width,height:n.height})}),this._frames.forEach(function(e){t.setNode(e.id.toString(),{id:e.id,type:"frame",width:e.element.clientWidth,height:e.element.clientHeight})}),this._nodes.forEach(function(n){n.block.outputs.forEach(function(r){r.hasEndpoints&&r.endpoints.forEach(function(r){var o=e._frames.filter(function(e){return-1!==e.nodes.indexOf(n)}),i=e._frames.filter(function(e){return e.nodes.some(function(e){return e.block===r.ownerBlock})}),a=o.length>0?o[0].id:n.id,l=i.length>0?i[0].id:r.ownerBlock.uniqueId;t.setEdge(a.toString(),l.toString())})})}),ze.layout(t),t.nodes().map(function(e){return t.node(e)}).forEach(function(t){if("node"!==t.type)for(var n=0,r=e._frames;nthis._selectionStartX?(this._selectionBox.style.left=this._selectionStartX/this.zoom+"px",this._selectionBox.style.width=(n-this._selectionStartX)/this.zoom+"px"):(this._selectionBox.style.left=n/this.zoom+"px",this._selectionBox.style.width=(this._selectionStartX-n)/this.zoom+"px"),r>this._selectionStartY?(this._selectionBox.style.top=this._selectionStartY/this.zoom+"px",this._selectionBox.style.height=(r-this._selectionStartY)/this.zoom+"px"):(this._selectionBox.style.top=r/this.zoom+"px",this._selectionBox.style.height=(this._selectionStartY-r)/this.zoom+"px"),void this.props.globalState.onSelectionBoxMoved.notifyObservers(this._selectionBox.getBoundingClientRect())}if(this._frameCandidate){t=this.canvasContainer.getBoundingClientRect(),n=e.pageX-t.left,r=e.pageY-t.top;return n>this._selectionStartX?(this._frameCandidate.style.left=this._selectionStartX/this.zoom+"px",this._frameCandidate.style.width=(n-this._selectionStartX)/this.zoom+"px"):(this._frameCandidate.style.left=n/this.zoom+"px",this._frameCandidate.style.width=(this._selectionStartX-n)/this.zoom+"px"),void(r>this._selectionStartY?(this._frameCandidate.style.top=this._selectionStartY/this.zoom+"px",this._frameCandidate.style.height=(r-this._selectionStartY)/this.zoom+"px"):(this._frameCandidate.style.top=r/this.zoom+"px",this._frameCandidate.style.height=(this._selectionStartY-r)/this.zoom+"px"))}if(this._candidateLink){t=this.canvasContainer.getBoundingClientRect();return this._candidatePort=null,this.props.globalState.onCandidateLinkMoved.notifyObservers(new a.Vector2(e.pageX,e.pageY)),this._dropPointX=(e.pageX-t.left)/this.zoom,this._dropPointY=(e.pageY-t.top)/this.zoom,void this._candidateLink.update(this._dropPointX,this._dropPointY,!0)}if(this._altKeyIsPressed&&1===e.buttons){this._oldY<0&&(this._oldY=e.pageY);var o=(e.pageY-this._oldY)/10;if(Math.abs(o)>5){var i=this.zoom;this.zoom=Math.max(Math.min(this.MaxZoom,this.zoom+o/100),this.MinZoom);var l=e.currentTarget.getBoundingClientRect(),s=l.width,c=s*this.zoom-s*i,u=(e.clientX-l.left-this.x)/i/s;this.x=this.x-c*u,this._oldY=e.pageY}}else this._rootContainer.style.cursor="move",null!==this._mouseStartPointX&&null!==this._mouseStartPointY&&(this.x+=e.clientX-this._mouseStartPointX,this.y+=e.clientY-this._mouseStartPointY,this._mouseStartPointX=e.clientX,this._mouseStartPointY=e.clientY)},t.prototype.onDown=function(e){if(this._rootContainer.setPointerCapture(e.pointerId),e.currentTarget===this._hostCanvas&&e.ctrlKey){this._selectionBox=this.props.globalState.hostDocument.createElement("div"),this._selectionBox.classList.add("selection-box"),this._selectionContainer.appendChild(this._selectionBox);var t=this.canvasContainer.getBoundingClientRect();return this._selectionStartX=e.pageX-t.left,this._selectionStartY=e.pageY-t.top,this._selectionBox.style.left=this._selectionStartX/this.zoom+"px",this._selectionBox.style.top=this._selectionStartY/this.zoom+"px",this._selectionBox.style.width="0px",void(this._selectionBox.style.height="0px")}if(e.currentTarget===this._hostCanvas&&e.shiftKey){this._frameCandidate=this.props.globalState.hostDocument.createElement("div"),this._frameCandidate.classList.add("frame-box"),this._frameContainer.appendChild(this._frameCandidate);t=this.canvasContainer.getBoundingClientRect();return this._selectionStartX=e.pageX-t.left,this._selectionStartY=e.pageY-t.top,this._frameCandidate.style.left=this._selectionStartX/this.zoom+"px",this._frameCandidate.style.top=this._selectionStartY/this.zoom+"px",this._frameCandidate.style.width="0px",void(this._frameCandidate.style.height="0px")}if(e.nativeEvent.srcElement&&"IMG"===e.nativeEvent.srcElement.nodeName){if(!this._candidateLink){var n=e.nativeEvent.srcElement.parentElement.port;this._candidateLink=new Ue(this,n,n.node)}}else this.props.globalState.onSelectionChangedObservable.notifyObservers(null),this._mouseStartPointX=e.clientX,this._mouseStartPointY=e.clientY},t.prototype.onUp=function(e){if(this._mouseStartPointX=null,this._mouseStartPointY=null,this._rootContainer.releasePointerCapture(e.pointerId),this._oldY=-1,this._candidateLink&&(this.processCandidatePort(),this.props.globalState.onCandidateLinkMoved.notifyObservers(null),this._candidateLink.dispose(),this._candidateLink=null,this._candidatePort=null),this._selectionBox&&(this._selectionBox.parentElement.removeChild(this._selectionBox),this._selectionBox=null),this._frameCandidate){var t=new we(this._frameCandidate,this);this._frames.push(t),this._frameCandidate.parentElement.removeChild(this._frameCandidate),this._frameCandidate=null,this.props.globalState.onSelectionChangedObservable.notifyObservers(t)}},t.prototype.onWheel=function(e){var t=e.deltaY<0?.1:-.1,n=this.zoom;this.zoom=Math.min(Math.max(this.MinZoom,this.zoom+t*this.zoom),this.MaxZoom);var r=e.currentTarget.getBoundingClientRect(),o=r.width,i=r.height,a=o*this.zoom-o*n,l=i*this.zoom-i*n,s=e.clientX-r.left,c=e.clientY-r.top,u=(s-this.x)/n/o,p=(c-this.y)/n/i;this.x=this.x-a*u,this.y=this.y-l*p,e.stopPropagation()},t.prototype.zoomToFit=function(){var e=this,t=0,n=0;this._nodes.forEach(function(r){e._frames.some(function(e){return-1!==e.nodes.indexOf(r)})||(r.x-1&&n._blocks.splice(a,1)}return n._graphCanvas.selectedLink&&n._graphCanvas.selectedLink.dispose(),n._graphCanvas.selectedFrame&&n._graphCanvas.selectedFrame.dispose(),n.props.globalState.onSelectionChangedObservable.notifyObservers(null),void n.props.globalState.onRebuildRequiredObservable.notifyObservers()}if(e.ctrlKey&&!n.props.globalState.blockKeyboardEvents)if("c"===e.key){if(n._copiedNodes=[],n._copiedFrame=null,n._graphCanvas.selectedFrame)return void(n._copiedFrame=n._graphCanvas.selectedFrame);var l;if(!(l=n._graphCanvas.selectedNodes).length)return;if(!l[0].block)return;n._copiedNodes=l.slice(0)}else if("v"===e.key){var s=n.props.globalState.hostDocument.querySelector(".diagram-container"),c=n._graphCanvas.zoom,u=(n._mouseLocationY-s.offsetTop-n._graphCanvas.y-20)/c;if(n._copiedFrame){var p=new we(null,n._graphCanvas,!0);n._graphCanvas.frames.push(p),p.width=n._copiedFrame.width,p.height=n._copiedFrame.height,p.width,p.name=n._copiedFrame.name,p.color=n._copiedFrame.color;var d=(n._mouseLocationX-s.offsetLeft-n._graphCanvas.x)/c;return p.x=d-p.width/2,p.y=u,n._copiedFrame.nodes.length&&(d=p.x+n._copiedFrame.nodes[0].x-n._copiedFrame.x,u=p.y+n._copiedFrame.nodes[0].y-n._copiedFrame.y,n.pasteSelection(n._copiedFrame.nodes,d,u)),void(n._copiedFrame.isCollapsed&&(p.isCollapsed=!0))}if(!n._copiedNodes.length)return;var f=(n._mouseLocationX-s.offsetLeft-n._graphCanvas.x-n.NodeWidth)/c;n.pasteSelection(n._copiedNodes,f,u)}},!1),n}return u(t,e),t.prototype.createNodeFromObject=function(e,t){if(void 0===t&&(t=!0),-1!==this._blocks.indexOf(e))return this._graphCanvas.nodes.filter(function(t){return t.block===e})[0];if(this._blocks.push(e),-1===this.props.globalState.nodeMaterial.attachedBlocks.indexOf(e)&&this.props.globalState.nodeMaterial.attachedBlocks.push(e),e.isFinalMerger&&this.props.globalState.nodeMaterial.addOutputNode(e),e.inputs.length)for(var n=0,r=e.inputs;n0){var p=u[0],d=n.indexOf(p);s.reconnectNewNodes(d,t,n,r);var f=l.outputs.indexOf(e.connectedPoint);t[d].block.outputs[f].connectTo(o)}else e._connectedPoint.connectTo(o);s._graphCanvas.connectPorts(o.connectedPoint,o)},s=this,c=0;cs){var c=l;l=s,s=c}return l+a+s+a+(r.isUndefined(i)?o:i)}function p(e,t,n,r){var o=""+t,i=""+n;if(!e&&o>i){var a=o;o=i,i=a}var l={v:o,w:i};return r&&(l.name=r),l}function d(e,t){return u(e,t.v,t.w,t.name)}l.prototype._nodeCount=0,l.prototype._edgeCount=0,l.prototype.isDirected=function(){return this._isDirected},l.prototype.isMultigraph=function(){return this._isMultigraph},l.prototype.isCompound=function(){return this._isCompound},l.prototype.setGraph=function(e){return this._label=e,this},l.prototype.graph=function(){return this._label},l.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},l.prototype.nodeCount=function(){return this._nodeCount},l.prototype.nodes=function(){return r.keys(this._nodes)},l.prototype.sources=function(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._in[t])})},l.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._out[t])})},l.prototype.setNodes=function(e,t){var n=arguments,o=this;return r.each(e,function(e){n.length>1?o.setNode(e,t):o.setNode(e)}),this},l.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=i,this._children[e]={},this._children[i][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},l.prototype.node=function(e){return this._nodes[e]},l.prototype.hasNode=function(e){return r.has(this._nodes,e)},l.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),function(e){t.setParent(e)}),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},l.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=i;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},l.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},l.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==i)return t}},l.prototype.children=function(e){if(r.isUndefined(e)&&(e=i),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===i)return this.nodes();if(this.hasNode(e))return[]}},l.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},l.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},l.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},l.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},l.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,function(n,r){e(r)&&t.setNode(r,n)}),r.each(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var o={};return this._isCompound&&r.each(t.nodes(),function(e){t.setParent(e,function e(r){var i=n.parent(r);return void 0===i||t.hasNode(i)?(o[r]=i,i):i in o?o[i]:e(i)}(e))}),t},l.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},l.prototype.edgeCount=function(){return this._edgeCount},l.prototype.edges=function(){return r.values(this._edgeObjs)},l.prototype.setPath=function(e,t){var n=this,o=arguments;return r.reduce(e,function(e,r){return o.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r}),this},l.prototype.setEdge=function(){var e,t,n,o,i=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(o=arguments[1],i=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],i=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var l=u(this._isDirected,e,t,n);if(r.has(this._edgeLabels,l))return i&&(this._edgeLabels[l]=o),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[l]=i?o:this._defaultEdgeLabelFn(e,t,n);var c=p(this._isDirected,e,t,n);return e=c.v,t=c.w,Object.freeze(c),this._edgeObjs[l]=c,s(this._preds[t],e),s(this._sucs[e],t),this._in[t][l]=c,this._out[e][l]=c,this._edgeCount++,this},l.prototype.edge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):u(this._isDirected,e,t,n);return this._edgeLabels[r]},l.prototype.hasEdge=function(e,t,n){var o=1===arguments.length?d(this._isDirected,arguments[0]):u(this._isDirected,e,t,n);return r.has(this._edgeLabels,o)},l.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):u(this._isDirected,e,t,n),o=this._edgeObjs[r];return o&&(e=o.v,t=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],c(this._preds[t],e),c(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},l.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var o=r.values(n);return t?r.filter(o,function(e){return e.v===t}):o}},l.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var o=r.values(n);return t?r.filter(o,function(e){return e.w===t}):o}},l.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},function(e,t,n){var r=n(16)(n(11),"Map");e.exports=r},function(e,t,n){var r=n(172),o=n(179),i=n(181),a=n(182),l=n(183);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=n}},function(e,t,n){(function(e){var r=n(75),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,l=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=l}).call(this,n(55)(e))},function(e,t,n){var r=n(42),o=n(189),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t,n){var r=n(82),o=n(83),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,l=a?function(e){return null==e?[]:(e=Object(e),r(a(e),function(t){return i.call(e,t)}))}:o;e.exports=l},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n0&&i(u)?n>1?e(u,n-1,i,a,l):r(l,u):a||(l[l.length]=u)}return l}},function(e,t,n){var r=n(25);e.exports=function(e,t,n){for(var o=-1,i=e.length;++o-1;o--){var i=n[o],a=(i.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(a)>-1&&(r=i)}return g.head.insertBefore(t,r),e}}var J="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function ee(){for(var e=12,t="";e-- >0;)t+=J[62*Math.random()|0];return t}function te(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ne(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,": ").concat(e[n],";")},"")}function re(e){return e.size!==K.size||e.x!==K.x||e.y!==K.y||e.rotate!==K.rotate||e.flipX||e.flipY}function oe(e){var t=e.transform,n=e.containerWidth,r=e.iconWidth,o={transform:"translate(".concat(n/2," 256)")},i="translate(".concat(32*t.x,", ").concat(32*t.y,") "),a="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),l="rotate(".concat(t.rotate," 0 0)");return{outer:o,inner:{transform:"".concat(i," ").concat(a," ").concat(l)},path:{transform:"translate(".concat(r/2*-1," -256)")}}}var ie={x:0,y:0,width:"100%",height:"100%"};function ae(e){var t=e.icons,n=t.main,r=t.mask,o=e.prefix,i=e.iconName,a=e.transform,s=e.symbol,c=e.title,u=e.extra,p=e.watchable,d=void 0!==p&&p,f=r.found?r:n,h=f.width,m=f.height,g="fa-w-".concat(Math.ceil(h/m*16)),v=[S.replacementClass,i?"".concat(S.familyPrefix,"-").concat(i):"",g].filter(function(e){return-1===u.classes.indexOf(e)}).concat(u.classes).join(" "),b={children:[],attributes:l({},u.attributes,{"data-prefix":o,"data-icon":i,class:v,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(h," ").concat(m)})};d&&(b.attributes[x]=""),c&&b.children.push({tag:"title",attributes:{id:b.attributes["aria-labelledby"]||"title-".concat(ee())},children:[c]});var y=l({},b,{prefix:o,iconName:i,main:n,mask:r,transform:a,symbol:s,styles:u.styles}),w=r.found&&n.found?function(e){var t=e.children,n=e.attributes,r=e.main,o=e.mask,i=e.transform,a=r.width,s=r.icon,c=o.width,u=o.icon,p=oe({transform:i,containerWidth:c,iconWidth:a}),d={tag:"rect",attributes:l({},ie,{fill:"white"})},f={tag:"g",attributes:l({},p.inner),children:[{tag:"path",attributes:l({},s.attributes,p.path,{fill:"black"})}]},h={tag:"g",attributes:l({},p.outer),children:[f]},m="mask-".concat(ee()),g="clip-".concat(ee()),v={tag:"defs",children:[{tag:"clipPath",attributes:{id:g},children:[u]},{tag:"mask",attributes:l({},ie,{id:m,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[d,h]}]};return t.push(v,{tag:"rect",attributes:l({fill:"currentColor","clip-path":"url(#".concat(g,")"),mask:"url(#".concat(m,")")},ie)}),{children:t,attributes:n}}(y):function(e){var t=e.children,n=e.attributes,r=e.main,o=e.transform,i=ne(e.styles);if(i.length>0&&(n.style=i),re(o)){var a=oe({transform:o,containerWidth:r.width,iconWidth:r.width});t.push({tag:"g",attributes:l({},a.outer),children:[{tag:"g",attributes:l({},a.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:l({},r.icon.attributes,a.path)}]}]})}else t.push(r.icon);return{children:t,attributes:n}}(y),_=w.children,C=w.attributes;return y.children=_,y.attributes=C,s?function(e){var t=e.prefix,n=e.iconName,r=e.children,o=e.attributes,i=e.symbol;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:l({},o,{id:!0===i?"".concat(t,"-").concat(S.familyPrefix,"-").concat(n):i}),children:r}]}]}(y):function(e){var t=e.children,n=e.main,r=e.mask,o=e.attributes,i=e.styles,a=e.transform;if(re(a)&&n.found&&!r.found){var s={x:n.width/n.height/2,y:.5};o.style=ne(l({},i,{"transform-origin":"".concat(s.x+a.x/16,"em ").concat(s.y+a.y/16,"em")}))}return[{tag:"svg",attributes:o,children:t}]}(y)}var le=function(){},se=(S.measurePerformance&&v&&v.mark&&v.measure,function(e,t,n,r){var o,i,a,l=Object.keys(e),s=l.length,c=void 0!==r?function(e,t){return function(n,r,o,i){return e.call(t,n,r,o,i)}}(t,r):t;for(void 0===n?(o=1,a=e[l[0]]):(o=0,a=n);o2&&void 0!==arguments[2]?arguments[2]:{}).skipHooks,r=void 0!==n&&n,o=Object.keys(t).reduce(function(e,n){var r=t[n];return!!r.icon?e[r.iconName]=r.icon:e[n]=r,e},{});"function"!=typeof P.hooks.addPack||r?P.styles[e]=l({},P.styles[e]||{},o):P.hooks.addPack(e,o),"fas"===e&&ce("fa",t)}var ue=P.styles,pe=P.shims,de=function(){var e=function(e){return se(ue,function(t,n,r){return t[r]=se(n,e,{}),t},{})};e(function(e,t,n){return t[3]&&(e[t[3]]=n),e}),e(function(e,t,n){var r=t[2];return e[n]=n,r.forEach(function(t){e[t]=n}),e});var t="far"in ue;se(pe,function(e,n){var r=n[0],o=n[1],i=n[2];return"far"!==o||t||(o="fas"),e[r]={prefix:o,iconName:i},e},{})};de();P.styles;function fe(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}function he(e){var t=e.tag,n=e.attributes,r=void 0===n?{}:n,o=e.children,i=void 0===o?[]:o;return"string"==typeof e?te(e):"<".concat(t," ").concat(function(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,'="').concat(te(e[n]),'" ')},"").trim()}(r),">").concat(i.map(he).join(""),"")}var me=function(e){var t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e?e.toLowerCase().split(" ").reduce(function(e,t){var n=t.toLowerCase().split("-"),r=n[0],o=n.slice(1).join("-");if(r&&"h"===o)return e.flipX=!0,e;if(r&&"v"===o)return e.flipY=!0,e;if(o=parseFloat(o),isNaN(o))return e;switch(r){case"grow":e.size=e.size+o;break;case"shrink":e.size=e.size-o;break;case"left":e.x=e.x-o;break;case"right":e.x=e.x+o;break;case"up":e.y=e.y-o;break;case"down":e.y=e.y+o;break;case"rotate":e.rotate=e.rotate+o}return e},t):t};function ge(e){this.name="MissingIcon",this.message=e||"Icon unavailable",this.stack=(new Error).stack}ge.prototype=Object.create(Error.prototype),ge.prototype.constructor=ge;var ve={fill:"currentColor"},be={attributeType:"XML",repeatCount:"indefinite",dur:"2s"},ye={tag:"path",attributes:l({},ve,{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})},we=l({},be,{attributeName:"opacity"});l({},ve,{cx:"256",cy:"364",r:"28"}),l({},be,{attributeName:"r",values:"28;14;28;28;14;28;"}),l({},we,{values:"1;0;1;1;0;1;"}),l({},ve,{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),l({},we,{values:"1;0;0;0;0;1;"}),l({},ve,{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),l({},we,{values:"0;0;1;1;0;0;"}),P.styles;P.styles;var xe='svg:not(:root).svg-inline--fa {\n overflow: visible;\n}\n\n.svg-inline--fa {\n display: inline-block;\n font-size: inherit;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.225em;\n}\n.svg-inline--fa.fa-w-1 {\n width: 0.0625em;\n}\n.svg-inline--fa.fa-w-2 {\n width: 0.125em;\n}\n.svg-inline--fa.fa-w-3 {\n width: 0.1875em;\n}\n.svg-inline--fa.fa-w-4 {\n width: 0.25em;\n}\n.svg-inline--fa.fa-w-5 {\n width: 0.3125em;\n}\n.svg-inline--fa.fa-w-6 {\n width: 0.375em;\n}\n.svg-inline--fa.fa-w-7 {\n width: 0.4375em;\n}\n.svg-inline--fa.fa-w-8 {\n width: 0.5em;\n}\n.svg-inline--fa.fa-w-9 {\n width: 0.5625em;\n}\n.svg-inline--fa.fa-w-10 {\n width: 0.625em;\n}\n.svg-inline--fa.fa-w-11 {\n width: 0.6875em;\n}\n.svg-inline--fa.fa-w-12 {\n width: 0.75em;\n}\n.svg-inline--fa.fa-w-13 {\n width: 0.8125em;\n}\n.svg-inline--fa.fa-w-14 {\n width: 0.875em;\n}\n.svg-inline--fa.fa-w-15 {\n width: 0.9375em;\n}\n.svg-inline--fa.fa-w-16 {\n width: 1em;\n}\n.svg-inline--fa.fa-w-17 {\n width: 1.0625em;\n}\n.svg-inline--fa.fa-w-18 {\n width: 1.125em;\n}\n.svg-inline--fa.fa-w-19 {\n width: 1.1875em;\n}\n.svg-inline--fa.fa-w-20 {\n width: 1.25em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-border {\n height: 1.5em;\n}\n.svg-inline--fa.fa-li {\n width: 2em;\n}\n.svg-inline--fa.fa-fw {\n width: 1.25em;\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: #ff253a;\n border-radius: 1em;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: #fff;\n height: 1.5em;\n line-height: 1;\n max-width: 5em;\n min-width: 1.5em;\n overflow: hidden;\n padding: 0.25em;\n right: 0;\n text-overflow: ellipsis;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: 0;\n right: 0;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: 0;\n left: 0;\n right: auto;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n right: 0;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: 0;\n right: auto;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-lg {\n font-size: 1.3333333333em;\n line-height: 0.75em;\n vertical-align: -0.0667em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: 2.5em;\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: -2em;\n position: absolute;\n text-align: center;\n width: 2em;\n line-height: inherit;\n}\n\n.fa-border {\n border: solid 0.08em #eee;\n border-radius: 0.1em;\n padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n float: left;\n}\n\n.fa-pull-right {\n float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n margin-left: 0.3em;\n}\n\n.fa-spin {\n -webkit-animation: fa-spin 2s infinite linear;\n animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n -webkit-animation: fa-spin 1s infinite steps(8);\n animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n -webkit-filter: none;\n filter: none;\n}\n\n.fa-stack {\n display: inline-block;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: #fff;\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n clip: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n position: static;\n width: auto;\n}';function _e(){var e=y,t=w,n=S.familyPrefix,r=S.replacementClass,o=xe;if(n!==e||r!==t){var i=new RegExp("\\.".concat(e,"\\-"),"g"),a=new RegExp("\\.".concat(t),"g");o=o.replace(i,".".concat(n,"-")).replace(a,".".concat(r))}return o}function Ce(e){return{found:!0,width:e[0],height:e[1],icon:{tag:"path",attributes:{fill:"currentColor",d:e.slice(4)[0]}}}}function ke(){S.autoAddCss&&!Ne&&($(_e()),Ne=!0)}function Ee(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(e){return he(e)})}}),Object.defineProperty(e,"node",{get:function(){if(b){var t=g.createElement("div");return t.innerHTML=e.html,t.children}}}),e}function Se(e){var t=e.prefix,n=void 0===t?"fa":t,r=e.iconName;if(r)return fe(Pe.definitions,n,r)||fe(P.styles,n,r)}var Te,Pe=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.definitions={}}var t,n,r;return t=e,(n=[{key:"add",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=t.transform,r=void 0===n?K:n,o=t.symbol,i=void 0!==o&&o,a=t.mask,s=void 0===a?null:a,c=t.title,u=void 0===c?null:c,p=t.classes,d=void 0===p?[]:p,f=t.attributes,h=void 0===f?{}:f,m=t.styles,g=void 0===m?{}:m;if(e){var v=e.prefix,b=e.iconName,y=e.icon;return Ee(l({type:"icon"},e),function(){return ke(),S.autoA11y&&(u?h["aria-labelledby"]="".concat(S.replacementClass,"-title-").concat(ee()):(h["aria-hidden"]="true",h.focusable="false")),ae({icons:{main:Ce(y),mask:s?Ce(s.icon):{found:!1,width:null,height:null,icon:{}}},prefix:v,iconName:b,transform:l({},K,r),symbol:i,title:u,extra:{attributes:h,styles:g,classes:d}})})}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e||{}).icon?e:Se(e||{}),r=t.mask;return r&&(r=(r||{}).icon?r:Se(r||{})),Te(n,l({},t,{mask:r}))})}).call(this,n(19),n(132).setImmediate)},function(e,t,n){e.exports={graphlib:n(10),layout:n(266),debug:n(325),util:{time:n(6).time,notime:n(6).notime},version:n(326)}},function(e,t,n){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT */var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,s=a(e),c=1;cd))return!1;var h=u.get(e);if(h&&u.get(t))return h==t;var m=-1,g=!0,v=n&l?new r:void 0;for(u.set(e,t),u.set(t,e);++m0&&(i=s.removeMin(),(a=l[i]).distance!==Number.POSITIVE_INFINITY);)r(i).forEach(c);return l}(e,String(t),n||i,r||function(t){return e.outEdges(t)})};var i=r.constant(1)},function(e,t,n){var r=n(7);function o(){this._arr=[],this._keyIndices={}}e.exports=o,o.prototype.size=function(){return this._arr.length},o.prototype.keys=function(){return this._arr.map(function(e){return e.key})},o.prototype.has=function(e){return r.has(this._keyIndices,e)},o.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},o.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},o.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var o=this._arr,i=o.length;return n[e]=i,o.push({key:e,priority:t}),this._decrease(i),!0}return!1},o.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},o.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},o.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,o=e;n>1].priorityL.length&&L.push(e)}function j(e,t,n){return null==e?0:function e(t,n,r,o){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var s=!1;if(null===t)s=!0;else switch(l){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case i:case a:s=!0}}if(s)return r(o,t,""===n?"."+A(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;cthis.eventPool.length&&this.eventPool.push(e)}function pe(e){e.eventPool=[],e.getPooled=ce,e.release=ue}o(se.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=ae)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=ae)},persist:function(){this.isPersistent=ae},isPersistent:le,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=le,this._dispatchInstances=this._dispatchListeners=null}}),se.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},se.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return o(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=o({},r.Interface,e),n.extend=r.extend,pe(n),n},pe(se);var de=se.extend({data:null}),fe=se.extend({data:null}),he=[9,13,27,32],me=Y&&"CompositionEvent"in window,ge=null;Y&&"documentMode"in document&&(ge=document.documentMode);var ve=Y&&"TextEvent"in window&&!ge,be=Y&&(!me||ge&&8=ge),ye=String.fromCharCode(32),we={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},xe=!1;function _e(e,t){switch(e){case"keyup":return-1!==he.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Ce(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var ke=!1;var Ee={eventTypes:we,extractEvents:function(e,t,n,r){var o=void 0,i=void 0;if(me)e:{switch(e){case"compositionstart":o=we.compositionStart;break e;case"compositionend":o=we.compositionEnd;break e;case"compositionupdate":o=we.compositionUpdate;break e}o=void 0}else ke?_e(e,n)&&(o=we.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=we.compositionStart);return o?(be&&"ko"!==n.locale&&(ke||o!==we.compositionStart?o===we.compositionEnd&&ke&&(i=ie()):(re="value"in(ne=r)?ne.value:ne.textContent,ke=!0)),o=de.getPooled(o,t,n,r),i?o.data=i:null!==(i=Ce(n))&&(o.data=i),H(o),i=o):i=null,(e=ve?function(e,t){switch(e){case"compositionend":return Ce(t);case"keypress":return 32!==t.which?null:(xe=!0,ye);case"textInput":return(e=t.data)===ye&&xe?null:e;default:return null}}(e,n):function(e,t){if(ke)return"compositionend"===e||!me&&_e(e,t)?(e=ie(),oe=re=ne=null,ke=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1