(()=>{"use strict";const e=window.wp.blocks,a=window.wp.blockEditor,t=window.wp.components,l=window.wp.i18n,s=JSON.parse('{"UU":"gateway/facet-search"}'),c=window.ReactJSXRuntime;(0,e.registerBlockType)(s.UU,{edit:({attributes:e,setAttributes:s})=>{const{label:n,fieldKey:r,placeholder:i}=e,o=(0,a.useBlockProps)({className:"gateway-facet gateway-facet--search"});return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a.InspectorControls,{children:(0,c.jsxs)(t.PanelBody,{title:(0,l.__)("Facet Search Settings","gateway"),children:[(0,c.jsx)(t.TextControl,{label:(0,l.__)("Label","gateway"),value:n,onChange:e=>s({label:e})}),(0,c.jsx)(t.TextControl,{label:(0,l.__)("Placeholder","gateway"),value:i,onChange:e=>s({placeholder:e})}),(0,c.jsx)(t.TextControl,{label:(0,l.__)("Field Key","gateway"),value:r,onChange:e=>s({fieldKey:e}),help:(0,l.__)("The field to search within. Leave blank to search all fields.","gateway")})]})}),(0,c.jsxs)("div",{...o,children:[n&&(0,c.jsx)("label",{className:"gateway-facet__label",children:n}),(0,c.jsx)("input",{type:"search",className:"gateway-facet__input",placeholder:i,readOnly:!0})]})]})},save:({attributes:e})=>{const{label:t,fieldKey:l,placeholder:s}=e;return(0,c.jsxs)("div",{...a.useBlockProps.save({className:"gateway-facet gateway-facet--search"}),children:[t&&(0,c.jsx)("label",{className:"gateway-facet__label",children:t}),(0,c.jsx)("input",{type:"search",className:"gateway-facet__input",placeholder:s,"data-field-key":l||void 0,"data-wp-on--input":"actions.filterBySearch"})]})}})})();