(()=>{function e(e,n,t,o,a,r,c,i,l,s,d,u,v,f,p,g){var m=this;function S(e){m.device=null,m.modelInfo=null,e=e.id||e;var e=a.detailRealtime(e),t=e.then(i.modelByDevice);n.all([e,t]).then(function(e){m.device=e[0],m.modelInfo=e[1],m.device&&m.modelInfo&&(m.restart=new l(m.device,m.modelInfo,m),m.sos=new s(m.device,m.modelInfo,m),m.alarms=new d(m.device,m.modelInfo,m),m.situation=new u(m.device,m.modelInfo,m),m.location=new v(m.device,m.modelInfo,m))})}function h(e,t,n){c.success(g.getString(e,{operation:t,operationResult:n}))}_.assign(m,f),m.scope=t,m.newModel={name:null,save:function(){return a.save({id:m.device.id,c8y_Hardware:_.assign(m.device.c8y_Hardware||{},{model:m.newModel.name})}).then(o.getResData).then(S)}},m.execute=function(a,i){return r.createWithNotifications(a).then(function(e){return e.created.then(function(){h(p('"{{operation.description | translate}}" will be executed.'),a),i.pending=!0}),e.completed.then(function(e){var t,n,o;e.status===r.status.SUCCESSFUL?h(p('"{{operation.description | translate}}" completed.'),a,e):e.status===r.status.FAILED&&(t=p('"{{operation.description | translate}}" failed due to: "{{operationResult.failureReason | translate}}".'),n=p('"{{operation.description | translate}}" failed.'),o=a,(e=e).failureReason?c.danger(g.getString(t,{operation:o,operationResult:e})):c.danger(g.getString(n,{operation:o,operationResult:e}))),i.pending=!1}),e})},i.list().then(function(e){m.supportedModels=e}),S(e.deviceId)}e.$inject=["$routeParams","$q","$scope","c8yBase","c8yDevices","c8yDeviceControl","c8yAlert","trackerModelsSvc","trackerRestartSvc","trackerSosSvc","trackerAlarmsSvc","trackerSituationSvc","trackerLocationSvc","UnitConversionHelperSvc","gettext","gettextCatalog"],angular.module("c8y.trackerConfiguration").controller("trackerConfigurationCtrl",e)})();