webpackJsonp([1,5],{

/***/ 148:
/***/ (function(module, exports) {

function webpackEmptyContext(req) {
	throw new Error("Cannot find module '" + req + "'.");
}
webpackEmptyContext.keys = function() { return []; };
webpackEmptyContext.resolve = webpackEmptyContext;
module.exports = webpackEmptyContext;
webpackEmptyContext.id = 148;


/***/ }),

/***/ 149:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_platform_browser_dynamic__ = __webpack_require__(166);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__app_app_module__ = __webpack_require__(168);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__environments_environment__ = __webpack_require__(191);




if (__WEBPACK_IMPORTED_MODULE_3__environments_environment__["a" /* environment */].production) {
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["a" /* enableProdMode */])();
}
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_platform_browser_dynamic__["a" /* platformBrowserDynamic */])().bootstrapModule(__WEBPACK_IMPORTED_MODULE_2__app_app_module__["a" /* AppModule */]);
//# sourceMappingURL=main.js.map

/***/ }),

/***/ 167:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppComponent; });
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};

var AppComponent = (function () {
    function AppComponent() {
        this.title = 'app works!';
    }
    return AppComponent;
}());
AppComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'app-root',
        template: __webpack_require__(280),
        styles: [__webpack_require__(249)]
    })
], AppComponent);

//# sourceMappingURL=app.component.js.map

/***/ }),

/***/ 168:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser__ = __webpack_require__(36);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_forms__ = __webpack_require__(67);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_http__ = __webpack_require__(165);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__angular_router__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__angular_common__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__dashboards_dashboards_module__ = __webpack_require__(174);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__values_values_module__ = __webpack_require__(51);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__app_component__ = __webpack_require__(167);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__connect_connect_component__ = __webpack_require__(169);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__dashboards_dashboard_dashboard_component__ = __webpack_require__(94);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__connected_service__ = __webpack_require__(93);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__dashboards_dashboards_service__ = __webpack_require__(37);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__template_service__ = __webpack_require__(20);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppModule; });
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
















var ROUTES = [
    {
        path: '',
        redirectTo: '/connect',
        pathMatch: 'full'
    },
    { path: 'connect', component: __WEBPACK_IMPORTED_MODULE_9__connect_connect_component__["a" /* ConnectComponent */] },
    { path: 'dashboard/:name', component: __WEBPACK_IMPORTED_MODULE_10__dashboards_dashboard_dashboard_component__["a" /* DashboardComponent */] },
];
var AppModule = (function () {
    function AppModule(connectedService) {
        this.connectedService = connectedService;
    }
    return AppModule;
}());
AppModule = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__angular_core__["b" /* NgModule */])({
        declarations: [
            __WEBPACK_IMPORTED_MODULE_8__app_component__["a" /* AppComponent */],
            __WEBPACK_IMPORTED_MODULE_9__connect_connect_component__["a" /* ConnectComponent */],
        ],
        imports: [
            __WEBPACK_IMPORTED_MODULE_5__angular_common__["a" /* CommonModule */],
            __WEBPACK_IMPORTED_MODULE_6__dashboards_dashboards_module__["a" /* DashboardsModule */],
            __WEBPACK_IMPORTED_MODULE_7__values_values_module__["a" /* ValuesModule */],
            __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser__["a" /* BrowserModule */],
            __WEBPACK_IMPORTED_MODULE_2__angular_forms__["a" /* FormsModule */],
            __WEBPACK_IMPORTED_MODULE_2__angular_forms__["b" /* ReactiveFormsModule */],
            __WEBPACK_IMPORTED_MODULE_3__angular_http__["a" /* HttpModule */],
            __WEBPACK_IMPORTED_MODULE_4__angular_router__["a" /* RouterModule */].forRoot(ROUTES)
        ],
        providers: [__WEBPACK_IMPORTED_MODULE_11__kervi_service__["a" /* KerviService */], __WEBPACK_IMPORTED_MODULE_13__dashboards_dashboards_service__["a" /* DashboardsService */], __WEBPACK_IMPORTED_MODULE_12__connected_service__["a" /* ConnectedService */], __WEBPACK_IMPORTED_MODULE_14__template_service__["a" /* TemplateService */]],
        bootstrap: [__WEBPACK_IMPORTED_MODULE_8__app_component__["a" /* AppComponent */]]
    }),
    __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_12__connected_service__["a" /* ConnectedService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_12__connected_service__["a" /* ConnectedService */]) === "function" && _a || Object])
], AppModule);

var _a;
//# sourceMappingURL=app.module.js.map

/***/ }),

/***/ 169:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_router__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__connected_service__ = __webpack_require__(93);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__angular_forms__ = __webpack_require__(67);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ConnectComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};





var ConnectComponent = (function () {
    function ConnectComponent(fb, kerviService, connectedService, router, route) {
        this.kerviService = kerviService;
        this.connectedService = connectedService;
        this.router = router;
        this.route = route;
        this.isConnected = false;
        this.currentPage = null;
        this.invalidUser = false;
        this.ts = new Date();
        this.isAuthenticated = false;
        this.doAuthenticate = false;
        this.inAuthentication = false;
        var self = this;
        this.loginForm = fb.group({
            'userName': ['', __WEBPACK_IMPORTED_MODULE_4__angular_forms__["c" /* Validators */].required],
            'password': ['', __WEBPACK_IMPORTED_MODULE_4__angular_forms__["c" /* Validators */].required]
        });
        this.userName = this.loginForm.controls['userName'];
        this.password = this.loginForm.controls['password'];
    }
    ConnectComponent.prototype.onConnectedChange = function (v) {
    };
    ConnectComponent.prototype.ngOnInit = function () {
        var self = this;
        this.isAuthenticated = this.connectedService.isAuthenticated;
        this.doAuthenticate = this.kerviService.doAuthenticate;
        this.inAuthentication = this.kerviService.inAuthentication$.value;
        this.kerviService.authenticationFailed$.subscribe(function (v) {
            self.invalidUser = v;
        });
        this.kerviService.IPCReady$.subscribe(function (v) {
            self.isConnected = v;
            self.isAuthenticated = self.connectedService.isAuthenticated;
            self.doAuthenticate = self.kerviService.doAuthenticate;
        });
        this.kerviService.inAuthentication$.subscribe(function (v) {
            self.inAuthentication = v;
            //self.isAuthenticated = self.connectedService.isAuthenticated;
            //self.doAuthenticate = self.kerviService.doAuthenticate;
        });
    };
    ConnectComponent.prototype.ngOnDestroy = function () {
        //this.kerviService.Connected.unsubscribe()    
    };
    ConnectComponent.prototype.onSubmit = function (value) {
        this.kerviService.authenticate(value.userName, value.password);
    };
    return ConnectComponent;
}());
ConnectComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'app-connect',
        //providers: [ KerviService ],
        template: __webpack_require__(281),
        styles: [__webpack_require__(250)]
    }),
    __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_4__angular_forms__["d" /* FormBuilder */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_4__angular_forms__["d" /* FormBuilder */]) === "function" && _a || Object, typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_3__connected_service__["a" /* ConnectedService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__connected_service__["a" /* ConnectedService */]) === "function" && _c || Object, typeof (_d = typeof __WEBPACK_IMPORTED_MODULE_2__angular_router__["b" /* Router */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__angular_router__["b" /* Router */]) === "function" && _d || Object, typeof (_e = typeof __WEBPACK_IMPORTED_MODULE_2__angular_router__["c" /* ActivatedRoute */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__angular_router__["c" /* ActivatedRoute */]) === "function" && _e || Object])
], ConnectComponent);

var _a, _b, _c, _d, _e;
//# sourceMappingURL=connect.component.js.map

/***/ }),

/***/ 17:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Rx__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rxjs_Rx___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_rxjs_Rx__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return DynamicRangeType; });
/* unused harmony export DynamicRange */
/* unused harmony export DynamicEnumOptionModel */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return DynamicEnumModel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DynamicNumberModel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return DynamicStringModel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DynamicBooleanModel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return DynamicDateTimeModel; });

//import { ControllersFactory } from './factory' 
var DynamicRangeType;
(function (DynamicRangeType) {
    DynamicRangeType[DynamicRangeType["normal"] = 0] = "normal";
    DynamicRangeType[DynamicRangeType["warning"] = 1] = "warning";
    DynamicRangeType[DynamicRangeType["error"] = 2] = "error";
})(DynamicRangeType || (DynamicRangeType = {}));
;
var DynamicRange = (function () {
    function DynamicRange(range) {
        this.start = null;
        this.end = null;
        this.type = null;
        this.start = range["start"];
        this.end = range["end"];
        if (range["type"] == "warning")
            this.type = DynamicRangeType.warning;
        else if (range["type"] == "error")
            this.type = DynamicRangeType.error;
        else
            this.type = DynamicRangeType.normal;
    }
    return DynamicRange;
}());

var DynamicEnumOptionModel = (function () {
    function DynamicEnumOptionModel(messageOption) {
        this.selected$ = new __WEBPACK_IMPORTED_MODULE_0_rxjs_Rx__["BehaviorSubject"](false);
        this.value = messageOption.value;
        this.text = messageOption.text;
        this.selected$.next(messageOption.selected);
    }
    DynamicEnumOptionModel.prototype.updateReferences = function () { };
    ;
    DynamicEnumOptionModel.prototype.reload = function (component) { };
    ;
    return DynamicEnumOptionModel;
}());

var DynamicEnumModel = (function () {
    function DynamicEnumModel(message) {
        this.componentType = "dynamicValue";
        this.ui = {};
        this.dashboards = [];
        this.options = [];
        this.name = message.name;
        this.id = message.id;
        this.visible = message.visible;
        this.ui = message.ui;
        this.type = message.componentType;
        this.command = message.command;
        this.options = [];
        for (var _i = 0, _a = message.options; _i < _a.length; _i++) {
            var option = _a[_i];
            this.options.push(new DynamicEnumOptionModel(option));
        }
    }
    DynamicEnumModel.prototype.updateReferences = function () { };
    ;
    DynamicEnumModel.prototype.reload = function (component) { };
    ;
    DynamicEnumModel.prototype.selectOptions = function (selectedOptions) {
        console.log("soc");
        for (var _i = 0, _a = this.options; _i < _a.length; _i++) {
            var option = _a[_i];
            option.selected$.next(false);
        }
        for (var _b = 0, selectedOptions_1 = selectedOptions; _b < selectedOptions_1.length; _b++) {
            var selectedOption = selectedOptions_1[_b];
            if (selectedOption.selected) {
                for (var _c = 0, _d = this.options; _c < _d.length; _c++) {
                    var option = _d[_c];
                    if (option.value == selectedOption.value) {
                        option.selected$.next(true);
                        console.log("os", option.selected$.value);
                    }
                }
            }
        }
    };
    return DynamicEnumModel;
}());

var DynamicNumberModel = (function () {
    function DynamicNumberModel(message) {
        this.componentType = "DynamicValue";
        this.dashboards = [];
        this.value$ = new __WEBPACK_IMPORTED_MODULE_0_rxjs_Rx__["BehaviorSubject"](0);
        this.sparkline$ = new __WEBPACK_IMPORTED_MODULE_0_rxjs_Rx__["BehaviorSubject"]([]);
        this.ranges = [];
        this.ui = {
            type: "",
            orientation: ""
        };
        this.name = message.name;
        this.type = message.componentType;
        this.isInput = message.isInput;
        this.ui = message.ui;
        this.orientation = message.orientation;
        this.visible = message.visible;
        this.unit = message.unit;
        this.value$.next(message.value);
        this.maxValue = message.maxValue;
        this.minValue = message.minValue;
        this.command = message.command;
        this.id = message.id;
        this.sparkline$.next(message.sparkline);
        for (var prop in message.ui) {
            if (this.ui[prop] != undefined)
                this.ui[prop] = message.ui[prop];
        }
        for (var _i = 0, _a = message.ranges; _i < _a.length; _i++) {
            var range = _a[_i];
            this.ranges.push(new DynamicRange(range));
        }
    }
    DynamicNumberModel.prototype.updateReferences = function () { };
    ;
    DynamicNumberModel.prototype.reload = function (component) { };
    ;
    return DynamicNumberModel;
}());

var DynamicStringModel = (function () {
    function DynamicStringModel(message) {
        this.componentType = "DynamicValue";
        this.dashboards = [];
        this.value$ = new __WEBPACK_IMPORTED_MODULE_0_rxjs_Rx__["BehaviorSubject"](0);
        this.ui = {
            type: "",
            orientation: ""
        };
        this.name = message.name;
        this.type = message.componentType;
        this.ui = message.ui;
        this.orientation = message.orientation;
        this.visible = message.visible;
        this.unit = message.unit;
        this.value$.next(message.value);
        this.maxValue = message.maxValue;
        this.minValue = message.minValue;
        this.command = message.command;
        this.id = message.id;
        for (var prop in message.ui) {
            if (this.ui[prop] != undefined)
                this.ui[prop] = message.ui[prop];
        }
    }
    DynamicStringModel.prototype.updateReferences = function () { };
    ;
    DynamicStringModel.prototype.reload = function (component) { };
    ;
    return DynamicStringModel;
}());

var DynamicBooleanModel = (function () {
    function DynamicBooleanModel(message) {
        this.componentType = "DynamicValue";
        this.ui = {};
        this.dashboards = [];
        this.value$ = new __WEBPACK_IMPORTED_MODULE_0_rxjs_Rx__["BehaviorSubject"](false);
        this.id = message.id;
        this.name = message.name;
        this.type = message.componentType;
        this.ui = message.ui;
        this.isInput = message.isInput;
        this.visible = message.visible;
        this.command = message.command;
        this.value$.next(message.value);
    }
    DynamicBooleanModel.prototype.updateReferences = function () { };
    ;
    DynamicBooleanModel.prototype.reload = function (component) { };
    ;
    return DynamicBooleanModel;
}());

/*export class ControllerButtonModel implements IComponent {
    public id: string;
    public name: string;
    public componentType = "DynamicValue"
    public ui:any = {}
    public dashboards: string[] = [];
    public type: string;
    public visible: boolean;
    public pressCommand: string;
    public releaseCommand: string;
    public clickCommand: string;
    public state$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);

    constructor(message) {
        this.id = message.id;
        this.name = message.name;
        this.visible = message.visible;
        this.type = message.componentType;
        this.ui = message.ui;
        this.clickCommand = message.onClick;
        this.pressCommand = message.onPress;
        this.releaseCommand = message.onRelease;
        this.state$.next(message.state);

    }

    updateReferences(){};
    reload(component:IComponent){};
}*/
var DynamicDateTimeModel = (function () {
    function DynamicDateTimeModel(message) {
        this.componentType = "DynamicValue";
        this.ui = {};
        this.dashboards = [];
        this.value$ = new __WEBPACK_IMPORTED_MODULE_0_rxjs_Rx__["BehaviorSubject"](null);
        this.id = message.id;
        this.name = message.name;
        this.type = message.componentType;
        this.ui = message.ui;
        this.visible = message.visible;
        this.subType = message.inputType;
        this.value$.next(message.value);
        this.changeCommand = message.command;
    }
    DynamicDateTimeModel.prototype.updateReferences = function () { };
    ;
    DynamicDateTimeModel.prototype.reload = function (component) { };
    ;
    return DynamicDateTimeModel;
}());

//# sourceMappingURL=dynamicValues.model.js.map

/***/ }),

/***/ 170:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__kervi_service__ = __webpack_require__(7);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ControllersService; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};


var ControllersService = (function () {
    function ControllersService(kerviService) {
        this.kerviService = kerviService;
        var self = this;
        var s = this.kerviService.getComponents$().subscribe(function (v) {
            self.refreshControllers();
        });
    }
    ControllersService.prototype.refreshControllers = function () {
        var self = this;
        var controllers = this.kerviService.getComponentsByType("controller");
        for (var _i = 0, controllers_1 = controllers; _i < controllers_1.length; _i++) {
            var controller = controllers_1[_i];
            if (controller.inputs.length == 0) {
                for (var _a = 0, _b = controller.inputReferences; _a < _b.length; _a++) {
                    var ref = _b[_a];
                    controller.inputs.push(this.kerviService.getComponent(ref.id));
                }
            }
            if (controller.outputs.length == 0) {
                for (var _c = 0, _d = controller.outputReferences; _c < _d.length; _c++) {
                    var ref = _d[_c];
                    controller.outputs.push(this.kerviService.getComponent(ref.id));
                }
            }
        }
        //console.log("rc", controllers);    
    };
    return ControllersService;
}());
ControllersService = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["c" /* Injectable */])(),
    __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */]) === "function" && _a || Object])
], ControllersService);

var _a;
//# sourceMappingURL=controller.service.js.map

/***/ }),

/***/ 171:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_controller_model__ = __webpack_require__(95);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__models_dashboard_model__ = __webpack_require__(19);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ControllerComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};



var ControllerComponent = (function () {
    function ControllerComponent() {
        this.section = "left";
    }
    ControllerComponent.prototype.ngOnInit = function () {
        console.log("ctrli", this);
    };
    return ControllerComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__models_controller_model__["a" /* ControllerModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__models_controller_model__["a" /* ControllerModel */]) === "function" && _a || Object)
], ControllerComponent.prototype, "controller", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", String)
], ControllerComponent.prototype, "section", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_2__models_dashboard_model__["b" /* DashboardSectionModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__models_dashboard_model__["b" /* DashboardSectionModel */]) === "function" && _b || Object)
], ControllerComponent.prototype, "dashboardSection", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Object)
], ControllerComponent.prototype, "parameters", void 0);
ControllerComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'kervi-controller',
        template: __webpack_require__(282),
        styles: [__webpack_require__(251)]
    }),
    __metadata("design:paramtypes", [])
], ControllerComponent);

var _a, _b;
//# sourceMappingURL=controller.component.js.map

/***/ }),

/***/ 172:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__controller_controller_component__ = __webpack_require__(171);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__controller_service__ = __webpack_require__(170);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__angular_router__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__values_values_module__ = __webpack_require__(51);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ControllersModule; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};






var ControllersModule = (function () {
    function ControllersModule(controllerService) {
        this.controllerService = controllerService;
    }
    return ControllersModule;
}());
ControllersModule = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["b" /* NgModule */])({
        imports: [
            __WEBPACK_IMPORTED_MODULE_1__angular_common__["a" /* CommonModule */],
            __WEBPACK_IMPORTED_MODULE_4__angular_router__["a" /* RouterModule */],
            __WEBPACK_IMPORTED_MODULE_5__values_values_module__["a" /* ValuesModule */]
        ],
        exports: [
            __WEBPACK_IMPORTED_MODULE_2__controller_controller_component__["a" /* ControllerComponent */],
        ],
        providers: [__WEBPACK_IMPORTED_MODULE_3__controller_service__["a" /* ControllersService */]],
        declarations: [
            __WEBPACK_IMPORTED_MODULE_2__controller_controller_component__["a" /* ControllerComponent */],
        ]
    }),
    __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_3__controller_service__["a" /* ControllersService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__controller_service__["a" /* ControllersService */]) === "function" && _a || Object])
], ControllersModule);

var _a;
//# sourceMappingURL=controllers.module.js.map

/***/ }),

/***/ 173:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__models_dashboard_model__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_Rx__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rxjs_Rx___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rxjs_Rx__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DashboardSectionComponent; });
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};




var DashboardSectionComponent = (function () {
    //sectionComponents:IComponent[] = []
    function DashboardSectionComponent(kerviService) {
        this.kerviService = kerviService;
        this.inline = false;
        this.sectionClassWidth = "dashboard-section-width-1";
        this.sectionClassHeight = "dashboard-section-height-1";
        //sectionWidth:string;
        //sectionHeight:string;
        this.showHeader = false;
        this.expanded = true;
        this.components = [];
        this.headerComponents = [];
        //messages: DashboardMessageModel[] = [];
        this.messages$ = new __WEBPACK_IMPORTED_MODULE_3_rxjs_Rx__["BehaviorSubject"]([]);
    }
    DashboardSectionComponent.prototype.ngOnInit = function () {
        var self = this;
        this.sectionClassWidth = "dashboard-section-width-" + this.section.parameters.columns;
        this.sectionClassHeight = "dashboard-section-height-" + this.section.parameters.rows;
        this.title = this.section.parameters.title;
        for (var _i = 0, _a = this.section.components; _i < _a.length; _i++) {
            var component = _a[_i];
            if (component.parameters.linkToHeader)
                this.headerComponents.push(component);
            else
                this.components.push(component);
        }
        this.showHeader = (this.section.parameters.title != null && this.section.parameters.title.length > 0) || (this.headerComponents.length > 0);
        if (this.section.parameters.userLog) {
            this.kerviService.spine.sendQuery("getLogItems", 0, 20, function (v) {
                console.log('lm', v);
                //var messages = DashboardFactory.createLogMessages(v)
                //self.messages$.next(messages);
            });
            this.kerviService.spine.addEventHandler("userLogMessage", null, function (v) {
                console.log("um", this);
                var messages = self.messages$.value;
                messages.unshift(new __WEBPACK_IMPORTED_MODULE_2__models_dashboard_model__["c" /* DashboardMessageModel */](this));
                if (messages.length > 20)
                    messages.pop();
                self.messages$.next(messages);
            });
        }
    };
    DashboardSectionComponent.prototype.ngOnDestroy = function () {
    };
    return DashboardSectionComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_2__models_dashboard_model__["b" /* DashboardSectionModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__models_dashboard_model__["b" /* DashboardSectionModel */]) === "function" && _a || Object)
], DashboardSectionComponent.prototype, "section", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Boolean)
], DashboardSectionComponent.prototype, "inline", void 0);
DashboardSectionComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'kervi-dashboard-section',
        //providers: [ KerviService ],
        template: __webpack_require__(283),
        styles: [__webpack_require__(246)],
        //encapsulation: ViewEncapsulation.None
        changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_15" /* ChangeDetectionStrategy */].OnPush
    }),
    __metadata("design:paramtypes", [typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */]) === "function" && _b || Object])
], DashboardSectionComponent);

var _a, _b;
//# sourceMappingURL=dashboard-section.component.js.map

/***/ }),

/***/ 174:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__dashboards_service__ = __webpack_require__(37);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__sensors_sensors_module__ = __webpack_require__(179);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__controllers_controllers_module__ = __webpack_require__(172);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__values_values_module__ = __webpack_require__(51);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__dashboard_dashboard_component__ = __webpack_require__(94);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__page_header_page_header_component__ = __webpack_require__(175);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__dashboard_section_dashboard_section_component__ = __webpack_require__(173);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__angular_router__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__ui_components_ui_components_module__ = __webpack_require__(98);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DashboardsModule; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};











var DashboardsModule = (function () {
    function DashboardsModule() {
    }
    return DashboardsModule;
}());
DashboardsModule = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["b" /* NgModule */])({
        imports: [
            __WEBPACK_IMPORTED_MODULE_1__angular_common__["a" /* CommonModule */],
            __WEBPACK_IMPORTED_MODULE_9__angular_router__["a" /* RouterModule */],
            __WEBPACK_IMPORTED_MODULE_3__sensors_sensors_module__["a" /* SensorsModule */],
            __WEBPACK_IMPORTED_MODULE_4__controllers_controllers_module__["a" /* ControllersModule */],
            __WEBPACK_IMPORTED_MODULE_5__values_values_module__["a" /* ValuesModule */],
            __WEBPACK_IMPORTED_MODULE_10__ui_components_ui_components_module__["a" /* UIComponentsModule */]
        ],
        exports: [
            __WEBPACK_IMPORTED_MODULE_6__dashboard_dashboard_component__["a" /* DashboardComponent */],
            __WEBPACK_IMPORTED_MODULE_7__page_header_page_header_component__["a" /* PageHeaderComponent */],
            __WEBPACK_IMPORTED_MODULE_8__dashboard_section_dashboard_section_component__["a" /* DashboardSectionComponent */],
            __WEBPACK_IMPORTED_MODULE_5__values_values_module__["a" /* ValuesModule */]
        ],
        providers: [__WEBPACK_IMPORTED_MODULE_2__dashboards_service__["a" /* DashboardsService */],],
        declarations: [
            __WEBPACK_IMPORTED_MODULE_6__dashboard_dashboard_component__["a" /* DashboardComponent */],
            __WEBPACK_IMPORTED_MODULE_7__page_header_page_header_component__["a" /* PageHeaderComponent */],
            __WEBPACK_IMPORTED_MODULE_8__dashboard_section_dashboard_section_component__["a" /* DashboardSectionComponent */],
        ]
    })
], DashboardsModule);

//# sourceMappingURL=dashboards.module.js.map

/***/ }),

/***/ 175:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dashboards_service__ = __webpack_require__(37);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__models_dashboard_model__ = __webpack_require__(19);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PageHeaderComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};




var PageHeaderComponent = (function () {
    function PageHeaderComponent(dashboardsService) {
        this.dashboardsService = dashboardsService;
        this.dashboard = null;
        this.dashboards$ = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__["BehaviorSubject"]([]);
    }
    PageHeaderComponent.prototype.ngOnInit = function () {
        var self = this;
        this.appSubscription = this.dashboardsService.getDashboards$().subscribe(function (v) {
            self.dashboards$.next(v);
        });
    };
    PageHeaderComponent.prototype.toggleControllers = function () {
        console.log("tgc");
        var panelLeft = jQuery('.controllers-left-section');
        var panelRight = jQuery('.controllers-right-section');
        if (panelLeft.hasClass("visible")) {
            panelLeft.removeClass('visible').animate({ 'margin-left': '-350px' });
            panelRight.removeClass('visible').animate({ 'margin-right': '-350px' });
        }
        else {
            panelLeft.addClass('visible').animate({ 'margin-left': '0px' });
            panelRight.addClass('visible').animate({ 'margin-right': '0px' });
        }
    };
    PageHeaderComponent.prototype.ngOnDestroy = function () {
        this.appSubscription.unsubscribe();
    };
    return PageHeaderComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_3__models_dashboard_model__["a" /* DashboardModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__models_dashboard_model__["a" /* DashboardModel */]) === "function" && _a || Object)
], PageHeaderComponent.prototype, "dashboard", void 0);
PageHeaderComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'app-page-header',
        template: __webpack_require__(285),
        styles: [__webpack_require__(252)],
    }),
    __metadata("design:paramtypes", [typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_1__dashboards_service__["a" /* DashboardsService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__dashboards_service__["a" /* DashboardsService */]) === "function" && _b || Object])
], PageHeaderComponent);

var _a, _b;
//# sourceMappingURL=page-header.component.js.map

/***/ }),

/***/ 176:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ComponentRef; });
var ComponentRef = (function () {
    function ComponentRef(message) {
        this.id = message.id;
    }
    return ComponentRef;
}());

//# sourceMappingURL=ComponentRef.js.map

/***/ }),

/***/ 177:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__dynamicValues_model__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__controller_model__ = __webpack_require__(95);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__sensor_model__ = __webpack_require__(96);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__dashboard_model__ = __webpack_require__(19);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ComponentFactory; });




var ComponentFactory = (function () {
    function ComponentFactory() {
    }
    ComponentFactory.createComponents = function (message) {
        var result = [];
        if (Array.isArray(message)) {
            for (var i = 0; (i < message.length); i++) {
                result = result.concat(this.createComponents(message[i]));
            }
        }
        else {
            var component = null;
            if (message.componentType == "dashboard")
                component = new __WEBPACK_IMPORTED_MODULE_3__dashboard_model__["a" /* DashboardModel */](message);
            if (message.componentType == "sensor")
                component = new __WEBPACK_IMPORTED_MODULE_2__sensor_model__["a" /* SensorModel */](message);
            else if (message.componentType == "controller")
                component = new __WEBPACK_IMPORTED_MODULE_1__controller_model__["a" /* ControllerModel */](message);
            else if (message.componentType == "dynamic-boolean")
                component = new __WEBPACK_IMPORTED_MODULE_0__dynamicValues_model__["a" /* DynamicBooleanModel */](message);
            else if (message.componentType == "dynamic-number")
                component = new __WEBPACK_IMPORTED_MODULE_0__dynamicValues_model__["b" /* DynamicNumberModel */](message);
            else if (message.componentType == "dynamic-string")
                component = new __WEBPACK_IMPORTED_MODULE_0__dynamicValues_model__["c" /* DynamicStringModel */](message);
            else if (message.componentType == "dynamic-enum")
                component = new __WEBPACK_IMPORTED_MODULE_0__dynamicValues_model__["d" /* DynamicEnumModel */](message);
            else if (message.componentType == "dynamic-datetime")
                component = new __WEBPACK_IMPORTED_MODULE_0__dynamicValues_model__["e" /* DynamicDateTimeModel */](message);
            if (component)
                result.push(component);
        }
        return result;
    };
    return ComponentFactory;
}());

//# sourceMappingURL=factory.js.map

/***/ }),

/***/ 178:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_sensor_model__ = __webpack_require__(96);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__models_dashboard_model__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__template_service__ = __webpack_require__(20);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SensorComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};





var SensorComponent = (function () {
    function SensorComponent(kerviService, templateService) {
        this.kerviService = kerviService;
        this.templateService = templateService;
        this.sensor = null;
        this.parameters = null;
        this.dashboardSection = null;
        this.inline = false;
    }
    SensorComponent.prototype.ngOnInit = function () {
    };
    return SensorComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__models_sensor_model__["a" /* SensorModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__models_sensor_model__["a" /* SensorModel */]) === "function" && _a || Object)
], SensorComponent.prototype, "sensor", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Object)
], SensorComponent.prototype, "parameters", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_2__models_dashboard_model__["b" /* DashboardSectionModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__models_dashboard_model__["b" /* DashboardSectionModel */]) === "function" && _b || Object)
], SensorComponent.prototype, "dashboardSection", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Boolean)
], SensorComponent.prototype, "inline", void 0);
SensorComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'kervi-sensor',
        template: __webpack_require__(286),
        styles: [__webpack_require__(253)],
        changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_15" /* ChangeDetectionStrategy */].OnPush
    }),
    __metadata("design:paramtypes", [typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_3__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__kervi_service__["a" /* KerviService */]) === "function" && _c || Object, typeof (_d = typeof __WEBPACK_IMPORTED_MODULE_4__template_service__["a" /* TemplateService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_4__template_service__["a" /* TemplateService */]) === "function" && _d || Object])
], SensorComponent);

var _a, _b, _c, _d;
//# sourceMappingURL=sensor.component.js.map

/***/ }),

/***/ 179:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__sensor_sensor_component__ = __webpack_require__(178);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_router__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__values_values_module__ = __webpack_require__(51);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SensorsModule; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};





var SensorsModule = (function () {
    function SensorsModule() {
    }
    return SensorsModule;
}());
SensorsModule = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["b" /* NgModule */])({
        imports: [
            __WEBPACK_IMPORTED_MODULE_1__angular_common__["a" /* CommonModule */],
            __WEBPACK_IMPORTED_MODULE_3__angular_router__["a" /* RouterModule */],
            __WEBPACK_IMPORTED_MODULE_4__values_values_module__["a" /* ValuesModule */]
        ],
        exports: [
            __WEBPACK_IMPORTED_MODULE_2__sensor_sensor_component__["a" /* SensorComponent */]
        ],
        providers: [],
        declarations: [
            __WEBPACK_IMPORTED_MODULE_2__sensor_sensor_component__["a" /* SensorComponent */]
        ]
    })
], SensorsModule);

//# sourceMappingURL=sensors.module.js.map

/***/ }),

/***/ 180:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__template_service__ = __webpack_require__(20);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ButtonComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};




//declare var Chart:any;
var ButtonComponent = (function () {
    //private  unitSize:number = 150;
    //state:boolean = false;
    //canvasId:string="";
    //private chart:any=null;
    //private chartData = [];
    function ButtonComponent(kerviService, templateService) {
        this.kerviService = kerviService;
        this.templateService = templateService;
        this.value = null;
        this.parameters = null;
        this.inline = false;
    }
    ButtonComponent.prototype.color = function (style, selector) {
        return this.templateService.getColor(style, selector);
    };
    ButtonComponent.prototype.ngOnInit = function () {
        var self = this;
        if (self.parameters) {
            if (!self.inline && self.parameters.inline)
                self.inline = true;
        }
    };
    ButtonComponent.prototype.press = function () {
        this.kerviService.spine.sendCommand(this.value.command, true);
    };
    ButtonComponent.prototype.release = function () {
        this.kerviService.spine.sendCommand(this.value.command, false);
    };
    return ButtonComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["a" /* DynamicBooleanModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["a" /* DynamicBooleanModel */]) === "function" && _a || Object)
], ButtonComponent.prototype, "value", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Object)
], ButtonComponent.prototype, "parameters", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", String)
], ButtonComponent.prototype, "type", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Number)
], ButtonComponent.prototype, "size", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Boolean)
], ButtonComponent.prototype, "inline", void 0);
ButtonComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'kervi-button',
        template: __webpack_require__(287),
        styles: [__webpack_require__(254)],
        changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_15" /* ChangeDetectionStrategy */].OnPush
    }),
    __metadata("design:paramtypes", [typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_3__template_service__["a" /* TemplateService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__template_service__["a" /* TemplateService */]) === "function" && _c || Object])
], ButtonComponent);

var _a, _b, _c;
//# sourceMappingURL=button.component.js.map

/***/ }),

/***/ 181:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__template_service__ = __webpack_require__(20);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ChartComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};




var ChartComponent = (function () {
    function ChartComponent(kerviService, templateService) {
        this.kerviService = kerviService;
        this.templateService = templateService;
        this.value = null;
        this.parameters = null;
        this.unitSize = 150;
        this.canvasId = "";
        this.chart = null;
        this.chartData = [];
        this.selectedPeriodText = "Hour";
        this.selectedPeriod = "hour";
        this.periodStart = null;
        this.periodEnd = null;
        this.updateChart = true;
    }
    ChartComponent.prototype.color = function (style, selector) {
        return this.templateService.getColor(style, selector);
    };
    ChartComponent.prototype.ngOnInit = function () {
        var self = this;
        this.canvasId = this.templateService.makeId();
        this.value.value$.subscribe(function (v) {
            if (self.chart) {
                try {
                    if (self.updateChart) {
                        var ds = self.chart.data.datasets[0].data;
                        ds.push({ x: self.value.valueTS, y: v });
                        if (ds.length > 20)
                            ds.shift();
                        self.chart.render();
                        self.chart.update();
                    }
                }
                catch (ex) {
                    console.log("cdx", ex);
                }
            }
        });
        self.periodEnd = new Date();
        self.periodStart = new Date();
        self.periodStart.setHours(self.periodEnd.getHours() - 1);
        setTimeout(function () {
            //jQuery("#"+self.canvasId).width(self.unitSize*self.size);
            //jQuery("#"+self.canvasId).height(self.unitSize);
            self.kerviService.spine.sendQuery("getSensorData", self.value.id, self.periodStart.toISOString(), self.periodEnd.toISOString(), function (results) {
                //console.log("gsd", this, results);
                var sensorData = results;
                self.chartData = [];
                for (var i = 0; (i < sensorData.length); i++) {
                    var dataItem = sensorData[i];
                    self.chartData.push({ x: new Date(dataItem.ts), y: dataItem.value });
                }
                //console.log("cd", chartData);
                var ctx = jQuery("#" + self.canvasId);
                self.chart = new Chart(ctx, {
                    type: 'line',
                    responsive: true,
                    maintainAspectRatio: false,
                    data: {
                        datasets: [
                            {
                                data: self.chartData,
                                fill: true,
                                lineTension: 0.1,
                            },
                        ]
                    },
                    options: {
                        responsive: true,
                        maintainAspectRatio: true,
                        pan: {
                            enabled: true,
                            mode: 'xy'
                        },
                        zoom: {
                            enabled: true,
                            mode: 'xy'
                        },
                        title: {
                            display: true,
                        },
                        elements: {
                            point: {
                                radius: 0
                            }
                        },
                        legend: {
                            display: false,
                        },
                        scales: {
                            xAxes: [{
                                    gridLines: {
                                        color: "rgba(255,255,255,0.5)",
                                        zeroLineColor: "rgba(255,255,255,0.5)"
                                    },
                                    type: "time",
                                    unit: 'second',
                                    unitStepSize: 120,
                                    time: {
                                        displayFormats: {
                                            'millisecond': 'MMM DD',
                                            'second': 'HH:mm:ss',
                                            'minute': 'HH:mm:ss',
                                            'hour': 'HH:mm:ss',
                                            'day': 'MMM DD',
                                            'week': 'MMM DD',
                                            'month': 'MMM DD',
                                            'quarter': 'MMM DD',
                                            'year': 'MMM DD',
                                        }
                                    },
                                    ticks: {
                                        display: true,
                                        stepSize: 120,
                                    },
                                    display: true,
                                    scaleLabel: {
                                        display: true,
                                    }
                                }],
                            yAxes: [{
                                    ticks: {
                                        fontColor: "white",
                                        max: self.value.maxValue,
                                        min: self.value.minValue,
                                    },
                                    gridLines: {
                                        color: "rgba(255,255,255,0.5)",
                                        zeroLineColor: "rgba(255,255,255,0.5)"
                                    },
                                    display: true,
                                    scaleLabel: {
                                        display: true,
                                    }
                                }]
                        }
                    }
                });
                console.log("sc", self.chart, self.chart.data.datasets[0].data);
            });
        }, 200);
    };
    ChartComponent.prototype.goLive = function () {
        this.selectPeriod(this.selectedPeriod);
    };
    ChartComponent.prototype.movePeriod = function (movement) {
        this.updateChart = false;
        if (this.selectedPeriod == "5min") {
            this.periodEnd.setMinutes(this.periodEnd.getMinutes() + 5 * movement);
            this.periodStart.setMinutes(this.periodEnd.getMinutes() - 5);
        }
        if (this.selectedPeriod == "15min") {
            this.periodEnd.setMinutes(this.periodEnd.getMinutes() + 15 * movement);
            this.periodStart.setMinutes(this.periodEnd.getMinutes() - 15);
        }
        if (this.selectedPeriod == "30min") {
            this.periodEnd.setMinutes(this.periodEnd.getMinutes() + 30 * movement);
            this.periodStart.setMinutes(this.periodEnd.getMinutes() - 30);
        }
        if (this.selectedPeriod == "hour") {
            this.periodEnd.setHours(this.periodEnd.getHours() + movement);
            this.periodStart.setHours(this.periodEnd.getHours() - 1);
        }
        if (this.selectedPeriod == "day") {
            this.periodEnd.setHours(this.periodEnd.getDay() + 24 * movement);
            this.periodStart.setHours(this.periodEnd.getDay() - 24);
        }
        if (this.selectedPeriod == "week") {
            this.periodEnd.setHours(this.periodEnd.getDay() + 7 * 24 * movement);
            this.periodStart.setHours(this.periodEnd.getDay() + 14 * 24 * movement);
        }
        if (this.selectedPeriod == "month") {
        }
        if (this.selectedPeriod == "year") {
        }
        this.loadPeriod();
    };
    ChartComponent.prototype.selectPeriod = function (period) {
        this.updateChart = true;
        this.selectedPeriod = period;
        this.periodEnd = new Date();
        this.periodStart = new Date();
        if (period == "5min") {
            this.selectedPeriodText = "5 min";
            this.periodStart.setMinutes(this.periodEnd.getMinutes() - 5);
        }
        if (period == "15min") {
            this.selectedPeriodText = "15 min";
            this.periodStart.setMinutes(this.periodEnd.getMinutes() - 15);
        }
        if (period == "30min") {
            this.selectedPeriodText = "30 min";
            this.periodStart.setMinutes(this.periodEnd.getMinutes() - 30);
        }
        if (period == "hour") {
            this.selectedPeriodText = "Hour";
            this.periodStart.setHours(this.periodEnd.getHours() - 1);
        }
        if (period == "day") {
            this.selectedPeriodText = "Day";
            this.periodStart.setHours(this.periodEnd.getHours() - 24);
        }
        if (period == "week") {
            this.selectedPeriodText = "Week";
            this.periodStart.setHours(this.periodEnd.getHours() - 7 * 24);
        }
        if (period == "month") {
            this.selectedPeriodText = "Month";
        }
        if (period == "year") {
            this.selectedPeriodText = "Year";
        }
        //console.log("sp", this.periodStart, this.periodEnd);
        this.loadPeriod();
    };
    ChartComponent.prototype.loadPeriod = function () {
        var self = this;
        //console.log("lp", this.periodStart, this.periodEnd);
        this.kerviService.spine.sendQuery("getSensorData", this.value.id, this.periodStart.toISOString(), this.periodEnd.toISOString(), function (results) {
            console.log("gsd", results);
            var sensorData = results;
            self.chartData.length = 0;
            for (var i = 0; (i < sensorData.length); i++) {
                var dataItem = sensorData[i];
                self.chartData.push({ x: Date.parse(dataItem.ts + " utc"), y: dataItem.value });
            }
            self.chart.render();
            self.chart.update();
        });
    };
    return ChartComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["b" /* DynamicNumberModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["b" /* DynamicNumberModel */]) === "function" && _a || Object)
], ChartComponent.prototype, "value", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Object)
], ChartComponent.prototype, "parameters", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", String)
], ChartComponent.prototype, "type", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Number)
], ChartComponent.prototype, "size", void 0);
ChartComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'kervi-chart',
        template: __webpack_require__(289),
        styles: [__webpack_require__(256)],
        changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_15" /* ChangeDetectionStrategy */].OnPush
    }),
    __metadata("design:paramtypes", [typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_3__template_service__["a" /* TemplateService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__template_service__["a" /* TemplateService */]) === "function" && _c || Object])
], ChartComponent);

var _a, _b, _c;
//# sourceMappingURL=chart.component.js.map

/***/ }),

/***/ 182:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__template_service__ = __webpack_require__(20);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GaugeComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};




var GaugeComponent = (function () {
    function GaugeComponent(kerviService, templateService) {
        this.kerviService = kerviService;
        this.templateService = templateService;
        this.value = null;
        this.parameters = null;
        this.type = "radial_gauge";
        this.unitSize = 110;
        this.canvasId = "";
        this.gauge = null;
        this.gaugeTypes = ['radial_gauge', 'vertical_linear_gauge', 'horizontal_linear_gauge', 'compass'];
    }
    GaugeComponent.prototype.color = function (style, selector) {
        return this.templateService.getColor(style, selector);
    };
    GaugeComponent.prototype.ngOnInit = function () {
        var self = this;
        this.canvasId = this.templateService.makeId();
        if (this.gaugeTypes.indexOf(this.type) > -1) {
            this.value.value$.subscribe(function (v) {
                if (self.gauge)
                    self.gauge.update({ value: v });
            });
            var warningColor = this.color("color", ".sensor-template .sensor-warning");
            var fatalColor = this.color("color", ".sensor-template .sensor-fatal");
            var dataHighlights = [];
            var fromLimit = self.value.minValue;
            for (var _i = 0, _a = self.value.ranges; _i < _a.length; _i++) {
                var range = _a[_i];
                if (range.type == __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["f" /* DynamicRangeType */].error)
                    dataHighlights.push({ "from": range.start, "to": range.end, "color": fatalColor });
                if (range.type == __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["f" /* DynamicRangeType */].warning)
                    dataHighlights.push({ "from": range.start, "to": range.end, "color": warningColor });
            }
            var nspan = (self.value.maxValue - self.value.minValue);
            var tickSpan = nspan / 10;
            var ticks = [];
            for (var n = self.value.minValue; (n <= self.value.maxValue); n += tickSpan)
                ticks.push(n);
            var settings = {
                renderTo: self.canvasId,
                value: self.value.value$.value,
                units: self.value.unit,
                title: self.parameters.label,
                minValue: self.value.minValue,
                maxValue: self.value.maxValue,
                highlights: dataHighlights,
                majorTicks: ticks,
                colorPlate: this.color("background-color", ".sensor-template"),
                borders: false,
                //colorBorderOuter:"",
                //colorBorderMiddle:"",
                //colorBorderInner:"",
                colorMajorTicks: this.color("color", ".sensor-template .sensor-major-ticks"),
                colorMinorTicks: this.color("color", ".sensor-template .sensor-minor-ticks"),
                colorTitle: this.color("color", ".sensor-template .sensor-title"),
                colorUnits: this.color("color", ".sensor-template .sensor-units"),
                colorNumbers: this.color("color", ".sensor-template .sensor-numbers"),
                colorNeedleStart: this.color("color", ".sensor-template .sensor-needle-start"),
                colorNeedleEnd: this.color("color", ".sensor-template .sensor-needle-end"),
                valueBox: false,
                animationRule: "bounce",
                animationDuration: "500",
                fontValue: "Led",
                animatedValue: "true"
            };
            setTimeout(function () {
                if (self.type == "radial_gauge") {
                    settings["width"] = self.unitSize * self.size;
                    settings["height"] = self.unitSize * self.size;
                    self.gauge = new RadialGauge(settings).draw();
                }
                if (self.type == "vertical_linear_gauge") {
                    settings["colorBarProgress"] = self.color("color", ".sensor-template .sensor-bar-progress"),
                        settings["colorBar"] = self.color("color", ".sensor-template .sensor-bar"),
                        settings["borders"] = false;
                    settings["needleType"] = "arrow";
                    settings["needleWidth"] = "2";
                    settings["needleCircleSize"] = "7";
                    settings["needleCircleOuter"] = "true";
                    settings["needleCircleInner"] = "false";
                    settings["animationDuration"] = "1500";
                    settings["animationRule"] = "linear";
                    settings["barWidth"] = "10";
                    settings["barBeginCircle"] = false;
                    //settings["numberSide"]="left";
                    settings["width"] = self.unitSize;
                    settings["height"] = self.unitSize * self.size;
                    self.gauge = new LinearGauge(settings).draw();
                }
                if (self.type == "horizontal_linear_gauge") {
                    settings["colorBarProgress"] = self.color("color", ".sensor-template .sensor-bar-progress"),
                        settings["colorBar"] = self.color("color", ".sensor-template .sensor-bar"),
                        settings["borders"] = false;
                    settings["needleType"] = "arrow";
                    settings["needleWidth"] = "2";
                    settings["needleCircleSize"] = "7";
                    settings["needleCircleOuter"] = "true";
                    settings["needleCircleInner"] = "false";
                    settings["animationDuration"] = "1500";
                    settings["animationRule"] = "linear";
                    settings["barWidth"] = "10";
                    settings["barBeginCircle"] = false;
                    settings["width"] = self.unitSize * self.size;
                    settings["height"] = self.unitSize;
                    self.gauge = new LinearGauge(settings).draw();
                }
            }, 1000);
        }
    };
    return GaugeComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["b" /* DynamicNumberModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["b" /* DynamicNumberModel */]) === "function" && _a || Object)
], GaugeComponent.prototype, "value", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Object)
], GaugeComponent.prototype, "parameters", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", String)
], GaugeComponent.prototype, "type", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Number)
], GaugeComponent.prototype, "size", void 0);
GaugeComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'kervi-gauge',
        template: __webpack_require__(290),
        styles: [__webpack_require__(257)],
        changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_15" /* ChangeDetectionStrategy */].OnPush
    }),
    __metadata("design:paramtypes", [typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_3__template_service__["a" /* TemplateService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__template_service__["a" /* TemplateService */]) === "function" && _c || Object])
], GaugeComponent);

var _a, _b, _c;
//# sourceMappingURL=gauge.component.js.map

/***/ }),

/***/ 183:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__cam_viewer_cam_viewer_component__ = __webpack_require__(97);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__kervi_service__ = __webpack_require__(7);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MPEGViewerComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};



var MPEGViewerComponent = (function () {
    function MPEGViewerComponent(kerviService, elementRef) {
        this.kerviService = kerviService;
        this.elementRef = elementRef;
        this.camComponent = null;
        this.firstLoad = true;
        var self = this;
    }
    MPEGViewerComponent.prototype.imageReady = function () {
        if (this.firstLoad) {
            this.firstLoad = false;
            if (this.camComponent)
                this.camComponent.imageReady();
        }
    };
    MPEGViewerComponent.prototype.ngOnInit = function () {
    };
    return MPEGViewerComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__cam_viewer_cam_viewer_component__["a" /* CamViewerComponent */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__cam_viewer_cam_viewer_component__["a" /* CamViewerComponent */]) === "function" && _a || Object)
], MPEGViewerComponent.prototype, "camComponent", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", String)
], MPEGViewerComponent.prototype, "cameraSource", void 0);
MPEGViewerComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'kervi-mpeg-viewer',
        template: __webpack_require__(291),
        styles: [__webpack_require__(258)]
    }),
    __metadata("design:paramtypes", [typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */]) === "function" && _c || Object])
], MPEGViewerComponent);

var _a, _b, _c;
//# sourceMappingURL=mpeg-viewer.component.js.map

/***/ }),

/***/ 184:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__template_service__ = __webpack_require__(20);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SliderComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};




var SliderComponent = (function () {
    function SliderComponent(kerviService, elementRef, templateService) {
        this.kerviService = kerviService;
        this.elementRef = elementRef;
        this.templateService = templateService;
        this.type = "horizontal_slider";
        this.moveDelayTimer = null;
        this.size = 0;
        this.unitSize = 110;
        this.inSlide = false;
        //console.log("cnio",this);
    }
    SliderComponent.prototype.color = function (style, selector) {
        return this.templateService.getColor(style, selector);
    };
    SliderComponent.prototype.ngOnInit = function () {
        var self = this;
        var sliderSize = self.unitSize * self.size;
        if (self.size == 0)
            sliderSize = self.unitSize;
        var color = this.color("color", ".number-gauge-template");
        setTimeout(function () {
            jQuery('input', self.elementRef.nativeElement).bootstrapSlider({
                tooltip: "hide",
                min: self.value.minValue,
                max: self.value.maxValue,
                step: self.tick,
                orientation: self.type == "horizontal_slider" ? "horizontal" : "vertical"
            });
            jQuery('.slider', self.elementRef.nativeElement).on("change", function (e) {
                self.kerviService.spine.sendCommand(self.value.command, e.value.newValue);
                jQuery(".slider-value", self.elementRef.nativeElement).html(e.value.newValue);
            });
            jQuery('.slider', self.elementRef.nativeElement).on("slideStart", function (e) {
                self.inSlide = true;
            });
            jQuery('.slider', self.elementRef.nativeElement).on("slideStop", function (e) {
                self.inSlide = false;
            });
            self.value.value$.subscribe(function (v) {
                if (!self.inSlide) {
                    jQuery("input", self.elementRef.nativeElement).bootstrapSlider('setValue', v);
                    //jQuery(".slider-value", self.elementRef.nativeElement).html(e.value.newValue);
                }
            });
        }, 0);
    };
    return SliderComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["b" /* DynamicNumberModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["b" /* DynamicNumberModel */]) === "function" && _a || Object)
], SliderComponent.prototype, "value", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", String)
], SliderComponent.prototype, "type", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Number)
], SliderComponent.prototype, "tick", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Object)
], SliderComponent.prototype, "parameters", void 0);
SliderComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'ui-slider',
        template: __webpack_require__(292),
        styles: [__webpack_require__(259)]
    }),
    __metadata("design:paramtypes", [typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */]) === "function" && _c || Object, typeof (_d = typeof __WEBPACK_IMPORTED_MODULE_3__template_service__["a" /* TemplateService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__template_service__["a" /* TemplateService */]) === "function" && _d || Object])
], SliderComponent);

var _a, _b, _c, _d;
//# sourceMappingURL=slider.component.js.map

/***/ }),

/***/ 185:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__template_service__ = __webpack_require__(20);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SparklineComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};



var SparklineComponent = (function () {
    function SparklineComponent(elementRef, templateService) {
        this.elementRef = elementRef;
        this.templateService = templateService;
    }
    SparklineComponent.prototype.color = function (style, selector) {
        return this.templateService.getColor(style, selector);
    };
    SparklineComponent.prototype.ngOnInit = function () {
        var self = this;
        var lineColor = self.color("color", ".sparkline-template");
        var spotColor = self.color("color", ".sparkline-template .spot");
        var fillColor = self.color("background-color", ".sparkline-template");
        var height = self.color("height", ".sparkline-template");
        var width = self.color("width", ".sparkline-template");
        //console.log("sl", width, height);
        this.value.sparkline$.subscribe(function (v) {
            jQuery(self.elementRef.nativeElement).sparkline(v, {
                type: 'line',
                lineColor: lineColor,
                spotColor: spotColor,
                fillColor: fillColor,
                height: height,
                width: width
            });
        });
    };
    return SparklineComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["b" /* DynamicNumberModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["b" /* DynamicNumberModel */]) === "function" && _a || Object)
], SparklineComponent.prototype, "value", void 0);
SparklineComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'value-sparkline',
        template: __webpack_require__(293),
        styles: [__webpack_require__(248)],
        changeDetection: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_15" /* ChangeDetectionStrategy */].OnPush
    }),
    __metadata("design:paramtypes", [typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_2__template_service__["a" /* TemplateService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__template_service__["a" /* TemplateService */]) === "function" && _c || Object])
], SparklineComponent);

var _a, _b, _c;
//# sourceMappingURL=sparkline.component.js.map

/***/ }),

/***/ 186:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__models_dashboard_model__ = __webpack_require__(19);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SwitchButtonComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};




var SwitchButtonComponent = (function () {
    function SwitchButtonComponent(kerviService, elementRef) {
        this.kerviService = kerviService;
        this.elementRef = elementRef;
        this.inline = false;
        this.state = false;
    }
    SwitchButtonComponent.prototype.press = function () {
        this.kerviService.spine.sendCommand(this.value.command, true);
    };
    SwitchButtonComponent.prototype.release = function () {
        this.kerviService.spine.sendCommand(this.value.command, false);
    };
    SwitchButtonComponent.prototype.ngOnInit = function () {
        var self = this;
        if (!this.parameters)
            this.parameters = this.value.ui;
        var onText = this.parameters && this.parameters.onIcon ? "<i class='fa fa-" + this.parameters.onIcon + "'></i> " : "";
        var offText = this.parameters && this.parameters.offIcon ? "<i class='fa fa-" + this.parameters.offIcon + "'></i> " : "";
        onText += this.parameters && this.parameters.onText ? this.parameters.onText : "";
        offText += this.parameters && this.parameters.offText ? this.parameters.offText : "";
        self.valueSubscription = self.value.value$.subscribe(function (v) {
            self.state = v;
            if (v)
                jQuery('input', self.elementRef.nativeElement).bootstrapToggle('on');
            else
                jQuery('input', self.elementRef.nativeElement).bootstrapToggle('off');
        });
        setTimeout(function () {
            jQuery('input', self.elementRef.nativeElement).bootstrapToggle({
                'on': onText,
                'off': offText,
                'onstyle': "on",
                'offstyle': "off",
                "width": "100%",
                "height": 20
            });
            jQuery('input', self.elementRef.nativeElement).change(function () {
                var state = jQuery('input', self.elementRef.nativeElement).prop('checked');
                if (state && !self.value.value$.value)
                    self.kerviService.spine.sendCommand(self.value.command, true);
                else if (!state && self.value.value$.value)
                    self.kerviService.spine.sendCommand(self.value.command, false);
            });
        }, 1000);
    };
    return SwitchButtonComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["a" /* DynamicBooleanModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["a" /* DynamicBooleanModel */]) === "function" && _a || Object)
], SwitchButtonComponent.prototype, "value", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_3__models_dashboard_model__["b" /* DashboardSectionModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__models_dashboard_model__["b" /* DashboardSectionModel */]) === "function" && _b || Object)
], SwitchButtonComponent.prototype, "dashboardSection", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Object)
], SwitchButtonComponent.prototype, "parameters", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Boolean)
], SwitchButtonComponent.prototype, "inline", void 0);
SwitchButtonComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'kervi-switchbutton',
        template: __webpack_require__(294),
        styles: [__webpack_require__(260)],
        encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["Y" /* ViewEncapsulation */].None
    }),
    __metadata("design:paramtypes", [typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */]) === "function" && _c || Object, typeof (_d = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */]) === "function" && _d || Object])
], SwitchButtonComponent);

var _a, _b, _c, _d;
//# sourceMappingURL=switch-button.component.js.map

/***/ }),

/***/ 187:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__template_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__models_dashboard_model__ = __webpack_require__(19);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DynamicBooleanComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};





var DynamicBooleanComponent = (function () {
    function DynamicBooleanComponent(kerviService, elementRef, templateService) {
        this.kerviService = kerviService;
        this.elementRef = elementRef;
        this.templateService = templateService;
        this.inline = false;
        this.size = 0;
        this.unitSize = 150;
        this.displayType = "switch";
        //console.log("cnio",this);
    }
    DynamicBooleanComponent.prototype.ngOnInit = function () {
        var self = this;
        if (!this.parameters)
            this.parameters = this.value.ui;
        if (this.parameters) {
            if (this.parameters.type) {
                this.displayType = this.parameters.type;
            }
            if (this.parameters.size)
                this.size = this.parameters.size;
            if (!this.inline && this.parameters.inline) {
                this.inline = true;
            }
            else if (!this.inline && this.parameters.size > 0) {
                this.inline = true;
            }
        }
        if (this.dashboardSection) {
            this.unitSize = this.dashboardSection.dashboard.unitSize;
        }
        if (self.value.isInput) {
            var sliderSize = self.unitSize * self.size;
            if (self.size == 0)
                sliderSize = self.unitSize;
        }
    };
    return DynamicBooleanComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["a" /* DynamicBooleanModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["a" /* DynamicBooleanModel */]) === "function" && _a || Object)
], DynamicBooleanComponent.prototype, "value", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_4__models_dashboard_model__["b" /* DashboardSectionModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_4__models_dashboard_model__["b" /* DashboardSectionModel */]) === "function" && _b || Object)
], DynamicBooleanComponent.prototype, "dashboardSection", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Object)
], DynamicBooleanComponent.prototype, "parameters", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Boolean)
], DynamicBooleanComponent.prototype, "inline", void 0);
DynamicBooleanComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'dynamic-value-boolean',
        template: __webpack_require__(295),
        styles: [__webpack_require__(261)]
        //directives: [ CommonModule  ],
    }),
    __metadata("design:paramtypes", [typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */]) === "function" && _c || Object, typeof (_d = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */]) === "function" && _d || Object, typeof (_e = typeof __WEBPACK_IMPORTED_MODULE_3__template_service__["a" /* TemplateService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__template_service__["a" /* TemplateService */]) === "function" && _e || Object])
], DynamicBooleanComponent);

var _a, _b, _c, _d, _e;
//# sourceMappingURL=boolean-value.component.js.map

/***/ }),

/***/ 188:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__template_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__models_dashboard_model__ = __webpack_require__(19);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DynamicValueComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};




var DynamicValueComponent = (function () {
    function DynamicValueComponent(kerviService, elementRef, templateService) {
        this.kerviService = kerviService;
        this.elementRef = elementRef;
        this.templateService = templateService;
        this.inline = false;
        this.size = 0;
        this.unitSize = 150;
        //console.log("cnio",this);
    }
    DynamicValueComponent.prototype.ngOnInit = function () {
    };
    return DynamicValueComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Object)
], DynamicValueComponent.prototype, "value", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_3__models_dashboard_model__["b" /* DashboardSectionModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__models_dashboard_model__["b" /* DashboardSectionModel */]) === "function" && _a || Object)
], DynamicValueComponent.prototype, "dashboardSection", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Object)
], DynamicValueComponent.prototype, "parameters", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Boolean)
], DynamicValueComponent.prototype, "inline", void 0);
DynamicValueComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'dynamic-value',
        template: __webpack_require__(296),
        styles: [__webpack_require__(262)]
        //directives: [ CommonModule  ],
    }),
    __metadata("design:paramtypes", [typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */]) === "function" && _c || Object, typeof (_d = typeof __WEBPACK_IMPORTED_MODULE_2__template_service__["a" /* TemplateService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__template_service__["a" /* TemplateService */]) === "function" && _d || Object])
], DynamicValueComponent);

var _a, _b, _c, _d;
//# sourceMappingURL=dynamic-value.component.js.map

/***/ }),

/***/ 189:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__template_service__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__models_dashboard_model__ = __webpack_require__(19);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DynamicNumberComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};





var DynamicNumberComponent = (function () {
    function DynamicNumberComponent(kerviService, elementRef, templateService) {
        this.kerviService = kerviService;
        this.elementRef = elementRef;
        this.templateService = templateService;
        this.inline = false;
        this.moveDelayTimer = null;
        this.size = 0;
        this.unitSize = 150;
        this.inSlide = false;
        this.displayType = "";
        this.currentIcon = null;
        this.gaugeTypes = ['radial_gauge', 'vertical_linear_gauge', 'horizontal_linear_gauge', 'compass'];
        this.slideTypes = ['horizontal_slider', 'vertical_slider'];
        //console.log("cnio",this);
    }
    DynamicNumberComponent.prototype.color = function (style, selector) {
        return this.templateService.getColor(style, selector);
    };
    DynamicNumberComponent.prototype.ngOnInit = function () {
        var self = this;
        if (!this.parameters)
            this.parameters = this.input.ui;
        if (this.parameters) {
            if (this.parameters.type) {
                if (this.gaugeTypes.indexOf(this.parameters.type) > -1) {
                    this.displayType = "gauge";
                    this.gaugeType = this.parameters.type;
                }
                else if (this.parameters.type == "chart") {
                    this.displayType = "chart";
                }
            }
            if (!this.inline && this.parameters.inline) {
                this.inline = true;
            }
            else if (!this.inline && this.parameters.size > 0) {
                this.inline = true;
            }
            if (this.parameters.size)
                this.size = this.parameters.size;
        }
        if (!this.displayType) {
            if (this.input.isInput)
                this.displayType = "slider";
            else
                this.displayType = "value";
        }
        if (this.dashboardSection) {
            this.unitSize = this.dashboardSection.dashboard.unitSize;
        }
        if (self.input.isInput) {
            var sliderSize = self.unitSize * self.size;
            if (self.size == 0)
                sliderSize = self.unitSize;
        }
    };
    return DynamicNumberComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["b" /* DynamicNumberModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["b" /* DynamicNumberModel */]) === "function" && _a || Object)
], DynamicNumberComponent.prototype, "input", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_4__models_dashboard_model__["b" /* DashboardSectionModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_4__models_dashboard_model__["b" /* DashboardSectionModel */]) === "function" && _b || Object)
], DynamicNumberComponent.prototype, "dashboardSection", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Object)
], DynamicNumberComponent.prototype, "parameters", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Boolean)
], DynamicNumberComponent.prototype, "inline", void 0);
DynamicNumberComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'dynamic-value-number',
        template: __webpack_require__(297),
        styles: [__webpack_require__(263)]
        //directives: [ CommonModule  ],
    }),
    __metadata("design:paramtypes", [typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */]) === "function" && _c || Object, typeof (_d = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */]) === "function" && _d || Object, typeof (_e = typeof __WEBPACK_IMPORTED_MODULE_3__template_service__["a" /* TemplateService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__template_service__["a" /* TemplateService */]) === "function" && _e || Object])
], DynamicNumberComponent);

var _a, _b, _c, _d, _e;
//# sourceMappingURL=number-value.component.js.map

/***/ }),

/***/ 19:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return DashboardMessageModel; });
/* unused harmony export DashboardSectionComponentModel */
/* unused harmony export DashboardSectionParametersModel */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DashboardSectionModel; });
/* unused harmony export DashboardBackgroundModel */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DashboardModel; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var DashboardMessageModel = (function () {
    function DashboardMessageModel(message) {
        this.timestamp = new Date(message.timestamp * 1000);
        this.topic = message.topic;
        this.body = message.body;
        this.type = message.type;
        this.sourceId = message.source_id;
        this.sourceName = message.source_name;
        this.area = message.area;
        this.level = message.level;
    }
    return DashboardMessageModel;
}());

var DashboardSectionComponentModel = (function () {
    function DashboardSectionComponentModel(message) {
        this.message = message;
        this.linkId = message.linkId;
        this.componentId = message.componentId;
        this.parameters = message.parameters;
    }
    return DashboardSectionComponentModel;
}());

var DashboardSectionParametersModel = (function () {
    function DashboardSectionParametersModel(messageParameters) {
        this.title = null;
        this.columns = null;
        this.rows = null;
        this.type = null;
        this.userLog = null;
        this.title = messageParameters.title;
        this.columns = messageParameters.columns;
        this.rows = messageParameters.rows;
        this.userLog = messageParameters.userLog;
        if (messageParameters.type)
            this.type = messageParameters.type;
    }
    return DashboardSectionParametersModel;
}());

var DashboardSectionModel = (function () {
    function DashboardSectionModel(dashboard, messageSection) {
        this.components = [];
        this.dashboard = dashboard;
        this.id = messageSection.id;
        this.name = messageSection.name;
        this.parameters = new DashboardSectionParametersModel(messageSection.uiParameters);
        for (var _i = 0, _a = messageSection.components; _i < _a.length; _i++) {
            var componentRef = _a[_i];
            this.components.push(new DashboardSectionComponentModel(componentRef));
        }
    }
    DashboardSectionModel.prototype.reload = function (source) {
        //console.log("rl", this);
        for (var _i = 0, _a = source.components; _i < _a.length; _i++) {
            var sourceComponent = _a[_i];
            var found = false;
            for (var _b = 0, _c = this.components; _b < _c.length; _b++) {
                var component = _c[_b];
                if (component.componentId == sourceComponent.componentId) {
                    found = true;
                }
            }
            if (!found) {
                this.components.push(sourceComponent);
            }
        }
        var deleteComponents = [];
        for (var _d = 0, _e = this.components; _d < _e.length; _d++) {
            var component = _e[_d];
            var found = false;
            for (var _f = 0, _g = source.components; _f < _g.length; _f++) {
                var sourceComponent = _g[_f];
                if (sourceComponent.componentId == component.componentId) {
                    found = true;
                    break;
                }
            }
            if (!found)
                deleteComponents.push(component);
        }
        //console.log("dsc",deleteComponents);
        for (var _h = 0, deleteComponents_1 = deleteComponents; _h < deleteComponents_1.length; _h++) {
            var component = deleteComponents_1[_h];
            this.components.splice(this.components.indexOf(component), 1);
        }
    };
    return DashboardSectionModel;
}());

var DashboardBackgroundModel = (function () {
    function DashboardBackgroundModel(message) {
        this.type = message.type;
        this.cameraId = message.cameraId;
    }
    return DashboardBackgroundModel;
}());

var DashboardModel = (function () {
    function DashboardModel(message) {
        this.headerSection = null;
        this.footerCenterSection = null;
        this.footerLeftSection = null;
        this.footerRightSection = null;
        this.sysSection = null;
        this.backgroundSection = null;
        this.controllerSection = null;
        this.LeftPadXSection = null;
        this.LeftPadYSection = null;
        this.RightPadXSection = null;
        this.RightPadYSection = null;
        this.id = message.id;
        this.name = message.name;
        this.componentType = "dashboard";
        this.type = message.type;
        this.isDefault = message.isDefault;
        this.template = message.template;
        this.unitSize = message.unitSize;
        //this.background=new DashboardBackgroundModel(message.background);
        this.sections = [];
        if (!this.template) {
            for (var _i = 0, _a = message.sections; _i < _a.length; _i++) {
                var messageSection = _a[_i];
                var section = new DashboardSectionModel(this, messageSection);
                if (section.id == "header_center")
                    this.headerSection = section;
                else if (section.id == "footer_left")
                    this.footerLeftSection = section;
                else if (section.id == "footer_center")
                    this.footerCenterSection = section;
                else if (section.id == "footer_right")
                    this.footerRightSection = section;
                else if (section.id == "header_right")
                    this.sysSection = section;
                else if (section.id == "controllers")
                    this.controllerSection = section;
                else if (section.id == "background")
                    this.backgroundSection = section;
                else if (section.id == "left_pad_x")
                    this.LeftPadXSection = section;
                else if (section.id == "left_pad_y")
                    this.LeftPadYSection = section;
                else if (section.id == "right_pad_x")
                    this.RightPadXSection = section;
                else if (section.id == "right_pad_y")
                    this.RightPadYSection = section;
                else
                    this.sections.push(section);
            }
        }
    }
    DashboardModel.prototype.updateReferences = function () { };
    ;
    DashboardModel.prototype.reload = function (component) {
        var source = component;
        if (!this.backgroundSection && source.backgroundSection)
            this.backgroundSection = source.backgroundSection;
        else if (this.backgroundSection && !source.backgroundSection)
            this.backgroundSection = null;
        else if (this.backgroundSection)
            this.backgroundSection.reload(source.backgroundSection);
        if (!this.footerLeftSection && source.footerLeftSection)
            this.footerLeftSection = source.footerLeftSection;
        else if (this.footerLeftSection && !source.footerLeftSection)
            this.footerLeftSection = null;
        else if (this.footerLeftSection)
            this.footerLeftSection.reload(source.footerLeftSection);
        if (!this.footerRightSection && source.footerRightSection)
            this.footerRightSection = source.footerRightSection;
        else if (this.footerRightSection && !source.footerRightSection)
            this.footerRightSection = null;
        else if (this.footerRightSection)
            this.footerRightSection.reload(source.footerRightSection);
        if (!this.footerCenterSection && source.footerCenterSection)
            this.footerCenterSection = source.footerCenterSection;
        else if (this.footerCenterSection && !source.footerCenterSection)
            this.footerCenterSection = null;
        else if (this.footerCenterSection)
            this.footerCenterSection.reload(source.footerCenterSection);
        /*if (!this.headerSection && source.headerSection)
            this.headerSection=source.headerSection;
        else if (this.headerSection && !source.headerSection)
            this.headerSection = null
        else if (this.headerSection)
            this.headerSection.reload(source.headerSection)*/
        if (!this.sysSection && source.sysSection)
            this.sysSection = source.sysSection;
        else if (this.sysSection && !source.sysSection)
            this.sysSection = null;
        else if (this.sysSection)
            this.sysSection.reload(source.sysSection);
        if (!this.LeftPadXSection && source.LeftPadXSection)
            this.LeftPadXSection = source.LeftPadXSection;
        else if (this.LeftPadXSection && !source.LeftPadXSection)
            this.LeftPadXSection = null;
        else if (this.LeftPadXSection)
            this.LeftPadXSection.reload(source.LeftPadXSection);
        if (!this.LeftPadYSection && source.LeftPadYSection)
            this.LeftPadYSection = source.LeftPadYSection;
        else if (this.LeftPadYSection && !source.LeftPadYSection)
            this.LeftPadYSection = null;
        else if (this.LeftPadYSection)
            this.LeftPadYSection.reload(source.LeftPadYSection);
        if (!this.RightPadXSection && source.RightPadXSection)
            this.RightPadXSection = source.RightPadXSection;
        else if (this.RightPadXSection && !source.RightPadXSection)
            this.RightPadXSection = null;
        else if (this.RightPadXSection)
            this.RightPadXSection.reload(source.RightPadXSection);
        if (!this.RightPadYSection && source.RightPadYSection)
            this.RightPadYSection = source.RightPadYSection;
        else if (this.RightPadYSection && !source.RightPadYSection)
            this.RightPadYSection = null;
        else if (this.RightPadYSection)
            this.RightPadYSection.reload(source.RightPadYSection);
        if (!this.controllerSection && source.controllerSection)
            this.controllerSection = source.controllerSection;
        else if (this.controllerSection && !source.controllerSection)
            this.controllerSection = null;
        else if (this.controllerSection)
            this.controllerSection.reload(source.controllerSection);
    };
    ;
    return DashboardModel;
}());

//# sourceMappingURL=dashboard.model.js.map

/***/ }),

/***/ 190:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__ = __webpack_require__(17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__models_dashboard_model__ = __webpack_require__(19);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DynamicStringComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};




var DynamicStringComponent = (function () {
    function DynamicStringComponent(kerviService, elementRef) {
        this.kerviService = kerviService;
        this.elementRef = elementRef;
        this.inline = false;
    }
    DynamicStringComponent.prototype.ngOnInit = function () {
        var self = this;
        if (!this.parameters)
            this.parameters = this.input.ui;
        this.input.value$.subscribe(function (v) {
            jQuery("input", self.elementRef.nativeElement).val(v).change();
        });
    };
    DynamicStringComponent.prototype.onChange = function (event) {
        console.log("evv", event);
        this.kerviService.spine.sendCommand(this.input.command, event.target.value);
    };
    return DynamicStringComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["c" /* DynamicStringModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__models_dynamicValues_model__["c" /* DynamicStringModel */]) === "function" && _a || Object)
], DynamicStringComponent.prototype, "input", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_3__models_dashboard_model__["b" /* DashboardSectionModel */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__models_dashboard_model__["b" /* DashboardSectionModel */]) === "function" && _b || Object)
], DynamicStringComponent.prototype, "dashboardSection", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Object)
], DynamicStringComponent.prototype, "parameters", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Boolean)
], DynamicStringComponent.prototype, "inline", void 0);
DynamicStringComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'dynamic-value-string',
        template: __webpack_require__(298),
        styles: [__webpack_require__(264)]
    }),
    __metadata("design:paramtypes", [typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__kervi_service__["a" /* KerviService */]) === "function" && _c || Object, typeof (_d = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */]) === "function" && _d || Object])
], DynamicStringComponent);

var _a, _b, _c, _d;
//# sourceMappingURL=string-value.component.js.map

/***/ }),

/***/ 191:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return environment; });
// The file contents for the current environment will overwrite these during build.
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `.angular-cli.json`.
// The file contents for the current environment will overwrite these during build.
var environment = {
    production: false
};
//# sourceMappingURL=environment.js.map

/***/ }),

/***/ 192:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return KerviSpine; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var KerviSpine = (function () {
    function KerviSpine(constructorOptions) {
        this.constructorOptions = constructorOptions;
        this.isConnected = false;
        this.doAuthenticate = false;
        this.sessionId = null;
        this.queryHandlers = [];
        this.commandHandlers = [];
        this.eventHandlers = [];
        this.rpcQueue = {};
        this.ready = false;
        this.messageId = 0;
        this.sensors = {};
        this.controllers = {};
        this.sensorTypes = [];
        this.controllerTypes = [];
        this.pointOfInterests = [];
        this.application = null;
        this.allowAnonymous = true;
        this.firstOnOpen = true;
        this.websocket = null;
        this.options = {
            userName: "anonymous",
            password: null,
            address: null,
            onOpen: null,
            onClose: null,
            onAuthenticate: null,
            onAuthenticateFailed: null,
            onAuthenticateStart: null,
            onLogOff: null,
            autoConnect: true,
            targetScope: null,
            protocol: "ws"
        };
        this.addEventHandler = function (eventName, id, callback) {
            if (id)
                this.eventHandlers.push({ "eventName": eventName + "/" + id, callback: callback });
            else
                this.eventHandlers.push({ "eventName": eventName, callback: callback });
            var cmd = { id: this.messageId++, "messageType": "registerEventHandler", "event": eventName, "eventId": id };
            console.log("add event handler", cmd);
            this.websocket.send(JSON.stringify(cmd));
        };
        console.log("Kervi spine init", this.options, constructorOptions);
        this.options = this.extend(this.options, constructorOptions);
        this.connect();
    }
    KerviSpine.prototype.extend = function () {
        var p = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            p[_i] = arguments[_i];
        }
        for (var i = 1; i < p.length; i++)
            for (var key in p[i])
                if (p[i].hasOwnProperty(key))
                    p[0][key] = p[i][key];
        return p[0];
    };
    KerviSpine.prototype.addRPCCallback = function (id, callback) {
        if (callback)
            this.rpcQueue[id] = callback;
    };
    KerviSpine.prototype.handleRPCResponse = function (message) {
        var callback = this.rpcQueue[message.id];
        if (callback) {
            delete this.rpcQueue[message.id];
            callback.call(this.options.targetScope, message.response, message.response);
        }
    };
    KerviSpine.prototype.handleEvent = function (message) {
        var eventName = message.event;
        var id = message.id;
        var eventPath = eventName;
        if (id) {
            eventPath += "/" + id;
        }
        var value = null;
        if (message.args && message.args.length) {
            value = message.args[0];
        }
        for (var n = 0; (n < this.eventHandlers.length); n++) {
            var h = this.eventHandlers[n];
            if (h.eventName == eventPath)
                h.callback.call(value, id, value);
        }
    };
    KerviSpine.prototype.handleCommand = function (message) {
        console.log("cmd", this, message);
        var command = message.command;
        var args = null;
        if (message.args && message.args.length) {
            args = message.args[0];
        }
        for (var n = 0; (n < this.commandHandlers.length); n++) {
            var c = this.commandHandlers[n];
            if (c.command == command)
                c.callback.call(this, args);
        }
    };
    KerviSpine.prototype.connect = function () {
        if (this.isConnected) {
            console.log("Kervi is connected");
            return;
        }
        var self = this;
        this.websocket = new WebSocket(this.options.protocol + "://" + this.options.userName + ":" + this.options.password + "@" + this.options.address);
        this.websocket.onopen = function (evt) {
            self.onOpen(evt);
        };
        this.websocket.onclose = function (evt) {
            self.onClose(evt);
        };
        this.websocket.onmessage = function (evt) {
            self.onMessage(evt);
        };
        this.websocket.onerror = function (evt) {
            self.onError(evt);
        };
    };
    KerviSpine.prototype.onOpen = function (evt) {
        console.log("Kervi spine on open", this, evt);
        var self = this;
        this.isConnected = true;
        console.log("Kervi spine ready");
    };
    KerviSpine.prototype.onClose = function (evt) {
        console.log("Kervi spine on close", evt);
        this.isConnected = false;
        if (this.options.onClose)
            this.options.onClose.call(this.options.targetScope, evt);
        this.firstOnOpen = true;
        if (this.options.autoConnect) {
            setTimeout(1000, this.connect());
        }
    };
    KerviSpine.prototype.authenticate = function (userName, password) {
        this.options.userName = userName;
        this.options.password = password;
        if (this.options.onAuthenticateStart)
            this.options.onAuthenticateStart.call(this.options.targetScope);
        var cmd = { id: this.messageId++, "messageType": "authenticate", "userName": this.options.userName, "password": this.options.password };
        this.websocket.send(JSON.stringify(cmd));
    };
    KerviSpine.prototype.logoff = function () {
        //this.options.userName = this.allowAnonymous ? "anonymous" : null;
        //this.options.password = null;
        var cmd = { id: this.messageId++, "messageType": "logoff", "session": this.sessionId };
        this.sessionId = null;
        this.websocket.send(JSON.stringify(cmd));
    };
    KerviSpine.prototype.onMessage = function (evt) {
        //console.log("on m",evt.data);
        var message = JSON.parse(evt.data);
        var self = this;
        if (message.messageType == "authenticate") {
            console.log("authenticate");
            this.doAuthenticate = true;
            if (this.options.userName)
                this.authenticate(this.options.userName, this.options.password);
            else
                this.options.onAuthenticate.call(this.options.targetScope, evt);
        }
        else if (message.messageType == "authentication_failed") {
            console.log("authentication failed", this.options.userName);
            if (this.options.userName == "anonymous") {
                this.allowAnonymous = false;
                this.options.userName = null;
                this.options.password = null;
                this.sessionId = null;
                console.log("x", self.options);
                if (self.options.onLogOff) {
                    console.log("x1");
                    self.options.onLogOff.call(self.options.targetScope, evt);
                }
            }
            else
                this.options.onAuthenticateFailed.call(this.options.targetScope, evt);
        }
        else if (message.messageType == "session_authenticated") {
            var date = new Date();
            date.setTime(date.getTime() + (2 * 60 * 60 * 1000));
            var expires = "; expires=" + date.toUTCString();
            this.sessionId = message.session;
            document.cookie = "kervisession" + "=" + message.session + expires + "; path=/";
            setTimeout(function () {
                if (self.options.onOpen)
                    self.options.onOpen.call(self.options.targetScope, self.firstOnOpen, evt);
                self.firstOnOpen = false;
            }, 100);
        }
        else if (message.messageType == "session_logoff") {
            if (self.options.onLogOff)
                self.options.onLogOff.call(self.options.targetScope, evt);
            if (this.allowAnonymous && this.options.userName != "anonymous") {
                this.authenticate("anonymous", null);
            }
            else {
                self.options.userName = null;
                self.options.password = null;
                self.sessionId = null;
            }
        }
        else if (message.messageType == "response")
            this.handleRPCResponse(message);
        else if (message.messageType == "event")
            this.handleEvent(message);
        else if (message.messageType == "command")
            this.handleCommand(message);
        else
            console.log("Kervi spine message unknown", this.rpcQueue, evt);
    };
    KerviSpine.prototype.onError = function (evt) {
        console.log("Kervi on error", evt);
    };
    KerviSpine.prototype.addCommandHandler = function (command, callback) {
        this.commandHandlers.push({ command: command, callback: callback });
        var cmd = { id: this.messageId++, "messageType": "registerCommandHandler", "command": command };
        this.websocket.send(JSON.stringify(cmd));
    };
    ;
    KerviSpine.prototype.addQueryHandler = function (query, callback) {
        this.queryHandlers.push({ query: query, callback: callback });
        var cmd = { id: this.messageId++, "messageType": "registerQueryHandler", "query": query };
        this.websocket.send(JSON.stringify(cmd));
    };
    ;
    KerviSpine.prototype.sendCommand = function (command) {
        var p = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            p[_i - 1] = arguments[_i];
        }
        console.log("sec", arguments);
        var args = [];
        var callback = null;
        for (var i = 0; (i < p.length); i++) {
            if (p[i] instanceof Function)
                callback = p[i];
            else
                args.push(p[i]);
        }
        /*if (p.length>1){
            var argOffset=1;
            if ( callback && callback instanceof Function )
                argOffset+=1;
            for (var i=argOffset;(i<arguments.length);i++){
                args.push(arguments[i]);
            }
        }*/
        var cmd = { id: this.messageId++, "messageType": "command", "command": command, "args": args };
        if (callback && callback instanceof Function)
            this.addRPCCallback(cmd.id.toString(), callback);
        console.log("sendCommand", this, cmd);
        this.websocket.send(JSON.stringify(cmd));
    };
    ;
    KerviSpine.prototype.sendQuery = function (query) {
        var p = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            p[_i - 1] = arguments[_i];
        }
        var args = [];
        var callback = null;
        for (var i = 0; (i < p.length); i++) {
            if (p[i] instanceof Function)
                callback = p[i];
            else
                args.push(p[i]);
        }
        var cmd = { id: this.messageId++, "messageType": "query", "query": query, "args": args };
        this.addRPCCallback(cmd.id.toString(), callback);
        console.log("sendQuery", p, this, callback, cmd);
        this.websocket.send(JSON.stringify(cmd));
    };
    ;
    KerviSpine.prototype.triggerEvent = function (eventName, id) {
        var e = { id: this.messageId++, "messageType": "event", "event": eventName, "args": arguments };
        this.websocket.send(JSON.stringify(e));
    };
    ;
    return KerviSpine;
}());

//# sourceMappingURL=kervi-spine.js.map

/***/ }),

/***/ 20:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TemplateService; });
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};

var TemplateService = (function () {
    function TemplateService() {
        console.log("kervi service constructor");
        //console.log("ctemplate");
    }
    TemplateService.prototype.getStyleRuleValue = function (style, selector, sheet) {
        var sheets = sheet != null ? [sheet] : document.styleSheets;
        for (var i = 0, l = sheets.length; i < l; i++) {
            var sheet = sheets[i];
            if (!sheet.cssRules) {
                continue;
            }
            for (var j = 0, k = sheet.cssRules.length; j < k; j++) {
                var rule = sheet.cssRules[j];
                if (rule.selectorText && rule.selectorText.split(',').indexOf(selector) !== -1) {
                    return rule.style[style];
                }
            }
        }
        return null;
    };
    TemplateService.prototype.makeId = function () {
        var text = "";
        var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
        for (var i = 0; i < 5; i++)
            text += possible.charAt(Math.floor(Math.random() * possible.length));
        return text;
    };
    TemplateService.prototype.getColor = function (colorName, cssClass) {
        var styleValue = this.getStyleRuleValue(colorName, cssClass, null);
        //console.log("sv", cssClass,styleValue);
        return styleValue;
    };
    return TemplateService;
}());
TemplateService = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["c" /* Injectable */])(),
    __metadata("design:paramtypes", [])
], TemplateService);

//# sourceMappingURL=template.service.js.map

/***/ }),

/***/ 246:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 247:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, ".page-header{\r\n    position:relative;\r\n    z-index:2000;\r\n    \r\n}\r\n\r\ndashboard-sections{\r\n    \r\n}\r\n\r\n.dashboard-sections-hidden{\r\n    display: none;\r\n}", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 248:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 249:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 250:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 251:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 252:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "nav {\n  color: white; }\n", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 253:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 254:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 255:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "#video-viewer {\n  margin-top: -20px; }\n\n.cam-pad-area {\n  z-index: 1200;\n  vertical-align: middle;\n  width: 200px;\n  display: inline-block;\n  position: absolute;\n  left: 389px;\n  top: 132px;\n  color: white; }\n", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 256:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 257:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 258:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "#video-viewer {\n  margin-top: -20px; }\n\n.cam-pad-area {\n  z-index: 1200;\n  vertical-align: middle;\n  width: 200px;\n  display: inline-block;\n  position: absolute;\n  left: 389px;\n  top: 132px;\n  color: white; }\n", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 259:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 260:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 261:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 262:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 263:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 264:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/*** EXPORTS FROM exports-loader ***/
module.exports = module.exports.toString();

/***/ }),

/***/ 280:
/***/ (function(module, exports) {

module.exports = "<router-outlet></router-outlet>"

/***/ }),

/***/ 281:
/***/ (function(module, exports) {

module.exports = "<!--{{isConnected}} {{doAuthenticate}} {{isAuthenticated}} {{inAuthentication}}-->\n<div *ngIf=\"isConnected && doAuthenticate && !isAuthenticated && !inAuthentication\" style=\"line-height: 1;width:266px;height:200px;background:rgba(255,255,255,0);border-radius: 4px;position: absolute; top:40%;left:50%;margin: -133px 0 0 -128px;padding:10px\">\n  <form class=\"form\" [formGroup]=\"loginForm\"  \n        (ngSubmit)=\"onSubmit(loginForm.value)\"  \n        class=\"form\"  \n        [class.error]=\"!loginForm.valid && loginForm.touched\">\n \n    <div class=\"form-group\"  \n        [class.error]=\"!userName.valid && userName.touched\">  \n      <!--<label class=\"control-label\" for=\"userNameInput\">User name</label>  -->\n      <input type=\"text\"  \n             id=\"userNameInput\"  \n             placeholder=\"User name\"  \n             [formControl]=\"userName\"\n             class=\"form-control\"\n             autofocus>  \n         \n    </div>\n\n    <div class=\"form-group\"  [class.error]=\"!password.valid && password.touched\">  \n      <!--<label class=\"control-label\" for=\"passwordInput\">Password</label>  -->\n      <input type=\"password\"  \n             id=\"passwordInput\"  \n             placeholder=\"Password\"  \n             [formControl]=\"password\"\n             class=\"form-control\">  \n    </div>\n    <div *ngIf=\"invalidUser\" class=\"ui error message\"><p>Invalid user name or password</p></div>\n \n    <button type=\"submit\" class=\"btn btn-primary\">Log on</button>  \n  </form>  \n\n\n</div>\n\n<div *ngIf=\"!isConnected\" style=\"line-height: 1;width:266px;height:256px;background:rgba(255,255,255,1);border-radius: 4px;position: absolute; top:40%;left:50%;margin: -133px 0 0 -128px\">\n  \n  <img \n  src=\"data:image/png;base64, \"\n  />\n  \n  <span style=\"font-size:800%\" >Kervi</span><br>\n  Connecting, please wait \n  <div class='uil-facebook-css' style='-webkit-transform:scale(0.08);display: inline-block; top:-12px;width:0;height:0'><div></div><div></div><div></div></div>\n</div>\n"

/***/ }),

/***/ 282:
/***/ (function(module, exports) {

module.exports = "    <ng-container *ngFor=\"let component of controller.inputs\">\n      <ng-container *ngIf=\"component.visible\">\n        <ng-container [ngSwitch]=\"component.type\">\n          <ng-template ngSwitchCase=\"dynamic-number\">\n            <dynamic-value [dashboardSection]=\"dashboardSection\" [value]=\"component\"></dynamic-value>\n          </ng-template>\n        </ng-container>\n      </ng-container>\n    </ng-container>\n"

/***/ }),

/***/ 283:
/***/ (function(module, exports) {

module.exports = "<div *ngIf=\"!inline\" [ngClass]=\"{'has-card-header': showHeader}\"  class=\"card {{sectionClassWidth}} \">\r\n    <div class=\"card-header\" *ngIf=\"showHeader\">\r\n        <h4 class=\"text-right\">\r\n            &nbsp;{{title}}\r\n            <a data-toggle=\"collapse\" role=\"tab\" href=\"#section-{{section.id}}\" [attr.aria-expanded]=\"expanded\" aria-control=\"\" style=\"float:left\"> <i class=\"fa fa-chevron-right\" aria-hidden=\"true\"></i> </a>\r\n            <div class=\"card-block\" *ngIf=\"headerComponents.length>0\" style=\"float:right;padding:0\"    >\r\n                <ng-container *ngFor=\"let sectionComponent of headerComponents\">\r\n                    <kervi-controller [dashboardSection]=\"section\" [controller]=\"sectionComponent.component\" [parameters]=\"sectionComponent.parameters\" *ngIf=\"sectionComponent.component && sectionComponent.component.componentType=='controller'\" ></kervi-controller>\r\n                    <dynamic-value [dashboardSection]=\"section\" [value]=\"sectionComponent.component\" [parameters]=\"sectionComponent.parameters\"  *ngIf=\"sectionComponent.component && sectionComponent.component.componentType=='DynamicValue'\" ></dynamic-value>\r\n                    <kervi-sensor [dashboardSection]=\"section\" [sensor]=\"sectionComponent.component\" [parameters]=\"sectionComponent.parameters\" *ngIf=\"sectionComponent.component && sectionComponent.component.componentType=='sensor'\" ></kervi-sensor>\r\n                </ng-container>\r\n            </div>\r\n        </h4>\r\n  </div>\r\n    <div id=\"section-{{section.id}}\" role=\"tabpanel\" [ngClass]=\"{'in': expanded}\" class=\"collapse  {{sectionClassHeight}} \" *ngIf=\"showHeader\" style=\"overflow:auto\">\r\n        <div class=\"card-block\" *ngIf=\"components.length>0\" >\r\n            <ng-container *ngFor=\"let sectionComponent of components\">\r\n                <kervi-controller [dashboardSection]=\"section\" [controller]=\"sectionComponent.component\" [parameters]=\"sectionComponent.parameters\" *ngIf=\"sectionComponent.component && sectionComponent.component.componentType=='controller'\" ></kervi-controller>\r\n                <dynamic-value [dashboardSection]=\"section\" [value]=\"sectionComponent.component\" [parameters]=\"sectionComponent.parameters\"  *ngIf=\"sectionComponent.component && sectionComponent.component.componentType=='DynamicValue'\" ></dynamic-value>\r\n                <kervi-sensor [dashboardSection]=\"section\" [sensor]=\"sectionComponent.component\" [parameters]=\"sectionComponent.parameters\" *ngIf=\"sectionComponent.component && sectionComponent.component.componentType=='sensor'\" ></kervi-sensor>\r\n            </ng-container>\r\n        </div>\r\n        \r\n        <div class=\"card-block\" *ngIf=\"section.parameters.userLog\"  >\r\n            <table class=\"table\">\r\n                <thead>\r\n                <tr>\r\n                    <th>&nbsp;</th>\r\n                    <th>Time</th>\r\n                    <th>component</th>\r\n                    <th>topic</th>\r\n                </tr>\r\n                </thead>\r\n                <tbody>\r\n                    <tr *ngFor=\"let message of messages$ | async\">\r\n                        <td>\r\n                            <span *ngIf=\"message.level<3\" class=\"alert\" [ngClass]=\"{'text-danger': message.level==1, 'text-warning': message.level==2}\" >&#11044;</span>\r\n                        </td>\r\n                        <td>{{message.timestamp | date: 'HH:mm:ss'}}</td>\r\n                        <td>{{message.sourceName}}</td>\r\n                        <td>{{message.topic}}</td>\r\n                    </tr>\r\n                </tbody>\r\n            </table>\r\n            \r\n        </div>    \r\n    </div>\r\n    \r\n    <div class=\"card-block {{sectionClassHeight}} \" *ngIf=\"!showHeader\" style=\"overflow:auto\">\r\n        <ng-container *ngFor=\"let sectionComponent of components\">\r\n            <kervi-controller [dashboardSection]=\"section\" [controller]=\"sectionComponent.component\" [parameters]=\"sectionComponent.component && sectionComponent.parameters\" *ngIf=\"sectionComponent.component.componentType=='controller'\" ></kervi-controller>\r\n            <dynamic-value [dashboardSection]=\"section\" [value]=\"sectionComponent.component\" [parameters]=\"sectionComponent.component && sectionComponent.parameters\"  *ngIf=\"sectionComponent.component.componentType=='DynamicValue'\" ></dynamic-value>\r\n            <kervi-sensor [dashboardSection]=\"section\" [sensor]=\"sectionComponent.component\" [parameters]=\"sectionComponent.component && sectionComponent.parameters\" *ngIf=\"sectionComponent.component.componentType=='sensor'\" ></kervi-sensor>\r\n        </ng-container>\r\n    </div>\r\n    \r\n</div>\r\n<ng-template [ngIf]=\"inline && section.components.length>0\" style=\"display:inline-block\">\r\n        <ng-container *ngFor=\"let sectionComponent of section.components\" style=\"display:inline-block\">\r\n            <kervi-controller  [dashboardSection]=\"section\" [controller]=\"sectionComponent.component\" [parameters]=\"sectionComponent.parameters\" *ngIf=\"sectionComponent.component && sectionComponent.component.componentType=='controller'\" ></kervi-controller>\r\n            <dynamic-value  [dashboardSection]=\"section\" [inline]=\"inline\" [value]=\"sectionComponent.component\" [parameters]=\"sectionComponent.parameters\"  *ngIf=\"sectionComponent.component && sectionComponent.component.componentType=='DynamicValue'\" ></dynamic-value>\r\n            <kervi-sensor  [dashboardSection]=\"section\" [inline]=\"inline\" [sensor]=\"sectionComponent.component\" [parameters]=\"sectionComponent.parameters\" *ngIf=\"sectionComponent.component && sectionComponent.component.componentType=='sensor'\" ></kervi-sensor>\r\n        </ng-container>\r\n</ng-template>"

/***/ }),

/***/ 284:
/***/ (function(module, exports) {

module.exports = "<nav class=\"navbar row navbar-toggleable-md navbar-fixed-top navbar-light bg-faded page-header\">\n\t<div class=\"row\" style=\"width:100%\">\n\t\t<div class=\" col-sm-4\">\n\t\t\t<ul class=\"navbar-nav flex-nowrap flex-row\" >\n\t\t\t\t<li class=\"nav-item dropdown\">\n\t\t\t\t\t<a *ngIf=\"showMenu\" class=\"nav-link\" title=\"Dashboards\" style=\"padding-top:0;cursor: pointer\" data-toggle=\"dropdown\"><i class=\"fa fa-bars fa-lg\" aria-hidden=\"true\"></i></a>\n\t\t\t\t\t<div  class=\"dropdown-menu  multi-leve ul.nav.navbar-nav.no-collapse\">\n\t\t\t\t\t\t<!--<span class=\"dropdown-divider\">&nbsp; Dashboards</span>-->\n\t\t\t\t\t\t<div class=\"dropdown-submenu\">\n\t\t\t\t\t\t\t<ng-container *ngIf=\"dashboardCount > 1\">\n\t\t\t\t\t\t\t<a  *ngFor=\"let dashboard of (dashboards$ | async)\" class=\"dropdown-item\" [routerLink]=\"['/dashboard', dashboard.id]\">{{dashboard.name}}</a>\n\t\t\t\t\t\t\t</ng-container>\n\t\t\t\t\t\t\t<div *ngIf=\"authenticated && dashboardCount > 1\" class=\"dropdown-divider\"></div>\n\t\t\t\t\t\t\t<a *ngIf=\"authenticated && anonymous\" href=\"javascript: return false;\" (click)=\"logoff($event)\" class=\"dropdown-item\" >Log in</a>\n\t\t\t\t\t\t\t<a *ngIf=\"authenticated && !anonymous\" href=\"javascript: return false;\" (click)=\"logoff($event)\" class=\"dropdown-item\" >Log out</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t\t<li class=\"nav-item\" *ngIf=\"showSectionController\">\n\t\t\t\t\t<a style=\"padding-top:0; display:inline-block\" class=\"nav-link btn\" (click)=\"dashboardSectionsHidden = !dashboardSectionsHidden;\"><i class=\"fa fa-sliders fa-lg\" aria-hidden=\"true\"></i>{{dashboardSectionsVisible}}</a>\n\t\t\t\t</li>\n\t\t\t\t<li *ngIf=\"dashboard\" style=\"display:inline-block;white-space:nowrap\">&nbsp;&nbsp;&nbsp;{{dashboard.name}}</li>\n\t\t\t</ul>\n\t\t</div>\t\n\t\t<div *ngIf=\"dashboard && dashboard.sysSection\" class=\"col-sm-8 core-sensors text-xs-center text-sm-right\" style=\"display:inline-block\">\n\t\t\t\t&nbsp;<kervi-dashboard-section [inline]=\"true\" [section]=\"dashboard.sysSection\" ></kervi-dashboard-section>\n\t\t</div>\n\t</div>\n</nav>\n\n<ng-container *ngIf=\"dashboard && dashboard.template\">\n\t<!--<dashboard-layout [dashboard]=\"dashboard\"></dashboard-layout>-->\n</ng-container>\n<div *ngIf=\"dashboard && !dashboard.template\" style=\"position:relative;margin-top:20px;\">\n\t<kervi-cam-viewer *ngIf=\"cameraId\" [isBackground]=\"true\" [cameraId]=\"cameraId\" [parameters]=\"cameraParameters\"></kervi-cam-viewer>\n\t<div id=\"controller-pads\">\n\t\t<div *ngIf=\"showLeftPad\" class=\"left-pad-area\" style=\"position:fixed;\" (mousedown)=\"padPress('left')\" (mouseup)=\"padRelease('left')\">\n\t\t\t<fieldset id=\"leftPad\" style=\"position:absolute\" class=\"pad\" [attr.data-width]=\"padSize\" [attr.data-height]=\"padSize\">\n\t\t\t\t<legend></legend>\n\t\t\t\t<input type=\"hidden\" id=\"left-pad-x\" name=\"left-x\" value=\"0\"><input type=\"hidden\" id=\"left-pad-y\" name=\"left-y\" value=\"0\">\n\t\t\t</fieldset>\n\t\t</div>\n\t\t<div *ngIf=\"showRightPad\" class=\"right-pad-area\" style=\"position:fixed\" (mousedown)=\"padPress('right')\" (mouseup)=\"padRelease('right')\">\n\t\t\t<fieldset id=\"rightPad\" style=\"position:absolute\" class=\"pad\" [attr.data-width]=\"padSize\" [attr.data-height]=\"padSize\">\n\t\t\t\t<legend></legend>\n\t\t\t\t<input id=\"right-pad-x\" type=\"hidden\" name=\"right-x\" value=\"0\"> <input type=\"hidden\" id=\"right-pad-y\" name=\"right-y\" value=\"0\">\n\t\t\t</fieldset>\n\t\t</div>\n\t</div>\n\t<div class=\"container-fluid\" style=\"top:0;padding-top:10px;z-index:1999;position:absolute\" >\n\t\t<div class=\"card-columns\" [ngClass]=\"{'dashboard-sections-hidden' : dashboardSectionsHidden }\">\n\t\t\t<kervi-dashboard-section *ngFor=\"let section of dashboard.sections\" [section]=\"section\"></kervi-dashboard-section>\n\t\t</div>  \n\t</div>\n</div>\n<footer class=\"footer\" *ngIf=\"dashboard\">\n\t\t<div class=\"row\">\n\t\t\t<div class=\"col-sm-4 text-left\" style=\"text-align: left\">\n\t\t\t\t<kervi-dashboard-section [inline]=\"true\" *ngIf=\"dashboard.footerLefSection\" [section]=\"dashboard.footerLeftSection\"></kervi-dashboard-section>\n\t\t\t</div>\n\t\t\t<div class=\"col-sm-4 text-center\" style=\"text-align:center\">\n\t\t\t\t<kervi-dashboard-section [inline]=\"true\" *ngIf=\"dashboard.footerCenterSection\" [section]=\"dashboard.footerCenterSection\"></kervi-dashboard-section>\n\t\t\t</div>\n\t\t\t<div class=\"col-sm-4 text-right\" style=\"text-align: right\">\n\t\t\t\t<kervi-dashboard-section [inline]=\"true\" *ngIf=\"dashboard.footerRightSection\" [section]=\"dashboard.footerRightSection\"></kervi-dashboard-section>\n\t\t\t</div>\n\t\t</div>\n\t</footer>"

/***/ }),

/***/ 285:
/***/ (function(module, exports) {

module.exports = "<li class=\"nav-item dropdown\">\r\n\t<a class=\"nav-link\" title=\"Dashboards\" style=\"padding-top:0;cursor: pointer\" data-toggle=\"dropdown\"><i class=\"fa fa-bars fa-lg\" aria-hidden=\"true\"></i></a>\r\n\t<div class=\"dropdown-menu  multi-leve ul.nav.navbar-nav.no-collapse\">\r\n\t\t\t<!--<span class=\"dropdown-divider\">&nbsp; Dashboards</span>-->\r\n\t\t\t<div class=\"dropdown-submenu\">\r\n\t\t\t\t\t<a *ngFor=\"let dashboard of (dashboards$ | async)\" class=\"dropdown-item\" [routerLink]=\"['/dashboard', dashboard.id]\">{{dashboard.name}}</a>\r\n\t\t\t</div>\r\n\t\t<!--<div class=\"dropdown-divider\"></div>-->\r\n\t\t<!--<a class=\"dropdown-item\" href=\"#/charts\">Charts</a>-->\r\n\t\t<!--<a class=\"dropdown-item\" href=\"#/about\">About</a>-->\r\n\t\t<!--<a class=\"dropdown-item\" href=\"#/settings\">Settings</a>-->\r\n\t</div>\r\n</li>\r\n\t\t"

/***/ }),

/***/ 286:
/***/ (function(module, exports) {

module.exports = "\n<ng-container *ngIf=\"sensor.subSensors.length == 0\">\n    <dynamic-value-number [inline]=\"inline\" [input]=\"sensor.value\" [parameters]=\"parameters\" [dashboardSection]=\"dashboardSection\"></dynamic-value-number>\t\n</ng-container>\n<ng-container *ngIf=\"sensor.subSensors.length > 0\">\n\t<div >\n\t\t<div>\n\t\t\t<i *ngIf=\"parameters.labelIcon\" class=\"fa fa-{{currentIcon}}\"></i>\n\t\t\t<span *ngIf=\"parameters.label\">{{parameters.label}}:</span>\n\t\t</div>\n\t\t<ng-container *ngFor=\"let subSensor of sensor.subSensors\">\n\t\t\t<div style=\"padding-left:15px;clear:both\">\n\t\t\t\t<kervi-sensor [inline]=\"lnline\" [sensor]=\"subSensor\" ></kervi-sensor>\n\t\t\t</div>\n\t\t</ng-container>\n\t</div>\n</ng-container>"

/***/ }),

/***/ 287:
/***/ (function(module, exports) {

module.exports = "<a *ngIf=\"!inline\" class=\"btn btn-primary pull-right\" [style.width.%]=\"parameters.inputSize\" [ngClass]=\"{'btn-primary-hover': (value.value$ | async)}\" (mousedown)=\"press()\" (mouseup)=\"release()\" [attr.title]=\"value.name\">\r\n    <i *ngIf=\"parameters.buttonIcon\" class='fa fa-{{parameters.buttonIcon}}'></i>\r\n    <ng-container *ngIf=\"parameters.buttonText\" >{{ parameters.buttonText}}</ng-container>\r\n</a>\r\n\r\n<a *ngIf=\"inline\" class=\"btn btn-primary\" [ngClass]=\"{'btn-primary-hover': (value.value$ | async)}\" (mousedown)=\"press()\" (mouseup)=\"release()\" [attr.title]=\"value.name\">\r\n    <i *ngIf=\"parameters.buttonIcon\" class='fa fa-{{parameters.buttonIcon}}'></i>\r\n    <ng-container *ngIf=\"parameters.buttonText\" >{{ parameters.buttonText}}</ng-container>\r\n</a>\r\n"

/***/ }),

/***/ 288:
/***/ (function(module, exports) {

module.exports = "<ng-container *ngIf=\"isBackground\">\r\n\t<div id=\"video-viewer\" class=\"video\" style=\"positionx:relative;width:100%;\">\r\n\t\t<span class=\"camImage\" style=\"top:0px;left:0px;height:100%;width:100%\">\r\n\t\t\t<kervi-mpeg-viewer   [cameraSource]=\"(cameraSource$ | async)\" > </kervi-mpeg-viewer>\r\n\t\t</span>\r\n\t\t<canvas id=\"camCanvas\" style=\"position:absolute;top:0px;left:0px;width:100%;height:100%\"></canvas>\r\n\t\t<canvas id=\"poiCanvas\" style=\"position:absolute;top:0px;left:0px;width:100%;height:100%\"></canvas>\r\n\t\t<div class=\"cam-pad-area\" style=\"display:none\">\r\n\t\t\t<fieldset id=\"camPad\" class=\"pad\" [attr.data-width]=\"padSize\" [attr.data-height]=\"padSize\">\r\n\t\t\t\t<legend></legend>\r\n\t\t\t\tpan : <input id=\"cam-servo-pan\" name=\"x\" value=\"0\"> tilt : <input id=\"cam-servo-tilt\" name=\"y\" value=\"0\">\r\n\t\t\t</fieldset>\r\n\t\t</div>\r\n\t</div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"!isBackground\">\r\n\t<div id=\"video-viewer\" class=\"video\" style=\"position:relative;width:100%\">\r\n\t\t<span class=\"camImage\" style=\"top:0px;left:0px;height:100%;width:100%\">\r\n\t\t\t<kervi-mpeg-viewer  [cameraSource]=\"(cameraSource$ | async)\" > </kervi-mpeg-viewer>\r\n\t\t</span>\r\n\t\t<canvas id=\"camCanvas\" style=\"position:absolute;top:0px;left:0px;width:100%;height:100%\"></canvas>\r\n\t\t<canvas id=\"poiCanvas\" style=\"position:absolute;top:0px;left:0px;width:100%;height:100%\"></canvas>\r\n\t\t<div class=\"cam-pad-area\" style=\"position:absolute\">\r\n\t\t\t<fieldset id=\"camPad\" style=\"position:absolute\" class=\"pad\" [attr.data-width]=\"padSize\" [attr.data-height]=\"padSize\">\r\n\t\t\t\t<legend></legend>\r\n\t\t\t\tpan : <input id=\"cam-servo-pan\" name=\"x\" value=\"0\"> tilt : <input id=\"cam-servo-tilt\" name=\"y\" value=\"0\">\r\n\t\t\t</fieldset>\r\n\t\t</div>\r\n\t</div>\r\n</ng-container>"

/***/ }),

/***/ 289:
/***/ (function(module, exports) {

module.exports = "<div style=\"width:100%;height:100%\">\r\n    <div class=\"row\">\r\n        <div class=\"col-sm-6\">\r\n            {{parameters.label}}\r\n        </div>\r\n        <div class=\"col-sm-6 text-right\">\r\n            <div class=\"btn-group btn-group-sm\" role=\"group\" aria-label=\"Basic example\">\r\n                <button type=\"button\" class=\"btn btn-primary btn-sm\"><i class=\"fa fa-chevron-left\" aria-hidden=\"true\" (click) = \"movePeriod(-1)\"></i></button>\r\n                <button type=\"button\" class=\"btn btn-primary btn-sm\"><i class=\"fa fa-chevron-right\" aria-hidden=\"true\" (click) = \"movePeriod(1)\"></i></button>\r\n                <button type=\"button\" class=\"btn btn-primary btn-sm\" title=\"live\" (click) = \"goLive()\"><i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"></i></button>\r\n                <div class=\"btn-group\" role=\"group\">\r\n                    <button class=\"btn btn-primary dropdown-toggle\" type=\"button\" id=\"dropdownMenuButton\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\r\n                        {{selectedPeriodText}}\r\n                    </button>\r\n                    <div class=\"dropdown-menu\" aria-labelledby=\"dropdownMenuButton\">\r\n                        <span class=\"dropdown-item\" href=\"#\" (click)=\"selectPeriod('5min')\" >5 min</span>\r\n                        <span class=\"dropdown-item\" href=\"#\" (click)=\"selectPeriod('15min')\" >15 min</span>\r\n                        <span class=\"dropdown-item\" href=\"#\" (click)=\"selectPeriod('30min')\" >30 min</span>\r\n                        <span class=\"dropdown-item\" href=\"#\" (click)=\"selectPeriod('hour')\" >Hour</span>\r\n                        <span class=\"dropdown-item\" href=\"#\" (click)=\"selectPeriod('day')\">Day</span>\r\n                        <span class=\"dropdown-item\" href=\"#\" (click)=\"selectPeriod('week')\">Week</span>\r\n                        <span class=\"dropdown-item\" href=\"#\" (click)=\"selectPeriod('month')\">Month</span>\r\n                        <span class=\"dropdown-item\" href=\"#\" (click)=\"selectPeriod('hour')\">Year</span>\r\n                    </div>\r\n                    \r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div id=\"wrapper\" style=\"\">\r\n        <canvas id=\"{{canvasId}}\" class=\"sensor-canvas\"></canvas>\r\n    </div>\r\n</div>"

/***/ }),

/***/ 290:
/***/ (function(module, exports) {

module.exports = "<canvas id=\"{{canvasId}}\" class=\"sensor-canvas\" ></canvas>"

/***/ }),

/***/ 291:
/***/ (function(module, exports) {

module.exports = "<img (load)=\"imageReady()\" class=\"camImage\" src=\"{{cameraSource}}\" style=\"width:100%\">\r\n"

/***/ }),

/***/ 292:
/***/ (function(module, exports) {

module.exports = "<input style=\"display:table-cell\" class=\"form-control\" />"

/***/ }),

/***/ 293:
/***/ (function(module, exports) {

module.exports = ""

/***/ }),

/***/ 294:
/***/ (function(module, exports) {

module.exports = "<div *ngIf=\"!inline\" class=\" pull-right\" [style.width.%]=\"parameters.inputSize\" [style.height.px]=\"38\">\r\n    <input type=\"checkbox\" checked=\"\">\r\n</div>    \r\n\r\n\r\n<!--<div *ngIf=\"!inline\" class=\"can-toggle pull-right\" [style.width.%]=\"parameters.inputSize\">\r\n    <input id=\"a\" class=\"\"  type=\"checkbox\" [attr.checked]=\"state ? '' : null\" >\r\n    <label for=\"a\">\r\n        <div class=\"can-toggle__switch\" data-checked=\"<b>On</b>\" data-unchecked=\"Off\"></div>\r\n    </label>\r\n</div>-->\r\n\r\n<div *ngIf=\"inline\" class=\"\" style=\"display:inline-flex\">\r\n    <input type=\"checkbox\" checked=\"\">\r\n</div>"

/***/ }),

/***/ 295:
/***/ (function(module, exports) {

module.exports = "<div *ngIf=\"!inline\" class=\"block-component\"> \r\n    <span  *ngIf=\"parameters.labelIcon\" class=\"fa fa-{{parameters.labelIcon}}\"></span>\r\n    <span  *ngIf=\"parameters.label\"  >{{parameters.label}}</span>\r\n    <kervi-switchbutton [inline]=\"inline\" [value]=\"value\" [parameters]=\"parameters\" *ngIf=\"displayType!='button'\"></kervi-switchbutton>\r\n    <kervi-button [value]=\"value\" [inline]=\"inline\" [parameters]=\"parameters\" *ngIf=\"displayType=='button'\"></kervi-button>\r\n</div>\r\n<div style=\"display:inline-block\" *ngIf=\"inline\" >\r\n    <span  *ngIf=\"parameters.labelIcon\" class=\"fa fa-{{parameters.labelIcon}}\"></span>\r\n    <span *ngIf=\"parameters.label\" >{{parameters.label}}</span>\r\n    <kervi-switchbutton [inline]=\"inline\" [value]=\"value\" [parameters]=\"parameters\" *ngIf=\"displayType!='button'\"></kervi-switchbutton>\r\n    <kervi-button [value]=\"value\" [inline]=\"inline\" [parameters]=\"parameters\" *ngIf=\"displayType=='button'\"></kervi-button>\r\n</div>\r\n\r\n\r\n\r\n"

/***/ }),

/***/ 296:
/***/ (function(module, exports) {

module.exports = "\r\n<ng-container [ngSwitch]=\"value.type\">\r\n    <ng-template ngSwitchCase=\"dynamic-number\">\r\n        <dynamic-value-number [parameters]=\"parameters\" [dashboardSection]=\"dashboardSection\" [inline]=\"inline\" [input]=\"value\"></dynamic-value-number>\r\n    </ng-template>\r\n    <ng-template ngSwitchCase=\"dynamic-boolean\">\r\n        <dynamic-value-boolean [parameters]=\"parameters\" [dashboardSection]=\"dashboardSection\" [inline]=\"inline\" [value]=\"value\"></dynamic-value-boolean>\r\n    </ng-template>\r\n    <ng-template ngSwitchCase=\"dynamic-string\">\r\n        <dynamic-value-string [parameters]=\"parameters\" [dashboardSection]=\"dashboardSection\" [inline]=\"inline\" [input]=\"value\"></dynamic-value-string>\r\n    </ng-template>\r\n    <!--<template ngSwitchCase=\"dynamic-input\">\r\n        <kervi-controller-text-input [dashboardSection]=\"dashboardSection\" [input]=\"component\"></kervi-controller-text-input>\r\n    </template>\r\n    <template ngSwitchCase=\"button\">\r\n        <kervi-controller-button [dashboardSection]=\"dashboardSection\" [button]=\"component\"></kervi-controller-button>\r\n    </template>\r\n    <template ngSwitchCase=\"dynamic-boolean\">\r\n        <kervi-controller-switchbutton [dashboardSection]=\"dashboardSection\" [button]=\"component\"></kervi-controller-switchbutton>\r\n    </template>\r\n    <template ngSwitchCase=\"dynamic-enum\">\r\n        <kervi-controller-select [dashboardSection]=\"dashboardSection\" [select]=\"component\"></kervi-controller-select>\r\n    </template>\r\n    <template ngSwitchCase=\"dynamic-datetime\">\r\n        <kervi-controller-datetime [dashboardSection]=\"dashboardSection\" [datetime]=\"component\"></kervi-controller-datetime>\r\n    </template>-->\r\n</ng-container>\r\n"

/***/ }),

/***/ 297:
/***/ (function(module, exports) {

module.exports = "<div *ngIf=\"displayType=='slider' && !inline\" class=\"block-component\" style=\"vertical-align:middle;display:table;width:100%\"> \r\n    <div style=\"display:inline-block\" [style.width.%]=\"100 - parameters.inputSize - parameters.valueSize\" [style.max-width.%]=\"100 - parameters.inputSize - parameters.valueSize\">\r\n        <span   *ngIf=\"parameters.labelIcon\" class=\"fa fa-{{parameters.labelIcon}}\"></span>\r\n        <span   *ngIf=\"parameters.label\">{{parameters.label}}</span>\r\n\t</div>\r\n    <div style=\"display:inline-block\" [style.width.%]=\"parameters.inputSize\" [style.max-width.%]=\"parameters.inputSize\">\r\n        <ui-slider [value]=\"input\" [parameters]=\"parameters\"></ui-slider>\r\n\t</div>\r\n    <div style=\"display:inline;float:right\" [style.width.%]=\"parameters.valueSize\" [style.max-width.%]=\"parameters.valueSize\"    class=\"slider-value\">\r\n        <span>{{(input.value$ | async)}}</span>\r\n    </div>\r\n    \r\n</div>\r\n\r\n<div *ngIf=\"displayType=='slider' && inline\" class=\"inline-component\"> \r\n    <div style=\"display:inline-block\">\r\n        <span style=\"display:inline\"  *ngIf=\"parameters.labelIcon\" class=\"fa fa-{{parameters.labelIcon}}\"></span>\r\n        <span style=\"display:inline\"  *ngIf=\"parameters.label\"  >{{parameters.label}}</span>\r\n\t</div>\r\n    <div style=\"display:inline-block\" class=\"slider-inline\"  [style.max-width.%]=\"parameters.inputSize\">\r\n        <ui-slider [value]=\"input\" [parameters]=\"parameters\"></ui-slider>\r\n\t</div>\r\n    <span style=\"display:inline\"  [style.max-width.%]=\"parameters.valueSize\"    class=\"slider-value\">{{(input.value$ | async)}}</span>\r\n</div>\r\n\r\n<span *ngIf=\"displayType=='value' && inline\" class=\"input-inline input-type-value\">\r\n\t\t<i *ngIf=\"parameters.labelIcon\" class=\"fa fa-{{currentIcon}}\"></i>\r\n\t\t<ng-container *ngIf=\"parameters.label\">{{parameters.label}}:</ng-container>\r\n\t\t<i *ngIf=\"currentIcon\" class=\"fa fa-{{currentIcon}}\"></i>\r\n\t\t<value-sparkline *ngIf=\"parameters.showSparkline\" [value]=\"input\"></value-sparkline>\r\n\t\t<span class=\"input-value\">{{(input.value$ | async)}}{{input.unit}}</span>\r\n</span>\r\n\r\n<div *ngIf=\"displayType=='value' && !inline\" class=\"input-block input-type-value\">\r\n    <div style=\"display: inline-block\" *ngIf=\"parameters.label\">{{parameters.label}}:</div>\r\n    <div style=\"display:inline-block; float: right\">\r\n        <i *ngIf=\"currentIcon\" class=\"fa fa-{{currentIcon}}\"></i>\r\n        <value-sparkline *ngIf=\"parameters.showSparkline\" [value]=\"input\"></value-sparkline>\r\n        <span class=\"input-value\">{{(input.value$ | async)}}{{input.unit}}</span>\r\n    </div>\r\n</div>\r\n\r\n<ng-container *ngIf=\"displayType=='gauge'\" class=\"\" >\r\n    <kervi-gauge [value]=\"input\" [parameters]=\"parameters\" [type]=\"gaugeType\" [size]=\"size\"></kervi-gauge>    \r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"displayType=='chart'\" class=\"\" >\r\n    <kervi-chart [value]=\"input\" [parameters]=\"parameters\" [size]=\"size\" ></kervi-chart>\r\n</ng-container>"

/***/ }),

/***/ 298:
/***/ (function(module, exports) {

module.exports = "<div *ngIf=\"parameters.size==0 && !parameters.inline\"   class=\"block-component\">\r\n\t<span  *ngIf=\"parameters.labelIcon\" class=\"fa fa-{{parameters.labelIcon}}\"></span>\r\n    <span *ngIf=\"parameters.label\">{{parameters.label}}</span>\r\n    <input class=\"form-control pull-right\" [style.width.%]=\"parameters.inputSize\" (keyup)=\"onChange($event)\" name=\"{{input.id}}\" value=\"{{(input.value$ | async)}}\"/>\r\n</div>\r\n<div *ngIf=\"parameters.size > 0 || parameters.inline\" style=\"white-space:nowrap\"  >\r\n\t<span  *ngIf=\"parameters.labelIcon\" class=\"fa fa-{{parameters.labelIcon}}\"></span>\r\n    <span *ngIf=\"parameters.label\">{{parameters.label}}</span>\r\n    <input class=\"form-control\" (keyup)=\"onChange($event)\" style=\"display: inline-block\" name=\"{{input.id}}\" [style.width.%]=\"parameters.inputSize\" value=\"{{(input.value$ | async)}}\"/>\r\n</div>"

/***/ }),

/***/ 37:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DashboardsService; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};


//import { ControllersService } from "../controllers/controllers.service";
//import { SensorsService } from "../sensors/sensors.service";

var DashboardsService = (function () {
    function DashboardsService(kerviService) {
        this.kerviService = kerviService;
        this.dashboards = [];
        this._dashboards$ = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__["BehaviorSubject"]([]);
        var self = this;
        var s = this.kerviService.getComponents$().subscribe(function (v) {
            self.dashboards = self.kerviService.getComponentsByType("dashboard");
            console.log("load dashboards", self.dashboards);
            for (var _i = 0, _a = self.dashboards; _i < _a.length; _i++) {
                var dashboard = _a[_i];
                //var dashboard = dashboardComponent as DashboardModel;
                for (var _b = 0, _c = dashboard.sections; _b < _c.length; _b++) {
                    var section = _c[_b];
                    for (var _d = 0, _e = section.components; _d < _e.length; _d++) {
                        var sectionComponent = _e[_d];
                        if (!sectionComponent.component)
                            sectionComponent.component = self.kerviService.getComponent(sectionComponent.componentId);
                    }
                }
                for (var _f = 0, _g = dashboard.sysSection.components; _f < _g.length; _f++) {
                    var sectionComponent = _g[_f];
                    if (!sectionComponent.component)
                        sectionComponent.component = self.kerviService.getComponent(sectionComponent.componentId);
                }
                for (var _h = 0, _j = dashboard.headerSection.components; _h < _j.length; _h++) {
                    var sectionComponent = _j[_h];
                    if (!sectionComponent.component)
                        sectionComponent.component = self.kerviService.getComponent(sectionComponent.componentId);
                }
                for (var _k = 0, _l = dashboard.footerLeftSection.components; _k < _l.length; _k++) {
                    var sectionComponent = _l[_k];
                    if (!sectionComponent.component)
                        sectionComponent.component = self.kerviService.getComponent(sectionComponent.componentId);
                }
                for (var _m = 0, _o = dashboard.footerCenterSection.components; _m < _o.length; _m++) {
                    var sectionComponent = _o[_m];
                    if (!sectionComponent.component)
                        sectionComponent.component = self.kerviService.getComponent(sectionComponent.componentId);
                }
                for (var _p = 0, _q = dashboard.footerRightSection.components; _p < _q.length; _p++) {
                    var sectionComponent = _q[_p];
                    if (!sectionComponent.component)
                        sectionComponent.component = self.kerviService.getComponent(sectionComponent.componentId);
                }
                for (var _r = 0, _s = dashboard.LeftPadXSection.components; _r < _s.length; _r++) {
                    var sectionComponent = _s[_r];
                    if (!sectionComponent.component)
                        sectionComponent.component = self.kerviService.getComponent(sectionComponent.componentId);
                }
                for (var _t = 0, _u = dashboard.LeftPadYSection.components; _t < _u.length; _t++) {
                    var sectionComponent = _u[_t];
                    if (!sectionComponent.component)
                        sectionComponent.component = self.kerviService.getComponent(sectionComponent.componentId);
                }
                for (var _v = 0, _w = dashboard.RightPadXSection.components; _v < _w.length; _v++) {
                    var sectionComponent = _w[_v];
                    if (!sectionComponent.component)
                        sectionComponent.component = self.kerviService.getComponent(sectionComponent.componentId);
                }
                for (var _x = 0, _y = dashboard.RightPadYSection.components; _x < _y.length; _x++) {
                    var sectionComponent = _y[_x];
                    if (!sectionComponent.component)
                        sectionComponent.component = self.kerviService.getComponent(sectionComponent.componentId);
                }
            }
            console.log("load dashboards updated", self.dashboards);
            self._dashboards$.next(self.dashboards);
        });
        this.kerviService.connected$.subscribe(function (v) {
            if (v) {
                self.kerviService.spine.addEventHandler("dashboardLinkChanged", null, function (v) {
                    for (var _i = 0, _a = self.dashboards; _i < _a.length; _i++) {
                        var dashboard = _a[_i];
                        for (var _b = 0, _c = dashboard.sections; _b < _c.length; _b++) {
                            var section = _c[_b];
                            if (section.components) {
                                for (var _d = 0, _e = section.components; _d < _e.length; _d++) {
                                    var component = _e[_d];
                                    if (component.linkId == this.linkId) {
                                        component.parameters[this.name] = this.value;
                                    }
                                }
                            }
                        }
                    }
                });
            }
            ;
        });
    }
    DashboardsService.prototype.refreshDashboards = function () {
        var self = this;
        self._dashboards$.next(this.dashboards);
    };
    /*
        private updateDashboards=function(message){
            if (Array.isArray(message)){
                for (var i=0;(i<message.length);i++){
                    this.updateDashboards(message[i]);
                }
            } else {
                var dashboard=new DashboardModel();
                dashboard.id=message.id;
                dashboard.name=message.name;
                dashboard.type=message.type;
                dashboard.isDefault=message.isDefault;
                dashboard.template=message.template;
                dashboard.sections=[];
                if (!dashboard.template){
                    var template=""
                    for (let messageSection of message.sections){
                        var section=new DashboardSectionModel();
                        section.id=messageSection.id;
                        section.name=messageSection.name;
    
                    }
                }
                this.dashboards.push(dashboard);
            }
        }*/
    DashboardsService.prototype.getDashboards$ = function () {
        return this._dashboards$.asObservable();
    };
    DashboardsService.prototype.getDashboardById = function (id) {
        for (var _i = 0, _a = this.dashboards; _i < _a.length; _i++) {
            var dashboard = _a[_i];
            if (dashboard.id == id)
                return dashboard;
        }
        return null;
    };
    DashboardsService.prototype.getDashboardComponents = function (dashboardId) {
        var result = [];
    };
    return DashboardsService;
}());
DashboardsService = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["c" /* Injectable */])(),
    __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */]) === "function" && _a || Object])
], DashboardsService);

var _a;
//# sourceMappingURL=dashboards.service.js.map

/***/ }),

/***/ 51:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__number_value_number_value_component__ = __webpack_require__(189);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__boolean_value_boolean_value_component__ = __webpack_require__(187);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__string_value_string_value_component__ = __webpack_require__(190);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__dynamic_value_dynamic_value_component__ = __webpack_require__(188);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ui_components_ui_components_module__ = __webpack_require__(98);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ValuesModule; });
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};







var ValuesModule = (function () {
    function ValuesModule() {
    }
    return ValuesModule;
}());
ValuesModule = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["b" /* NgModule */])({
        declarations: [
            __WEBPACK_IMPORTED_MODULE_2__number_value_number_value_component__["a" /* DynamicNumberComponent */],
            __WEBPACK_IMPORTED_MODULE_5__dynamic_value_dynamic_value_component__["a" /* DynamicValueComponent */],
            __WEBPACK_IMPORTED_MODULE_3__boolean_value_boolean_value_component__["a" /* DynamicBooleanComponent */],
            __WEBPACK_IMPORTED_MODULE_4__string_value_string_value_component__["a" /* DynamicStringComponent */]
        ],
        exports: [
            __WEBPACK_IMPORTED_MODULE_2__number_value_number_value_component__["a" /* DynamicNumberComponent */],
            __WEBPACK_IMPORTED_MODULE_5__dynamic_value_dynamic_value_component__["a" /* DynamicValueComponent */],
            __WEBPACK_IMPORTED_MODULE_3__boolean_value_boolean_value_component__["a" /* DynamicBooleanComponent */],
            __WEBPACK_IMPORTED_MODULE_4__string_value_string_value_component__["a" /* DynamicStringComponent */]
        ],
        imports: [
            __WEBPACK_IMPORTED_MODULE_6__ui_components_ui_components_module__["a" /* UIComponentsModule */],
            __WEBPACK_IMPORTED_MODULE_1__angular_common__["a" /* CommonModule */]
        ],
        providers: [],
        bootstrap: []
    }),
    __metadata("design:paramtypes", [])
], ValuesModule);

//# sourceMappingURL=values.module.js.map

/***/ }),

/***/ 569:
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(149);


/***/ }),

/***/ 7:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__kervi_spine__ = __webpack_require__(192);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__models_factory__ = __webpack_require__(177);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return KerviService; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};




var KerviService = (function () {
    function KerviService() {
        this.spine = null;
        this.appInfo = null;
        this.components = [];
        this.components$ = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__["BehaviorSubject"]([]);
        this.doAuthenticate = false;
        this.inAuthentication$ = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__["BehaviorSubject"](false);
        this.connected$ = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__["BehaviorSubject"](false);
        this.IPCReady$ = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__["BehaviorSubject"](false);
        this.authenticationFailed$ = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__["BehaviorSubject"](false);
        console.log("kervi service constructor");
        var self = this;
        this.connected$ = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__["BehaviorSubject"](false);
        this.application$ = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__["BehaviorSubject"](null);
        setInterval(function () {
            if (self.connected$.value) {
                //self.refreshComponents()  
            }
        }, 10000);
        var s1 = this.IPCReady$.subscribe(function (connected) {
            if (connected) {
                self.spine.addEventHandler("dynamicValueChanged", "", function (id, value) {
                    for (var _i = 0, _a = self.components; _i < _a.length; _i++) {
                        var component = _a[_i];
                        if (component.id == value.id) {
                            if (component.componentType == "sensor") {
                                var dynamicValue = component;
                                dynamicValue.value.valueTS = new Date(this.timestamp + " utc");
                                dynamicValue.value.value$.next(value.value);
                                var spl = dynamicValue.value.sparkline$.value;
                                spl.push(value.value);
                                if (spl.length > 10)
                                    spl.shift();
                                dynamicValue.value.sparkline$.next(spl);
                            }
                            else {
                                var dynamicValue = component;
                                dynamicValue.valueTS = new Date(this.timestamp + " utc");
                                dynamicValue.value$.next(value.value);
                            }
                        }
                    }
                });
            }
        });
    }
    KerviService.prototype.refreshComponents = function () {
        var self = this;
        self.spine.sendQuery("getComponentInfo", function (message) {
            console.log("refresh component info", message);
            var components = __WEBPACK_IMPORTED_MODULE_3__models_factory__["a" /* ComponentFactory */].createComponents(message);
            console.log("refresh components", components);
            for (var _i = 0, components_1 = components; _i < components_1.length; _i++) {
                var c = components_1[_i];
                var found = false;
                for (var _a = 0, _b = self.components; _a < _b.length; _a++) {
                    var component = _b[_a];
                    if (component.id == c.id) {
                        found = true;
                        component.reload(c);
                        break;
                    }
                }
                if (!found) {
                    self.components.push(c);
                    console.log("add c", c);
                }
            }
            console.log("delete hanging components");
            var deleteComponents = [];
            for (var _c = 0, _d = self.components; _c < _d.length; _c++) {
                var component = _d[_c];
                var found = false;
                for (var _e = 0, components_2 = components; _e < components_2.length; _e++) {
                    var c = components_2[_e];
                    if (component.id == c.id) {
                        found = true;
                        break;
                    }
                }
                if (!found)
                    deleteComponents.push(component);
            }
            console.log("dc", deleteComponents);
            for (var _f = 0, deleteComponents_1 = deleteComponents; _f < deleteComponents_1.length; _f++) {
                var component = deleteComponents_1[_f];
                self.components.splice(self.components.indexOf(component), 1);
            }
            console.log("refresh done");
            self.components$.next(self.components);
        });
    };
    KerviService.prototype.getComponents$ = function () {
        return this.components$.asObservable();
    };
    KerviService.prototype.getComponent = function (id) {
        for (var _i = 0, _a = this.components; _i < _a.length; _i++) {
            var component = _a[_i];
            if (component.id == id)
                return component;
        }
        return null;
    };
    KerviService.prototype.getComponentsByType = function (type) {
        var result = [];
        for (var _i = 0, _a = this.components; _i < _a.length; _i++) {
            var component = _a[_i];
            if (component.componentType == type)
                result.push(component);
        }
        return result;
    };
    KerviService.prototype.connect = function () {
        var address = null;
        var protocol = "ws";
        try {
            if (kerviSocketAddress) {
                address = kerviSocketAddress;
            }
            if (socketProtocol) {
                protocol = socketProtocol;
            }
        }
        catch (e) {
            //for testing with ng serve
            var httpProtocol = location.protocol;
            if (httpProtocol == "https")
                protocol = "wss";
            var httpHost = window.location.hostname;
            address = httpHost + ":9000";
        }
        console.log("ks", address);
        this.spine = new __WEBPACK_IMPORTED_MODULE_1__kervi_spine__["a" /* KerviSpine */]({
            address: address,
            onOpen: this.onOpen,
            onClose: this.onClose,
            onAuthenticate: this.onAuthenticate,
            onAuthenticateFailed: this.onAuthenticateFailed,
            onLogOff: this.onLogoff,
            onAuthenticateStart: this.onAuthenticateStart,
            targetScope: this,
        });
    };
    KerviService.prototype.isAnonymous = function () {
        return this.spine.options.userName == "anonymous";
    };
    KerviService.prototype.authenticate = function (userName, password) {
        this.authenticationFailed$.next(false);
        this.spine.authenticate(userName, password);
    };
    KerviService.prototype.logoff = function () {
        this.inAuthentication$.next(false);
        this.spine.logoff();
    };
    KerviService.prototype.onAuthenticateStart = function () {
        this.inAuthentication$.next(true);
    };
    KerviService.prototype.onAuthenticate = function () {
        this.doAuthenticate = true;
        this.reset();
    };
    KerviService.prototype.onAuthenticateFailed = function () {
        this.authenticationFailed$.next(true);
        this.inAuthentication$.next(false);
    };
    KerviService.prototype.onLogoff = function () {
        console.log("ol");
        this.doAuthenticate = true;
        this.inAuthentication$.next(false);
        //this.spine.logoff()
        if (this.spine.firstOnOpen)
            this.IPCReady$.next(true);
        this.authenticationFailed$.next(false);
        this.reset();
    };
    KerviService.prototype.reset = function () {
        //this.inAuthentication$.next(false);
        this.components = [];
        this.components$.next(this.components);
        this.connected$.next(false);
    };
    KerviService.prototype.onOpen = function (first) {
        console.log("kervice service on open", this.spine.firstOnOpen, first, this);
        var self = this;
        this.doAuthenticate = this.spine.doAuthenticate;
        this.spine.sendQuery("GetApplicationInfo", function (message) {
            console.log("appinfo", message);
            this.spine.sendQuery("getComponentInfo", function (message) {
                console.log("component info", message);
                self.components = __WEBPACK_IMPORTED_MODULE_3__models_factory__["a" /* ComponentFactory */].createComponents(message);
                self.components$.next(self.components);
                self.application$.next(message);
                self.connected$.next(true);
                //self.inAuthentication$.next(false);
                console.log("components", self.components);
            });
        });
        if (self.spine.firstOnOpen) {
            this.IPCReady$.next(true);
            this.spine.addEventHandler("moduleStarted", "", function () {
                console.log("module loaded", self.components);
                self.refreshComponents();
            });
            this.spine.addEventHandler("moduleStopped", "", function () {
                console.log("module unloaded");
                setTimeout(function () {
                    console.log("module unloaded, refresh");
                    self.refreshComponents();
                }, 5000);
            });
        }
    };
    KerviService.prototype.onClose = function () {
        this.reset();
        console.log("ks on close");
        this.IPCReady$.next(false);
    };
    KerviService.prototype.onHeartbeat = function () {
    };
    KerviService.prototype.onConnect = function () {
    };
    return KerviService;
}());
KerviService = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["c" /* Injectable */])(),
    __metadata("design:paramtypes", [])
], KerviService);

//# sourceMappingURL=kervi.service.js.map

/***/ }),

/***/ 93:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__dashboards_dashboards_service__ = __webpack_require__(37);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_router__ = __webpack_require__(31);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ConnectedService; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};




var ConnectedService = (function () {
    function ConnectedService(kerviService, dashboardsService, router, route) {
        this.kerviService = kerviService;
        this.dashboardsService = dashboardsService;
        this.router = router;
        this.route = route;
        this.isConnected = false;
        this.isAuthenticated = false;
        this.currentPage = null;
        console.log("connected service c");
        var self = this;
        this.kerviService.connect();
        var s = this.kerviService.connected$.subscribe(function (connectedValue) {
            console.log("connected service state", connectedValue, self.isConnected, self);
            if (connectedValue) {
                self.isConnected = true;
                self.isAuthenticated = true;
                if (self.currentPage)
                    self.router.navigate([self.currentPage]);
                else {
                    self.dashboardsService.getDashboards$().subscribe(function (v) {
                        if (v && v.length) {
                            var defaultDashboard = v.filter(function (v) { return v.isDefault; });
                            if (defaultDashboard.length > 0) {
                                console.log("df", defaultDashboard[0].componentType + '/' + defaultDashboard[0].id);
                                setTimeout(function () {
                                    self.router.navigate(['/' + defaultDashboard[0].componentType + '/' + defaultDashboard[0].id]);
                                }, 100);
                            }
                        }
                    });
                }
            }
            else if (!connectedValue) {
                self.isAuthenticated = false;
                if (self.isConnected) {
                    self.currentPage = self.router.url;
                    self.router.navigate(['/connect']);
                }
                self.isConnected = false;
            }
        });
    }
    ConnectedService.prototype.connect = function (userName, password) {
        this.kerviService.authenticate(userName, password);
    };
    ConnectedService.prototype.logout = function () {
        this.isAuthenticated = false;
        //this.kerviService.disconnect();
    };
    return ConnectedService;
}());
ConnectedService = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["c" /* Injectable */])(),
    __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */]) === "function" && _a || Object, typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_2__dashboards_dashboards_service__["a" /* DashboardsService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__dashboards_dashboards_service__["a" /* DashboardsService */]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_3__angular_router__["b" /* Router */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__angular_router__["b" /* Router */]) === "function" && _c || Object, typeof (_d = typeof __WEBPACK_IMPORTED_MODULE_3__angular_router__["c" /* ActivatedRoute */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__angular_router__["c" /* ActivatedRoute */]) === "function" && _d || Object])
], ConnectedService);

var _a, _b, _c, _d;
//# sourceMappingURL=connected.service.js.map

/***/ }),

/***/ 94:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__dashboards_service__ = __webpack_require__(37);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_router__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_Rx__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_rxjs_Rx___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_rxjs_Rx__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DashboardComponent; });
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};





var DashboardComponent = (function () {
    function DashboardComponent(elementRef, zone, kerviService, dashboardsService, router, activatedRoute) {
        this.elementRef = elementRef;
        this.zone = zone;
        this.kerviService = kerviService;
        this.dashboardsService = dashboardsService;
        this.router = router;
        this.activatedRoute = activatedRoute;
        this.dashboards$ = new __WEBPACK_IMPORTED_MODULE_4_rxjs_Rx__["BehaviorSubject"]([]);
        this.dashboardCount = 0;
        this.sections = [];
        this.authenticated = false;
        this.sectionRows = [];
        this.cameraId = null;
        this.cameraParameters = null;
        this.dashboardSectionsHidden = false;
        this.anonymous = true;
        this.padSize = 180;
        this.moveLeftDelayTimer = null;
        this.moveRightDelayTimer = null;
        this.showLeftPad = false;
        this.showRightPad = false;
        this.inLeftPadDrag = false;
        this.inRightPadDrag = false;
        this.autoZeroLeftPad = false;
        this.autoZeroRightPad = false;
        this.showMenu = true;
        this.leftXValue = null;
        this.leftYValue = null;
        this.rightXValue = null;
        this.rightYValue = null;
    }
    DashboardComponent.prototype.logoff = function (event) {
        this.kerviService.logoff();
        event.stopPropagation();
    };
    DashboardComponent.prototype.padPress = function (pad) {
        if (pad == "left")
            this.inLeftPadDrag = true;
        if (pad == "right")
            this.inRightPadDrag = true;
    };
    DashboardComponent.prototype.padRelease = function (pad) {
        if (pad == "left")
            this.inLeftPadDrag = false;
        if (this.autoZeroLeftPad && this.leftXValue) {
            jQuery("input[name='left-x']", this.elementRef.nativeElement).val(0).change();
            this.kerviService.spine.sendCommand(this.leftXValue.command, 0);
        }
        if (this.autoZeroLeftPad && this.leftYValue) {
            jQuery("input[name='left-y']", this.elementRef.nativeElement).val(0).change();
            this.kerviService.spine.sendCommand(this.leftYValue.command, 0);
        }
        if (pad == "right")
            this.inRightPadDrag = false;
        if (this.autoZeroRightPad && this.rightXValue) {
            jQuery("input[name='right-x']", this.elementRef.nativeElement).val(0).change();
            this.kerviService.spine.sendCommand(this.rightXValue.command, 0);
        }
        if (this.autoZeroRightPad && this.rightYValue) {
            jQuery("input[name='right-y']", this.elementRef.nativeElement).val(0).change();
            this.kerviService.spine.sendCommand(this.rightYValue.command, 0);
        }
    };
    DashboardComponent.prototype.ngOnInit = function () {
        var _this = this;
        console.log("db init", this);
        var self = this;
        this.dashboardsService.getDashboards$().subscribe(function (v) {
            self.dashboardCount = v.length;
            self.showMenu = (self.dashboardCount > 1 || self.kerviService.doAuthenticate);
            self.anonymous = self.kerviService.isAnonymous();
            self.dashboards$.next(v);
        });
        this.authenticated = this.kerviService.doAuthenticate;
        if (!this.kerviService.connected$.value)
            this.router.navigate(['/connect']);
        this.routeSubscription = this.activatedRoute.params.subscribe(function (params) {
            _this.dashboardId = params['name'];
            _this.setupDashboard();
            _this.dashboardsService.getDashboards$().subscribe(function (v) {
                this.setupDashboard();
            });
        });
    };
    DashboardComponent.prototype.ngOnDestroy = function () {
        this.routeSubscription.unsubscribe();
    };
    DashboardComponent.prototype.setupDashboard = function () {
        console.log("setup dashboard");
        var self = this;
        this.dashboard = this.dashboardsService.getDashboardById(this.dashboardId);
        if (this.dashboard) {
            this.dashboardSectionsHidden = false;
            this.showSectionController = false;
            this.cameraId = null;
            this.cameraParameters = null;
            if (this.dashboard.backgroundSection) {
                if (this.dashboard.backgroundSection.components.length > 0) {
                    this.dashboardSectionsHidden = true;
                    this.showSectionController = true;
                    this.cameraId = this.dashboard.backgroundSection.components[0].componentId;
                    this.cameraParameters = this.dashboard.backgroundSection.components[0].parameters;
                }
            }
            var rowSize = 3;
            this.sectionRows = [];
            var currentRow = [];
            this.sectionRows.push(currentRow);
            for (var _i = 0, _a = this.dashboard.sections; _i < _a.length; _i++) {
                var section = _a[_i];
                currentRow.push(section);
                if (currentRow.length == rowSize) {
                    currentRow = [];
                    this.sectionRows.push(currentRow);
                }
            }
            if (this.dashboard.LeftPadXSection && this.dashboard.LeftPadXSection.components.length || this.dashboard.LeftPadYSection && this.dashboard.LeftPadYSection.components.length) {
                this.showLeftPad = true;
                if (self.dashboard.LeftPadXSection.components.length) {
                    self.leftXValue = self.dashboard.LeftPadXSection.components[0].component;
                    if (self.dashboard.LeftPadXSection.components[0].parameters.padAutoCenter)
                        self.autoZeroLeftPad = true;
                }
                if (self.dashboard.LeftPadYSection.components.length) {
                    self.leftYValue = self.dashboard.LeftPadYSection.components[0].component;
                    if (self.dashboard.LeftPadYSection.components[0].parameters.padAutoCenter)
                        self.autoZeroLeftPad = true;
                }
                //console.log("lc",self.dashboard.LeftPadXSection, self.dashboard.LeftPadYSection,this.leftXValue,this.leftYValue)
                if (self.leftXValue) {
                    self.leftXValue.value$.subscribe(function (v) {
                        if (!this.inLeftPadDrag)
                            jQuery("input[name='left-x']", self.elementRef.nativeElement).val(v).change();
                    });
                }
                if (self.leftYValue) {
                    self.leftYValue.value$.subscribe(function (v) {
                        if (!this.inLeftPadDrag)
                            jQuery("input[name='left-y']", self.elementRef.nativeElement).val(v).change();
                    });
                }
                setTimeout(function () {
                    var h = window.innerHeight;
                    var w = window.innerWidth;
                    jQuery(".left-pad-area", self.elementRef.nativeElement).css({ top: h / 2 - (self.padSize / 2), left: w / 4 - (self.padSize / 2) });
                    jQuery(window).bind('resize', function () {
                        var h = window.innerHeight;
                        var w = window.innerWidth;
                        jQuery(".left-pad-area", self.elementRef.nativeElement).css({ top: h / 2 - self.padSize / 2, left: w / 4 - self.padSize / 2 });
                    });
                    if (self.leftXValue)
                        jQuery("input[name='left-x']", self.elementRef.nativeElement).val(self.leftXValue.value$.value).change();
                    if (self.leftYValue)
                        jQuery("input[name='left-y']", self.elementRef.nativeElement).val(self.leftYValue.value$.value).change();
                    var color = "rgba(255,255,255,.5)";
                    var p = jQuery('#leftPad').xy({
                        displayPrevious: false,
                        min: -100,
                        max: 100,
                        width: self.padSize,
                        height: self.padSize,
                        fgColor: color,
                        bgColor: color,
                        change: function (value) {
                            if (self.moveLeftDelayTimer) {
                                clearTimeout(self.moveLeftDelayTimer);
                            }
                            self.moveLeftDelayTimer = setTimeout(function () {
                                if (self.leftXValue && self.inLeftPadDrag)
                                    self.kerviService.spine.sendCommand(self.leftXValue.command, value[0]);
                                if (self.leftYValue && self.inLeftPadDrag)
                                    self.kerviService.spine.sendCommand(self.leftYValue.command, value[1]);
                            }, 200);
                        }
                    })
                        .css({ 'border': '2px solid ' + color });
                }, 0);
            }
            if (this.dashboard.RightPadXSection && this.dashboard.RightPadXSection.components.length || this.dashboard.RightPadYSection && this.dashboard.RightPadYSection.components.length) {
                this.showRightPad = true;
                if (self.dashboard.RightPadXSection.components.length) {
                    self.rightXValue = self.dashboard.RightPadXSection.components[0].component;
                    if (self.dashboard.RightPadXSection.components[0].parameters.padAutoCenter)
                        self.autoZeroRightPad = true;
                }
                if (self.dashboard.RightPadYSection.components.length) {
                    self.rightYValue = self.dashboard.RightPadYSection.components[0].component;
                    if (self.dashboard.RightPadYSection.components[0].parameters.padAutoCenter)
                        self.autoZeroRightPad = true;
                }
                if (self.rightXValue) {
                    self.rightXValue.value$.subscribe(function (v) {
                        if (!this.inLeftPadDrag)
                            jQuery("input[name='right-x']", self.elementRef.nativeElement).val(v).change();
                    });
                }
                if (self.rightYValue) {
                    self.rightYValue.value$.subscribe(function (v) {
                        if (!this.inLeftPadDrag)
                            jQuery("input[name='right-y']", self.elementRef.nativeElement).val(v).change();
                    });
                }
                setTimeout(function () {
                    var color = "rgba(255,255,255,.5)";
                    var h = window.innerHeight;
                    var w = window.innerWidth;
                    jQuery(".right-pad-area", self.elementRef.nativeElement).css({ top: h / 2 - (self.padSize / 2), left: w - (w / 4) - (self.padSize / 2) });
                    jQuery(window).bind('resize', function () {
                        var h = window.innerHeight;
                        var w = window.innerWidth;
                        jQuery(".right-pad-area", self.elementRef.nativeElement).css({ top: h / 2 - self.padSize / 2, left: w - (w / 4) - self.padSize / 2 });
                    });
                    if (self.rightXValue)
                        jQuery("input[name='right-x']", self.elementRef.nativeElement).val(self.rightXValue.value$.value).change();
                    if (self.rightYValue)
                        // jQuery("input[name='right-y']", self.elementRef.nativeElement).val(self.rightYValue.value$.value).change();
                        var p = jQuery('#rightPad').xy({
                            displayPrevious: false,
                            min: -100,
                            max: 100,
                            width: self.padSize,
                            height: self.padSize,
                            fgColor: color,
                            bgColor: color,
                            change: function (value) {
                                if (self.moveRightDelayTimer) {
                                    clearTimeout(self.moveRightDelayTimer);
                                }
                                self.moveRightDelayTimer = setTimeout(function () {
                                    if (self.rightXValue)
                                        self.kerviService.spine.sendCommand(self.rightXValue.command, value[0]);
                                    if (self.rightYValue)
                                        self.kerviService.spine.sendCommand(self.rightYValue.command, value[1]);
                                }, 200);
                            }
                        })
                            .css({ 'border': '2px solid ' + color });
                }, 0);
            }
        }
        //console.log("dbbcx", this.cameraId, this.cameraParameters);
    };
    return DashboardComponent;
}());
DashboardComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'app-dashboard',
        //providers: [ KerviService ],
        template: __webpack_require__(284),
        styles: [__webpack_require__(247)]
    }),
    __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */]) === "function" && _a || Object, typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["W" /* NgZone */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["W" /* NgZone */]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */]) === "function" && _c || Object, typeof (_d = typeof __WEBPACK_IMPORTED_MODULE_2__dashboards_service__["a" /* DashboardsService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__dashboards_service__["a" /* DashboardsService */]) === "function" && _d || Object, typeof (_e = typeof __WEBPACK_IMPORTED_MODULE_3__angular_router__["b" /* Router */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__angular_router__["b" /* Router */]) === "function" && _e || Object, typeof (_f = typeof __WEBPACK_IMPORTED_MODULE_3__angular_router__["c" /* ActivatedRoute */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__angular_router__["c" /* ActivatedRoute */]) === "function" && _f || Object])
], DashboardComponent);

var _a, _b, _c, _d, _e, _f;
//# sourceMappingURL=dashboard.component.js.map

/***/ }),

/***/ 95:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ComponentRef__ = __webpack_require__(176);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ControllerModel; });

//import { ControllersFactory } from './factory' 
var ControllerModel = (function () {
    function ControllerModel(message) {
        this.componentType = "controller";
        this.ui = {};
        this.inputs = [];
        this.outputs = [];
        this.inputReferences = [];
        this.outputReferences = [];
        this.id = message.id;
        this.name = message.name;
        this.type = message.type;
        this.ui = message.ui;
        this.visible = message.visible;
        this.dashboards = message.dashboards;
        this.parameters = message.parameters;
        this.template = message.template;
        for (var _i = 0, _a = message.inputs; _i < _a.length; _i++) {
            var ref = _a[_i];
            this.inputReferences.push(new __WEBPACK_IMPORTED_MODULE_0__ComponentRef__["a" /* ComponentRef */](ref));
        }
        for (var _b = 0, _c = message.outputs; _b < _c.length; _b++) {
            var ref = _c[_b];
            this.outputReferences.push(new __WEBPACK_IMPORTED_MODULE_0__ComponentRef__["a" /* ComponentRef */](ref));
        }
    }
    ControllerModel.prototype.updateReferences = function () { };
    ;
    ControllerModel.prototype.reload = function (component) { };
    ;
    return ControllerModel;
}());

//# sourceMappingURL=controller.model.js.map

/***/ }),

/***/ 96:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__dynamicValues_model__ = __webpack_require__(17);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SensorModel; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT

var SensorModel = (function () {
    function SensorModel(message) {
        this.subSensors = [];
        this.id = null;
        this.name = null;
        this.componentType = "sensor";
        this.ui = {};
        this.type = null;
        this.visible = true;
        this.value = null;
        this.dashboards = [];
        this.id = message.id;
        this.name = message.name;
        this.ui = message.ui;
        this.visible = message.visible;
        this.dashboards = message.dashboards;
        this.value = new __WEBPACK_IMPORTED_MODULE_0__dynamicValues_model__["b" /* DynamicNumberModel */](message);
        this.type = message.type;
        for (var _i = 0, _a = message.subSensors; _i < _a.length; _i++) {
            var subSensor = _a[_i];
            this.subSensors.push(new SensorModel(subSensor));
        }
    }
    SensorModel.prototype.updateReferences = function () { };
    ;
    SensorModel.prototype.reload = function (component) { };
    ;
    return SensorModel;
}());

//# sourceMappingURL=sensor.model.js.map

/***/ }),

/***/ 97:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__kervi_service__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CamViewerComponent; });
// Copyright (c) 2016, Tim Wentzlau
// Licensed under MIT
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};


//import { ControllersService } from '../controllers.service';

var CamViewerComponent = (function () {
    function CamViewerComponent(kerviService, elementRef) {
        this.kerviService = kerviService;
        this.elementRef = elementRef;
        this.cameraId = null;
        this.isBackground = false;
        this.parameters = null;
        this.camera$ = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__["BehaviorSubject"](null);
        this.cameraSource$ = new __WEBPACK_IMPORTED_MODULE_2_rxjs_Rx__["BehaviorSubject"]("");
        this.padSize = 180;
        this.panSubscription = null;
        this.tiltSubscription = null;
        this.moveDelayTimer = null;
        this.pointOfInterests = [];
        //private img = new Image();
        this.firstLoad = true;
        var self = this;
        this.camera$.subscribe(function (v) {
            //console.log("cse",v);
            if (self.panSubscription)
                self.panSubscription.unsubscribe();
            if (self.tiltSubscription)
                self.tiltSubscription.unsubscribe();
            if (v) {
                var pan = null;
                var tilt = null;
                for (var _i = 0, _a = v.inputs; _i < _a.length; _i++) {
                    var i = _a[_i];
                    if (i.id.endsWith(".pan"))
                        pan = i;
                    else if (i.id.endsWith(".tilt"))
                        tilt = i;
                }
                if (pan) {
                    self.panSubscription = pan.value$.subscribe(function (v) {
                        jQuery("input[name='x']", self.elementRef.nativeElement).val(v).change();
                    });
                }
                if (tilt) {
                    self.tiltSubscription = tilt.value$.subscribe(function (v) {
                        jQuery("input[name='y']", self.elementRef.nativeElement).val(v).change();
                    });
                }
                if (v.ui && v.ui.type == "frame") {
                    if (v.ui.source)
                        self.cameraSource$.next(v.ui.source.server + v.ui.source.path);
                }
            }
            else {
                self.cameraSource$.next("");
            }
        });
    }
    CamViewerComponent.prototype.imageReady = function () {
        var h = jQuery(".video", this.elementRef.nativeElement).height();
        var w = jQuery(".video", this.elementRef.nativeElement).width();
        jQuery(".cam-pad-area", this.elementRef.nativeElement).css({ top: h / 2 - this.padSize / 2, left: w / 2 - this.padSize / 2 });
    };
    CamViewerComponent.prototype.timedRefresh = function () {
        //console.log("trx", this);
    };
    CamViewerComponent.prototype.ngOnInit = function () {
        var self = this;
        if (this.cameraId) {
            this.camera$.next(this.kerviService.getComponent(this.cameraId));
        }
        setTimeout(function () {
            self.timedRefresh();
            var h = jQuery(".video", self.elementRef.nativeElement).height();
            var w = jQuery(".video", self.elementRef.nativeElement).width();
            if (w < self.padSize) {
                self.padSize = w - 10;
                //jQuery(".camPad", self.elementRef.nativeElement).css({ width: self.padSize, height:  self.padSize });
            }
            //console.log("cwp",h,w,self.padSize);
            var pan = null;
            var tilt = null;
            for (var _i = 0, _a = self.camera$.value.inputs; _i < _a.length; _i++) {
                var i = _a[_i];
                if (i.id.endsWith(".pan"))
                    pan = i;
                else if (i.id.endsWith(".tilt"))
                    tilt = i;
            }
            jQuery("input[name='x']", self.elementRef.nativeElement).val(pan.value$.value).change();
            jQuery("input[name='y']", self.elementRef.nativeElement).val(tilt.value$.value).change();
            var color = "rgba(255,255,255,.5)";
            var p = jQuery('fieldset', self.elementRef.nativeElement).xy({
                displayPrevious: false,
                min: -100,
                max: 100,
                width: self.padSize,
                height: self.padSize,
                fgColor: color,
                bgColor: color,
                change: function (value) {
                    if (self.moveDelayTimer) {
                        clearTimeout(self.moveDelayTimer);
                    }
                    self.moveDelayTimer = setTimeout(function () {
                        if (pan)
                            self.kerviService.spine.sendCommand(pan.command, value[0]);
                        if (tilt)
                            self.kerviService.spine.sendCommand(tilt.command, value[1]);
                    }, 200);
                }
            })
                .css({ 'border': '2px solid ' + color });
            jQuery(".cam-pad-area", self.elementRef.nativeElement).css({ top: h / 2 - (self.padSize / 2), left: w / 2 - (self.padSize / 2) });
            jQuery(".cam-pad-area", self.elementRef.nativeElement).show();
            jQuery(window).bind('resize', function () {
                //jQuery('#video-viewer').height(jQuery(window).height());
                var h = jQuery(".video", self.elementRef.nativeElement).height();
                var w = jQuery(".video", self.elementRef.nativeElement).width();
                jQuery(".cam-pad-area", self.elementRef.nativeElement).css({ top: h / 2 - self.padSize / 2, left: w / 2 - self.padSize / 2 });
            });
        }, 500);
        self.kerviService.IPCReady$.subscribe(function (ready) {
            if (ready) {
                self.kerviService.spine.addEventHandler("pointOfInterestChange", "", function () {
                    console.log("poi change", this);
                    if (this.action == "add") {
                        self.pointOfInterests.push(this.pointOfInterest);
                    }
                    else if (this.action == "update") {
                        for (var i = 0; (self.pointOfInterests.length); i++) {
                            var poi = self.pointOfInterests[i];
                            if (poi.id == this.pointOfInterest.id) {
                                self.pointOfInterests[i] = this.pointOfInterest;
                                break;
                            }
                        }
                    }
                    else if (this.action == "delete") {
                        for (var i = 0; (self.pointOfInterests.length); i++) {
                            var poi = self.pointOfInterests[i];
                            if (poi.id == this.pointOfInterest.id) {
                                self.pointOfInterests.splice(i, 1);
                                break;
                            }
                        }
                    }
                    else if (this.action == "clear") {
                        for (var i = 0; (self.pointOfInterests.length); i++) {
                            var poi = self.pointOfInterests[i];
                            if (poi.cameraId == this.cameraId && poi.visionId == this.visionId) {
                                self.pointOfInterests.splice(i, 1);
                            }
                        }
                    }
                    self.updatePOI();
                });
            }
        });
        self.kerviService.connected$.subscribe(function (connected) {
            if (connected) {
            }
        });
    };
    CamViewerComponent.prototype.updatePOI = function () {
        if (this.camera$.value) {
            var canvas = document.getElementById('poiCanvas');
            var context = canvas.getContext('2d');
            var cam = this.camera$.value;
            canvas.height = cam.ui.height;
            canvas.width = cam.ui.width;
            context.clearRect(0, 0, canvas.width, canvas.height);
            for (var i in this.pointOfInterests) {
                var poi = this.pointOfInterests[i];
                context.beginPath();
                context.rect(poi.position[0], poi.position[1], poi.size[0], poi.size[1]);
                context.fillStyle = 'rgba(255, 255, 255, 0.5)';
                context.fill();
                context.lineWidth = 1;
                context.strokeStyle = 'green';
                context.stroke();
            }
        }
    };
    return CamViewerComponent;
}());
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", String)
], CamViewerComponent.prototype, "cameraId", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Boolean)
], CamViewerComponent.prototype, "isBackground", void 0);
__decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Input */])(),
    __metadata("design:type", Object)
], CamViewerComponent.prototype, "parameters", void 0);
CamViewerComponent = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_14" /* Component */])({
        selector: 'kervi-cam-viewer',
        template: __webpack_require__(288),
        styles: [__webpack_require__(255)]
    }),
    __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__kervi_service__["a" /* KerviService */]) === "function" && _a || Object, typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ElementRef */]) === "function" && _b || Object])
], CamViewerComponent);

var _a, _b;
//# sourceMappingURL=cam-viewer.component.js.map

/***/ }),

/***/ 98:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__sparkline_sparkline_component__ = __webpack_require__(185);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__slider_slider_component__ = __webpack_require__(184);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__gauge_gauge_component__ = __webpack_require__(182);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__chart_chart_component__ = __webpack_require__(181);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__angular_common__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__switch_button_switch_button_component__ = __webpack_require__(186);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__button_button_component__ = __webpack_require__(180);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__cam_viewer_cam_viewer_component__ = __webpack_require__(97);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__mpeg_viewer_mpeg_viewer_component__ = __webpack_require__(183);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return UIComponentsModule; });
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};










var UIComponentsModule = (function () {
    function UIComponentsModule() {
    }
    return UIComponentsModule;
}());
UIComponentsModule = __decorate([
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["b" /* NgModule */])({
        declarations: [
            __WEBPACK_IMPORTED_MODULE_1__sparkline_sparkline_component__["a" /* SparklineComponent */],
            __WEBPACK_IMPORTED_MODULE_2__slider_slider_component__["a" /* SliderComponent */],
            __WEBPACK_IMPORTED_MODULE_3__gauge_gauge_component__["a" /* GaugeComponent */],
            __WEBPACK_IMPORTED_MODULE_4__chart_chart_component__["a" /* ChartComponent */],
            __WEBPACK_IMPORTED_MODULE_6__switch_button_switch_button_component__["a" /* SwitchButtonComponent */],
            __WEBPACK_IMPORTED_MODULE_7__button_button_component__["a" /* ButtonComponent */],
            __WEBPACK_IMPORTED_MODULE_8__cam_viewer_cam_viewer_component__["a" /* CamViewerComponent */],
            __WEBPACK_IMPORTED_MODULE_9__mpeg_viewer_mpeg_viewer_component__["a" /* MPEGViewerComponent */]
        ],
        exports: [
            __WEBPACK_IMPORTED_MODULE_1__sparkline_sparkline_component__["a" /* SparklineComponent */],
            __WEBPACK_IMPORTED_MODULE_2__slider_slider_component__["a" /* SliderComponent */],
            __WEBPACK_IMPORTED_MODULE_3__gauge_gauge_component__["a" /* GaugeComponent */],
            __WEBPACK_IMPORTED_MODULE_4__chart_chart_component__["a" /* ChartComponent */],
            __WEBPACK_IMPORTED_MODULE_6__switch_button_switch_button_component__["a" /* SwitchButtonComponent */],
            __WEBPACK_IMPORTED_MODULE_7__button_button_component__["a" /* ButtonComponent */],
            __WEBPACK_IMPORTED_MODULE_8__cam_viewer_cam_viewer_component__["a" /* CamViewerComponent */]
        ],
        imports: [
            __WEBPACK_IMPORTED_MODULE_5__angular_common__["a" /* CommonModule */]
        ],
        providers: [],
        bootstrap: []
    }),
    __metadata("design:paramtypes", [])
], UIComponentsModule);

//# sourceMappingURL=ui-components.module.js.map

/***/ })

},[569]);
//# sourceMappingURL=main.bundle.js.map