(()=>{"use strict";const e=window.ReactJSXRuntime,{__}=wp.i18n,{registerBlockType:t}=wp.blocks,{RichText:a,MediaUpload:n,InspectorControls:l,InnerBlocks:i}=wp.blockEditor,{Button:s,PanelBody:o,SelectControl:g}=wp.components;t("xgate/stage",{title:__("Stage","xgate"),icon:"smiley",category:"xgate-blocks",attributes:{title:{type:"string"},subtitle:{type:"string"},content:{type:"string"},imageUrl:{type:"string"},imageId:{type:"number"},variant:{type:"string",default:"content-center"},design:{type:"string",default:"blue-white"}},edit:function(t){const{attributes:i,setAttributes:r,className:c}=t,{title:u,subtitle:d,content:x,imageUrl:b,variant:h,design:p}=i;return(0,e.jsxs)("div",{className:c,children:[(0,e.jsx)(l,{children:(0,e.jsxs)(o,{title:__("Block Settings","xgate"),children:[(0,e.jsx)(g,{label:__("Content Variant","xgate"),value:h,options:[{label:__("Center Content","xgate"),value:"content-center"},{label:__("Half Width Content","xgate"),value:"content-half"},{label:__("30% / 70% Split","xgate"),value:"content-30"},{label:__("70% / 30% Split","xgate"),value:"content-70"}],onChange:e=>{r({variant:e})}}),(0,e.jsx)(g,{label:__("Design Variant","xgate"),value:p,options:[{label:__("Blue background  White lines","xgate"),value:"blue-white"},{label:__("White background  Blue lines","xgate"),value:"white-blue"},{label:__("Dark background  White lines","xgate"),value:"dark"}],onChange:e=>{r({design:e})}})]})}),(0,e.jsx)(a,{tagName:"h1",placeholder:__("Add Title","xgate"),value:u,onChange:e=>{r({title:e})}}),(0,e.jsx)(a,{tagName:"h2",placeholder:__("Add Subtitle","xgate"),value:d,onChange:e=>{r({subtitle:e})}}),(0,e.jsx)(a,{tagName:"p",placeholder:__("Add content","xgate"),value:x,onChange:e=>{r({content:e})}}),(0,e.jsx)(n,{onSelect:e=>{r({imageUrl:e.url,imageId:e.id})},allowedTypes:["image"],value:t.attributes.imageId,render:({open:t})=>(0,e.jsx)(s,{className:"button button-large",onClick:t,children:b?(0,e.jsx)("img",{src:b,width:"50",heigh:"50",alt:__("Selected Image","xgate")}):__("Choose an image","xgate")})})]})},save:function(){return null}})})();