(()=>{function e(t,c,e){function i(e){t.device=e,o()}function n(){e.detail((()=>{var e=c.deviceId;return e=t.child.config&&t.child.config.device&&t.child.config.device.id?t.child.config.device.id:e})(),t).then(i)}function o(){var n=_.cloneDeep(t.child.config.options)||[];_.forEach(n,function(e){if(e.fields)e.object=e.fields.reduce(function(e,c){return e[c]=t.$eval("device.".concat(c)),e},{});else try{e.object=t.$eval("device.".concat(e.keyPath))}catch(e){}var c,i;c=n,i=e,_.isUndefined(i.object)&&_.remove(c,function(e){return e===i}),n=c}),t.options=n,t.singleOption=1===n.length}t.$watch("child.config.device.id",n),t.$watch("child.config.options",o),t.$watch("device",o,!0),n()}e.$inject=["$scope","$routeParams","c8yMoRealTimeDetails"],angular.module("c8y.parts.devicePropertyWidget").controller("devicePropertyWidgetCtrl",e)})();