(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.hooks,o=window.wp.i18n,n=window.wp.url,r=window.wp.apiFetch;var a=e.n(r);const s=window.wp.htmlEntities,i=window.ReactJSXRuntime,l={name:"sellers",className:"woocommerce-search__sellers-result",options(e){const t=e?{search:e,searchby:"name",per_page:10}:{};return a()({path:(0,n.addQueryArgs)("/dokan/v1/stores",t)})},isDebounced:!0,getOptionIdentifier:e=>e.id,getOptionKeywords:e=>[e.store_name],getFreeTextOptions:e=>[],getOptionLabel(e,t){const o=function(e,t){if(!t)return null;const o=e.toLocaleLowerCase().indexOf(t.toLocaleLowerCase());return{suggestionBeforeMatch:(0,s.decodeEntities)(e.substring(0,o)),suggestionMatch:(0,s.decodeEntities)(e.substring(o,o+t.length)),suggestionAfterMatch:(0,s.decodeEntities)(e.substring(o+t.length))}}(e.store_name,t);return(0,i.jsxs)("span",{className:"woocommerce-search__result-name","aria-label":e.store_name,children:[o?.suggestionBeforeMatch,(0,i.jsx)("strong",{className:"components-form-token-field__suggestion-match",children:o?.suggestionMatch}),o?.suggestionAfterMatch]},"name")},getOptionCompletion:e=>({key:e.id,label:e.store_name})},d=l,c=window.lodash;function u(e=""){return new Set(e.split(",").map(e=>parseInt(e,10)).filter(e=>!isNaN(e)))}const m=function(e,t=c.identity){return function(o="",r){const s="function"==typeof e?e(r):e,i=function(e=""){return[...u(e)]}(o);if(i.length<1)return Promise.resolve([]);const l={include:i.join(","),per_page:i.length};return a()({path:(0,n.addQueryArgs)(s+"/"+i[0],l)}).then(e=>[e].map(t))}}("dokan/v1/stores",e=>({key:e.id,label:e.store_name})),p=e=>[{label:(0,o.__)("Vendor","dokan"),staticParams:[],param:"seller",showFilters:()=>!0,defaultValue:"all",filters:[{label:(0,o.__)("All Vendors","dokan"),value:"all"},{label:(0,o.__)("Single Vendor","dokan"),value:"select_vendor",chartMode:"item-comparison",subFilters:[{component:"Search",value:"single_vendor",chartMode:"item-comparison",path:["select_vendor"],settings:{type:"custom",param:"sellers",autocompleter:d,getLabels:m,labels:{placeholder:(0,o.__)("Type to search for a vendor","dokan"),button:(0,o.__)("Single Vendor","dokan")}}}]}]},...e],_=["products","revenue","orders","categories","coupons","taxes","variations","stock"];for(let e=0;e<_.length;e++)(0,t.addFilter)(`woocommerce_admin_${_[e]}_report_filters`,"dokan",p);(0,t.addFilter)("woocommerce_admin_dashboard_charts_filter","dokan/hide-woocommerce-downloads-chart/callback",e=>e.filter(e=>"downloads"!==e.endpoint&&"download_count"!==e.key)),(0,t.addFilter)("woocommerce_admin_dashboard_filters","dokan",p)})();