@pie-element/element-player 0.1.5-next.20261007175429 → 0.1.5-next.20261007201108
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.
|
@@ -81,7 +81,7 @@ function g(e) {
|
|
|
81
81
|
} }));
|
|
82
82
|
}
|
|
83
83
|
var _ = "https://github.com/pie-framework/pie-players/blob/develop/docs/item-player/loading-strategies.md#one-mathjax-version-per-page", v = "pie-mathjax-version-conflict", y = Symbol.for("@pie-element/shared-math-rendering-mathjax/unsupported-page");
|
|
84
|
-
function
|
|
84
|
+
function ee(e, t) {
|
|
85
85
|
if (typeof window > "u") return;
|
|
86
86
|
let n = globalThis;
|
|
87
87
|
n[y] ??= {
|
|
@@ -98,14 +98,14 @@ function b(e, t) {
|
|
|
98
98
|
docsUrl: _
|
|
99
99
|
} }));
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function te() {
|
|
102
102
|
let e = window.MathJax?.version;
|
|
103
103
|
return typeof e == "string" && e.startsWith("3.") ? e : void 0;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function b() {
|
|
106
106
|
return window.MathJax;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function ne(t, { root: n, speechPath: r }) {
|
|
109
109
|
n && (t.loader = {
|
|
110
110
|
...t.loader,
|
|
111
111
|
paths: {
|
|
@@ -121,81 +121,81 @@ function te(t, { root: n, speechPath: r }) {
|
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function re(e, t) {
|
|
125
125
|
let n = t.srcUrl || (t.root ? `${t.root}/mathjax@4.1.3/tex-mml-chtml.js` : void 0);
|
|
126
|
-
return n ? (
|
|
126
|
+
return n ? (ne(e, t), new Promise((t, r) => {
|
|
127
127
|
window.MathJax = e;
|
|
128
128
|
let i = document.createElement("script");
|
|
129
129
|
i.src = n, i.async = !0, i.onload = () => t(!0), i.onerror = () => r(/* @__PURE__ */ Error("Failed to load MathJax")), document.head.appendChild(i);
|
|
130
130
|
})) : (g("untypeset"), Promise.resolve(!1));
|
|
131
131
|
}
|
|
132
|
-
var
|
|
133
|
-
function
|
|
132
|
+
var ie = globalThis, x = "PIE-MJX-CHTML-styles", ae = ["MJX-CHTML-styles", "MJX-SVG-styles"], oe = te, se = "http://www.w3.org/1998/Math/MathML", ce = /^([a-z_][\w.-]*):math$/, le = /^[a-z][a-z0-9-]*$/;
|
|
133
|
+
function ue(e) {
|
|
134
134
|
for (let t of e.querySelectorAll("*")) {
|
|
135
|
-
let n =
|
|
136
|
-
!n || !e.contains(t) || t.closest("mjx-container") || t.replaceWith(
|
|
135
|
+
let n = ce.exec(t.tagName.toLowerCase())?.[1];
|
|
136
|
+
!n || !e.contains(t) || t.closest("mjx-container") || t.replaceWith(de(t, `${n}:`));
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function de(e, t) {
|
|
140
140
|
let n = e.tagName.toLowerCase().slice(t.length);
|
|
141
|
-
if (!
|
|
142
|
-
let r = e.ownerDocument.createElementNS(
|
|
141
|
+
if (!le.test(n)) return e;
|
|
142
|
+
let r = e.ownerDocument.createElementNS(se, n);
|
|
143
143
|
for (let t of e.attributes) r.setAttribute(t.name, t.value);
|
|
144
144
|
for (let n of [...e.childNodes]) {
|
|
145
145
|
let e = n instanceof Element && n.tagName.toLowerCase().startsWith(t);
|
|
146
|
-
r.appendChild(e ?
|
|
146
|
+
r.appendChild(e ? de(n, t) : n);
|
|
147
147
|
}
|
|
148
148
|
return r;
|
|
149
149
|
}
|
|
150
|
-
var
|
|
150
|
+
var fe = /* @__PURE__ */ new Set([
|
|
151
151
|
"updiagonalstrike",
|
|
152
152
|
"downdiagonalstrike",
|
|
153
153
|
"verticalstrike",
|
|
154
154
|
"horizontalstrike"
|
|
155
|
-
]),
|
|
155
|
+
]), pe = {
|
|
156
156
|
thin: "0.035em",
|
|
157
157
|
medium: "0.07em",
|
|
158
158
|
thick: "0.14em"
|
|
159
|
-
},
|
|
159
|
+
}, me = {
|
|
160
160
|
tight: "0em",
|
|
161
161
|
medium: "0.1em",
|
|
162
162
|
loose: "0.2em"
|
|
163
|
-
},
|
|
163
|
+
}, he = /^(\d+(\.\d*)?|\.\d+)(em|ex|px|pt|pc|in|cm|mm)$/, ge = /^(#[0-9a-f]{3,8}|[a-z]+)$/i, _e = /^(\d+(\.\d*)?|\.\d+)$/, ve = /* @__PURE__ */ new Set([
|
|
164
164
|
"mn",
|
|
165
165
|
"mo",
|
|
166
166
|
"mi",
|
|
167
167
|
"mtext"
|
|
168
|
-
]),
|
|
168
|
+
]), ye = /* @__PURE__ */ new Set([
|
|
169
169
|
"stackalign",
|
|
170
170
|
"charalign",
|
|
171
171
|
"charspacing",
|
|
172
172
|
"longdivstyle"
|
|
173
173
|
]);
|
|
174
|
-
function
|
|
175
|
-
let i = e.createElementNS(
|
|
174
|
+
function S(e, t, n = [], r = {}) {
|
|
175
|
+
let i = e.createElementNS(se, t);
|
|
176
176
|
for (let [e, t] of Object.entries(r)) i.setAttribute(e, t);
|
|
177
177
|
for (let e of n) e && i.appendChild(e);
|
|
178
178
|
return i;
|
|
179
179
|
}
|
|
180
|
-
function
|
|
181
|
-
let n =
|
|
180
|
+
function C(e, t) {
|
|
181
|
+
let n = S(e.document, "mo");
|
|
182
182
|
return n.textContent = t, n;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
let t =
|
|
186
|
-
return t.textContent = "0",
|
|
184
|
+
function be(e) {
|
|
185
|
+
let t = S(e.document, "mn");
|
|
186
|
+
return t.textContent = "0", S(e.document, "mphantom", [t]);
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function w(e, t) {
|
|
189
189
|
return e.getAttribute(t)?.trim().toLowerCase() || void 0;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function T(e, t) {
|
|
192
192
|
let n = Number.parseInt(e.getAttribute(t) ?? "", 10);
|
|
193
193
|
return Number.isFinite(n) ? n : 0;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function E(e) {
|
|
196
196
|
return e.localName === "none" || e.localName === "mrow" && e.children.length === 0 && !e.textContent?.trim();
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function D(e, t, n = e) {
|
|
199
199
|
switch (t) {
|
|
200
200
|
case "left": return 0;
|
|
201
201
|
case "center": return Math.floor(e / 2);
|
|
@@ -203,14 +203,14 @@ function N(e, t, n = e) {
|
|
|
203
203
|
default: return n;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function O(e, t, n) {
|
|
207
207
|
let r = [], i, a, o = (e, t) => {
|
|
208
208
|
let s = (e) => t.reduceRight((e, t) => {
|
|
209
209
|
let n = t.cloneNode(!1);
|
|
210
210
|
return n.appendChild(e), n;
|
|
211
211
|
}, e);
|
|
212
212
|
if (e.localName === "mstyle") for (let n of [...e.children]) o(n, [...t, e]);
|
|
213
|
-
else if (
|
|
213
|
+
else if (E(e)) r.push(null);
|
|
214
214
|
else if (e.localName === "mn" && e.children.length === 0) {
|
|
215
215
|
let t = [...(e.textContent ?? "").trim()];
|
|
216
216
|
for (let a of t) {
|
|
@@ -219,28 +219,28 @@ function P(e, t, n) {
|
|
|
219
219
|
t.textContent = a, r.push(s(t));
|
|
220
220
|
}
|
|
221
221
|
t.length && (a ??= r.length);
|
|
222
|
-
} else
|
|
222
|
+
} else ve.has(e.localName) && e.textContent?.trim() === n.decimalPoint && (i ??= r.length), r.push(s(e));
|
|
223
223
|
};
|
|
224
224
|
for (let t of e) o(t, []);
|
|
225
225
|
return {
|
|
226
226
|
kind: "digits",
|
|
227
227
|
cells: r,
|
|
228
|
-
anchor:
|
|
228
|
+
anchor: D(r.length, n.stackAlign, i ?? a),
|
|
229
229
|
position: t
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
-
function
|
|
233
|
-
return (e ?? "").toLowerCase().split(/\s+/).filter((e) =>
|
|
232
|
+
function k(e) {
|
|
233
|
+
return (e ?? "").toLowerCase().split(/\s+/).filter((e) => fe.has(e));
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
let n = [...e.children].filter((e) => !
|
|
237
|
-
return n.length <= 1 ? n[0] ?? null :
|
|
235
|
+
function xe(e, t) {
|
|
236
|
+
let n = [...e.children].filter((e) => !E(e));
|
|
237
|
+
return n.length <= 1 ? n[0] ?? null : S(t.document, "mrow", n);
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
let r =
|
|
241
|
-
content:
|
|
242
|
-
location:
|
|
243
|
-
crossout: e.hasAttribute("crossout") ?
|
|
239
|
+
function Se(e, t, n) {
|
|
240
|
+
let r = w(e, "location") ?? "n", i = k(e.getAttribute("crossout")), a = [...e.children].map((e) => E(e) ? null : e.localName === "mscarry" ? {
|
|
241
|
+
content: xe(e, n),
|
|
242
|
+
location: w(e, "location") ?? r,
|
|
243
|
+
crossout: e.hasAttribute("crossout") ? k(e.getAttribute("crossout")) : i
|
|
244
244
|
} : {
|
|
245
245
|
content: e,
|
|
246
246
|
location: r,
|
|
@@ -249,60 +249,60 @@ function ge(e, t, n) {
|
|
|
249
249
|
return {
|
|
250
250
|
kind: "carries",
|
|
251
251
|
carries: a,
|
|
252
|
-
anchor:
|
|
252
|
+
anchor: D(a.length, n.stackAlign),
|
|
253
253
|
position: t,
|
|
254
|
-
scale:
|
|
254
|
+
scale: _e.test(o) ? o : "0.6"
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
let t =
|
|
259
|
-
return `${n} solid ${
|
|
257
|
+
function A(e) {
|
|
258
|
+
let t = w(e, "mslinethickness") ?? "medium", n = pe[t] ?? (he.test(t) ? t : "0.07em"), r = e.getAttribute("mathcolor")?.trim() ?? "";
|
|
259
|
+
return `${n} solid ${ge.test(r) ? r : "currentColor"}`;
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
let r = Math.max(0,
|
|
261
|
+
function Ce(e, t, n) {
|
|
262
|
+
let r = Math.max(0, T(e, "length"));
|
|
263
263
|
return {
|
|
264
264
|
kind: "line",
|
|
265
265
|
length: r,
|
|
266
|
-
anchor:
|
|
266
|
+
anchor: D(r, n.stackAlign),
|
|
267
267
|
position: t,
|
|
268
|
-
border:
|
|
268
|
+
border: A(e)
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function j(e, t, n, r, i) {
|
|
272
272
|
e.forEach((e, a) => {
|
|
273
|
-
let o = t + a * n +
|
|
273
|
+
let o = t + a * n + T(e, "position");
|
|
274
274
|
switch (e.localName) {
|
|
275
275
|
case "msgroup":
|
|
276
|
-
|
|
276
|
+
j([...e.children], o, T(e, "shift"), r, i);
|
|
277
277
|
break;
|
|
278
278
|
case "msline":
|
|
279
|
-
i.push(
|
|
279
|
+
i.push(Ce(e, o, r));
|
|
280
280
|
break;
|
|
281
281
|
case "mscarries":
|
|
282
|
-
i.push(
|
|
282
|
+
i.push(Se(e, o, r));
|
|
283
283
|
break;
|
|
284
284
|
case "msrow":
|
|
285
285
|
case "mrow":
|
|
286
|
-
i.push(
|
|
286
|
+
i.push(O([...e.children], o, r));
|
|
287
287
|
break;
|
|
288
|
-
default: i.push(
|
|
288
|
+
default: i.push(O([e], o, r));
|
|
289
289
|
}
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function M(e) {
|
|
293
293
|
return -e.anchor - e.position;
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function N(e) {
|
|
296
296
|
return e.kind === "digits" ? e.cells.length : e.kind === "carries" ? e.carries.length : e.length;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
299
|
-
return
|
|
298
|
+
function P(e) {
|
|
299
|
+
return M(e) + N(e) - 1;
|
|
300
300
|
}
|
|
301
|
-
function
|
|
302
|
-
let i = (e) =>
|
|
301
|
+
function we(e, t, n, r) {
|
|
302
|
+
let i = (e) => S(r.document, "mpadded", [t], {
|
|
303
303
|
width: "0",
|
|
304
304
|
...e ? { lspace: e } : {}
|
|
305
|
-
}), a = (e, t) =>
|
|
305
|
+
}), a = (e, t) => S(r.document, e, t);
|
|
306
306
|
switch (n) {
|
|
307
307
|
case "s": return a("munder", [e, i("-0.5width")]);
|
|
308
308
|
case "ne": return a("msup", [e, i()]);
|
|
@@ -324,49 +324,49 @@ function ve(e, t, n, r) {
|
|
|
324
324
|
default: return a("mover", [e, i("-0.5width")]);
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
let r =
|
|
327
|
+
function Te(e, t, n) {
|
|
328
|
+
let r = S(n.document, "menclose", [e], {
|
|
329
329
|
notation: t.join(" "),
|
|
330
330
|
"data-padding": "0.1em",
|
|
331
331
|
"data-thickness": "0.067em"
|
|
332
332
|
}), i = t.some((e) => e.endsWith("diagonalstrike")) ? .167 : t.includes("horizontalstrike") ? .1 : 0;
|
|
333
|
-
return i ?
|
|
333
|
+
return i ? S(n.document, "mpadded", [r], {
|
|
334
334
|
lspace: `-${i}em`,
|
|
335
335
|
width: `-${2 * i}em`
|
|
336
336
|
}) : r;
|
|
337
337
|
}
|
|
338
|
-
function
|
|
339
|
-
let a = e && t.crossout.length ?
|
|
338
|
+
function Ee(e, t, n, r, i) {
|
|
339
|
+
let a = e && t.crossout.length ? Te(e, t.crossout, i) : e;
|
|
340
340
|
if (!t.content) return a;
|
|
341
|
-
let o =
|
|
342
|
-
return
|
|
341
|
+
let o = S(i.document, "mstyle", [t.content], { scriptsizemultiplier: r });
|
|
342
|
+
return we(a ?? be(i), o, n, i);
|
|
343
343
|
}
|
|
344
|
-
function
|
|
345
|
-
return e.carries[t -
|
|
344
|
+
function F(e, t) {
|
|
345
|
+
return e.carries[t - M(e)] ?? null;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function De(e, t, n, r) {
|
|
348
348
|
let i = e.content;
|
|
349
349
|
n.forEach((e, a) => {
|
|
350
|
-
let o = n.length - 1 - a, s = n[o], c =
|
|
350
|
+
let o = n.length - 1 - a, s = n[o], c = F(s, t), l = n.slice(0, o).some((e) => F(e, t));
|
|
351
351
|
if (!c && !l) return;
|
|
352
352
|
let u = c ?? {
|
|
353
|
-
content:
|
|
353
|
+
content: be(r),
|
|
354
354
|
location: "n",
|
|
355
355
|
crossout: []
|
|
356
356
|
}, d = a === 0 ? u.location : "n";
|
|
357
|
-
i =
|
|
357
|
+
i = Ee(i, u, d, s.scale, r);
|
|
358
358
|
}), e.content = i;
|
|
359
359
|
}
|
|
360
|
-
function
|
|
361
|
-
let n = e.filter((e) =>
|
|
360
|
+
function I(e, t) {
|
|
361
|
+
let n = e.filter((e) => N(e) > 0), r = Math.min(0, ...n.map(M)), i = Math.max(r, ...n.map(P)) - r + 1, a = -r, o = [], s = /* @__PURE__ */ new Map(), c = () => Array.from({ length: i }, () => ({
|
|
362
362
|
content: null,
|
|
363
363
|
borders: {}
|
|
364
|
-
})), l = (e) => e.length === 0 ? Array.from({ length: i }, (e, t) => t) : Array.from({ length: e.length }, (t, n) => a +
|
|
364
|
+
})), l = (e) => e.length === 0 ? Array.from({ length: i }, (e, t) => t) : Array.from({ length: e.length }, (t, n) => a + M(e) + n), u = [], d = [], f = (e) => {
|
|
365
365
|
let n = c();
|
|
366
366
|
e.cells.forEach((t, r) => {
|
|
367
|
-
n[a +
|
|
367
|
+
n[a + M(e) + r].content = t;
|
|
368
368
|
}), u.length && n.forEach((e, n) => {
|
|
369
|
-
|
|
369
|
+
De(e, n - a, u, t);
|
|
370
370
|
});
|
|
371
371
|
for (let e of d) for (let t of l(e)) n[t].borders.top = e.border;
|
|
372
372
|
u = [], d = [], s.set(e, o.length), o.push(n);
|
|
@@ -386,44 +386,44 @@ function H(e, t) {
|
|
|
386
386
|
origin: a
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
let r =
|
|
389
|
+
function L(e, { rows: t }, n) {
|
|
390
|
+
let r = S(n.document, "mtable", t.map((e) => S(n.document, "mtr", e.map((e) => {
|
|
391
391
|
let t = Object.entries(e.borders).map(([e, t]) => `border-${e}:${t}`).join(";");
|
|
392
|
-
return
|
|
392
|
+
return S(n.document, "mtd", [e.content], {
|
|
393
393
|
...t ? { style: t } : {},
|
|
394
394
|
...e.align ? { columnalign: e.align } : {}
|
|
395
395
|
});
|
|
396
396
|
}))));
|
|
397
|
-
for (let { name: t, value: n } of [...e.attributes])
|
|
398
|
-
let i =
|
|
399
|
-
return r.setAttribute("columnspacing",
|
|
397
|
+
for (let { name: t, value: n } of [...e.attributes]) ye.has(t) || r.setAttribute(t, n);
|
|
398
|
+
let i = w(e, "charspacing") ?? "medium", a = w(e, "charalign");
|
|
399
|
+
return r.setAttribute("columnspacing", me[i] ?? (he.test(i) ? i : me.medium)), r.setAttribute("columnalign", a === "left" || a === "center" ? a : "right"), r.setAttribute("rowspacing", "0"), r.setAttribute("align", e.getAttribute("align") ?? "baseline"), r;
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function R(e) {
|
|
402
402
|
return {
|
|
403
403
|
document: e.ownerDocument,
|
|
404
|
-
stackAlign:
|
|
404
|
+
stackAlign: w(e, "stackalign") ?? "decimalpoint",
|
|
405
405
|
decimalPoint: e.closest("[decimalpoint]")?.getAttribute("decimalpoint")?.trim().charAt(0) || "."
|
|
406
406
|
};
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
let t =
|
|
410
|
-
return
|
|
408
|
+
function Oe(e) {
|
|
409
|
+
let t = R(e), n = [];
|
|
410
|
+
return j([...e.children], 0, 0, t, n), L(e, I(n, t), t);
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function z(e, t, n, r, i, a) {
|
|
413
413
|
for (let o = n; o <= r; o++) e[t][o].borders[i] = a;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
let n =
|
|
417
|
-
return n.setAttribute("minsize", "1.2em"), [
|
|
415
|
+
function ke(e, t) {
|
|
416
|
+
let n = C(t, ")");
|
|
417
|
+
return n.setAttribute("minsize", "1.2em"), [S(t.document, "mrow", [e, S(t.document, "mspace", [], { width: "0.2em" })]), S(t.document, "mpadded", [n], {
|
|
418
418
|
voffset: "0.1em",
|
|
419
419
|
lspace: "-0.15em",
|
|
420
420
|
depth: "-0.2em",
|
|
421
421
|
height: "-0.2em"
|
|
422
422
|
})];
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
let t =
|
|
426
|
-
|
|
424
|
+
function Ae(e) {
|
|
425
|
+
let t = R(e), [n, r, ...i] = [...e.children], a = n && !E(n) ? n : null, o = r && !E(r) ? r : null, s = w(e, "longdivstyle") ?? "lefttop", c = A(e), l = [];
|
|
426
|
+
j(i, 0, 0, t, l);
|
|
427
427
|
let u = l.find((e) => e.kind === "digits");
|
|
428
428
|
u || (u = {
|
|
429
429
|
kind: "digits",
|
|
@@ -435,51 +435,51 @@ function we(e) {
|
|
|
435
435
|
u.cells.unshift(...e), u.anchor += e.length;
|
|
436
436
|
}, p = (...e) => {
|
|
437
437
|
let n = e.flatMap((e) => e ? e.localName === "mrow" ? [...e.children] : [e] : []);
|
|
438
|
-
u.cells.push(...
|
|
438
|
+
u.cells.push(...O(n, 0, t).cells);
|
|
439
439
|
};
|
|
440
440
|
switch (s) {
|
|
441
441
|
case "left/\\right":
|
|
442
|
-
f(a,
|
|
442
|
+
f(a, C(t, "/")), p(C(t, "\\"), o);
|
|
443
443
|
break;
|
|
444
444
|
case "left)(right":
|
|
445
|
-
f(a,
|
|
445
|
+
f(a, C(t, ")")), p(C(t, "("), o);
|
|
446
446
|
break;
|
|
447
447
|
case ":right=right":
|
|
448
|
-
p(
|
|
448
|
+
p(C(t, ":"), a, C(t, "="), o);
|
|
449
449
|
break;
|
|
450
450
|
case "righttop":
|
|
451
451
|
case "stackedleftlinetop":
|
|
452
452
|
case "lefttop":
|
|
453
|
-
o &&
|
|
453
|
+
o && j([o], 0, 0, t, d), l.splice(l.indexOf(u), 0, ...d), s === "righttop" ? p(a) : s === "stackedleftlinetop" ? f(a) : f(...ke(a, t));
|
|
454
454
|
break;
|
|
455
455
|
}
|
|
456
|
-
let m =
|
|
456
|
+
let m = I(l, t), h = m.rows, g = m.rowOf.get(u) ?? 0, _ = (e) => m.origin + M(u) + e, v = Math.max(_(u.cells.length - 1), ...d.map((e) => m.origin + P(e)));
|
|
457
457
|
switch (s) {
|
|
458
458
|
case "left/\\right":
|
|
459
459
|
case "left)(right":
|
|
460
460
|
case ":right=right": break;
|
|
461
461
|
case "righttop": {
|
|
462
462
|
let e = h[g][_(u.cells.length - 1)];
|
|
463
|
-
e.borders.left = c, e.borders.bottom = c,
|
|
463
|
+
e.borders.left = c, e.borders.bottom = c, z(h, g, _(0), _(u.cells.length - 1), "top", c);
|
|
464
464
|
break;
|
|
465
465
|
}
|
|
466
466
|
case "stackedleftlinetop": {
|
|
467
467
|
let e = h[g][_(0)];
|
|
468
|
-
e.borders.right = c, e.borders.bottom = c,
|
|
468
|
+
e.borders.right = c, e.borders.bottom = c, z(h, g, _(1), v, "top", c);
|
|
469
469
|
break;
|
|
470
470
|
}
|
|
471
471
|
case "stackedrightright":
|
|
472
472
|
case "mediumstackedrightright":
|
|
473
473
|
case "shortstackedrightright":
|
|
474
474
|
case "stackedleftleft":
|
|
475
|
-
|
|
475
|
+
je(h, g, s, a, o, c, t);
|
|
476
476
|
break;
|
|
477
|
-
default:
|
|
477
|
+
default: z(h, g, _(1), v, "top", c);
|
|
478
478
|
}
|
|
479
|
-
return
|
|
479
|
+
return L(e, m, t);
|
|
480
480
|
}
|
|
481
|
-
function
|
|
482
|
-
let s = n === "stackedleftleft", c = s ? "right" : "left", l = (e) => e &&
|
|
481
|
+
function je(e, t, n, r, i, a, o) {
|
|
482
|
+
let s = n === "stackedleftleft", c = s ? "right" : "left", l = (e) => e && S(o.document, "mpadded", [e], {
|
|
483
483
|
lspace: "0.2em",
|
|
484
484
|
width: "+0.4em"
|
|
485
485
|
});
|
|
@@ -498,134 +498,409 @@ function Te(e, t, n, r, i, a, o) {
|
|
|
498
498
|
}) : o === t + 1 ? (u.content = l(i), n !== "shortstackedrightright" && (u.borders[c] = a)) : o > t + 1 && (n === "stackedrightright" || s) && (u.borders[c] = a), s ? e.unshift(u) : e.push(u);
|
|
499
499
|
});
|
|
500
500
|
}
|
|
501
|
-
function
|
|
502
|
-
for (let t of [...e.querySelectorAll("mstack, mlongdiv")]) !t.closest("math") || t.closest("mjx-container") || t.replaceWith(t.localName === "mstack" ?
|
|
501
|
+
function Me(e) {
|
|
502
|
+
for (let t of [...e.querySelectorAll("mstack, mlongdiv")]) !t.closest("math") || t.closest("mjx-container") || t.replaceWith(t.localName === "mstack" ? Oe(t) : Ae(t));
|
|
503
503
|
}
|
|
504
|
-
var
|
|
504
|
+
var Ne = "PIE-MJX-explorer-styles", B = "var(--pie-text, black)", Pe = "var(--pie-background, #ffffff)", Fe = "var(--pie-border-dark, #66686A)", V = "var(--pie-focus-outline, var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565C0)))", H = `color-mix(in srgb, ${V} 15%, transparent)`, Ie = `
|
|
505
505
|
:root mjx-container [data-sre-highlight-1]:not([data-mjx-collapsed], rect) {
|
|
506
|
-
color: ${
|
|
507
|
-
fill: ${
|
|
506
|
+
color: ${B} !important;
|
|
507
|
+
fill: ${B} !important;
|
|
508
508
|
}
|
|
509
509
|
:root mjx-container:not([data-mjx-clone-container]) [data-sre-highlight-1]:not([data-sre-enclosed], rect) {
|
|
510
|
-
background-color: ${
|
|
510
|
+
background-color: ${H} !important;
|
|
511
511
|
}
|
|
512
512
|
:root mjx-container rect[data-sre-highlight-1]:not([data-sre-enclosed]) {
|
|
513
|
-
fill: ${
|
|
513
|
+
fill: ${H} !important;
|
|
514
514
|
}
|
|
515
515
|
:root mjx-container .mjx-selected {
|
|
516
|
-
outline: 2px solid ${
|
|
516
|
+
outline: 2px solid ${V} !important;
|
|
517
517
|
}
|
|
518
518
|
:root mjx-container [data-sre-highlight-2] {
|
|
519
|
-
color: ${
|
|
519
|
+
color: ${B} !important;
|
|
520
520
|
background-color: transparent !important;
|
|
521
|
-
fill: ${
|
|
522
|
-
outline: 2px dashed ${
|
|
521
|
+
fill: ${B} !important;
|
|
522
|
+
outline: 2px dashed ${V} !important;
|
|
523
523
|
}
|
|
524
524
|
:root mjx-container rect[data-sre-highlight-2] {
|
|
525
525
|
fill: transparent !important;
|
|
526
|
-
stroke: ${
|
|
526
|
+
stroke: ${V} !important;
|
|
527
527
|
stroke-width: 2px !important;
|
|
528
528
|
vector-effect: non-scaling-stroke;
|
|
529
529
|
}
|
|
530
530
|
:root .MJX_LiveRegion, :root .MJX_HoverRegion, :root .MJX_ToolTip {
|
|
531
|
-
color: ${
|
|
532
|
-
background-color: ${
|
|
533
|
-
border-color: ${
|
|
531
|
+
color: ${B} !important;
|
|
532
|
+
background-color: ${Pe} !important;
|
|
533
|
+
border-color: ${Fe} !important;
|
|
534
534
|
}
|
|
535
535
|
:root .MJX_LiveRegion > div, :root .MJX_HoverRegion > div {
|
|
536
|
-
color: ${
|
|
537
|
-
background-color: ${
|
|
536
|
+
color: ${B} !important;
|
|
537
|
+
background-color: ${H} !important;
|
|
538
538
|
}
|
|
539
539
|
`;
|
|
540
|
-
function
|
|
540
|
+
function Le(e = document) {
|
|
541
541
|
if (e.getElementById("PIE-MJX-explorer-styles")) return;
|
|
542
542
|
let t = e.createElement("style");
|
|
543
|
-
t.id =
|
|
543
|
+
t.id = Ne, t.textContent = Ie, e.head.appendChild(t);
|
|
544
|
+
}
|
|
545
|
+
var Re = /[-]/g, ze = {
|
|
546
|
+
"+": "positive",
|
|
547
|
+
"-": "negative",
|
|
548
|
+
"−": "negative",
|
|
549
|
+
"±": "plus or minus",
|
|
550
|
+
"∓": "minus or plus"
|
|
551
|
+
}, Be = {
|
|
552
|
+
"(": "open parenthesis",
|
|
553
|
+
"[": "open bracket",
|
|
554
|
+
"{": "open brace",
|
|
555
|
+
"⟨": "open angle bracket",
|
|
556
|
+
"⌊": "open floor",
|
|
557
|
+
"⌈": "open ceiling"
|
|
558
|
+
}, Ve = {
|
|
559
|
+
")": "close parenthesis",
|
|
560
|
+
"]": "close bracket",
|
|
561
|
+
"}": "close brace",
|
|
562
|
+
"⟩": "close angle bracket",
|
|
563
|
+
"⌋": "close floor",
|
|
564
|
+
"⌉": "close ceiling"
|
|
565
|
+
}, U = {
|
|
566
|
+
"!": "factorial",
|
|
567
|
+
"%": "percent",
|
|
568
|
+
"°": "degrees",
|
|
569
|
+
"′": "prime",
|
|
570
|
+
"″": "double prime"
|
|
571
|
+
}, He = {
|
|
572
|
+
"+": "plus",
|
|
573
|
+
"-": "minus",
|
|
574
|
+
"−": "minus",
|
|
575
|
+
"±": "plus or minus",
|
|
576
|
+
"∓": "minus or plus",
|
|
577
|
+
"×": "times",
|
|
578
|
+
"⋅": "times",
|
|
579
|
+
"·": "times",
|
|
580
|
+
"*": "times",
|
|
581
|
+
"÷": "divided by",
|
|
582
|
+
"/": "divided by",
|
|
583
|
+
"=": "equals",
|
|
584
|
+
"≠": "does not equal",
|
|
585
|
+
"<": "is less than",
|
|
586
|
+
">": "is greater than",
|
|
587
|
+
"≤": "is less than or equal to",
|
|
588
|
+
"≥": "is greater than or equal to",
|
|
589
|
+
"≈": "is approximately equal to",
|
|
590
|
+
"≡": "is equivalent to",
|
|
591
|
+
"∝": "is proportional to",
|
|
592
|
+
"∈": "is an element of",
|
|
593
|
+
"∉": "is not an element of",
|
|
594
|
+
"⊂": "is a subset of",
|
|
595
|
+
"⊆": "is a subset of or equal to",
|
|
596
|
+
"∪": "union",
|
|
597
|
+
"∩": "intersection",
|
|
598
|
+
"→": "right arrow",
|
|
599
|
+
"←": "left arrow",
|
|
600
|
+
"⇒": "implies",
|
|
601
|
+
"⇔": "if and only if",
|
|
602
|
+
"∑": "sum",
|
|
603
|
+
"∏": "product",
|
|
604
|
+
"∫": "integral",
|
|
605
|
+
"∞": "infinity",
|
|
606
|
+
"∠": "angle",
|
|
607
|
+
"⊥": "is perpendicular to",
|
|
608
|
+
"∥": "is parallel to",
|
|
609
|
+
"∴": "therefore",
|
|
610
|
+
",": "comma",
|
|
611
|
+
";": "semicolon",
|
|
612
|
+
":": "colon",
|
|
613
|
+
"|": "vertical bar",
|
|
614
|
+
"‖": "double vertical bar",
|
|
615
|
+
...Be,
|
|
616
|
+
...Ve,
|
|
617
|
+
...U
|
|
618
|
+
}, Ue = /* @__PURE__ */ new Set(["|", "‖"]), We = /* @__PURE__ */ new Set([
|
|
619
|
+
"∑",
|
|
620
|
+
"∏",
|
|
621
|
+
"∫",
|
|
622
|
+
"∪",
|
|
623
|
+
"∩"
|
|
624
|
+
]), Ge = {
|
|
625
|
+
α: "alpha",
|
|
626
|
+
β: "beta",
|
|
627
|
+
γ: "gamma",
|
|
628
|
+
δ: "delta",
|
|
629
|
+
ε: "epsilon",
|
|
630
|
+
θ: "theta",
|
|
631
|
+
λ: "lambda",
|
|
632
|
+
μ: "mu",
|
|
633
|
+
π: "pi",
|
|
634
|
+
ρ: "rho",
|
|
635
|
+
σ: "sigma",
|
|
636
|
+
τ: "tau",
|
|
637
|
+
φ: "phi",
|
|
638
|
+
ω: "omega",
|
|
639
|
+
Δ: "capital delta",
|
|
640
|
+
Σ: "capital sigma",
|
|
641
|
+
Ω: "capital omega",
|
|
642
|
+
"∞": "infinity",
|
|
643
|
+
sin: "sine",
|
|
644
|
+
cos: "cosine",
|
|
645
|
+
tan: "tangent",
|
|
646
|
+
sec: "secant",
|
|
647
|
+
csc: "cosecant",
|
|
648
|
+
cot: "cotangent",
|
|
649
|
+
ln: "natural log",
|
|
650
|
+
lim: "limit"
|
|
651
|
+
}, Ke = {
|
|
652
|
+
"¯": "bar",
|
|
653
|
+
"‾": "bar",
|
|
654
|
+
"―": "bar",
|
|
655
|
+
"^": "hat",
|
|
656
|
+
ˆ: "hat",
|
|
657
|
+
"~": "tilde",
|
|
658
|
+
"˜": "tilde",
|
|
659
|
+
"→": "vector",
|
|
660
|
+
"⃗": "vector",
|
|
661
|
+
"˙": "dot"
|
|
662
|
+
}, W = (e) => (e.textContent ?? "").replace(Re, "").replace(/\s+/g, " ").trim(), G = (e) => e.replace(/\s+/g, " ").trim(), K = (e) => [...e.children];
|
|
663
|
+
function q(e) {
|
|
664
|
+
return !e || [
|
|
665
|
+
"mn",
|
|
666
|
+
"mi",
|
|
667
|
+
"mtext",
|
|
668
|
+
"mo"
|
|
669
|
+
].includes(e.localName) ? !0 : ["mrow", "mstyle"].includes(e.localName) && e.children.length === 1 ? q(e.children[0]) : !1;
|
|
670
|
+
}
|
|
671
|
+
function qe(e) {
|
|
672
|
+
let t = e ? W(e) : "";
|
|
673
|
+
return /^\d{1,3}$/.test(t) ? Number(t) : void 0;
|
|
674
|
+
}
|
|
675
|
+
function Je(e) {
|
|
676
|
+
return `${e}${e % 100 >= 11 && e % 100 <= 13 ? "th" : {
|
|
677
|
+
1: "st",
|
|
678
|
+
2: "nd",
|
|
679
|
+
3: "rd"
|
|
680
|
+
}[e % 10] ?? "th"}`;
|
|
681
|
+
}
|
|
682
|
+
function Ye(e) {
|
|
683
|
+
return Ge[e] ?? e;
|
|
684
|
+
}
|
|
685
|
+
function J(e) {
|
|
686
|
+
return He[e] ?? e;
|
|
687
|
+
}
|
|
688
|
+
function Y(e) {
|
|
689
|
+
let t = [], n = !1;
|
|
690
|
+
for (let r of e) {
|
|
691
|
+
if (r.localName !== "mo") {
|
|
692
|
+
t.push(X(r)), n = !0;
|
|
693
|
+
continue;
|
|
694
|
+
}
|
|
695
|
+
let e = W(r);
|
|
696
|
+
e && (!n && ze[e] ? t.push(ze[e]) : e in U ? t.push(U[e]) : (t.push(J(e)), n = e in Ve || Ue.has(e) && n));
|
|
697
|
+
}
|
|
698
|
+
return t.filter(Boolean).join(" ");
|
|
699
|
+
}
|
|
700
|
+
function Xe(e) {
|
|
701
|
+
let [t, ...n] = e, r = n[n.length - 1], i = (e) => e?.localName === "mo" && ["|", "‖"].includes(W(e)), a = n.slice(0, -1);
|
|
702
|
+
if (a.length && i(t) && i(r) && W(t) === W(r) && !a.some(i)) {
|
|
703
|
+
let e = G(Y(a));
|
|
704
|
+
return W(t) === "|" ? `absolute value of ${e} end absolute value` : `norm of ${e} end norm`;
|
|
705
|
+
}
|
|
706
|
+
return Y(e);
|
|
707
|
+
}
|
|
708
|
+
function Ze(e, t) {
|
|
709
|
+
let n = e ? X(e) : "", r = t ? X(t) : "";
|
|
710
|
+
return q(e) && q(t) ? `${n} over ${r}` : `the fraction with numerator ${n} and denominator ${r}`;
|
|
711
|
+
}
|
|
712
|
+
function Qe(e, t, n) {
|
|
713
|
+
return n ? `${t} of ${e}` : `${t} of ${e} end root`;
|
|
714
|
+
}
|
|
715
|
+
function $e(e, t) {
|
|
716
|
+
let n = t ? W(t) : "";
|
|
717
|
+
if (t && q(t)) {
|
|
718
|
+
if (n === "2") return `${e} squared`;
|
|
719
|
+
if (n === "3") return `${e} cubed`;
|
|
720
|
+
if (n in U) return `${e} ${U[n]}`;
|
|
721
|
+
}
|
|
722
|
+
let r = t ? X(t) : "";
|
|
723
|
+
return q(t) ? `${e} to the power of ${r}` : `${e} to the power of ${r} end power`;
|
|
724
|
+
}
|
|
725
|
+
function et(e, t) {
|
|
726
|
+
let n = t ? X(t) : "";
|
|
727
|
+
return q(t) ? `${e} sub ${n}` : `${e} sub ${n} end sub`;
|
|
728
|
+
}
|
|
729
|
+
function tt(e, t, n) {
|
|
730
|
+
let r = W(e);
|
|
731
|
+
if (r === "lim") return `limit as ${t ? X(t) : ""} of`;
|
|
732
|
+
if (!We.has(r)) return;
|
|
733
|
+
let i = t ? `from ${X(t)}` : "", a = n ? `to ${X(n)}` : "";
|
|
734
|
+
return `${J(r)} ${i} ${a} of`;
|
|
544
735
|
}
|
|
545
|
-
|
|
546
|
-
|
|
736
|
+
function nt(e) {
|
|
737
|
+
let t = K(e).filter((e) => ["mtr", "mlabeledtr"].includes(e.localName)), n = t.map((e) => K(e).filter((e) => e.localName === "mtd")), r = Math.max(0, ...n.map((e) => e.length)), i = n.map((e, t) => `row ${t + 1}: ${e.map((e) => G(Y(K(e)))).join(", ")}`);
|
|
738
|
+
return `table with ${t.length} ${t.length === 1 ? "row" : "rows"} and ${r} ${r === 1 ? "column" : "columns"}. ${i.join(". ")}`;
|
|
739
|
+
}
|
|
740
|
+
function rt(e) {
|
|
741
|
+
let t = e.getAttribute("open") ?? "(", n = e.getAttribute("close") ?? ")", r = (e.getAttribute("separators") ?? ",").replace(/\s+/g, "").split(""), i = K(e).map((e, t, n) => t < n.length - 1 ? `${X(e)} ${J(r[Math.min(t, r.length - 1)] ?? ",")}` : X(e));
|
|
742
|
+
return [
|
|
743
|
+
J(t),
|
|
744
|
+
...i,
|
|
745
|
+
J(n)
|
|
746
|
+
].filter(Boolean).join(" ");
|
|
747
|
+
}
|
|
748
|
+
function X(e) {
|
|
749
|
+
let t = K(e);
|
|
750
|
+
switch (e.localName) {
|
|
751
|
+
case "mi": return Ye(W(e));
|
|
752
|
+
case "mn":
|
|
753
|
+
case "mtext":
|
|
754
|
+
case "ms": return W(e);
|
|
755
|
+
case "mo": return J(W(e));
|
|
756
|
+
case "mspace":
|
|
757
|
+
case "mphantom":
|
|
758
|
+
case "annotation":
|
|
759
|
+
case "annotation-xml": return "";
|
|
760
|
+
case "semantics": return t[0] ? X(t[0]) : "";
|
|
761
|
+
case "mfrac": return Ze(t[0], t[1]);
|
|
762
|
+
case "msqrt": return Qe(G(Y(t)), "square root", t.length === 1 && q(t[0]));
|
|
763
|
+
case "mroot": {
|
|
764
|
+
let e = qe(t[1]), n = e === 2 ? "square root" : e === 3 ? "cube root" : e ? `${Je(e)} root` : `root with index ${t[1] ? X(t[1]) : ""}`;
|
|
765
|
+
return Qe(t[0] ? X(t[0]) : "", n, q(t[0]));
|
|
766
|
+
}
|
|
767
|
+
case "msup": return $e(t[0] ? X(t[0]) : "", t[1]);
|
|
768
|
+
case "msub": return et(t[0] ? X(t[0]) : "", t[1]);
|
|
769
|
+
case "msubsup": return (t[0] ? tt(t[0], t[1], t[2]) : void 0) || $e(et(t[0] ? X(t[0]) : "", t[1]), t[2]);
|
|
770
|
+
case "munder":
|
|
771
|
+
case "mover":
|
|
772
|
+
case "munderover": {
|
|
773
|
+
let [n, r, i] = t, a = e.localName === "mover" ? void 0 : r, o = e.localName === "munder" ? void 0 : e.localName === "mover" ? r : i, s = n ? tt(n, a, o) : void 0;
|
|
774
|
+
if (s) return s;
|
|
775
|
+
let c = n ? X(n) : "", l = e.localName === "mover" && r ? Ke[W(r)] : void 0;
|
|
776
|
+
return l ? l === "vector" ? `vector ${c}` : `${c} ${l}` : [
|
|
777
|
+
c,
|
|
778
|
+
a ? `with ${X(a)} below` : "",
|
|
779
|
+
o ? `with ${X(o)} above` : ""
|
|
780
|
+
].filter(Boolean).join(" ");
|
|
781
|
+
}
|
|
782
|
+
case "mfenced": return rt(e);
|
|
783
|
+
case "mtable": return nt(e);
|
|
784
|
+
case "mrow":
|
|
785
|
+
case "math": return Xe(t);
|
|
786
|
+
default: return t.length ? Y(t) : W(e);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
function it(e) {
|
|
790
|
+
return G(X(e));
|
|
791
|
+
}
|
|
792
|
+
var at = [
|
|
793
|
+
"a[href]",
|
|
794
|
+
"button",
|
|
795
|
+
"label",
|
|
796
|
+
"summary",
|
|
797
|
+
...[
|
|
798
|
+
"button",
|
|
799
|
+
"checkbox",
|
|
800
|
+
"combobox",
|
|
801
|
+
"link",
|
|
802
|
+
"menuitem",
|
|
803
|
+
"menuitemcheckbox",
|
|
804
|
+
"menuitemradio",
|
|
805
|
+
"option",
|
|
806
|
+
"radio",
|
|
807
|
+
"switch",
|
|
808
|
+
"tab",
|
|
809
|
+
"treeitem"
|
|
810
|
+
].map((e) => `[role="${e}"]`)
|
|
811
|
+
].join(", ");
|
|
812
|
+
function ot(e) {
|
|
813
|
+
if (e.hasAttribute("aria-label") || !e.closest(at)) return;
|
|
814
|
+
let t = e.querySelector("math"), n = t ? it(t) : "";
|
|
815
|
+
n && e.setAttribute("aria-label", n);
|
|
816
|
+
}
|
|
817
|
+
function st(e) {
|
|
818
|
+
for (let t of e.querySelectorAll("mjx-container")) ot(t);
|
|
819
|
+
}
|
|
820
|
+
var ct = Symbol.for("@pie-element/shared-math-rendering-mathjax/speech-worker-failed");
|
|
821
|
+
function lt() {
|
|
547
822
|
let e = globalThis;
|
|
548
|
-
e[
|
|
823
|
+
e[ct] || (e[ct] = !0, console.warn(`[math-rendering] MathJax's speech worker did not start, so speech, braille and the explorer are off. A content security policy must allow blob: workers, and scripts and fetches from the asset root. See ${t}`));
|
|
549
824
|
}
|
|
550
|
-
function
|
|
825
|
+
function ut(e) {
|
|
551
826
|
let t = e.webworker;
|
|
552
827
|
if (!t || t.ready) return;
|
|
553
828
|
e.options ??= {};
|
|
554
829
|
let n = e.options;
|
|
555
|
-
n.enableSpeech = !1, n.enableBraille = !1, n.speechError = () => {}, t.Post = () => Promise.reject(/* @__PURE__ */ Error("The speech worker did not start")), t.Terminate(),
|
|
830
|
+
n.enableSpeech = !1, n.enableBraille = !1, n.speechError = () => {}, t.Post = () => Promise.reject(/* @__PURE__ */ Error("The speech worker did not start")), t.Terminate(), lt();
|
|
556
831
|
}
|
|
557
|
-
function
|
|
832
|
+
function dt(e) {
|
|
558
833
|
let t = e?.adaptor, n = t?.createWorker;
|
|
559
834
|
!e || !t || !n || (t.createWorker = async (r, i) => {
|
|
560
835
|
let a = await n.call(t, r, i);
|
|
561
|
-
return a.addEventListener("error", () =>
|
|
836
|
+
return a.addEventListener("error", () => ut(e), { once: !0 }), a;
|
|
562
837
|
});
|
|
563
838
|
}
|
|
564
839
|
`${i}`;
|
|
565
|
-
var
|
|
840
|
+
var ft = {
|
|
566
841
|
parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
|
|
567
842
|
overarc: "\\overparen",
|
|
568
843
|
napprox: "\\not\\approx",
|
|
569
844
|
longdiv: "\\enclose{longdiv}",
|
|
570
845
|
abs: ["\\left|#1\\right|", 1]
|
|
571
|
-
},
|
|
846
|
+
}, pt = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)", mt = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/, ht = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/, gt = /\\embed\{newLine\}\[\]/g, _t = [
|
|
572
847
|
["$$", "$$"],
|
|
573
848
|
["$", "$"],
|
|
574
849
|
["\\[", "\\]"],
|
|
575
850
|
["\\(", "\\)"]
|
|
576
|
-
],
|
|
851
|
+
], vt = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading"), yt = "MJX-CHTML-styles", bt = "PIE-MJX-SVG-styles", Z = "PIE-MathJax-Menu-Settings", xt = { "mjx-container[overflow=\"linebreak\"][display]": {
|
|
577
852
|
overflow: "auto clip",
|
|
578
853
|
"min-width": "initial !important"
|
|
579
|
-
} },
|
|
854
|
+
} }, St = 200, Ct = 201, wt = 202;
|
|
580
855
|
function Q(e) {
|
|
581
856
|
let t = [...e.matches("mjx-container") ? [e] : [], ...e.querySelectorAll("mjx-container")];
|
|
582
857
|
for (let e of t) for (let t of [e, ...e.querySelectorAll("[data-latex],[data-latex-item]")]) t.removeAttribute("data-latex"), t.removeAttribute("data-latex-item");
|
|
583
858
|
}
|
|
584
|
-
function
|
|
585
|
-
for (let [t, n] of
|
|
859
|
+
function Tt(e) {
|
|
860
|
+
for (let [t, n] of _t) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
|
|
586
861
|
return e;
|
|
587
862
|
}
|
|
588
|
-
function
|
|
589
|
-
return
|
|
863
|
+
function Et(e) {
|
|
864
|
+
return Tt(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e);
|
|
590
865
|
}
|
|
591
|
-
var
|
|
592
|
-
function
|
|
593
|
-
let n = e.closest(`.${
|
|
594
|
-
return n !== null && t.contains(n) && !n.classList.contains(
|
|
866
|
+
var Dt = "mathjax_ignore", Ot = "mathjax_process";
|
|
867
|
+
function kt(e, t) {
|
|
868
|
+
let n = e.closest(`.${Dt}, .${Ot}`);
|
|
869
|
+
return n !== null && t.contains(n) && !n.classList.contains(Ot);
|
|
595
870
|
}
|
|
596
|
-
function
|
|
871
|
+
function At(e) {
|
|
597
872
|
for (let t of e.querySelectorAll("[data-latex]")) {
|
|
598
|
-
if (t.dataset.mathHandled || t.closest("mjx-container") ||
|
|
873
|
+
if (t.dataset.mathHandled || t.closest("mjx-container") || kt(t, e)) continue;
|
|
599
874
|
let n = t.textContent;
|
|
600
|
-
n && (t.textContent = `\\(${
|
|
875
|
+
n && (t.textContent = `\\(${Et(n)}\\)`.replace(gt, "\\newline "), t.dataset.mathHandled = "true");
|
|
601
876
|
}
|
|
602
877
|
}
|
|
603
|
-
function
|
|
878
|
+
function jt(e) {
|
|
604
879
|
for (let t of e.querySelectorAll("math")) t.closest("mjx-container") || t.setAttribute("displaystyle", "true");
|
|
605
880
|
}
|
|
606
|
-
function
|
|
881
|
+
function Mt(e, t) {
|
|
607
882
|
for (let t of e.querySelectorAll("math")) if (!t.closest("mjx-assistive-mml")) return !0;
|
|
608
|
-
return (t ?
|
|
883
|
+
return (t ? ht : mt).test(e.textContent ?? "");
|
|
609
884
|
}
|
|
610
|
-
function
|
|
885
|
+
function Nt(e) {
|
|
611
886
|
return new Promise((t, n) => {
|
|
612
887
|
let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: a = !0, srcUrl: o } = e, s = d(e, import.meta.url), c = {
|
|
613
888
|
loader: {
|
|
614
889
|
load: i ? ["a11y/assistive-mml"] : [],
|
|
615
890
|
failed: (e) => n(e),
|
|
616
891
|
"output/svg": { ready: (e) => {
|
|
617
|
-
let t =
|
|
618
|
-
return
|
|
892
|
+
let t = b();
|
|
893
|
+
return $(t) && Pt(t), e;
|
|
619
894
|
} }
|
|
620
895
|
},
|
|
621
896
|
startup: {
|
|
622
897
|
typeset: !1,
|
|
623
898
|
ready: () => {
|
|
624
|
-
let e =
|
|
625
|
-
i && (
|
|
899
|
+
let e = b(), r = e?.startup, i = $(e);
|
|
900
|
+
i && (Pt(e), Ft(e, s.speechLocales), f(e?._?.a11y?.sre_ts?.locales, s.speechLocales)), r?.defaultReady?.(), i && (It(r?.document), Lt(r?.document), r?.document?.addStyles?.(xt), dt(r?.document)), Promise.resolve(r?.promise).then(() => t(), n);
|
|
626
901
|
}
|
|
627
902
|
},
|
|
628
|
-
tex: { macros: { ...
|
|
903
|
+
tex: { macros: { ...ft } },
|
|
629
904
|
output: { displayOverflow: "linebreak" },
|
|
630
905
|
options: {
|
|
631
906
|
enableMenu: i,
|
|
@@ -637,9 +912,9 @@ function et(e) {
|
|
|
637
912
|
a11y: { inTabOrder: !1 }
|
|
638
913
|
}
|
|
639
914
|
};
|
|
640
|
-
r && c.tex && (console.warn(
|
|
915
|
+
r && c.tex && (console.warn(pt), c.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], c.tex.processEscapes = !0), a || (c.chtml = { fontURL: "" });
|
|
641
916
|
let l = p(s.speechLocales);
|
|
642
|
-
l && c.options && (c.options.sre = { locale: l }),
|
|
917
|
+
l && c.options && (c.options.sre = { locale: l }), re(c, {
|
|
643
918
|
...s,
|
|
644
919
|
srcUrl: o
|
|
645
920
|
}).then((e) => {
|
|
@@ -647,16 +922,16 @@ function et(e) {
|
|
|
647
922
|
}, n);
|
|
648
923
|
});
|
|
649
924
|
}
|
|
650
|
-
function
|
|
925
|
+
function $(e) {
|
|
651
926
|
return !!e?.version?.startsWith("4.");
|
|
652
927
|
}
|
|
653
|
-
function
|
|
928
|
+
function Pt(e) {
|
|
654
929
|
let t = e?._?.output, n = t?.chtml_ts?.CHTML;
|
|
655
|
-
n && (n.STYLESHEETID =
|
|
930
|
+
n && (n.STYLESHEETID = x);
|
|
656
931
|
let r = t?.svg_ts?.SVG;
|
|
657
|
-
r && (r.STYLESHEETID =
|
|
932
|
+
r && (r.STYLESHEETID = bt);
|
|
658
933
|
}
|
|
659
|
-
function
|
|
934
|
+
function Ft(e, t) {
|
|
660
935
|
let n = e?._?.ui?.menu?.Menu?.Menu;
|
|
661
936
|
if (n) {
|
|
662
937
|
n.MENU_STORAGE = Z;
|
|
@@ -669,13 +944,13 @@ function nt(e, t) {
|
|
|
669
944
|
} catch {}
|
|
670
945
|
}
|
|
671
946
|
}
|
|
672
|
-
function
|
|
947
|
+
function It(e) {
|
|
673
948
|
if (!e) return;
|
|
674
949
|
let t = /* @__PURE__ */ new WeakSet(), n = (e) => {
|
|
675
950
|
let n = e.typesetRoot;
|
|
676
951
|
!n || t.has(n) || (Q(n), t.add(n));
|
|
677
952
|
};
|
|
678
|
-
e.addRenderAction?.("pie-strip-latex",
|
|
953
|
+
e.addRenderAction?.("pie-strip-latex", Ct, (e) => {
|
|
679
954
|
for (let t of e.math ?? []) n(t);
|
|
680
955
|
return !1;
|
|
681
956
|
}, (e) => {
|
|
@@ -683,114 +958,97 @@ function rt(e) {
|
|
|
683
958
|
return t && Q(t), !1;
|
|
684
959
|
});
|
|
685
960
|
let r = e.outputJax?.chtmlStyles;
|
|
686
|
-
r?.id ===
|
|
961
|
+
r?.id === yt && (r.id = x), Bt();
|
|
687
962
|
}
|
|
688
|
-
function
|
|
689
|
-
|
|
963
|
+
function Lt(e) {
|
|
964
|
+
let t = (e) => {
|
|
965
|
+
e.typesetRoot && ot(e.typesetRoot);
|
|
966
|
+
};
|
|
967
|
+
e?.addRenderAction?.("pie-name-math", wt, (e) => {
|
|
968
|
+
for (let n of e.math ?? []) t(n);
|
|
969
|
+
return !1;
|
|
970
|
+
}, (e) => (t(e), !1));
|
|
690
971
|
}
|
|
691
|
-
function
|
|
692
|
-
|
|
972
|
+
function Rt(e) {
|
|
973
|
+
return e instanceof HTMLStyleElement && ae.includes(e.id);
|
|
693
974
|
}
|
|
694
|
-
function
|
|
695
|
-
|
|
975
|
+
function zt(e) {
|
|
976
|
+
ee("foreign-output-stylesheet", `another MathJax added <style id="${e.id}"> to <head>`);
|
|
977
|
+
}
|
|
978
|
+
function Bt() {
|
|
979
|
+
let e = document.head, t = [...e.children].find(Rt);
|
|
696
980
|
if (t) {
|
|
697
|
-
|
|
981
|
+
zt(t);
|
|
698
982
|
return;
|
|
699
983
|
}
|
|
700
984
|
let n = new MutationObserver((e) => {
|
|
701
985
|
for (let t of e) {
|
|
702
|
-
let e = [...t.addedNodes].find(
|
|
986
|
+
let e = [...t.addedNodes].find(Rt);
|
|
703
987
|
if (e) {
|
|
704
|
-
|
|
988
|
+
zt(e), n.disconnect();
|
|
705
989
|
return;
|
|
706
990
|
}
|
|
707
991
|
}
|
|
708
992
|
});
|
|
709
993
|
n.observe(e, { childList: !0 });
|
|
710
994
|
}
|
|
711
|
-
function
|
|
995
|
+
function Vt(e) {
|
|
712
996
|
let t = e?.math;
|
|
713
997
|
if (!t?.remove) return;
|
|
714
|
-
let n = [...t].filter((e) => (e.state?.() ?? 0) >=
|
|
998
|
+
let n = [...t].filter((e) => (e.state?.() ?? 0) >= St && e.typesetRoot?.isConnected === !1);
|
|
715
999
|
if (n.length !== 0) {
|
|
716
1000
|
for (let e of [...n].reverse()) e.clear?.();
|
|
717
1001
|
t.remove(...n);
|
|
718
1002
|
}
|
|
719
1003
|
}
|
|
720
|
-
function
|
|
1004
|
+
function Ht(e) {
|
|
721
1005
|
return new Promise((t, n) => {
|
|
722
1006
|
let r = e.startup ?? {};
|
|
723
1007
|
e.startup = r;
|
|
724
1008
|
let i = r.ready;
|
|
725
1009
|
r.ready = () => {
|
|
726
|
-
let e =
|
|
1010
|
+
let e = b()?.startup;
|
|
727
1011
|
i ? i.call(r) : e?.defaultReady?.(), Promise.resolve(e?.promise).then(() => t(), n);
|
|
728
1012
|
};
|
|
729
1013
|
});
|
|
730
1014
|
}
|
|
731
|
-
function
|
|
732
|
-
let t =
|
|
733
|
-
return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() :
|
|
1015
|
+
function Ut(e) {
|
|
1016
|
+
let t = b();
|
|
1017
|
+
return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : Ht(t) : Nt(e);
|
|
734
1018
|
}
|
|
735
|
-
function
|
|
736
|
-
return
|
|
737
|
-
let e =
|
|
1019
|
+
function Wt(e) {
|
|
1020
|
+
return Ut(e).then(() => {
|
|
1021
|
+
let e = b();
|
|
738
1022
|
e && typeof e.typesetPromise != "function" && console.warn("[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.");
|
|
739
1023
|
});
|
|
740
1024
|
}
|
|
741
|
-
function
|
|
742
|
-
let t =
|
|
743
|
-
return n || (n =
|
|
1025
|
+
function Gt(e) {
|
|
1026
|
+
let t = ie, n = t[vt];
|
|
1027
|
+
return n || (n = Wt(e), t[vt] = n), n;
|
|
744
1028
|
}
|
|
745
|
-
function
|
|
1029
|
+
function Kt(e = {}) {
|
|
746
1030
|
let t = e.useSingleDollar ?? !1;
|
|
747
1031
|
return async (n) => {
|
|
748
1032
|
if (typeof window > "u") return;
|
|
749
|
-
let r =
|
|
750
|
-
r &&
|
|
751
|
-
let i =
|
|
752
|
-
if (
|
|
1033
|
+
let r = oe();
|
|
1034
|
+
r && ee("mathjax-3-global", `window.MathJax is MathJax ${r}`), At(n), ue(n), jt(n), Me(n);
|
|
1035
|
+
let i = Gt(e);
|
|
1036
|
+
if (!Mt(n, t)) {
|
|
753
1037
|
i.catch(() => {});
|
|
754
1038
|
return;
|
|
755
1039
|
}
|
|
756
1040
|
await i;
|
|
757
|
-
let a =
|
|
1041
|
+
let a = b();
|
|
758
1042
|
if (await a?.startup?.promise, typeof a?.typesetPromise == "function") {
|
|
759
|
-
|
|
1043
|
+
Le(), Vt(a.startup?.document);
|
|
760
1044
|
try {
|
|
761
1045
|
await a.typesetPromise([n]);
|
|
762
1046
|
} catch (e) {
|
|
763
1047
|
throw a.typesetClear?.([n]), e;
|
|
764
1048
|
}
|
|
765
|
-
Q(n);
|
|
1049
|
+
Q(n), st(n);
|
|
766
1050
|
}
|
|
767
1051
|
};
|
|
768
1052
|
}
|
|
769
|
-
var pt = {
|
|
770
|
-
"(": "open parenthesis",
|
|
771
|
-
"[": "open bracket",
|
|
772
|
-
"{": "open brace",
|
|
773
|
-
"⟨": "open angle bracket",
|
|
774
|
-
"⌊": "open floor",
|
|
775
|
-
"⌈": "open ceiling"
|
|
776
|
-
}, mt = {
|
|
777
|
-
")": "close parenthesis",
|
|
778
|
-
"]": "close bracket",
|
|
779
|
-
"}": "close brace",
|
|
780
|
-
"⟩": "close angle bracket",
|
|
781
|
-
"⌋": "close floor",
|
|
782
|
-
"⌉": "close ceiling"
|
|
783
|
-
}, ht = {
|
|
784
|
-
"!": "factorial",
|
|
785
|
-
"%": "percent",
|
|
786
|
-
"°": "degrees",
|
|
787
|
-
"′": "prime",
|
|
788
|
-
"″": "double prime"
|
|
789
|
-
};
|
|
790
|
-
({
|
|
791
|
-
...pt,
|
|
792
|
-
...mt,
|
|
793
|
-
...ht
|
|
794
|
-
});
|
|
795
1053
|
//#endregion
|
|
796
|
-
export {
|
|
1054
|
+
export { Kt as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./math-mathjax-
|
|
1
|
+
import { t as e } from "./math-mathjax-BYcKE-jQ.js";
|
|
2
2
|
//#region ../../node_modules/.bun/svelte@5.57.1/node_modules/svelte/src/internal/disclose-version.js
|
|
3
3
|
typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add("5");
|
|
4
4
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/element-player",
|
|
3
|
-
"version": "0.1.5-next.
|
|
3
|
+
"version": "0.1.5-next.20261007201108",
|
|
4
4
|
"description": "Shared PIE element player web component",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"unpkg": "./dist/pie-element-player.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dev": "vite"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@pie-element/shared-math-rendering-mathjax": "0.1.4-next.
|
|
29
|
+
"@pie-element/shared-math-rendering-mathjax": "0.1.4-next.20261007201108"
|
|
30
30
|
},
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"publishConfig": {
|