(()=>{"use strict";var e,o={234:()=>{const e=window.wp.blocks,o=window.wp.blockEditor,r=window.wp.components,t=window.wp.data,n=window.wp.primitives,i=JSON.parse('{"UU":"ninodem/icon","hO":["ninodem/icon-path"]}'),l=window.ReactJSXRuntime,c=()=>(0,l.jsx)(n.SVG,{width:"24",height:"24",viewBox:"0 0 150 150",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",children:(0,l.jsx)(n.Path,{d:"M0 76.468 76.468 0 150 73.532 73.532 150z",fill:"currentColor"})});(0,e.registerBlockType)(i.UU,{transforms:{from:[{type:"block",blocks:["core/image"],transform:o=>{const r=o.url,t=o.width;console.log("core/image attributes",o),console.log("core/image imageUrl",r),console.log("core/image width",t);const n=r.split("/").pop().replace(".svg","");console.log("core/image iconName",n);const i=[(0,e.createBlock)("ninodem/icon-path",{name:n})];return(0,e.createBlock)("ninodem/icon",{},i)}}]},icon:()=>(0,l.jsx)(n.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,l.jsx)(n.Path,{d:"M12 2L15 8H9L12 2zM12 22L9 16H15L12 22zM2 12L8 9V15L2 12zM22 12L16 15V9L22 12z",fill:"currentColor"})}),edit:e=>{const{clientId:n,isSelected:s}=e,{removeBlock:a}=(0,t.useDispatch)("core/block-editor"),d=(0,t.useSelect)((e=>e("core/block-editor").getBlocks(n)),[n]),h=d.length>0;return(0,l.jsxs)("div",{...(0,o.useBlockProps)(),children:[h&&(0,l.jsx)(o.BlockControls,{group:"other",children:(0,l.jsx)(r.ToolbarButton,{label:"Substituir",text:"Substituir",icon:null,onClick:()=>{h&&a(d[0].clientId),setTimeout((()=>{document.querySelector(`[data-block="${n}"] .block-editor-button-block-appender`)?.click()}),100)}})}),(0,l.jsx)(o.InnerBlocks,{placeholder:!s&&c,allowedBlocks:i.hO,renderAppender:!h&&o.InnerBlocks.ButtonBlockAppender})]})},save:({attributes:e})=>(0,l.jsx)("svg",{...o.useBlockProps.save(),width:"24",height:"24",viewBox:"0 0 150 150",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",children:(0,l.jsx)(o.InnerBlocks.Content,{})})})}},r={};function t(e){var n=r[e];if(void 0!==n)return n.exports;var i=r[e]={exports:{}};return o[e](i,i.exports,t),i.exports}t.m=o,e=[],t.O=(o,r,n,i)=>{if(!r){var l=1/0;for(d=0;d<e.length;d++){for(var[r,n,i]=e[d],c=!0,s=0;s<r.length;s++)(!1&i||l>=i)&&Object.keys(t.O).every((e=>t.O[e](r[s])))?r.splice(s--,1):(c=!1,i<l&&(l=i));if(c){e.splice(d--,1);var a=n();void 0!==a&&(o=a)}}return o}i=i||0;for(var d=e.length;d>0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[r,n,i]},t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={185:0,269:0};t.O.j=o=>0===e[o];var o=(o,r)=>{var n,i,[l,c,s]=r,a=0;if(l.some((o=>0!==e[o]))){for(n in c)t.o(c,n)&&(t.m[n]=c[n]);if(s)var d=s(t)}for(o&&o(r);a<l.length;a++)i=l[a],t.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return t.O(d)},r=globalThis.webpackChunk=globalThis.webpackChunk||[];r.forEach(o.bind(null,0)),r.push=o.bind(null,r.push.bind(r))})();var n=t.O(void 0,[269],(()=>t(234)));n=t.O(n)})();