(()=>{"use strict";var e,t={7864(e,t,n){const o=window.wp.blocks,r=window.wp.i18n,i=window.wp.blockEditor,l=window.wp.apiFetch;var s=n.n(l);const a=window.React,c=window.wp.primitives,d=(0,a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(c.Path,{d:"M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"})),h=(0,a.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(c.Path,{d:"M12.5 5L10 19h1.9l2.5-14z"})),p=window.ReactJSXRuntime,{Panel:v,PanelBody:w,ToggleControl:u,Toolbar:m,ToolbarButton:b,ToolbarGroup:x}=wp.components,g=JSON.parse('{"UU":"rsvpmaker/title-date"}');(0,o.registerBlockType)(g.UU,{edit:function(e){const{attributes:t,attributes:{show_time:n,italic:o,bold:l,align:c},context:{postId:v},setAttributes:g,isSelected:f}=e,[j,k]=(0,a.useState)(null),O={display:"block"};return l&&(O.fontWeight="bold"),o&&(O.fontStyle="italic"),c&&(O.textAlign=c),console.log("post id "+v),(0,a.useEffect)(()=>{s()({path:"/rsvpmaker/v1/title-date/"+v}).then(e=>{k(e)})},[]),(0,p.jsxs)("div",{...(0,i.useBlockProps)(),children:[(0,p.jsx)(i.BlockControls,{children:(0,p.jsxs)(m,{label:"Options",children:[(0,p.jsx)(x,{children:(0,p.jsx)(i.AlignmentToolbar,{value:c,onChange:e=>{g({align:void 0===e?"none":e})}})}),(0,p.jsx)(b,{icon:d,label:"Bold",onClick:()=>g({bold:!l}),isActive:l}),(0,p.jsx)(b,{icon:h,label:"Italic",onClick:()=>g({italic:!o}),isActive:o})]})}),(0,p.jsx)(i.InspectorControls,{children:(0,p.jsx)(w,{title:(0,r.__)("Date or Date+Time","rsvpmaker"),children:(0,p.jsx)(u,{label:(0,r.__)("Show Time","rsvpmaker"),checked:n,onChange:e=>{g({show_time:e})}})})},"titledateinspector"),j&&(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("p",{children:(0,p.jsxs)("a",{href:"#",style:O,children:[j.title," - ",j.date," ",n&&(0,p.jsx)("span",{children:j.time})]})})}),!j&&(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("p",{children:"Loading ..."})})]})},save:function(){return null}})}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.m=t,e=[],o.O=(t,n,r,i)=>{if(!n){var l=1/0;for(d=0;d<e.length;d++){for(var[n,r,i]=e[d],s=!0,a=0;a<n.length;a++)(!1&i||l>=i)&&Object.keys(o.O).every(e=>o.O[e](n[a]))?n.splice(a--,1):(s=!1,i<l&&(l=i));if(s){e.splice(d--,1);var c=r();void 0!==c&&(t=c)}}return t}i=i||0;for(var d=e.length;d>0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[n,r,i]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={8145:0,3957:0};o.O.j=t=>0===e[t];var t=(t,n)=>{var r,i,[l,s,a]=n,c=0;if(l.some(t=>0!==e[t])){for(r in s)o.o(s,r)&&(o.m[r]=s[r]);if(a)var d=a(o)}for(t&&t(n);c<l.length;c++)i=l[c],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return o.O(d)},n=globalThis.webpackChunkadmin=globalThis.webpackChunkadmin||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var r=o.O(void 0,[3957],()=>o(7864));r=o.O(r)})();