NEW_CKEDITOR.dialog.add("paste",(function(e){function t(t){var a=new NEW_CKEDITOR.dom.document(t.document),o=a.getBody(),s=a.getById("edi_actscrpt");s&&s.remove(),o.setAttribute("contenteditable",!0),o.on(i.mainPasteEvent,(function(e){e=i.initPasteDataTransfer(e),n?e!=n&&(n=i.initPasteDataTransfer()):n=e})),NEW_CKEDITOR.env.ie&&8>NEW_CKEDITOR.env.version&&a.getWindow().on("blur",(function(){a.$.selection.empty()})),a.on("keydown",(function(e){var t;switch((e=e.data).getKeystroke()){case 27:this.hide(),t=1;break;case 9:case NEW_CKEDITOR.SHIFT+9:this.changeFocus(1),t=1}t&&e.preventDefault()}),this),e.fire("ariaWidget",new NEW_CKEDITOR.dom.element(t.frameElement)),a.getWindow().getFrame().removeCustomData("pendingFocus")&&o.focus()}var n,a=e.lang.clipboard,i=NEW_CKEDITOR.plugins.clipboard;return e.on("pasteDialogCommit",(function(t){t.data&&e.fire("paste",{type:"auto",dataValue:t.data.dataValue,method:"paste",dataTransfer:t.data.dataTransfer||i.initPasteDataTransfer()})}),null,null,1e3),{title:a.paste,minWidth:NEW_CKEDITOR.env.ie&&NEW_CKEDITOR.env.quirks?370:350,minHeight:NEW_CKEDITOR.env.quirks?250:245,onShow:function(){this.parts.dialog.$.offsetHeight,this.setupContent(),this._.committed=!1},onLoad:function(){(NEW_CKEDITOR.env.ie7Compat||NEW_CKEDITOR.env.ie6Compat)&&"rtl"==e.lang.dir&&this.parts.contents.setStyle("overflow","hidden")},onOk:function(){this.commitContent()},contents:[{id:"general",label:e.lang.common.generalTab,elements:[{type:"html",id:"pasteMsg",html:'<div style="white-space:normal;width:340px">'+a.pasteMsg+"</div>"},{type:"html",id:"editing_area",style:"width:100%;height:100%",html:"",focus:function(){var e=this.getInputElement(),t=e.getFrameDocument().getBody();!t||t.isReadOnly()?e.setCustomData("pendingFocus",1):t.focus()},setup:function(){var i=this.getDialog(),o='<html dir="'+e.config.contentsLangDirection+'" lang="'+(e.config.contentsLanguage||e.langCode)+'"><head><style>body{margin:3px;height:95%;word-break:break-all;}</style></head><body><script id="edi_actscrpt" type="text/javascript">window.parent.NEW_CKEDITOR.tools.callFunction('+NEW_CKEDITOR.tools.addFunction(t,i)+",this);<\/script></body></html>",s=NEW_CKEDITOR.env.air?"javascript:void(0)":NEW_CKEDITOR.env.ie&&!NEW_CKEDITOR.env.edge?"javascript:void((function(){"+encodeURIComponent("document.open();("+NEW_CKEDITOR.tools.fixDomain+")();document.close();")+'})())"':"",r=NEW_CKEDITOR.dom.element.createFromHtml('<iframe class="edi_pasteframe" frameborder="0"  allowTransparency="true" src="'+s+'" aria-label="'+a.pasteArea+'" aria-describedby="'+i.getContentElement("general","pasteMsg").domId+'"></iframe>');if(n=null,r.on("load",(function(n){n.removeListener(),(n=r.getFrameDocument()).write(o),e.focusManager.add(n.getBody()),NEW_CKEDITOR.env.air&&t.call(this,n.getWindow().$)}),i),r.setCustomData("dialog",i),(i=this.getElement()).setHtml(""),i.append(r),NEW_CKEDITOR.env.ie&&!NEW_CKEDITOR.env.edge){var d=NEW_CKEDITOR.dom.element.createFromHtml('<span tabindex="-1" style="position:absolute" role="presentation"></span>');d.on("focus",(function(){setTimeout((function(){r.$.contentWindow.focus()}))})),i.append(d),this.focus=function(){d.focus(),this.fire("focus")}}this.getInputElement=function(){return r},NEW_CKEDITOR.env.ie&&(i.setStyle("display","block"),i.setStyle("height",r.$.offsetHeight+2+"px"))},commit:function(){var e=this.getDialog().getParentEditor(),t=this.getInputElement().getFrameDocument().getBody(),a=t.getBogus();a&&a.remove(),t=t.getHtml(),this.getDialog()._.committed=!0,e.fire("pasteDialogCommit",{dataValue:t,dataTransfer:n||i.initPasteDataTransfer()})}}]}]}}));