(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var l in r)e.o(r,l)&&!e.o(t,l)&&Object.defineProperty(t,l,{enumerable:!0,get:r[l]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,r=window.React,l=window.wp.blockEditor,s=window.wp.components,n=window.wp.i18n,a=window.wp.serverSideRender;var o=e.n(a);const i=window.bp.blockData,d=[{label:(0,n._x)("Newest","Members","buddypress"),value:"newest"},{label:(0,n._x)("Active","Members","buddypress"),value:"active"},{label:(0,n._x)("Popular","Members","buddypress"),value:"popular"}],b=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"bp/dynamic-members","title":"Dynamic Members List","category":"widgets","icon":"groups","description":"A dynamic list of recently active, popular, and newest members.","keywords":["BuddyPress","members","community"],"textdomain":"buddypress","attributes":{"title":{"type":"string","default":""},"maxMembers":{"type":"number","default":5},"memberDefault":{"type":"string","default":"active"},"linkTitle":{"type":"boolean","default":false}},"supports":{"align":true},"editorScript":"file:index.js","style":"file:index.css"}');(0,t.registerBlockType)(b,{icon:{background:"#fff",foreground:"#d84800",src:"groups"},edit:({attributes:e,setAttributes:t})=>{const a=(0,l.useBlockProps)(),{title:b,maxMembers:m,memberDefault:u,linkTitle:c}=e,p=(0,i.isActive)("friends")?d:d.filter((e=>"popular"!==e.value)),y=b||(0,n.__)("Members","buddypress"),w={...e,title:y};return(0,r.createElement)("div",{...a},(0,r.createElement)(l.InspectorControls,null,(0,r.createElement)(s.PanelBody,{title:(0,n.__)("Settings","buddypress"),initialOpen:!0},(0,r.createElement)(s.TextControl,{label:(0,n.__)("Title","buddypress"),value:y,onChange:e=>{t({title:e})}}),(0,r.createElement)(s.RangeControl,{label:(0,n.__)("Max members to show","buddypress"),value:m,onChange:e=>t({maxMembers:e}),min:1,max:10,required:!0}),(0,r.createElement)(s.SelectControl,{label:(0,n.__)("Default members to show","buddypress"),value:u,options:p,onChange:e=>{t({memberDefault:e})}}),(0,r.createElement)(s.ToggleControl,{label:(0,n.__)("Link block title to Members directory","buddypress"),checked:!!c,onChange:()=>{t({linkTitle:!c})}}))),(0,r.createElement)(s.Disabled,null,(0,r.createElement)(o(),{block:"bp/dynamic-members",attributes:w})))}})})();