import{s as t}from"./p-67d9bad5.js";import{g as n}from"./p-ae1fa3d6.js";import{a as o}from"./p-80da0c3d.js";function e(o,...e){return t("*",Object.assign({id:"trendingProducts",typeOfRecords:[n.Product]},o),...e)}var r=undefined&&undefined.__awaiter||function(t,n,o,e){function r(t){return t instanceof o?t:new o((function(n){n(t)}))}return new(o||(o=Promise))((function(o,i){function c(t){try{s(e.next(t))}catch(t){i(t)}}function a(t){try{s(e["throw"](t))}catch(t){i(t)}}function s(t){t.done?o(t.value):r(t.value).then(c,a)}s((e=e.apply(t,n||[])).next())}))};function i(t){return r(this,void 0,void 0,(function*(){const n=new FormData;n.append("image",t,t.name||o.getDefault().apiKey+".jpg");const e=yield fetch(`https://api.ksearchnet.com/image/store/${o.getDefault().apiKey}`,{method:"POST",body:n});if(e.status!==200){console.warn("Failed to upload image: "+e.status);throw new Error("Failed to upload image")}const{url:r}=yield e.json();return r}))}function c(t,n){let o=t;for(const t of n){o=o.replace("%s",t)}return o}export{i as K,c as s,e as t};
//# sourceMappingURL=p-d38c6d1d.js.map