(()=>{"use strict";var e={n:l=>{var a=l&&l.__esModule?()=>l.default:()=>l;return e.d(a,{a}),a},d:(l,a)=>{for(var t in a)e.o(a,t)&&!e.o(l,t)&&Object.defineProperty(l,t,{enumerable:!0,get:a[t]})},o:(e,l)=>Object.prototype.hasOwnProperty.call(e,l)};const l=window.wp.blocks,a=JSON.parse('{"u2":"foxiz/related"}'),t=window.wp.element,n=window.wp.i18n,o=window.wp.components,r=window.wp.blockEditor,_=window.wp.serverSideRender;var u=e.n(_);(0,l.registerBlockType)(a.u2,{edit:function(e){const{attributes:l,setAttributes:a}=e,{heading:_,heading_tag:i,total:s,layout:d,ids:b,where:v,order:c}=l,p=(e,l)=>{a({[e]:l})},g=[{label:(0,n.__)("Layout 1"),value:"1"},{label:(0,n.__)("Layout 2"),value:"2"},{label:(0,n.__)("Layout 3"),value:"3"},{label:(0,n.__)("Layout 4"),value:"4"},{label:(0,n.__)("Layout 5"),value:"5"},{label:(0,n.__)("Layout 6"),value:"6"}],m=[{label:(0,n.__)("Same Tags and Categories"),value:"all"},{label:(0,n.__)("Categories"),value:"category"},{label:(0,n.__)("Tags"),value:"tag"}],h=[{label:(0,n.__)("Relevance"),value:"relevance"},{label:(0,n.__)("Random"),value:"rand"},{label:(0,n.__)("Last Published"),value:"date"},{label:(0,n.__)("Last Updated"),value:"modified"}],w=[{label:(0,n.__)("H2"),value:"h2"},{label:(0,n.__)("H3"),value:"h3"},{label:(0,n.__)("H4"),value:"h4"},{label:(0,n.__)("H5"),value:"h5"},{label:(0,n.__)("H6"),value:"h6"},{label:(0,n.__)("p"),value:"p"},{label:(0,n.__)("Div"),value:"div"}],y=(0,r.useBlockProps)({className:"gb-wrap rb-gutenberg-related"});return(0,t.createElement)("div",y,(0,t.createElement)(r.InspectorControls,null,(0,t.createElement)(o.PanelBody,{title:(0,n.__)("General"),initialOpen:!0},(0,t.createElement)(o.SelectControl,{label:(0,n.__)("Layout"),value:d,options:g,onChange:e=>p("layout",e)}),(0,t.createElement)(o.TextControl,{value:_,label:(0,n.__)("Heading"),onChange:e=>p("heading",e)}),(0,t.createElement)(o.SelectControl,{label:(0,n.__)("Heading Tag"),value:i,options:w,onChange:e=>p("heading_tag",e)})),(0,t.createElement)(o.PanelBody,{title:(0,n.__)("Query Filters"),initialOpen:!0},(0,t.createElement)(o.SelectControl,{label:(0,n.__)("Where get Posts?"),value:v,options:m,onChange:e=>p("where",e)}),(0,t.createElement)(o.TextControl,{label:(0,n.__)("or Custom IDs?"),help:(0,n.__)("Input post IDs, separated by commas (,)"),value:b,onChange:e=>p("ids",e)}),(0,t.createElement)(o.SelectControl,{label:(0,n.__)("Order Posts?"),value:c,options:h,onChange:e=>p("order",e)}),(0,t.createElement)(o.RangeControl,{label:(0,n.__)("Total"),value:s,onChange:e=>p("total",e),step:1,max:30,min:0}))),(0,t.createElement)(o.Disabled,null,(0,t.createElement)(u(),{block:"foxiz/related",attributes:l})))},save:function(){return null}})})();