1import{n as e}from"./61b66786.8BhlS34s.js";import{typeOf as t}from"https://js-c.etc4.com/dxb/js/@dy-kit__type-of.CrUCRkUf.js";function n(e=``){return{success:!1,msg:e,data:``}}function r(e=``){return{success:!0,msg:``,data:e}}function i(e){return Object.values(x).filter(t=>t.key!==`mercadolivre`&&e.includes(t.type))}function a(e){return e.map(e=>/alibaba.com\/\w+-detail/.test(e)?e.match(/\.alibaba\.com\/\w+-detail\/.*?(\d+)\.html/)?.[1]:e.includes(`alibaba.com/alibaba-detail/`)?e.match(/\.alibaba\.com\/alibaba-detail\/.*?(\d+)\.html/)?.[1]:/alibaba\.com\/product\/(\d+)?-\d+\//.test(e)?e.match(/alibaba\.com\/product\/(\d+)?-\d+\//)?.[1]:null)}function o(e){let t=e.match(/:\/\/(www\d?\.)?(.[^/:]+)/i);return t!=null&&t.length>2&&typeof t[2]==`string`&&t[2].length>0?t[2]:null}function s(e){let t=o(e),n=t;if(t!=null){let e=t.split(`.`).reverse();e!=null&&e.length>1&&(n=`${e[1]}.${e[0]}`,t.toLowerCase().includes(`.co.uk`)&&e.length>2&&(n=`${e[2]}.${n}`))}return n||``}var c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C;function w(){return(w=e((()=>{c={key:`taobao.com`,type:`taobao`,typeName:`æ·å®`,getPageType(e){let{hostname:t,pathname:n}=e,r=t+n;return r.includes(`item.taobao.com/item.htm`)?`detail`:r.includes(`taobao.com/category`)||r.includes(`taobao.com/search.htm`)?`category`:n===`/search`&&r.includes(`taobao.com/search`)?`ptSearch`:n===`/`&&t===`www.taobao.com`?`ptIndex`:(n===`/`||n===`index.htm`)&&t!==`www.taobao.com`?`storeIndex`:`æªç¥`}},l={key:`tmall.com`,type:`tmall`,typeName:`天ç«`,getPageType(e){let{hostname:t,pathname:n,href:r}=e,i=t+n;return i.includes(`detail.tmall.com/item.htm`)||i.includes(`detail.tmall.com/item_o.htm`)||/detail.tmall.hk\/hk\/item.htm/.test(r)?`detail`:/tmall.(com|hk)\/category/.test(r)||/tmall.(com|hk)\/search.htm/.test(r)?`category`:n===`/search_product.htm`&&i.includes(`tmall.com/search_product.htm`)?`ptSearch`:n===`/`&&t===`www.tmall.com`?`ptIndex`:(n===`/`||n===`index.htm`)&&t!==`www.tmall.com`?`storeIndex`:`æªç¥`}},u={key:`1688.com`,type:`ali1688`,typeName:`1688`,getPageType(e){let{hostname:t,pathname:n}=e,r=t+n;return r.includes(`dj.1688.com/ci_bb`)||r.includes(`detail.1688.com/offer/`)||r.includes(`detail.1688.com/newoffer/`)?`detail`:r.includes(`1688.com/page/offerlist`)?`category`:r.includes(`1688.com/selloffer/offer_search.htm`)?`ptSearch`:n===`/`&&t===`www.1688.com`?`ptIndex`:(n===`/`||n===`/index.html`||n.match(/^\/page\/([^/]+)?\.html?$/))&&t!==`www.1688.com`?`storeIndex`:`æªç¥`}},d={key:`temu.com`,type:`temu`,typeName:`temu`,getPageType(e){let{hostname:t,pathname:n}=e,r=t+n;return r.match(/-g-\d+\.html/)||r.match(/goods\.html/)?`detail`:r.match(/-m-\d+\.html/)||r.match(/mall\.html/)?`category`:`æªç¥`}},f={key:`aliexpress`,type:`smt`,typeName:`éåé`,getPageType(e){let{hostname:t,pathname:n}=e,r=t+n;return/\/item\/([^/]*\/)?\d+\.html/.test(r)||/\/store\/product\/.+?\/\d+_\d+.html/.test(r)||/\/i\/\d+\.html/.test(n)?`detail`:r.includes(`/store/all-wholesale-products`)||r.includes(`/store/group/`)||/\/store\/\d+\/search/.test(r)||/\/store\/\d+\/pages\//.test(r)?`category`:r.includes(`/wholesale`)?`ptSearch`:n===`/`?`ptIndex`:/\/store\/\d+/.test(r)?`storeIndex`:`æªç¥`}},p={key:`yangkeduo.com`,type:`pinduoduo`,typeName:`æ¼å¤å¤`,getPageType(e){let{hostname:t,pathname:n}=e,r=t+n;return r.match(/yangkeduo\.com\/goods\d*\.html/)?`detail`:r.includes(`yangkeduo.com/mall_search_result.html`)||r.includes(`yangkeduo.com/comm_mall_cate_view.html`)?`category`:r.includes(`yangkeduo.com/search_result.html`)?`ptSearch`:n===`/`&&t===`www.yangkeduo.com`?`ptIndex`:r.includes(`yangkeduo.com/mall_page.html`)?`storeIndex`:`æªç¥`}},m={key:`pinduoduo.com`,type:`pinduoduo`,typeName:`æ¼å¤å¤`,getPageType(e){let{hostname:t,pathname:n}=e,r=t+n;return r.includes(`pinduoduo.com/goods.html`)?`detail`:r.includes(`pinduoduo.com/mall_search_result.html`)||r.includes(`pinduoduo.com/comm_mall_cate_view.html`)?`category`:r.includes(`pinduoduo.com/search_result.html`)?`ptSearch`:n===`/`&&t===`www.pinduoduo.com`?`ptIndex`:r.includes(`pinduoduo.com/mall_page.html`)?`storeIndex`:`æªç¥`}},h={key:`alibaba.com`,type:`alibaba`,typeName:`é¿éå·´å·´`,getPageType(e){let{hostname:t,pathname:n}=e,r=t+n;return r.includes(`alibaba.com/product-detail/`)||r.includes(`alibaba.com/p-detail/`)||/alibaba\.com\/product\/\d+-\d+\//.test(r)||/alibaba\.com\/product\/\d+\//.test(r)?`detail`:/alibaba\.com\/productlist(-\d+)?\.html/.test(r)||/alibaba\.com\/productgrouplist-\d+/.test(r)||r.includes(`alibaba.com/search/product`)||r.includes(`alibaba.com/collection_product/`)||r.includes(`featureproductlist.html`)?`category`:r.includes(`alibaba.com/trade/search`)?`ptSearch`:n===`/`&&t===`www.alibaba.com`?`ptIndex`:n.match(/^\/([^/]*\.html)?$/)&&t!==`www.alibaba.com`?`storeIndex`:`æªç¥`}},g={key:`jd.com`,type:`jd`,typeName:`京ä¸`,getPageType(e){let{hostname:t,pathname:n}=e,r=t+n;return/item\.(jd|yiyaojd)\.com\/\d+\.html/.test(r)?`detail`:r.includes(`jd.com/view_search`)?`category`:r.includes(`search.jd.com/Search`)?`ptSearch`:n===`/`&&t===`www.jd.com`?`ptIndex`:/jd\.com\/index-\d+\.html/.test(r)?`storeIndex`:`æªç¥`}},_={key:`amazon`,type:`amazon`,typeName:`äºé©¬é`,getPageType(e){let{hostname:t,pathname:n}=e;return n.includes(`/dp/`)||n.includes(`/gp/`)?`detail`:n===`/s`?`category`:n===`/sp`?`storeIndex`:`æªç¥`}},v={key:`madeinchina`,type:`madeinchina`,typeName:`ä¸å½å¶é ç½`,getPageType(e){let{hostname:t,pathname:n}=e;return t+n,n.includes(`/product/`)?`detail`:n.includes(`/product-group/`)||n.includes(`/productList`)||n.includes(`/product-list`)?`category`:`æªç¥`}},y={key:`shopee`,type:`shopee`,typeName:`è¾ç®`,getPageType(e){let{hostname:t,pathname:n,search:r,params:i,hash:a}=e;return n.match(/-i\.\d+\.\d+/)||n.match(/product\//)?`detail`:n.match(/\/search/)||a===`product_list`||i.shopCollection||i.page?`category`:`æªç¥`}},b={key:`lazada`,type:`lazada`,typeName:`Lazada`,getPageType(e){let{hostname:t,pathname:n,search:r,params:i,hash:a}=e;return t+n,n.match(/-i.*?(\d+).*?\.html/)||n.match(/\/products\/i\d+\.html/)?`detail`:r.match(`from=wangpu`)?`category`:`æªç¥`}}
1,x={"taobao.com":c,"tmall.com":l,"1688.com":u,"temu.com":d,aliexpress:f,"yangkeduo.com":p,"pinduoduo.com":m,"alibaba.com":h,"jd.com":g,amazon:_,"made-in-china":v,shopee:y,xiapibuy:y,lazada:b,daraz:b,"shop.com.mm":b,ebay:{key:`ebay`,type:`ebay`,typeName:`ebay`,getPageType(e){let{hostname:t,pathname:n,search:r,params:i,hash:a}=e;return t+n,n.match(/\/itm\/\d+/)||n.match(/\/itm\//)&&e.search.includes(`item=`)?`detail`:n.match(/\/sch\/i\.html/)&&r.match(/_ssn=/)?`category`:`æªç¥`}},jp0663:{key:`junPuPiFa`,type:`junPuPiFa`,typeName:`ååæ¹åç½`,getPageType(e){let{hostname:t,pathname:n}=e;return/^\/detail\//.test(n)?`detail`:/^\/shop\/\d+/.test(n)?`category`:n===`/`&&/jp0663\.com/.test(t)?`ptIndex`:`æªç¥`}},mercadolibre:{key:`mercadolibre`,type:`mercadolibre`,typeName:`mercadolibre`,getPageType(e){let{hostname:t,pathname:n,href:r}=e;return/\/p\/[^/]+$/.test(n)||/pdp_filters=item_id:/.test(r)||/^\/[a-zA-Z]+-\d+-/.test(n)?`detail`:/\/pagina\//.test(n)||r.includes(`applied_filter_id%3Dcategory`)?`category`:n===`/`&&/mercadolibre\.com/.test(t)?`ptIndex`:`æªç¥`}},mercadolivre:{key:`mercadolivre`,type:`mercadolibre`,typeName:`mercadolibre`,getPageType(e){let{hostname:t,pathname:n,href:r}=e;return/\/p\/[^/]+$/.test(n)||/pdp_filters=item_id:/.test(r)||/^\/[a-zA-Z]+-\d+-/.test(n)?`detail`:/\/pagina\//.test(n)||r.includes(`applied_filter_id%3Dcategory`)?`category`:n===`/`&&/mercadolibre\.com/.test(t)?`ptIndex`:`æªç¥`}},"pifa.pinduoduo":{key:`pddPiFa`,type:`pddPiFa`,typeName:`æ¼å¤å¤æ¹å`,getPageType(e){let{hostname:t,pathname:n}=e;return(t+n).includes(`/goods/detail`)?`detail`:n===`/`&&/pifa\.pinduoduo\.com/.test(t)?`ptIndex`:`æªç¥`}},shein:{key:`shein`,type:`shein`,typeName:`shein`,getPageType(e){let{hostname:t,pathname:n}=e;return n.match(/-\d+\.html/)?`detail`:n===`/`&&/shein\.com/.test(t)?`ptIndex`:`æªç¥`}},dhgate:{key:`dhw`,type:`dhw`,typeName:`æ¦ç
ç½`,getPageType(e){let{hostname:t,pathname:n}=e;return n.match(/\/product\/.*\/\d+\.html/)?`detail`:n.match(/\/store\/category\/.*/)?`category`:n===`/`&&/dhgate\.com/.test(t)?`ptIndex`:`æªç¥`}}},S=Array.from(new Set(Object.values(x))),C={filter(e,t=`detail`){let n=this.detect(e);return n.success?n.data.pageType==t?Promise.resolve(n.data):Promise.reject(`龿¥ä¸å¹é
`):Promise.reject(n.msg)},detect(e){let t=this.toLocation(e),i;if(Object.keys(x).forEach(e=>{t.hostname.includes(e)&&(i=x[e])}),i){let e=i.getPageType(t);return r({ptType:i.type,ptTypeName:i.typeName,key:i.key,pageType:e,location:t})}return n(`䏿¯ææ¤å¹³å°`)},detectSafety(e){try{let{success:t,data:n,msg:r}=this.detect(e);if(!t)throw r;return n}catch{return{ptType:`䏿¯æ`,ptTypeName:`䏿¯æ`,key:`䏿¯æ`,pageType:`䏿¯æ`,location}}},toLocation(e){e=this.appendProtocol(e);let t=new URL(e);return t.href=e,{href:e,url:`${t.protocol}//${t.hostname}${t.pathname.replace(/^([^\/])/,`/$1`)}${t.search}`,origin:`${t.protocol}//${t.hostname}`,protocol:t.protocol,host:t.hostname,hostname:t.hostname,domain:s(e),port:t.port,pathname:t.pathname.replace(/^([^\/])/,`/$1`),search:t.search,hash:t.hash.replace(`#`,``),params:(function(){let e={},n=t.search.replace(/^\?/,``).split(`&`),r=n.length,i=0,a;for(;i<r;i++)n[i]&&(a=n[i].split(`=`),e[a[0]]=a[1]);return e})(),file:(t.pathname.match(/\/([^\/?#]+)$/i)||[``])[1]}},toUrl(e){let{origin:t,pathname:n,params:r}=e,i=[];return Object.keys(r).forEach(e=>{i.push(`${e}=${r[e]}`)}),e.origin+e.pathname+(i?`?${i.join(`&`)}`:``)},toSearch(e){let t=[];return this.isPlainObject(e)&&Object.keys(e).forEach(n=>{t.push(`${n}=${encodeURIComponent(e[n])}`)}),t.join(`&`)},isPlainObject(e){return e&&t(e,Object)&&`isPrototypeOf`in e},urlRxp(e){return!!new RegExp(/(http(s)?:)?\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/).test(e)},appendProtocol(e,t=`https:`){return/^\/\//.test(e)?t+e:e},uuid(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==`x`?t:t&3|8).toString(16)})+Date.now()},getOffset(e){let t={top:0,left:0};if(!e.getClientRects().length||window.getComputedStyle(e).display===`none`)return t;t=e.getBoundingClientRect();let n=e.ownerDocument.documentElement;return{top:t.top+window.pageYOffset-n.clientTop,left:t.left+window.pageXOffset-n.clientLeft}},htmlDecode(e){let t=``;return e.length==0?``:(t=e.replace(/&/g,`&`),t=t.replace(/</g,`<`),t=t.replace(/>/g,`>`),t=t.replace(/"/g,`"`),t=t.replace(/'/g,`'`),t=t.replace(///g,`/`),t=t.replace(/`/g,"`"),t=t.replace(/=/g,`=`),t=t.replace(/ /g,` `),t)}}})))()}export{S as a,a as i,i as n,w as o,o as r,C as s,s as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.