"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),posts_exports={};__export(posts_exports,{getPosts:()=>getPosts,getSearchPosts:()=>getSearchPosts});var getPosts=__name(function(_0){return __async(this,arguments,function*({filter:filter,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl,axios:axios,cheerio:cheerio}=providerContext,baseUrl=yield getBaseUrl("vadapav");return page>1?[]:posts({baseUrl:baseUrl,url:`${baseUrl+filter}`,signal:signal,axios:axios,cheerio:cheerio})})},"getPosts"),getSearchPosts=__name(function(_0){return __async(this,arguments,function*({searchQuery:searchQuery,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl,axios:axios,cheerio:cheerio}=providerContext,baseUrl=yield getBaseUrl("vadapav");return page>1?[]:posts({baseUrl:baseUrl,url:`${baseUrl}/s/${searchQuery}`,signal:signal,axios:axios,cheerio:cheerio})})},"getSearchPosts");function posts(_0){return __async(this,arguments,function*({url:url,signal:signal,axios:axios,cheerio:cheerio}){try{const data=(yield axios.get(url,{signal:signal})).data,$=cheerio.load(data),catalog=[];return $('.directory-entry:not(:contains("Parent Directory"))').map((i,element)=>{var _a;const title=$(element).text(),link=$(element).attr("href"),imageTitle=(null==title?void 0:title.length)>30?null==(_a=null==title?void 0:title.slice(0,30))?void 0:_a.replace(/\./g," "):null==title?void 0:title.replace(/\./g," "),image=`https://placehold.jp/23/000000/ffffff/200x400.png?text=${encodeURIComponent(imageTitle)}&css=%7B%22background%22%3A%22%20-webkit-gradient(linear%2C%20left%20bottom%2C%20left%20top%2C%20from(%233f3b3b)%2C%20to(%23000000))%22%2C%22text-transform%22%3A%22%20capitalize%22%7D`;title&&link&&catalog.push({title:title,link:link,image:image})}),catalog}catch(err){return[]}})}__name(posts,"posts"),exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;