!function(){"use strict";var e={7005:function(e,t,r){var n=r(1609),o=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,r){var n,c={},i=null,u=null;for(n in void 0!==r&&(i=""+r),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,n)&&!l.hasOwnProperty(n)&&(c[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===c[n]&&(c[n]=t[n]);return{$$typeof:o,type:e,key:i,ref:u,props:c,_owner:s.current}}},9255:function(e,t,r){e.exports=r(7005)},1609:function(e){e.exports=window.React}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}!function(){var e=window.wp.blocks,t=window.wp.primitives,n=r(9255),o=(0,n.jsx)(t.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(t.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})}),a=window.wp.i18n,s=window.wp.coreData,l=window.wp.data,c=window.wp.blockEditor,i=window.wp.components;function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(null,arguments)}var p=JSON.parse('{"UU":"surecart/product-list-filter"}');(0,e.registerBlockType)(p.UU,{icon:o,edit:e=>{let{attributes:{taxonomy:t,label:r},setAttributes:n}=e;const o=(0,c.useBlockProps)({className:"sc-dropdown"}),{records:l}=(0,s.useEntityRecords)("root","taxonomy",{per_page:-1}),p=(l??[]).filter((e=>e.types.includes("sc_product")&&e?.visibility.public));return React.createElement("div",u({},o,{role:"menu",tabIndex:"-1"}),React.createElement(c.InspectorControls,null,React.createElement(i.PanelBody,{title:(0,a.__)("Settings")},Array.isArray(p)&&React.createElement(i.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,a.__)("Taxonomy"),options:p.map((e=>({label:e.name,value:e.slug}))),value:t,onChange:e=>n({taxonomy:e,label:p.find((t=>t.slug===e))?.name??(0,a.__)("Filter","surecart")})}))),React.createElement("button",{className:"sc-dropdown__trigger sc-button sc-button--standard sc-button--medium sc-button--caret sc-button--has-label sc-button--text"},React.createElement("span",{className:"sc-button__label"},React.createElement(c.RichText,{value:r??(0,a.__)("Filter","surecart"),withoutInteractiveFormatting:!0,allowedFormats:[],onChange:e=>n({label:e})})),React.createElement("span",{className:"sc-button__caret"},React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},React.createElement("polyline",{points:"6 9 12 15 18 9"})))))},__experimentalLabel:e=>{const t=(0,l.select)(s.store).getEntityRecords("root","taxonomy",{per_page:-1});if(!t)return!1;const r=t.find((t=>t.slug===e?.taxonomy));return!(!r||!r?.name)&&r.name}})}()}();