import{o as e}from"./chunk-mlkTr37E.js";import{t}from"./lodash-BtwhQj49.js";import{f as n}from"./cache-BCH2kRNz.js";import{t as r}from"./init-vTxIv4PY.js";var i=e(t()),a=async(e=``,t=1,n=20,a=`name`,o=``)=>{let s={page_number:t,page_size:n};e&&a&&(s.keyword=e,s.search_type=a),o&&(s.cursor=o),s.count_list_types=[`sold_out`,`banned`,`deboosted`,`deleted`,`unlisted`,`reviewing`].join(`,`);let c=await r.get(`/api/v3/mpsku/list/search_product_list`,{params:s}),l=i.default.get(c,`data.products`,[]);return{listProduct:l,cursor:i.default.get(c,`data.page_info.cursor`,``),total:i.default.get(c,`data.page_info.total`,0),count:l.length}},o=async(e=1,t=20,r=``)=>{let i=new n([e,t,r].join(`-`)),o=await i.get();if(o)return o;let s=await a(``,e,t,`name`,r);return s.listProduct.length&&await i.set(s),s};export{a as n,o as t};