(()=>{"use strict";var e={n:t=>{var l=t&&t.__esModule?()=>t.default:()=>t;return e.d(l,{a:l}),l},d:(t,l)=>{for(var o in l)e.o(l,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:l[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,l=window.wp.blockEditor,o=window.wp.serverSideRender;var n=e.n(o);const s=window.wp.components,a=JSON.parse('{"UU":"ggmc/product-filter"}'),r=window.ReactJSXRuntime;(0,t.registerBlockType)(a.UU,{edit:({attributes:e,setAttributes:t})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(l.InspectorControls,{children:[(0,r.jsxs)(s.PanelBody,{title:"Filter Options",children:[(0,r.jsx)(s.ToggleControl,{label:"Show Title",checked:"yes"===e.show_title,onChange:e=>t({show_title:e?"yes":"no"})}),"yes"===e.show_title&&(0,r.jsx)(s.TextControl,{label:"Filter Title",value:e.filter_title,onChange:e=>t({filter_title:e})}),(0,r.jsx)(s.ToggleControl,{label:"Show Search Box",checked:"yes"===e.show_search,onChange:e=>t({show_search:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Categories Filter",checked:"yes"===e.show_categories,onChange:e=>t({show_categories:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Tags Filter",checked:"yes"===e.show_tags,onChange:e=>t({show_tags:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Hide Empty Categories/Tags",checked:"yes"===e.hide_empty,onChange:e=>t({hide_empty:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Price Range",checked:"yes"===e.show_price_range,onChange:e=>t({show_price_range:e?"yes":"no"})}),"yes"===e.show_price_range&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.SelectControl,{label:"Price Range Display",value:e.price_range_display_type,options:[{label:"Range Slider",value:"slider"},{label:"Min/Max Inputs",value:"inputs"}],onChange:e=>t({price_range_display_type:e})}),(0,r.jsx)(s.__experimentalNumberControl,{label:"Minimum Price",value:e.min_price,onChange:e=>t({min_price:parseInt(e)||0}),min:0}),(0,r.jsx)(s.__experimentalNumberControl,{label:"Maximum Price",value:e.max_price,onChange:e=>t({max_price:parseInt(e)||1e3}),min:1})]}),(0,r.jsx)(s.ToggleControl,{label:"Show Stock Filter",checked:"yes"===e.show_stock_filter,onChange:e=>t({show_stock_filter:e?"yes":"no"})})]}),(0,r.jsxs)(s.PanelBody,{title:"Attribute Filters",initialOpen:!1,children:[(0,r.jsx)(s.ToggleControl,{label:"Show Attribute Filters",checked:"yes"===e.show_attribute_filters,onChange:e=>t({show_attribute_filters:e?"yes":"no"})}),"yes"===e.show_attribute_filters&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.SelectControl,{label:"Attribute Display",value:e.attribute_filter_type,options:[{label:"Checkboxes",value:"checkbox"},{label:"Dropdown",value:"dropdown"}],onChange:e=>t({attribute_filter_type:e})}),(0,r.jsx)(s.SelectControl,{label:"Number Attribute Display",value:e.number_attribute_type,options:[{label:"Range Slider",value:"slider"},{label:"Min/Max Inputs",value:"inputs"}],onChange:e=>t({number_attribute_type:e})}),(0,r.jsx)(s.ToggleControl,{label:"Show Units",help:"Display unit suffix (kg, cm, etc.) next to values",checked:"yes"===e.show_attribute_units,onChange:e=>t({show_attribute_units:e?"yes":"no"})}),(0,r.jsx)(s.ToggleControl,{label:"Show Product Counts",checked:"yes"===e.show_attribute_counts,onChange:e=>t({show_attribute_counts:e?"yes":"no"})}),(0,r.jsx)(s.SelectControl,{label:"Label Display",value:e.attribute_label_display,options:[{label:"Name Only",value:"name"},{label:"Name + Icon",value:"name_icon"},{label:"Icon Only",value:"icon"}],onChange:e=>t({attribute_label_display:e})})]})]})]}),(0,r.jsx)(n(),{block:a.UU,attributes:e})]}),save:()=>null})})();