(()=>{"use strict";var e,r={9151(e,r,t){const o=window.wp.blocks,a=window.wp.i18n,n=window.React,s=window.wp.blockEditor,l=window.wp.apiFetch;var i=t.n(l);const p=window.wp.url,u=window.ReactJSXRuntime,{Fragment:c}=wp.element,{SelectControl:d,ToggleControl:v}=wp.components,m=JSON.parse('{"UU":"rsvpmaker/future-rsvp-links"}');(0,o.registerBlockType)(m.UU,{edit:function(e){const{attributes:r,setAttributes:t,attributes:{limit:o,skipfirst:l,featured_image:m}}=e,[k,f]=(0,n.useState)(null);(0,n.useEffect)(()=>{i()({path:(0,p.addQueryArgs)("/rsvpmaker/v1/preview/future-rsvp-links",r)}).then(e=>{e&&f(e)})},[r]);const g=[{label:(0,a.__)("None","rsvpmaker"),value:""},{label:(0,a.__)("Medium (up to 300 px)"),value:"medium"},{label:(0,a.__)("Medium Large (up to 768 px)"),value:"medium_large"},{label:(0,a.__)("Large (up to 1024 px)"),value:"large"}];return(0,u.jsx)(c,{children:(0,u.jsxs)("div",{...(0,s.useBlockProps)(),children:[(0,u.jsxs)(s.InspectorControls,{children:[(0,u.jsx)(d,{label:(0,a.__)("Limit","rsvpmaker"),value:o,options:[{label:"3",value:"3"},{label:"5",value:"5"},{label:"7",value:"7"},{label:"10",value:"10"}],onChange:e=>{t({limit:e})}}),(0,u.jsx)(v,{label:(0,a.__)("Skip First Date","rsvpmaker"),checked:l,help:(0,a.__)("For example, to pick up after an embedded date block that features the first event in the series."),onChange:e=>{t({skipfirst:e})}}),(0,u.jsx)(d,{label:(0,a.__)("Featured Image","rsvpmaker"),value:m,options:g,onChange:e=>{t({featured_image:e})}})]},"futurersvpinspector"),k&&(0,u.jsx)("div",{dangerouslySetInnerHTML:{__html:k}}),!k&&(0,u.jsx)("p",{children:"Future RSVP Links loading ..."})]})})},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(u=0;u<e.length;u++){for(var[t,a,n]=e[u],l=!0,i=0;i<t.length;i++)(!1&n||s>=n)&&Object.keys(o.O).every(e=>o.O[e](t[i]))?t.splice(i--,1):(l=!1,n<s&&(s=n));if(l){e.splice(u--,1);var p=a();void 0!==p&&(r=p)}}return r}n=n||0;for(var u=e.length;u>0&&e[u-1][2]>n;u--)e[u]=e[u-1];e[u]=[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={8205:0,5985:0};o.O.j=r=>0===e[r];var r=(r,t)=>{var a,n,[s,l,i]=t,p=0;if(s.some(r=>0!==e[r])){for(a in l)o.o(l,a)&&(o.m[a]=l[a]);if(i)var u=i(o)}for(r&&r(t);p<s.length;p++)n=s[p],o.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return o.O(u)},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,[5985],()=>o(9151));a=o.O(a)})();