ps2.live-old/build/index.js
2024-07-15 14:13:23 -04:00

1904 lines
64 KiB
JavaScript

var __defProp = Object.defineProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: !0 });
};
// node_modules/@remix-run/dev/dist/config/defaults/entry.server.node.tsx
var entry_server_node_exports = {};
__export(entry_server_node_exports, {
default: () => handleRequest
});
import { PassThrough } from "node:stream";
import { createReadableStreamFromReadable } from "@remix-run/node";
import { RemixServer } from "@remix-run/react";
import * as isbotModule from "isbot";
import { renderToPipeableStream } from "react-dom/server";
import { jsxDEV } from "react/jsx-dev-runtime";
var ABORT_DELAY = 5e3;
function handleRequest(request, responseStatusCode, responseHeaders, remixContext, loadContext) {
return isBotRequest(request.headers.get("user-agent")) || remixContext.isSpaMode ? handleBotRequest(
request,
responseStatusCode,
responseHeaders,
remixContext
) : handleBrowserRequest(
request,
responseStatusCode,
responseHeaders,
remixContext
);
}
function isBotRequest(userAgent) {
return userAgent ? "isbot" in isbotModule && typeof isbotModule.isbot == "function" ? isbotModule.isbot(userAgent) : "default" in isbotModule && typeof isbotModule.default == "function" ? isbotModule.default(userAgent) : !1 : !1;
}
function handleBotRequest(request, responseStatusCode, responseHeaders, remixContext) {
return new Promise((resolve, reject) => {
let shellRendered = !1, { pipe, abort } = renderToPipeableStream(
/* @__PURE__ */ jsxDEV(
RemixServer,
{
context: remixContext,
url: request.url,
abortDelay: ABORT_DELAY
},
void 0,
!1,
{
fileName: "node_modules/@remix-run/dev/dist/config/defaults/entry.server.node.tsx",
lineNumber: 66,
columnNumber: 7
},
this
),
{
onAllReady() {
shellRendered = !0;
let body = new PassThrough(), stream = createReadableStreamFromReadable(body);
responseHeaders.set("Content-Type", "text/html"), resolve(
new Response(stream, {
headers: responseHeaders,
status: responseStatusCode
})
), pipe(body);
},
onShellError(error) {
reject(error);
},
onError(error) {
responseStatusCode = 500, shellRendered && console.error(error);
}
}
);
setTimeout(abort, ABORT_DELAY);
});
}
function handleBrowserRequest(request, responseStatusCode, responseHeaders, remixContext) {
return new Promise((resolve, reject) => {
let shellRendered = !1, { pipe, abort } = renderToPipeableStream(
/* @__PURE__ */ jsxDEV(
RemixServer,
{
context: remixContext,
url: request.url,
abortDelay: ABORT_DELAY
},
void 0,
!1,
{
fileName: "node_modules/@remix-run/dev/dist/config/defaults/entry.server.node.tsx",
lineNumber: 116,
columnNumber: 7
},
this
),
{
onShellReady() {
shellRendered = !0;
let body = new PassThrough(), stream = createReadableStreamFromReadable(body);
responseHeaders.set("Content-Type", "text/html"), resolve(
new Response(stream, {
headers: responseHeaders,
status: responseStatusCode
})
), pipe(body);
},
onShellError(error) {
reject(error);
},
onError(error) {
responseStatusCode = 500, shellRendered && console.error(error);
}
}
);
setTimeout(abort, ABORT_DELAY);
});
}
// app/root.tsx
var root_exports = {};
__export(root_exports, {
default: () => App,
links: () => links
});
// css-bundle-plugin-ns:@remix-run/css-bundle
var cssBundleHref = "/build/css-bundle-RYSASN3C.css";
// app/root.tsx
import {
Links,
LiveReload,
Meta,
Outlet,
Scripts,
ScrollRestoration
} from "@remix-run/react";
// app/root.css.ts
var root = "root_root__o19f1u0";
// app/root.tsx
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
var links = () => [
{
rel: "preconnect",
href: "https://fonts.gstatic.com",
crossOrigin: "anonymous"
},
{
rel: "preconnect",
href: "ttps://fonts.googleapis.com",
crossOrigin: "anonymous"
},
{
rel: "stylesheet",
href: "https://fonts.googleapis.com/css2?family=Unbounded:wght@700&display=swap"
},
...cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []
];
function App() {
return /* @__PURE__ */ jsxDEV2("html", { lang: "en", children: [
/* @__PURE__ */ jsxDEV2("head", { children: [
/* @__PURE__ */ jsxDEV2("meta", { charSet: "utf-8" }, void 0, !1, {
fileName: "app/root.tsx",
lineNumber: 37,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV2("meta", { name: "viewport", content: "width=device-width,initial-scale=1" }, void 0, !1, {
fileName: "app/root.tsx",
lineNumber: 38,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV2(Meta, {}, void 0, !1, {
fileName: "app/root.tsx",
lineNumber: 39,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV2(Links, {}, void 0, !1, {
fileName: "app/root.tsx",
lineNumber: 40,
columnNumber: 9
}, this)
] }, void 0, !0, {
fileName: "app/root.tsx",
lineNumber: 36,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV2("body", { className: root, children: [
/* @__PURE__ */ jsxDEV2(Outlet, {}, void 0, !1, {
fileName: "app/root.tsx",
lineNumber: 43,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV2(ScrollRestoration, {}, void 0, !1, {
fileName: "app/root.tsx",
lineNumber: 44,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV2(Scripts, {}, void 0, !1, {
fileName: "app/root.tsx",
lineNumber: 45,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV2(LiveReload, {}, void 0, !1, {
fileName: "app/root.tsx",
lineNumber: 46,
columnNumber: 9
}, this)
] }, void 0, !0, {
fileName: "app/root.tsx",
lineNumber: 42,
columnNumber: 7
}, this)
] }, void 0, !0, {
fileName: "app/root.tsx",
lineNumber: 35,
columnNumber: 5
}, this);
}
// app/routes/debug.components.tsx
var debug_components_exports = {};
__export(debug_components_exports, {
default: () => DebugComponents
});
import { useState } from "react";
// app/components/faction-bar.tsx
import { useMemo } from "react";
// app/components/faction-bar.css.ts
var bar = "faction-bar_bar__prieg10", tinyBar = "faction-bar_tinyBar__prieg11", left = "faction-bar_left__prieg12", center = "faction-bar_center__prieg13", right = "faction-bar_right__prieg14";
// app/components/faction-bar.tsx
import { Fragment, jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
var FactionBar = ({
population: { vs, nc, tr },
tiny
}) => {
let { vsPercent, ncPercent, trPercent } = useMemo(() => {
let total = nc + vs + tr;
return {
vsPercent: Math.round(vs / total * 100) || 0,
ncPercent: Math.round(nc / total * 100) || 0,
trPercent: Math.round(tr / total * 100) || 0
};
}, [vs, nc, tr]);
return /* @__PURE__ */ jsxDEV3("div", { className: tiny ? tinyBar : bar, children: [
/* @__PURE__ */ jsxDEV3("div", { className: left, style: { flexGrow: vs + 1 }, children: tiny ? /* @__PURE__ */ jsxDEV3(Fragment, { children: "\xA0" }, void 0, !1, {
fileName: "app/components/faction-bar.tsx",
lineNumber: 23,
columnNumber: 17
}, this) : `${vsPercent}%` }, void 0, !1, {
fileName: "app/components/faction-bar.tsx",
lineNumber: 22,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV3("div", { className: center, style: { flexGrow: nc + 1 }, children: tiny ? /* @__PURE__ */ jsxDEV3(Fragment, { children: "\xA0" }, void 0, !1, {
fileName: "app/components/faction-bar.tsx",
lineNumber: 26,
columnNumber: 17
}, this) : `${ncPercent}%` }, void 0, !1, {
fileName: "app/components/faction-bar.tsx",
lineNumber: 25,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV3("div", { className: right, style: { flexGrow: tr + 1 }, children: tiny ? /* @__PURE__ */ jsxDEV3(Fragment, { children: "\xA0" }, void 0, !1, {
fileName: "app/components/faction-bar.tsx",
lineNumber: 29,
columnNumber: 17
}, this) : `${trPercent}%` }, void 0, !1, {
fileName: "app/components/faction-bar.tsx",
lineNumber: 28,
columnNumber: 7
}, this)
] }, void 0, !0, {
fileName: "app/components/faction-bar.tsx",
lineNumber: 21,
columnNumber: 5
}, this);
};
// app/components/faction-pie.css.ts
var pieRoot = "faction-pie_pieRoot__15tar860";
// app/components/faction-pie.tsx
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
var FactionPie = ({
population: population3,
innerMargin,
innerBackground,
size
}) => {
let { nc, tr, vs } = population3, total = nc + tr + vs, trPct = tr / total * 100, vsPct = vs / total * 100;
return /* @__PURE__ */ jsxDEV4(
"div",
{
className: pieRoot,
style: {
fontSize: size || "1em",
backgroundImage: `conic-gradient(
#d30101 0% ${trPct}%,
#991cba ${trPct}% ${trPct + vsPct}%,
#1564cc ${trPct + vsPct}% 100%
)`,
"--inner-margin": innerMargin ? `${innerMargin}px` : "0",
"--inner-bg": innerBackground || "none"
},
children: "\xA0"
},
void 0,
!1,
{
fileName: "app/components/faction-pie.tsx",
lineNumber: 22,
columnNumber: 5
},
this
);
};
// app/routes/debug.components.tsx
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
function DebugComponents() {
let [population3, setPopulation] = useState({
nc: 33,
tr: 33,
vs: 33
}), [innerMargin, setInnerMargin] = useState(10), [innerColor, setInnerColor] = useState("black");
return /* @__PURE__ */ jsxDEV5("div", { children: [
/* @__PURE__ */ jsxDEV5("h1", { children: "Debug Components" }, void 0, !1, {
fileName: "app/routes/debug.components.tsx",
lineNumber: 17,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV5("h2", { children: "Faction Viz" }, void 0, !1, {
fileName: "app/routes/debug.components.tsx",
lineNumber: 18,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV5("div", { children: [
"NC",
" ",
/* @__PURE__ */ jsxDEV5(
"input",
{
type: "number",
value: population3.nc,
onChange: (e) => setPopulation((p) => ({ ...p, nc: Number(e.target.value) }))
},
void 0,
!1,
{
fileName: "app/routes/debug.components.tsx",
lineNumber: 21,
columnNumber: 9
},
this
),
" ",
"|| TR",
" ",
/* @__PURE__ */ jsxDEV5(
"input",
{
type: "number",
value: population3.tr,
onChange: (e) => setPopulation((p) => ({ ...p, tr: Number(e.target.value) }))
},
void 0,
!1,
{
fileName: "app/routes/debug.components.tsx",
lineNumber: 29,
columnNumber: 9
},
this
),
" ",
"|| VS",
" ",
/* @__PURE__ */ jsxDEV5(
"input",
{
type: "number",
value: population3.vs,
onChange: (e) => setPopulation((p) => ({ ...p, vs: Number(e.target.value) }))
},
void 0,
!1,
{
fileName: "app/routes/debug.components.tsx",
lineNumber: 37,
columnNumber: 9
},
this
)
] }, void 0, !0, {
fileName: "app/routes/debug.components.tsx",
lineNumber: 19,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV5("div", { children: [
/* @__PURE__ */ jsxDEV5("h3", { children: "Horizontal Stacked Bar Chart" }, void 0, !1, {
fileName: "app/routes/debug.components.tsx",
lineNumber: 46,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV5(FactionBar, { population: population3 }, void 0, !1, {
fileName: "app/routes/debug.components.tsx",
lineNumber: 47,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV5("h3", { children: "Pie Chart" }, void 0, !1, {
fileName: "app/routes/debug.components.tsx",
lineNumber: 48,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV5("div", { style: { fontSize: "5rem" }, children: [
/* @__PURE__ */ jsxDEV5(FactionPie, { population: population3 }, void 0, !1, {
fileName: "app/routes/debug.components.tsx",
lineNumber: 50,
columnNumber: 11
}, this),
/* @__PURE__ */ jsxDEV5(
FactionPie,
{
population: population3,
innerBackground: innerColor,
innerMargin
},
void 0,
!1,
{
fileName: "app/routes/debug.components.tsx",
lineNumber: 51,
columnNumber: 11
},
this
)
] }, void 0, !0, {
fileName: "app/routes/debug.components.tsx",
lineNumber: 49,
columnNumber: 9
}, this),
"Inner margin",
" ",
/* @__PURE__ */ jsxDEV5(
"input",
{
type: "number",
value: innerMargin,
onChange: (e) => setInnerMargin(Number(e.target.value))
},
void 0,
!1,
{
fileName: "app/routes/debug.components.tsx",
lineNumber: 58,
columnNumber: 9
},
this
),
"Inner color",
" ",
/* @__PURE__ */ jsxDEV5(
"input",
{
type: "color",
value: innerColor,
onChange: (e) => setInnerColor(e.target.value)
},
void 0,
!1,
{
fileName: "app/routes/debug.components.tsx",
lineNumber: 64,
columnNumber: 9
},
this
)
] }, void 0, !0, {
fileName: "app/routes/debug.components.tsx",
lineNumber: 45,
columnNumber: 7
}, this)
] }, void 0, !0, {
fileName: "app/routes/debug.components.tsx",
lineNumber: 16,
columnNumber: 5
}, this);
}
// app/routes/worlds.$id.tsx
var worlds_id_exports = {};
__export(worlds_id_exports, {
default: () => World,
loader: () => loader,
meta: () => meta
});
import { json } from "@remix-run/cloudflare";
import { useLoaderData } from "@remix-run/react";
// app/components/footer.tsx
import { Link } from "@remix-run/react";
// app/components/footer.css.ts
var root2 = "footer_root__1a7dndp0", background = "footer_background__1a7dndp1", logo = "footer_logo__1a7dndp2";
var logoLive = "footer_logoLive__1a7dndp4", logoDot = "footer_logoDot__1a7dndp5", lowerLogo = "footer_lowerLogo__1a7dndp6", link = "footer_link__1a7dndp7";
// app/components/footer.tsx
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
var Footer = ({ isMainPage }) => /* @__PURE__ */ jsxDEV6("footer", { children: /* @__PURE__ */ jsxDEV6("div", { className: root2, children: [
/* @__PURE__ */ jsxDEV6("div", { className: background }, void 0, !1, {
fileName: "app/components/footer.tsx",
lineNumber: 7,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV6("div", { className: logo, children: [
"PS2",
/* @__PURE__ */ jsxDEV6("div", { className: logoDot }, void 0, !1, {
fileName: "app/components/footer.tsx",
lineNumber: 10,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV6("span", { className: logoLive, children: "LIVE" }, void 0, !1, {
fileName: "app/components/footer.tsx",
lineNumber: 11,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV6("div", { className: lowerLogo, children: [
/* @__PURE__ */ jsxDEV6("div", { children: isMainPage ? /* @__PURE__ */ jsxDEV6(Link, { className: link, to: "/about", children: "more stuff \xBB" }, void 0, !1, {
fileName: "app/components/footer.tsx",
lineNumber: 15,
columnNumber: 11
}, this) : /* @__PURE__ */ jsxDEV6(Link, { className: link, to: "/", children: "less stuff \xBB" }, void 0, !1, {
fileName: "app/components/footer.tsx",
lineNumber: 19,
columnNumber: 11
}, this) }, void 0, !1, {
fileName: "app/components/footer.tsx",
lineNumber: 13,
columnNumber: 11
}, this),
/* @__PURE__ */ jsxDEV6("div", { children: [
"\xA9 ",
(/* @__PURE__ */ new Date()).getFullYear()
] }, void 0, !0, {
fileName: "app/components/footer.tsx",
lineNumber: 24,
columnNumber: 11
}, this)
] }, void 0, !0, {
fileName: "app/components/footer.tsx",
lineNumber: 12,
columnNumber: 9
}, this)
] }, void 0, !0, {
fileName: "app/components/footer.tsx",
lineNumber: 8,
columnNumber: 7
}, this)
] }, void 0, !0, {
fileName: "app/components/footer.tsx",
lineNumber: 6,
columnNumber: 5
}, this) }, void 0, !1, {
fileName: "app/components/footer.tsx",
lineNumber: 5,
columnNumber: 1
}, this);
// app/utils/metagame.ts
var fetchMetagameWorlds = async () => await (await fetch("https://metagame.ps2.live/all")).json(), fetchSingleMetagameWorld = async (id) => await (await fetch(`https://metagame.ps2.live/${id}`)).json();
// app/utils/saerro.ts
var saerroFetch = async (query) => (await (await fetch(
`https://saerro.ps2.live/graphql?query=${query}`,
{
cf: {
cacheTtl: 60
}
}
)).json()).data, allVehicles = [
"flash",
"sunderer",
"lightning",
"scythe",
"vanguard",
"prowler",
"reaver",
"mosquito",
"galaxy",
"valkyrie",
"liberator",
"ant",
"harasser",
"dervish",
"chimera",
"javelin",
"corsair",
"magrider"
], allClasses = [
"infiltrator",
"lightAssault",
"combatMedic",
"engineer",
"heavyAssault",
"max"
], worldQuery = async (worldID) => {
let query = `{
world(by: {id: ${Number(worldID)}}) {
id
population {
nc
tr
vs
}
zones {
all {
id
classes {
${allClasses.map((cls) => `${cls} { total nc tr vs }`).join(" ")}
}
vehicles {
total
${allVehicles.map((vehicle) => `${vehicle} { total nc tr vs }`).join(" ")}
}
population {
nc
tr
vs
}
}
}
}
}`;
return await saerroFetch(query);
}, totalPopulation = ({ nc, vs, tr }) => nc + vs + tr;
// app/utils/strings.ts
var toTitleCase = (str) => str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()), pascalCaseToTitleCase = (str) => toTitleCase(str.replace(/([A-Z])/g, " $1")), snakeCaseToTitleCase = (str) => toTitleCase(str.replace(/_/g, " ")), humanTimeAgo = (ms, full) => {
let millis = Math.floor(ms % 1e3), seconds = Math.floor(ms / 1e3), minutes = Math.floor(seconds / 60), hours = Math.floor(minutes / 60);
return hours > 0 ? full ? `${hours}h ${minutes % 60}m ${seconds % 60}s` : `${hours}h` : minutes > 0 ? full ? `${minutes}m ${seconds % 60}s` : `${minutes}m` : seconds > 0 ? `${seconds}s` : `${millis}ms`;
}, worlds = {
1: {
name: "Connery",
timeZone: "America/Los_Angeles",
locale: "en-US",
location: "US-W",
platform: "PC"
},
10: {
name: "Miller",
timeZone: "UTC",
locale: "en-GB",
location: "EU",
platform: "PC"
},
13: {
name: "Cobalt",
timeZone: "UTC",
locale: "en-GB",
location: "EU",
platform: "PC"
},
17: {
name: "Emerald",
timeZone: "America/New_York",
locale: "en-US",
location: "US-E",
platform: "PC"
},
19: {
name: "Jaeger",
timeZone: "America/New_York",
locale: "en-US",
location: "US-E",
platform: "PC"
},
40: {
name: "SolTech",
timeZone: "Asia/Tokyo",
locale: "en-GB",
location: "JP",
platform: "PC"
},
1e3: {
name: "Genudine",
timeZone: "America/New_York",
locale: "en-US",
location: "US-E",
platform: "PS4"
},
2e3: {
name: "Ceres",
timeZone: "UTC",
locale: "en-GB",
location: "EU",
platform: "PS4"
},
default: {
name: "Unknown",
timeZone: "UTC",
locale: "en-US",
location: "???",
platform: "???"
}
}, zones = {
2: {
name: "Indar",
colors: ["#edb96b", "#964c2f"]
},
4: {
name: "Hossin",
colors: ["#47570d", "#7b9c05"]
},
6: {
name: "Amerish",
colors: ["#87a12a", "#5f634f"]
},
8: {
name: "Esamir",
colors: ["#d5f3f5", "#a1c7e6"]
},
344: {
name: "Oshur",
colors: ["#00c2bf", "#174185"]
},
default: {
name: "Unknown",
colors: ["#111111", "#cccccc"]
}
};
// app/components/world.css.ts
var headerFont = "world_headerFont__cpwhdm0", header = "world_header__cpwhdm1", headerName = "world_headerName__cpwhdm2", headerSub = "world_headerSub__cpwhdm3", outer = "world_outer__cpwhdm4", population = "world_population__cpwhdm5", populationHead = "world_populationHead__cpwhdm6", popNumbers = "world_popNumbers__cpwhdm7", popItem = "world_popItem__cpwhdm8", totalPop = "world_totalPop__cpwhdm9", headerConts = "world_headerConts__cpwhdma";
var cont = "world_cont__cpwhdmc", contSub = "world_contSub__cpwhdmd";
// app/utils/classes.ts
var c = (...args) => args.filter((x) => !!x).join(" ");
// app/components/index-world.css.ts
var container = "index-world_container__1e3z7iu0", header2 = "index-world_header__1e3z7iu1", headerName2 = "index-world_headerName__1e3z7iu2", headerDetailsLink = "index-world_headerDetailsLink__1e3z7iu3", headerMarkers = "index-world_headerMarkers__1e3z7iu4";
var details = "index-world_details__1e3z7iu6", population2 = "index-world_population__1e3z7iu7", popFaction = "index-world_popFaction__1e3z7iu8", popImage = "index-world_popImage__1e3z7iu9", totalPop2 = "index-world_totalPop__1e3z7iua", continent = "index-world_continent__1e3z7iub", contBars = "index-world_contBars__1e3z7iuc", contBarTitle = "index-world_contBarTitle__1e3z7iud", barSeparator = "index-world_barSeparator__1e3z7iue", contCircle = "index-world_contCircle__1e3z7iuf", contName = "index-world_contName__1e3z7iug", jaegerConts = "index-world_jaegerConts__1e3z7iuh";
var nextCont = "index-world_nextCont__1e3z7ium", nextContText = "index-world_nextContText__1e3z7iun", oopsies = "index-world_oopsies__1e3z7iuo", oopsiesSpin = "index-world_oopsiesSpin__1e3z7iuq";
// app/images/vs-100.png
var vs_100_default = "/build/_assets/vs-100-5TO3XQQ2.png";
// app/images/nc-100.png
var nc_100_default = "/build/_assets/nc-100-22JVQEND.png";
// app/images/tr-100.png
var tr_100_default = "/build/_assets/tr-100-MTGS5ODT.png";
// app/components/alert-timer.tsx
import { useEffect, useState as useState2 } from "react";
// app/components/alert-timer.css.ts
var alertDot = "alert-timer_alertDot__eh4xj51", timer = "alert-timer_timer__eh4xj52";
// app/components/alert-timer.tsx
import { Fragment as Fragment2, jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
var endTime = (alert) => {
let alertDurationMins = 90;
switch (alert.alert_type) {
case "air":
alertDurationMins = 30;
break;
case "sudden_death":
case "max":
alertDurationMins = 15;
break;
default:
break;
}
return new Date(alert.start_time).getTime() + alertDurationMins * 60 * 1e3;
}, timeLeftString = (alert) => {
if (alert) {
let time = endTime(alert) - Date.now();
if (time < 2e3)
return /* @__PURE__ */ jsxDEV7(Fragment2, { children: "JUST ENDED" }, void 0, !1, {
fileName: "app/components/alert-timer.tsx",
lineNumber: 30,
columnNumber: 14
}, this);
let speed = time < 1e3 * 60 * 15 ? "1s" : "4s";
return /* @__PURE__ */ jsxDEV7(Fragment2, { children: [
humanTimeAgo(time, !0).toUpperCase(),
" LEFT",
" ",
/* @__PURE__ */ jsxDEV7(
"div",
{
className: alertDot,
style: { "--speed": speed }
},
void 0,
!1,
{
fileName: "app/components/alert-timer.tsx",
lineNumber: 38,
columnNumber: 9
},
this
)
] }, void 0, !0, {
fileName: "app/components/alert-timer.tsx",
lineNumber: 36,
columnNumber: 7
}, this);
} else
return /* @__PURE__ */ jsxDEV7(Fragment2, {}, void 0, !1, {
fileName: "app/components/alert-timer.tsx",
lineNumber: 45,
columnNumber: 12
}, this);
}, AlertTimer = ({
alert
}) => {
let [timeLeft, setTimeLeft] = useState2(timeLeftString(alert));
return useEffect(() => {
if (alert) {
let interval = setInterval(() => {
setTimeLeft(timeLeftString(alert));
}, 1e3);
return () => clearInterval(interval);
}
}, [alert]), /* @__PURE__ */ jsxDEV7("div", { className: timer, children: timeLeft }, void 0, !1, {
fileName: "app/components/alert-timer.tsx",
lineNumber: 65,
columnNumber: 10
}, this);
};
// app/utils/sorting.ts
var contPrioritySort = (a, b) => a.locked && !b.locked ? 1 : !a.locked && b.locked ? -1 : a.alert && b.alert ? Date.parse(a.alert.start_time) - Date.parse(b.alert.start_time) : a.alert ? -1 : b.alert ? 1 : a.locked_since && b.locked_since ? Date.parse(a.locked_since) - Date.parse(b.locked_since) : a.locked_since ? -1 : b.locked_since ? 1 : 0;
// app/routes/worlds.$id.tsx
import { Fragment as Fragment3, jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
async function loader({ params }) {
let [saerro, metagame] = await Promise.all(
[
worldQuery(params.id),
fetchSingleMetagameWorld(params.id)
]
);
return json({ saerro, metagame, id: params.id });
}
var meta = ({ data }) => {
let { saerro, id } = data, date = /* @__PURE__ */ new Date(), worldInfo = worlds[String(id || "default")], datetimeHumanFriendly = date.toLocaleString(worldInfo.locale, {
timeZone: worldInfo.timeZone,
dateStyle: "medium",
timeStyle: "short"
});
return [
{
title: `${worldInfo.name || "Unknown world"} | PlanetSide 2 Live Population Stats`
},
{
name: "description",
content: `${worldInfo.name} currently has ${totalPopulation(
saerro.world.population
)} players online as of ${datetimeHumanFriendly} ${worldInfo.name} time. VS: ${saerro.world.population.vs}, NC: ${saerro.world.population.nc}, TR: ${saerro.world.population.tr} -- See more detailed stats on ps2.live.`
}
];
};
function World() {
let {
saerro: { world },
id,
metagame
} = useLoaderData(), worldInfo = worlds[String(id || "default")], nextZoneID = metagame.zones.length !== 0 ? metagame.zones.sort(
(a, b) => new Date(a.locked_since ?? Date.now()).getTime() - new Date(b.locked_since ?? Date.now()).getTime()
)[0].id : 0;
return /* @__PURE__ */ jsxDEV8(Fragment3, { children: [
/* @__PURE__ */ jsxDEV8("div", { className: outer, children: /* @__PURE__ */ jsxDEV8("div", { children: [
/* @__PURE__ */ jsxDEV8("div", { className: header, children: [
/* @__PURE__ */ jsxDEV8("div", { className: c(headerName, headerFont), children: [
/* @__PURE__ */ jsxDEV8("div", { children: worldInfo.name.toUpperCase() }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 98,
columnNumber: 15
}, this),
/* @__PURE__ */ jsxDEV8("div", { className: headerSub, children: [
"[",
worldInfo.location,
"] [",
worldInfo.platform,
"]"
] }, void 0, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 99,
columnNumber: 15
}, this)
] }, void 0, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 97,
columnNumber: 13
}, this),
/* @__PURE__ */ jsxDEV8("div", { className: populationHead, children: [
/* @__PURE__ */ jsxDEV8("div", { className: headerFont, children: [
/* @__PURE__ */ jsxDEV8("div", { className: totalPop, children: totalPopulation(world.population).toLocaleString() }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 105,
columnNumber: 17
}, this),
"PLAYERS"
] }, void 0, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 104,
columnNumber: 15
}, this),
/* @__PURE__ */ jsxDEV8("div", { className: population, children: [
/* @__PURE__ */ jsxDEV8("div", { className: popNumbers, children: [
/* @__PURE__ */ jsxDEV8(
"div",
{
className: popItem,
style: { flex: world.population.vs + 1 },
children: [
/* @__PURE__ */ jsxDEV8("img", { className: popImage, src: vs_100_default, alt: "VS" }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 116,
columnNumber: 21
}, this),
" ",
world.population.vs
]
},
void 0,
!0,
{
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 112,
columnNumber: 19
},
this
),
/* @__PURE__ */ jsxDEV8(
"div",
{
className: popItem,
style: { flex: world.population.nc + 1 },
children: [
/* @__PURE__ */ jsxDEV8("img", { className: popImage, src: nc_100_default, alt: "NC" }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 123,
columnNumber: 21
}, this),
" ",
world.population.nc
]
},
void 0,
!0,
{
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 119,
columnNumber: 19
},
this
),
/* @__PURE__ */ jsxDEV8(
"div",
{
className: popItem,
style: { flex: world.population.tr + 1 },
children: [
/* @__PURE__ */ jsxDEV8("img", { className: popImage, src: tr_100_default, alt: "TR" }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 130,
columnNumber: 21
}, this),
" ",
world.population.tr
]
},
void 0,
!0,
{
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 126,
columnNumber: 19
},
this
)
] }, void 0, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 111,
columnNumber: 17
}, this),
/* @__PURE__ */ jsxDEV8(FactionBar, { population: world.population }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 134,
columnNumber: 17
}, this)
] }, void 0, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 110,
columnNumber: 15
}, this)
] }, void 0, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 103,
columnNumber: 13
}, this),
/* @__PURE__ */ jsxDEV8("div", { className: headerConts, children: [
/* @__PURE__ */ jsxDEV8("div", { className: headerSub, children: "CONTINENT CONTROL" }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 138,
columnNumber: 15
}, this),
metagame.zones.sort(contPrioritySort).map((zone, idx) => {
let zoneInfo = zones[String(zone.id)];
return /* @__PURE__ */ jsxDEV8("div", { className: cont, children: [
/* @__PURE__ */ jsxDEV8("div", { style: { flex: 0 }, children: zoneInfo.name.toUpperCase() }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 143,
columnNumber: 21
}, this),
/* @__PURE__ */ jsxDEV8("div", { style: { flex: 1 }, children: /* @__PURE__ */ jsxDEV8(
FactionPie,
{
size: "4rem",
population: zone.alert?.percentages ?? zone.territory,
innerBackground: `linear-gradient(45deg, ${zoneInfo.colors[0]}, ${zoneInfo.colors[1]})`,
innerMargin: 10
},
void 0,
!1,
{
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 145,
columnNumber: 23
},
this
) }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 144,
columnNumber: 21
}, this),
/* @__PURE__ */ jsxDEV8("div", { className: contSub, children: zone.alert ? /* @__PURE__ */ jsxDEV8(AlertTimer, { alert: zone.alert }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 154,
columnNumber: 23
}, this) : zone.locked ? nextZoneID == zone.id ? /* @__PURE__ */ jsxDEV8(Fragment3, { children: "NEXT UP \xBB" }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 157,
columnNumber: 23
}, this) : /* @__PURE__ */ jsxDEV8(Fragment3, { children: "LOCKED" }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 159,
columnNumber: 23
}, this) : /* @__PURE__ */ jsxDEV8(Fragment3, { children: "UNLOCKED" }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 162,
columnNumber: 23
}, this) }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 152,
columnNumber: 21
}, this)
] }, idx, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 142,
columnNumber: 19
}, this);
})
] }, void 0, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 137,
columnNumber: 13
}, this)
] }, void 0, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 96,
columnNumber: 11
}, this),
/* @__PURE__ */ jsxDEV8("div", { children: [
/* @__PURE__ */ jsxDEV8("h2", { children: "Continents" }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 171,
columnNumber: 13
}, this),
world.zones.all.map(
(zone) => /* @__PURE__ */ jsxDEV8(ZoneInfo, { zone }, zone.id, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 173,
columnNumber: 13
}, this)
)
] }, void 0, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 170,
columnNumber: 11
}, this)
] }, void 0, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 95,
columnNumber: 9
}, this) }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 94,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV8(Footer, { isMainPage: !0 }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 178,
columnNumber: 7
}, this)
] }, void 0, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 93,
columnNumber: 5
}, this);
}
var ZoneInfo = ({ zone }) => {
let zoneInfo = zones[String(zone.id)];
return /* @__PURE__ */ jsxDEV8("section", { children: [
/* @__PURE__ */ jsxDEV8("h3", { children: zoneInfo.name }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 187,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV8("p", { children: [
totalPopulation(zone.population),
" players (",
zone.population.vs,
" VS,",
" ",
zone.population.nc,
" NC, ",
zone.population.tr,
" TR)"
] }, void 0, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 188,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV8("p", { children: /* @__PURE__ */ jsxDEV8("ul", { children: allClasses.map(
(cls, idx) => /* @__PURE__ */ jsxDEV8("li", { children: [
/* @__PURE__ */ jsxDEV8("b", { children: pascalCaseToTitleCase(cls) }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 196,
columnNumber: 15
}, this),
": ",
zone.classes?.[cls].total,
" ",
"total, ",
zone.classes?.[cls].vs,
" VS, ",
zone.classes?.[cls].nc,
" NC,",
" ",
zone.classes?.[cls].tr,
" TR"
] }, idx, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 195,
columnNumber: 11
}, this)
) }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 193,
columnNumber: 9
}, this) }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 192,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV8("p", { children: [
totalPopulation(zone.vehicles),
" vehicles...",
/* @__PURE__ */ jsxDEV8("ul", { children: allVehicles.map(
(vehicle, idx) => /* @__PURE__ */ jsxDEV8("li", { children: [
/* @__PURE__ */ jsxDEV8("b", { children: toTitleCase(vehicle) }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 208,
columnNumber: 15
}, this),
":",
" ",
totalPopulation(zone.vehicles?.[vehicle]),
" total,",
" ",
zone.vehicles?.[vehicle].vs,
" VS, ",
zone.vehicles?.[vehicle].nc,
" ",
"NC, ",
zone.vehicles?.[vehicle].tr,
" TR"
] }, idx, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 207,
columnNumber: 11
}, this)
) }, void 0, !1, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 205,
columnNumber: 9
}, this)
] }, void 0, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 203,
columnNumber: 7
}, this)
] }, void 0, !0, {
fileName: "app/routes/worlds.$id.tsx",
lineNumber: 186,
columnNumber: 5
}, this);
};
// app/routes/_index.tsx
var index_exports = {};
__export(index_exports, {
default: () => Index,
loader: () => loader2,
meta: () => meta2
});
import { json as json2 } from "@remix-run/cloudflare";
import { useLoaderData as useLoaderData2 } from "@remix-run/react";
// app/components/index-world.tsx
import { Link as Link2 } from "@remix-run/react";
import { Fragment as Fragment4, jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
var IndexWorld = ({ metagame, population: population3 }) => {
let worldId = metagame.id, { platform, location, name } = worlds[String(worldId || "default")];
if (metagame.zones.length === 0)
return /* @__PURE__ */ jsxDEV9(BrokenWorld, { worldId }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 29,
columnNumber: 12
}, this);
let nextZone = metagame.zones.sort(
(a, b) => new Date(a.locked_since ?? Date.now()).getTime() - new Date(b.locked_since ?? Date.now()).getTime()
)[0], nextZoneStrings = zones[nextZone.id];
return /* @__PURE__ */ jsxDEV9("div", { className: container, children: [
/* @__PURE__ */ jsxDEV9(Link2, { to: `/worlds/${worldId}`, className: header2, children: [
/* @__PURE__ */ jsxDEV9("div", { className: headerName2, children: name }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 42,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV9("div", { className: headerMarkers, children: [
"[",
location,
"] [",
platform,
"]",
" "
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 43,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV9("div", { className: headerDetailsLink, children: "DETAILS \u21E8" }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 46,
columnNumber: 9
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 41,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV9("div", { className: details, children: [
/* @__PURE__ */ jsxDEV9("div", { className: population2, children: [
/* @__PURE__ */ jsxDEV9("div", { className: totalPop2, children: population3.factions.vs + population3.factions.nc + population3.factions.tr }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 50,
columnNumber: 11
}, this),
/* @__PURE__ */ jsxDEV9("div", { className: popFaction, children: [
/* @__PURE__ */ jsxDEV9("img", { className: popImage, src: vs_100_default, alt: "VS" }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 56,
columnNumber: 13
}, this),
" ",
population3.factions.vs
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 55,
columnNumber: 11
}, this),
/* @__PURE__ */ jsxDEV9("div", { className: popFaction, children: [
/* @__PURE__ */ jsxDEV9("img", { className: popImage, src: nc_100_default, alt: "NC" }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 60,
columnNumber: 13
}, this),
" ",
population3.factions.nc
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 59,
columnNumber: 11
}, this),
/* @__PURE__ */ jsxDEV9("div", { className: popFaction, children: [
/* @__PURE__ */ jsxDEV9("img", { className: popImage, src: tr_100_default, alt: "TR" }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 64,
columnNumber: 13
}, this),
" ",
population3.factions.tr
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 63,
columnNumber: 11
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 49,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV9(FactionBar, { population: population3.factions }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 68,
columnNumber: 9
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 48,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV9("div", { className: c(worldId === 19 && jaegerConts), children: [
metagame.zones.filter((zone) => !zone.locked).sort((a, b) => a.alert && !b.alert ? -1 : b.alert && !a.alert ? 1 : 0).map((zone) => worldId !== 19 ? /* @__PURE__ */ jsxDEV9(Continent, { zone }, zone.id, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 78,
columnNumber: 11
}, this) : /* @__PURE__ */ jsxDEV9(JaegerContinent, { zone }, zone.id, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 80,
columnNumber: 11
}, this)),
worldId !== 19 && /* @__PURE__ */ jsxDEV9("div", { className: nextCont, children: [
/* @__PURE__ */ jsxDEV9("div", { className: nextContText, children: "Next continent \xBB" }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 85,
columnNumber: 13
}, this),
" ",
/* @__PURE__ */ jsxDEV9("div", { className: contName, children: [
/* @__PURE__ */ jsxDEV9(
"div",
{
className: contCircle,
style: {
"--upper-color": nextZoneStrings.colors[0],
"--lower-color": nextZoneStrings.colors[1]
}
},
void 0,
!1,
{
fileName: "app/components/index-world.tsx",
lineNumber: 87,
columnNumber: 15
},
this
),
/* @__PURE__ */ jsxDEV9("div", { children: nextZoneStrings.name }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 96,
columnNumber: 15
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 86,
columnNumber: 13
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 84,
columnNumber: 9
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 70,
columnNumber: 7
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 40,
columnNumber: 5
}, this);
}, JaegerContinent = ({ zone }) => {
let {
name,
colors: [upper, lower]
} = zones[zone.id];
return /* @__PURE__ */ jsxDEV9("div", { className: contName, children: [
/* @__PURE__ */ jsxDEV9(
"div",
{
className: contCircle,
style: {
"--upper-color": upper,
"--lower-color": lower
}
},
void 0,
!1,
{
fileName: "app/components/index-world.tsx",
lineNumber: 112,
columnNumber: 7
},
this
),
/* @__PURE__ */ jsxDEV9("div", { children: name }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 121,
columnNumber: 7
}, this)
] }, zone.id, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 111,
columnNumber: 5
}, this);
}, Continent = ({ zone }) => {
let {
name,
colors: [upper, lower]
} = zones[zone.id];
return /* @__PURE__ */ jsxDEV9("div", { className: c(continent), children: [
/* @__PURE__ */ jsxDEV9("div", { className: contName, children: [
/* @__PURE__ */ jsxDEV9(
"div",
{
className: contCircle,
style: {
"--upper-color": upper,
"--lower-color": lower
}
},
void 0,
!1,
{
fileName: "app/components/index-world.tsx",
lineNumber: 135,
columnNumber: 9
},
this
),
/* @__PURE__ */ jsxDEV9("div", { children: name }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 144,
columnNumber: 9
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 134,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV9("div", { className: contBars, children: [
/* @__PURE__ */ jsxDEV9("div", { children: [
/* @__PURE__ */ jsxDEV9("div", { className: contBarTitle, children: "TERRITORY CONTROL" }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 148,
columnNumber: 11
}, this),
/* @__PURE__ */ jsxDEV9(FactionBar, { population: zone.territory }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 149,
columnNumber: 11
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 147,
columnNumber: 9
}, this),
zone.alert && /* @__PURE__ */ jsxDEV9(Fragment4, { children: [
/* @__PURE__ */ jsxDEV9("div", { className: barSeparator }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 153,
columnNumber: 13
}, this),
/* @__PURE__ */ jsxDEV9("div", { children: [
/* @__PURE__ */ jsxDEV9("div", { className: contBarTitle, children: [
/* @__PURE__ */ jsxDEV9("div", { children: [
snakeCaseToTitleCase(zone.alert.alert_type).toUpperCase(),
" ",
"ALERT PROGRESS"
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 156,
columnNumber: 17
}, this),
" ",
/* @__PURE__ */ jsxDEV9("div", { children: [
/* @__PURE__ */ jsxDEV9(AlertTimer, { alert: zone.alert }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 161,
columnNumber: 19
}, this),
" "
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 160,
columnNumber: 17
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 155,
columnNumber: 15
}, this),
/* @__PURE__ */ jsxDEV9(FactionBar, { population: zone.alert.percentages }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 164,
columnNumber: 15
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 154,
columnNumber: 13
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 152,
columnNumber: 9
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 146,
columnNumber: 7
}, this)
] }, zone.id, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 133,
columnNumber: 5
}, this);
}, BrokenWorld = ({ worldId }) => {
let { platform, location, name } = worlds[String(worldId || "default")];
return /* @__PURE__ */ jsxDEV9("div", { className: container, children: [
/* @__PURE__ */ jsxDEV9(Link2, { to: `/worlds/${worldId}`, className: header2, children: [
/* @__PURE__ */ jsxDEV9("div", { className: headerName2, children: name }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 179,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV9("div", { className: headerMarkers, children: [
"[",
location,
"] [",
platform,
"]",
" "
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 180,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV9("div", { className: headerDetailsLink, children: "DETAILS \u21E8" }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 183,
columnNumber: 9
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 178,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV9("div", { className: details, children: /* @__PURE__ */ jsxDEV9("div", { className: oopsies, children: [
"Daybreak made an oopsie.",
/* @__PURE__ */ jsxDEV9("br", {}, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 188,
columnNumber: 11
}, this),
/* @__PURE__ */ jsxDEV9("div", { className: oopsiesSpin, children: "\u{1F642}" }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 189,
columnNumber: 11
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 186,
columnNumber: 9
}, this) }, void 0, !1, {
fileName: "app/components/index-world.tsx",
lineNumber: 185,
columnNumber: 7
}, this)
] }, void 0, !0, {
fileName: "app/components/index-world.tsx",
lineNumber: 177,
columnNumber: 5
}, this);
};
// app/components/index-world-container.css.ts
var container2 = "index-world-container_container__1ib388g0";
// app/components/index-world-container.tsx
import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
var WorldContainer = ({
metagame,
population: population3
}) => /* @__PURE__ */ jsxDEV10("div", { className: container2, children: metagame.map(
(world) => /* @__PURE__ */ jsxDEV10(
IndexWorld,
{
metagame: world,
population: population3.find((p) => p.id === world.id)
},
world.id,
!1,
{
fileName: "app/components/index-world-container.tsx",
lineNumber: 15,
columnNumber: 3
},
this
)
) }, void 0, !1, {
fileName: "app/components/index-world-container.tsx",
lineNumber: 13,
columnNumber: 1
}, this);
// app/components/index.css.ts
var outer2 = "components_outer__8hh0bp0";
// app/utils/population.ts
var fetchPopulationWorlds = async () => (await (await fetch("https://agg.ps2.live/population/all")).json()).map(({ id, average, factions }) => ({ id, average, factions }));
// app/routes/_index.tsx
import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
var loader2 = async () => {
let [metagame, population3] = await Promise.all(
[
fetchMetagameWorlds(),
fetchPopulationWorlds()
]
);
return json2({ metagame: metagame.sort((a, b) => a.id - b.id), population: population3 });
}, meta2 = () => [
{ title: "PS2.LIVE" },
{
name: "description",
content: "PlanetSide 2 Live Population Stats"
}
];
function Index() {
let data = useLoaderData2();
return /* @__PURE__ */ jsxDEV11("div", { children: [
/* @__PURE__ */ jsxDEV11("div", { className: outer2, children: /* @__PURE__ */ jsxDEV11(WorldContainer, { metagame: data.metagame, population: data.population }, void 0, !1, {
fileName: "app/routes/_index.tsx",
lineNumber: 33,
columnNumber: 9
}, this) }, void 0, !1, {
fileName: "app/routes/_index.tsx",
lineNumber: 32,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV11(Footer, { isMainPage: !0 }, void 0, !1, {
fileName: "app/routes/_index.tsx",
lineNumber: 35,
columnNumber: 7
}, this)
] }, void 0, !0, {
fileName: "app/routes/_index.tsx",
lineNumber: 31,
columnNumber: 5
}, this);
}
// app/routes/about.tsx
var about_exports = {};
__export(about_exports, {
default: () => About
});
// app/components/about.css.ts
var header3 = "about_header__wg0hcp0", outer3 = "about_outer__wg0hcp1", link2 = "about_link__wg0hcp2", itemContainer = "about_itemContainer__wg0hcp3", item = "about_item__wg0hcp4", itemLink = "about_itemLink__wg0hcp5", itemGithubLink = "about_itemGithubLink__wg0hcp6", love = "about_love__wg0hcp7";
// app/routes/about.tsx
import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
function About() {
return /* @__PURE__ */ jsxDEV12("div", { children: [
/* @__PURE__ */ jsxDEV12("div", { className: outer3, children: [
/* @__PURE__ */ jsxDEV12("div", { children: [
/* @__PURE__ */ jsxDEV12("p", { className: header3, children: [
/* @__PURE__ */ jsxDEV12("b", { children: "PS2.LIVE" }, void 0, !1, {
fileName: "app/routes/about.tsx",
lineNumber: 19,
columnNumber: 13
}, this),
" is a network of services that report on the ongoing war on Auraxis."
] }, void 0, !0, {
fileName: "app/routes/about.tsx",
lineNumber: 18,
columnNumber: 11
}, this),
/* @__PURE__ */ jsxDEV12("p", { style: { fontStyle: "italic" }, children: [
"hat tips:",
" ",
/* @__PURE__ */ jsxDEV12("a", { className: link2, href: "https://ps2.fisu.pw/", children: "fisu" }, void 0, !1, {
fileName: "app/routes/about.tsx",
lineNumber: 24,
columnNumber: 13
}, this),
",",
" ",
/* @__PURE__ */ jsxDEV12("a", { className: link2, href: "https://wt.honu.pw/", children: "honu & varunda" }, void 0, !1, {
fileName: "app/routes/about.tsx",
lineNumber: 28,
columnNumber: 13
}, this),
",",
" ",
/* @__PURE__ */ jsxDEV12("a", { className: link2, href: "https://voidwell.com/", children: "Voidwell & Lampjaw" }, void 0, !1, {
fileName: "app/routes/about.tsx",
lineNumber: 32,
columnNumber: 13
}, this),
",",
" ",
/* @__PURE__ */ jsxDEV12("a", { className: link2, href: "https://census.lithafalcon.cc/", children: "Sanctuary & Falcon" }, void 0, !1, {
fileName: "app/routes/about.tsx",
lineNumber: 36,
columnNumber: 13
}, this),
",",
" ",
/* @__PURE__ */ jsxDEV12("a", { className: link2, href: "https://ps2alerts.com/", children: "PS2Alerts team" }, void 0, !1, {
fileName: "app/routes/about.tsx",
lineNumber: 40,
columnNumber: 13
}, this),
",",
" ",
/* @__PURE__ */ jsxDEV12("a", { className: link2, href: "https://discord.gg/yVzGEg3RKV", children: "PS2devs Discord" }, void 0, !1, {
fileName: "app/routes/about.tsx",
lineNumber: 44,
columnNumber: 13
}, this),
", Daybreak Census Team \u{1F496}"
] }, void 0, !0, {
fileName: "app/routes/about.tsx",
lineNumber: 22,
columnNumber: 11
}, this)
] }, void 0, !0, {
fileName: "app/routes/about.tsx",
lineNumber: 17,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV12("div", { children: /* @__PURE__ */ jsxDEV12("ul", { className: itemContainer, children: [
{
name: "Saerro",
url: "https://saerro.ps2.live",
github: "https://github.com/genudine/saerro",
description: "Population GraphQL API focussing on deep granularity."
},
{
name: "Metagame API",
url: "https://metagame.ps2.live",
github: "https://github.com/genudine/metagame",
description: "World states, contininent locks, alerts, etc."
},
{
name: "Population API",
url: "https://agg.ps2.live/population",
github: "https://github.com/genudine/agg-population",
description: "Population as seen by many services, averaged."
},
{
name: "Census Playground",
url: "https://try.ps2.live",
github: "https://github.com/genudine/try.ps2.live",
description: "Explore and share the Census API."
},
{
name: "ps2.live",
url: "https://ps2.live",
github: "https://github.com/genudine/ps2.live",
description: "This website. It's pretty cool."
},
{
name: "Medkit",
url: "https://github.com/genudine/medkit2",
github: "https://github.com/genudine/medkit2",
description: "PS2 Discord bot for population/continents in channel names."
}
].map(
({ name, url, github, description }, i) => /* @__PURE__ */ jsxDEV12("li", { className: item, children: [
/* @__PURE__ */ jsxDEV12("a", { href: url, className: itemLink, children: name }, void 0, !1, {
fileName: "app/routes/about.tsx",
lineNumber: 93,
columnNumber: 17
}, this),
/* @__PURE__ */ jsxDEV12("div", { children: [
description,
" "
] }, void 0, !0, {
fileName: "app/routes/about.tsx",
lineNumber: 96,
columnNumber: 17
}, this),
/* @__PURE__ */ jsxDEV12("a", { href: github, className: itemGithubLink, children: "github" }, void 0, !1, {
fileName: "app/routes/about.tsx",
lineNumber: 97,
columnNumber: 17
}, this)
] }, i, !0, {
fileName: "app/routes/about.tsx",
lineNumber: 92,
columnNumber: 13
}, this)
) }, void 0, !1, {
fileName: "app/routes/about.tsx",
lineNumber: 51,
columnNumber: 11
}, this) }, void 0, !1, {
fileName: "app/routes/about.tsx",
lineNumber: 50,
columnNumber: 9
}, this),
/* @__PURE__ */ jsxDEV12("p", { className: love, children: "Built with \u{1F496} by Doll" }, void 0, !1, {
fileName: "app/routes/about.tsx",
lineNumber: 104,
columnNumber: 9
}, this)
] }, void 0, !0, {
fileName: "app/routes/about.tsx",
lineNumber: 16,
columnNumber: 7
}, this),
/* @__PURE__ */ jsxDEV12(Footer, {}, void 0, !1, {
fileName: "app/routes/about.tsx",
lineNumber: 106,
columnNumber: 7
}, this)
] }, void 0, !0, {
fileName: "app/routes/about.tsx",
lineNumber: 15,
columnNumber: 5
}, this);
}
// server-assets-manifest:@remix-run/dev/assets-manifest
var assets_manifest_default = { entry: { module: "/build/entry.client-ZTY5EYA2.js", imports: ["/build/_shared/chunk-O4BRYNJ4.js", "/build/_shared/chunk-Q3VAUTNA.js", "/build/_shared/chunk-U4FRFQSK.js", "/build/_shared/chunk-D6I44YFN.js", "/build/_shared/chunk-UWV35TSL.js", "/build/_shared/chunk-XGOTYLZ5.js", "/build/_shared/chunk-7M6SC7J5.js", "/build/_shared/chunk-PNG5AS42.js"] }, routes: { root: { id: "root", parentId: void 0, path: "", index: void 0, caseSensitive: void 0, module: "/build/root-LK675L7D.js", imports: void 0, hasAction: !1, hasLoader: !1, hasClientAction: !1, hasClientLoader: !1, hasErrorBoundary: !1 }, "routes/_index": { id: "routes/_index", parentId: "root", path: void 0, index: !0, caseSensitive: void 0, module: "/build/routes/_index-QVFHENLU.js", imports: ["/build/_shared/chunk-RPE3GBUS.js", "/build/_shared/chunk-UFMODTTP.js", "/build/_shared/chunk-AKBCVZVU.js"], hasAction: !1, hasLoader: !0, hasClientAction: !1, hasClientLoader: !1, hasErrorBoundary: !1 }, "routes/about": { id: "routes/about", parentId: "root", path: "about", index: void 0, caseSensitive: void 0, module: "/build/routes/about-NZRSS7UU.js", imports: ["/build/_shared/chunk-AKBCVZVU.js"], hasAction: !1, hasLoader: !1, hasClientAction: !1, hasClientLoader: !1, hasErrorBoundary: !1 }, "routes/debug.components": { id: "routes/debug.components", parentId: "root", path: "debug/components", index: void 0, caseSensitive: void 0, module: "/build/routes/debug.components-JC3GMEKW.js", imports: ["/build/_shared/chunk-YKZC3E7O.js", "/build/_shared/chunk-UFMODTTP.js"], hasAction: !1, hasLoader: !1, hasClientAction: !1, hasClientLoader: !1, hasErrorBoundary: !1 }, "routes/worlds.$id": { id: "routes/worlds.$id", parentId: "root", path: "worlds/:id", index: void 0, caseSensitive: void 0, module: "/build/routes/worlds.$id-S4Z76SWU.js", imports: ["/build/_shared/chunk-YKZC3E7O.js", "/build/_shared/chunk-RPE3GBUS.js", "/build/_shared/chunk-UFMODTTP.js", "/build/_shared/chunk-AKBCVZVU.js"], hasAction: !1, hasLoader: !0, hasClientAction: !1, hasClientLoader: !1, hasErrorBoundary: !1 } }, version: "918ff520", hmr: { runtime: "/build/_shared/chunk-D6I44YFN.js", timestamp: 1718514722630 }, url: "/build/manifest-918FF520.js" };
// server-entry-module:@remix-run/dev/server-build
var mode = "development", assetsBuildDirectory = "public/build", future = { v3_fetcherPersist: !1, v3_relativeSplatPath: !1, v3_throwAbortReason: !1, unstable_singleFetch: !1 }, publicPath = "/build/", entry = { module: entry_server_node_exports }, routes = {
root: {
id: "root",
parentId: void 0,
path: "",
index: void 0,
caseSensitive: void 0,
module: root_exports
},
"routes/debug.components": {
id: "routes/debug.components",
parentId: "root",
path: "debug/components",
index: void 0,
caseSensitive: void 0,
module: debug_components_exports
},
"routes/worlds.$id": {
id: "routes/worlds.$id",
parentId: "root",
path: "worlds/:id",
index: void 0,
caseSensitive: void 0,
module: worlds_id_exports
},
"routes/_index": {
id: "routes/_index",
parentId: "root",
path: void 0,
index: !0,
caseSensitive: void 0,
module: index_exports
},
"routes/about": {
id: "routes/about",
parentId: "root",
path: "about",
index: void 0,
caseSensitive: void 0,
module: about_exports
}
};
export {
assets_manifest_default as assets,
assetsBuildDirectory,
entry,
future,
mode,
publicPath,
routes
};
//# sourceMappingURL=index.js.map