(function(){tinymce.PluginManager.add("safelayout_icons",function(a){function b(a){d=a.selection.getNode();const b=d.classList.contains("safelayout-ei-icon-block");let e={};if(b){let a=d.getAttribute("sldataicon");a?e=JSON.parse(decodeURIComponent(a)):(a=d.getAttribute("dataicon"),a&&(e=JSON.parse(atob(a))))}a.windowManager.open({title:"Insert Icon (Safelayout)",classes:"sl-ei-icon-block-dialog",width:370,height:545,body:[{type:"container",html:"<style>.dashicons{font-family:dashicons !important;font-size:20px}#safelayout-ei-icon-dialog-mce rect{height: revert-layer;width: revert-layer;}.block-editor-tools-panel-color-gradient-settings__dropdown{margin-bottom: 4px;}</style><div id=\"safelayout-ei-icon-dialog-mce\"></div>"}],onsubmit(){const e=SLEImceIcons.att;SLEImceIcons.icon(c,e);const f=encodeURIComponent(JSON.stringify(e));setTimeout(function(){const g=c.innerHTML.replaceAll("div","span").replace("<svg ","<svg data-safelayout-mce-icon=\"1\" ").replace("<style","<sl-bb-custom1359").replace("</style","</sl-bb-custom1359");b&&a.selection.select(d),a.insertContent(`<span contenteditable="false" class="safelayout-ei-icon-block ${e.classes||""}" style="display: inline-block;position: relative;top: ${e.top}px;" sldataicon="${f}">${g}&nbsp;</span>`)},2)}}),setTimeout(()=>SLEImceIcons.menu(document.getElementById("safelayout-ei-icon-dialog-mce"),e),2),SLEImceIcons.cssKey||(SLEImceIcons.cssKey=!0,document.querySelectorAll("link[rel=\"stylesheet\"][href*=\"tinymce\"]").forEach(a=>document.head.prepend(a)))}const c=document.createElement("div");let d;SLEImceIcons.cssKey=!1,a.addButton("safelayout_icons",{image:"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0IiB3aWR0aD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9InNsLWVpLW1haW4taWNvbi1ncmFkMDAxIiB4MT0iMC4xNSIgeTE9IjAuODUiIHgyPSIwLjg1IiB5Mj0iMC4xNSI+PHN0b3Agc3RvcC1jb2xvcj0iI0ZGNTlCRiIgb2Zmc2V0PSIwIiAvPjxzdG9wIHN0b3AtY29sb3I9IiNGRjk5RDkiIG9mZnNldD0iMC4yNSIgLz48c3RvcCBzdG9wLWNvbG9yPSIjQTZGRjY2IiBvZmZzZXQ9IjAuNzUiIC8+PHN0b3Agc3RvcC1jb2xvcj0iIzhDRkY0QyIgb2Zmc2V0PSIxIiAvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxwYXRoIGZpbGw9InVybCgjc2wtZWktbWFpbi1pY29uLWdyYWQwMDEpIiBzdHJva2U9IiMzMzMzMzMiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTExLjA3MiAxLjg3YzEuNDc1LjQ5Ni0yLjg0NyAyLjkzNS0uMTQ2IDQuNTcxIDEuNTE5LjkyIDQuODM0LTMuMjQyIDYuNDk4LTQuMTc2IDEuNDE2LS43ODkgMy44OTktLjk0OSA1LjE1NSAxLjc5NiAxLjU5MiAzLjQ3Ni4yMDQgMTIuNTE1LTUuNTM0IDE2LjE1MS01Ljc5OCAzLjY1MS0xMy4wOTkgMS43OTYtMTUuNjI2LTMuODg0LTIuOTM1LTYuNjE1IDQuNTU2LTE2LjE5NSA5LjY1Mi0xNC40NTd6bTEuNzY3IDkuNDE5YzEuMDY2IDIuMzk1IDYuODY0LS43MyA1LjUzNC00LjA4OS0uODYyLTIuMTc1LTYuNTQzIDEuODI2LTUuNTM0IDQuMDg5eiIgLz48L3N2Zz4=",tooltip:wp.i18n.__("Icon (Safelayout)","safelayout-elegant-icons"),stateSelector:["span.safelayout-ei-icon-block"],enabled:!1,onclick:()=>b(a)}),a.on("dblclick",function(){d=a.selection.getNode();const c=d.classList.contains("safelayout-ei-icon-block");c&&b(a)})})})();