(function(){"use strict";u8.Crm.Widgets.CopyToClipboardPopup=function(t,o){this.Widget(t,o)};u8.Crm.Widgets.CopyToClipboardPopup.makeClass({name:"CopyToClipboardPopup",deriveFrom:u8.Base.Widgets.Widget,events:["Close"]});$.extend(u8.Crm.Widgets.CopyToClipboardPopup.prototype,{open:function(){u8.using({texts:["CopyToClipboard_text","button_text"],templates:[{name:"copyToClipboard_template",url:"~/crm/CopyToClipboardPopup.utml.htm"}]},this._create.bind(this))},_create:function(){var t=this,o=$.extend({parent:this,position:"center",alignTo:"window",allowResize:false,allowMaximize:false,autoShow:false,modal:true,disposeOnClose:true,sizing:"fit",title:$t("TXT_CopyToClipboard_text_2"),onCreate:function(o){t._popup=o;t._createView(t._popup.getContent())}},this.popup);this._popup=new u8.Base.Widgets.Popup("<div/>",o);this._popup.open()},_createView:function(t){var o=this,e={id:this.id,text:this.text,onCloseButtonClick:function(t){o._popup.close()}};t.addClass("u8-copytoclipboardpopup").utml({name:"copyToClipboard_template",data:e,itemOptions:{parent:this._popup}},function(){o._popup.autoSizeAndPosition().show();var e=t.find("#"+o.id+"_text");if(!e.length){return}e.focus().select();e.keydown(function(e){if(e.ctrlKey&&e.keyCode===67){t.find("#"+o.id+"_copySuccess").show();o._popup.close.bind(o._popup).timeout(500)}})})}})})();