(()=>{"use strict";var e={n:o=>{var t=o&&o.__esModule?()=>o.default:()=>o;return e.d(t,{a:t}),t},d:(o,t)=>{for(var a in t)e.o(t,a)&&!e.o(o,a)&&Object.defineProperty(o,a,{enumerable:!0,get:t[a]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.wp.i18n,t=window.wp.element,a=window.wp.domReady;var r=e.n(a);const n=window.wp.hooks,l=window.dokan.components,d=window.ReactJSXRuntime;function i({filterArgs:e,setFilterArgs:t}){var a;const r=(0,n.applyFilters)("dokan_get_other_product_filters",[{value:"featured",label:(0,o.__)("Featured","dokan")},{value:"top_rated",label:(0,o.__)("Top Rated","dokan")},{value:"best_selling",label:(0,o.__)("Best Selling","dokan")},{value:"low_stock",label:(0,o.__)("Low on Stock","dokan")},{value:"out_of_stock",label:(0,o.__)("Out of Stock","dokan")}]);return(0,d.jsx)(l.Select,{isClearable:!0,placeholder:(0,o.__)("Select filter","dokan"),options:r,value:null!==(a=r.find(o=>o.value===e.filter_by_other))&&void 0!==a?a:null,onChange:e=>{t(o=>{var t;return{...o,filter_by_other:null!==(t=e?.value)&&void 0!==t?t:"",page:1}})}})}r()(()=>{(0,n.addFilter)("dokan_product_list_filter_fields","dokan-pro/other-filter",(e,t,a)=>[...e,{id:"filter_by_other",label:(0,o.__)("Other","dokan"),field:(0,d.jsx)(i,{filterArgs:t,setFilterArgs:a})}]),(0,n.addFilter)("dokan_product_list_page_notices","dokan-pro/subscription-notice",(e,a)=>{const r=a?.subscription;if(!r)return e;const{remaining_products:n,can_post_product:l,subscription_url:i}=r;let s;return s=!0===n&&l?(0,d.jsx)("p",{className:"dokan-info",children:(0,o.__)("You can add unlimited products","dokan")}):0!==n&&l?(0,d.jsx)("p",{className:"dokan-alert dokan-alert-info",children:(0,o.sprintf)(/* translators: %d: number of remaining products */ /* translators: %d: number of remaining products */
(0,o.__)("You can add %d more product(s).","dokan"),n)}):(0,d.jsx)(t.RawHTML,{className:"dokan-alert dokan-alert-info",children:(0,o.sprintf)(/* translators: %s: subscription page URL */ /* translators: %s: subscription page URL */
(0,o.__)('Sorry! You can not add or publish any more product. Please <a href="%s">update your package</a>.',"dokan"),i)}),[...e,s]})})})();