"+P("Welcome to the wonderful world of blocks…")+"
"}},merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),transforms:x,edit:function({clientId:e,attributes:{content:t},setAttributes:o,onReplace:a}){const s=m(!1);return p(()=>{if(!s.current)return;const o=window.tinymce.get(`editor-${e}`);let r;o&&(r=o.getContent()),r!==t&&o.setContent(t||"")},[t]),p(()=>{const{baseURL:c,suffix:i}=window.wpEditorL10n.tinymce;function l(e){let r;t&&e.on("loadContent",()=>e.setContent(t)),e.on("blur",()=>{r=e.selection.getBookmark(2,!0);const t=document.querySelector(".interface-interface-skeleton__content"),n=t.scrollTop;return o({content:e.getContent()}),e.once("focus",()=>{r&&(e.selection.moveToBookmark(r),t.scrollTop!==n&&(t.scrollTop=n))}),!1}),e.on("mousedown touchstart",()=>{r=null});const c=n(()=>{const t=e.getContent();t!==e._lastChange&&(e._lastChange=t,o({content:t}))},250);e.on("Paste Change input Undo Redo",c),e.on("remove",c.cancel),e.on("keydown",t=>{k.primary(t,"z")&&t.stopPropagation(),t.keyCode!==b&&t.keyCode!==f||!function(e){const t=e.getBody();return!(t.childNodes.length>1)&&(0===t.childNodes.length||!(t.childNodes[0].childNodes.length>1)&&/^\n?$/.test(t.innerText||t.textContent))}(e)||(a([]),t.preventDefault(),t.stopImmediatePropagation());const{altKey:o}=t;o&&t.keyCode===g&&t.stopPropagation()}),e.on("init",()=>{const t=e.getBody();t.ownerDocument.activeElement===t&&(t.blur(),e.focus())})}function d(){const{settings:t}=window.wpEditorL10n.tinymce;r.oldEditor.initialize(`editor-${e}`,{tinymce:{...t,inline:!0,content_css:!1,fixed_toolbar_container:`#toolbar-${e}`,setup:l}})}function u(){"complete"===document.readyState&&d()}return s.current=!0,window.tinymce.EditorManager.overrideDefaults({base_url:c,suffix:i}),"complete"===document.readyState?d():document.addEventListener("readystatechange",u),()=>{document.removeEventListener("readystatechange",u),r.oldEditor.remove(`editor-${e}`)}},[]),d("div",i(),d("div",{key:"toolbar",id:`toolbar-${e}`,className:"block-library-classic__toolbar tma-classic-paragraph__toolbar",onClick:function(){const t=window.tinymce.get(`editor-${e}`);t&&t.focus()},"data-placeholder":c.classicParagraphTitle,onKeyDown:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}}),d("div",{key:"editor",id:`editor-${e}`,className:"wp-block-freeform block-library-rich-text__tinymce tma-classic-paragraph"}))},save:function({attributes:e}){const{content:t}=e;return h(y,null,t)}};const{dispatch:O,select:j}=wp.data,{createBlock:R,rawHandler:$}=wp.blocks;var D=function(){const e=j("core/block-editor").getSelectedBlock();let t;if(e){let o=e.attributes.content;o?(//.test(o)&&(o=o.replace(/
/g,"
")),t=$({HTML:o})):t=R("core/paragraph"),O("core/block-editor").replaceBlocks(e.clientId,t)}};!function(){const e=window.wp,t=window.tadvBlockRegister;if(!e||!t)return;const{createElement:o}=e.element,{__:r}=e.i18n,{addFilter:n}=e.hooks,{PluginBlockSettingsMenuItem:c}=e.editPost,{registerPlugin:a}=e.plugins,{registerBlockType:i,setDefaultBlockName:s}=e.blocks;t.classicParagraph?(i("tadv/classic-paragraph",N),a("tadv-add-submenu",{render:()=>(t.hybridMode&&s("tadv/classic-paragraph"),o(c,{allowedBlocks:["tadv/classic-paragraph"],icon:"screenoptions",label:r("Convert to Blocks"),onClick:D}))})):t.hybridMode&&a("tadv-set-default-block",{render:()=>(s("core/freeform"),null)})}()}]);