var rml_gutenberg;(()=>{"use strict";const e=ReactJSXRuntime,t=(React,wp),s="real-media-library/gallery",{registerBlockType:i}=t.blocks,{G:r,SVG:n,Path:l,ServerSideRender:o,PanelBody:a,RangeControl:h,ToggleControl:p,SelectControl:d,TreeSelect:u,Notice:c,Spinner:g,Button:m,withNotices:b}=t.components,{Component:x,Fragment:C}=t.element,{InspectorControls:y,ServerSideRender:j}=t.editor,{__:v}=t.i18n,f=o||j,k=[{value:"attachment",label:v("Attachment Page")},{value:"media",label:v("Media File")},{value:"none",label:v("None")}];class w extends x{constructor(){super(...arguments),this.state={$busy:!0,tree:[]}}async componentDidMount(){const{tree:e}=await window.rml.request({location:{path:"/tree"}});e.unshift({id:-1,name:rmlOpts.others.lang.unorganized}),e.unshift({id:void 0,name:"-"}),this.setState({tree:e,$busy:!1})}render(){const{...t}=this.props,{$busy:s,tree:i}=this.state;return s?(0,e.jsx)(g,{}):(0,e.jsx)(u,{label:rmlOpts.others.lang.folder,...t,tree:i})}}i(s,{title:"Real Media Library Gallery",description:"Display folder images in a rich gallery.",icon:(0,e.jsxs)(n,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,e.jsx)(l,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,e.jsxs)(r,{children:[(0,e.jsx)(l,{d:"M20 4v12H8V4h12m0-2H8L6 4v12l2 2h12l2-2V4l-2-2z"}),(0,e.jsx)(l,{d:"M12 12l1 2 3-3 3 4H9z"}),(0,e.jsx)(l,{d:"M2 6v14l2 2h14v-2H4V6H2z"})]})]}),category:"common",supports:{align:!0},attributes:{fid:{type:"number",default:0},columns:{type:"number",default:3},imageCrop:{type:"boolean",default:!0},captions:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"},lastEditReload:{type:"number",default:0}},edit:b(class extends x{constructor(){super(...arguments),this.setFid=e=>this.props.setAttributes({fid:+e}),this.setLinkTo=e=>this.props.setAttributes({linkTo:e}),this.setColumnsNumber=e=>this.props.setAttributes({columns:e}),this.toggleImageCrop=()=>this.props.setAttributes({imageCrop:!this.props.attributes.imageCrop}),this.toggleCaptions=()=>this.props.setAttributes({captions:!this.props.attributes.captions}),this.handleReload=()=>this.props.setAttributes({lastEditReload:(new Date).getTime()}),this.render=()=>{const{attributes:t}=this.props,{fid:i,columns:r=3,imageCrop:n,captions:l,linkTo:o}=t;return(0,e.jsxs)(C,{children:[(0,e.jsx)(y,{children:(0,e.jsxs)(a,{title:v("Gallery Settings"),children:[(0,e.jsx)(w,{value:i,onChange:this.setFid}),(0,e.jsx)(h,{label:v("Columns"),value:r,onChange:this.setColumnsNumber,min:"1",max:"8"}),(0,e.jsx)(p,{label:v("Crop Images"),checked:!!n,onChange:this.toggleImageCrop}),(0,e.jsx)(p,{label:v("Caption"),checked:!!l,onChange:this.toggleCaptions}),(0,e.jsx)(d,{label:v("Link To"),value:o,onChange:this.setLinkTo,options:k}),(0,e.jsx)(m,{isPrimary:!0,onClick:this.handleReload,children:rmlOpts.others.lang.reloadContent})]})}),(0,e.jsx)(f,{block:s,attributes:t}),!i&&(0,e.jsx)(c,{status:"error",isDismissible:!1,children:(0,e.jsx)("p",{children:rmlOpts.others.lang.gutenBergBlockSelect})})]})},this.state={refresh:(new Date).getTime()}}}),save:()=>null}),rml_gutenberg={}})();
//# sourceMappingURL=https://sourcemap.devowl.io/real-media-library/4.22.67/44c85db578b5236b407257a1f3b230b0/rml_gutenberg.lite.js.map
