function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}angular.module("c8y.deviceDatabase4").directive("unique",function(){return{restrict:"A",require:"ngModel",link:function(r,e,t,o){var i=t.uniqueInArray,n=t.uniquePropName;function u(){var e,t=o.$modelValue;_.isUndefined(t)||(e=r.$eval(i),e=_(e).chain().filter(_defineProperty({},n,t)).size().lte(1).value(),o.$setValidity("unique",e))}r.$watch(i,u,!0),t.$observe(n,u),r.$watch(function(){return o.$modelValue},u)}}});