!function(){"use strict";var n,t,e,r,o,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.VK"),a=function(n){return n.target_list},c=function(n){return n.rel_list},l=function(n){return n.link_class_list},h=function(n){return"boolean"==typeof n.link_assume_external_targets&&n.link_assume_external_targets},f=function(n){return n.link_list},p=function(n){return"string"==typeof n.default_link_target},v=function(n){return n.default_link_target},s=a,g=function(n){return!1!==a(n)},d=c,m=function(n){return c(n)!==undefined},y=l,x=function(n){return l(n)!==undefined},k=function(n){return!1!==n.link_title},b=function(n){return"boolean"==typeof n.allow_unsafe_link_target&&n.allow_unsafe_link_target},O=function(n){return!0===n.link_quicklink},w=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),_=tinymce.util.Tools.resolve("tinymce.Env"),A=function(n){if(!_.ie||10<_.ie){var t=document.createElement("a");t.target="_blank",t.href=n,t.rel="noreferrer noopener";var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),i=t,u=e,document.body.appendChild(i),i.dispatchEvent(u),document.body.removeChild(i)}else{var r=window.open("","_blank");if(r){r.opener=null;var o=r.document;o.open(),o.write(''),o.close()}}var i,u},T=tinymce.util.Tools.resolve("tinymce.util.Tools"),C=function(n,t){var e,r,o=["noopener"],i=n?n.split(/\s+/):[],u=function(n){return n.filter(function(n){return-1===T.inArray(o,n)})};return(i=t?(e=u(e=i)).length?e.concat(o):o:u(i)).length?(r=i,T.trim(r.sort().join(" "))):null},N=function(n,t){return t=t||n.selection.getNode(),D(t)?n.dom.select("a[href]",t)[0]:n.dom.getParent(t,"a[href]")},S=function(n){return n&&"A"===n.nodeName&&n.href},D=function(n){return n&&"FIGURE"===n.nodeName&&/\bimage\b/i.test(n.className)},M=function(n,t){var e,r;(r=n.dom.select("img",t)[0])&&(e=n.dom.getParents(r,"a[href]",t)[0])&&(e.parentNode.insertBefore(r,e),n.dom.remove(e))},z=function(n,t,e){var r,o;(o=n.dom.select("img",t)[0])&&(r=n.dom.create("a",e),o.parentNode.insertBefore(r,o),r.appendChild(o))},U=function(o,i){return function(r){o.undoManager.transact(function(){var n=o.selection.getNode(),t=N(o,n),e={href:r.href,target:r.target?r.target:null,rel:r.rel?r.rel:null,"class":r["class"]?r["class"]:null,title:r.title?r.title:null};m(o.settings)||!1!==b(o.settings)||(e.rel=C(e.rel,"_blank"===e.target)),r.href===i.href&&(i.attach(),i={}),t?(o.focus(),r.hasOwnProperty("text")&&("innerText"in t?t.innerText=r.text:t.textContent=r.text),o.dom.setAttribs(t,e),o.selection.select(t),o.undoManager.add()):D(n)?z(o,n,e):r.hasOwnProperty("text")?o.insertContent(o.dom.createHTML("a",e,o.dom.encode(r.text))):o.execCommand("mceInsertLink",!1,e)})}},E=function(t){return function(){t.undoManager.transact(function(){var n=t.selection.getNode();D(n)?M(t,n):t.execCommand("unlink")})}},P=function(n){return 0]+>[^<]+<\/a>$/.test(n)||-1===n.indexOf("href=")))},R=N,K=function(n,t){var e=t?t.innerText||t.textContent:n.getContent({format:"text"});return e.replace(/\uFEFF/g,"")},q=C,j=function(){for(var n=[],t=0;t"));var r={href:t.url.value,attach:t.url.meta!==undefined&&t.url.meta.attach?t.url.meta.attach:function(){}},o=U(u,r),i=E(u);t.url.value?((c.is(t.text)||a.optNode.isNone()&&!t.text)&&delete e.text,console.log("result data",e),bn(u,l,e).get(function(n){console.log("preprocessed",n),o(n)}),n.close()):i()});return e=d,o=(t=n).anchor.text.map(function(){return{name:"text",type:"input",label:"Text to display"}}).toArray(),i=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],f={url:{value:(r=t).anchor.url.getOr(""),meta:{attach:function(){},text:r.anchor.text.getOr(""),original:{value:r.anchor.url.getOr("")}}},text:r.anchor.text.getOr(""),title:r.anchor.title.getOr(""),anchor:r.anchor.url.getOr(""),link:r.anchor.url.getOr(""),rel:r.anchor.rel.getOr(""),target:r.anchor.target.getOr(""),classz:r.anchor.linkClass.getOr("")},s=dn(f,t),g=t.catalogs,{title:"Insert link",size:"normal",body:{type:"panel",items:en([[{name:"url",type:"urlinput",filetype:"file",label:"Url"}],o,i,function(n){for(var t=[],e=function(n){t.push(n)},r=0;r