!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("@angular/common")):"function"==typeof define&&define.amd?define("ngx-flowchart",["exports","@angular/core","rxjs","@angular/common"],t):t((e=e||self)["ngx-flowchart"]={},e.ng.core,e.rxjs,e.ng.common)}(this,(function(e,t,n,o){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function s(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}var a=new t.InjectionToken("fc-node.component.config");var d={htmlPrefix:"fc",leftConnectorType:"leftConnector",rightConnectorType:"rightConnector",curvedStyle:"curved",lineStyle:"line",dragAnimationRepaint:"repaint",dragAnimationShadow:"shadow",canvasClass:"fc-canvas",selectedClass:"fc-selected",editClass:"fc-edit",activeClass:"fc-active",hoverClass:"fc-hover",draggingClass:"fc-dragging",edgeClass:"fc-edge",edgeLabelClass:"fc-edge-label",connectorClass:"fc-connector",magnetClass:"fc-magnet",nodeClass:"fc-node",nodeOverlayClass:"fc-node-overlay",leftConnectorClass:"fc-leftConnectors",rightConnectorClass:"fc-rightConnectors",canvasResizeThreshold:200,canvasResizeStep:200};var l=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t}(Error);function c(e){var t,n,o,r,i={};e.nodes.forEach((function(e){i[e.id]={incoming:0,outgoing:[]}})),e.edges.forEach((function(t){var n=e.nodes.filter((function(e){return e.connectors.some((function(e){return e.id===t.source}))}))[0],o=e.nodes.filter((function(e){return e.connectors.some((function(e){return e.id===t.destination}))}))[0];i[n.id].outgoing.push(o.id),i[o.id].incoming++}));var a=[],d=[];try{for(var l=s(Object.keys(i)),c=l.next();!c.done;c=l.next()){var g=c.value;0===i[g].incoming&&d.push(g)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}for(;0!==d.length;){for(var h=d.pop(),p=0;p=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom},e.prototype.getItemInfoAtPoint=function(e,t){return{node:this.getNodeAtPoint(e,t),edge:this.getEdgeAtPoint(e,t)}},e.prototype.getNodeAtPoint=function(e,t){var n,o;try{for(var r=s(this.model.nodes),i=r.next();!i.done;i=r.next()){var a=i.value,d=this.nodes.getHtmlElement(a.id).getBoundingClientRect();if(e>=d.left&&e<=d.right&&t>=d.top&&t<=d.bottom)return a}}catch(e){n={error:e}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(n)throw n.error}}return null},e.prototype.getEdgeAtPoint=function(e,t){var n=document.elementFromPoint(e,t).id,o=-1;return n&&(n.startsWith("fc-edge-path-")?o=Number(n.substring("fc-edge-path-".length)):n.startsWith("fc-edge-label-")&&(o=Number(n.substring("fc-edge-label-".length)))),o>-1?this.model.edges[o]:null},e.prototype.selectAllInRect=function(e){var t=this;this.model.nodes.forEach((function(n){var o=t.nodes.getHtmlElement(n.id).getBoundingClientRect();if(!n.readonly){var r=o.left+o.width/2,i=o.top+o.height/2;t.inRectBox(r,i,e)?t.nodes.select(n):t.nodes.isSelected(n)&&t.nodes.deselect(n)}}));var n=this.canvasHtmlElement.getBoundingClientRect();this.model.edges.forEach((function(o){var r=t.edges.sourceCoord(o),i=t.edges.destCoord(o),s=(r.x+i.x)/2+n.left,a=(r.y+i.y)/2+n.top;t.inRectBox(s,a,e)?t.edges.select(o):t.edges.isSelected(o)&&t.edges.deselect(o)}))},e.prototype.deleteSelected=function(){var e=this;this.edges.getSelectedEdges().forEach((function(t){e.edges.delete(t)})),this.nodes.getSelectedNodes().forEach((function(t){e.nodes.delete(t)}))},e.prototype.isEditable=function(){return void 0===this.dropTargetId},e.prototype.isDropSource=function(){return void 0!==this.dropTargetId},e.prototype.getDragImage=function(){return this.dragImage||(this.dragImage=new Image,this.dragImage.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",this.dragImage.style.visibility="hidden"),this.dragImage},e.prototype.registerCallbacks=function(e,t,n){this.edgeAddedCallback=e,this.nodeRemovedCallback=t,this.edgeRemovedCallback=n},e}();var h=function(){function e(e){this.modelService=e}return e.prototype.select=function(e){this.modelService.selectObject(e)},e.prototype.deselect=function(e){this.modelService.deselectObject(e)},e.prototype.toggleSelected=function(e){this.modelService.toggleSelectedObject(e)},e.prototype.isSelected=function(e){return this.modelService.isSelectedObject(e)},e.prototype.isEdit=function(e){return this.modelService.isEditObject(e)},e}();var p=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getConnector=function(e){var t,n,o,r,i=this.modelService.model;try{for(var a=s(i.nodes),d=a.next();!d.done;d=a.next()){var l=d.value;try{for(var c=(o=void 0,s(l.connectors)),g=c.next();!g.done;g=c.next()){var h=g.value;if(h.id===e)return h}}catch(e){o={error:e}}finally{try{g&&!g.done&&(r=c.return)&&r.call(c)}finally{if(o)throw o.error}}}}catch(e){t={error:e}}finally{try{d&&!d.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}},t.prototype.getHtmlElement=function(e){return this.modelService.connectorsHtmlElements[e]},t.prototype.setHtmlElement=function(e,t){this.modelService.connectorsHtmlElements[e]=t,this.modelService.detectChanges()},t.prototype._getCoords=function(e,t){var n=this.getHtmlElement(e),o=this.modelService.canvasHtmlElement;if(null==n||null===o)return{x:0,y:0};var r=n.getBoundingClientRect(),i=o.getBoundingClientRect(),s={x:r.left-i.left,y:r.top-i.top};return t&&(s={x:Math.round(s.x+n.offsetWidth/2),y:Math.round(s.y+n.offsetHeight/2)}),s},t.prototype.getCoords=function(e){return this._getCoords(e,!1)},t.prototype.getCenteredCoord=function(e){return this._getCoords(e,!0)},t}(h),u=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getConnectorsByType=function(e,t){return e.connectors.filter((function(e){return e.type===t}))},t.prototype._addConnector=function(e,t){e.connectors.push(t);try{this.modelService.modelValidation.validateNode(e)}catch(n){throw e.connectors.splice(e.connectors.indexOf(t),1),n}},t.prototype.delete=function(e){this.isSelected(e)&&this.deselect(e);var t=this.modelService.model,n=t.nodes.indexOf(e);if(-1===n){if(void 0===e)throw new Error("Passed undefined");throw new Error("Tried to delete not existing node")}for(var o=this.getConnectorIds(e),r=0;r-1)return a}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return null},t.prototype.getHtmlElement=function(e){return this.modelService.nodesHtmlElements[e]},t.prototype.setHtmlElement=function(e,t){this.modelService.nodesHtmlElements[e]=t,this.modelService.detectChanges()},t}(h),f=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.ready=function(e){var t=this.modelService.connectors.getHtmlElement(e.source),n=this.modelService.connectors.getHtmlElement(e.destination);return void 0!==t&&void 0!==n},t.prototype.sourceCoord=function(e){return this.modelService.connectors.getCenteredCoord(e.source)},t.prototype.destCoord=function(e){return this.modelService.connectors.getCenteredCoord(e.destination)},t.prototype.delete=function(e){var t=this.modelService.model,n=t.edges.indexOf(e);if(-1===n)throw new Error("Tried to delete not existing edge");this.isSelected(e)&&this.deselect(e),t.edges.splice(n,1),this.modelService.edgeRemovedCallback(e)},t.prototype.getSelectedEdges=function(){var e=this;return this.modelService.model.edges.filter((function(t){return e.modelService.edges.isSelected(t)}))},t.prototype.handleEdgeMouseClick=function(e,t){t?this.modelService.edges.toggleSelected(e):(this.modelService.deselectAll(),this.modelService.edges.select(e))},t.prototype.putEdge=function(e){this.modelService.model.edges.push(e)},t.prototype._addEdge=function(e,t,n,o){var r=this;this.modelService.modelValidation.validateConnector(t),this.modelService.modelValidation.validateConnector(n);var i={};i.source=t.id,i.destination=n.id,i.label=o;var s=this.modelService.model;this.modelService.modelValidation.validateEdges(s.edges.concat([i]),s.nodes),this.modelService.createEdge(e,i).subscribe((function(e){s.edges.push(e),r.modelService.edgeAddedCallback(e)}))},t}(h),v=function(){function e(){}return e.prototype.validateModel=function(e){return this.validateNodes(e.nodes),this._validateEdges(e.edges,e.nodes),e},e.prototype.validateNodes=function(e){var t=this,n=[];e.forEach((function(e){if(t.validateNode(e),-1!==n.indexOf(e.id))throw new l("Id not unique.");n.push(e.id)}));var o=[];return e.forEach((function(e){e.connectors.forEach((function(e){if(-1!==o.indexOf(e.id))throw new l("Id not unique.");o.push(e.id)}))})),e},e.prototype.validateNode=function(e){var t=this;if(void 0===e.id)throw new l("Id not valid.");if("string"!=typeof e.name)throw new l("Name not valid.");if("number"!=typeof e.x||e.x<0||Math.round(e.x)!==e.x)throw new l("Coordinates not valid.");if("number"!=typeof e.y||e.y<0||Math.round(e.y)!==e.y)throw new l("Coordinates not valid.");if(!Array.isArray(e.connectors))throw new l("Connectors not valid.");return e.connectors.forEach((function(e){t.validateConnector(e)})),e},e.prototype._validateEdges=function(e,t){var n=this;if(e.forEach((function(e){n._validateEdge(e,t)})),e.forEach((function(t,n){e.forEach((function(e,o){if(n!==o&&(t.source===e.source&&t.destination===e.destination||t.source===e.destination&&t.destination===e.source))throw new l("Duplicated edge.")}))})),null===c({nodes:t,edges:e}))throw new l("Graph has a circle.");return e},e.prototype.validateEdges=function(e,t){return this.validateNodes(t),this._validateEdges(e,t)},e.prototype._validateEdge=function(e,t){if(void 0===e.source)throw new l("Source not valid.");if(void 0===e.destination)throw new l("Destination not valid.");if(e.source===e.destination)throw new l("Edge with same source and destination connectors.");var n=t.filter((function(t){return t.connectors.some((function(t){return t.id===e.source}))}))[0];if(void 0===n)throw new l("Source not valid.");var o=t.filter((function(t){return t.connectors.some((function(t){return t.id===e.destination}))}))[0];if(void 0===o)throw new l("Destination not valid.");if(n===o)throw new l("Edge with same source and destination nodes.");return e},e.prototype.validateEdge=function(e,t){return this.validateNodes(t),this._validateEdge(e,t)},e.prototype.validateConnector=function(e){if(void 0===e.id)throw new l("Id not valid.");if(void 0===e.type||null===e.type||"string"!=typeof e.type)throw new l("Type not valid.");return e},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[]},e}(),m={dropElement:null},y=function(){function e(e,t,n,o){this.nodeDraggingScope={shadowDragStarted:!1,dropElement:null,draggedNodes:[],shadowElements:[]},this.dragOffsets=[],this.draggedElements=[],this.destinationHtmlElements=[],this.oldDisplayStyles=[],this.modelService=e,this.automaticResize=n,this.dragAnimation=o,this.applyFunction=t}return e.prototype.getCoordinate=function(e,t){return e=Math.max(e,0),e=Math.min(e,t)},e.prototype.getXCoordinate=function(e){return this.getCoordinate(e,this.modelService.canvasHtmlElement.offsetWidth)},e.prototype.getYCoordinate=function(e){return this.getCoordinate(e,this.modelService.canvasHtmlElement.offsetHeight)},e.prototype.resizeCanvas=function(e,t){if(this.automaticResize&&!this.modelService.isDropSource()){var n=this.modelService.canvasHtmlElement;n.offsetWidth

'+k.name+"

"),I=$(this.draggedElements[w]).children()[0];O.children()[0].style.backgroundColor=I.style.backgroundColor,this.nodeDraggingScope.shadowElements.push(O),this.modelService.canvasHtmlElement.appendChild(this.nodeDraggingScope.shadowElements[w][0])}if(S.dataTransfer.setData("text","Just to support firefox"),S.dataTransfer.setDragImage)S.dataTransfer.setDragImage(this.modelService.getDragImage(),0,0);else{for(w=0;w\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n {{edgeDraggingService.edgeDragging.dragLabel}}\n
\n
\n \n
\n
\n \n
\n
\n ×\n
\n {{edge.label}}\n
\n \n \n\n',changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[":host{display:block;position:relative;width:100%;height:100%;background-size:25px 25px;background-image:linear-gradient(to right,rgba(0,0,0,.1) 1px,transparent 1px),linear-gradient(to bottom,rgba(0,0,0,.1) 1px,transparent 1px);background-color:transparent;min-width:100%;min-height:100%;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .fc-canvas-container{display:block;position:relative;width:100%;height:100%}:host .fc-canvas-container svg.fc-canvas-svg{display:block;position:relative;width:100%;height:100%}:host .fc-edge{stroke:gray;stroke-width:4;transition:stroke-width .2s;fill:transparent}:host .fc-edge.fc-hover{stroke:gray;stroke-width:6;fill:transparent}:host .fc-edge.fc-selected{stroke:red;stroke-width:4;fill:transparent}:host .fc-edge.fc-active{-webkit-animation:3s linear infinite dash;animation:3s linear infinite dash;stroke-dasharray:20}:host .fc-edge.fc-dragging{pointer-events:none}:host .fc-arrow-marker polygon{stroke:gray;fill:gray}:host .fc-arrow-marker-selected polygon{stroke:red;fill:red}:host .edge-endpoint{fill:gray}:host .fc-noselect{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .fc-edge-label{position:absolute;opacity:.8;transition:transform .2s;transform-origin:bottom left;margin:0 auto}:host .fc-edge-label .fc-edge-label-text{position:absolute;transform:translate(-50%,-50%);white-space:nowrap;text-align:center;font-size:16px}:host .fc-edge-label .fc-edge-label-text span{cursor:default;border:solid #ff3d00;border-radius:10px;color:#ff3d00;background-color:#fff;padding:3px 5px}:host .fc-edge-label .fc-nodeedit{top:-30px;right:14px}:host .fc-edge-label .fc-nodedelete{top:-30px;right:-13px}:host .fc-edge-label.fc-hover{transform:scale(1.25)}:host .fc-edge-label.fc-edit .fc-edge-label-text span,:host .fc-edge-label.fc-selected .fc-edge-label-text span{border:solid red;color:#fff;font-weight:600;background-color:red}:host .fc-select-rectangle{border:2px dashed #5262ff;position:absolute;background:rgba(20,125,255,.1);z-index:2}@-webkit-keyframes dash{from{stroke-dashoffset:500}}@keyframes dash{from{stroke-dashoffset:500}}:host ::ng-deep .fc-nodeedit{display:none;font-size:15px}:host ::ng-deep .fc-nodedelete{display:none;font-size:18px}:host ::ng-deep .fc-edit .fc-nodedelete,:host ::ng-deep .fc-edit .fc-nodeedit{display:block;position:absolute;border:2px solid #eee;border-radius:50%;font-weight:600;line-height:20px;height:20px;padding-top:2px;width:22px;background:#494949;color:#fff;text-align:center;vertical-align:bottom;cursor:pointer}:host ::ng-deep .fc-edit .fc-nodeedit{top:-24px;right:16px}:host ::ng-deep .fc-edit .fc-nodedelete{top:-24px;right:-13px}"]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.IterableDiffers},{type:v},{type:C},{type:t.ChangeDetectorRef},{type:t.NgZone}]},e.propDecorators={canvasClass:[{type:t.HostBinding,args:["attr.class"]}],model:[{type:t.Input}],selectedObjects:[{type:t.Input}],edgeStyle:[{type:t.Input}],userCallbacks:[{type:t.Input}],automaticResize:[{type:t.Input}],dragAnimation:[{type:t.Input}],nodeWidth:[{type:t.Input}],nodeHeight:[{type:t.Input}],dropTargetId:[{type:t.Input}],dragover:[{type:t.HostListener,args:["dragover",["$event"]]}],drop:[{type:t.HostListener,args:["drop",["$event"]]}],mousedown:[{type:t.HostListener,args:["mousedown",["$event"]]}],mousemove:[{type:t.HostListener,args:["mousemove",["$event"]]}],mouseup:[{type:t.HostListener,args:["mouseup",["$event"]]}]},e}();var I=function(){function e(e){this.elementRef=e}return e.prototype.ngOnInit=function(){$(this.elementRef.nativeElement).addClass(d.magnetClass)},e.prototype.dragover=function(e){return this.callbacks.edgeDragoverMagnet(e,this.connector)},e.prototype.dragleave=function(e){this.callbacks.edgeDragleaveMagnet(e)},e.prototype.drop=function(e){return this.callbacks.edgeDrop(e,this.connector)},e.prototype.dragend=function(e){this.callbacks.edgeDragend(e)},e.decorators=[{type:t.Directive,args:[{selector:"[fc-magnet]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={callbacks:[{type:t.Input}],connector:[{type:t.Input}],dragover:[{type:t.HostListener,args:["dragover",["$event"]]}],dragleave:[{type:t.HostListener,args:["dragleave",["$event"]]}],drop:[{type:t.HostListener,args:["drop",["$event"]]}],dragend:[{type:t.HostListener,args:["dragend",["$event"]]}]},e}();var A=function(){function e(e){this.elementRef=e}return e.prototype.ngOnInit=function(){var e=$(this.elementRef.nativeElement);e.addClass(d.connectorClass),this.modelservice.isEditable()&&(e.attr("draggable","true"),this.updateConnectorClass()),this.modelservice.connectors.setHtmlElement(this.connector.id,e[0])},e.prototype.ngOnChanges=function(e){var t,n,o=!1;try{for(var r=s(Object.keys(e)),i=r.next();!i.done;i=r.next()){var a=i.value,d=e[a];d.firstChange||d.currentValue===d.previousValue||"mouseOverConnector"===a&&(o=!0)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}o&&this.modelservice.isEditable()&&this.updateConnectorClass()},e.prototype.updateConnectorClass=function(){var e=$(this.elementRef.nativeElement);this.connector===this.mouseOverConnector?e.addClass(d.hoverClass):e.removeClass(d.hoverClass)},e.prototype.dragover=function(e){},e.prototype.drop=function(e){if(this.modelservice.isEditable())return this.callbacks.edgeDrop(e,this.connector)},e.prototype.dragend=function(e){this.modelservice.isEditable()&&this.callbacks.edgeDragend(e)},e.prototype.dragstart=function(e){this.modelservice.isEditable()&&this.callbacks.edgeDragstart(e,this.connector)},e.prototype.mouseenter=function(e){this.modelservice.isEditable()&&this.callbacks.connectorMouseEnter(e,this.connector)},e.prototype.mouseleave=function(e){this.modelservice.isEditable()&&this.callbacks.connectorMouseLeave(e,this.connector)},e.decorators=[{type:t.Directive,args:[{selector:"[fc-connector]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={callbacks:[{type:t.Input}],modelservice:[{type:t.Input}],connector:[{type:t.Input}],mouseOverConnector:[{type:t.Input}],dragover:[{type:t.HostListener,args:["dragover",["$event"]]}],drop:[{type:t.HostListener,args:["drop",["$event"]]}],dragend:[{type:t.HostListener,args:["dragend",["$event"]]}],dragstart:[{type:t.HostListener,args:["dragstart",["$event"]]}],mouseenter:[{type:t.HostListener,args:["mouseenter",["$event"]]}],mouseleave:[{type:t.HostListener,args:["mouseleave",["$event"]]}]},e}();var R=function(){function e(e,t,n){this.nodeComponentConfig=e,this.elementRef=t,this.componentFactoryResolver=n}return Object.defineProperty(e.prototype,"nodeId",{get:function(){return this.node.id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.node.y+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"left",{get:function(){return this.node.x+"px"},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.userNodeCallbacks||(this.userNodeCallbacks={}),this.userNodeCallbacks.nodeEdit=this.userNodeCallbacks.nodeEdit||function(){},this.userNodeCallbacks.doubleClick=this.userNodeCallbacks.doubleClick||function(){},this.userNodeCallbacks.mouseDown=this.userNodeCallbacks.mouseDown||function(){},this.userNodeCallbacks.mouseEnter=this.userNodeCallbacks.mouseEnter||function(){},this.userNodeCallbacks.mouseLeave=this.userNodeCallbacks.mouseLeave||function(){};var e=$(this.elementRef.nativeElement);e.addClass(d.nodeClass),this.node.readonly||e.attr("draggable","true"),this.updateNodeClass(),this.modelservice.nodes.setHtmlElement(this.node.id,e[0]),this.nodeContentContainer.clear();var t=this.componentFactoryResolver.resolveComponentFactory(this.nodeComponentConfig.nodeComponentType),n=this.nodeContentContainer.createComponent(t);this.nodeComponent=n.instance,this.nodeComponent.callbacks=this.callbacks,this.nodeComponent.userNodeCallbacks=this.userNodeCallbacks,this.nodeComponent.node=this.node,this.nodeComponent.modelservice=this.modelservice,this.updateNodeComponent()},e.prototype.ngOnChanges=function(e){var t,n,o=!1;try{for(var r=s(Object.keys(e)),i=r.next();!i.done;i=r.next()){var a=i.value,d=e[a];d.firstChange||d.currentValue===d.previousValue||["selected","edit","underMouse","mouseOverConnector","dragging"].includes(a)&&(o=!0)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}o&&(this.updateNodeClass(),this.updateNodeComponent())},e.prototype.updateNodeClass=function(){var e=$(this.elementRef.nativeElement);this.toggleClass(e,d.selectedClass,this.selected),this.toggleClass(e,d.editClass,this.edit),this.toggleClass(e,d.hoverClass,this.underMouse),this.toggleClass(e,d.draggingClass,this.dragging)},e.prototype.updateNodeComponent=function(){this.nodeComponent.selected=this.selected,this.nodeComponent.edit=this.edit,this.nodeComponent.underMouse=this.underMouse,this.nodeComponent.mouseOverConnector=this.mouseOverConnector,this.nodeComponent.dragging=this.dragging},e.prototype.toggleClass=function(e,t,n){n?e.addClass(t):e.removeClass(t)},e.prototype.mousedown=function(e){e.stopPropagation()},e.prototype.dragstart=function(e){this.node.readonly||this.callbacks.nodeDragstart(e,this.node)},e.prototype.dragend=function(e){this.node.readonly||this.callbacks.nodeDragend(e)},e.prototype.click=function(e){this.node.readonly||this.callbacks.nodeClicked(e,this.node)},e.prototype.mouseover=function(e){this.node.readonly||this.callbacks.nodeMouseOver(e,this.node)},e.prototype.mouseout=function(e){this.node.readonly||this.callbacks.nodeMouseOut(e,this.node)},e.decorators=[{type:t.Component,args:[{selector:"fc-node",template:"",styles:[":host{position:absolute;z-index:1}:host.fc-dragging{z-index:10}:host ::ng-deep .fc-leftConnectors,:host ::ng-deep .fc-rightConnectors{position:absolute;top:0;height:100%;display:flex;flex-direction:column;z-index:-10}:host ::ng-deep .fc-leftConnectors .fc-magnet,:host ::ng-deep .fc-rightConnectors .fc-magnet{align-items:center}:host ::ng-deep .fc-leftConnectors{left:-20px}:host ::ng-deep .fc-rightConnectors{right:-20px}:host ::ng-deep .fc-magnet{display:flex;flex-grow:1;height:60px;justify-content:center}:host ::ng-deep .fc-connector{width:18px;height:18px;border:10px solid transparent;-moz-background-clip:padding;-webkit-background-clip:padding;background-clip:padding-box;border-radius:50%;background-color:#f7a789;color:#fff;pointer-events:all}:host ::ng-deep .fc-connector.fc-hover{background-color:#000}"]}]}],e.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[a]}]},{type:t.ElementRef},{type:t.ComponentFactoryResolver}]},e.propDecorators={callbacks:[{type:t.Input}],userNodeCallbacks:[{type:t.Input}],node:[{type:t.Input}],selected:[{type:t.Input}],edit:[{type:t.Input}],underMouse:[{type:t.Input}],mouseOverConnector:[{type:t.Input}],modelservice:[{type:t.Input}],dragging:[{type:t.Input}],nodeId:[{type:t.HostBinding,args:["attr.id"]}],top:[{type:t.HostBinding,args:["style.top"]}],left:[{type:t.HostBinding,args:["style.left"]}],nodeContentContainer:[{type:t.ViewChild,args:["nodeContent",{read:t.ViewContainerRef,static:!0}]}],mousedown:[{type:t.HostListener,args:["mousedown",["$event"]]}],dragstart:[{type:t.HostListener,args:["dragstart",["$event"]]}],dragend:[{type:t.HostListener,args:["dragend",["$event"]]}],click:[{type:t.HostListener,args:["click",["$event"]]}],mouseover:[{type:t.HostListener,args:["mouseover",["$event"]]}],mouseout:[{type:t.HostListener,args:["mouseout",["$event"]]}]},e}();var H=function(){function e(){this.flowchartConstants=d}return e.prototype.ngOnInit=function(){},e.propDecorators={callbacks:[{type:t.Input}],userNodeCallbacks:[{type:t.Input}],node:[{type:t.Input}],selected:[{type:t.Input}],edit:[{type:t.Input}],underMouse:[{type:t.Input}],mouseOverConnector:[{type:t.Input}],modelservice:[{type:t.Input}],dragging:[{type:t.Input}]},e}();var N=function(e){function n(){return e.call(this)||this}return i(n,e),n.decorators=[{type:t.Component,args:[{selector:"fc-default-node",template:'\n
\n
\n

{{ node.name }}

\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n ×\n
\n\n',styles:[":host .fc-node-overlay{position:absolute;pointer-events:none;left:0;top:0;right:0;bottom:0;background-color:#000;opacity:0}:host :host-context(.fc-hover) .fc-node-overlay{opacity:.25;transition:opacity .2s}:host :host-context(.fc-selected) .fc-node-overlay{opacity:.25}:host .innerNode{display:flex;justify-content:center;align-items:center;min-width:100px;border-radius:5px;background-color:#f15b26;color:#fff;font-size:16px;pointer-events:none}:host .innerNode p{padding:0 15px;text-align:center}"]}]}],n.ctorParameters=function(){return[]},n}(H),M={nodeComponentType:N},P=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{entryComponents:[N],declarations:[O,I,A,R,N],providers:[v,C,{provide:a,useValue:M}],imports:[o.CommonModule],exports:[O,I,A,N]}]}],e}();e.FC_NODE_COMPONENT_CONFIG=a,e.FcNodeComponent=H,e.FlowchartConstants=d,e.ModelvalidationError=l,e.NgxFlowchartComponent=O,e.NgxFlowchartModule=P,e.fcTopSort=c,e.ɵa=R,e.ɵb=v,e.ɵc=C,e.ɵd=N,e.ɵe=I,e.ɵf=A,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=ngx-flowchart.umd.min.js.map