angular.module("c8y.deviceDatabase4").directive("validateValueInRegisterRange",function(){return{restrict:"A",require:"ngModel",link:function(a,e,i,n){var t=i.validateValueInRegisterRange,d=i.validateStrictly;n.$validators["value-in-register-range"]=function(e){var i,n;return!!_.isUndefined(e)||(e=e,i=a.$eval(t)||{},n=a.$eval(d)||!1,!_.isUndefined(i.min)&&!_.isUndefined(i.max)&&(!n||_.isUndefined(i.step)||_.isUndefined(i.decimalPlaces)?i.min<=e&&e<=i.max:(n=Math.pow(10,i.decimalPlaces),0<=(n=(((e*n).toFixed(6)-(i.min*n).toFixed(6))/(i.step*n).toFixed(6)).toFixed(6))&&n%1==0&&e<=i.max)))},a.$watch(function(){return a.$eval(t)},function(){return n.$validate()},!0)}}});