(()=>{"use strict";var e,t={952(){const e=window.wp.blocks,t=window.wp.blockEditor,n=window.wp.components,l=window.wp.i18n,o=window.ReactJSXRuntime,a=JSON.parse('{"UU":"clanbite/event-rsvp"}');(0,e.registerBlockType)(a.UU,{edit:function({attributes:e,setAttributes:a,context:r}){var i,c;const{eventType:s,eventId:p,showAttendees:v}=e,_=null!==(i=r?.postId)&&void 0!==i?i:0,b=null!==(c=r?.postType)&&void 0!==c?c:"",d=p>0?p:_>0&&("match"===s&&"clanbite_match"===b||"group"===s&&"cp_group"===b||"clanbite_event"===s&&"clanbite_event"===b)?_:0,u=(0,t.useBlockProps)({className:"clanbite-event-rsvp-editor"}),h="group"===s?(0,l.__)("Group","clanbite"):"clanbite_event"===s?(0,l.__)("Event","clanbite"):(0,l.__)("Match","clanbite");return(0,o.jsxs)("div",{...u,children:[(0,o.jsx)(t.InspectorControls,{children:(0,o.jsxs)(n.PanelBody,{title:(0,l.__)("Event","clanbite"),children:[(0,o.jsx)(n.SelectControl,{label:(0,l.__)("Event type","clanbite"),value:s,options:[{label:(0,l.__)("Match (cp_match)","clanbite"),value:"match"},{label:(0,l.__)("Group (cp_group)","clanbite"),value:"group"},{label:(0,l.__)("Scheduled event (cp_event)","clanbite"),value:"clanbite_event"}],onChange:e=>a({eventType:e})}),(0,o.jsx)(n.TextControl,{label:(0,l.__)("Event ID (optional)","clanbite"),help:(0,l.__)("Leave 0 to use the current template post in the editor or on single event pages.","clanbite"),type:"number",value:p||"",onChange:e=>a({eventId:parseInt(e,10)||0}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,o.jsx)(n.ToggleControl,{label:(0,l.__)("Show attendee list","clanbite"),checked:v,onChange:e=>a({showAttendees:e}),__nextHasNoMarginBottom:!0})]})}),(0,o.jsx)("p",{className:"clanbite-event-rsvp-editor__title",children:(0,o.jsx)("strong",{children:(0,l.__)("Event RSVP","clanbite")})}),d<1&&(0,o.jsx)("p",{children:(0,l.__)("Select a match or group template, or set an event ID.","clanbite")}),d>0&&(0,o.jsx)("p",{children:(0,l.sprintf)(/* translators: 1: event kind, 2: numeric ID */ /* translators: 1: event kind, 2: numeric ID */
(0,l.__)("Linked %1$s — ID %2$d","clanbite"),h,d)})]})}})}},n={};function l(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,l),a.exports}l.m=t,e=[],l.O=(t,n,o,a)=>{if(!n){var r=1/0;for(p=0;p<e.length;p++){for(var[n,o,a]=e[p],i=!0,c=0;c<n.length;c++)(!1&a||r>=a)&&Object.keys(l.O).every(e=>l.O[e](n[c]))?n.splice(c--,1):(i=!1,a<r&&(r=a));if(i){e.splice(p--,1);var s=o();void 0!==s&&(t=s)}}return t}a=a||0;for(var p=e.length;p>0&&e[p-1][2]>a;p--)e[p]=e[p-1];e[p]=[n,o,a]},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={4172:0,7044:0};l.O.j=t=>0===e[t];var t=(t,n)=>{var o,a,[r,i,c]=n,s=0;if(r.some(t=>0!==e[t])){for(o in i)l.o(i,o)&&(l.m[o]=i[o]);if(c)var p=c(l)}for(t&&t(n);s<r.length;s++)a=r[s],l.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return l.O(p)},n=globalThis.webpackChunkclanbite=globalThis.webpackChunkclanbite||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var o=l.O(void 0,[7044],()=>l(952));o=l.O(o)})();