/* Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ !function(){function e(e,t){var n=CKEDITOR.plugins.getPath("preview"),i=e.config,a=e.title,o=function(){var e=location.origin,t=location.pathname;return i.baseHref||CKEDITOR.env.gecko?i.baseHref?''.replace("{HREF}",i.baseHref):(t=t.split("/"),t.pop(),t=t.join("/"),''.replace("{HREF}",e+t+"/")):""}();return i.fullPage?e.getData().replace(//,"$&"+o).replace(/[^>]*(?=<\/title>)/,"$& — "+a):i.docType+''+o+""+a+""+CKEDITOR.tools.buildStyleHtml(i.contentsCss)+''+function(){var t="",n=e.document&&e.document.getBody();return n?(n.getAttribute("id")&&(t=t.replace(">",' id="'+n.getAttribute("id")+'">')),n.getAttribute("class")&&(t=t.replace(">",' class="'+n.getAttribute("class")+'">')),t):t}()+e.getData()+(t?"":"")+""}function t(){var e=window.screen;return{width:Math.round(.8*e.width),height:Math.round(.7*e.height),left:Math.round(.1*e.width)}}function n(){var e=CKEDITOR.plugins.getPath("preview");return CKEDITOR.env.gecko?CKEDITOR.getUrl(e+"preview.html"):""}CKEDITOR.plugins.add("preview",{lang:"af,ar,az,bg,bn,bs,ca,cs,cy,da,de,de-ch,el,en,en-au,en-ca,en-gb,eo,es,es-mx,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,oc,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn",icons:"preview,preview-rtl",hidpi:!0,init:function(e){e.addCommand("preview",{modes:{wysiwyg:1},canUndo:!1,readOnly:1,exec:function(){CKEDITOR.plugins.preview.createPreview(e)}}),e.ui.addButton&&e.ui.addButton("Preview",{label:e.lang.preview.preview,command:"preview",toolbar:"document,40"})}}),CKEDITOR.plugins.preview={createPreview:function(i,a){var o,r={dataValue:e(i,a)},l=t();o=CKEDITOR.env.ie||CKEDITOR.env.gecko?"javascript:void( (function(){document.open();"+("("+CKEDITOR.tools.fixDomain+")();").replace(/\/\/.*?\n/g,"").replace(/parent\./g,"window.opener.")+"document.write( window.opener._cke_htmlToLoad );document.close();window.opener._cke_htmlToLoad = null;})() )":null;var c,d,s=n();return!1===i.fire("contentPreview",r)?!1:((o||s)&&(window._cke_htmlToLoad=r.dataValue),c=window.open(s,null,["toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes","width="+l.width,"height="+l.height,"left="+l.left].join()),d=new CKEDITOR.dom.window(c),o&&c&&(c.location=o),window._cke_htmlToLoad||(l=c.document,l.open(),l.write(r.dataValue),l.close()),a&&(c.previewCallback=function(){"complete"===c.document.readyState&&a(d)},c.previewCallback()),d)}}}();