(()=>{"use strict";var e,t={9816(e,t,r){const n=window.wp.blocks,s=window.wp.i18n,o=window.wp.blockEditor,a=window.wp.apiFetch;var i=r.n(a);const l=window.React,p=window.ReactJSXRuntime,{Component:c,Fragment:d}=wp.element,{Panel:h,PanelBody:x,ToggleControl:u,RangeControl:v}=wp.components,m=JSON.parse('{"UU":"rsvpmaker/excerpt"}');(0,n.registerBlockType)(m.UU,{edit:function(e){const{attributes:{hide_type:t,max:r},setAttributes:n,context:a,isSelected:h}=e,{postId:m}=a,[b,w]=(0,l.useState)({});console.log(e),(0,l.useEffect)(()=>{i()({path:"/rsvpmaker/v1/excerpt/"+m+"?max="+r}).then(e=>{w(e)})},[r]);class f extends c{render(){const{attributes:{hide_type:e,max:t},setAttributes:r,isSelected:n}=this.props;return void 0===e&&(e=!1),(0,p.jsx)("div",{children:(0,p.jsx)(o.InspectorControls,{children:(0,p.jsxs)(x,{title:(0,s.__)("RSVPMaker Excerpt","rsvpmaker"),children:[(0,p.jsx)(v,{label:"Max Number of Words",value:t,onChange:e=>r({max:e}),min:10,max:110}),(0,p.jsx)(u,{label:(0,s.__)("Hide Event Type","rsvpmaker"),checked:e,onChange:e=>{r({hide_type:e})}}),(0,p.jsx)("p",{children:(0,p.jsx)("em",{children:"By default, any RSVPMaker Event Types that have been set will be shown beneath the excerpt. An Event Type is similar to a blog post category."})})]})},"excerptinspector")})}}return(0,p.jsx)(d,{children:(0,p.jsxs)("div",{...(0,o.useBlockProps)(),children:[(0,p.jsx)(f,{...e}),b.excerpt&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("p",{children:b.excerpt}),!t&&b.types&&(0,p.jsx)("p",{className:"rsvpmeta",dangerouslySetInnerHTML:{__html:b.types}})]}),!b.excerpt&&(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("p",{children:"Loading ..."})})]})})},save:function(){return null}})}},r={};function n(e){var s=r[e];if(void 0!==s)return s.exports;var o=r[e]={exports:{}};return t[e](o,o.exports,n),o.exports}n.m=t,e=[],n.O=(t,r,s,o)=>{if(!r){var a=1/0;for(c=0;c<e.length;c++){for(var[r,s,o]=e[c],i=!0,l=0;l<r.length;l++)(!1&o||a>=o)&&Object.keys(n.O).every(e=>n.O[e](r[l]))?r.splice(l--,1):(i=!1,o<a&&(a=o));if(i){e.splice(c--,1);var p=s();void 0!==p&&(t=p)}}return t}o=o||0;for(var c=e.length;c>0&&e[c-1][2]>o;c--)e[c]=e[c-1];e[c]=[r,s,o]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={2491:0,5651:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var s,o,[a,i,l]=r,p=0;if(a.some(t=>0!==e[t])){for(s in i)n.o(i,s)&&(n.m[s]=i[s]);if(l)var c=l(n)}for(t&&t(r);p<a.length;p++)o=a[p],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return n.O(c)},r=globalThis.webpackChunkadmin=globalThis.webpackChunkadmin||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var s=n.O(void 0,[5651],()=>n(9816));s=n.O(s)})();