!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/flex-layout"),require("@angular/forms"),require("@lcu/common"),require("jsplumbtoolkit-angular"),require("jsplumbtoolkit-angular-drop"),require("ng2-charts"),require("@lowcodeunit/lazy-element"),require("@angular/material/dialog"),require("jsplumbtoolkit"),require("@angular/material/snack-bar"),require("util"),require("jsplumbtoolkit-angular/jsplumbtoolkit-angular")):"function"==typeof define&&define.amd?define("@napkin-ide/lcu-data-flow-common",["exports","@angular/core","@angular/flex-layout","@angular/forms","@lcu/common","jsplumbtoolkit-angular","jsplumbtoolkit-angular-drop","ng2-charts","@lowcodeunit/lazy-element","@angular/material/dialog","jsplumbtoolkit","@angular/material/snack-bar","util","jsplumbtoolkit-angular/jsplumbtoolkit-angular"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self)["napkin-ide"]=t["napkin-ide"]||{},t["napkin-ide"]["lcu-data-flow-common"]={}),t.ng.core,t.ng.flexLayout,t.ng.forms,t.common,t.jsplumbtoolkitAngular,t.jsplumbtoolkitAngularDrop,t.ng2Charts,t.lazyElement,t.ng.material.dialog,t.jsplumbtoolkit,t.ng.material.snackBar,t.util,t.i1)}(this,(function(t,e,n,o,a,r,i,s,l,u,c,d,p,h){"use strict";
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */var m=function(t,e){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function g(t,e){function n(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function f(t,e,n,o){return new(n||(n=Promise))((function(a,r){function i(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,s)}l((o=o.apply(t,e||[])).next())}))}function y(t,e){var n,o,a,r,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(a=2&r[0]?o.return:r[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,r[1])).done)return a;switch(o=0,a&&(r=[2&r[0],a.value]),r[0]){case 0:case 1:a=r;break;case 4:return i.label++,{value:r[1],done:!1};case 5:i.label++,o=r[1],r=[0];continue;case 7:r=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==r[0]&&2!==r[0])){i=0;continue}if(3===r[0]&&(!a||r[1]>a[0]&&r[1]<a[3])){i.label=r[1];break}if(6===r[0]&&i.label<a[1]){i.label=a[1],a=r;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(r);break}a[2]&&i.ops.pop(),i.trys.pop();continue}r=e.call(t,i)}catch(t){r=[6,t],o=0}finally{n=a=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}Object.create;Object.create;var S=function(t){function e(e){var n=t.call(this,e)||this;return n.injector=e,n}return g(e,t),e.prototype.AddIoTInfrastructure=function(){this.Execute({Arguments:{},Type:"AddIoTInfrastructure"})},e.prototype.DeleteDataFlow=function(t){this.Execute({Arguments:{DataFlowLookup:t},Type:"DeleteDataFlow"})},e.prototype.DeployDataFlow=function(t){this.Execute({Arguments:{DataFlowLookup:t},Type:"DeployDataFlow"})},e.prototype.SaveDataFlow=function(t){this.Execute({Arguments:{DataFlow:t},Type:"SaveDataFlow"})},e.prototype.SetActiveDataFlow=function(t){this.Execute({Arguments:{DataFlowLookup:t},Type:"SetActiveDataFlow"})},e.prototype.ToggleCreationModules=function(){this.Execute({Arguments:{},Type:"ToggleCreationModules"})},e.prototype.ToggleIsCreating=function(){this.Execute({Arguments:{},Type:"ToggleIsCreating"})},e.prototype.defaultValue=function(){return{Loading:!0}},e.prototype.loadStateKey=function(){return"main"},e.prototype.loadStateName=function(){return"dataflowmanagement"},e}(a.StateContext);S.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new S(e.ɵɵinject(e.INJECTOR))},token:S,providedIn:"root"}),S.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],S.ctorParameters=function(){return[{type:e.Injector}]};var w=function(){function t(){this.deleteDataFlow=new e.EventEmitter,this.deployDataFlow=new e.EventEmitter,this.saveDataFlow=new e.EventEmitter,this.setActiveDataFlow=new e.EventEmitter,this.toggleCreationModules=new e.EventEmitter,this.toggleIsCreating=new e.EventEmitter}return t.prototype.EmitDeleteDataFlowEvent=function(t){this.deleteDataFlow.emit(t)},t.prototype.GetDeleteDataFlowEvent=function(){return this.deleteDataFlow},t.prototype.EmitDeployDataFlowEvent=function(t){this.deployDataFlow.emit(t)},t.prototype.GetDeployDataFlowEvent=function(){return this.deployDataFlow},t.prototype.EmitSaveDataFlowEvent=function(t){this.saveDataFlow.emit(t)},t.prototype.GetSaveDataFlowEvent=function(){return this.saveDataFlow},t.prototype.EmitSetActiveDataFlowEvent=function(t){this.setActiveDataFlow.emit(t)},t.prototype.GetSetActiveDataFlowEvent=function(){return this.setActiveDataFlow},t.prototype.EmitToggleCreationModulesEvent=function(){this.toggleCreationModules.emit()},t.prototype.GetToggleCreationModulesEvent=function(){return this.toggleCreationModules},t.prototype.EmitToggleIsCreatingEvent=function(){this.toggleIsCreating.emit()},t.prototype.GetToggleIsCreatingEvent=function(){return this.toggleIsCreating},t}();w.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new w},token:w,providedIn:"root"}),w.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],w.ctorParameters=function(){return[]};var D=function(){},v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e}(a.LCUElementContext),b="lcu-data-flow-manager-element",F=function(t){function e(e,n,o){var a=t.call(this,e)||this;return a.injector=e,a.state=n,a.dataFlowEventService=o,a.subscriptions={deleteDataFlow:a.deleteDataFlow(),deployDataFlow:a.deployDataFlow(),saveDataFlow:a.saveDataFlow(),setActiveDataFlow:a.setActiveDataFlow(),toggleCreationModules:a.toggleCreationModules(),toggleIsCreating:a.toggleIsCreating()},a}return g(e,t),e.prototype.ngOnInit=function(){var e=this;t.prototype.ngOnInit.call(this),this.state.Context.subscribe((function(t){return f(e,void 0,void 0,(function(){return y(this,(function(e){switch(e.label){case 0:return this.State=t,console.log(this.State),[4,this.handleStateChanged()];case 1:return e.sent(),[2]}}))}))}))},e.prototype.ngOnDestroy=function(){for(var t in this.subscriptions)this.subscriptions[t]&&(this.subscriptions[t].unsubscribe(),delete this.subscriptions[t])},e.prototype.AddIoT=function(){this.State.Loading=!0,this.state.AddIoTInfrastructure()},e.prototype.handleStateChanged=function(){},e.prototype.deleteDataFlow=function(){var t=this;return this.dataFlowEventService.GetDeleteDataFlowEvent().subscribe((function(e){t.State.Loading=!0,t.state.DeleteDataFlow(e)}))},e.prototype.deployDataFlow=function(){var t=this;return this.dataFlowEventService.GetDeployDataFlowEvent().subscribe((function(e){t.State.Loading=!0,t.state.DeployDataFlow(e)}))},e.prototype.saveDataFlow=function(){var t=this;return this.dataFlowEventService.GetSaveDataFlowEvent().subscribe((function(e){t.State.Loading=!0,t.state.SaveDataFlow(e)}))},e.prototype.setActiveDataFlow=function(){var t=this;return this.dataFlowEventService.GetSetActiveDataFlowEvent().subscribe((function(e){t.State.Loading=!0,t.state.SetActiveDataFlow(e)}))},e.prototype.toggleCreationModules=function(){var t=this;return this.dataFlowEventService.GetToggleCreationModulesEvent().subscribe((function(){t.State.Loading=!0,t.state.ToggleCreationModules()}))},e.prototype.toggleIsCreating=function(){var t=this;return this.dataFlowEventService.GetToggleIsCreatingEvent().subscribe((function(){t.State.Loading=!0,t.state.ToggleIsCreating()}))},e}(a.LcuElementComponent);F.decorators=[{type:e.Component,args:[{selector:b,template:'<div class="data-flow-manager-container">\r\n  <ng-container *ngIf="!State.Loading">\r\n    \x3c!-- <div class="spread" *ngIf="!State.ModuleOptions || State.ModuleOptions.length <= 2">\r\n      <h2 class="mat-headline">Unable to Detect IoT Infrastructure</h2>\r\n\r\n      <p class="mat-body-2 spread">\r\n        We are unable to detect any IoT infrastructure to use with the Data Flow tool. If you have already clicked the button below, wait a\r\n        bit longer and refresh the page. If you have not clicked to add IoT infrastructure, then do so now.\r\n      </p>\r\n\r\n      <div class="spread">\r\n        <a mat-raised-button color="primary" (click)="AddIoT()">Add IoT Infrastructure</a>\r\n      </div>\r\n    </div> --\x3e\r\n\r\n    <div *ngIf="!State.ActiveDataFlow" class="spread">\r\n      <h2 class="mat-headline">Data Flow Management</h2>\r\n\r\n      <p class="mat-body-2 spread">\r\n        The Data Flow Manager is a powerful drag and drop interface for easily \r\n        configuring and provisioning end-to-end cloud infrastructure. \r\n      </p>\r\n      <p class="mat-body-2 spread">\r\n        Here you can manage all the data flows in your workspace. \r\n        Pay careful attention to the data flow types contained here as they all have \r\n        different outcomes and costs depending on what assets and configurations are \r\n        provisioned. \r\n      </p>\r\n\r\n      <lcu-data-flow-list-element [context]="{ State: State }"></lcu-data-flow-list-element>\r\n    </div>\r\n\r\n    <ng-container *ngIf="State.ActiveDataFlow">\r\n      <lcu-data-flow-ide-element [context]="{ State: State }"></lcu-data-flow-ide-element>\r\n    </ng-container>\r\n  </ng-container>\r\n\r\n  <div class="spread" *ngIf="State.Loading">\r\n    <mat-spinner></mat-spinner>\r\n  </div>\r\n</div>\r\n',styles:[":host ::ng-deep .data-flow-manager-container{height:100%}"]}]}],F.ctorParameters=function(){return[{type:e.Injector},{type:S},{type:w}]};var I=function(){},T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e}(a.LCUElementContext),C="lcu-data-flow-list-element",E=function(t){function e(e,n,o){var a=t.call(this,o)||this;return a.dataFlowEventService=e,a.formBldr=n,a.injector=o,a}return g(e,t),Object.defineProperty(e.prototype,"DataFlowLookup",{get:function(){return this.CreateNewDataFlowForm?this.CreateNewDataFlowForm.get("lookup"):null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"DataFlowLookupHasError",{get:function(){return this.DataFlowLookup.hasError("pattern")||this.DataFlowLookup.hasError("required")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"DataFlowLookupErrorMessage",{get:function(){return this.DataFlowLookup.hasError("pattern")?"The Project lookup must contain 1 - 4 charaters, all lowercase with '-'. A '-' may not start or end the value.":this.DataFlowLookup.hasError("required")?"The Data Flow lookup is required.":void 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"State",{get:function(){return this.context.State},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){t.prototype.ngOnInit.call(this),this.CreateNewDataFlowForm=this.formBldr.group({name:["",o.Validators.required],desc:["",o.Validators.required],lookup:["",{validators:o.Validators.compose([o.Validators.required,o.Validators.pattern("^[a-z-]{1,4}$")]),updateOn:"change"}]}),this.handleStateChanged()},e.prototype.CreateNewDataFlow=function(){this.dataFlowEventService.EmitSaveDataFlowEvent({Name:this.CreateNewDataFlowForm.controls.name.value,Description:this.CreateNewDataFlowForm.controls.desc.value,Lookup:this.CreateNewDataFlowForm.controls.lookup.value})},e.prototype.DeleteDataFlow=function(t){confirm("Are you sure you want to delete the data flow for '"+t.Name+"'?")&&this.dataFlowEventService.EmitDeleteDataFlowEvent(t.Lookup)},e.prototype.SetActiveDataFlow=function(t){this.dataFlowEventService.EmitSetActiveDataFlowEvent(t.Lookup)},e.prototype.ToggleIsCreating=function(){this.dataFlowEventService.EmitToggleIsCreatingEvent()},e.prototype.handleStateChanged=function(){},e}(a.LcuElementComponent);E.decorators=[{type:e.Component,args:[{selector:C,template:'<div class="data-flow-list-header" fxLayout="row" fxLayoutAlign="space-between center">\r\n  <h3 fxLayoutAlign="start center" fxFlex="70%">\r\n    <mat-icon>settings_input_antenna</mat-icon>\r\n    Active Data Flows\r\n  </h3>\r\n  <div fxLayout="start center" fxFlex="30%">\r\n    <a\r\n      mat-raised-button\r\n      color="accent"\r\n      (click)="ToggleIsCreating()"\r\n      *ngIf="!State.IsCreating"\r\n    >\r\n      Create New Data Flow\r\n    </a>\r\n  </div>\r\n</div>\r\n\r\n<mat-list *ngIf="State">\r\n  <ng-container *ngIf="!State.IsCreating">\r\n    <mat-list-item *ngFor="let dataFlow of State.DataFlows">\r\n      <div fxFlex="70%" class="list-item-container">\r\n        <div fxLayout="row" fxLayoutAlign="start center">\r\n          <h4 fxFlex="20%">\r\n            {{ dataFlow.Name }}  &nbsp;\r\n          </h4>\r\n          <div class="description"  fxFlex="75%" >{{ dataFlow.Description }}</div>\r\n        </div>\r\n      </div>\r\n\r\n      <div fxFlex="30%">\r\n        <a\r\n          mat-raised-button\r\n          color="accent"\r\n          (click)="SetActiveDataFlow(dataFlow)"\r\n        >\r\n          <mat-icon>settings</mat-icon>\r\n\r\n          <span *ngIf="!dataFlow.PreventEditing">Manage</span>\r\n\r\n          <span *ngIf="dataFlow.PreventEditing">View</span>\r\n        </a>\r\n\r\n        <a mat-icon-button color="warn" (click)="DeleteDataFlow(dataFlow)">\r\n          <mat-icon>delete</mat-icon>\r\n        </a>\r\n      </div>\r\n    </mat-list-item>\r\n\r\n    <mat-list-item *ngIf="!State?.DataFlows || State.DataFlows.length == 0">\r\n      <h4 mat-line>No active data flows. Create a new data flow now.</h4>\r\n    </mat-list-item>\r\n  </ng-container>\r\n\r\n  <ng-container *ngIf="State.IsCreating">\r\n    <form [formGroup]="CreateNewDataFlowForm" (ngSubmit)="CreateNewDataFlow()">\r\n      <div>\r\n        <mat-form-field style="width: 100%;" class="disable-autofill-background-default">\r\n          <input\r\n            type="text"\r\n            matInput\r\n            placeholder="Name"\r\n            formControlName="name"\r\n            maxlength="40"\r\n            required\r\n          />\r\n        </mat-form-field>\r\n      </div>\r\n\r\n      <div>\r\n        <mat-form-field style="width: 100%;" class="disable-autofill-background-default">\r\n          <input\r\n            type="text"\r\n            matInput\r\n            placeholder="Description"\r\n            formControlName="desc"\r\n            maxlength="175"\r\n            required\r\n          />\r\n        </mat-form-field>\r\n      </div>\r\n\r\n      <div>\r\n        <mat-form-field style="width: 100%;" class="disable-autofill-background-default">\r\n          <input\r\n            type="text"\r\n            matInput\r\n            placeholder="Lookup"\r\n            formControlName="lookup"\r\n            required\r\n            maxlength="4"\r\n          />\r\n          <mat-icon\r\n            matSuffix\r\n            matTooltip="Lookups are a 1 to 4 length alpha lower-case representation of the current domain object.  This format helps keep your flow agnostic to any specific service provider.  When naming lookups, use something that is recognizable and relevant based on the asset you are creating"\r\n          >\r\n            info\r\n          </mat-icon>\r\n\r\n          <mat-error *ngIf="DataFlowLookupHasError">\r\n            {{ DataFlowLookupErrorMessage }}\r\n          </mat-error>\r\n        </mat-form-field>\r\n      </div>\r\n\r\n      <div class="spread">\r\n        <button\r\n          mat-raised-button\r\n          color="primary"\r\n          type="submit"\r\n          [disabled]="!CreateNewDataFlowForm.valid"\r\n        >\r\n          Create Data Flow\r\n        </button>\r\n\r\n        <a mat-raised-button color="warn" (click)="ToggleIsCreating()"\r\n          ><mat-icon>delete</mat-icon> Cancel</a\r\n        >\r\n      </div>\r\n    </form>\r\n  </ng-container>\r\n\r\n  <hr />\r\n\r\n  <br />\r\n\r\n  \x3c!-- <mat-list-item>\r\n    <a\r\n      mat-raised-button\r\n      color="accent"\r\n      (click)="ToggleIsCreating()"\r\n      *ngIf="!State.IsCreating"\r\n    >\r\n      Create New Data Flow\r\n    </a>\r\n  </mat-list-item> --\x3e\r\n</mat-list>\r\n',styles:[".data-flow-list-header{padding:0 16px}.list-item-container{margin-bottom:10px;margin-top:10px}.description{display:flex;flex-wrap:wrap}"]}]}],E.ctorParameters=function(){return[{type:w},{type:o.FormBuilder},{type:e.Injector}]};var M=function(){function t(t,e){this.dialogRef=t,this.data=e,this.DisableCreateButton=!0,console.log("Data: ",e)}return Object.defineProperty(t.prototype,"NameControl",{get:function(){return this.Form.get("nameControl")},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){this.setupForm(),this.setupTitle()},t.prototype.setupForm=function(){this.Form=new o.FormGroup({nameControl:new o.FormControl(this.data.Text,o.Validators.compose([o.Validators.required]))}),this.onChanges()},t.prototype.setupTitle=function(){if(this.data.Type){var t="";this.data.Type.split("-").forEach((function(e){t+=e.charAt(0).toLocaleUpperCase()+e.slice(1)+" "})),this.ResourceName=t.trim()}},t.prototype.onChanges=function(){var t=this;this.Form.valueChanges.subscribe((function(e){""===e.nameControl||!e.nameControl||e.nameControl.length<2?t.DisableCreateButton=!0:t.DisableCreateButton=!1}))},t.prototype.Create=function(){this.dialogRef.close({event:"test",data:this.NameControl.value})},t.prototype.CancelResourceCreation=function(){this.dialogRef.close()},t}();M.decorators=[{type:e.Component,args:[{selector:"lcu-dialog-body",template:'<form fxLayout="column" fxLayoutGap="10px" [formGroup]="Form" (ngSubmit)="Create()" novalidate>\r\n  <h2 mat-dialog-title>{{ResourceName}}</h2>\r\n\r\n  <mat-dialog-content>\r\n    <div fxFlex fxLayout.lg="row" fxLayout.sm="column" fxLayout.xs="column" fxLayoutAlign="start center" fxLayoutGap="10px">\r\n      <mat-icon color="primary">storage</mat-icon>\r\n      <mat-form-field fxFlex>\r\n        <input formControlName="nameControl" matInput placeholder="Name" required />\r\n        \x3c!-- <mat-error *ngIf="LastNameControl.hasError(\'required\')">\r\n                A value is required\r\n              </mat-error> --\x3e\r\n      </mat-form-field>\r\n    </div>\r\n  </mat-dialog-content>\r\n\r\n  <mat-dialog-actions>\r\n    <button mat-button color="primary" class="mat-raised-button" [disabled]="DisableCreateButton" type="submit" >Save</button>\r\n    <a mat-button color="warn" class="mat-raised-button"  (click)="CancelResourceCreation()">Cancel</a>\r\n  </mat-dialog-actions>\r\n</form>\r\n',styles:[""]}]}],M.ctorParameters=function(){return[{type:u.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[u.MAT_DIALOG_DATA]}]}]};var x=function(){},k=function(t,e){this.Key=t,this.Value=e},R=function(){},A=function(){function t(t,e){this.dialogRef=t,this.data=e,this.ShowConnections=!1}return t.prototype.ngOnInit=function(){var t=this;this.Module=Object.assign({},this.data.Module),this.Config={Assets:[this.Module.Display.Toolkit],ElementName:this.Module.Display.Element};var e=this.Module.Settings||{},n=(this.Module.Status||{}).QuickView||{},o=Object.assign(Object.assign({},e),{Chart:n.Chart});this.Context={State:o},setTimeout((function(){t.displayConnections()}),1e3)},t.prototype.Cancel=function(){this.dialogRef.close(Object.assign({},this.data.Module))},t.prototype.Save=function(){this.dialogRef.close(Object.assign({},this.Module))},t.prototype.CopyToClipboard=function(t){var e=document.createElement("textarea"),n=this.Connections[t];e.value=n.Value,document.body.appendChild(e),e.focus(),e.select(),document.execCommand("copy"),document.body.removeChild(e)},t.prototype.displayConnections=function(){var t=this;this.Connections=[],Object.entries(this.Context.State.Infrastructure.Connections).forEach((function(e){t.Connections.push(new k(e[0],e[1]))})),this.ShowConnections=!0},t}();A.decorators=[{type:e.Component,args:[{selector:"lcu-dialog-module-configure",template:'<h1 mat-dialog-title>Managing {{ Module.Text }}</h1>\r\n\r\n<div mat-dialog-content>\r\n  <lcu-lazy-element [config]="Config" [context]="Context"></lcu-lazy-element>\r\n  <mat-expansion-panel *ngIf="ShowConnections === true">\r\n    <mat-expansion-panel-header>\r\n      <mat-panel-title>\r\n        <div fxLayout="row" fxLayoutAlign="start center">\r\n          <mat-icon color="accent" class="margin-right-2">swap_horizontal_circle</mat-icon>\r\n          Storage Connections\r\n        </div>\r\n      </mat-panel-title>\r\n      \x3c!-- <mat-panel-description>\r\n        This is a summary of the content\r\n      </mat-panel-description> --\x3e\r\n    </mat-expansion-panel-header>\r\n  \r\n  <mat-card>\r\n    <mat-card-header>\r\n        \x3c!-- <div mat-card-avatar>\r\n          <mat-icon color="accent">swap_horizontal_circle</mat-icon>\r\n        </div> --\x3e\r\n        <mat-card-title>Connections</mat-card-title>\r\n    </mat-card-header>\r\n    <mat-card-content>\r\n        <mat-list *ngFor="let connection of Connections; let i = index; let odd = odd; let even = even">\r\n          <mat-list-item [ngClass]="{ odd: odd, even: even }" style="height: auto;">\r\n            <div fxFlex fxLayout="row" class="margin-2">\r\n              <div fxFlex="95" fxLayout="column" class="margin-right-3 word-break-all">\r\n                <span id="connectionKey" name="connectionKey" class="mat-body-strong mat-body-2">{{connection.Key}}: </span>\r\n                <span id="connectionValue" name="connectionValue" class="mat-small mat-caption">{{connection.Value}}</span>\r\n              </div>\r\n              <div fxLayoutAlign="end start">\r\n                <button\r\n                  id="copyToClipboardButton"\r\n                  name="copyToClipboardButton"\r\n                  type="button"\r\n                  mat-button\r\n                  matTooltip="Copy connection string to Clipboard"\r\n                  matTooltipPosition="right"\r\n                  (click)="CopyToClipboard(i)">\r\n                  <mat-icon class="rotate-180 clipboard-icon">save_alt</mat-icon>\r\n                </button>\r\n              </div>\r\n            </div>\r\n          </mat-list-item>\r\n        </mat-list>\r\n    </mat-card-content>\r\n  </mat-card>\r\n</mat-expansion-panel>\r\n\r\n</div>\r\n\r\n<div mat-dialog-actions>\r\n  <button mat-button color="primary" (click)="Save()">Save</button>\r\n\r\n  <button mat-button color="warn" (click)="Cancel()">Cancel</button>\r\n</div>\r\n',styles:[":host .mat-dialog-content{height:calc(100% - 100px);max-height:100%}.rotate-180{transform:rotate(180deg)}.word-break-all{word-break:break-all}"]}]}],A.ctorParameters=function(){return[{type:u.MatDialogRef},{type:R,decorators:[{type:e.Inject,args:[u.MAT_DIALOG_DATA]}]}]};var O=function(t){function e(e){var n=t.call(this)||this;return n.matDialog=e,n.ModuleShapes=a.DataFlowModuleShapeTypes,n}return g(e,t),Object.defineProperty(e.prototype,"Module",{get:function(){return this.obj},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"StatusColor",{get:function(){return!this.Module.Status||this.Module.Status&&0!==this.Module.Status.Code&&100!==this.Module.Status.Code&&-100!==this.Module.Status.Code?"red":this.Module.Status&&-100===this.Module.Status.Code?"yellow":this.Module.Status&&0===this.Module.Status.Code?"green":this.Module.Status&&100===this.Module.Status.Code?"gray":void 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"StatusDiameter",{get:function(){return this.ViewDetails?12:50},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"StatusIconClass",{get:function(){return!this.Module.Status||this.Module.Status&&0!==this.Module.Status.Code&&100!==this.Module.Status.Code&&-100!==this.Module.Status.Code||this.Module.Status&&-100===this.Module.Status.Code?"warning":this.Module.Status&&0===this.Module.Status.Code?"check":this.Module.Status&&100===this.Module.Status.Code?"sync":void 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"StatusText",{get:function(){return!this.Module.Status||this.Module.Status&&0!==this.Module.Status.Code&&100!==this.Module.Status.Code&&-100!==this.Module.Status.Code?"Provisioned resource not located":this.Module.Status&&-100===this.Module.Status.Code?"Not yet provisioned":this.Module.Status&&0===this.Module.Status.Code?"Successfully provisioned":this.Module.Status&&100===this.Module.Status.Code?"Provisioning unavailable":void 0},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.setQuickView()}),1e3)},e.prototype.ngOnInit=function(){},e.prototype.Abs=function(t){return Math.abs(t)},e.prototype.EditNodeName=function(){var t=this,e={data:this.Module,disableClose:!0};null!=this.editNameDialogRef&&(this.editNameDialogRef.close({}),this.editNameDialogRef=null),this.editNameDialogRef=this.matDialog.open(M,e),this.editNameDialogRef.afterClosed().subscribe((function(e){var n=Object.assign(Object.assign({},t.Module),{Text:e.data});n.Text&&n.Text.length>2&&t.toolkit.updateNode(t.obj,n)}))},e.prototype.ManageModule=function(){var t=this,e={data:{Module:this.Module},height:"95%",width:"95%"};null!=this.configureDialogRef&&(this.configureDialogRef.close({}),this.configureDialogRef=null),this.configureDialogRef=this.matDialog.open(A,e),this.configureDialogRef.afterClosed().subscribe((function(e){var n=Object.assign({},e);n&&t.toolkit.updateNode(t.obj,n)}))},e.prototype.OpenModuleQuickView=function(){this.ToggleViewDetails()},e.prototype.RemoveNode=function(){null!=this.Module&&confirm("Delete '"+this.Module.Text+"'?")&&this.toolkit.removeNode(this.obj)},e.prototype.ToggleViewDetails=function(){this.ViewDetails=!this.ViewDetails},e.prototype.setQuickView=function(){var t=this.Module.Status;t&&t.QuickView&&t.QuickView.Chart?this.QuickView=t.QuickView:this.QuickView=null},e}(r.BaseNodeComponent);O.decorators=[{type:e.Component,args:[{template:'<div [style.width]="Abs(Module.Display.Width) + \'px\'"\r\n  [style.height]="Abs(Module.Display.Height) + \'px\'"\r\n  class="flowchart-object flowchart-{{ Module.Display.ModuleType }}">\r\n  <div style="width: calc(100%); height: calc(100%);">\r\n    <mat-card style="width: 100%; height: 100%;" class="outer">\r\n      <mat-card-header class="inner">\r\n        \x3c!-- <div mat-card-avatar class="example-header-image"></div> --\x3e\r\n\r\n        <mat-card-title>\r\n          <mat-icon *ngIf="Module.Display.Icon?.Icon"\r\n            >{{Module.Display.Icon?.Icon}}\r\n          </mat-icon>\r\n\r\n          {{ Module.Text }}\r\n        </mat-card-title>\r\n\r\n        \x3c!-- <mat-card-subtitle>Dog Breed</mat-card-subtitle> --\x3e\r\n      </mat-card-header>\r\n\r\n      <mat-card-content class="inner">\r\n        <mat-toolbar class="node-actions">\r\n          <span class="filler"></span>\r\n\r\n          <a title="Module Quick View"\r\n            class="node-quick-view"\r\n            (click)="OpenModuleQuickView()">\r\n            <mat-icon *ngIf="!ViewDetails" class="module-status-icon-sm">visibility</mat-icon>\r\n            <mat-icon *ngIf="ViewDetails" class="module-status-icon-sm">visibility_off</mat-icon>\r\n          </a>\r\n\r\n          <a title="Rename Module" class="node-edit" (click)="EditNodeName()">\r\n            <mat-icon class="module-status-icon-sm">edit</mat-icon>\r\n          </a>\r\n\r\n          <a title="Configure Module"\r\n            class="node-configure"\r\n            (click)="ManageModule()">\r\n            <mat-icon class="module-status-icon-sm">settings</mat-icon>\r\n          </a>\r\n\r\n          <a title="Delete Module" class="node-delete" (click)="RemoveNode()">\r\n            <mat-icon class="module-status-icon-sm">close</mat-icon>\r\n          </a>\r\n\r\n          \x3c!-- <a mat-icon-button title="Creation Modules" color="primary" (click)="ToggleCreationModules()">\r\n            <mat-icon *ngIf="State.AllowCreationModules">check_box</mat-icon>\r\n\r\n            <mat-icon *ngIf="!State.AllowCreationModules">check_box_outline_blank</mat-icon>\r\n          </a> --\x3e\r\n\r\n          <span class="filler"></span>\r\n        </mat-toolbar>\r\n\r\n        <div class="module-details" [ngClass]="{\'hide-details\': !ViewDetails}">\r\n          <div class="module-status-check"\r\n            [matTooltip]="StatusText"\r\n            [ngStyle]="{color: StatusColor}">\r\n\r\n            <mat-icon *ngIf="StatusIconClass !== \'sync\'" [ngClass]="{\'module-status-icon-lg\': !ViewDetails, \'module-status-icon-sm\': ViewDetails}">{{StatusIconClass}}</mat-icon>\r\n\r\n            <mat-progress-spinner *ngIf="StatusIconClass === \'sync\'"\r\n              mode="indeterminate"\r\n              style="display: inline-flex;"\r\n              [diameter]="StatusDiameter">\r\n            </mat-progress-spinner>\r\n\r\n            <span *ngIf="ViewDetails">{{StatusText}}</span>\r\n          </div>\r\n\r\n          <div class="module-status-chart" *ngIf="QuickView && QuickView.Chart">\r\n            <canvas\r\n              baseChart\r\n              *ngIf="ViewDetails"\r\n              chartType="line"\r\n              [legend]="false"\r\n              [options]="QuickView.Chart.Options"\r\n              [labels]="QuickView.Chart.Labels"\r\n              [colors]="QuickView.Chart.Colors"\r\n              [datasets]="QuickView.Chart.Results"\r\n            ></canvas>\r\n          </div>\r\n        </div>\r\n      </mat-card-content>\r\n    </mat-card>\r\n\r\n    \x3c!-- <svg\r\n      [attr.width]="Abs(Module.Display.Width)"\r\n      [attr.height]="Abs(Module.Display.Height)"\r\n      [fxShow]="Module.Display.Shape == ModuleShapes.Custom"\r\n    >\r\n      <path\r\n        [attr.d]="\r\n          \'M \' +\r\n          Abs(Module.Display.Width) / 2 +\r\n          \' 0 L \' +\r\n          Abs(Module.Display.Width) +\r\n          \' \' +\r\n          Abs(Module.Display.Height) / 2 +\r\n          \' L \' +\r\n          Abs(Module.Display.Width) / 2 +\r\n          \' \' +\r\n          Abs(Module.Display.Height) +\r\n          \' L 0 \' +\r\n          Abs(Module.Display.Height) / 2 +\r\n          \' Z\'\r\n        "\r\n        class="outer"\r\n      />\r\n      <path\r\n        [attr.d]="\r\n          \'M \' +\r\n          Abs(Module.Display.Width) / 2 +\r\n          \' 10 L \' +\r\n          Abs(Module.Display.Width - 10) +\r\n          \' \' +\r\n          Abs(Module.Display.Height) / 2 +\r\n          \' L \' +\r\n          Abs(Module.Display.Width) / 2 +\r\n          \' \' +\r\n          Abs(Module.Display.Height - 10) +\r\n          \' L 10 \' +\r\n          Abs(Module.Display.Height) / 2 +\r\n          \' Z\'\r\n        "\r\n        class="inner"\r\n      />\r\n\r\n      <text\r\n        text-anchor="middle"\r\n        [attr.x]="Abs(Module.Display.Width) / 2"\r\n        [attr.y]="Abs(Module.Display.Height) / 2"\r\n        dominant-baseline="central"\r\n      >\r\n        {{ Module.Text }}\r\n      </text>\r\n    </svg> --\x3e\r\n\r\n    \x3c!--\r\n    <svg\r\n      [attr.width]="Abs(Module.Display.Width)"\r\n      [attr.height]="Abs(Module.Display.Height)"\r\n      [fxShow]="Module.Display.Shape == ModuleShapes.Rectangle"\r\n    >\r\n      <rect [attr.x]="0" [attr.y]="0" [attr.width]="Abs(Module.Display.Width)" [attr.height]="Abs(Module.Display.Height)" class="outer" />\r\n\r\n      <rect\r\n        [attr.x]="10"\r\n        [attr.y]="10"\r\n        [attr.width]="Abs(Module.Display.Width - 20)"\r\n        [attr.height]="Abs(Module.Display.Height - 20)"\r\n        class="inner"\r\n      />\r\n\r\n      <text\r\n        text-anchor="middle"\r\n        [attr.x]="Abs(Module.Display.Width) / 2"\r\n        [attr.y]="Abs(Module.Display.Height) / 2"\r\n        dominant-baseline="central"\r\n      >\r\n        {{ Module.Text }}\r\n      </text>\r\n    </svg>\r\n\r\n    <svg\r\n      [attr.width]="Abs(Module.Display.Width)"\r\n      [attr.height]="Abs(Module.Display.Height)"\r\n      [fxShow]="Module.Display.Shape == ModuleShapes.Circle"\r\n    >\r\n      <circle [attr.cx]="Abs(Module.Display.Width) / 2" [attr.cy]="Abs(Module.Display.Height) / 2" class="outer" />\r\n      <circle [attr.cx]="Abs(Module.Display.Width) / 2" [attr.cy]="Abs(Module.Display.Height) / 2" class="inner" />\r\n\r\n      <text\r\n        text-anchor="middle"\r\n        [attr.x]="Abs(Module.Display.Width) / 2"\r\n        [attr.y]="Abs(Module.Display.Height) / 2"\r\n        dominant-baseline="central"\r\n      >\r\n        {{ Module.Text }}\r\n      </text>\r\n    </svg>\r\n\r\n    <svg\r\n      [attr.width]="Abs(Module.Display.Width)"\r\n      [attr.height]="Abs(Module.Display.Height)"\r\n      [fxShow]="Module.Display.Shape == ModuleShapes.Ellipse"\r\n    >\r\n      <ellipse\r\n        [attr.cx]="Abs(Module.Display.Width) / 2"\r\n        [attr.cy]="Abs(Module.Display.Height) / 2"\r\n        [attr.rx]="Abs(Module.Display.Width) / 2"\r\n        [attr.ry]="Abs(Module.Display.Height) / 2"\r\n        class="outer"\r\n      />\r\n      <ellipse\r\n        [attr.cx]="Abs(Module.Display.Width) / 2"\r\n        [attr.cy]="Abs(Module.Display.Height) / 2"\r\n        [attr.rx]="Abs(Module.Display.Width / 2 - 10)"\r\n        [attr.ry]="Abs(Module.Display.Height / 2 - 10)"\r\n        class="inner"\r\n      />\r\n\r\n      <text\r\n        text-anchor="middle"\r\n        [attr.x]="Abs(Module.Display.Width) / 2"\r\n        [attr.y]="Abs(Module.Display.Height) / 2"\r\n        dominant-baseline="central"\r\n      >\r\n        {{ Module.Text }}\r\n      </text>\r\n    </svg> --\x3e\r\n  </div>\r\n\r\n  <jtk-target port-type="target"></jtk-target>\r\n\r\n  <jtk-source port-type="source" filter=".outer"></jtk-source>\r\n</div>\r\n'}]}],O.ctorParameters=function(){return[{type:u.MatDialog}]};var L=function(){function t(t){this.jsPlumb=t,this.ioName=this.loadIOName(),c.jsPlumbToolkitIO.parsers[this.ioName]=this.parseOutput,c.jsPlumbToolkitIO.exporters[this.ioName]=this.exportOutput,this.CanvasClicked=new e.EventEmitter,this.EdgeAdded=new e.EventEmitter,this.EdgeDoubleClicked=new e.EventEmitter,this.EdgeLabelClicked=new e.EventEmitter,this.ModeChanged=new e.EventEmitter,this.NodeAdded=new e.EventEmitter,this.NodeFactoried=new e.EventEmitter,this.NodeTapped=new e.EventEmitter,this.PortClicked=new e.EventEmitter,this.Repainted=new e.EventEmitter,this.SourceClicked=new e.EventEmitter,this.TargetClicked=new e.EventEmitter}return t.prototype.ExportFromSurface=function(t){return f(this,void 0,void 0,(function(){return y(this,(function(e){return[2,t.getToolkit().exportData({type:this.ioName,parameters:{}})]}))}))},t.prototype.GetSurface=function(t){return f(this,void 0,void 0,(function(){var e=this;return y(this,(function(n){return[2,new Promise((function(n){e.jsPlumb.getSurface(t,(function(t){n(t)}))}))]}))}))},t.prototype.LoadOntoSurface=function(t,e,n,o){return void 0===o&&(o=null),f(this,void 0,void 0,(function(){return y(this,(function(a){switch(a.label){case 0:return o?p.isString(o)&&(o=this.loadDefaultLayoutSpec(o)):o=this.loadDefaultLayoutSpec(),n?[4,this.LoadOutput(t,e)]:[3,2];case 1:a.sent(),a.label=2;case 2:return t.repaintEverything(),t.setLayout(o),t.zoomToFit(),[2]}}))}))},t.prototype.LoadOutput=function(t,e){return f(this,void 0,void 0,(function(){var n=this;return y(this,(function(o){return[2,new Promise((function(o){t.getToolkit().load({type:n.ioName,data:e||{},parameters:{},onload:function(){o()}})}))]}))}))},t.prototype.LoadRenderParams=function(){var t=this;return{layout:{type:"Absolute"},events:{canvasClick:function(e){t.CanvasClicked.emit(e)},objectRepainted:function(){return t.Repainted.emit({})},edgeAdded:function(e){t.EdgeAdded.emit(e)},modeChanged:function(e){return t.ModeChanged.emit(e)},nodeAdded:function(e){t.NodeAdded.emit(e)}},lassoInvert:!1,elementsDroppable:!0,consumeRightClick:!1,dragOptions:{filter:".jtk-draw-handle, .node-action, .node-action i, .bank-module"},modelLeftAttribute:"Left",modelTopAttribute:"Top"}},t.prototype.LoadToolkitParams=function(){var t=this;return{nodeFactory:function(e,n,o){t.NodeFactoried.emit({Type:e,Data:n,Callback:o})}}},t.prototype.LoadView=function(){var t=this;return{nodes:{parent:this.loadParentNode()},edges:{default:{anchor:"AutoDefault",endpoint:"Blank",connector:["Flowchart",{cornerRadius:5}],paintStyle:{strokeWidth:2,stroke:"rgb(132, 172, 179)",outlineWidth:3,outlineStroke:"transparent"},hoverPaintStyle:{strokeWidth:2,stroke:"rgb(67,67,67)"},overlays:[["Arrow",{location:1,width:10,length:10}],["Arrow",{location:.3,width:10,length:10}]],events:{dblclick:function(e){t.EdgeDoubleClicked.emit(e)}}},connection:{parent:"default",overlays:[["Label",{label:"${label}",events:{click:function(e){t.EdgeLabelClicked.emit(e)}}}]]}},ports:{default:{paintStyle:{fill:"#f76258"},events:{click:function(e){t.PortClicked.emit(e)}}},source:{endpoint:"Blank",edgeType:"default",paintStyle:{fill:"#f76258"},anchor:"Right",maxConnections:-1,events:{click:function(e){t.SourceClicked.emit(e)}},isSource:!0,isTarget:!1},target:{maxConnections:-1,endpoint:"Blank",edgeType:"default",anchor:"Left",paintStyle:{fill:"#f76258"},isSource:!1,isTarget:!0,events:{click:function(e){t.TargetClicked.emit(e)}}}}}},t.prototype.loadDefaultLayoutSpec=function(t){return void 0===t&&(t="Hierarchical"),{type:t,parameters:{padding:[150,151],orientation:"vertical"}}},t.prototype.loadParentNode=function(){var t=this;return{events:{tap:function(e){return t.NodeTapped.emit(e)}}}},t}();L.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new L(e.ɵɵinject(h.jsPlumbService))},token:L,providedIn:"root"}),L.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],L.ctorParameters=function(){return[{type:r.jsPlumbService}]};var j=function(t){function e(e,n){var o=t.call(this,e)||this;return o.jsPlumb=e,o.snackBar=n,o}return g(e,t),e.prototype.LoadRenderParams=function(e){void 0===e&&(e="Spring");var n=t.prototype.LoadRenderParams.call(this);return n.layout.type=e||n.layout.type,n},e.prototype.LoadToolkitParamsWithOptions=function(e,n){var o=this,a=t.prototype.LoadToolkitParams.call(this);return a.beforeConnect=function(t,a,r){return o.beforeConnect(t,a,r,e,n)},a.beforeStartConnect=function(t,a){return o.beforeStartConnect(t,a,e,n)},a},e.prototype.LoadView=function(){var e=t.prototype.LoadView.call(this);return e.edges.default.connector=["Flowchart",{cornerRadius:5,anchor:"AutoDefault"}],e},e.prototype.SetViewNodes=function(t,e,n){void 0===n&&(n=O),t&&e&&(e.nodes={parent:this.loadParentNode()},t&&t.forEach((function(t){e.nodes[t.ModuleType]={parent:"parent",component:n}})))},e.prototype.beforeConnect=function(t,e,n,o,a){var r=a().getAllEdgesFor(e).filter((function(t){return t.target.id===e.id}));if(r.find((function(e){return e.source.id===t.id})))return this.openSnackBar("These two modules are already connected."),!1;var i=o.find((function(e){return e.ModuleType===t.data.type})),s=o.find((function(t){return t.ModuleType===e.data.type}));return s.IncomingConnectionLimit>=0&&r.length>=s.IncomingConnectionLimit?(this.openSnackBar("No more incoming connections allowed for "+e.data.type),!1):s.IncomingConnectionTypes&&s.IncomingConnectionTypes.length>0&&!s.IncomingConnectionTypes.find((function(e){return e===t.data.type}))?(this.openSnackBar("The "+t.data.type+" cannot connect to the "+e.data.type),!1):!(i.OutgoingConnectionTypes&&i.OutgoingConnectionTypes.length>0&&!i.OutgoingConnectionTypes.find((function(t){return t===e.data.type})))||(this.openSnackBar("The "+t.data.type+" cannot connect to the "+e.data.type),!1)},e.prototype.beforeStartConnect=function(t,e,n,o){var a=o(),r=n.find((function(e){return e.ModuleType===t.data.type})),i=a.getAllEdgesFor(t).filter((function(e){return e.source.id===t.id}));return r.OutgoingConnectionLimit>=0&&i.length>=r.OutgoingConnectionLimit?(this.openSnackBar("No more outgoing connections allowed for "+t.data.type),!1):{label:""}},e.prototype.exportOutput=function(t,e){var n=t.getNodes(),o=t.getAllEdges(),a={Modules:[],Streams:[]};return n.forEach((function(t){var e={ID:t.id,Text:t.data.Text,Display:t.data.Display,Deleted:t.data.Deleted,Settings:t.data.Settings,Status:t.data.Status};e.Display.Left=t.data.left,e.Display.Top=t.data.top,e.Display.Width=t.data.w,e.Display.Height=t.data.h,a.Modules.push(e)})),o.forEach((function(t){a.Streams.push({ID:t.data.id,InputModuleID:t.source.id,OutputModuleID:t.target.id,Title:t.data.label})})),a},e.prototype.loadIOName=function(){return"data-flow-output"},e.prototype.openSnackBar=function(t,e){void 0===e&&(e=null),this.snackBar.open(t,e,{duration:5e3})},e.prototype.parseOutput=function(t,e,n){t&&(e.clear(),t&&(t.Modules&&t.Modules.filter((function(t){return!t.Deleted})).forEach((function(t){var n=Object.assign(Object.assign({},t),{id:t.ID,type:t.Display.ModuleType,left:t.Display.Left,top:t.Display.Top,w:t.Display.Width,h:t.Display.Height});e.addNode(n)})),t.Streams&&t.Streams.forEach((function(t){e.addEdge({source:t.InputModuleID,target:t.OutputModuleID,data:{id:t.ID,label:t.Title,type:"connection"}})}))))},e}(L);j.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new j(e.ɵɵinject(h.jsPlumbService),e.ɵɵinject(d.MatSnackBar))},token:j,providedIn:"root"}),j.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],j.ctorParameters=function(){return[{type:r.jsPlumbService},{type:d.MatSnackBar}]};var V,N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e}(x),P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e}(a.LCUElementContext),J="lcu-data-flow-ide-element",H=function(t){function e(e,n,o,a,r){var i=t.call(this,o)||this;return i.$jsplumb=e,i.dataFlowEventService=n,i.injector=o,i.io=a,i.matDialog=r,i.SelectMode="pan",i.subscriptions={},i}return g(e,t),Object.defineProperty(e.prototype,"State",{get:function(){return this.context.State},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){return f(this,void 0,void 0,(function(){return y(this,(function(t){switch(t.label){case 0:return this.surface=this.SurfaceComponent?this.SurfaceComponent.surface:null,this.surface?(this.toolkit=this.surface.getToolkit(),this.drawing=new c.DrawingTools({renderer:this.surface}),this.io.SetViewNodes(this.State.ModuleOptions,this.View),[4,this.Relayout(!0)]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},e.prototype.ngOnDestroy=function(){for(var t in this.subscriptions)this.subscriptions[t]&&(this.subscriptions[t].unsubscribe(),delete this.subscriptions[t])},e.prototype.ngOnInit=function(){t.prototype.ngOnInit.call(this),this.setupJsPlumbSurface(),this.handleStateChanged()},e.prototype.CancelActive=function(){this.dataFlowEventService.EmitSetActiveDataFlowEvent(null)},e.prototype.Deploy=function(){this.dataFlowEventService.EmitDeployDataFlowEvent(this.State.ActiveDataFlow.Lookup)},e.prototype.Relayout=function(t){return void 0===t&&(t=!1),f(this,void 0,void 0,(function(){return y(this,(function(e){switch(e.label){case 0:return this.surface&&this.State.ActiveDataFlow?[4,this.io.LoadOntoSurface(this.surface,this.State.ActiveDataFlow.Output,t)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.Save=function(){return f(this,void 0,void 0,(function(){var t;return y(this,(function(e){switch(e.label){case 0:return t=this.State.ActiveDataFlow,[4,this.io.ExportFromSurface(this.surface)];case 1:return t.Output=e.sent(),this.dataFlowEventService.EmitSaveDataFlowEvent(this.State.ActiveDataFlow),[2]}}))}))},e.prototype.ToggleCreationModules=function(){this.dataFlowEventService.EmitToggleCreationModulesEvent()},e.prototype.ToggleSelectMode=function(){this.SelectMode="pan"===this.SelectMode?"select":"pan",this.surface.setMode(this.SelectMode)},e.prototype.ZoomToFit=function(){this.surface.zoomToFit()},e.prototype.edgeAdded=function(t){this.setIsSaved()},e.prototype.editLabel=function(t){},e.prototype.handleStateChanged=function(){return f(this,void 0,void 0,(function(){return y(this,(function(t){switch(t.label){case 0:return this.State.ActiveDataFlow&&(this.toolkit=this.$jsplumb.getToolkit(this.State.ActiveDataFlow.Lookup,this.ToolkitParams),this.io.SetViewNodes(this.State.ModuleOptions,this.View)),this.setOriginalState(),this.IsSaved=!0,[4,this.Relayout(!0)];case 1:return t.sent(),[2]}}))}))},e.prototype.nodeAdded=function(t){this.setIsSaved()},e.prototype.nodeFactory=function(t){var e=this,n=new u.MatDialogConfig;n.data=t,n.disableClose=!0,null!=this.dialogRef&&(this.dialogRef.close({}),this.dialogRef=null),this.dialogRef=this.matDialog.open(M,n),this.dialogRef.afterClosed().subscribe((function(n){var o=Object.assign(Object.assign({},t.Data),{Text:n.data});o.Text&&(o.Text.length>=2?(o.id=c.jsPlumbUtil.uuid(),t.Callback(o),e.setIsSaved()):alert(o.Display.ModuleType+" names must be at least 2 characters!"))})),this.setIsSaved()},e.prototype.removeEdge=function(t){this.toolkit.removeEdge(t),this.setIsSaved()},e.prototype.setIsSaved=function(){if(this.State&&this.State.ActiveDataFlow){var t=JSON.stringify(this.State.ActiveDataFlow.Output);this.IsSaved=t===this.originalState}else this.IsSaved=!1},e.prototype.setOriginalState=function(){this.State&&this.State.ActiveDataFlow?this.originalState=JSON.stringify(this.State.ActiveDataFlow.Output):this.originalState=null},e.prototype.setupJsPlumbSurface=function(){var t=this;this.RenderParams=this.io.LoadRenderParams(),this.ToolkitParams=this.io.LoadToolkitParamsWithOptions(this.State.ModuleOptions,(function(){return t.toolkit})),this.View=this.io.LoadView(),this.subscriptions.EdgeAdded||(this.subscriptions.EdgeAdded=this.io.EdgeAdded.subscribe((function(e){t.edgeAdded(e)}))),this.subscriptions.EdgeDoubleClicked||(this.subscriptions.EdgeDoubleClicked=this.io.EdgeDoubleClicked.subscribe((function(e){t.removeEdge(e.edge)}))),this.subscriptions.EdgeLabelClicked||(this.subscriptions.EdgeLabelClicked=this.io.EdgeLabelClicked.subscribe((function(e){t.editLabel(e.edge)}))),this.subscriptions.NodeAdded||(this.subscriptions.NodeAdded=this.io.NodeAdded.subscribe((function(e){t.nodeAdded(e.node)}))),this.subscriptions.NodeFactoried||(this.subscriptions.NodeFactoried=this.io.NodeFactoried.subscribe((function(e){t.nodeFactory(e)}))),this.subscriptions.NodeTapped||(this.subscriptions.NodeTapped=this.io.NodeTapped.subscribe((function(t){})))},e}(a.LcuElementComponent);H.decorators=[{type:e.Component,args:[{selector:J,template:'<div class="data-flow-ide-container">\r\n  <mat-drawer-container>\r\n    <mat-drawer-content>\r\n      <div class="home-actions">\r\n        <a mat-mini-fab color="accent" title="Data Flows Home" (click)="CancelActive()">\r\n          <mat-icon>home</mat-icon>\r\n        </a>\r\n      </div>\r\n\r\n      <div class="panel-actions" *ngIf="!State.ActiveDataFlow.PreventEditing">\r\n        <a mat-mini-fab color="primary" title="Toggle Modules" (click)="drawer.toggle()">\r\n          <mat-icon>menu</mat-icon>\r\n        </a>\r\n      </div>\r\n\r\n      <div class="flow-actions">\r\n        <a mat-mini-fab title="Select Mode" (click)="ToggleSelectMode()">\r\n          <mat-icon title="Switch to Select Mode" *ngIf="SelectMode != \'select\'">edit</mat-icon>\r\n\r\n          <mat-icon title="Switch to Pan Mode" *ngIf="SelectMode != \'pan\'">pan_tool</mat-icon>\r\n        </a>\r\n\r\n        <a mat-mini-fab title="Zoom to Fit" (click)="ZoomToFit()">\r\n          <mat-icon>zoom_out_map</mat-icon>\r\n        </a>\r\n      </div>\r\n\r\n      <jsplumb-surface\r\n        [surfaceId]="State.ActiveDataFlow.Lookup"\r\n        [toolkitId]="State.ActiveDataFlow.Lookup"\r\n        [view]="View"\r\n        [renderParams]="RenderParams"\r\n      ></jsplumb-surface>\r\n\r\n      <jsplumb-miniview [surfaceId]="State.ActiveDataFlow.Lookup"></jsplumb-miniview>\r\n\r\n      <jsplumb-controls [surfaceId]="State.ActiveDataFlow.Lookup"></jsplumb-controls>\r\n    </mat-drawer-content>\r\n\r\n    <mat-drawer mode="side" [opened]="!State.ActiveDataFlow.PreventEditing" position="end" #drawer>\r\n      <div class="data-flow-ide-bank-container">\r\n        <mat-toolbar>\r\n          <a mat-icon-button id="dataFlowIdeSaveBtn" title="Save" color="primary" (click)="Save()">\r\n            <mat-icon>save</mat-icon>\r\n          </a>\r\n\r\n          <button mat-icon-button id="dataFlowIdeDeployBtn" title="Deploy" color="primary" (click)="Deploy()" [disabled]="!IsSaved">\r\n            <mat-icon>cloud_upload</mat-icon>\r\n          </button>\r\n\r\n          <a mat-icon-button id="dataFlowIdeRelayoutBtn" title="Align" color="primary" (click)="Relayout()">\r\n            <mat-icon>loop</mat-icon>\r\n          </a>\r\n\r\n          \x3c!-- <a mat-icon-button title="Creation Modules" color="primary" (click)="ToggleCreationModules()">\r\n            <mat-icon *ngIf="State.AllowCreationModules">check_box</mat-icon>\r\n\r\n            <mat-icon *ngIf="!State.AllowCreationModules">check_box_outline_blank</mat-icon>\r\n          </a> --\x3e\r\n        </mat-toolbar>\r\n\r\n        <div class="bank">\r\n          <h3>Managing {{ State.ActiveDataFlow.Name }} Data Flow</h3>\r\n\r\n          <hr />\r\n\r\n          <lcu-data-flow-modules-bank-element\r\n            [displays]="State.ModuleDisplays"\r\n            [options]="State.ModuleOptions"\r\n            [data-flow-lookup]="State.ActiveDataFlow.Lookup"\r\n          ></lcu-data-flow-modules-bank-element>\r\n        </div>\r\n      </div>\r\n    </mat-drawer>\r\n  </mat-drawer-container>\r\n</div>\r\n',styles:[":host ::ng-deep .data-flow-ide-container{height:100%}:host ::ng-deep .data-flow-ide-container .mat-drawer-container{background-color:transparent;height:100%}:host ::ng-deep .data-flow-ide-container .mat-drawer-container .mat-drawer-content{overflow:hidden;position:relative}:host ::ng-deep .data-flow-ide-container .mat-drawer-container .mat-drawer-content .mat-mini-fab{margin:0 .5rem}:host ::ng-deep .data-flow-ide-container .mat-drawer-container .mat-drawer-content .home-actions{left:1rem;position:absolute;top:1rem;z-index:500}:host ::ng-deep .data-flow-ide-container .mat-drawer-container .mat-drawer-content .panel-actions{position:absolute;right:1rem;top:1rem;z-index:500}:host ::ng-deep .data-flow-ide-container .mat-drawer-container .mat-drawer-content .flow-actions{bottom:1rem;left:1rem;position:absolute;z-index:500}:host ::ng-deep .data-flow-ide-container .mat-drawer-container .mat-drawer-content jsplumb-miniview{bottom:1rem;position:absolute;right:1rem}:host ::ng-deep .data-flow-ide-container .mat-drawer-container .mat-drawer-content jsplumb-surface{display:block;height:100%}:host ::ng-deep .data-flow-ide-container .mat-drawer-container .mat-drawer-content jsplumb-surface>div{height:100%!important}:host ::ng-deep .data-flow-ide-container .mat-drawer-container .mat-drawer{background-color:#a4bab3;width:300px}:host ::ng-deep .data-flow-ide-container .mat-drawer-container .mat-drawer .data-flow-ide-bank-container{height:100%}:host ::ng-deep .data-flow-ide-container .mat-drawer-container .mat-drawer .data-flow-ide-bank-container .mat-toolbar{background-color:#fbfcf3}:host ::ng-deep .data-flow-ide-container .mat-drawer-container .mat-drawer .data-flow-ide-bank-container .bank{color:#000;margin:.5rem}:host ::ng-deep .drop-hover{background-color:#a4bab3!important}:host ::ng-deep .jtk-node svg{fill:#4a918e;left:0;position:absolute;stroke:none;top:0}:host ::ng-deep .flowchart-object{background:none;border:none;border-radius:0;box-shadow:none;font-size:12px;min-height:0;min-width:0;position:absolute;text-align:center;z-index:10}:host ::ng-deep .flowchart-object text{fill:#fff;font-family:Open Sans,sans-serif;font-size:14px;font-weight:400;stroke:none}:host ::ng-deep .flowchart-object .node-actions{height:auto;padding:.1em}:host ::ng-deep .flowchart-object .node-actions a{color:#fff;cursor:pointer;font-size:12px;line-height:15px;margin:0 .5em}:host ::ng-deep .flowchart-object .node-actions a:hover{color:#282d35}:host ::ng-deep .outer{background-color:#92aba3;border-radius:.5em;cursor:pointer;opacity:.6;overflow:hidden;padding:0;position:relative}:host ::ng-deep .outer .mat-card-header-text{margin:0 .5em}:host ::ng-deep .outer>:first-child{margin-top:.5em}:host ::ng-deep .outer>:last-child{margin-bottom:.5em}:host ::ng-deep .outer>*{margin:.5em}:host ::ng-deep .inner{background-color:#b2c4be;border-radius:.5em;cursor:move!important;opacity:.8}:host ::ng-deep .inner .mat-toolbar{background-color:#4a918e;opacity:.5}:host ::ng-deep .inner .module-details{height:calc(100% - 15px - 1em);margin:.5em;position:relative;text-align:left}:host ::ng-deep .inner .module-details .module-status-check{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host ::ng-deep .inner .module-details .module-status-chart{height:calc(100% - 13px);position:relative}:host ::ng-deep .inner .module-details .module-status-chart canvas{height:100%;width:100%}:host ::ng-deep .inner .module-details.hide-details{margin-top:2.5em;text-align:center}:host ::ng-deep .inner .module-details.hide-details .module-status-chart{display:none}:host ::ng-deep .inner .module-status-icon-lg{font-size:50px;height:50px;width:50px}:host ::ng-deep .inner .module-status-icon-sm{font-size:12px;height:12px;width:12px}:host ::ng-deep .inner.mat-card-header{height:24px}:host ::ng-deep .inner.mat-card-content{height:calc(100% - 24px - 1.5em)}:host ::ng-deep .flowchart-object:hover .outer{opacity:.8}:host ::ng-deep .flowchart-object:hover .inner{opacity:.9}:host ::ng-deep .flowchart-object:hover .inner .mat-toolbar{opacity:.8}:host ::ng-deep .connection-drop svg{fill:#ccc}:host ::ng-deep .connection-drop text{fill:#000}:host ::ng-deep .jtk-surface.jtk-drag-drop-hover{outline:6px solid #9cd8d7!important}:host ::ng-deep .jtk-surface{height:500px}:host ::ng-deep jsplumb-controls{color:#fff;left:231px;position:absolute;top:-3px;width:150px;z-index:501}:host ::ng-deep .jtk-surface.jtk-drag-drop-active{outline:6px dotted #67c7c5!important}:host ::ng-deep .jtk-surface.jtk-drag-drop-hover{outline:6px solid #f7a45d!important}:host ::ng-deep svg.jtk-drag-drop-active,:host ::ng-deep svg.jtk-drag-drop-hover{outline:none!important}:host ::ng-deep svg.jtk-drag-drop-active path{stroke:#67c7c5;stroke-dasharray:2 0 2 5;stroke-width:3px}:host ::ng-deep svg.jtk-drag-drop-hover path{stroke:#f7a45d;stroke-dasharray:0;stroke-width:4px}"]}]}],H.ctorParameters=function(){return[{type:r.jsPlumbService},{type:w},{type:e.Injector},{type:j},{type:u.MatDialog}]},H.propDecorators={SurfaceComponent:[{type:e.ViewChild,args:[r.jsPlumbSurfaceComponent]}]},(V=t.DataFlowModulesBankViewTypes||(t.DataFlowModulesBankViewTypes={}))[V.Grid=0]="Grid",V[V.List=1]="List";var G=function(){},W=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e}(a.LCUElementContext),B="lcu-data-flow-modules-bank-element",_=function(e){function n(n){var o=e.call(this,n)||this;return o.injector=n,o.ViewTypes=t.DataFlowModulesBankViewTypes,o.View=t.DataFlowModulesBankViewTypes.List,o}return g(n,e),Object.defineProperty(n.prototype,"Categories",{get:function(){var t=this;return this.Options.map((function(e){return t.GetDisplay(e.ModuleType).Category})).filter((function(t,e,n){return n.indexOf(t)===e}))},enumerable:!1,configurable:!0}),n.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this)},n.prototype.DataGenerator=function(t){var e=t.getAttribute("module-type"),n=JSON.parse(t.getAttribute("module-display")),o=JSON.parse(t.getAttribute("module-settings"));return{name:e,type:e,w:n.Width,h:n.Height,Display:n,Settings:o}},n.prototype.GetDisplay=function(t){return this.Displays.find((function(e){return e.ModuleType===t}))},n.prototype.GetObjString=function(t){return JSON.stringify(t)},n.prototype.GetOptions=function(t){var e=this;return this.Options.filter((function(n){return e.GetDisplay(n.ModuleType).Category===t}))},n}(a.LcuElementComponent);_.decorators=[{type:e.Component,args:[{selector:B,template:'<ng-container [ngSwitch]="View" *ngIf="Options">\r\n  \x3c!-- <div\r\n      fxLayout="row"\r\n      fxLayoutAlign="center stretch"\r\n      gdAlignColumns="center stretch"\r\n      gdAlignRows="center stretch"\r\n      *ngSwitchCase="ViewTypes.Grid"\r\n    >\r\n      <ng-container *ngFor="let option of Options">\r\n        <div></div>\r\n      </ng-container>\r\n    </div> --\x3e\r\n\r\n  <div\r\n    *ngSwitchCase="ViewTypes.List"\r\n    jsplumb-surface-drop\r\n    selector="a"\r\n    [surfaceId]="DataFlowLookup"\r\n    [dataGenerator]="DataGenerator"\r\n  >\r\n    <ng-container *ngFor="let category of Categories">\r\n      <div class="category">\r\n        <h4 class="mat-subheading-2">\r\n          {{ category }}\r\n        </h4>\r\n\r\n        <ng-container *ngFor="let option of GetOptions(category)">\r\n          <ng-container *ngIf="GetDisplay(option.ModuleType); let display">\r\n            <div class="option" id="{{ option.ModuleType }}ModuleOption">\r\n              <a\r\n                fxFlex\r\n                fxLayoutAlign="start center"\r\n                mat-raised-button\r\n                color="accent"\r\n                class="bank-module flow-option"\r\n                [attr.module-display]="GetObjString(display)"\r\n                [attr.module-settings]="GetObjString(option.Settings)"\r\n                [attr.module-type]="option.ModuleType"\r\n                title="Drag to add new"\r\n              >\r\n                <mat-icon>{{ display.Icon?.Icon }}</mat-icon>\r\n\r\n                {{ option.Name }}\r\n              </a>\r\n            </div>\r\n          </ng-container>\r\n        </ng-container>\r\n\r\n        <hr />\r\n      </div>\r\n    </ng-container>\r\n  </div>\r\n</ng-container>\r\n',styles:[":host .bank-module{margin:.5rem 0}:host .mat-subheading-2{margin:0}:host .mat-button-base{white-space:normal}.flow-option{cursor:move;z-index:1000}"]}]}],_.ctorParameters=function(){return[{type:e.Injector}]},_.propDecorators={DataFlowLookup:[{type:e.Input,args:["data-flow-lookup"]}],Displays:[{type:e.Input,args:["displays"]}],Options:[{type:e.Input,args:["options"]}],View:[{type:e.Input,args:["view"]}]};var q=function(){},z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e}(a.LCUElementContext),Q="lcu-data-flow-data-flow-analytics-element",U=function(t){function e(e){var n=t.call(this,e)||this;return n.injector=e,n}return g(e,t),e.prototype.ngOnInit=function(){t.prototype.ngOnInit.call(this)},e}(a.LcuElementComponent);U.decorators=[{type:e.Component,args:[{selector:Q,template:"<h2>LcuDataFlow DataFlowAnalytics Next Steps</h2>\r\n\r\n<p>Do stuff and things with Analytics!</p>\r\n",styles:[""]}]}],U.ctorParameters=function(){return[{type:e.Injector}]};var K=function(){},$=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e}(a.LCUElementContext),Z="lcu-data-flow-data-flow-map-element",X=function(t){function e(e){var n=t.call(this,e)||this;return n.injector=e,n}return g(e,t),e.prototype.ngOnInit=function(){t.prototype.ngOnInit.call(this)},e}(a.LcuElementComponent);X.decorators=[{type:e.Component,args:[{selector:Z,template:'\x3c!-- <div class="data-flow-map-container">\r\n  <jsplumb-toolkit id="jsPlumbSurface" class="jtk-demo-canvas jtk-surface jtk-droppable" #toolkit surfaceId="flowchartSurface" jtkId="flowchart" [view]="FlowLayout.View" [renderParams]="FlowLayout.RenderParams" [toolkitParams]="FlowLayout.ToolkitParams" [nodeResolver]="NodeResolver"></jsplumb-toolkit>\r\n</div> --\x3e\r\n',styles:[":host ::ng-deep .data-flow-map-container{height:100%}"]}]}],X.ctorParameters=function(){return[{type:e.Injector}]};var Y=function(){},tt=function(){},et=function(){},nt=function(){},ot=function(){},at=function(){},rt=function(){},it=function(){},st=function(t){function n(n){var o=t.call(this,n)||this;return o.jsPlumb=n,o.EdgeTapped=new e.EventEmitter,o}return g(n,t),n.prototype.LoadRenderParams=function(e){void 0===e&&(e="Spring");var n=t.prototype.LoadRenderParams.call(this);return n.layout={type:"Absolute",parameters:{padding:[150],orientation:"vertical"}},n},n.prototype.LoadToolkitParams=function(){var e=this,n=t.prototype.LoadToolkitParams.call(this);return n.beforeStartConnect=function(t,n){return e.beforeStartConnect(t,n)},n},n.prototype.LoadView=function(){var e=this,n=t.prototype.LoadView.call(this);return delete n.edges.default.endpoint,delete n.edges.default.anchor,delete n.edges.default.hoverPaintStyle,delete n.edges.default.overlays,n.edges.default.endpoints=["Blank",["Image",{src:"/img/gear.png"}]],n.edges.default.anchors=["Right","Left"],n.ports.target.endpoint=["Image",{src:"/img/gear.png"}],n.edges.default.overlays=[["Label",{cssClass:"delete-relationship",label:"<i class='fa fa-times'></i>",events:{tap:function(t){e.EdgeTapped.emit(t.edge)}},location:.1}]],n.edges.default.paintStyle.strokeWidth=1,n.edges.default.paintStyle.outlineWidth=1,n},n.prototype.beforeStartConnect=function(t,e){return{label:""}},n.prototype.exportOutput=function(t,e){var n=t.getNodes(),o=t.getAllEdges(),a=new Y;return a.SchemaMaps=new Array,a.SchemaNodes=new Array,a.SchemaFunctions=new Array,a.SchemaFunctionReturns=new Array,a.HasErrors=!1,n.forEach((function(e){var n={ID:e.id,Data:{},JSONSchemaID:e.data.Schema.id,IncommingModuleID:"",OutgoingModuleIDs:[],JoinRelationships:[],Groups:[],Timestamp:"",TumblingWindow:!1,TumblingInterval:"",TumblingIntervalValue:null,DisableSchemaEdit:!1};if("incomming"===e.data.SchemaType&&e.data.IncommingModuleID?n.IncommingModuleID=e.data.IncommingModuleID:"outgoing"===e.data.SchemaType&&e.data.OutgoingModuleIDs&&(n.OutgoingModuleIDs=e.data.OutgoingModuleIDs),e.data.DisableSchemaEdit&&(n.DisableSchemaEdit=e.data.DisableSchemaEdit),Object.keys(e.data).forEach((function(t){"Schema"!==t&&"IncommingModules"!==t&&"OutgoingModules"!==t&&"IncommingModuleID"!==t&&"OutgoingModuleID"!==t&&"OutgoingModuleIDs"!==t&&"Functions"!==t&&"SchemaFunctionsReturnSource"!==t&&"SchemaFunctionsReturnSourceID"!==t&&"SchemaFunctionsReturnValue"!==t&&"SchemaFunctionsReturnValueType"!==t&&"JoinRelationships"!==t&&"DisableSchemaEdit"!==t&&"ShowJoinLink"!==t&&"Groups"!==t&&"TumblingWindow"!==t&&"TumblingInterval"!==t&&"TumblingIntervalValue"!==t&&"Timestamp"!==t&&"MappingFunctions"!==t&&"JoinFunctionNeeded"!==t&&(n.Data[t]=e.data[t])})),e.data.Functions&&e.data.Functions.length>0){if(e.data.SchemaFunctionsReturnSourceID){var r=new et;r.PropertyID=e.id,r.NodeID=e.data.id,r.SchemaFunctionsReturnSource=e.data.SchemaFunctionsReturnSource,r.SchemaFunctionsReturnSourceID=e.data.SchemaFunctionsReturnSourceID,r.SchemaFunctionsReturnValue=e.data.SchemaFunctionsReturnValue,r.SchemaFunctionsReturnValueType=e.data.SchemaFunctionsReturnValueType,r.Type="filter",r.ExternalSchemaID="",a.SchemaFunctionReturns.push(r)}e.data.Functions.forEach((function(t){t.ExtraData&&t.ExtraData.HasErrors&&(a.HasErrors=!0);var n={ID:t.ID,Properties:[],Name:t.Name,Order:t.Order,FunctionID:t.Function.ID,ExtraData:t.ExtraData,ResultNodeID:e.data.id,ResultPropertyID:"",ReturnValueType:t.ReturnValueType,ReturnTrueSourceID:t.ReturnTrueSourceID,ReturnTrueSource:t.ReturnTrueSource,ReturnTrueValue:t.ReturnTrueValue,ReturnFalseSourceID:t.ReturnFalseSourceID,ReturnFalseSource:t.ReturnFalseSource,ReturnFalseValue:t.ReturnFalseValue,Type:"filter"};t.Properties.forEach((function(t){n.Properties.push({id:t.Property?t.Property.id:null,StaticValue:t.StaticValue,StaticValueType:t.StaticValueType,SchemaID:t.SchemaID,Order:t.Order,Source:t.Source,NodeID:t.NodeID})})),a.SchemaFunctions.push(n)}))}e.data.JoinRelationships&&Object.keys(e.data.JoinRelationships).length>0&&(n.JoinRelationships=[],Object.keys(e.data.JoinRelationships).forEach((function(t){var o=e.data.JoinRelationships[t],r={Key:t,Object:{Relationship:o.Relationship,Order:o.Order}};if(n.JoinRelationships.push(r),o.SchemaFunctionsReturnSourceID){var i=new et;i.PropertyID=e.id,i.NodeID=e.data.id,i.SchemaFunctionsReturnSource=o.SchemaFunctionsReturnSource,i.SchemaFunctionsReturnSourceID=o.SchemaFunctionsReturnSourceID,i.SchemaFunctionsReturnValue=o.SchemaFunctionsReturnValue,i.SchemaFunctionsReturnValueType=o.SchemaFunctionsReturnValueType,i.Type="join",i.ExternalSchemaID=t,a.SchemaFunctionReturns.push(i)}o.Functions&&o.Functions.forEach((function(n){n.ExtraData&&n.ExtraData.HasErrors&&(a.HasErrors=!0);var o={ID:n.ID,Properties:[],Name:n.Name,Order:n.Order,FunctionID:n.Function.ID,ExtraData:n.ExtraData,ResultNodeID:e.data.id,ResultPropertyID:t,ReturnValueType:n.ReturnValueType,ReturnTrueSourceID:n.ReturnTrueSourceID,ReturnTrueSource:n.ReturnTrueSource,ReturnTrueValue:n.ReturnTrueValue,ReturnFalseSourceID:n.ReturnFalseSourceID,ReturnFalseSource:n.ReturnFalseSource,ReturnFalseValue:n.ReturnFalseValue,Type:"join"};n.Properties.forEach((function(t){o.Properties.push({id:t.Property?t.Property.id:null,StaticValue:t.StaticValue,StaticValueType:t.StaticValueType,SchemaID:t.SchemaID,NodeID:t.NodeID,Order:t.Order,Source:t.Source})})),a.SchemaFunctions.push(o)}))}))),e.data.JoinFunctionNeeded&&(a.HasErrors=!0),e.data.Timestamp&&(n.Timestamp=e.data.Timestamp),e.data.Groups&&(n.Groups=e.data.Groups),e.data.TumblingWindow&&(n.TumblingWindow=e.data.TumblingWindow,n.TumblingInterval=e.data.TumblingInterval,n.TumblingIntervalValue=e.data.TumblingIntervalValue);e.getPorts().filter((function(e){return t.getAllEdgesFor(e).filter((function(t){return t.target.id===e.id})).length>0}));0===o.length&&"outgoing"===e.data.SchemaType&&(a.HasErrors=!0),"outgoing"!==e.data.SchemaType||e.data.OutgoingModuleIDs&&0!==e.data.OutgoingModuleIDs.length||(a.HasErrors=!0),"incomming"!==e.data.SchemaType||e.data.IncommingModuleID||(a.HasErrors=!0),a.SchemaNodes.push(n),e.getPorts().forEach((function(t){if(t.data.MappingFunctionNeeded&&(a.HasErrors=!0),t.data.Functions&&t.data.Functions.length>0){if(t.data.SchemaFunctionsReturnSourceID){var n=new et;n.PropertyID=t.id,n.NodeID=e.data.id,n.SchemaFunctionsReturnSource=t.data.SchemaFunctionsReturnSource,n.SchemaFunctionsReturnSourceID=t.data.SchemaFunctionsReturnSourceID,n.SchemaFunctionsReturnValue=t.data.SchemaFunctionsReturnValue,n.SchemaFunctionsReturnValueType=t.data.SchemaFunctionsReturnValueType,n.Type="mapping",n.ExternalSchemaID="",a.SchemaFunctionReturns.push(n)}t.data.Functions.forEach((function(n){n.ExtraData&&n.ExtraData.HasErrors&&(a.HasErrors=!0);var o={ID:n.ID,Properties:[],Name:n.Name,Order:n.Order,FunctionID:n.Function.ID,ExtraData:n.ExtraData,ResultNodeID:e.data.id,ResultPropertyID:t.id,ReturnValueType:n.ReturnValueType,ReturnTrueSourceID:n.ReturnTrueSourceID,ReturnTrueSource:n.ReturnTrueSource,ReturnTrueValue:n.ReturnTrueValue,ReturnFalseSourceID:n.ReturnFalseSourceID,ReturnFalseSource:n.ReturnFalseSource,ReturnFalseValue:n.ReturnFalseValue,Type:"mapping"};n.Properties.forEach((function(t){o.Properties.push({id:t.Property?t.Property.id:null,StaticValue:t.StaticValue,StaticValueType:t.StaticValueType,SchemaID:t.SchemaID,NodeID:t.NodeID,Order:t.Order,Source:t.Source})})),a.SchemaFunctions.push(o)}))}}))})),o.forEach((function(t){var e=t.data,n={ID:t.data.id,IncommingSchemaID:t.source.id,OutgoingSchemaID:t.target.id,Data:e,IncommingPropertyID:t.source.id,OutgoingPropertyID:t.target.id};a.SchemaMaps.push(n)})),a},n.prototype.loadIOName=function(){return"data-flow-map-output"},n.prototype.recurseJSONSchemaToAddPorts=function(t,e){var n=this;if(t.properties){var o=Object.keys(t.properties),a="default";a="incomming"===e.data.SchemaType?"source":"target",o.forEach((function(o){e.addPort({id:t.properties[o].$id,DataType:t.properties[o].type,Text:t.properties[o].title,type:a,MappingFunctionError:!1}),"object"===t.properties[o].type&&n.recurseJSONSchemaToAddPorts(t.properties[o].oneOf[0],e)}))}},n.prototype.recurseJSONSchemaToFindProperty=function(t,e){var n=this;if(t.properties){var o=Object.keys(t.properties),a=null;return o.forEach((function(o){t.properties[o].$id===e?a=t.properties[o]:a||"object"!==t.properties[o].type||(a=n.recurseJSONSchemaToFindProperty(t.properties[o].oneOf[0],e))})),a}},n.prototype.parseOutput=function(t,e,n){var o=this;t.SchemaNodes&&t.SchemaNodes.forEach((function(t){var a=t.Data,r=n.Schemas.filter((function(e){return e.$id===t.JSONSchemaID}));r&&r.length>0&&(a.Schema=JSON.parse(JSON.stringify(r[0]))),a.FilterFunctionError=!1,t.IncommingModuleID&&(a.IncommingModuleID=t.IncommingModuleID),t.OutgoingModuleIDs&&(a.OutgoingModuleIDs=t.OutgoingModuleIDs),t.DisableSchemaEdit&&(a.DisableSchemaEdit=t.DisableSchemaEdit),t.DisableSchemaEdit&&(a.Schema.sourceTitle=t.Data.Name),t.Groups&&(a.Groups=t.Groups),t.Timestamp&&(a.Timestamp=t.Timestamp),t.TumblingWindow&&(a.TumblingWindow=t.TumblingWindow,a.TumblingInterval=t.TumblingInterval,a.TumblingIntervalValue=t.TumblingIntervalValue),t.JoinRelationships&&t.JoinRelationships.length>0&&(a.JoinRelationships={},t.JoinRelationships.forEach((function(t){a.JoinRelationships[t.Key]={},a.JoinRelationships[t.Key].Relationship=t.Object.Relationship,a.JoinRelationships[t.Key].Order=t.Object.Order,a.JoinRelationships[t.Key].JoinFunctionError=!1})));var i=e.addNode(a);o.recurseJSONSchemaToAddPorts(a.Schema,i),setTimeout((function(){e.updateNode(i.id)}),50)})),setTimeout((function(){t.SchemaMaps&&t.SchemaMaps.forEach((function(t){e.addEdge({source:t.IncommingSchemaID+"."+t.IncommingPropertyID,target:t.OutgoingSchemaID+"."+t.OutgoingPropertyID,data:t.Data,directed:!1})})),t.SchemaFunctions&&t.SchemaFunctions.forEach((function(r){var i,s=e.getNode(r.ResultNodeID);r.Type||(r.Type="mapping"),"mapping"===r.Type?(i=s.getPort(r.ResultPropertyID)).data.Functions||(i.data.Functions=new Array):"filter"===r.Type?s.data.Functions||(s.data.Functions=new Array):"join"===r.Type&&(s.data.JoinRelationships[r.ResultPropertyID].Functions||(s.data.JoinRelationships[r.ResultPropertyID].Functions=new Array));var l=new rt;l.ID=r.ID,l.Name=r.Name,l.Order=r.Order,l.ExtraData=r.ExtraData,l.ReturnValueType=r.ReturnValueType,l.ReturnTrueSource=r.ReturnTrueSource,l.ReturnTrueSourceID=r.ReturnTrueSourceID,l.ReturnTrueValue=r.ReturnTrueValue,l.ReturnFalseSource=r.ReturnFalseSource,l.ReturnFalseSourceID=r.ReturnFalseSourceID,l.ReturnFalseValue=r.ReturnFalseValue,l.Properties=new Array,r.Properties.forEach((function(r){if("function"===r.Source){var i=t.SchemaFunctions.filter((function(t){return t.ID===r.id}))[0],s=n.AvailableSchemaFunctions.filter((function(t){return t.ID===i.FunctionID}))[0],u=new at;u.Source=r.Source,u.Property=new a.JSONSchema,u.Property.$id=i.ID,u.Property.title="Result of "+i.Name,u.Property.type=s.ReturnType,u.Order=r.Order,u.StaticValue=r.StaticValue,u.StaticValueType=r.StaticValueType,l.Properties.push(u)}else if("static"===r.Source){var c=new at;c.Source=r.Source,c.Order=r.Order,c.StaticValue=r.StaticValue,c.StaticValueType=r.StaticValueType,c.Property=new a.JSONSchema,c.Property.$id=r.id,l.Properties.push(c)}else{var d=null;r.id&&(d=o.recurseJSONSchemaToFindProperty(e.getNode(r.NodeID).data.Schema,r.id)),l.Properties.push({Source:r.Source,Property:d,SchemaID:r.SchemaID,NodeID:r.NodeID,Order:r.Order,StaticValue:r.StaticValue,StaticValueType:r.StaticValueType})}})),l.Function=n.AvailableSchemaFunctions.filter((function(t){return t.ID===r.FunctionID}))[0],"mapping"===r.Type?(i.data.Functions.push(l),r.ExtraData.HasErrors&&(i.data.MappingFunctionError=!0)):"filter"===r.Type?(s.data.Functions.push(l),r.ExtraData.HasErrors&&(s.data.FilterFunctionError=!0)):"join"===r.Type&&(s.data.JoinRelationships[r.ResultPropertyID].Functions.push(l),r.ExtraData.HasErrors&&(s.data.JoinRelationships[r.ResultPropertyID].JoinFunctionError=!0))})),t.SchemaFunctionReturns&&t.SchemaFunctionReturns.forEach((function(t){var n,o=e.getNode(t.NodeID);t.Type||(t.Type="mapping"),"mapping"===t.Type?((n=o.getPort(t.PropertyID)).data.SchemaFunctionsReturnSourceID||(n.data.SchemaFunctionsReturnSource=null,n.data.SchemaFunctionsReturnSourceID=null,n.data.SchemaFunctionsReturnValue=null,n.data.SchemaFunctionsReturnValueType=null),n.data.SchemaFunctionsReturnSource=t.SchemaFunctionsReturnSource,n.data.SchemaFunctionsReturnSourceID=t.SchemaFunctionsReturnSourceID,n.data.SchemaFunctionsReturnValue=t.SchemaFunctionsReturnValue,n.data.SchemaFunctionsReturnValueType=t.SchemaFunctionsReturnValueType):"filter"===t.Type?(o.data.SchemaFunctionsReturnSourceID||(o.data.SchemaFunctionsReturnSource=null,o.data.SchemaFunctionsReturnSourceID=null,o.data.SchemaFunctionsReturnValue=null,o.data.SchemaFunctionsReturnValueType=null),o.data.SchemaFunctionsReturnSource=t.SchemaFunctionsReturnSource,o.data.SchemaFunctionsReturnSourceID=t.SchemaFunctionsReturnSourceID,o.data.SchemaFunctionsReturnValue=t.SchemaFunctionsReturnValue,o.data.SchemaFunctionsReturnValueType=t.SchemaFunctionsReturnValueType):"join"===t.Type&&(o.data.JoinRelationships[t.ExternalSchemaID].SchemaFunctionsReturnSourceID||(o.data.JoinRelationships[t.ExternalSchemaID].SchemaFunctionsReturnSource=null,o.data.JoinRelationships[t.ExternalSchemaID].SchemaFunctionsReturnSourceID=null,o.data.JoinRelationships[t.ExternalSchemaID].SchemaFunctionsReturnValue=null,o.data.JoinRelationships[t.ExternalSchemaID].SchemaFunctionsReturnValueType=null),o.data.JoinRelationships[t.ExternalSchemaID].SchemaFunctionsReturnSource=t.SchemaFunctionsReturnSource,o.data.JoinRelationships[t.ExternalSchemaID].SchemaFunctionsReturnSourceID=t.SchemaFunctionsReturnSourceID,o.data.JoinRelationships[t.ExternalSchemaID].SchemaFunctionsReturnValue=t.SchemaFunctionsReturnValue,o.data.JoinRelationships[t.ExternalSchemaID].SchemaFunctionsReturnValueType=t.SchemaFunctionsReturnValueType,o.data.JoinRelationships[t.ExternalSchemaID].ExternalSchemaID=t.ExternalSchemaID)})),t.SchemaNodes&&e.getNodes().filter((function(t){return"outgoing"===t.data.SchemaType})).forEach((function(t){t.data.JoinFunctionNeeded=!1,t.data.ShowJoinLink=!1,t.getPorts().forEach((function(o){var a=e.getAllEdgesFor(o);if("outgoing"===t.data.SchemaType&&a.forEach((function(e){var o=n.IsJoinFunctionNeeded(e);o&&!n.IsJoinPresent(t)&&(t.data.JoinFunctionNeeded=!0),o&&(t.data.ShowJoinLink=!0)})),a&&a.length>0){var r=a[0];n.IsMappingFunctionNeeded(r)&&!r.target.data.SchemaFunctionsReturnSource&&(r.target.data.MappingFunctionNeeded=!0)}})),n.IsGroupNeeded(t,null,null)}))}),500)},n}(L);st.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new st(e.ɵɵinject(h.jsPlumbService))},token:st,providedIn:"root"}),st.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],st.ctorParameters=function(){return[{type:r.jsPlumbService}]};var lt=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[j,st]}},t}();lt.decorators=[{type:e.NgModule,args:[{declarations:[F,E,H,_,U,X,O,M,A],entryComponents:[F,E,H,_,U,X,O,M,A],exports:[F,E,H,_,U,X,O,M,A],imports:[a.FathymSharedModule,a.MaterialModule,n.FlexLayoutModule,o.ReactiveFormsModule,o.FormsModule,r.jsPlumbToolkitModule,i.jsPlumbToolkitDragDropModule,s.ChartsModule,l.LazyElementModule,a.PipeModule],schemas:[e.CUSTOM_ELEMENTS_SCHEMA]}]}],lt.ctorParameters=function(){return[]};var ut=function(){},ct=function(){};t.ConnectionStringModel=k,t.DataFlowJSPlumbToolkitIOService=j,t.DataFlowMapJSPlumbToolkitIOService=st,t.DataFlowModuleSchemaConfig=Y,t.DataFlowNodeFactoryParams=ct,t.DataFlowSchemaMap=tt,t.LCUChart=ut,t.LcuDataFlowDataFlowAnalyticsContext=z,t.LcuDataFlowDataFlowAnalyticsElementComponent=U,t.LcuDataFlowDataFlowAnalyticsElementState=q,t.LcuDataFlowDataFlowIdeContext=P,t.LcuDataFlowDataFlowIdeElementComponent=H,t.LcuDataFlowDataFlowIdeElementState=N,t.LcuDataFlowDataFlowListContext=T,t.LcuDataFlowDataFlowListElementComponent=E,t.LcuDataFlowDataFlowListElementState=I,t.LcuDataFlowDataFlowManagerContext=v,t.LcuDataFlowDataFlowManagerElementComponent=F,t.LcuDataFlowDataFlowManagerElementState=D,t.LcuDataFlowDataFlowMapContext=$,t.LcuDataFlowDataFlowMapElementComponent=X,t.LcuDataFlowDataFlowMapElementState=K,t.LcuDataFlowDataFlowModulesBankContext=W,t.LcuDataFlowDataFlowModulesBankElementComponent=_,t.LcuDataFlowDataFlowModulesBankElementState=G,t.LcuDataFlowModule=lt,t.SchemaFunction=rt,t.SchemaFunctionDefinition=ot,t.SchemaFunctionProperty=at,t.SchemaFunctionRef=it,t.SchemaFunctionReturn=et,t.SchemaNode=nt,t.SelectorLcuDataFlowDataFlowAnalyticsElement=Q,t.SelectorLcuDataFlowDataFlowIdeElement=J,t.SelectorLcuDataFlowDataFlowListElement=C,t.SelectorLcuDataFlowDataFlowManagerElement=b,t.SelectorLcuDataFlowDataFlowMapElement=Z,t.SelectorLcuDataFlowDataFlowModulesBankElement=B,t.ɵa=S,t.ɵb=w,t.ɵc=L,t.ɵd=O,t.ɵe=M,t.ɵf=R,t.ɵg=A,t.ɵh=x,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=napkin-ide-lcu-data-flow-common.umd.min.js.map