"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())}),stream_exports={};__export(stream_exports,{getStream:()=>getStream});var getStream=__name(_0=>__async(null,[_0],function*({link:id,providerContext:providerContext}){const{getBaseUrl:getBaseUrl}=providerContext;try{let providerValue="netflixMirror";const baseUrl=yield getBaseUrl("nfMirror");console.log("nfGetStream, baseUrl:",baseUrl);const url=`https://netmirror.8man.dev/api/net-proxy?url=${baseUrl}${"netflixMirror"===providerValue?"/mobile/playlist.php?id=":"/pv/playlist.php?id="}${id}&t=${Math.round((new Date).getTime()/1e3)}`;console.log("nfGetStream, url:",url);const res=yield fetch(url,{credentials:"omit"}),resJson=yield res.json(),data=null==resJson?void 0:resJson[0],streamLinks=[];return null==data||data.sources.forEach(source=>{var _a;streamLinks.push({server:source.label,link:(null==(_a=source.file)?void 0:_a.startsWith("http"))?source.file:`${baseUrl}${source.file}`,type:"m3u8",headers:{Referer:baseUrl,origin:baseUrl,Cookie:"hd=on"}})}),console.log(streamLinks),streamLinks}catch(err){return console.error(err),[]}}),"getStream");exports.getStream=getStream;