botc-character-sheet 0.15.1 → 0.15.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,6 +5,6 @@ interface JinxesSectionProps {
|
|
|
5
5
|
allCharacters: ResolvedCharacter[];
|
|
6
6
|
fabledAndLoric: FabledOrLoric[];
|
|
7
7
|
}
|
|
8
|
-
export declare function JinxesAndSpecial({ jinxes, allCharacters, fabledAndLoric, }: JinxesSectionProps): import("preact").JSX.Element;
|
|
8
|
+
export declare function JinxesAndSpecial({ jinxes, allCharacters, fabledAndLoric, }: JinxesSectionProps): import("preact").JSX.Element | null;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=JinxesAndSpecial.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JinxesAndSpecial.d.ts","sourceRoot":"","sources":["../../src/components/JinxesAndSpecial.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,UAAU,kBAAkB;IAC1B,MAAM,EAAE,IAAI,EAAE,CAAC;IACf,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,aAAa,EACb,cAAc,GACf,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"JinxesAndSpecial.d.ts","sourceRoot":"","sources":["../../src/components/JinxesAndSpecial.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,UAAU,kBAAkB;IAC1B,MAAM,EAAE,IAAI,EAAE,CAAC;IACf,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,aAAa,EACb,cAAc,GACf,EAAE,kBAAkB,uCA4EpB"}
|
package/dist/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { options as
|
|
2
|
-
var
|
|
1
|
+
import { options as S, Fragment as u } from "preact";
|
|
2
|
+
var E = 0;
|
|
3
3
|
function e(i, t, a, r, n, h) {
|
|
4
4
|
t || (t = {});
|
|
5
|
-
var l,
|
|
6
|
-
if ("ref" in
|
|
7
|
-
var
|
|
8
|
-
if (typeof i == "function" && (l = i.defaultProps)) for (
|
|
9
|
-
return
|
|
5
|
+
var l, o, s = t;
|
|
6
|
+
if ("ref" in s) for (o in s = {}, t) o == "ref" ? l = t[o] : s[o] = t[o];
|
|
7
|
+
var d = { type: i, props: s, key: a, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --E, __i: -1, __u: 0, __source: n, __self: h };
|
|
8
|
+
if (typeof i == "function" && (l = i.defaultProps)) for (o in l) s[o] === void 0 && (s[o] = l[o]);
|
|
9
|
+
return S.vnode && S.vnode(d), d;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function C(i) {
|
|
12
12
|
if (i.startsWith("#") && (i = i.slice(1)), i.length === 3 && (i = i.split("").map((n) => n + n).join("")), i.length !== 6)
|
|
13
13
|
throw new Error("Invalid HEX color.");
|
|
14
14
|
const t = parseInt(i.slice(0, 2), 16), a = parseInt(i.slice(2, 4), 16), r = parseInt(i.slice(4, 6), 16);
|
|
15
15
|
return [t, a, r];
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function z(i, t, a) {
|
|
18
18
|
const r = (n) => {
|
|
19
19
|
const h = n.toString(16);
|
|
20
20
|
return h.length === 1 ? "0" + h : h;
|
|
21
21
|
};
|
|
22
22
|
return `#${r(i)}${r(t)}${r(a)}`;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const [a, r, n] =
|
|
26
|
-
return
|
|
24
|
+
function R(i, t) {
|
|
25
|
+
const [a, r, n] = C(i), h = Math.round(a * t), l = Math.round(r * t), o = Math.round(n * t);
|
|
26
|
+
return z(h, l, o);
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const p = {
|
|
29
29
|
townsfolk: "#00469e",
|
|
30
30
|
outsider: "#00469e",
|
|
31
31
|
minion: "#580709",
|
|
@@ -34,14 +34,14 @@ const f = {
|
|
|
34
34
|
traveller: "#390758ff",
|
|
35
35
|
loric: "#1f5807"
|
|
36
36
|
};
|
|
37
|
-
function
|
|
37
|
+
function k(i) {
|
|
38
38
|
return Array.isArray(i) ? i : [i];
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function A(i, t = 20) {
|
|
41
41
|
if (i.length === 0)
|
|
42
42
|
return "transparent";
|
|
43
43
|
if (i.length === 1) {
|
|
44
|
-
const r =
|
|
44
|
+
const r = R(i[0], 0.4);
|
|
45
45
|
return `linear-gradient(${t}deg, ${i[0]} 50%, ${r})`;
|
|
46
46
|
}
|
|
47
47
|
const a = i.map((r, n) => {
|
|
@@ -50,8 +50,8 @@ function D(i, t = 20) {
|
|
|
50
50
|
}).join(", ");
|
|
51
51
|
return `linear-gradient(${t}deg, ${a})`;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
const a =
|
|
53
|
+
function j(i, t = 90) {
|
|
54
|
+
const a = k(i);
|
|
55
55
|
if (a.length === 1)
|
|
56
56
|
return a[0];
|
|
57
57
|
const r = a.map((n, h) => {
|
|
@@ -60,46 +60,58 @@ function I(i, t = 90) {
|
|
|
60
60
|
}).join(", ");
|
|
61
61
|
return `linear-gradient(${t}deg, ${r})`;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function H({
|
|
64
64
|
jinxes: i,
|
|
65
65
|
allCharacters: t,
|
|
66
66
|
fabledAndLoric: a
|
|
67
67
|
}) {
|
|
68
68
|
const r = new Map(
|
|
69
|
-
t.map((
|
|
70
|
-
), n = i.length >
|
|
71
|
-
let
|
|
72
|
-
|
|
69
|
+
t.map((m) => [m.id.toLowerCase(), m])
|
|
70
|
+
), n = i.length > 0 && a.length > 0, h = i.length > 0 && a.length === 0, l = i.length === 0 && a.length > 0, o = [...i, ...a], s = n || i.length > 4 || a.length > 4, d = s ? Math.ceil(o.length / 2) : o.length;
|
|
71
|
+
let c, y;
|
|
72
|
+
if (n)
|
|
73
|
+
c = i.map((m, g) => /* @__PURE__ */ e(b, { jinx: m, charMap: r }, `lc-${g}`)), y = a.map((m, g) => /* @__PURE__ */ e(x, { item: m }, `rc-${g}`));
|
|
74
|
+
else if (h && s)
|
|
75
|
+
c = i.slice(0, d).map((m, g) => /* @__PURE__ */ e(b, { jinx: m, charMap: r }, `lc-${g}`)), y = i.slice(d).map((m, g) => /* @__PURE__ */ e(b, { jinx: m, charMap: r }, `rc-${g}`));
|
|
76
|
+
else if (l && s)
|
|
77
|
+
c = a.slice(0, d).map((m, g) => /* @__PURE__ */ e(x, { item: m }, `lc-${g}`)), y = a.slice(d).map((m, g) => /* @__PURE__ */ e(x, { item: m }, `rc-${g}`));
|
|
78
|
+
else if (h)
|
|
79
|
+
c = i.map((m, g) => /* @__PURE__ */ e(b, { jinx: m, charMap: r }, `lc-${g}`));
|
|
80
|
+
else if (l)
|
|
81
|
+
c = a.map((m, g) => /* @__PURE__ */ e(x, { item: m }, `lc-${g}`));
|
|
82
|
+
else
|
|
83
|
+
return null;
|
|
84
|
+
return /* @__PURE__ */ e("div", { className: "jinxes-section", children: [
|
|
73
85
|
/* @__PURE__ */ e("h2", { className: "section-title" }),
|
|
74
|
-
|
|
86
|
+
y ? /* @__PURE__ */ e("div", { className: "jinxes-list jinxes-two-columns", children: [
|
|
75
87
|
/* @__PURE__ */ e("div", { className: "jinx-column", children: [
|
|
76
|
-
...
|
|
88
|
+
...c
|
|
77
89
|
] }),
|
|
78
90
|
/* @__PURE__ */ e("div", { className: "jinx-column", children: [
|
|
79
|
-
...
|
|
91
|
+
...y
|
|
80
92
|
] })
|
|
81
93
|
] }) : /* @__PURE__ */ e("div", { className: "jinxes-list", children: [
|
|
82
|
-
...
|
|
94
|
+
...c
|
|
83
95
|
] })
|
|
84
96
|
] });
|
|
85
97
|
}
|
|
86
|
-
const
|
|
98
|
+
const b = ({ charMap: i, jinx: t }) => {
|
|
87
99
|
const a = i.get(t.characters[0]), r = i.get(t.characters[1]);
|
|
88
100
|
return /* @__PURE__ */ e("div", { className: "jinx-item", children: [
|
|
89
101
|
/* @__PURE__ */ e("div", { className: "jinx-icons", children: [
|
|
90
|
-
a && /* @__PURE__ */ e("div", { className: "jinx-icon-wrapper", children:
|
|
102
|
+
a && /* @__PURE__ */ e("div", { className: "jinx-icon-wrapper", children: v(a) ? /* @__PURE__ */ e(
|
|
91
103
|
"img",
|
|
92
104
|
{
|
|
93
|
-
src:
|
|
105
|
+
src: v(a),
|
|
94
106
|
alt: a.name,
|
|
95
107
|
className: "jinx-icon"
|
|
96
108
|
}
|
|
97
109
|
) : /* @__PURE__ */ e("div", { className: "jinx-icon-placeholder", children: a.name.charAt(0) }) }),
|
|
98
110
|
/* @__PURE__ */ e("span", { className: "jinx-divider" }),
|
|
99
|
-
r && /* @__PURE__ */ e("div", { className: "jinx-icon-wrapper", children:
|
|
111
|
+
r && /* @__PURE__ */ e("div", { className: "jinx-icon-wrapper", children: v(r) ? /* @__PURE__ */ e(
|
|
100
112
|
"img",
|
|
101
113
|
{
|
|
102
|
-
src:
|
|
114
|
+
src: v(r),
|
|
103
115
|
alt: r.name,
|
|
104
116
|
className: "jinx-icon"
|
|
105
117
|
}
|
|
@@ -108,7 +120,7 @@ const p = ({ charMap: i, jinx: t }) => {
|
|
|
108
120
|
/* @__PURE__ */ e("p", { className: "jinx-text", children: t.jinx })
|
|
109
121
|
] });
|
|
110
122
|
};
|
|
111
|
-
function
|
|
123
|
+
function x({ item: i }) {
|
|
112
124
|
return /* @__PURE__ */ e("div", { className: "jinx-item loric", children: [
|
|
113
125
|
/* @__PURE__ */ e("div", { className: "loric-spacer" }),
|
|
114
126
|
i.image ? /* @__PURE__ */ e("img", { src: i.image, alt: i.name, className: "jinx-icon loric" }) : /* @__PURE__ */ e("div", { className: "jinx-icon-placeholder", children: i.name.charAt(0) }),
|
|
@@ -118,7 +130,7 @@ function H({ item: i }) {
|
|
|
118
130
|
] })
|
|
119
131
|
] });
|
|
120
132
|
}
|
|
121
|
-
function
|
|
133
|
+
function v(i) {
|
|
122
134
|
return i.wiki_image ? i.wiki_image : i.image ? typeof i.image == "string" ? i.image : i.image[0] : null;
|
|
123
135
|
}
|
|
124
136
|
const _ = [
|
|
@@ -1100,7 +1112,7 @@ const _ = [
|
|
|
1100
1112
|
oldJinx: "If the Exorcist chooses the Yaggababble, the Yaggababble ability does not kill tonight."
|
|
1101
1113
|
}
|
|
1102
1114
|
];
|
|
1103
|
-
function
|
|
1115
|
+
function B(i) {
|
|
1104
1116
|
const t = {
|
|
1105
1117
|
townsfolk: [],
|
|
1106
1118
|
outsider: [],
|
|
@@ -1118,7 +1130,7 @@ function G(i) {
|
|
|
1118
1130
|
}
|
|
1119
1131
|
return t;
|
|
1120
1132
|
}
|
|
1121
|
-
function
|
|
1133
|
+
function G(i, t = !1) {
|
|
1122
1134
|
const a = new Set(i.map((n) => n.id.toLowerCase())), r = [];
|
|
1123
1135
|
for (const n of _) {
|
|
1124
1136
|
const [h, l] = n.characters;
|
|
@@ -1134,25 +1146,25 @@ function B(i, t = !1) {
|
|
|
1134
1146
|
const h = typeof n == "object" && n !== null, l = "jinxes" in n;
|
|
1135
1147
|
if (!h || !l) continue;
|
|
1136
1148
|
console.log("char.jinxes:", n.jinxes);
|
|
1137
|
-
const
|
|
1138
|
-
if (a.has(
|
|
1139
|
-
for (const
|
|
1140
|
-
const
|
|
1141
|
-
if (console.log(`${n.id} is jinxed with ${
|
|
1149
|
+
const o = n, s = o.id.toLowerCase();
|
|
1150
|
+
if (a.has(s) && o.jinxes)
|
|
1151
|
+
for (const d of o.jinxes) {
|
|
1152
|
+
const c = d.id.toLowerCase();
|
|
1153
|
+
if (console.log(`${n.id} is jinxed with ${c}`), a.has(c) || (console.log("characterIds doesnt contain charId", c), console.log("characterIds:", a)), a.has(c)) {
|
|
1142
1154
|
const y = r.some(
|
|
1143
|
-
(
|
|
1155
|
+
(m) => m.characters[0] === s && m.characters[1] === c || m.characters[0] === c && m.characters[1] === s
|
|
1144
1156
|
);
|
|
1145
1157
|
console.log("Jinx already exists:", y), y || r.push({
|
|
1146
|
-
characters: [
|
|
1147
|
-
jinx:
|
|
1158
|
+
characters: [s, c],
|
|
1159
|
+
jinx: d.reason
|
|
1148
1160
|
});
|
|
1149
1161
|
}
|
|
1150
1162
|
}
|
|
1151
1163
|
}
|
|
1152
1164
|
return r;
|
|
1153
1165
|
}
|
|
1154
|
-
const
|
|
1155
|
-
function
|
|
1166
|
+
const N = (i) => i.wiki_image ? i.wiki_image : i.image ? typeof i.image == "string" ? i.image : i.image[0] : null;
|
|
1167
|
+
function M(i, t, a) {
|
|
1156
1168
|
const r = [];
|
|
1157
1169
|
return t.forEach((n) => {
|
|
1158
1170
|
n.characters[0] === i.id ? r.push(n.characters[1]) : n.characters[1] === i.id && r.push(n.characters[0]);
|
|
@@ -1168,45 +1180,45 @@ function $({
|
|
|
1168
1180
|
jinxes: n = [],
|
|
1169
1181
|
showSwirls: h = !0,
|
|
1170
1182
|
includeMargins: l = !1,
|
|
1171
|
-
solidTitle:
|
|
1172
|
-
iconScale:
|
|
1173
|
-
appearance:
|
|
1174
|
-
fabledOrLoric:
|
|
1183
|
+
solidTitle: o = !1,
|
|
1184
|
+
iconScale: s = 1.6,
|
|
1185
|
+
appearance: d = "normal",
|
|
1186
|
+
fabledOrLoric: c = [],
|
|
1175
1187
|
inlineJinxIcons: y = !1
|
|
1176
1188
|
}) {
|
|
1177
|
-
const
|
|
1189
|
+
const m = [
|
|
1178
1190
|
{
|
|
1179
1191
|
key: "townsfolk",
|
|
1180
1192
|
title: "Townsfolk",
|
|
1181
1193
|
chars: a.townsfolk,
|
|
1182
|
-
color:
|
|
1194
|
+
color: p.townsfolk
|
|
1183
1195
|
},
|
|
1184
1196
|
{
|
|
1185
1197
|
key: "outsider",
|
|
1186
1198
|
title: "Outsiders",
|
|
1187
1199
|
chars: a.outsider,
|
|
1188
|
-
color:
|
|
1200
|
+
color: p.outsider
|
|
1189
1201
|
},
|
|
1190
1202
|
{
|
|
1191
1203
|
key: "minion",
|
|
1192
1204
|
title: "Minions",
|
|
1193
1205
|
chars: a.minion,
|
|
1194
|
-
color:
|
|
1206
|
+
color: p.minion
|
|
1195
1207
|
},
|
|
1196
1208
|
{
|
|
1197
1209
|
key: "demon",
|
|
1198
1210
|
title: "Demons",
|
|
1199
1211
|
chars: a.demon,
|
|
1200
|
-
color:
|
|
1212
|
+
color: p.demon
|
|
1201
1213
|
}
|
|
1202
|
-
].filter((
|
|
1214
|
+
].filter((f) => f.chars.length > 0), g = k(r), O = A(g, 20), P = ["character-sheet", d !== "normal" ? `appearance-${d}` : ""].filter(Boolean).join(" ");
|
|
1203
1215
|
return /* @__PURE__ */ e(
|
|
1204
1216
|
"div",
|
|
1205
1217
|
{
|
|
1206
1218
|
className: P,
|
|
1207
1219
|
id: "character-sheet",
|
|
1208
1220
|
style: {
|
|
1209
|
-
"--header-gradient":
|
|
1221
|
+
"--header-gradient": O,
|
|
1210
1222
|
transform: l ? "scale(0.952)" : void 0
|
|
1211
1223
|
},
|
|
1212
1224
|
children: [
|
|
@@ -1225,18 +1237,18 @@ function $({
|
|
|
1225
1237
|
showSwirls: h,
|
|
1226
1238
|
title: i,
|
|
1227
1239
|
author: t,
|
|
1228
|
-
solidHeader:
|
|
1240
|
+
solidHeader: o
|
|
1229
1241
|
}
|
|
1230
1242
|
),
|
|
1231
1243
|
/* @__PURE__ */ e("div", { className: "characters-grid", children: [
|
|
1232
|
-
|
|
1244
|
+
m.map((f, W) => /* @__PURE__ */ e(u, { children: [
|
|
1233
1245
|
/* @__PURE__ */ e(
|
|
1234
1246
|
U,
|
|
1235
1247
|
{
|
|
1236
|
-
title:
|
|
1237
|
-
characters:
|
|
1238
|
-
charNameColor:
|
|
1239
|
-
iconScale:
|
|
1248
|
+
title: f.title.toUpperCase(),
|
|
1249
|
+
characters: f.chars,
|
|
1250
|
+
charNameColor: f.color,
|
|
1251
|
+
iconScale: s,
|
|
1240
1252
|
jinxes: n,
|
|
1241
1253
|
allCharacters: [
|
|
1242
1254
|
...a.townsfolk,
|
|
@@ -1246,16 +1258,16 @@ function $({
|
|
|
1246
1258
|
],
|
|
1247
1259
|
inlineJinxIcons: y
|
|
1248
1260
|
},
|
|
1249
|
-
|
|
1261
|
+
f.key
|
|
1250
1262
|
),
|
|
1251
|
-
|
|
1263
|
+
W < m.length - 1 && /* @__PURE__ */ e("img", { src: "/images/divider.png", className: "section-divider" })
|
|
1252
1264
|
] })),
|
|
1253
|
-
(n.length > 0 ||
|
|
1265
|
+
(n.length > 0 || c.length > 0) && /* @__PURE__ */ e(u, { children: [
|
|
1254
1266
|
/* @__PURE__ */ e("img", { src: "/images/divider.png", className: "section-divider" }),
|
|
1255
1267
|
/* @__PURE__ */ e(
|
|
1256
|
-
|
|
1268
|
+
H,
|
|
1257
1269
|
{
|
|
1258
|
-
fabledAndLoric:
|
|
1270
|
+
fabledAndLoric: c,
|
|
1259
1271
|
jinxes: n,
|
|
1260
1272
|
allCharacters: [
|
|
1261
1273
|
...a.townsfolk,
|
|
@@ -1286,7 +1298,7 @@ function V({
|
|
|
1286
1298
|
author: a,
|
|
1287
1299
|
solidHeader: r = !1
|
|
1288
1300
|
}) {
|
|
1289
|
-
return /* @__PURE__ */ e(
|
|
1301
|
+
return /* @__PURE__ */ e(u, { children: [
|
|
1290
1302
|
/* @__PURE__ */ e("h1", { className: "sheet-header", children: [
|
|
1291
1303
|
i && /* @__PURE__ */ e(
|
|
1292
1304
|
"img",
|
|
@@ -1319,7 +1331,7 @@ function V({
|
|
|
1319
1331
|
] });
|
|
1320
1332
|
}
|
|
1321
1333
|
function F({ color: i }) {
|
|
1322
|
-
const t =
|
|
1334
|
+
const t = j(i, 180);
|
|
1323
1335
|
return /* @__PURE__ */ e("div", { className: "sidebar-container", children: [
|
|
1324
1336
|
/* @__PURE__ */ e("div", { className: "sidebar-background" }),
|
|
1325
1337
|
/* @__PURE__ */ e(
|
|
@@ -1340,53 +1352,53 @@ function U({
|
|
|
1340
1352
|
allCharacters: h,
|
|
1341
1353
|
inlineJinxIcons: l
|
|
1342
1354
|
}) {
|
|
1343
|
-
const
|
|
1355
|
+
const o = t.length > 8 ? "space-between" : t.length % 2 === 0 ? "space-around" : "flex-start";
|
|
1344
1356
|
return /* @__PURE__ */ e("div", { className: "character-section", children: [
|
|
1345
1357
|
/* @__PURE__ */ e("h2", { className: "section-title", children: i }),
|
|
1346
1358
|
/* @__PURE__ */ e("div", { className: "character-list", children: [
|
|
1347
|
-
/* @__PURE__ */ e("div", { className: "character-column", style: { justifyContent:
|
|
1348
|
-
|
|
1359
|
+
/* @__PURE__ */ e("div", { className: "character-column", style: { justifyContent: o }, children: t.slice(0, Math.ceil(t.length / 2)).map((s) => /* @__PURE__ */ e(
|
|
1360
|
+
J,
|
|
1349
1361
|
{
|
|
1350
|
-
character:
|
|
1362
|
+
character: s,
|
|
1351
1363
|
color: a,
|
|
1352
1364
|
iconScale: r,
|
|
1353
|
-
jinxedCharacters:
|
|
1365
|
+
jinxedCharacters: M(s, n, h),
|
|
1354
1366
|
inlineJinxIcons: l
|
|
1355
1367
|
},
|
|
1356
|
-
|
|
1368
|
+
s.id
|
|
1357
1369
|
)) }),
|
|
1358
|
-
/* @__PURE__ */ e("div", { className: "character-column", style: { justifyContent:
|
|
1359
|
-
|
|
1370
|
+
/* @__PURE__ */ e("div", { className: "character-column", style: { justifyContent: o }, children: t.slice(Math.ceil(t.length / 2), t.length).map((s) => /* @__PURE__ */ e(
|
|
1371
|
+
J,
|
|
1360
1372
|
{
|
|
1361
|
-
character:
|
|
1373
|
+
character: s,
|
|
1362
1374
|
color: a,
|
|
1363
1375
|
iconScale: r,
|
|
1364
|
-
jinxedCharacters:
|
|
1376
|
+
jinxedCharacters: M(s, n, h),
|
|
1365
1377
|
inlineJinxIcons: l
|
|
1366
1378
|
},
|
|
1367
|
-
|
|
1379
|
+
s.id
|
|
1368
1380
|
)) })
|
|
1369
1381
|
] })
|
|
1370
1382
|
] });
|
|
1371
1383
|
}
|
|
1372
|
-
function
|
|
1384
|
+
function J({
|
|
1373
1385
|
character: i,
|
|
1374
1386
|
color: t,
|
|
1375
1387
|
iconScale: a,
|
|
1376
1388
|
jinxedCharacters: r,
|
|
1377
1389
|
inlineJinxIcons: n
|
|
1378
1390
|
}) {
|
|
1379
|
-
const h = (
|
|
1380
|
-
const
|
|
1381
|
-
if (
|
|
1382
|
-
const [,
|
|
1383
|
-
return /* @__PURE__ */ e(
|
|
1384
|
-
|
|
1385
|
-
/* @__PURE__ */ e("strong", { className: "setup-ability", children:
|
|
1391
|
+
const h = (o) => {
|
|
1392
|
+
const s = o.match(/^(.*?)(\[.*?\])$/);
|
|
1393
|
+
if (s) {
|
|
1394
|
+
const [, d, c] = s;
|
|
1395
|
+
return /* @__PURE__ */ e(u, { children: [
|
|
1396
|
+
d,
|
|
1397
|
+
/* @__PURE__ */ e("strong", { className: "setup-ability", children: c })
|
|
1386
1398
|
] });
|
|
1387
1399
|
}
|
|
1388
|
-
return
|
|
1389
|
-
}, l =
|
|
1400
|
+
return o;
|
|
1401
|
+
}, l = N(i);
|
|
1390
1402
|
return /* @__PURE__ */ e("div", { className: "character-card", children: [
|
|
1391
1403
|
/* @__PURE__ */ e("div", { className: "character-icon-wrapper", children: l ? /* @__PURE__ */ e(
|
|
1392
1404
|
"img",
|
|
@@ -1407,25 +1419,25 @@ function N({
|
|
|
1407
1419
|
/* @__PURE__ */ e("div", { className: "character-info", children: [
|
|
1408
1420
|
/* @__PURE__ */ e("h3", { className: "character-name", style: { color: t }, children: [
|
|
1409
1421
|
i.name,
|
|
1410
|
-
n && r.length > 0 && /* @__PURE__ */ e("span", { className: "inline-jinx-icons", children: r.map((
|
|
1411
|
-
const
|
|
1412
|
-
return
|
|
1422
|
+
n && r.length > 0 && /* @__PURE__ */ e("span", { className: "inline-jinx-icons", children: r.map((o) => {
|
|
1423
|
+
const s = N(o);
|
|
1424
|
+
return s ? /* @__PURE__ */ e(
|
|
1413
1425
|
"img",
|
|
1414
1426
|
{
|
|
1415
|
-
src:
|
|
1416
|
-
alt:
|
|
1427
|
+
src: s,
|
|
1428
|
+
alt: o.name,
|
|
1417
1429
|
className: "inline-jinx-icon",
|
|
1418
|
-
title: `Jinxed with ${
|
|
1430
|
+
title: `Jinxed with ${o.name}`
|
|
1419
1431
|
},
|
|
1420
|
-
|
|
1432
|
+
o.id
|
|
1421
1433
|
) : /* @__PURE__ */ e(
|
|
1422
1434
|
"span",
|
|
1423
1435
|
{
|
|
1424
1436
|
className: "inline-jinx-icon-placeholder",
|
|
1425
|
-
title: `Jinxed with ${
|
|
1426
|
-
children:
|
|
1437
|
+
title: `Jinxed with ${o.name}`,
|
|
1438
|
+
children: o.name.charAt(0)
|
|
1427
1439
|
},
|
|
1428
|
-
|
|
1440
|
+
o.id
|
|
1429
1441
|
);
|
|
1430
1442
|
}) })
|
|
1431
1443
|
] }),
|
|
@@ -1433,7 +1445,7 @@ function N({
|
|
|
1433
1445
|
] })
|
|
1434
1446
|
] });
|
|
1435
1447
|
}
|
|
1436
|
-
const
|
|
1448
|
+
const D = /* @__PURE__ */ new Set([
|
|
1437
1449
|
"the",
|
|
1438
1450
|
"of",
|
|
1439
1451
|
"in",
|
|
@@ -1453,21 +1465,21 @@ const M = /* @__PURE__ */ new Set([
|
|
|
1453
1465
|
"upon",
|
|
1454
1466
|
"after",
|
|
1455
1467
|
"before"
|
|
1456
|
-
]),
|
|
1457
|
-
const h =
|
|
1468
|
+
]), w = (i, t) => D.has(i) || t === 0 && D.has(i.toLowerCase()), Y = (i) => i.split(/\s+/).reduce((t, a, r, n) => {
|
|
1469
|
+
const h = w(a, r), l = r > 0 && w(n[r - 1], r - 1);
|
|
1458
1470
|
if (r === 0 || h !== l) {
|
|
1459
|
-
const
|
|
1460
|
-
for (let
|
|
1461
|
-
|
|
1462
|
-
const
|
|
1471
|
+
const s = [];
|
|
1472
|
+
for (let c = r; c < n.length && w(n[c], c) === h; c++)
|
|
1473
|
+
s.push(n[c]);
|
|
1474
|
+
const d = t.length > 0;
|
|
1463
1475
|
t.push(
|
|
1464
1476
|
/* @__PURE__ */ e(
|
|
1465
1477
|
"span",
|
|
1466
1478
|
{
|
|
1467
1479
|
className: h ? "minor-word" : void 0,
|
|
1468
1480
|
children: [
|
|
1469
|
-
|
|
1470
|
-
|
|
1481
|
+
d && " ",
|
|
1482
|
+
s.join(" ")
|
|
1471
1483
|
]
|
|
1472
1484
|
},
|
|
1473
1485
|
r
|
|
@@ -1476,7 +1488,7 @@ const M = /* @__PURE__ */ new Set([
|
|
|
1476
1488
|
}
|
|
1477
1489
|
return t;
|
|
1478
1490
|
}, []);
|
|
1479
|
-
function
|
|
1491
|
+
function I(i) {
|
|
1480
1492
|
return typeof i == "string" ? i === "dawn" ? "/images/dawn-icon.png" : i === "dusk" ? "/images/dusk-icon.png" : i === "minioninfo" ? "/images/minioninfo.png" : "/images/demoninfo.png" : typeof i.image == "string" ? i.image : Array.isArray(i.image) && i.image.length ? i.image[0] : i.wiki_image;
|
|
1481
1493
|
}
|
|
1482
1494
|
const Z = (i) => {
|
|
@@ -1484,11 +1496,11 @@ const Z = (i) => {
|
|
|
1484
1496
|
return /* @__PURE__ */ e("div", { class: "night-orders-container", children: [
|
|
1485
1497
|
/* @__PURE__ */ e("div", { class: "night-order", children: [
|
|
1486
1498
|
/* @__PURE__ */ e("p", { children: "First Night:" }),
|
|
1487
|
-
/* @__PURE__ */ e("div", { class: "icon-row", children: t.map((r) => /* @__PURE__ */ e("img", { src:
|
|
1499
|
+
/* @__PURE__ */ e("div", { class: "icon-row", children: t.map((r) => /* @__PURE__ */ e("img", { src: I(r), class: "icon" })) })
|
|
1488
1500
|
] }),
|
|
1489
1501
|
/* @__PURE__ */ e("div", { class: "night-order", children: [
|
|
1490
1502
|
/* @__PURE__ */ e("p", { children: "Other Nights:" }),
|
|
1491
|
-
/* @__PURE__ */ e("div", { class: "icon-row", children: a.map((r) => /* @__PURE__ */ e("img", { src:
|
|
1503
|
+
/* @__PURE__ */ e("div", { class: "icon-row", children: a.map((r) => /* @__PURE__ */ e("img", { src: I(r), class: "icon" })) })
|
|
1492
1504
|
] })
|
|
1493
1505
|
] });
|
|
1494
1506
|
}, K = {
|
|
@@ -1503,7 +1515,7 @@ const Z = (i) => {
|
|
|
1503
1515
|
13: [9, 0, 3, 1],
|
|
1504
1516
|
14: [9, 1, 3, 1],
|
|
1505
1517
|
"15+": [9, 2, 3, 1]
|
|
1506
|
-
}, q = () => /* @__PURE__ */ e(
|
|
1518
|
+
}, q = () => /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e("div", { className: "player-count-container", children: [
|
|
1507
1519
|
/* @__PURE__ */ e("div", { className: "count-column titles", children: [
|
|
1508
1520
|
/* @__PURE__ */ e("div", { className: "row-title", children: "Players" }),
|
|
1509
1521
|
/* @__PURE__ */ e("div", { className: "row-title good-count", children: "Townsfolk" }),
|
|
@@ -1527,13 +1539,13 @@ const Z = (i) => {
|
|
|
1527
1539
|
nightOrders: h = { first: [], other: [] },
|
|
1528
1540
|
displayPlayerCounts: l = !0
|
|
1529
1541
|
}) => {
|
|
1530
|
-
const
|
|
1531
|
-
const
|
|
1532
|
-
return
|
|
1533
|
-
r ? Y(
|
|
1534
|
-
y <
|
|
1542
|
+
const o = () => {
|
|
1543
|
+
const d = i.split("&");
|
|
1544
|
+
return d.map((c, y) => /* @__PURE__ */ e(u, { children: [
|
|
1545
|
+
r ? Y(c) : c,
|
|
1546
|
+
y < d.length - 1 && /* @__PURE__ */ e("span", { className: "ampersand", children: "&" })
|
|
1535
1547
|
] }));
|
|
1536
|
-
},
|
|
1548
|
+
}, s = j(t, 180);
|
|
1537
1549
|
return /* @__PURE__ */ e(
|
|
1538
1550
|
"div",
|
|
1539
1551
|
{
|
|
@@ -1542,12 +1554,12 @@ const Z = (i) => {
|
|
|
1542
1554
|
transform: a ? "scale(0.952)" : void 0
|
|
1543
1555
|
},
|
|
1544
1556
|
children: [
|
|
1545
|
-
/* @__PURE__ */ e("div", { className: "sheet-background", children: /* @__PURE__ */ e("div", { className: "title-container", children: /* @__PURE__ */ e("h1", { children:
|
|
1557
|
+
/* @__PURE__ */ e("div", { className: "sheet-background", children: /* @__PURE__ */ e("div", { className: "title-container", children: /* @__PURE__ */ e("h1", { children: o() }) }) }),
|
|
1546
1558
|
/* @__PURE__ */ e(
|
|
1547
1559
|
"div",
|
|
1548
1560
|
{
|
|
1549
1561
|
className: "sheet-back-overlay",
|
|
1550
|
-
style: { background:
|
|
1562
|
+
style: { background: s }
|
|
1551
1563
|
}
|
|
1552
1564
|
),
|
|
1553
1565
|
/* @__PURE__ */ e("div", { className: "back-info-container", children: [
|
|
@@ -1557,24 +1569,24 @@ const Z = (i) => {
|
|
|
1557
1569
|
]
|
|
1558
1570
|
}
|
|
1559
1571
|
);
|
|
1560
|
-
}, Q = (i) => /* @__PURE__ */ e(
|
|
1561
|
-
/* @__PURE__ */ e(
|
|
1572
|
+
}, Q = (i) => /* @__PURE__ */ e(u, { children: [
|
|
1573
|
+
/* @__PURE__ */ e(L, { ...i, children: [
|
|
1562
1574
|
/* @__PURE__ */ e("div", { className: "night-sheet-heading", children: [
|
|
1563
1575
|
/* @__PURE__ */ e("h3", { className: "night-title", children: "First Night" }),
|
|
1564
1576
|
/* @__PURE__ */ e("h3", { className: "script-title", children: i.title })
|
|
1565
1577
|
] }),
|
|
1566
|
-
/* @__PURE__ */ e("div", { className: "night-sheet-order", children: i.firstNightOrder.map((t) => /* @__PURE__ */ e(
|
|
1578
|
+
/* @__PURE__ */ e("div", { className: "night-sheet-order", children: i.firstNightOrder.map((t) => /* @__PURE__ */ e(T, { entry: t, night: "first" })) })
|
|
1567
1579
|
] }),
|
|
1568
|
-
/* @__PURE__ */ e(
|
|
1580
|
+
/* @__PURE__ */ e(L, { ...i, children: [
|
|
1569
1581
|
/* @__PURE__ */ e("div", { className: "night-sheet-heading", children: [
|
|
1570
1582
|
/* @__PURE__ */ e("h3", { className: "night-title", children: "Other Nights" }),
|
|
1571
1583
|
/* @__PURE__ */ e("h3", { className: "script-title", children: i.title })
|
|
1572
1584
|
] }),
|
|
1573
|
-
/* @__PURE__ */ e("div", { className: "night-sheet-order", children: i.otherNightOrder.map((t) => /* @__PURE__ */ e(
|
|
1585
|
+
/* @__PURE__ */ e("div", { className: "night-sheet-order", children: i.otherNightOrder.map((t) => /* @__PURE__ */ e(T, { entry: t, night: "other" })) })
|
|
1574
1586
|
] })
|
|
1575
|
-
] }),
|
|
1576
|
-
const t =
|
|
1577
|
-
return /* @__PURE__ */ e(
|
|
1587
|
+
] }), L = (i) => {
|
|
1588
|
+
const t = k(i.color), a = A(t, 20), r = j(i.color, 180);
|
|
1589
|
+
return /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(
|
|
1578
1590
|
"div",
|
|
1579
1591
|
{
|
|
1580
1592
|
className: "night-sheet",
|
|
@@ -1609,18 +1621,18 @@ const Z = (i) => {
|
|
|
1609
1621
|
]
|
|
1610
1622
|
}
|
|
1611
1623
|
) });
|
|
1612
|
-
}, ee = () => /* @__PURE__ */ e("img", { className: "reminder-icon", src: "/images/reminder.png" }),
|
|
1613
|
-
const t =
|
|
1624
|
+
}, ee = () => /* @__PURE__ */ e("img", { className: "reminder-icon", src: "/images/reminder.png" }), T = (i) => {
|
|
1625
|
+
const t = I(i.entry), { reminderText: a, name: r } = ie(i.entry, i.night), n = typeof i.entry == "string" ? "#222" : p[i.entry.team];
|
|
1614
1626
|
if (!a)
|
|
1615
|
-
return console.warn("No reminder text found for:", i.entry), /* @__PURE__ */ e(
|
|
1616
|
-
const h = (
|
|
1627
|
+
return console.warn("No reminder text found for:", i.entry), /* @__PURE__ */ e(u, {});
|
|
1628
|
+
const h = (o) => o.split(":reminder:").map((s, d) => d % 2 === 0 ? s : /* @__PURE__ */ e(ee, {}));
|
|
1617
1629
|
return /* @__PURE__ */ e("div", { className: "night-sheet-entry", children: [
|
|
1618
1630
|
/* @__PURE__ */ e("img", { src: t }),
|
|
1619
1631
|
/* @__PURE__ */ e("div", { className: "night-sheet-entry-text", children: [
|
|
1620
1632
|
/* @__PURE__ */ e("p", { className: "reminder-name", style: { color: n }, children: r }),
|
|
1621
|
-
/* @__PURE__ */ e("p", { className: "reminder-text", children: ((
|
|
1622
|
-
const
|
|
1623
|
-
return /* @__PURE__ */ e(
|
|
1633
|
+
/* @__PURE__ */ e("p", { className: "reminder-text", children: ((o) => {
|
|
1634
|
+
const s = o.split("*").map((d, c) => c % 2 === 0 ? d : /* @__PURE__ */ e("strong", { children: d })).map((d) => typeof d == "string" ? h(d) : d);
|
|
1635
|
+
return /* @__PURE__ */ e(u, { children: s });
|
|
1624
1636
|
})(a) })
|
|
1625
1637
|
] })
|
|
1626
1638
|
] });
|
|
@@ -1671,16 +1683,16 @@ function oe({ script: i, options: t, nightOrders: a }) {
|
|
|
1671
1683
|
var r;
|
|
1672
1684
|
return /* @__PURE__ */ e("div", { className: "sheet-wrapper", children: [
|
|
1673
1685
|
Array(t.numberOfCharacterSheets).fill(!0).map((n, h) => {
|
|
1674
|
-
var l,
|
|
1686
|
+
var l, o, s;
|
|
1675
1687
|
return /* @__PURE__ */ e("div", { className: h === 0 ? "" : "print-only", children: [
|
|
1676
1688
|
/* @__PURE__ */ e(
|
|
1677
1689
|
$,
|
|
1678
1690
|
{
|
|
1679
1691
|
title: ((l = i.metadata) == null ? void 0 : l.name) || "Custom Script",
|
|
1680
|
-
author: t.showAuthor ? (
|
|
1681
|
-
characters:
|
|
1692
|
+
author: t.showAuthor ? (o = i.metadata) == null ? void 0 : o.author : void 0,
|
|
1693
|
+
characters: B(i.characters),
|
|
1682
1694
|
color: t.color,
|
|
1683
|
-
jinxes: t.showJinxes ?
|
|
1695
|
+
jinxes: t.showJinxes ? G(i.characters, t.useOldJinxes) : [],
|
|
1684
1696
|
fabledOrLoric: ae(i.characters),
|
|
1685
1697
|
showSwirls: t.showSwirls,
|
|
1686
1698
|
includeMargins: t.includeMargins,
|
|
@@ -1691,11 +1703,11 @@ function oe({ script: i, options: t, nightOrders: a }) {
|
|
|
1691
1703
|
}
|
|
1692
1704
|
),
|
|
1693
1705
|
/* @__PURE__ */ e("div", { style: "break-after:page;" }),
|
|
1694
|
-
t.showBackingSheet && /* @__PURE__ */ e(
|
|
1706
|
+
t.showBackingSheet && /* @__PURE__ */ e(u, { children: [
|
|
1695
1707
|
/* @__PURE__ */ e(
|
|
1696
1708
|
X,
|
|
1697
1709
|
{
|
|
1698
|
-
title: ((
|
|
1710
|
+
title: ((s = i.metadata) == null ? void 0 : s.name) || "Custom Script",
|
|
1699
1711
|
color: t.color,
|
|
1700
1712
|
includeMargins: t.includeMargins,
|
|
1701
1713
|
nightOrders: a,
|
|
@@ -1708,7 +1720,7 @@ function oe({ script: i, options: t, nightOrders: a }) {
|
|
|
1708
1720
|
] })
|
|
1709
1721
|
] });
|
|
1710
1722
|
}),
|
|
1711
|
-
t.showNightSheet && /* @__PURE__ */ e(
|
|
1723
|
+
t.showNightSheet && /* @__PURE__ */ e(u, { children: [
|
|
1712
1724
|
/* @__PURE__ */ e(
|
|
1713
1725
|
Q,
|
|
1714
1726
|
{
|
|
@@ -1728,7 +1740,7 @@ export {
|
|
|
1728
1740
|
oe as FancyDoc,
|
|
1729
1741
|
Q as NightSheet,
|
|
1730
1742
|
X as SheetBack,
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1743
|
+
R as darken,
|
|
1744
|
+
C as parseRgb,
|
|
1745
|
+
z as rgbString
|
|
1734
1746
|
};
|