(()=>{"use strict";var e,r={5768(e,r,t){const o=window.wp.blocks,a=window.wp.apiFetch;var n=t.n(a);const s=window.ReactJSXRuntime,{__}=wp.i18n,{registerBlockType:l}=wp.blocks,{RichText:c}=wp.blockEditor,{Fragment:i}=wp.element,{Component:p}=wp.element,{InspectorControls:u,useBlockProps:d}=wp.blockEditor,{PanelBody:m,DateTimePicker:v,SelectControl:h,ToggleControl:k,TextControl:b}=wp.components,g=JSON.parse('{"UU":"rsvpmaker/schedule"}');(0,o.registerBlockType)(g.UU,{edit:function(e){const{attributes:r,className:t,setAttributes:o,isSelected:a,clientId:l}=e,c=d({className:t}),i=[{value:"",label:"None selected (optional)"}];return n()({path:"rsvpmaker/v1/types"}).then(e=>{Array.isArray(e)?e.map(function(e){e.slug&&e.name&&i.push({value:e.slug,label:e.name})}):Object.values(e).map(function(e){e.slug&&e.name&&i.push({value:e.slug,label:e.name})})}).catch(e=>{console.log(e)}),(0,s.jsxs)("div",{...c,children:[(0,s.jsxs)(u,{children:[(0,s.jsxs)(m,{title:__("Start Time","rsvpmaker"),children:[(0,s.jsx)(h,{label:__("Set Start Time","rsvpmaker"),value:r.start_on,onChange:e=>o({start_on:e}),options:[{value:0,label:__("No","rsvpmaker")},{value:1,label:__("Yes","rsvpmaker")}]}),r.start_on>0&&(0,s.jsx)(v,{is12Hour:!0,currentDate:r.start,onChange:e=>o({start:e})})]}),(0,s.jsxs)(m,{title:__("End Time","rsvpmaker"),children:[(0,s.jsx)(h,{label:__("Set End Time","rsvpmaker"),value:r.end_on,onChange:e=>o({end_on:e}),options:[{value:0,label:__("No","rsvpmaker")},{value:1,label:__("Yes","rsvpmaker")}]}),r.end_on>0&&(0,s.jsx)("div",{id:"endtime",children:(0,s.jsx)(v,{is12Hour:!0,currentDate:r.end,onChange:e=>o({end:e})})})]}),(0,s.jsxs)(m,{title:__("Display Options","rsvpmaker"),children:[(0,s.jsx)(k,{label:__('Display "Show in my timezone" button',"rsvpmaker"),checked:r.convert_tz,onChange:e=>{o({convert_tz:e})}}),(0,s.jsx)(h,{label:__("Event Type","rsvpmaker"),value:r.type,options:i,onChange:e=>{o({type:e})}}),(0,s.jsx)(b,{label:__("Max Events Displayed"),value:r.limit,onChange:e=>{o({limit:e})}})]})]},"scheduleinspector"),(0,s.jsx)("div",{className:"schedule-placeholder",children:__("Daily schedule of events")})]})},save:function(){return null},transforms:{to:[{type:"block",blocks:["core/query"],transform:e=>{const r=e.calendar&&parseInt(e.calendar)?[["rsvpmaker/calendar",e],["core/post-template",{layout:{type:"grid",columnCount:2}},[["core/post-title",{isLink:!0}],["core/post-featured-image"],["rsvpmaker/loop-blocks"],["core/read-more",{content:"Read More >>"}]]],["core/query-pagination"],["core/query-no-results",{},[["core/paragraph",{content:"No events found."}]]]]:[["core/post-template",{layout:{type:"grid",columnCount:2}},[["core/post-title",{isLink:!0}],["core/post-featured-image"],["rsvpmaker/loop-blocks"],["core/read-more",{content:"Read More >>"}]]],["core/query-pagination"],["core/query-no-results",{},[["core/paragraph",{content:"No events found."}]]]],t=(0,o.createBlocksFromInnerBlocksTemplate)(r);return(0,o.createBlock)("core/query",{queryId:0,query:{perPage:20,pages:0,offset:0,postType:"rsvpmaker",order:"asc",author:"",search:"",exclude:[],sticky:"",inherit:!1},namespace:"rsvpmaker/rsvpmaker-loop"},t)}}]}})}},t={};function o(e){var a=t[e];if(void 0!==a)return a.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,o),n.exports}o.m=r,e=[],o.O=(r,t,a,n)=>{if(!t){var s=1/0;for(p=0;p<e.length;p++){for(var[t,a,n]=e[p],l=!0,c=0;c<t.length;c++)(!1&n||s>=n)&&Object.keys(o.O).every(e=>o.O[e](t[c]))?t.splice(c--,1):(l=!1,n<s&&(s=n));if(l){e.splice(p--,1);var i=a();void 0!==i&&(r=i)}}return r}n=n||0;for(var p=e.length;p>0&&e[p-1][2]>n;p--)e[p]=e[p-1];e[p]=[t,a,n]},o.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return o.d(r,{a:r}),r},o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={9613:0,6193:0};o.O.j=r=>0===e[r];var r=(r,t)=>{var a,n,[s,l,c]=t,i=0;if(s.some(r=>0!==e[r])){for(a in l)o.o(l,a)&&(o.m[a]=l[a]);if(c)var p=c(o)}for(r&&r(t);i<s.length;i++)n=s[i],o.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return o.O(p)},t=globalThis.webpackChunkadmin=globalThis.webpackChunkadmin||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var a=o.O(void 0,[6193],()=>o(5768));a=o.O(a)})();