(()=>{function o(i,r){return{restrict:"A",link:function(o,c){var t=c.find("[c8y-copy-to-clipboard-input]"),c=c.find("[c8y-copy-to-clipboard-button]");t||console.error("Missing c8y-copy-to-clipboard-input attribute!"),c?c.bind("click",function(){if(t&&t.select){var c;t.select();try{c=document.execCommand("copy"),t.blur()}catch(o){c=!1}c?i.success(r("Copied to clipboard.")):i.warning(r("Could not copy to clipboard, press Ctrl/Cmd+C to copy."))}}):console.error("Missing c8y-copy-to-clipboard-button attribute!")}}}o.$inject=["c8yAlert","gettext"],angular.module("c8y.ui").directive("c8yCopyToClipboard",o)})();