!function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.tinymce,n=e.n(t);const o=e=>Object.keys(e).map((t=>({text:e[Number(t)],value:t}))),s=(e,t)=>({text:t.getLang("code_snippets.insert_source_menu"),onclick:()=>{e.windowManager.open({title:t.getLang("code_snippets.insert_source_title"),body:[{type:"listbox",name:"id",label:t.getLang("code_snippets.snippet_label"),values:o(t.getLang("code_snippets.all_snippets"))},{type:"checkbox",name:"line_numbers",label:t.getLang("code_snippets.show_line_numbers_label")}],onsubmit:t=>{const n=parseInt(t.data.id,10);if(!n)return;let o="";t.data.line_numbers&&(o+=" line_numbers=true"),e.insertContent(`[code_snippet_source id=${n}${o}]`)}},{})}}),i=(e,t)=>({text:t.getLang("code_snippets.insert_content_menu"),onclick:()=>{e.windowManager.open({title:t.getLang("code_snippets.insert_content_title"),body:[{type:"listbox",name:"id",label:t.getLang("code_snippets.snippet_label"),values:o(t.getLang("code_snippets.content_snippets"))},{type:"checkbox",name:"php",label:t.getLang("code_snippets.php_att_label")},{type:"checkbox",name:"format",label:t.getLang("code_snippets.format_att_label")},{type:"checkbox",name:"shortcodes",label:t.getLang("code_snippets.shortcodes_att_label")}],onsubmit:t=>{const n=parseInt(t.data.id,10);if(!n)return;let o="";for(const[e,n]of Object.entries(t.data))"id"!==e&&n&&(o+=` ${e}=${n}`);e.insertContent(`[code_snippet id=${n}${o}]`)}},{})}});n().PluginManager.add("code_snippets",(function(e){const t=n().activeEditor;e.addButton("code_snippets",{icon:"code",type:"menubutton",menu:[s(e,t),i(e,t)]})}))}();