"use strict"; (self.webpackChunk_N_E = self.webpackChunk_N_E || []).push([ [911], { 6911: (e, t, n) => { n.r(t), n.d(t, { default: () => S }); var r = n(5155), i = n(2115), a = n(7650), o = n(1408), s = n(8654), l = n(9924), c = n(8731), p = n(5719), u = n(3856), d = n(9398); function f(e) { if (!e || e.startsWith("/api/proxy") || !e.startsWith("bs_")) return e; try { let t = e.slice(3); return atob(t).split("").reverse().join("") } catch (t) { return console.error("De-obfuscation error:", t), e } } async function h(e, t, n, r) { try { let i; i = "movie" === e ? "/api/movie/".concat(t) : "/api/tv/".concat(t, "/").concat(n || 1, "/").concat(r || 1); let a = await fetch(i, { headers: { "x-bcine-key": "bcine_internal_2024_x7k9" } }); if (!a.ok) throw Error("Failed to fetch sources from API: ".concat(a.statusText)); let o = await a.json(), s = (o.sources || []).map(e => f(e)), l = (o.servers || []).map(e => ({ ...e, url: f(e.url) })); return { urls: s, servers: l } } catch (e) { return console.error("Error fetching Cinemull sources:", e), { urls: [], servers: [] } } } n(8319), n(85); let x = "3e20e76d6d210b6cb128d17d233b64dc", g = "https://api.themoviedb.org/3", m = ["Nova", "Astra", "Nebula", "Luna", "Titan", "Polaris", "Atlas", "Vega", "Lyra", "Orion", "Sirius", "Altair", "Deneb", "Rigel", "Capella", "Castor", "Pollux", "Antares", "Spica", "Arcturus", "Aldebaran", "Fomalhaut", "Regulus", "Canopus", "Procyon", "Achernar"], y = ["Vast Library", "Vast Collection", "Alternative Stream", "Reliable", "HD Quality", "Backup Server", "Multi Language", "Low Latency", "Premium Quality", "Direct Stream", "4K Support & Multi Audio", "Fast CDN"]; async function b(e) { if (!e) return !1; if (e.startsWith("/api/")) return !0; try { let t = new AbortController, n = setTimeout(() => t.abort(), 6e3); return await fetch(e, { method: "HEAD", signal: t.signal, mode: "no-cors" }), clearTimeout(n), !0 } catch (e) { return !1 } } function v(e) { let { switching: t } = e, n = (0, l.iR)(), r = (0, c.nV)("waiting"), a = (0, c.nV)("seeking"), o = (0, c.nV)("canPlay"), s = t || r || a || !o, p = (0, i.useRef)(!1); return (0, i.useEffect)(() => { s && !p.current ? (n.pauseControls(), p.current = !0) : !s && p.current && (n.resumeControls(), p.current = !1) }, [s, n]), (0, i.useEffect)(() => () => { p.current && (n.resumeControls(), p.current = !1) }, [n]), null } function k(e) { let { servers: t, activeIdx: n, visible: l, interactive: c, onSelect: p, onClose: u, containerRef: d } = e, f = (0, i.useRef)(null), [h, x] = (0, i.useState)(100), g = (0, i.useRef)(null), m = (0, i.useRef)([]), [y, b] = (0, i.useState)(n), v = (0, i.useRef)(n), k = (0, i.useRef)(null), w = (0, i.useRef)(!1); (0, i.useEffect)(() => { f.current && x(f.current.offsetHeight) }), (0, i.useEffect)(() => { b(n), v.current = n }, [n]), (0, i.useEffect)(() => { if (!c || !g.current) return; let e = m.current[n]; if (!e) return; let t = g.current, r = e.offsetTop + e.offsetHeight / 2; t.scrollTo({ top: r - t.clientHeight / 2, behavior: "smooth" }), b(n), v.current = n }, [c, n]); let j = (0, i.useCallback)(() => { let e = g.current; if (!e) return; w.current = !0; let t = e.scrollTop + e.clientHeight / 2, n = 0, r = 1 / 0; m.current.forEach((e, i) => { if (!e) return; let a = Math.abs(e.offsetTop + e.offsetHeight / 2 - t); a < r && (r = a, n = i) }), n !== v.current && (v.current = n, b(n)), k.current && clearTimeout(k.current), k.current = setTimeout(() => { w.current = !1; let t = v.current, n = m.current[t]; if (n && e) { let t = n.offsetTop + n.offsetHeight / 2; e.scrollTo({ top: t - e.clientHeight / 2, behavior: "smooth" }) } }, 120) }, []); (0, i.useEffect)(() => { if (!c) return; let e = e => { "Escape" === e.key && (null == u || u()) }; return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e) }, [c, u]); let [C, S] = (0, i.useState)(null); (0, i.useLayoutEffect)(() => { var e; S(null != (e = null == d ? void 0 : d.current) ? e : document.body) }, []), (0, i.useEffect)(() => { let e = () => { var e, t, n; let r = null != (t = null != (e = document.fullscreenElement) ? e : document.webkitFullscreenElement) ? t : null, i = null != (n = null == d ? void 0 : d.current) ? n : null; i && r && r.contains(i) ? S(i) : r ? S(r) : S(null != i ? i : document.body) }; return document.addEventListener("fullscreenchange", e), document.addEventListener("webkitfullscreenchange", e), document.addEventListener("mozfullscreenchange", e), document.addEventListener("MSFullscreenChange", e), () => { document.removeEventListener("fullscreenchange", e), document.removeEventListener("webkitfullscreenchange", e), document.removeEventListener("mozfullscreenchange", e), document.removeEventListener("MSFullscreenChange", e) } }, []); let L = t[n], E = t.slice(n + 1), W = l && null != L; if (!C) return null; let M = (null == d ? void 0 : d.current) != null && C === d.current; return a.createPortal((0, r.jsx)(o.N, { children: W && (0, r.jsx)(s.P.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: .28, ease: "easeOut" }, style: { position: M ? "absolute" : "fixed", inset: 0, zIndex: 0x7fffffff, background: "rgba(0,0,0,0.45)", backdropFilter: "blur(4px)", WebkitBackdropFilter: "blur(4px)", pointerEvents: c ? "auto" : "none" }, onClick: c ? u : void 0, children: c ? (0, r.jsxs)(r.Fragment, { children: [(0, r.jsx)("div", { ref: g, onScroll: j, onClick: e => e.stopPropagation(), style: { position: "absolute", inset: 0, overflowY: "scroll", display: "flex", flexDirection: "column", alignItems: "center", paddingTop: "50vh", paddingBottom: "50vh", scrollbarWidth: "none", maskImage: "linear-gradient(to bottom, transparent 0%, black 22%, black 78%, transparent 100%)", WebkitMaskImage: "linear-gradient(to bottom, transparent 0%, black 22%, black 78%, transparent 100%)", zIndex: 2 }, children: t.map((e, t) => { let i = t === y, a = Math.abs(t - y), l = Math.min(Math.max((t - y) * 18, -54), 54), c = "connected" === e.playState ? "rgba(74,222,128,1)" : "not-working" === e.playState ? "rgba(248,113,113,1)" : "connecting" === e.playState ? "rgba(255,255,255,0.5)" : "rgba(255,255,255,0.25)"; return (0, r.jsxs)("div", { ref: e => { m.current[t] = e }, onClick: () => { null == p || p(t), null == u || u() }, style: { display: "flex", flexDirection: "column", alignItems: "center", gap: i ? "5px" : "2px", padding: "10px 0", minHeight: "72px", justifyContent: "center", cursor: "pointer", width: "100%", boxSizing: "border-box", opacity: 0 === a ? 1 : 1 === a ? .38 : 2 === a ? .16 : .06, transform: "scale(".concat(0 === a ? 1 : 1 === a ? .78 : 2 === a ? .62 : .52, ") perspective(600px) rotateX(").concat(l, "deg)"), transformOrigin: "center center", transition: "opacity 0.18s ease, transform 0.18s ease", willChange: "transform, opacity" }, children: [(0, r.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: ["connecting" === e.playState ? (0, r.jsx)("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: c, strokeWidth: "2.5", strokeLinecap: "round", style: { animation: "vspin 0.9s linear infinite", flexShrink: 0 }, children: (0, r.jsx)("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }) : (0, r.jsx)("svg", { width: "7", height: "7", viewBox: "0 0 24 24", style: { flexShrink: 0 }, children: (0, r.jsx)("circle", { cx: "12", cy: "12", r: "10", fill: c }) }), (0, r.jsx)("span", { style: { fontSize: i ? "clamp(24px, 5vw, 38px)" : "clamp(16px, 3vw, 22px)", fontWeight: i ? 700 : 500, color: i ? "white" : "rgba(255,255,255,0.55)", letterSpacing: "-0.5px", textAlign: "center", lineHeight: 1.15, textShadow: i ? "0 1px 8px rgba(0,0,0,0.9), 0 0 20px rgba(0,0,0,0.6)" : "0 1px 8px rgba(0,0,0,0.9)", transition: "font-size 0.18s ease, color 0.18s ease" }, children: e.name }), i && t === n && (0, r.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "rgba(255,255,255,0.45)", strokeWidth: "2.8", strokeLinecap: "round", strokeLinejoin: "round", children: (0, r.jsx)("polyline", { points: "20 6 9 17 4 12" }) })] }), a <= 1 && (0, r.jsx)("span", { style: { fontSize: i ? "clamp(13px, 2.2vw, 17px)" : "clamp(11px, 1.8vw, 13px)", color: i ? "rgba(255,255,255,0.45)" : "rgba(255,255,255,0.22)", fontWeight: 400, textAlign: "center", textShadow: "0 1px 6px rgba(0,0,0,0.9)", transition: "font-size 0.18s ease, color 0.18s ease" }, children: e.description }), i && t === n && (0, r.jsxs)(o.N, { mode: "wait", children: ["connecting" === e.playState && (0, r.jsxs)(s.P.div, { initial: { opacity: 0, y: 4 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -4 }, transition: { duration: .18 }, style: { display: "flex", alignItems: "center", gap: "6px" }, children: [(0, r.jsx)("span", { style: { fontSize: "clamp(13px, 2.2vw, 17px)", color: "rgba(255,255,255,0.6)", fontWeight: 500, textShadow: "0 1px 6px rgba(0,0,0,0.9)" }, children: "Connecting..." }), (0, r.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "rgba(255,255,255,0.6)", strokeWidth: "2.5", strokeLinecap: "round", style: { animation: "vspin 0.85s linear infinite", flexShrink: 0 }, children: (0, r.jsx)("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) })] }, "connecting"), "connected" === e.playState && (0, r.jsxs)(s.P.div, { initial: { opacity: 0, scale: .8 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0 }, transition: { duration: .22 }, style: { display: "flex", alignItems: "center", gap: "6px" }, children: [(0, r.jsx)("span", { style: { fontSize: "clamp(13px, 2.2vw, 17px)", color: "rgba(74,222,128,1)", fontWeight: 600, textShadow: "0 0 12px rgba(74,222,128,0.5)" }, children: "Connected" }), (0, r.jsx)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "rgba(74,222,128,1)", strokeWidth: "2.8", strokeLinecap: "round", strokeLinejoin: "round", style: { flexShrink: 0, filter: "drop-shadow(0 0 4px rgba(74,222,128,0.6))" }, children: (0, r.jsx)("polyline", { points: "20 6 9 17 4 12" }) })] }, "connected"), "not-working" === e.playState && (0, r.jsxs)(s.P.div, { initial: { opacity: 0, scale: .8 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0 }, transition: { duration: .2 }, style: { display: "flex", alignItems: "center", gap: "6px" }, children: [(0, r.jsx)("span", { style: { fontSize: "clamp(13px, 2.2vw, 17px)", color: "rgba(248,113,113,1)", fontWeight: 600 }, children: "Not working" }), (0, r.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "rgba(248,113,113,1)", strokeWidth: "2.8", strokeLinecap: "round", style: { flexShrink: 0 }, children: (0, r.jsx)("path", { d: "M18 6L6 18M6 6l12 12" }) })] }, "not-working")] })] }, t) }) }), (0, r.jsx)("div", { style: { position: "absolute", bottom: "clamp(16px, 4%, 28px)", left: 0, right: 0, display: "flex", justifyContent: "center", pointerEvents: "none", zIndex: 3 }, children: (0, r.jsx)("span", { style: { fontSize: "clamp(11px, 1.8vw, 13px)", color: "rgba(255,255,255,0.28)", letterSpacing: "0.06em" }, children: "Tap the server to hide" }) })] }) : (0, r.jsxs)(r.Fragment, { children: [(0, r.jsxs)("div", { ref: f, style: { position: "absolute", top: "50%", left: "50%", transform: "translate(-50%, -50%)", display: "flex", flexDirection: "column", alignItems: "center", gap: "6px", width: "100%" }, children: [(0, r.jsx)("span", { style: { fontSize: "clamp(26px, 5.5vw, 40px)", fontWeight: 700, color: "white", letterSpacing: "-0.5px", textAlign: "center", lineHeight: 1.15, textShadow: "0 1px 8px rgba(0,0,0,0.9), 0 0 20px rgba(0,0,0,0.6)" }, children: L.name }), (0, r.jsx)(s.P.span, { initial: { opacity: 0, y: -4 }, animate: { opacity: 1, y: 0 }, transition: { duration: .2 }, style: { fontSize: "clamp(15px, 2.5vw, 20px)", fontWeight: 400, color: "rgba(255,255,255,0.5)", textAlign: "center", textShadow: "0 1px 6px rgba(0,0,0,0.9)" }, children: L.description }, L.description), (0, r.jsxs)(o.N, { mode: "wait", children: ["connecting" === L.playState && (0, r.jsxs)(s.P.div, { initial: { opacity: 0, y: 4 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -4 }, transition: { duration: .18 }, style: { display: "flex", alignItems: "center", gap: "6px" }, children: [(0, r.jsx)("span", { style: { fontSize: "clamp(15px, 2.5vw, 20px)", color: "rgba(255,255,255,0.6)", fontWeight: 500, textShadow: "0 1px 6px rgba(0,0,0,0.9)" }, children: "Connecting..." }), (0, r.jsx)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "rgba(255,255,255,0.6)", strokeWidth: "2.5", strokeLinecap: "round", style: { animation: "vspin 0.85s linear infinite", flexShrink: 0, filter: "drop-shadow(0 0 3px rgba(0,0,0,0.8))" }, children: (0, r.jsx)("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) })] }, "connecting"), "connected" === L.playState && (0, r.jsxs)(s.P.div, { initial: { opacity: 0, scale: .8 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0 }, transition: { duration: .22 }, style: { display: "flex", alignItems: "center", gap: "6px" }, children: [(0, r.jsx)("span", { style: { fontSize: "clamp(15px, 2.5vw, 20px)", color: "rgba(74,222,128,1)", fontWeight: 600, textShadow: "0 0 12px rgba(74,222,128,0.5), 0 1px 6px rgba(0,0,0,0.9)" }, children: "Connected" }), (0, r.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "rgba(74,222,128,1)", strokeWidth: "2.8", strokeLinecap: "round", strokeLinejoin: "round", style: { flexShrink: 0, filter: "drop-shadow(0 0 4px rgba(74,222,128,0.6))" }, children: (0, r.jsx)("polyline", { points: "20 6 9 17 4 12" }) })] }, "connected"), "not-working" === L.playState && (0, r.jsxs)(s.P.div, { initial: { opacity: 0, scale: .8 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0 }, transition: { duration: .2 }, style: { display: "flex", alignItems: "center", gap: "6px" }, children: [(0, r.jsx)("span", { style: { fontSize: "clamp(15px, 2.5vw, 20px)", color: "rgba(248,113,113,1)", fontWeight: 600, textShadow: "0 0 12px rgba(248,113,113,0.4), 0 1px 6px rgba(0,0,0,0.9)" }, children: "Not working" }), (0, r.jsx)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "rgba(248,113,113,1)", strokeWidth: "2.8", strokeLinecap: "round", style: { flexShrink: 0, filter: "drop-shadow(0 0 3px rgba(248,113,113,0.5))" }, children: (0, r.jsx)("path", { d: "M18 6L6 18M6 6l12 12" }) })] }, "not-working")] })] }), E.length > 0 && (0, r.jsx)("div", { style: { position: "absolute", top: "calc(50% + ".concat(h / 2, "px)"), left: 0, right: 0, display: "flex", flexDirection: "column", alignItems: "center", maskImage: "linear-gradient(to bottom, black 0%, black 30%, transparent 100%)", WebkitMaskImage: "linear-gradient(to bottom, black 0%, black 30%, transparent 100%)" }, children: E.map((e, t) => { let i = t + 1; return (0, r.jsx)("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "7px 0", opacity: 1 === i ? .4 : 2 === i ? .2 : .09, transform: "scale(".concat(1 === i ? .84 : .72, ")"), transformOrigin: "center top", transition: "opacity 0.4s ease, transform 0.4s ease" }, children: (0, r.jsx)("span", { style: { fontSize: "clamp(18px, 3.5vw, 26px)", fontWeight: 500, color: "white", letterSpacing: "-0.5px", textAlign: "center", lineHeight: 1.15, textShadow: "0 1px 8px rgba(0,0,0,0.9)" }, children: e.name }) }, n + 1 + t) }) })] }) }) }), C) } function w(e) { let { hidden: t } = e, n = (0, l.iR)(), i = (0, c.nV)("paused"), a = (0, c.nV)("currentTime"), o = (0, c.nV)("controlsVisible"), s = !t && (i || o), p = { background: "none", border: "none", cursor: "pointer", padding: 0, display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 }, u = "drop-shadow(0 2px 10px rgba(0,0,0,0.8))"; return (0, r.jsx)("div", { style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", zIndex: 50, pointerEvents: "none", opacity: +!!s, transition: "opacity 0.2s ease" }, children: (0, r.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "32px", pointerEvents: s ? "auto" : "none" }, children: [(0, r.jsx)("button", { style: p, onClick: e => { e.stopPropagation(), n.seek(Math.max(0, a - 10)) }, children: (0, r.jsxs)("svg", { width: "52", height: "52", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { filter: u }, children: [(0, r.jsx)("path", { opacity: "0.4", d: "M9.53906 15.92V10.5801L8.03906 12.2501", stroke: "#ffffff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), (0, r.jsx)("path", { d: "M10.0195 4.46997L11.9995 2", stroke: "#ffffff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), (0, r.jsx)("path", { d: "M4.90939 7.79974C3.79939 9.27974 3.10938 11.1097 3.10938 13.1097C3.10938 18.0197 7.08939 21.9998 11.9994 21.9998C16.9094 21.9998 20.8894 18.0197 20.8894 13.1097C20.8894 8.19974 16.9094 4.21973 11.9994 4.21973C11.3194 4.21973 10.6594 4.30978 10.0194 4.45978", stroke: "#ffffff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), (0, r.jsx)("path", { opacity: "0.4", d: "M14 10.5801C15.1 10.5801 16 11.4801 16 12.5801V13.9301C16 15.0301 15.1 15.9301 14 15.9301C12.9 15.9301 12 15.0301 12 13.9301V12.5801C12 11.4701 12.9 10.5801 14 10.5801Z", stroke: "#ffffff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }) }), (0, r.jsx)("button", { style: p, onClick: e => { e.stopPropagation(), i ? n.play() : n.pause() }, children: i ? (0, r.jsx)("svg", { width: "68", height: "68", viewBox: "0 0 24 24", fill: "white", xmlns: "http://www.w3.org/2000/svg", style: { filter: u }, children: (0, r.jsx)("path", { d: "M8 5v14l11-7z" }) }) : (0, r.jsx)("svg", { width: "68", height: "68", viewBox: "0 0 24 24", fill: "white", xmlns: "http://www.w3.org/2000/svg", style: { filter: u }, children: (0, r.jsx)("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }) }) }), (0, r.jsx)("button", { style: p, onClick: e => { e.stopPropagation(), n.seek(a + 10) }, children: (0, r.jsxs)("svg", { width: "52", height: "52", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { filter: u }, children: [(0, r.jsx)("path", { d: "M13.98 4.46997L12 2", stroke: "#ffffff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), (0, r.jsx)("path", { d: "M19.0894 7.79974C20.1994 9.27974 20.8894 11.1097 20.8894 13.1097C20.8894 18.0197 16.9094 21.9998 11.9994 21.9998C7.08939 21.9998 3.10938 18.0197 3.10938 13.1097C3.10938 8.19974 7.08939 4.21973 11.9994 4.21973C12.6794 4.21973 13.3394 4.30978 13.9794 4.45978", stroke: "#ffffff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), (0, r.jsx)("path", { opacity: "0.4", d: "M9.53906 15.92V10.5801L8.03906 12.2501", stroke: "#ffffff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), (0, r.jsx)("path", { opacity: "0.4", d: "M14 10.5801C15.1 10.5801 16 11.4801 16 12.5801V13.9301C16 15.0301 15.1 15.9301 14 15.9301C12.9 15.9301 12 15.0301 12 13.9301V12.5801C12 11.4701 12.9 10.5801 14 10.5801Z", stroke: "#ffffff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }) })] }) }) } function j(e) { let { size: t = 18 } = e; return (0, r.jsxs)("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, r.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1 4.75C1 3.10996 2.47275 2 4 2H20C21.5273 2 23 3.10996 23 4.75V8.25C23 9.89004 21.5273 11 20 11H4C2.47275 11 1 9.89004 1 8.25V4.75ZM7 6.5C7 7.32843 6.32843 8 5.5 8C4.67157 8 4 7.32843 4 6.5C4 5.67157 4.67157 5 5.5 5C6.32843 5 7 5.67157 7 6.5Z", fill: "currentColor" }), (0, r.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1 15.75C1 14.11 2.47275 13 4 13H20C21.5273 13 23 14.11 23 15.75V19.25C23 20.89 21.5273 22 20 22H4C2.47275 22 1 20.89 1 19.25V15.75ZM7 17.5C7 18.3284 6.32843 19 5.5 19C4.67157 19 4 18.3284 4 17.5C4 16.6716 4.67157 16 5.5 16C6.32843 16 7 16.6716 7 17.5Z", fill: "currentColor" })] }) } function C(e) { let { servers: t, activeIdx: n, onToggle: i, panelOpen: a } = e; return 0 === t.length ? null : (0, r.jsx)("button", { className: "vds-button", onClick: e => { e.stopPropagation(), i() }, title: "Change Server", "aria-label": "Change Server", children: (0, r.jsx)(j, { size: 20 }) }) } function S(e) { var t, n, a, o; let { movieId: s, tvId: l, season: c, episode: f, autoPlay: j = !0, onEnded: S, onError: L } = e, E = (0, i.useRef)(null), W = (0, i.useRef)(null), [M, R] = (0, i.useState)(!1), [z, I] = (0, i.useState)([]), A = (0, i.useRef)([]), [T, P] = (0, i.useState)(0), V = (0, i.useRef)(0), N = (0, i.useRef)(!1), [H, B] = (0, i.useState)(!1), [_, F] = (0, i.useState)(!0), D = (0, i.useRef)(null), { metadata: O, loading: Z } = function (e, t, n, r) { let [a, o] = (0, i.useState)({}), [s, l] = (0, i.useState)(null), [c, p] = (0, i.useState)(!1); return (0, i.useEffect)(() => { !async function () { if (!e && !t) { o({}), l(null); return } p(!0); try { if (e) { let t = await fetch("".concat(g, "/movie/").concat(e, "?api_key=").concat(x)), n = await t.json(); o({ title: n.title || "Unknown Movie", subtitle: "", backdropUrl: n.backdrop_path ? "https://image.tmdb.org/t/p/original".concat(n.backdrop_path) : void 0 }), l(null) } else if (t && void 0 !== n && void 0 !== r) { let e = "string" == typeof n ? parseInt(n) : n, i = "string" == typeof r ? parseInt(r) : r, a = await fetch("".concat(g, "/tv/").concat(t, "?api_key=").concat(x)), s = await a.json(), c = await fetch("".concat(g, "/tv/").concat(t, "/season/").concat(e, "/episode/").concat(i, "?api_key=").concat(x)), p = await c.json(); o({ title: p.name || "Episode ".concat(i), subtitle: "S".concat(e, " E").concat(i, " ").concat(s.name || ""), backdropUrl: s.backdrop_path ? "https://image.tmdb.org/t/p/original".concat(s.backdrop_path) : void 0 }); try { let n = await fetch("".concat(g, "/tv/").concat(t, "/season/").concat(e, "/episode/").concat(i + 1, "?api_key=").concat(x)); if (n.ok) { let r = await n.json(); l({ title: r.name || "Episode ".concat(i + 1), id: t, season: e, episode: i + 1 }) } else { let n = await fetch("".concat(g, "/tv/").concat(t, "/season/").concat(e + 1, "/episode/1?api_key=").concat(x)); if (n.ok) { let r = await n.json(); l({ title: r.name || "Episode 1", id: t, season: e + 1, episode: 1 }) } else l(null) } } catch (e) { l(null) } } } catch (e) { console.error("TMDB Metadata Fetch Error:", e) } finally { p(!1) } }() }, [e, t, n, r]), { metadata: a, nextEpisode: s, loading: c } }(s, l, c, f), { sources: U, loading: q, hasFetched: K } = function (e, t, n, r) { let [a, o] = i.useState([]), [s, l] = i.useState([]), [c, p] = i.useState(!0), [u, d] = i.useState(!1); return i.useEffect(() => { if (!e && !t) { o([]), l([]), p(!1), d(!0); return }!async function () { p(!0); let i = ["Nova", "Astra", "Nebula", "Luna", "Titan", "Polaris", "Atlas", "Vega", "Lyra", "Orion", "Sirius", "Altair", "Deneb", "Rigel", "Capella", "Castor", "Pollux", "Antares", "Spica", "Arcturus", "Aldebaran", "Fomalhaut", "Regulus", "Canopus", "Procyon", "Achernar"]; try { let a = await h(e ? "movie" : "tv", e || t, n, r), s = a.servers.map((e, t) => { let n = "bCine" === e.name ? "bCine" : i[t % i.length]; return e.quality && "Auto" !== e.quality && (n += " (".concat(e.quality, ")")), { file: e.url, label: n, originalLabel: e.title || e.name, type: "mp4" === e.type ? "mp4" : "hls", headers: e.headers, useProxy: e.useProxy, flag: e.flag } }); 0 === s.length && a.urls.length > 0 && a.urls.forEach((e, t) => { let n = i[t % i.length]; e.includes("1080") ? n += " (1080p)" : e.includes("720") ? n += " (720p)" : e.includes("480") ? n += " (480p)" : e.includes("360") && (n += " (360p)"), s.push({ file: e, label: n, type: "hls" }) }), o(s), l(a.servers) } catch (e) { console.error("Error fetching sources:", e), o([]), l([]) } finally { p(!1), d(!0) } }() }, [e, t, n, r]), { sources: a, servers: s, loading: c, hasFetched: u } }(s, l, c, f), { subtitles: Q } = function (e, t, n, r) { let [a, o] = i.useState([]), [s, l] = i.useState(!1); return i.useEffect(() => { !async function () { if (!e && !t) return o([]); l(!0); let i = new URLSearchParams({ id: e || t }); t && (i.set("season", String(n || "1")), i.set("episode", String(r || "1"))); try { let e = await fetch("/api/subtitles?".concat(i.toString())); if (!e.ok) throw Error("Failed to fetch subtitles: ".concat(e.statusText)); let t = await e.json(); o(t || []) } catch (e) { console.error("Error fetching subtitles:", e), o([]) } finally { l(!1) } }() }, [e, t, n, r]), { subtitles: a, loading: s } }(s, l, c, f), X = (0, i.useCallback)(e => { I(t => { let n = "function" == typeof e ? e(t) : e; return A.current = n, n }) }, []), Y = (0, i.useCallback)((e, t) => { X(n => n.map((n, r) => r === e ? { ...n, playState: t } : n)) }, [X]); (0, i.useEffect)(() => { if (!K || q) return; if (0 === U.length) { null == L || L(); return } let e = U.map((e, t) => { var n, r, i; let a = null == (n = e.label) ? void 0 : n.match(/\(([^)]+)\)$/), o = a ? a[1] : "Auto"; return { name: ("bCine" === e.label || (null == (r = e.label) ? void 0 : r.startsWith("bCine ")) ? "bCine" : m[t % m.length]) + (o && "Auto" !== o ? " ".concat(o) : ""), description: y[t % y.length], url: e.file, type: null != (i = e.type) ? i : "hls", quality: o, flag: e.flag, status: "testing", playState: 0 === t ? "connecting" : "idle" } }); A.current = e, X(e), P(0), V.current = 0, F(!0), N.current = !1, G.current = !1, ea.current = !0, ei.current = !1, e.forEach((e, t) => { b(e.url).then(e => { X(n => n.map((n, r) => r === t ? { ...n, status: e ? "ok" : "fail" } : n)) }) }) }, [K, q, U.length]); let $ = (0, i.useRef)(null), G = (0, i.useRef)(!1), J = (0, i.useCallback)(() => { $.current && (clearTimeout($.current), $.current = null) }, []), ee = (0, i.useCallback)(() => { let e = A.current.length; if (0 === e || N.current) return; N.current = !0, J(); let t = V.current, n = t + 1; Y(t, "not-working"), n < e ? (V.current = n, P(n), B(!0), F(!0), Y(n, "connecting"), G.current = !1, setTimeout(() => { N.current = !1, B(!1) }, 1500)) : (null == L || L(), N.current = !1) }, [J, L, Y]), et = (0, i.useCallback)(() => { ee() }, [ee]), en = (0, i.useCallback)(() => { G.current || (J(), $.current = setTimeout(() => { ee() }, 8e3)) }, [J, ee]), er = (0, i.useCallback)(() => { G.current = !0, J(), Y(V.current, "connected"), D.current && clearTimeout(D.current), D.current = setTimeout(() => F(!1), 2e3) }, [J, Y]), ei = (0, i.useRef)(!1); (0, i.useEffect)(() => { 0 !== A.current.length && (ei.current || (ei.current = !0, J(), $.current = setTimeout(() => { G.current || en() }, 400))) }, [z.length, J, en]); let ea = (0, i.useRef)(!0); (0, i.useEffect)(() => { if (V.current = T, ea.current) { ea.current = !1; return } return G.current = !1, J(), F(!0), $.current = setTimeout(() => { G.current || en() }, 300), J }, [T]); let eo = Z || q, es = null != (t = z[T]) ? t : null, el = null != (n = O.title) ? n : "", ec = null != (a = O.subtitle) ? a : "", ep = null != (o = O.backdropUrl) ? o : "", eu = ec ? "".concat(el, " — ").concat(ec) : el; return eo ? (0, r.jsxs)("div", { className: "h-screen w-screen bg-black overflow-hidden", style: { position: "relative" }, children: [ep && (0, r.jsx)("img", { src: ep, alt: "", style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", opacity: .32, filter: "blur(20px) saturate(1.3)", transform: "scale(1.08)" } }), (0, r.jsx)("div", { style: { position: "absolute", inset: 0, background: "linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.55) 50%, rgba(0,0,0,0.72) 100%)" } }), (0, r.jsxs)("div", { style: { position: "absolute", inset: 0, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", gap: "20px" }, children: [(0, r.jsxs)("div", { style: { position: "relative", width: "56px", height: "56px" }, children: [(0, r.jsx)("div", { style: { position: "absolute", inset: 0, borderRadius: "50%", border: "3px solid rgba(255,255,255,0.08)" } }), (0, r.jsx)("div", { style: { position: "absolute", inset: 0, borderRadius: "50%", border: "3px solid transparent", borderTopColor: "rgba(255,255,255,0.85)", borderRightColor: "rgba(255,255,255,0.2)", animation: "vspin 0.9s linear infinite" } }), (0, r.jsx)("div", { style: { position: "absolute", top: "50%", left: "50%", transform: "translate(-50%, -50%)", width: "6px", height: "6px", borderRadius: "50%", background: "rgba(255,255,255,0.5)", animation: "spulse 1.4s ease-in-out infinite" } })] }), (0, r.jsxs)("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: "6px" }, children: [(0, r.jsx)("span", { style: { fontSize: "clamp(11px, 2vw, 13px)", fontWeight: 700, letterSpacing: "0.18em", color: "rgba(255,255,255,0.9)", textTransform: "uppercase" }, children: "Fetching" }), (0, r.jsx)("span", { style: { fontSize: "clamp(9px, 1.5vw, 11px)", fontWeight: 400, letterSpacing: "0.12em", color: "rgba(255,255,255,0.35)", textTransform: "uppercase" }, children: "Almost done…" })] }), (0, r.jsx)("div", { style: { display: "flex", gap: "5px", alignItems: "center" }, children: [0, 1, 2].map(e => (0, r.jsx)("div", { style: { width: "4px", height: "4px", borderRadius: "50%", background: "rgba(255,255,255,0.5)", animation: "spulse 1.2s ease-in-out ".concat(.2 * e, "s infinite") } }, e)) })] }), el && (0, r.jsx)("div", { style: { position: "absolute", bottom: "clamp(14px, 4%, 28px)", left: "clamp(14px, 4%, 28px)", right: "clamp(14px, 4%, 28px)" }, children: (0, r.jsx)("p", { style: { fontSize: "clamp(12px, 2.2vw, 16px)", fontWeight: 600, color: "rgba(255,255,255,0.5)", letterSpacing: "-0.2px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", textAlign: "center" }, children: eu }) }), (0, r.jsx)("style", { children: "\n @keyframes vspin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }\n @keyframes spulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }\n " })] }) : es ? (0, r.jsxs)("div", { ref: W, className: "h-screen w-screen bg-black overflow-hidden".concat(H ? " vds-switching" : ""), style: { position: "relative" }, children: [(0, r.jsxs)(p.KJj, { ref: E, title: eu, src: { src: es.url, type: "mp4" === es.type ? "video/mp4" : "application/x-mpegurl" }, autoPlay: j, muted: !0, playsInline: !0, onEnded: S, onError: et, onPlaying: er, onWaiting: en, onStalled: en, className: "h-full w-full", children: [(0, r.jsx)(v, { switching: H }), (0, r.jsx)(w, { hidden: _ }), (0, r.jsxs)(p.YE$, { children: [ep && (0, r.jsx)(p.O6d, { className: "vds-poster", src: ep, alt: el }), Q.map((e, t) => { var n, i, a, o; let s = null != (n = e.format) ? n : "srt", l = e.lang || e.language || "Subtitle ".concat(t + 1), c = l.toLowerCase().includes("english") || (null != (i = e.language) ? i : "").toLowerCase().startsWith("en"); return (0, r.jsx)(p.CCl, { kind: "subtitles", src: e.file, label: l, lang: null != (a = e.language) ? a : "en", type: "vtt" === s ? "vtt" : "srt", default: 0 === t && c }, "".concat(null != (o = e.file) ? o : t)) })] }), (0, r.jsx)(u.X2, { icons: d.g, thumbnails: ep, slots: { topControlsGroupEnd: (0, r.jsx)(C, { servers: z, activeIdx: T, onToggle: () => R(e => !e), panelOpen: M }), bufferingIndicator: (0, r.jsx)(r.Fragment, {}) } })] }), (0, r.jsx)(k, { servers: z, activeIdx: T, visible: _ || M, interactive: _ || M, containerRef: W, onSelect: e => { Y(e, "connecting"), P(e), F(!0), N.current = !1, B(!0), setTimeout(() => B(!1), 1500) }, onClose: () => { R(!1), F(!1) } }), (0, r.jsx)("style", { children: "\n @keyframes vspin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n @keyframes spulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.3; }\n }\n \n .vds-video-layout .vds-load-container,\n .vds-video-layout[data-sm] .vds-controls .vds-play-button {\n display: none !important;\n }\n\n \n .vds-buffering-indicator,\n media-buffering-indicator,\n [data-media-buffering],\n .vds-loading-indicator {\n display: none !important;\n opacity: 0 !important;\n pointer-events: none !important;\n }\n " })] }) : (0, r.jsxs)("div", { className: "h-screen w-screen flex flex-col items-center justify-center bg-black gap-3", children: [(0, r.jsx)("svg", { className: "w-12 h-12 text-white/30", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, r.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M15.182 16.318A4.486 4.486 0 0012.016 15a4.486 4.486 0 00-3.198 1.318M21 12a9 9 0 11-18 0 9 9 0 0118 0zM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75zm-.375 0h.008v.015h-.008V9.75zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75zm-.375 0h.008v.015h-.008V9.75z" }) }), (0, r.jsx)("p", { className: "text-white/50 text-sm", children: "No sources available" })] }) } } } ]);