(()=>{"use strict";var e,a={337(){const e=window.wp.blocks,a=window.wp.i18n,l=window.wp.blockEditor,t=window.wp.components,r=window.ReactJSXRuntime,s=JSON.parse('{"UU":"sunflower/meta-data","uK":{"icon":{"type":"string","default":"fas fa-clock"},"url":{"type":"string","default":""}}}'),{uK:n}=s,o=[{attributes:n,save(e){const a=l.useBlockProps.save(),{url:t,icon:s}=e.attributes;return(0,r.jsx)("div",{...a,children:(0,r.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:(0,r.jsx)("i",{className:s})})})}},{attributes:n,save(e){const a=l.useBlockProps.save();return(0,r.jsx)("div",{...a,children:(0,r.jsx)("a",{href:e.attributes.url,target:"_blank",rel:"noopener",children:(0,r.jsx)("i",{className:e.attributes.icon})})})}}];(0,e.registerBlockType)(s.UU,{edit:function({attributes:e,setAttributes:s}){const n=(0,l.useBlockProps)({className:"row"}),{url:o,icon:i}=e;return(0,r.jsxs)("div",{...n,children:[(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(t.Disabled,{children:o?(0,r.jsx)("a",{href:o,target:"_blank",className:"sunflower-meta-data__link",rel:"noopener noreferrer",children:(0,r.jsx)("i",{className:i})}):(0,r.jsx)("i",{className:`${i} is-empty`})})}),(0,r.jsx)(l.InspectorControls,{children:(0,r.jsxs)(t.PanelBody,{title:(0,a.__)("Settings"),children:[(0,r.jsx)(t.SelectControl,{label:(0,a.__)("Predefined Icons","sunflower-meta-data"),value:[],options:[{value:"none",label:"Bitte wählen"},{value:"fab fa-x-twitter",label:"X (Twitter)"},{value:"fab fa-bluesky",label:"Bluesky"},{value:"fab fa-instagram",label:"Instagram"},{value:"fab fa-facebook-f",label:"Facebook"},{value:"fab fa-linkedin",label:"LinkedIn"},{value:"fab fa-mastodon",label:"Mastodon"},{value:"fab fa-threads",label:"Threads"},{value:"fab fa-tiktok",label:"TikTok"},{value:"fab fa-whatsapp",label:"WhatsApp"},{value:"fab fa-xing",label:"Xing"},{value:"fab fa-youtube",label:"YouTube"},{value:"fas fa-envelope",label:"E-Mail"},{value:"fas fa-globe",label:"Website"}],onChange:e=>{s({icon:void 0===e?"none":e})}}),(0,r.jsx)(t.TextControl,{label:(0,a.__)("Selected Icon","sunflower-meta-data"),help:(0,a.__)("All icons can be found at https://fontawesome.com/icons?d=gallery&m=free","sunflower-meta-data"),value:i,onChange:e=>{s({icon:void 0===e?"none":e})}}),(0,r.jsx)(t.TextControl,{label:"URL",help:(0,a.__)("Target URL the Icon is linked to. For email addresses, use the format mailto:example@example.com.","sunflower-meta-data"),value:o,placeholder:"https://gruene.social/@verdigado",onChange:e=>{/^[^\s@\/]+@[^\s@]+\.[^\s@]{2,10}$/.test(e)&&"mailto:"!==e.substring(0,7)&&(e="mailto:"+e),s({url:void 0===e?"":e})}})]})})]})},save:function(e){const a=l.useBlockProps.save(),{url:t,icon:s}=e.attributes;return(0,r.jsx)("div",{...a,children:t?(0,r.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"sunflower-meta-data__link",children:(0,r.jsx)("i",{className:s})}):(0,r.jsx)("i",{className:`${s} is-empty`})})},deprecated:o})}},l={};function t(e){var r=l[e];if(void 0!==r)return r.exports;var s=l[e]={exports:{}};return a[e](s,s.exports,t),s.exports}t.m=a,e=[],t.O=(a,l,r,s)=>{if(!l){var n=1/0;for(c=0;c<e.length;c++){for(var[l,r,s]=e[c],o=!0,i=0;i<l.length;i++)(!1&s||n>=s)&&Object.keys(t.O).every(e=>t.O[e](l[i]))?l.splice(i--,1):(o=!1,s<n&&(n=s));if(o){e.splice(c--,1);var u=r();void 0!==u&&(a=u)}}return a}s=s||0;for(var c=e.length;c>0&&e[c-1][2]>s;c--)e[c]=e[c-1];e[c]=[l,r,s]},t.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),(()=>{var e={572:0,260:0};t.O.j=a=>0===e[a];var a=(a,l)=>{var r,s,[n,o,i]=l,u=0;if(n.some(a=>0!==e[a])){for(r in o)t.o(o,r)&&(t.m[r]=o[r]);if(i)var c=i(t)}for(a&&a(l);u<n.length;u++)s=n[u],t.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return t.O(c)},l=globalThis.webpackChunksunflower=globalThis.webpackChunksunflower||[];l.forEach(a.bind(null,0)),l.push=a.bind(null,l.push.bind(l))})();var r=t.O(void 0,[260],()=>t(337));r=t.O(r)})();