(()=>{"use strict";var e,r={2581(){const e=window.wp.blocks,r=window.ReactJSXRuntime,{__}=wp.i18n,{InspectorControls:t,useBlockProps:o,InnerBlocks:a}=wp.blockEditor,{PanelBody:s,TextControl:n,ToggleControl:l}=wp.components,{useBlockProps:c,InnerBlocks:p}=wp.blockEditor,i=JSON.parse('{"UU":"rsvpmaker/formwrapper"}');(0,e.registerBlockType)(i.UU,{edit:function(e){const{attributes:c,attributes:{appslug:p,button_label:i,recaptcha:u},className:m,setAttributes:d,isSelected:h}=e,k=o({className:m});return(0,r.jsxs)("div",{...k,children:[(0,r.jsx)(t,{children:(0,r.jsxs)(s,{title:__("Form Options","rsvpmaker"),children:[(0,r.jsx)(n,{label:__("Button Label","rsvpmaker"),value:i,onChange:e=>{d({button_label:e})}}),(0,r.jsx)(n,{label:__("App Slug","rsvpmaker"),value:p,onChange:e=>{d({appslug:e})}}),(0,r.jsx)("p",{children:(0,r.jsxs)("em",{children:['Leave the App Slug as "contact" for the built-in contact form. Change it to integrate with your own custom app (see ',(0,r.jsx)("a",{href:"https://rsvpmaker.com/knowledge-base/rsvpmaker-form-wrapper-block/",children:"documentation"}),")."]})}),(0,r.jsx)(l,{label:__("Include ReCaptcha","rsvpmaker"),checked:u,onChange:e=>{d({recaptcha:e})}}),(0,r.jsx)("p",{children:(0,r.jsx)("em",{children:"ReCaptcha must be enabled first on the RSVPMaker Settings screen."})})]})},"formwrapperinspector"),!h&&(0,r.jsx)("p",{children:(0,r.jsx)("em",{children:"Click here to set form options"})}),(0,r.jsx)(a,{template:[["rsvpmaker/formfield",{label:"First Name",slug:"first_name"}],["rsvpmaker/formfield",{label:"Last Name",slug:"last_name"}],["rsvpmaker/formfield",{label:"Email",slug:"email",required:"required"}]]}),u&&(0,r.jsx)("div",{children:(0,r.jsx)("img",{src:"/wp-content/plugins/rsvpmaker/images/recaptcha-preview.png",height:"112",width:"426",alt:"ReCaptcha goes here"})}),(0,r.jsx)("p",{children:(0,r.jsx)("button",{children:i})})]})},save:function(e){const t=c.save(e);return(0,r.jsx)("div",{...t,children:(0,r.jsx)(p.Content,{})})},transforms:{to:[{type:"block",blocks:["core/query"],transform:r=>{const t=r.calendar&&parseInt(r.calendar)?[["rsvpmaker/calendar",r],["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."}]]]],o=(0,e.createBlocksFromInnerBlocksTemplate)(t);return(0,e.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"},o)}}]}})}},t={};function o(e){var a=t[e];if(void 0!==a)return a.exports;var s=t[e]={exports:{}};return r[e](s,s.exports,o),s.exports}o.m=r,e=[],o.O=(r,t,a,s)=>{if(!t){var n=1/0;for(i=0;i<e.length;i++){for(var[t,a,s]=e[i],l=!0,c=0;c<t.length;c++)(!1&s||n>=s)&&Object.keys(o.O).every(e=>o.O[e](t[c]))?t.splice(c--,1):(l=!1,s<n&&(n=s));if(l){e.splice(i--,1);var p=a();void 0!==p&&(r=p)}}return r}s=s||0;for(var i=e.length;i>0&&e[i-1][2]>s;i--)e[i]=e[i-1];e[i]=[t,a,s]},o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={2139:0,9539:0};o.O.j=r=>0===e[r];var r=(r,t)=>{var a,s,[n,l,c]=t,p=0;if(n.some(r=>0!==e[r])){for(a in l)o.o(l,a)&&(o.m[a]=l[a]);if(c)var i=c(o)}for(r&&r(t);p<n.length;p++)s=n[p],o.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return o.O(i)},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,[9539],()=>o(2581));a=o.O(a)})();