UNPKG

smart-house-frontend

Version:
2 lines 65.9 kB
webpackJsonp([2],{412:function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(3),s=n(413),a=n(414),c=n(423),p=n(427),u=n(431),d=n(22),l=n(389),f=n(387),v=n(434),h=n(428),m=n(509),g=n(510),y=n(421),b=n(527),w=n(422),_=n(415),S=function(){function t(){}return t=i([r.NgModule({id:e.id,imports:[f.SharedModule,d.CommonModule,l.FormsModule,v.DevicesModule,g.DragulaModule,s.routing],declarations:[a.ConstructorComponent,c.DashboardConstructorComponent,p.MapConstructorComponent,u.SensorsListComponent,h.FileDropDirective,h.FileSelectDirective,m.DevicesComponent,b.OptionsComponent],providers:[y.CanDeactivateConstructor,w.ViewResolveService,_.ConstructorService]}),o("design:paramtypes",[])],t)}();t.ConstructorModule=S},413:function(e,t,n){"use strict";var i=n(29),o=n(414),r=n(419),s=n(421),a=n(422);t.routes=[{path:"",component:o.ConstructorComponent,canDeactivate:[s.CanDeactivateConstructor],resolve:{sensors:r.DeviceListResolver}},{path:":id",component:o.ConstructorComponent,canDeactivate:[s.CanDeactivateConstructor],resolve:{sensors:r.DeviceListResolver,view:a.ViewResolveService}}],t.routing=i.RouterModule.forChild(t.routes)},414:function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(3),s=n(29),a=n(415),c=n(390),p=n(416),u=function(){function e(e,t,n,i,o){this.route=e,this.router=t,this.constructorService=n,this.toastr=i,this.mapViewService=o,this.canBeMapActive=!0,this.canBeDashboardActive=!0,this.isSave=!1}return e.prototype.ngOnInit=function(){this.view=this.route.snapshot.data.view||{name:"",description:"",defaultSubview:"mapSubview",dashboardSubview:{},mapSubview:{}}},e.prototype.onMapActiveChanged=function(e){this.canBeDashboardActive=e,e||"mapSubview"!==this.view.defaultSubview||(this.view.defaultSubview="dashboardSubview")},e.prototype.onDashboardActiveChanged=function(e){this.canBeMapActive=e,e||"dashboardSubview"!==this.view.defaultSubview||(this.view.defaultSubview="mapSubview")},e.prototype.onSaveView=function(){var e=this;return this.isViewCanBeSaved()?void this.constructorService.confirm().filter(function(e){return e}).subscribe(function(){return e.onSuccessConfirm()}):void this.toastr.error('Please fill mandatory fields: "Name", "Description" and "Add Picture" or "Dashboard"')},e.prototype.onUploadPicture=function(e){this.uploader=e},e.prototype.isEditingMode=function(){return null!=this.view._id},e.prototype.isViewCanBeSaved=function(){return this.view.name&&this.view.description&&(this.isAnySubviewExists()||this.isEditingMode())},e.prototype.isAnySubviewExists=function(){return this.isMapSubviewExists()||this.isDashboardSubviewExists()},e.prototype.isMapSubviewExists=function(){return this.uploader&&this.uploader.queue.length>0},e.prototype.isDashboardSubviewExists=function(){return this.view.dashboardSubview.devices&&this.view.dashboardSubview.devices.length>0},e.prototype.uploadPicture=function(e){this.uploader.setOptions({url:this.mapViewService.resolvePictureUploadUrl(e)}),this.uploader.uploadAll()},e.prototype.onSuccessConfirm=function(){var e=this;return this.isSave=!0,this.constructorService.createOrUpdate(this.view).subscribe(function(t){var n=t.mapSubview;return e.uploader?e.uploadPicture(n):void e.router.navigate([".."])})},e=i([r.Component({selector:"sh-constructor",template:n(417),styles:[n(418)]}),o("design:paramtypes",["function"==typeof(t="undefined"!=typeof s.ActivatedRoute&&s.ActivatedRoute)&&t||Object,"function"==typeof(u="undefined"!=typeof s.Router&&s.Router)&&u||Object,"function"==typeof(d="undefined"!=typeof a.ConstructorService&&a.ConstructorService)&&d||Object,"function"==typeof(l="undefined"!=typeof c.ToastsManager&&c.ToastsManager)&&l||Object,"function"==typeof(f="undefined"!=typeof p.MapViewService&&p.MapViewService)&&f||Object])],e);var t,u,d,l,f}();t.ConstructorComponent=u},415:function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(3),s=n(67),a=n(398),c=function(){function e(e,t){this.http=e,this.dialogService=t}return e.prototype.createOrUpdate=function(e){var t="/views";return null!=e._id&&(t+="/"+e._id),this.http.post(t,e)},e.prototype.getView=function(e){return this.http.get("/views/"+e)},e.prototype.confirm=function(){return this.dialogService.confirm(null,{title:"",message:"Do you want to save and exit?",ok:"Yes",cancel:"No"})},e=i([r.Injectable(),o("design:paramtypes",["function"==typeof(t="undefined"!=typeof s.ShHttpService&&s.ShHttpService)&&t||Object,"function"==typeof(n="undefined"!=typeof a.DialogService&&a.DialogService)&&n||Object])],e);var t,n}();t.ConstructorService=c},417:function(e,t){e.exports='<sh-map-constructor\n [(name)]="view.name"\n [(description)]="view.description"\n [(defaultSubview)]="view.defaultSubview"\n [mapSubview]="view.mapSubview"\n\n (isActiveChange)="onMapActiveChanged($event)"\n [canBeActive]="canBeMapActive"\n\n (uploadPicture)="onUploadPicture($event)"\n (saveView)="onSaveView($event)"\n\n></sh-map-constructor>\n\n<sh-dashboard-constructor\n [(defaultSubview)]="view.defaultSubview"\n [dashboardSubview]="view.dashboardSubview"\n\n [canBeActive]="canBeDashboardActive"\n (isActiveChange)="onDashboardActiveChanged($event)"\n\n (saveView)="onSaveView($event)"\n\n></sh-dashboard-constructor>\n'},418:function(e,t){e.exports=".constructor{width:1280px;margin:0 auto;margin-top:30px}\n"},421:function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(81),s=n(398),a=n(3),c=function(){function e(e){this.dialogService=e}return e.prototype.canDeactivate=function(e){return e.isSave?r.Observable.of(e.isSave):this.dialogService.confirm(null,{title:"",message:"Do you want to exit without saving?",ok:"Yes",cancel:"No"})},e=i([a.Injectable(),o("design:paramtypes",["function"==typeof(t="undefined"!=typeof s.DialogService&&s.DialogService)&&t||Object])],e);var t}();t.CanDeactivateConstructor=c},422:function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(3),s=n(81),a=n(415),c=n(390),p=function(){function e(e,t){this.constructorService=e,this.toastr=t}return e.prototype.resolve=function(e){var t=this,n=e.params.id;return this.constructorService.getView(n).catch(function(e){return t.toastr.error(e),s.Observable.never()})},e=i([r.Injectable(),o("design:paramtypes",["function"==typeof(t="undefined"!=typeof a.ConstructorService&&a.ConstructorService)&&t||Object,"function"==typeof(n="undefined"!=typeof c.ToastsManager&&c.ToastsManager)&&n||Object])],e);var t,n}();t.ViewResolveService=p},423:function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(3),s=n(424),a=function(){function e(){this.defaultSubviewChange=new r.EventEmitter,this.isActiveChange=new r.EventEmitter,this.saveView=new r.EventEmitter,this.selectedDevices=[],this.defaultSubviewValue=""}return Object.defineProperty(e.prototype,"defaultSubview",{get:function(){return this.defaultSubviewValue},set:function(e){this.defaultSubviewValue=e,this.defaultSubviewChange.emit(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isActive",{get:function(){return this.dashboardSubview.active},set:function(e){this.dashboardSubview.active=e,this.isActiveChange.emit(e)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){0!==Object.keys(this.dashboardSubview).length?this.initEditedView(this.dashboardSubview):this.initNewView()},e.prototype.initEditedView=function(e){e.devices&&(this.selectedDevices=e.devices)},e.prototype.initNewView=function(){this.isActive=!0,this.defaultSubview="mapSubview"},e.prototype.deviceIsAdded=function(e){return this.selectedDevices.some(function(t){return t._id===e._id})},e.prototype.onAddDevice=function(e){this.deviceIsAdded(e)||(this.selectedDevices.push(e),this.storeDevices())},e.prototype.onRemoveDevice=function(e){this.filterSelectedDevices(e),this.storeDevices()},e.prototype.onRemoveSelectedDevice=function(e){this.filterSelectedDevices(e),this.storeDevices()},e.prototype.onSubmit=function(){this.saveView.emit()},e.prototype.filterSelectedDevices=function(e){this.selectedDevices=this.selectedDevices.filter(function(t){return t.mqttId!==e.mqttId})},e.prototype.storeDevices=function(){this.dashboardSubview.devices=this.selectedDevices},i([r.Input(),o("design:type",Boolean)],e.prototype,"canBeActive",void 0),i([r.Output(),o("design:type","function"==typeof(t="undefined"!=typeof r.EventEmitter&&r.EventEmitter)&&t||Object)],e.prototype,"defaultSubviewChange",void 0),i([r.Input(),o("design:type",Object),o("design:paramtypes",[Object])],e.prototype,"defaultSubview",null),i([r.Output(),o("design:type","function"==typeof(a="undefined"!=typeof r.EventEmitter&&r.EventEmitter)&&a||Object)],e.prototype,"isActiveChange",void 0),i([r.Output(),o("design:type","function"==typeof(c="undefined"!=typeof r.EventEmitter&&r.EventEmitter)&&c||Object)],e.prototype,"saveView",void 0),i([r.Input(),o("design:type","function"==typeof(p="undefined"!=typeof s.DashboardViewInfoDto&&s.DashboardViewInfoDto)&&p||Object)],e.prototype,"dashboardSubview",void 0),e=i([r.Component({selector:"sh-dashboard-constructor",template:n(425),styles:[n(426)]}),o("design:paramtypes",[])],e);var t,a,c,p}();t.DashboardConstructorComponent=a},425:function(e,t){e.exports='<p class="title">Constructor / Dashboard view</p>\n\n<div class="heading">\n <span>Step 4: Add widgets</span>\n\n <sh-options\n [id]="\'dashboardSubview\'"\n [(isActive)]="isActive"\n [canBeActive]="canBeActive"\n [(defaultSubview)]="defaultSubview"\n ></sh-options>\n</div>\n\n<div class="dashboard-view">\n <div class="dashboard-view__centered" *ngIf="!selectedDevices?.length">\n <span>Please add your widgets</span>\n </div>\n <div class="dashboard-view__ordered" *ngIf="selectedDevices?.length">\n <sh-device-widget\n *ngFor="let device of selectedDevices"\n [device]="device"\n [isEditMode]="true"\n (onRemoveWidget)="onRemoveSelectedDevice($event)">\n </sh-device-widget>\n </div>\n</div>\n\n<div class="dashboard-buttons">\n <button class="button button_cancel" [routerLink]="[\'\']">Cancel</button>\n <button class="button button_success" (click)="onSubmit()">Save</button>\n</div>\n\n<div class="step">\n <span>Step 5: Add widgets on dashboard</span>\n</div>\n\n<sh-sensors-list\n [mappedSensors]="selectedDevices"\n (onAddSensor)="onAddDevice($event)"\n (onRemoveSensor)="onRemoveDevice($event)">\n</sh-sensors-list>\n'},426:function(e,t){e.exports=":host .title{font-size:24px;font-weight:600;letter-spacing:0.3px}:host .heading{display:flex;justify-content:space-between;margin-top:20px;width:100%}:host .dashboard-view{width:100%;height:373px;background-color:#e9e9e9;border:solid 1px #c7c8c2;margin-bottom:20px}:host .dashboard-view__centered{display:flex;align-items:center;justify-content:center;height:100%}:host .dashboard-view__ordered{display:flex;flex-wrap:wrap}:host .dashboard-buttons{display:flex;justify-content:flex-end}\n"},427:function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(3),s=n(29),a=n(428),c=n(416),p=function(){function e(e,t,n,i){this.router=e,this.ngZone=t,this.renderer=n,this.mapViewService=i,this.defaultSubviewChange=new r.EventEmitter,this.nameChange=new r.EventEmitter,this.descriptionChange=new r.EventEmitter,this.isActiveChange=new r.EventEmitter,this.saveView=new r.EventEmitter,this.uploadPicture=new r.EventEmitter,this.uploader=new a.FileUploader({queueLimit:1,allowedFileType:["image"]}),this.hasBaseDropZoneOver=!1,this.nameValue="",this.descriptionValue="",this.defaultSubviewValue="",this.reader=new FileReader,this.edittedDevices=[]}return Object.defineProperty(e.prototype,"defaultSubview",{get:function(){return this.defaultSubviewValue},set:function(e){this.defaultSubviewValue=e,this.defaultSubviewChange.emit(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.nameValue},set:function(e){this.nameValue=e,this.nameChange.emit(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"description",{get:function(){return this.descriptionValue},set:function(e){this.descriptionValue=e,this.descriptionChange.emit(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isActive",{get:function(){return this.mapSubview.active},set:function(e){this.mapSubview.active=e,this.isActiveChange.emit(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isReUploadDisabled",{get:function(){return!this.picture},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;0!==Object.keys(this.mapSubview).length?this.initEditedView(this.mapSubview):this.initNewView(),this.uploader.onAfterAddingFile=this.ngZone.run(function(){return function(t){t.withCredentials=!1,e.reader.readAsDataURL(t._file)}}),this.uploader.onCompleteAll=function(){return e.onCreateSuccess()},this.reader.onload=this.ngZone.run(function(){return function(t){e.picture=t.target.result,e.uploadPicture.emit(e.uploader)}})},e.prototype.initNewView=function(){this.isActive=!0,this.defaultSubview="mapSubview"},e.prototype.initEditedView=function(e){this.picture=e.pictureName&&this.mapViewService.resolvePictureUrl(e),this.isActive=e.active,this.edittedDevices=e.sensors.map(function(e){return e.position&&(e.sensor.posX=e.position.x,e.sensor.posY=e.position.y),e.sensor})},e.prototype.onCreateSuccess=function(){this.router.navigate([".."])},e.prototype.sensorIsUnique=function(e){return this.edittedDevices.some(function(t){return t._id===e._id})},e.prototype.onAddSensor=function(e){this.picture&&(this.sensorIsUnique(e)||(this.setInitCoordinates(e),this.edittedDevices.push(e),this.updateEdittedSensors()))},e.prototype.onRemoveSensor=function(e){this.picture&&(this.edittedDevices=this.edittedDevices.filter(function(t){return t._id!==e._id}),this.updateEdittedSensors())},e.prototype.setInitCoordinates=function(e){var t=100*this.edittedDevices.length;e.posX=t,e.posY=0},e.prototype.fileOverBase=function(e){this.hasBaseDropZoneOver=e},e.prototype.onUploadClick=function(){this.uploader.clearQueue();var e=new MouseEvent("click",{bubbles:!0});this.renderer.invokeElementMethod(this.fileInput.nativeElement,"dispatchEvent",[e])},e.prototype.onDeviceMoved=function(){this.updateEdittedSensors()},e.prototype.onSubmit=function(){this.saveView.emit()},e.prototype.updateEdittedSensors=function(){this.mapSubview.sensors=this.edittedDevices.map(function(e){var t=e._id,n=e.posX,i=e.posY;return{sensor:t,position:{x:n,y:i}}})},i([r.ViewChild("fileInput"),o("design:type","function"==typeof(t="undefined"!=typeof r.ElementRef&&r.ElementRef)&&t||Object)],e.prototype,"fileInput",void 0),i([r.Input(),o("design:type",Boolean)],e.prototype,"canBeActive",void 0),i([r.Input(),o("design:type",Object)],e.prototype,"mapSubview",void 0),i([r.Output(),o("design:type","function"==typeof(p="undefined"!=typeof r.EventEmitter&&r.EventEmitter)&&p||Object)],e.prototype,"defaultSubviewChange",void 0),i([r.Input(),o("design:type",Object),o("design:paramtypes",[Object])],e.prototype,"defaultSubview",null),i([r.Output(),o("design:type","function"==typeof(u="undefined"!=typeof r.EventEmitter&&r.EventEmitter)&&u||Object)],e.prototype,"nameChange",void 0),i([r.Input(),o("design:type",Object),o("design:paramtypes",[Object])],e.prototype,"name",null),i([r.Output(),o("design:type","function"==typeof(d="undefined"!=typeof r.EventEmitter&&r.EventEmitter)&&d||Object)],e.prototype,"descriptionChange",void 0),i([r.Input(),o("design:type",Object),o("design:paramtypes",[Object])],e.prototype,"description",null),i([r.Output(),o("design:type","function"==typeof(l="undefined"!=typeof r.EventEmitter&&r.EventEmitter)&&l||Object)],e.prototype,"isActiveChange",void 0),i([r.Output(),o("design:type","function"==typeof(f="undefined"!=typeof r.EventEmitter&&r.EventEmitter)&&f||Object)],e.prototype,"saveView",void 0),i([r.Output(),o("design:type","function"==typeof(v="undefined"!=typeof r.EventEmitter&&r.EventEmitter)&&v||Object)],e.prototype,"uploadPicture",void 0),e=i([r.Component({selector:"sh-map-constructor",template:n(429),styles:[n(430)]}),o("design:paramtypes",["function"==typeof(h="undefined"!=typeof s.Router&&s.Router)&&h||Object,"function"==typeof(m="undefined"!=typeof r.NgZone&&r.NgZone)&&m||Object,"function"==typeof(g="undefined"!=typeof r.Renderer&&r.Renderer)&&g||Object,"function"==typeof(y="undefined"!=typeof c.MapViewService&&c.MapViewService)&&y||Object])],e);var t,p,u,d,l,f,v,h,m,g,y}();t.MapConstructorComponent=p},428:function(e,t,n){!function(t,i){e.exports=i(n(3),n(22))}(this,function(e,t){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=9)}([function(e,t,n){"use strict";function i(e){return File&&e instanceof File}var o=n(5),r=n(3),s=n(7),a=function(){function e(e){this.isUploading=!1,this.queue=[],this.progress=0,this._nextIndex=0,this.options={autoUpload:!1,isHTML5:!0,filters:[],removeAfterUpload:!1,disableMultipart:!1},this.setOptions(e)}return e.prototype.setOptions=function(e){this.options=Object.assign(this.options,e),this.authToken=e.authToken,this.authTokenHeader=e.authTokenHeader||"Authorization",this.autoUpload=e.autoUpload,this.options.filters.unshift({name:"queueLimit",fn:this._queueLimitFilter}),this.options.maxFileSize&&this.options.filters.unshift({name:"fileSize",fn:this._fileSizeFilter}),this.options.allowedFileType&&this.options.filters.unshift({name:"fileType",fn:this._fileTypeFilter}),this.options.allowedMimeType&&this.options.filters.unshift({name:"mimeType",fn:this._mimeTypeFilter});for(var t=0;t<this.queue.length;t++)this.queue[t].url=this.options.url},e.prototype.addToQueue=function(e,t,n){for(var i=this,s=[],a=0,c=e;a<c.length;a++){var p=c[a];s.push(p)}var u=this._getFilters(n),d=this.queue.length,l=[];s.map(function(e){t||(t=i.options);var n=new o.FileLikeObject(e);if(i._isValidFile(n,u,t)){var s=new r.FileItem(i,e,t);l.push(s),i.queue.push(s),i._onAfterAddingFile(s)}else{var a=u[i._failFilterIndex];i._onWhenAddingFileFailed(n,a,t)}}),this.queue.length!==d&&(this._onAfterAddingAll(l),this.progress=this._getTotalProgress()),this._render(),this.options.autoUpload&&this.uploadAll()},e.prototype.removeFromQueue=function(e){var t=this.getIndexOfItem(e),n=this.queue[t];n.isUploading&&n.cancel(),this.queue.splice(t,1),this.progress=this._getTotalProgress()},e.prototype.clearQueue=function(){for(;this.queue.length;)this.queue[0].remove();this.progress=0},e.prototype.uploadItem=function(e){var t=this.getIndexOfItem(e),n=this.queue[t],i=this.options.isHTML5?"_xhrTransport":"_iframeTransport";n._prepareToUploading(),this.isUploading||(this.isUploading=!0,this[i](n))},e.prototype.cancelItem=function(e){var t=this.getIndexOfItem(e),n=this.queue[t],i=this.options.isHTML5?n._xhr:n._form;n&&n.isUploading&&i.abort()},e.prototype.uploadAll=function(){var e=this.getNotUploadedItems().filter(function(e){return!e.isUploading});e.length&&(e.map(function(e){return e._prepareToUploading()}),e[0].upload())},e.prototype.cancelAll=function(){var e=this.getNotUploadedItems();e.map(function(e){return e.cancel()})},e.prototype.isFile=function(e){return i(e)},e.prototype.isFileLikeObject=function(e){return e instanceof o.FileLikeObject},e.prototype.getIndexOfItem=function(e){return"number"==typeof e?e:this.queue.indexOf(e)},e.prototype.getNotUploadedItems=function(){return this.queue.filter(function(e){return!e.isUploaded})},e.prototype.getReadyItems=function(){return this.queue.filter(function(e){return e.isReady&&!e.isUploading}).sort(function(e,t){return e.index-t.index})},e.prototype.destroy=function(){},e.prototype.onAfterAddingAll=function(e){return{fileItems:e}},e.prototype.onBuildItemForm=function(e,t){return{fileItem:e,form:t}},e.prototype.onAfterAddingFile=function(e){return{fileItem:e}},e.prototype.onWhenAddingFileFailed=function(e,t,n){return{item:e,filter:t,options:n}},e.prototype.onBeforeUploadItem=function(e){return{fileItem:e}},e.prototype.onProgressItem=function(e,t){return{fileItem:e,progress:t}},e.prototype.onProgressAll=function(e){return{progress:e}},e.prototype.onSuccessItem=function(e,t,n,i){return{item:e,response:t,status:n,headers:i}},e.prototype.onErrorItem=function(e,t,n,i){return{item:e,response:t,status:n,headers:i}},e.prototype.onCancelItem=function(e,t,n,i){return{item:e,response:t,status:n,headers:i}},e.prototype.onCompleteItem=function(e,t,n,i){return{item:e,response:t,status:n,headers:i}},e.prototype.onCompleteAll=function(){},e.prototype._mimeTypeFilter=function(e){return!(this.options.allowedMimeType&&this.options.allowedMimeType.indexOf(e.type)===-1)},e.prototype._fileSizeFilter=function(e){return!(this.options.maxFileSize&&e.size>this.options.maxFileSize)},e.prototype._fileTypeFilter=function(e){return!(this.options.allowedFileType&&this.options.allowedFileType.indexOf(s.FileType.getMimeClass(e))===-1)},e.prototype._onErrorItem=function(e,t,n,i){e._onError(t,n,i),this.onErrorItem(e,t,n,i)},e.prototype._onCompleteItem=function(e,t,n,i){e._onComplete(t,n,i),this.onCompleteItem(e,t,n,i);var o=this.getReadyItems()[0];return this.isUploading=!1,o?void o.upload():(this.onCompleteAll(),this.progress=this._getTotalProgress(),void this._render())},e.prototype._headersGetter=function(e){return function(t){return t?e[t.toLowerCase()]||void 0:e}},e.prototype._xhrTransport=function(e){var t,n=this,i=e._xhr=new XMLHttpRequest;if(this._onBeforeUploadItem(e),"number"!=typeof e._file.size)throw new TypeError("The file specified is no longer valid");if(this.options.disableMultipart?t=e._file:(t=new FormData,this._onBuildItemForm(e,t),t.append(e.alias,e._file,e.file.name),void 0!==this.options.additionalParameter&&Object.keys(this.options.additionalParameter).forEach(function(e){t.append(e,n.options.additionalParameter[e])})),i.upload.onprogress=function(t){var i=Math.round(t.lengthComputable?100*t.loaded/t.total:0);n._onProgressItem(e,i)},i.onload=function(){var t=n._parseHeaders(i.getAllResponseHeaders()),o=n._transformResponse(i.response,t),r=n._isSuccessCode(i.status)?"Success":"Error",s="_on"+r+"Item";n[s](e,o,i.status,t),n._onCompleteItem(e,o,i.status,t)},i.onerror=function(){var t=n._parseHeaders(i.getAllResponseHeaders()),o=n._transformResponse(i.response,t);n._onErrorItem(e,o,i.status,t),n._onCompleteItem(e,o,i.status,t)},i.onabort=function(){var t=n._parseHeaders(i.getAllResponseHeaders()),o=n._transformResponse(i.response,t);n._onCancelItem(e,o,i.status,t),n._onCompleteItem(e,o,i.status,t)},i.open(e.method,e.url,!0),i.withCredentials=e.withCredentials,this.options.headers)for(var o=0,r=this.options.headers;o<r.length;o++){var s=r[o];i.setRequestHeader(s.name,s.value)}if(e.headers.length)for(var a=0,c=e.headers;a<c.length;a++){var s=c[a];i.setRequestHeader(s.name,s.value)}this.authToken&&i.setRequestHeader(this.authTokenHeader,this.authToken),i.send(t),this._render()},e.prototype._getTotalProgress=function(e){if(void 0===e&&(e=0),this.options.removeAfterUpload)return e;var t=this.getNotUploadedItems().length,n=t?this.queue.length-t:this.queue.length,i=100/this.queue.length,o=e*i/100;return Math.round(n*i+o)},e.prototype._getFilters=function(e){if(!e)return this.options.filters;if(Array.isArray(e))return e;if("string"==typeof e){var t=e.match(/[^\s,]+/g);return this.options.filters.filter(function(e){return t.indexOf(e.name)!==-1})}return this.options.filters},e.prototype._render=function(){},e.prototype._queueLimitFilter=function(){return void 0===this.options.queueLimit||this.queue.length<this.options.queueLimit},e.prototype._isValidFile=function(e,t,n){var i=this;return this._failFilterIndex=-1,!t.length||t.every(function(t){return i._failFilterIndex++,t.fn.call(i,e,n)})},e.prototype._isSuccessCode=function(e){return e>=200&&e<300||304===e},e.prototype._transformResponse=function(e,t){return e},e.prototype._parseHeaders=function(e){var t,n,i,o={};return e?(e.split("\n").map(function(e){i=e.indexOf(":"),t=e.slice(0,i).trim().toLowerCase(),n=e.slice(i+1).trim(),t&&(o[t]=o[t]?o[t]+", "+n:n)}),o):o},e.prototype._onWhenAddingFileFailed=function(e,t,n){this.onWhenAddingFileFailed(e,t,n)},e.prototype._onAfterAddingFile=function(e){this.onAfterAddingFile(e)},e.prototype._onAfterAddingAll=function(e){this.onAfterAddingAll(e)},e.prototype._onBeforeUploadItem=function(e){e._onBeforeUpload(),this.onBeforeUploadItem(e)},e.prototype._onBuildItemForm=function(e,t){e._onBuildForm(t),this.onBuildItemForm(e,t)},e.prototype._onProgressItem=function(e,t){var n=this._getTotalProgress(t);this.progress=n,e._onProgress(t),this.onProgressItem(e,t),this.onProgressAll(n),this._render()},e.prototype._onSuccessItem=function(e,t,n,i){e._onSuccess(t,n,i),this.onSuccessItem(e,t,n,i)},e.prototype._onCancelItem=function(e,t,n,i){e._onCancel(t,n,i),this.onCancelItem(e,t,n,i)},e}();t.FileUploader=a},function(t,n){t.exports=e},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(1),s=n(0),a=function(){function e(e){this.fileOver=new r.EventEmitter,this.onFileDrop=new r.EventEmitter,this.element=e}return e.prototype.getOptions=function(){return this.uploader.options},e.prototype.getFilters=function(){return{}},e.prototype.onDrop=function(e){var t=this._getTransfer(e);if(t){var n=this.getOptions(),i=this.getFilters();this._preventAndStop(e),this.uploader.addToQueue(t.files,n,i),this.fileOver.emit(!1),this.onFileDrop.emit(t.files)}},e.prototype.onDragOver=function(e){var t=this._getTransfer(e);this._haveFiles(t.types)&&(t.dropEffect="copy",this._preventAndStop(e),this.fileOver.emit(!0))},e.prototype.onDragLeave=function(e){this.element&&e.currentTarget===this.element[0]||(this._preventAndStop(e),this.fileOver.emit(!1))},e.prototype._getTransfer=function(e){return e.dataTransfer?e.dataTransfer:e.originalEvent.dataTransfer},e.prototype._preventAndStop=function(e){e.preventDefault(),e.stopPropagation()},e.prototype._haveFiles=function(e){return!!e&&(e.indexOf?e.indexOf("Files")!==-1:!!e.contains&&e.contains("Files"))},e}();i([r.Input(),o("design:type",s.FileUploader)],a.prototype,"uploader",void 0),i([r.Output(),o("design:type",r.EventEmitter)],a.prototype,"fileOver",void 0),i([r.Output(),o("design:type",r.EventEmitter)],a.prototype,"onFileDrop",void 0),i([r.HostListener("drop",["$event"]),o("design:type",Function),o("design:paramtypes",[Object]),o("design:returntype",void 0)],a.prototype,"onDrop",null),i([r.HostListener("dragover",["$event"]),o("design:type",Function),o("design:paramtypes",[Object]),o("design:returntype",void 0)],a.prototype,"onDragOver",null),i([r.HostListener("dragleave",["$event"]),o("design:type",Function),o("design:paramtypes",[Object]),o("design:returntype",Object)],a.prototype,"onDragLeave",null),a=i([r.Directive({selector:"[ng2FileDrop]"}),o("design:paramtypes",[r.ElementRef])],a),t.FileDropDirective=a},function(e,t,n){"use strict";var i=n(5),o=function(){function e(e,t,n){this.url="/",this.headers=[],this.withCredentials=!0,this.formData=[],this.isReady=!1,this.isUploading=!1,this.isUploaded=!1,this.isSuccess=!1,this.isCancel=!1,this.isError=!1,this.progress=0,this.index=void 0,this.uploader=e,this.some=t,this.options=n,this.file=new i.FileLikeObject(t),this._file=t,e.options&&(this.method=e.options.method||"POST",this.alias=e.options.itemAlias||"file"),this.url=e.options.url}return e.prototype.upload=function(){try{this.uploader.uploadItem(this)}catch(e){this.uploader._onCompleteItem(this,"",0,{}),this.uploader._onErrorItem(this,"",0,{})}},e.prototype.cancel=function(){this.uploader.cancelItem(this)},e.prototype.remove=function(){this.uploader.removeFromQueue(this)},e.prototype.onBeforeUpload=function(){},e.prototype.onBuildForm=function(e){return{form:e}},e.prototype.onProgress=function(e){return{progress:e}},e.prototype.onSuccess=function(e,t,n){return{response:e,status:t,headers:n}},e.prototype.onError=function(e,t,n){return{response:e,status:t,headers:n}},e.prototype.onCancel=function(e,t,n){return{response:e,status:t,headers:n}},e.prototype.onComplete=function(e,t,n){return{response:e,status:t,headers:n}; },e.prototype._onBeforeUpload=function(){this.isReady=!0,this.isUploading=!0,this.isUploaded=!1,this.isSuccess=!1,this.isCancel=!1,this.isError=!1,this.progress=0,this.onBeforeUpload()},e.prototype._onBuildForm=function(e){this.onBuildForm(e)},e.prototype._onProgress=function(e){this.progress=e,this.onProgress(e)},e.prototype._onSuccess=function(e,t,n){this.isReady=!1,this.isUploading=!1,this.isUploaded=!0,this.isSuccess=!0,this.isCancel=!1,this.isError=!1,this.progress=100,this.index=void 0,this.onSuccess(e,t,n)},e.prototype._onError=function(e,t,n){this.isReady=!1,this.isUploading=!1,this.isUploaded=!0,this.isSuccess=!1,this.isCancel=!1,this.isError=!0,this.progress=0,this.index=void 0,this.onError(e,t,n)},e.prototype._onCancel=function(e,t,n){this.isReady=!1,this.isUploading=!1,this.isUploaded=!1,this.isSuccess=!1,this.isCancel=!0,this.isError=!1,this.progress=0,this.index=void 0,this.onCancel(e,t,n)},e.prototype._onComplete=function(e,t,n){this.onComplete(e,t,n),this.uploader.options.removeAfterUpload&&this.remove()},e.prototype._prepareToUploading=function(){this.index=this.index||++this.uploader._nextIndex,this.isReady=!0},e}();t.FileItem=o},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(1),s=n(0),a=function(){function e(e){this.element=e}return e.prototype.getOptions=function(){return this.uploader.options},e.prototype.getFilters=function(){},e.prototype.isEmptyAfterSelection=function(){return!!this.element.nativeElement.attributes.multiple},e.prototype.onChange=function(){var e=this.element.nativeElement.files,t=this.getOptions(),n=this.getFilters();this.uploader.addToQueue(e,t,n),this.isEmptyAfterSelection()&&(this.element.nativeElement.value="")},e}();i([r.Input(),o("design:type",s.FileUploader)],a.prototype,"uploader",void 0),i([r.HostListener("change"),o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",Object)],a.prototype,"onChange",null),a=i([r.Directive({selector:"[ng2FileSelect]"}),o("design:paramtypes",[r.ElementRef])],a),t.FileSelectDirective=a},function(e,t,n){"use strict";function i(e){return!(!e||!(e.nodeName||e.prop&&e.attr&&e.find))}var o=function(){function e(e){var t=i(e),n=t?e.value:e,o="string"==typeof n?"FakePath":"Object",r="_createFrom"+o;this[r](n)}return e.prototype._createFromFakePath=function(e){this.lastModifiedDate=void 0,this.size=void 0,this.type="like/"+e.slice(e.lastIndexOf(".")+1).toLowerCase(),this.name=e.slice(e.lastIndexOf("/")+e.lastIndexOf("\\")+2)},e.prototype._createFromObject=function(e){this.size=e.size,this.type=e.type,this.name=e.name},e}();t.FileLikeObject=o},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=n(8),r=n(1),s=n(2),a=n(4),c=function(){function e(){}return e}();c=i([r.NgModule({imports:[o.CommonModule],declarations:[s.FileDropDirective,a.FileSelectDirective],exports:[s.FileDropDirective,a.FileSelectDirective]})],c),t.FileUploadModule=c},function(e,t,n){"use strict";var i=function(){function e(){}return e.getMimeClass=function(e){var t="application";return this.mime_psd.indexOf(e.type)!==-1?t="image":e.type.match("image.*")?t="image":e.type.match("video.*")?t="video":e.type.match("audio.*")?t="audio":"application/pdf"===e.type?t="pdf":this.mime_compress.indexOf(e.type)!==-1?t="compress":this.mime_doc.indexOf(e.type)!==-1?t="doc":this.mime_xsl.indexOf(e.type)!==-1?t="xls":this.mime_ppt.indexOf(e.type)!==-1&&(t="ppt"),"application"===t&&(t=this.fileTypeDetection(e.name)),t},e.fileTypeDetection=function(e){var t={jpg:"image",jpeg:"image",tif:"image",psd:"image",bmp:"image",png:"image",nef:"image",tiff:"image",cr2:"image",dwg:"image",cdr:"image",ai:"image",indd:"image",pin:"image",cdp:"image",skp:"image",stp:"image","3dm":"image",mp3:"audio",wav:"audio",wma:"audio",mod:"audio",m4a:"audio",compress:"compress",rar:"compress","7z":"compress",lz:"compress",z01:"compress",pdf:"pdf",xls:"xls",xlsx:"xls",ods:"xls",mp4:"video",avi:"video",wmv:"video",mpg:"video",mts:"video",flv:"video","3gp":"video",vob:"video",m4v:"video",mpeg:"video",m2ts:"video",mov:"video",doc:"doc",docx:"doc",eps:"doc",txt:"doc",odt:"doc",rtf:"doc",ppt:"ppt",pptx:"ppt",pps:"ppt",ppsx:"ppt",odp:"ppt"},n=e.split(".");if(n.length<2)return"application";var i=n[n.length-1].toLowerCase();return void 0===t[i]?"application":t[i]},e}();i.mime_doc=["application/msword","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-word.document.macroEnabled.12","application/vnd.ms-word.template.macroEnabled.12"],i.mime_xsl=["application/vnd.ms-excel","application/vnd.ms-excel","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.ms-excel.sheet.macroEnabled.12","application/vnd.ms-excel.template.macroEnabled.12","application/vnd.ms-excel.addin.macroEnabled.12","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],i.mime_ppt=["application/vnd.ms-powerpoint","application/vnd.ms-powerpoint","application/vnd.ms-powerpoint","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/vnd.ms-powerpoint.addin.macroEnabled.12","application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],i.mime_psd=["image/photoshop","image/x-photoshop","image/psd","application/photoshop","application/psd","zz-application/zz-winassoc-psd"],i.mime_compress=["application/x-gtar","application/x-gcompress","application/compress","application/x-tar","application/x-rar-compressed","application/octet-stream"],t.FileType=i},function(e,n){e.exports=t},function(e,t,n){"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}i(n(4)),i(n(2)),i(n(0)),i(n(3));var o=n(6);t.FileUploadModule=o.FileUploadModule}])})},429:function(e,t){e.exports='<div class="constructor">\n <h2 class="title">Constructor / Map view</h2>\n\n <section>\n\n <h4 class="heading">Step 1: Name your view</h4>\n\n <div>\n <div class="input-group">\n <label class="input-group__label" for="name">Name</label>\n <input class="input-group__input"\n type="text"\n id="name"\n placeholder="Enter name"\n [(ngModel)]="name"\n name="mapViewName"\n required>\n </div>\n\n <div class="input-group">\n <label class="input-group__label" for="description">Description</label>\n <input class="input-group__input"\n type="text"\n id="description"\n placeholder="Enter description"\n [(ngModel)]="description"\n name="mapViewDescription"\n required>\n </div>\n </div>\n\n </section>\n\n <section>\n <div class="heading">\n <span>Step 2: Add picture</span>\n\n <sh-options\n [id]="\'mapSubview\'"\n [(isActive)]="isActive"\n [canBeActive]="canBeActive"\n [(defaultSubview)]="defaultSubview"\n ></sh-options>\n </div>\n\n <input #fileInput\n type="file"\n name="mapViewPicture"\n accept="image/*"\n style="display: none;"\n ng2FileSelect\n [uploader]="uploader"/>\n\n <div class="picture picture_blank"\n *ngIf="!picture"\n [ngClass]="{\'picture_file-over\': hasBaseDropZoneOver}"\n ng2FileDrop\n (fileOver)="fileOverBase($event)"\n (click)="onUploadClick()"\n [uploader]="uploader">\n <div class="add-picture">\n <div class="add-picture__icon"></div>\n <p class="add-picture__title">Please add your picture</p>\n </div>\n </div>\n\n <div class="picture"\n *ngIf="picture">\n\n <img class="picture__image"\n [src]="picture"\n alt="your image"/>\n\n <sh-constructor-devices\n [edittedDevices]="edittedDevices"\n (deviceMoved)="onDeviceMoved()"\n class="constructor-devices">\n </sh-constructor-devices>\n </div>\n\n </section>\n\n\n <div class="controls">\n\n <button class="button button_cancel"\n type="button"\n [routerLink]="[\'\']">\n Cancel\n </button>\n\n <button class="button button_retry"\n type="button"\n (click)="onUploadClick()"\n [disabled]="isReUploadDisabled">\n Reupload\n </button>\n\n <button class="button button_success"\n type="button"\n (click)="onSubmit()">\n Save\n </button>\n\n </div>\n\n <section>\n <h4 class="heading">Step 3: Add devices on the map</h4>\n\n <sh-sensors-list\n [mappedSensors]="edittedDevices"\n (onAddSensor)="onAddSensor($event)"\n (onRemoveSensor)="onRemoveSensor($event)">\n </sh-sensors-list>\n </section>\n</div>\n'},430:function(e,t){e.exports='.constructor{width:1280px;margin:0 auto;margin-top:30px}.title{font-weight:600;font-size:24px;letter-spacing:0.3px}.input-group{width:48%;float:left;margin-right:4%}.input-group:last-child{margin-right:0}.input-group__label{font-weight:600;color:#000;font-size:12px;letter-spacing:0.2px}.input-group__input{font-weight:normal;font-size:12px;letter-spacing:0.2px}.heading{display:flex;justify-content:space-between;margin-top:20px;width:100%}.nv-file-over{border:dotted 3px red}.controls{display:flex;justify-content:flex-end}.picture{height:370px;position:relative;background-color:#f9f9f9}.picture_blank{border:dashed 1px #92928f;cursor:pointer}.picture_file-over{border-style:dotted}.picture__image{position:absolute;max-width:1280px;height:100%}.add-picture{width:150px;margin:120px auto}.add-picture__icon{width:60px;height:60px;margin:0 auto;background-image:url("assets/ic-add-a-photo.svg");background-repeat:no-repeat}.add-picture__title{font-size:14px;color:#5f605d}.constructor-devices{position:absolute;top:0;left:0;width:1280px;height:370px}\n'},431:function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(3),s=n(29),a=function(){function e(e){this.route=e,this.onAddSensor=new r.EventEmitter,this.onRemoveSensor=new r.EventEmitter}return e.prototype.ngOnInit=function(){this.devices=this.route.snapshot.data.sensors},e.prototype.addSensor=function(e){this.onAddSensor.emit(e)},e.prototype.removeSensor=function(e){this.onRemoveSensor.emit(e)},e.prototype.isSensorOnView=function(e){return this.mappedSensors.some(function(t){return t._id===e._id})},i([r.Input(),o("design:type",Array)],e.prototype,"mappedSensors",void 0),i([r.Output(),o("design:type","function"==typeof(t="undefined"!=typeof r.EventEmitter&&r.EventEmitter)&&t||Object)],e.prototype,"onAddSensor",void 0),i([r.Output(),o("design:type","function"==typeof(a="undefined"!=typeof r.EventEmitter&&r.EventEmitter)&&a||Object)],e.prototype,"onRemoveSensor",void 0),e=i([r.Component({selector:"sh-sensors-list",template:n(432),styles:[n(433)]}),o("design:paramtypes",["function"==typeof(c="undefined"!=typeof s.ActivatedRoute&&s.ActivatedRoute)&&c||Object])],e);var t,a,c}();t.SensorsListComponent=a},432:function(e,t){e.exports='<div class="sensors-list">\n <div class="sensors-list__item row" *ngFor="let sensor of devices">\n <span class="col s2 sensors-list__title">{{sensor.mqttId}}</span>\n <span class="col s2">{{sensor.description}}</span>\n <span class="col s2">position</span>\n <div class="sensors-list__actions sensors-list__actions_add"\n [ngClass]="{unactive: isSensorOnView(sensor)}"\n (click)="addSensor(sensor)"></div>\n <div class="sensors-list__actions sensors-list__actions_remove"\n (click)="removeSensor(sensor)"\n [ngClass]="{unactive: !isSensorOnView(sensor)}"></div>\n </div>\n</div>\n'},433:function(e,t){e.exports='.sensors-list{margin:0 60px 30px}.sensors-list__item{height:28px;border:solid 1px #e9e9e9;position:relative;padding-right:12px}.sensors-list__title{margin-right:-10px;margin-left:10px !important}.sensors-list__title::before{content:\'\';width:5px;height:5px;position:absolute;top:10px;left:6px;background-color:#b8e986;border-radius:50%}.sensors-list__actions{text-align:right;cursor:pointer;background-repeat:no-repeat;width:20px;height:20px;display:inline-block;float:right;margin:3px 3px 0}.sensors-list__actions_add{background-image:url("assets/add-icon.svg")}.sensors-list__actions_remove{background-image:url("assets/remove-icon.svg")}.sensors-list .row{margin-bottom:-1px}.unactive{opacity:0.25}\n'},509:function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(3),s=n(510),a=function(){function e(e,t,n){this.element=e,this.renderer=t,this.dragulaService=n,this.deviceMoved=new r.EventEmitter,this.switcher=!1}return e.prototype.ngOnInit=function(){this.dragAndDrop()},e.prototype.saveCoordinates=function(e,t,n){this.edittedDevices.forEach(function(i){i._id===e&&(i.posX=t,i.posY=n)}),this.deviceMoved.emit()},e.prototype.dragAndDrop=function(){var e=this;this.dragulaService.drag.subscribe(function(t){var n,i,o,r,s=t.slice(1)[0],a=s.getAttribute("id"),c=e.element.nativeElement,p=Number.parseInt(getComputedStyle(c).width),u=Number.parseInt(getComputedStyle(c).height);document.onmouseup=function(){var t=n-o+Number.parseInt(getComputedStyle(s).left),c=i-r+Number.parseInt(getComputedStyle(s).top);t>0&&t<p&&c>0&&c<u&&(e.renderer.setElementAttribute(s,"style","left: "+t+"px; top: "+c+"px;"),e.saveCoordinates(a,t,c)),document.onmouseup=null,document.onmousemove=null},document.onmousemove=function(e){o=o?o:e.clientX,r=r?r:e.clientY,n=e.clientX,i=e.clientY}})},i([r.Input(),o("design:type",Array)],e.prototype,"edittedDevices",void 0),i([r.Output(),o("design:type","function"==typeof(t="undefined"!=typeof r.EventEmitter&&r.EventEmitter)&&t||Object)],e.prototype,"deviceMoved",void 0),e=i([r.Component({selector:"sh-constructor-devices",template:n(525),styles:[n(526)]}),o("design:paramtypes",["function"==typeof(a="undefined"!=typeof r.ElementRef&&r.ElementRef)&&a||Object,"function"==typeof(c="undefined"!=typeof r.Renderer&&r.Renderer)&&c||Object,"function"==typeof(p="undefined"!=typeof s.DragulaService&&s.DragulaService)&&p||Object])],e);var t,a,c,p}();t.DevicesComponent=a},510:function(e,t,n){"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}i(n(511))},511:function(e,t,n){"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}i(n(512)),i(n(522)),i(n(523)),i(n(524))},512:function(e,t,n){"use strict";var i=n(513);t.dragula=i.default||i},513:function(e,t,n){(function(t){"use strict";function i(e,t){function n(e){return ue.containers.indexOf(e)!==-1||pe.isContainer(e)}function i(e){var t=e?"remove":"add";o(E,t,"mousedown",x),o(E,t,"mouseup",M)}function a(e){var t=e?"remove":"add";o(E,t,"mousemove",C)}function h(e){var t=e?"remove":"add";w[t](E,"selectstart",O),w[t](E,"click",O)}function g(){i(!0),M({})}function O(e){ae&&e.preventDefault()}function x(e){te=e.clientX,ne=e.clientY;var t=1!==r(e)||e.metaKey||e.ctrlKey;if(!t){var n=e.target,i=D(n);i&&(ae=i,a(),"mousedown"===e.type&&(v(n)?n.focus():e.preventDefault()))}}function C(e){if(ae){if(0===r(e))return void M({});if(void 0===e.clientX||e.clientX!==te||void 0===e.clientY||e.clientY!==ne){if(pe.ignoreInputTextSelection){var t=y("clientX",e),n=y("clientY",e),i=S.elementFromPoint(t,n);if(v(i))return}var o=ae;a(!0),h(),F(),A(o);var c=s(K);G=y("pageX",e)-c.left,ee=y("pageY",e)-c.top,_.add(re||K,"gu-transit"),H(),q(e)}}}function D(e){if(!(ue.dragging&&W|