@pretextbook/pretext-html 0.15.0 → 0.16.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.
- package/dist/index.browser.d.ts +2 -0
- package/dist/index.browser.js +855 -511
- package/dist/index.d.ts +2 -0
- package/dist/index.js +34 -29
- package/dist/live-patch.d.ts +100 -0
- package/dist/live-patch.js +346 -0
- package/package.json +9 -1
package/dist/index.browser.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { fromXml as
|
|
2
|
-
import { toXml as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
1
|
+
import { fromXml as X } from "xast-util-from-xml";
|
|
2
|
+
import { toXml as q } from "xast-util-to-xml";
|
|
3
|
+
const he = "/";
|
|
4
|
+
function Me(e) {
|
|
5
5
|
if (!e)
|
|
6
6
|
return ".";
|
|
7
7
|
const n = e.startsWith("/"), t = e.length > 1 && e.endsWith("/"), r = [];
|
|
8
8
|
for (const o of e.split("/"))
|
|
9
9
|
if (!(!o || o === ".")) {
|
|
10
10
|
if (o === "..") {
|
|
11
|
-
const
|
|
12
|
-
r.length > 0 &&
|
|
11
|
+
const l = r[r.length - 1];
|
|
12
|
+
r.length > 0 && l !== ".." ? r.pop() : n || r.push("..");
|
|
13
13
|
continue;
|
|
14
14
|
}
|
|
15
15
|
r.push(o);
|
|
@@ -17,7 +17,7 @@ function pe(e) {
|
|
|
17
17
|
let i = r.join("/");
|
|
18
18
|
return n && (i = `/${i}`), i ? (t && !i.endsWith("/") && (i += "/"), i) : n ? "/" : ".";
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function I(...e) {
|
|
21
21
|
let n = "";
|
|
22
22
|
for (let r = e.length - 1; r >= 0; r--) {
|
|
23
23
|
const i = e[r];
|
|
@@ -25,42 +25,42 @@ function h(...e) {
|
|
|
25
25
|
break;
|
|
26
26
|
}
|
|
27
27
|
n.startsWith("/") || (n = `/${n}`);
|
|
28
|
-
const t =
|
|
28
|
+
const t = Me(n);
|
|
29
29
|
return t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function at(...e) {
|
|
32
32
|
const n = e.filter(Boolean).join("/");
|
|
33
|
-
return n ?
|
|
33
|
+
return n ? Me(n) : ".";
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function H(e) {
|
|
36
36
|
const n = e.replace(/\/+$/, "");
|
|
37
37
|
if (!n)
|
|
38
38
|
return e.startsWith("/") ? "/" : ".";
|
|
39
39
|
const t = n.lastIndexOf("/");
|
|
40
40
|
return t < 0 ? "." : t === 0 ? "/" : n.slice(0, t);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
const t =
|
|
42
|
+
function ue(e, n) {
|
|
43
|
+
const t = I(e).split("/").filter(Boolean), r = I(n).split("/").filter(Boolean);
|
|
44
44
|
let i = 0;
|
|
45
45
|
for (; i < t.length && i < r.length && t[i] === r[i]; )
|
|
46
46
|
i += 1;
|
|
47
47
|
return [...new Array(t.length - i).fill(".."), ...r.slice(i)].join("/");
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
function
|
|
49
|
+
const ct = "ptxPreviewBannerDismissed", lt = "About live preview";
|
|
50
|
+
function Te(e) {
|
|
51
51
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function ut(e) {
|
|
54
54
|
return [
|
|
55
55
|
'<div id="ptx-preview-banner" class="ptx-preview-banner" role="note">',
|
|
56
|
-
` <span class="ptx-preview-banner-text">${
|
|
56
|
+
` <span class="ptx-preview-banner-text">${Te(e)}</span>`,
|
|
57
57
|
' <button type="button" class="ptx-preview-banner-dismiss" aria-label="Dismiss">×</button>',
|
|
58
58
|
"</div>",
|
|
59
|
-
`<button type="button" id="ptx-preview-banner-restore" class="ptx-preview-banner-restore" hidden>${
|
|
59
|
+
`<button type="button" id="ptx-preview-banner-restore" class="ptx-preview-banner-restore" hidden>${Te(lt)}</button>`
|
|
60
60
|
].join(`
|
|
61
61
|
`);
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function dt() {
|
|
64
64
|
return [
|
|
65
65
|
"<style>",
|
|
66
66
|
".ptx-preview-banner {",
|
|
@@ -129,11 +129,11 @@ function He() {
|
|
|
129
129
|
].join(`
|
|
130
130
|
`);
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function ft() {
|
|
133
133
|
return [
|
|
134
134
|
"<script>",
|
|
135
135
|
"(function () {",
|
|
136
|
-
" var KEY = " + JSON.stringify(
|
|
136
|
+
" var KEY = " + JSON.stringify(ct) + ";",
|
|
137
137
|
' var banner = document.getElementById("ptx-preview-banner");',
|
|
138
138
|
' var restore = document.getElementById("ptx-preview-banner-restore");',
|
|
139
139
|
" if (!banner || !restore) { return; }",
|
|
@@ -170,39 +170,39 @@ function Ve() {
|
|
|
170
170
|
].join(`
|
|
171
171
|
`);
|
|
172
172
|
}
|
|
173
|
-
const
|
|
174
|
-
function
|
|
175
|
-
const t =
|
|
173
|
+
const pt = "<!--ptx-preview-banner-->", ht = "<!--/ptx-preview-banner-->", mt = /\n?<!--ptx-preview-banner-->[\s\S]*?<!--\/ptx-preview-banner-->/;
|
|
174
|
+
function wt(e, n) {
|
|
175
|
+
const t = mt.exec(e), r = t ? e.slice(0, t.index) + e.slice(t.index + t[0].length) : e;
|
|
176
176
|
if (!/<body[^>]*>/i.test(r))
|
|
177
177
|
return r;
|
|
178
178
|
const i = `
|
|
179
|
-
${
|
|
180
|
-
${
|
|
181
|
-
${
|
|
182
|
-
${
|
|
183
|
-
${
|
|
179
|
+
${pt}
|
|
180
|
+
${dt()}
|
|
181
|
+
${ut(n.message)}
|
|
182
|
+
${ft()}
|
|
183
|
+
${ht}`;
|
|
184
184
|
return r.replace(/<body([^>]*)>/i, `<body$1>${i}`);
|
|
185
185
|
}
|
|
186
|
-
const
|
|
187
|
-
let
|
|
188
|
-
function
|
|
189
|
-
|
|
186
|
+
const gt = "https://cdn.jsdelivr.net/npm/@pretextbook/pretext-html@0.16.0/assets";
|
|
187
|
+
let Ce;
|
|
188
|
+
function nr(e) {
|
|
189
|
+
Ce = e.replace(/\/+$/, "");
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
return
|
|
191
|
+
function se() {
|
|
192
|
+
return Ce ?? gt;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function Oe(e, n) {
|
|
195
195
|
return `${e.replace(/\/+$/, "")}/${n.replace(/^\/+/, "")}`;
|
|
196
196
|
}
|
|
197
|
-
const
|
|
198
|
-
function
|
|
197
|
+
const Se = /* @__PURE__ */ new Map();
|
|
198
|
+
function vt(e) {
|
|
199
199
|
return `${e.replace(/\/+$/, "")}-bundle.json`;
|
|
200
200
|
}
|
|
201
|
-
function
|
|
202
|
-
let n =
|
|
201
|
+
function bt(e) {
|
|
202
|
+
let n = Se.get(e);
|
|
203
203
|
return n || (n = (async () => {
|
|
204
204
|
try {
|
|
205
|
-
const t = await fetch(
|
|
205
|
+
const t = await fetch(vt(e));
|
|
206
206
|
if (!t.ok)
|
|
207
207
|
return /* @__PURE__ */ new Map();
|
|
208
208
|
const r = await t.json();
|
|
@@ -210,14 +210,14 @@ function qe(e) {
|
|
|
210
210
|
} catch {
|
|
211
211
|
return /* @__PURE__ */ new Map();
|
|
212
212
|
}
|
|
213
|
-
})(),
|
|
213
|
+
})(), Se.set(e, n)), n;
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
return e ===
|
|
215
|
+
function Et(e) {
|
|
216
|
+
return e === Oe(se(), "xsl");
|
|
217
217
|
}
|
|
218
|
-
async function
|
|
219
|
-
if (
|
|
220
|
-
const o = (await
|
|
218
|
+
async function Be(e, n) {
|
|
219
|
+
if (Et(e)) {
|
|
220
|
+
const o = (await bt(e)).get(n.replace(/^\/+/, ""));
|
|
221
221
|
if (o !== void 0)
|
|
222
222
|
return new TextEncoder().encode(o);
|
|
223
223
|
}
|
|
@@ -241,7 +241,7 @@ async function we(e, n) {
|
|
|
241
241
|
return;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
async function
|
|
244
|
+
async function ce(e) {
|
|
245
245
|
if (/^[a-z][a-z0-9+.-]*:\/\//i.test(e))
|
|
246
246
|
try {
|
|
247
247
|
const n = await fetch(e);
|
|
@@ -250,42 +250,42 @@ async function B(e) {
|
|
|
250
250
|
return;
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
|
-
const
|
|
253
|
+
const je = "2.51.0", yt = "8.2.9", xt = [
|
|
254
254
|
"prefix-runtime.5ef53875c58b216b.bundle.js",
|
|
255
255
|
"prefix-926.5c7038c8ef173faf.bundle.js",
|
|
256
256
|
"prefix-runestone.c5ba0ffa5f963084.bundle.js"
|
|
257
|
-
],
|
|
257
|
+
], Tt = [
|
|
258
258
|
"prefix-926.229729d09512acc9.css",
|
|
259
259
|
"prefix-runestone.efe427683fc41f98.css"
|
|
260
|
-
],
|
|
261
|
-
function
|
|
260
|
+
], St = "born-hidden-knowl", At = /<details\b([^>]*)>(\s*)(?:<summary\b([^>]*)>)?/g;
|
|
261
|
+
function It(e) {
|
|
262
262
|
const n = /\bclass="([^"]*)"/.exec(e);
|
|
263
263
|
return n ? n[1].trim().split(/\s+/) : [];
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function Lt(e) {
|
|
266
266
|
return /(^|\s)open(\s|=|$)/.test(e);
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
return
|
|
268
|
+
function Ae(e) {
|
|
269
|
+
return Lt(e) ? e : ` open${e}`;
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function _t(e) {
|
|
272
272
|
return e.replace(
|
|
273
|
-
|
|
273
|
+
At,
|
|
274
274
|
(n, t, r, i) => {
|
|
275
|
-
if (!
|
|
275
|
+
if (!It(t).includes(St))
|
|
276
276
|
return n;
|
|
277
|
-
const o = `<details${
|
|
278
|
-
return i === void 0 ? `${o}${r}` : `${o}${r}<summary${
|
|
277
|
+
const o = `<details${Ae(t)}>`;
|
|
278
|
+
return i === void 0 ? `${o}${r}` : `${o}${r}<summary${Ae(i)}>`;
|
|
279
279
|
}
|
|
280
280
|
);
|
|
281
281
|
}
|
|
282
|
-
const
|
|
283
|
-
let
|
|
284
|
-
function
|
|
285
|
-
|
|
282
|
+
const be = /* @__PURE__ */ new Map(), Ue = /* @__PURE__ */ new Map();
|
|
283
|
+
let me, $t = 0, Fe = Be;
|
|
284
|
+
function rr(e) {
|
|
285
|
+
Fe = e;
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
const t = typeof e == "string" ? e : e instanceof URL ? e.href : e.url, r =
|
|
287
|
+
function Rt(e, n) {
|
|
288
|
+
const t = typeof e == "string" ? e : e instanceof URL ? e.href : e.url, r = Ue.get(t);
|
|
289
289
|
if (r !== void 0)
|
|
290
290
|
return Promise.resolve(new Response(r, { status: 200 }));
|
|
291
291
|
let i;
|
|
@@ -294,62 +294,62 @@ function at(e, n) {
|
|
|
294
294
|
} catch {
|
|
295
295
|
i = "";
|
|
296
296
|
}
|
|
297
|
-
const o =
|
|
298
|
-
return o !== void 0 ?
|
|
297
|
+
const o = be.get(i);
|
|
298
|
+
return o !== void 0 ? Nt(o, t) : me(e, n);
|
|
299
299
|
}
|
|
300
|
-
const
|
|
301
|
-
async function
|
|
302
|
-
const t = decodeURIComponent(new URL(n).pathname), r = await
|
|
300
|
+
const kt = '<?xml version="1.0"?><pretext-preview-missing-file/>';
|
|
301
|
+
async function Nt(e, n) {
|
|
302
|
+
const t = decodeURIComponent(new URL(n).pathname), r = await Fe(e, t);
|
|
303
303
|
if (r === void 0)
|
|
304
|
-
return new Response(
|
|
304
|
+
return new Response(kt, { status: 200 });
|
|
305
305
|
const i = typeof r == "string" ? r : new Uint8Array(r);
|
|
306
306
|
return new Response(i, { status: 200 });
|
|
307
307
|
}
|
|
308
|
-
function
|
|
309
|
-
|
|
308
|
+
function We() {
|
|
309
|
+
me || (me = globalThis.fetch, globalThis.fetch = Rt);
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
|
|
313
|
-
const n = `mnt${
|
|
314
|
-
return
|
|
311
|
+
function He(e) {
|
|
312
|
+
We();
|
|
313
|
+
const n = `mnt${++$t}.ptx.invalid`;
|
|
314
|
+
return be.set(n, e), `http://${n}`;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
317
|
-
|
|
316
|
+
function Pt(e) {
|
|
317
|
+
be.delete(new URL(e).host);
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
|
|
319
|
+
function Dt(e, n) {
|
|
320
|
+
We(), Ue.set(e, n);
|
|
321
321
|
}
|
|
322
|
-
const
|
|
323
|
-
function
|
|
322
|
+
const Mt = /<a\b[^>]*\bdata-printout="[^"]*"[^>]*>/gi;
|
|
323
|
+
function ie(e, n) {
|
|
324
324
|
const t = new RegExp(`\\b${n}="([^"]*)"`, "i").exec(e);
|
|
325
|
-
return t ?
|
|
325
|
+
return t ? Ct(t[1]) : void 0;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function Ct(e) {
|
|
328
328
|
return e.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'|'/g, "'").replace(/'/gi, "'").replace(/&/g, "&");
|
|
329
329
|
}
|
|
330
|
-
function
|
|
330
|
+
function Ot(e, n, t) {
|
|
331
331
|
const r = [e, n].filter(Boolean).join(" ");
|
|
332
332
|
return r && t ? `${r}: ${t}` : r || t;
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function Ve(e) {
|
|
335
335
|
const n = [], t = /* @__PURE__ */ new Set();
|
|
336
|
-
for (const [r] of e.matchAll(
|
|
337
|
-
const i =
|
|
336
|
+
for (const [r] of e.matchAll(Mt)) {
|
|
337
|
+
const i = ie(r, "data-printout");
|
|
338
338
|
if (!i || t.has(i))
|
|
339
339
|
continue;
|
|
340
340
|
t.add(i);
|
|
341
|
-
const o =
|
|
341
|
+
const o = ie(r, "data-printout-type") ?? "", l = ie(r, "data-printout-number") ?? "", u = ie(r, "data-printout-title") ?? "";
|
|
342
342
|
n.push({
|
|
343
343
|
id: i,
|
|
344
344
|
type: o,
|
|
345
|
-
number:
|
|
346
|
-
title:
|
|
347
|
-
label:
|
|
345
|
+
number: l,
|
|
346
|
+
title: u,
|
|
347
|
+
label: Ot(o, l, u)
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
350
|
return n;
|
|
351
351
|
}
|
|
352
|
-
const
|
|
352
|
+
const Bt = /* @__PURE__ */ new Set([
|
|
353
353
|
"worksheet",
|
|
354
354
|
"handout",
|
|
355
355
|
"project",
|
|
@@ -357,17 +357,17 @@ const wt = /* @__PURE__ */ new Set([
|
|
|
357
357
|
"exploration",
|
|
358
358
|
"investigation"
|
|
359
359
|
]);
|
|
360
|
-
function
|
|
361
|
-
if (!(!n || !
|
|
360
|
+
function jt(e, n) {
|
|
361
|
+
if (!(!n || !Bt.has(n)))
|
|
362
362
|
return e[0]?.id;
|
|
363
363
|
}
|
|
364
|
-
const
|
|
365
|
-
function
|
|
364
|
+
const Ut = "__ptxPrintPreview";
|
|
365
|
+
function Ft(e) {
|
|
366
366
|
const n = JSON.stringify(e ?? null);
|
|
367
367
|
return [
|
|
368
368
|
"<script>",
|
|
369
369
|
"(function () {",
|
|
370
|
-
" var KEY = " + JSON.stringify(
|
|
370
|
+
" var KEY = " + JSON.stringify(Ut) + ";",
|
|
371
371
|
" window[KEY] = " + n + ";",
|
|
372
372
|
// Pin the page to light mode for the print layout; see printPreviewCss.
|
|
373
373
|
// `data-darkmode="disabled"` is upstream's own switch — pretext-core.js
|
|
@@ -402,7 +402,7 @@ function bt(e) {
|
|
|
402
402
|
].join(`
|
|
403
403
|
`);
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function Wt() {
|
|
406
406
|
return [
|
|
407
407
|
"<style>",
|
|
408
408
|
":root {",
|
|
@@ -422,19 +422,19 @@ function xt() {
|
|
|
422
422
|
].join(`
|
|
423
423
|
`);
|
|
424
424
|
}
|
|
425
|
-
const
|
|
426
|
-
function
|
|
427
|
-
const t =
|
|
425
|
+
const Ht = "<!--ptx-print-preview-->", Vt = "<!--/ptx-print-preview-->", Xt = /\n?<!--ptx-print-preview-->[\s\S]*?<!--\/ptx-print-preview-->/;
|
|
426
|
+
function Jt(e, n) {
|
|
427
|
+
const t = Xt.exec(e), r = t ? e.slice(0, t.index) + e.slice(t.index + t[0].length) : e, i = /<head[^>]*>/i.exec(r);
|
|
428
428
|
if (!i)
|
|
429
429
|
return r;
|
|
430
|
-
const o = n &&
|
|
431
|
-
${
|
|
432
|
-
${
|
|
433
|
-
${o ? `${
|
|
434
|
-
` : ""}${
|
|
435
|
-
return r.slice(0,
|
|
436
|
-
}
|
|
437
|
-
const
|
|
430
|
+
const o = n && Ve(r).some((m) => m.id === n) ? n : void 0, l = `
|
|
431
|
+
${Ht}
|
|
432
|
+
${Ft(o)}
|
|
433
|
+
${o ? `${Wt()}
|
|
434
|
+
` : ""}${Vt}`, u = i.index + i[0].length;
|
|
435
|
+
return r.slice(0, u) + l + r.slice(u);
|
|
436
|
+
}
|
|
437
|
+
const we = `<?xml version="1.0" encoding="UTF-8"?>
|
|
438
438
|
<publication>
|
|
439
439
|
<source>
|
|
440
440
|
<directories external="../assets" generated="../generated-assets" />
|
|
@@ -446,82 +446,82 @@ const H = `<?xml version="1.0" encoding="UTF-8"?>
|
|
|
446
446
|
<platform portable="yes"/>
|
|
447
447
|
</html>
|
|
448
448
|
</publication>
|
|
449
|
-
`,
|
|
450
|
-
function
|
|
449
|
+
`, zt = ["theme", "style", "shell"];
|
|
450
|
+
function W(e, n) {
|
|
451
451
|
for (const t of e.children)
|
|
452
452
|
if (t.type === "element" && t.name === n)
|
|
453
453
|
return t;
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
let t =
|
|
455
|
+
function V(e, n) {
|
|
456
|
+
let t = W(e, n);
|
|
457
457
|
return t || (t = { type: "element", name: n, attributes: {}, children: [] }, e.children.push(t)), t;
|
|
458
458
|
}
|
|
459
|
-
function
|
|
460
|
-
const t =
|
|
461
|
-
if (t &&
|
|
459
|
+
function Gt(e, n) {
|
|
460
|
+
const t = W(e, "css");
|
|
461
|
+
if (t && zt.some((i) => t.attributes?.[i]))
|
|
462
462
|
return;
|
|
463
|
-
const r = t ??
|
|
463
|
+
const r = t ?? V(e, "css");
|
|
464
464
|
r.attributes = { ...r.attributes, theme: n };
|
|
465
465
|
}
|
|
466
|
-
function
|
|
467
|
-
const t =
|
|
466
|
+
function Kt(e, n) {
|
|
467
|
+
const t = W(e, "appearance");
|
|
468
468
|
if (t?.attributes?.theme)
|
|
469
469
|
return;
|
|
470
|
-
const r = t ??
|
|
470
|
+
const r = t ?? V(e, "appearance");
|
|
471
471
|
r.attributes = { ...r.attributes, theme: n };
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
const n =
|
|
473
|
+
function Yt(e) {
|
|
474
|
+
const n = V(e, "resources");
|
|
475
475
|
n.attributes = {
|
|
476
476
|
...n.attributes,
|
|
477
477
|
host: "cdn",
|
|
478
478
|
math: "online"
|
|
479
479
|
};
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function qt(e, n = {}) {
|
|
482
482
|
const t = n.cssTheme?.trim(), r = n.revealTheme?.trim(), i = n.target === "slides";
|
|
483
483
|
if (!e && !t && !i)
|
|
484
|
-
return
|
|
485
|
-
const o =
|
|
486
|
-
if (!
|
|
484
|
+
return we;
|
|
485
|
+
const o = X(e ?? we), l = W(o, "publication");
|
|
486
|
+
if (!l)
|
|
487
487
|
throw new Error(
|
|
488
488
|
"Invalid publication file: no root <publication> element found"
|
|
489
489
|
);
|
|
490
|
-
const
|
|
491
|
-
if (
|
|
492
|
-
const
|
|
493
|
-
|
|
490
|
+
const u = V(l, "html"), m = V(u, "platform");
|
|
491
|
+
if (m.attributes = { ...m.attributes, portable: "yes" }, t && Gt(u, t), i) {
|
|
492
|
+
const f = V(l, "revealjs");
|
|
493
|
+
Yt(f), r && Kt(f, r);
|
|
494
494
|
}
|
|
495
|
-
return
|
|
495
|
+
return q(o);
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function Ie(e) {
|
|
498
498
|
if (!(e === void 0 || e === "" || e.startsWith("/")))
|
|
499
499
|
return e.endsWith("/") ? e : `${e}/`;
|
|
500
500
|
}
|
|
501
|
-
function
|
|
502
|
-
const n =
|
|
501
|
+
function Zt(e) {
|
|
502
|
+
const n = X(e ?? we), t = W(n, "publication"), r = t && W(t, "source"), i = r && W(r, "directories"), o = Ie(
|
|
503
503
|
i?.attributes?.external ?? void 0
|
|
504
|
-
),
|
|
504
|
+
), l = Ie(
|
|
505
505
|
i?.attributes?.generated ?? void 0
|
|
506
506
|
);
|
|
507
507
|
return {
|
|
508
508
|
external: o,
|
|
509
|
-
generated:
|
|
510
|
-
managed: o !== void 0 &&
|
|
509
|
+
generated: l,
|
|
510
|
+
managed: o !== void 0 && l !== void 0
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function ir(e) {
|
|
514
514
|
return e === "slides" || e === "scroll";
|
|
515
515
|
}
|
|
516
|
-
const
|
|
517
|
-
function
|
|
518
|
-
const n = typeof e == "number" && isFinite(e) ? e :
|
|
516
|
+
const Xe = 960, Je = 700, Qt = 1, en = 0.04;
|
|
517
|
+
function tn(e) {
|
|
518
|
+
const n = typeof e == "number" && isFinite(e) ? e : Qt, t = Math.min(1, Math.max(0.25, n));
|
|
519
519
|
return {
|
|
520
|
-
width: Math.round(
|
|
521
|
-
height: Math.round(
|
|
520
|
+
width: Math.round(Xe / t),
|
|
521
|
+
height: Math.round(Je / t)
|
|
522
522
|
};
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function nn(e) {
|
|
525
525
|
return {
|
|
526
526
|
view: "scroll",
|
|
527
527
|
scrollLayout: "compact",
|
|
@@ -531,11 +531,11 @@ function At(e) {
|
|
|
531
531
|
controls: !1,
|
|
532
532
|
controlsTutorial: !1,
|
|
533
533
|
hash: !1,
|
|
534
|
-
...
|
|
535
|
-
margin:
|
|
534
|
+
...tn(e.zoom),
|
|
535
|
+
margin: en
|
|
536
536
|
};
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function rn() {
|
|
539
539
|
return {
|
|
540
540
|
// Explicitly null rather than absent: the same page may have been
|
|
541
541
|
// delivered in scroll view a moment ago, and an embedder that re-injects
|
|
@@ -547,11 +547,11 @@ function Bt() {
|
|
|
547
547
|
// size with a percentage width renders its text far larger, relative to
|
|
548
548
|
// the slide, than the same deck will on a projector. No zoom margin
|
|
549
549
|
// though — presenting means filling whatever it is shown in.
|
|
550
|
-
width:
|
|
551
|
-
height:
|
|
550
|
+
width: Xe,
|
|
551
|
+
height: Je
|
|
552
552
|
};
|
|
553
553
|
}
|
|
554
|
-
const
|
|
554
|
+
const on = [
|
|
555
555
|
"<style>",
|
|
556
556
|
".reveal-viewport.reveal-scroll .scroll-page section {",
|
|
557
557
|
" box-shadow: inset 0 0 0 calc(1px / var(--slide-scale, 1))",
|
|
@@ -559,14 +559,14 @@ const Ot = [
|
|
|
559
559
|
"}",
|
|
560
560
|
"</style>"
|
|
561
561
|
].join(`
|
|
562
|
-
`),
|
|
562
|
+
`), sn = [
|
|
563
563
|
" var paused = document.querySelectorAll('.reveal .fragment');",
|
|
564
564
|
" for (var i = 0; i < paused.length; i++) {",
|
|
565
565
|
" paused[i].classList.remove('fragment');",
|
|
566
566
|
" }"
|
|
567
567
|
];
|
|
568
|
-
function
|
|
569
|
-
const t = e === "scroll" ?
|
|
568
|
+
function an(e, n = {}) {
|
|
569
|
+
const t = e === "scroll" ? nn(n) : rn();
|
|
570
570
|
return [
|
|
571
571
|
"<script>",
|
|
572
572
|
"(function () {",
|
|
@@ -594,7 +594,7 @@ function Ct(e, n = {}) {
|
|
|
594
594
|
// Inside the wrapper rather than at top level: this script sits in <head>,
|
|
595
595
|
// where the slides have not been parsed yet, but the deck calls initialize
|
|
596
596
|
// from the end of the document, by which time they have.
|
|
597
|
-
...e === "scroll" ?
|
|
597
|
+
...e === "scroll" ? sn : [],
|
|
598
598
|
" return initialize(merged);",
|
|
599
599
|
" };",
|
|
600
600
|
"})();",
|
|
@@ -602,71 +602,71 @@ function Ct(e, n = {}) {
|
|
|
602
602
|
].join(`
|
|
603
603
|
`);
|
|
604
604
|
}
|
|
605
|
-
const
|
|
606
|
-
function
|
|
607
|
-
const r =
|
|
605
|
+
const cn = /<script\b[^>]*\bsrc=["'][^"']*\breveal\.js["'][^>]*>\s*<\/script>/i, ln = "<!--ptx-reveal-view-->", un = "<!--/ptx-reveal-view-->", dn = /\n?<!--ptx-reveal-view-->[\s\S]*?<!--\/ptx-reveal-view-->/;
|
|
606
|
+
function fn(e, n, t = {}) {
|
|
607
|
+
const r = dn.exec(e), i = r ? e.slice(0, r.index) + e.slice(r.index + r[0].length) : e, o = cn.exec(i);
|
|
608
608
|
if (!o)
|
|
609
609
|
return i;
|
|
610
|
-
const
|
|
611
|
-
${
|
|
612
|
-
${
|
|
613
|
-
${
|
|
614
|
-
${
|
|
615
|
-
return i.slice(0,
|
|
616
|
-
}
|
|
617
|
-
const
|
|
618
|
-
async function
|
|
619
|
-
return e.includes("include") ? (await
|
|
620
|
-
}
|
|
621
|
-
async function
|
|
622
|
-
const r =
|
|
623
|
-
projectDir:
|
|
624
|
-
stack: [
|
|
625
|
-
}, o = await
|
|
610
|
+
const l = o.index + o[0].length, u = `
|
|
611
|
+
${ln}
|
|
612
|
+
${on}
|
|
613
|
+
${an(n, t)}
|
|
614
|
+
${un}`;
|
|
615
|
+
return i.slice(0, l) + u + i.slice(l);
|
|
616
|
+
}
|
|
617
|
+
const ze = "http://www.w3.org/2001/XInclude", Le = 64;
|
|
618
|
+
async function pn(e, n, t) {
|
|
619
|
+
return e.includes("include") ? (await Ee(e, n, t)).content : e;
|
|
620
|
+
}
|
|
621
|
+
async function Ee(e, n, t) {
|
|
622
|
+
const r = X(e), i = {
|
|
623
|
+
projectDir: I(t),
|
|
624
|
+
stack: [I(n)]
|
|
625
|
+
}, o = await Z(
|
|
626
626
|
r,
|
|
627
|
-
|
|
627
|
+
H(I(n)),
|
|
628
628
|
{ "": "" },
|
|
629
629
|
i
|
|
630
630
|
);
|
|
631
|
-
return { tree: r, content: o ?
|
|
631
|
+
return { tree: r, content: o ? q(r) : e };
|
|
632
632
|
}
|
|
633
|
-
function
|
|
633
|
+
function hn(e) {
|
|
634
634
|
return e.data?.ptxIncludedFile;
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function mn(e, n) {
|
|
637
637
|
const t = e.data ?? (e.data = {});
|
|
638
638
|
t.ptxIncludedFile = n;
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function ae(e, n) {
|
|
641
641
|
let t = e;
|
|
642
642
|
for (const [r, i] of Object.entries(n.attributes))
|
|
643
643
|
(r === "xmlns" || r.startsWith("xmlns:")) && (t === e && (t = { ...e }), t[r === "xmlns" ? "" : r.slice(6)] = i ?? "");
|
|
644
644
|
return t;
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function Ge(e, n) {
|
|
647
647
|
const t = e.name.indexOf(":"), r = t === -1 ? "" : e.name.slice(0, t);
|
|
648
|
-
return (t === -1 ? e.name : e.name.slice(t + 1)) === "include" && n[r] ===
|
|
648
|
+
return (t === -1 ? e.name : e.name.slice(t + 1)) === "include" && n[r] === ze;
|
|
649
649
|
}
|
|
650
|
-
async function
|
|
650
|
+
async function Z(e, n, t, r) {
|
|
651
651
|
let i = !1;
|
|
652
652
|
for (let o = 0; o < e.children.length; o++) {
|
|
653
|
-
const
|
|
654
|
-
if (
|
|
653
|
+
const l = e.children[o];
|
|
654
|
+
if (l.type !== "element")
|
|
655
655
|
continue;
|
|
656
|
-
const
|
|
657
|
-
if (
|
|
658
|
-
const
|
|
659
|
-
|
|
656
|
+
const u = ae(t, l);
|
|
657
|
+
if (Ge(l, u)) {
|
|
658
|
+
const m = await Ke(
|
|
659
|
+
l,
|
|
660
660
|
n,
|
|
661
|
-
|
|
661
|
+
u,
|
|
662
662
|
r
|
|
663
663
|
);
|
|
664
|
-
e.children.splice(o, 1, ...
|
|
665
|
-
} else await
|
|
664
|
+
e.children.splice(o, 1, ...m), o += m.length - 1, i = !0;
|
|
665
|
+
} else await Z(l, n, u, r) && (i = !0);
|
|
666
666
|
}
|
|
667
667
|
return i;
|
|
668
668
|
}
|
|
669
|
-
async function
|
|
669
|
+
async function Ke(e, n, t, r) {
|
|
670
670
|
const i = r.stack[r.stack.length - 1];
|
|
671
671
|
if (e.attributes.xpointer)
|
|
672
672
|
throw new Error(
|
|
@@ -675,83 +675,83 @@ async function ke(e, n, t, r) {
|
|
|
675
675
|
const o = e.attributes.href;
|
|
676
676
|
if (!o)
|
|
677
677
|
throw new Error(`xi:include without href (in ${i})`);
|
|
678
|
-
let
|
|
678
|
+
let l = o;
|
|
679
679
|
try {
|
|
680
|
-
|
|
680
|
+
l = decodeURIComponent(o);
|
|
681
681
|
} catch {
|
|
682
682
|
}
|
|
683
|
-
const
|
|
684
|
-
if (
|
|
683
|
+
const u = I(n, l);
|
|
684
|
+
if (u !== r.projectDir && !u.startsWith(r.projectDir + he))
|
|
685
685
|
throw new Error(
|
|
686
686
|
`xi:include escapes the project directory: ${o} (in ${i})`
|
|
687
687
|
);
|
|
688
|
-
if (r.stack.includes(
|
|
688
|
+
if (r.stack.includes(u))
|
|
689
689
|
throw new Error(
|
|
690
|
-
`Circular xi:include: ${[...r.stack,
|
|
690
|
+
`Circular xi:include: ${[...r.stack, u].join(" -> ")}`
|
|
691
691
|
);
|
|
692
|
-
if (r.stack.length >=
|
|
693
|
-
throw new Error(`xi:include nesting exceeds ${
|
|
694
|
-
const
|
|
695
|
-
if (
|
|
696
|
-
const
|
|
697
|
-
if (
|
|
698
|
-
return await
|
|
692
|
+
if (r.stack.length >= Le)
|
|
693
|
+
throw new Error(`xi:include nesting exceeds ${Le} levels`);
|
|
694
|
+
const m = await ce(u);
|
|
695
|
+
if (m === void 0) {
|
|
696
|
+
const w = gn(e, t);
|
|
697
|
+
if (w)
|
|
698
|
+
return await Z(w, n, t, r), w.children;
|
|
699
699
|
throw new Error(`xi:include target not found: ${o} (in ${i})`);
|
|
700
700
|
}
|
|
701
701
|
if (e.attributes.parse === "text")
|
|
702
|
-
return [{ type: "text", value:
|
|
703
|
-
let
|
|
702
|
+
return [{ type: "text", value: m }];
|
|
703
|
+
let f;
|
|
704
704
|
try {
|
|
705
|
-
|
|
706
|
-
} catch (
|
|
705
|
+
f = X(m);
|
|
706
|
+
} catch (w) {
|
|
707
707
|
throw new Error(
|
|
708
|
-
`Could not parse xi:include target ${
|
|
708
|
+
`Could not parse xi:include target ${u} as XML: ${w instanceof Error ? w.message : w}. (Included files must be well-formed, with a single root element.)`
|
|
709
709
|
);
|
|
710
710
|
}
|
|
711
|
-
r.stack.push(
|
|
711
|
+
r.stack.push(u);
|
|
712
712
|
try {
|
|
713
|
-
await
|
|
713
|
+
await Z(f, H(u), { "": "" }, r);
|
|
714
714
|
} finally {
|
|
715
715
|
r.stack.pop();
|
|
716
716
|
}
|
|
717
|
-
const
|
|
718
|
-
(
|
|
717
|
+
const v = f.children.filter(
|
|
718
|
+
(w) => w.type === "element"
|
|
719
719
|
);
|
|
720
|
-
for (const
|
|
721
|
-
|
|
722
|
-
return
|
|
720
|
+
for (const w of v)
|
|
721
|
+
mn(w, u);
|
|
722
|
+
return v;
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function _e(e) {
|
|
725
725
|
return e.name === "docinfo";
|
|
726
726
|
}
|
|
727
|
-
async function
|
|
727
|
+
async function wn(e, n, t) {
|
|
728
728
|
try {
|
|
729
|
-
const i =
|
|
730
|
-
(
|
|
729
|
+
const i = X(e).children.find(
|
|
730
|
+
(f) => f.type === "element"
|
|
731
731
|
);
|
|
732
732
|
if (!i)
|
|
733
733
|
return;
|
|
734
|
-
const o =
|
|
735
|
-
projectDir:
|
|
734
|
+
const o = I(n), l = H(o), u = {
|
|
735
|
+
projectDir: I(t),
|
|
736
736
|
stack: [o]
|
|
737
|
-
},
|
|
738
|
-
for (const
|
|
739
|
-
if (
|
|
737
|
+
}, m = ae({ "": "" }, i);
|
|
738
|
+
for (const f of i.children) {
|
|
739
|
+
if (f.type !== "element")
|
|
740
740
|
continue;
|
|
741
|
-
const
|
|
742
|
-
if (
|
|
743
|
-
return await
|
|
744
|
-
if (
|
|
745
|
-
const
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
741
|
+
const v = ae(m, f);
|
|
742
|
+
if (_e(f))
|
|
743
|
+
return await Z(f, l, v, u), q(f);
|
|
744
|
+
if (Ge(f, v)) {
|
|
745
|
+
const b = (await Ke(
|
|
746
|
+
f,
|
|
747
|
+
l,
|
|
748
|
+
v,
|
|
749
|
+
u
|
|
750
750
|
)).find(
|
|
751
|
-
(
|
|
751
|
+
(y) => y.type === "element" && _e(y)
|
|
752
752
|
);
|
|
753
|
-
if (
|
|
754
|
-
return
|
|
753
|
+
if (b)
|
|
754
|
+
return q(b);
|
|
755
755
|
continue;
|
|
756
756
|
}
|
|
757
757
|
break;
|
|
@@ -761,78 +761,78 @@ async function zt(e, n, t) {
|
|
|
761
761
|
return;
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function gn(e, n) {
|
|
765
765
|
for (const t of e.children) {
|
|
766
766
|
if (t.type !== "element")
|
|
767
767
|
continue;
|
|
768
|
-
const r =
|
|
769
|
-
if ((i === -1 ? t.name : t.name.slice(i + 1)) === "fallback" && r[o] ===
|
|
768
|
+
const r = ae(n, t), i = t.name.indexOf(":"), o = i === -1 ? "" : t.name.slice(0, i);
|
|
769
|
+
if ((i === -1 ? t.name : t.name.slice(i + 1)) === "fallback" && r[o] === ze)
|
|
770
770
|
return t;
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function Ye(e) {
|
|
774
774
|
return typeof e == "object" && e !== null && e.type === "element";
|
|
775
775
|
}
|
|
776
|
-
function
|
|
776
|
+
function vn(e) {
|
|
777
777
|
return /^(pf|xhtml):/.test(e.name);
|
|
778
778
|
}
|
|
779
|
-
function
|
|
780
|
-
const r = [], i = e.children.find(
|
|
779
|
+
function bn(e, n, t) {
|
|
780
|
+
const r = [], i = e.children.find(Ye);
|
|
781
781
|
if (i) {
|
|
782
782
|
const o = t?.parentId ?? "root";
|
|
783
|
-
|
|
783
|
+
qe(i, o, t?.position ?? 1, n, o, r);
|
|
784
784
|
}
|
|
785
785
|
return r;
|
|
786
786
|
}
|
|
787
|
-
function
|
|
788
|
-
const
|
|
789
|
-
let
|
|
790
|
-
if (
|
|
791
|
-
|
|
787
|
+
function qe(e, n, t, r, i, o) {
|
|
788
|
+
const l = hn(e) ?? r;
|
|
789
|
+
let u, m;
|
|
790
|
+
if (vn(e))
|
|
791
|
+
m = "root";
|
|
792
792
|
else {
|
|
793
|
-
const
|
|
794
|
-
|
|
795
|
-
id:
|
|
796
|
-
file:
|
|
793
|
+
const v = e.attributes.label ?? e.attributes["xml:id"];
|
|
794
|
+
u = v ?? `${n}-${t}`, o.push({
|
|
795
|
+
id: u,
|
|
796
|
+
file: l,
|
|
797
797
|
line: e.position?.start.line ?? 1,
|
|
798
798
|
column: e.position?.start.column ?? 1,
|
|
799
799
|
endLine: e.position?.end.line ?? e.position?.start.line ?? 1,
|
|
800
800
|
parent: i
|
|
801
|
-
}),
|
|
801
|
+
}), m = u;
|
|
802
802
|
}
|
|
803
|
-
let
|
|
804
|
-
for (const
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
803
|
+
let f = 0;
|
|
804
|
+
for (const v of e.children)
|
|
805
|
+
Ye(v) && (f += 1, qe(
|
|
806
|
+
v,
|
|
807
|
+
m,
|
|
808
|
+
f,
|
|
809
|
+
l,
|
|
810
|
+
u ?? i,
|
|
811
811
|
o
|
|
812
812
|
));
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function or(e, n) {
|
|
815
815
|
let t;
|
|
816
816
|
for (const r of e)
|
|
817
817
|
r.line <= n && (t = r);
|
|
818
818
|
return t ?? e[0];
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function En(e) {
|
|
821
821
|
const n = e.replace(/<!--[\s\S]*?-->/g, " ").replace(/<!\[CDATA\[[\s\S]*?\]\]>/g, " ");
|
|
822
822
|
return /<\s*slide(?:show)?[\s/>]/.test(n) ? "slides" : "html";
|
|
823
823
|
}
|
|
824
|
-
const
|
|
825
|
-
function
|
|
824
|
+
const Ze = "pretext-html:set-theme";
|
|
825
|
+
function sr(e) {
|
|
826
826
|
return e === "dark" || e === "light" || e === "system";
|
|
827
827
|
}
|
|
828
|
-
function
|
|
829
|
-
return { type:
|
|
828
|
+
function ar(e) {
|
|
829
|
+
return { type: Ze, theme: e };
|
|
830
830
|
}
|
|
831
|
-
function
|
|
831
|
+
function yn(e) {
|
|
832
832
|
return [
|
|
833
833
|
"<script>",
|
|
834
834
|
"(function () {",
|
|
835
|
-
" var CFG = " + JSON.stringify({ msg:
|
|
835
|
+
" var CFG = " + JSON.stringify({ msg: Ze, initial: e }) + ";",
|
|
836
836
|
// Where the last requested theme is remembered so it survives an in-place
|
|
837
837
|
// document rewrite (same Window) and outranks the baked initial value.
|
|
838
838
|
" var KEY = '__ptxPreviewTheme';",
|
|
@@ -902,12 +902,12 @@ function Zt(e) {
|
|
|
902
902
|
].join(`
|
|
903
903
|
`);
|
|
904
904
|
}
|
|
905
|
-
function
|
|
906
|
-
const t =
|
|
905
|
+
function xn(e, n) {
|
|
906
|
+
const t = yn(n);
|
|
907
907
|
return /<head[^>]*>/i.test(e) ? e.replace(/<head([^>]*)>/i, `<head$1>
|
|
908
908
|
${t}`) : e;
|
|
909
909
|
}
|
|
910
|
-
const
|
|
910
|
+
const Qe = /* @__PURE__ */ new Set([
|
|
911
911
|
"colophon",
|
|
912
912
|
"biography",
|
|
913
913
|
"dedication",
|
|
@@ -927,69 +927,69 @@ const De = /* @__PURE__ */ new Set([
|
|
|
927
927
|
"glossary",
|
|
928
928
|
"worksheet",
|
|
929
929
|
"handout"
|
|
930
|
-
]),
|
|
930
|
+
]), et = /* @__PURE__ */ new Set([
|
|
931
931
|
"book",
|
|
932
932
|
"article",
|
|
933
933
|
"slideshow",
|
|
934
934
|
"letter",
|
|
935
935
|
"memo"
|
|
936
|
-
]),
|
|
937
|
-
...
|
|
938
|
-
...
|
|
936
|
+
]), tt = /* @__PURE__ */ new Set([
|
|
937
|
+
...et,
|
|
938
|
+
...Qe,
|
|
939
939
|
"part",
|
|
940
940
|
"frontmatter",
|
|
941
941
|
"backmatter"
|
|
942
|
-
]),
|
|
942
|
+
]), Tn = /* @__PURE__ */ new Set(["docinfo"]), nt = /* @__PURE__ */ new Set([
|
|
943
943
|
"title",
|
|
944
944
|
"shorttitle",
|
|
945
945
|
"plaintitle",
|
|
946
946
|
"subtitle",
|
|
947
947
|
"caption"
|
|
948
948
|
]);
|
|
949
|
-
function
|
|
949
|
+
function O(e) {
|
|
950
950
|
return e.type === "element";
|
|
951
951
|
}
|
|
952
|
-
function
|
|
952
|
+
function rt(e) {
|
|
953
953
|
return e.attributes["xml:id"] ?? void 0;
|
|
954
954
|
}
|
|
955
|
-
function
|
|
955
|
+
function ge(e, n) {
|
|
956
956
|
for (const t of e.children) {
|
|
957
|
-
if (!
|
|
958
|
-
if (
|
|
959
|
-
const r =
|
|
957
|
+
if (!O(t)) continue;
|
|
958
|
+
if (rt(t) === n) return t;
|
|
959
|
+
const r = ge(t, n);
|
|
960
960
|
if (r) return r;
|
|
961
961
|
}
|
|
962
962
|
}
|
|
963
|
-
function
|
|
963
|
+
function oe(e, n) {
|
|
964
964
|
for (const t of e.children) {
|
|
965
|
-
if (!
|
|
965
|
+
if (!O(t)) continue;
|
|
966
966
|
if (t === n) return [t];
|
|
967
|
-
const r =
|
|
967
|
+
const r = oe(t, n);
|
|
968
968
|
if (r) return [t, ...r];
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
|
-
function
|
|
971
|
+
function Sn(e, n) {
|
|
972
972
|
let t = 0;
|
|
973
973
|
for (const [r, i] of e.entries()) {
|
|
974
974
|
const o = r === 0 ? void 0 : e[r - 1];
|
|
975
|
-
|
|
975
|
+
et.has(i.name) ? t = 0 : i.name === "frontmatter" || i.name === "backmatter" || i.name === "part" ? t = o?.name === "book" && n ? 1 : 0 : Qe.has(i.name) && (t += 1);
|
|
976
976
|
}
|
|
977
977
|
return t;
|
|
978
978
|
}
|
|
979
|
-
function
|
|
980
|
-
if (!
|
|
981
|
-
e.children = e.children.filter(
|
|
979
|
+
function it(e) {
|
|
980
|
+
if (!nt.has(e.name)) {
|
|
981
|
+
e.children = e.children.filter(O);
|
|
982
982
|
for (const n of e.children)
|
|
983
|
-
|
|
983
|
+
it(n);
|
|
984
984
|
}
|
|
985
985
|
}
|
|
986
|
-
function
|
|
986
|
+
function ve(e, n) {
|
|
987
987
|
const t = [];
|
|
988
988
|
for (const r of e.children)
|
|
989
|
-
|
|
989
|
+
O(r) && (n.has(r) || Tn.has(r.name) || nt.has(r.name) ? t.push(r) : tt.has(r.name) && (ve(r, n), t.push(r)));
|
|
990
990
|
e.children = t;
|
|
991
991
|
}
|
|
992
|
-
function
|
|
992
|
+
function An(e) {
|
|
993
993
|
const n = /* @__PURE__ */ new Set(), t = (r) => {
|
|
994
994
|
if (r.name === "xref") {
|
|
995
995
|
const i = [
|
|
@@ -998,69 +998,69 @@ function nn(e) {
|
|
|
998
998
|
r.attributes.last
|
|
999
999
|
];
|
|
1000
1000
|
for (const o of i)
|
|
1001
|
-
for (const
|
|
1002
|
-
|
|
1001
|
+
for (const l of o?.split(/[\s,]+/) ?? [])
|
|
1002
|
+
l && n.add(l);
|
|
1003
1003
|
}
|
|
1004
1004
|
for (const i of r.children)
|
|
1005
|
-
|
|
1005
|
+
O(i) && t(i);
|
|
1006
1006
|
};
|
|
1007
1007
|
return t(e), n;
|
|
1008
1008
|
}
|
|
1009
|
-
function
|
|
1009
|
+
function In(e, n, t) {
|
|
1010
1010
|
const r = (i) => {
|
|
1011
|
-
for (const [o,
|
|
1012
|
-
if (
|
|
1013
|
-
if (
|
|
1011
|
+
for (const [o, l] of i.children.entries())
|
|
1012
|
+
if (O(l)) {
|
|
1013
|
+
if (rt(l) === n)
|
|
1014
1014
|
return i.children[o] = t, !0;
|
|
1015
|
-
if (r(
|
|
1015
|
+
if (r(l)) return !0;
|
|
1016
1016
|
}
|
|
1017
1017
|
return !1;
|
|
1018
1018
|
};
|
|
1019
1019
|
return r(e);
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1022
|
-
const t =
|
|
1021
|
+
function Ln(e, n) {
|
|
1022
|
+
const t = ge(e, n);
|
|
1023
1023
|
if (!t) return;
|
|
1024
|
-
const r =
|
|
1024
|
+
const r = oe(e, t);
|
|
1025
1025
|
if (!r) return;
|
|
1026
1026
|
const i = r.filter(
|
|
1027
|
-
(
|
|
1028
|
-
), o = i[0],
|
|
1029
|
-
(
|
|
1030
|
-
),
|
|
1031
|
-
if (
|
|
1032
|
-
for (const
|
|
1033
|
-
const
|
|
1034
|
-
if (!
|
|
1035
|
-
const
|
|
1036
|
-
if (!
|
|
1037
|
-
const
|
|
1038
|
-
if (
|
|
1039
|
-
|
|
1040
|
-
for (const
|
|
1041
|
-
|
|
1027
|
+
(b) => b.name !== "pretext" && b.name !== "mathbook"
|
|
1028
|
+
), o = i[0], l = o?.name === "book" && o.children.some(
|
|
1029
|
+
(b) => O(b) && b.name === "part"
|
|
1030
|
+
), u = Sn(i, l), m = new Set(r), f = An(t), v = /* @__PURE__ */ new Set();
|
|
1031
|
+
if (f.size > 0)
|
|
1032
|
+
for (const b of f) {
|
|
1033
|
+
const y = ge(e, b);
|
|
1034
|
+
if (!y || y === t) continue;
|
|
1035
|
+
const B = oe(e, y);
|
|
1036
|
+
if (!B) continue;
|
|
1037
|
+
const $ = [...B].reverse().find((k) => tt.has(k.name));
|
|
1038
|
+
if ($ && $ !== t) {
|
|
1039
|
+
v.add($);
|
|
1040
|
+
for (const k of oe(e, $) ?? [])
|
|
1041
|
+
m.add(k);
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
|
-
for (const
|
|
1045
|
-
if (
|
|
1046
|
-
|
|
1044
|
+
for (const b of r) {
|
|
1045
|
+
if (b === t) break;
|
|
1046
|
+
ve(b, m);
|
|
1047
1047
|
}
|
|
1048
|
-
for (const
|
|
1049
|
-
|
|
1050
|
-
const
|
|
1051
|
-
return
|
|
1048
|
+
for (const b of v)
|
|
1049
|
+
it(b);
|
|
1050
|
+
const w = e.children.find(O);
|
|
1051
|
+
return w && !r.includes(w) && ve(w, m), { content: q(e), divisionId: n, level: u };
|
|
1052
1052
|
}
|
|
1053
|
-
const
|
|
1054
|
-
function
|
|
1053
|
+
const _n = "This live preview shows a single division, so links into the rest of the document do not work here.", $n = /<a\b([^>]*)>/g, Rn = /\sid="([^"]*)"/g, de = /\shref="([^"]*)"/, kn = /\\href\{([^{}]*)\}/g, $e = /\stitle="([^"]*)"/;
|
|
1054
|
+
function Nn(e) {
|
|
1055
1055
|
const n = /* @__PURE__ */ new Set();
|
|
1056
|
-
for (const t of e.matchAll(
|
|
1056
|
+
for (const t of e.matchAll(Rn))
|
|
1057
1057
|
n.add(t[1]);
|
|
1058
1058
|
return n;
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1060
|
+
function Pn(e) {
|
|
1061
1061
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1063
|
+
function Re(e, n) {
|
|
1064
1064
|
if (e.startsWith("#") || e === "") return { kind: "keep" };
|
|
1065
1065
|
if (/^[a-z][a-z0-9+.-]*:/i.test(e) || e.startsWith("//"))
|
|
1066
1066
|
return { kind: "keep" };
|
|
@@ -1069,73 +1069,73 @@ function ae(e, n) {
|
|
|
1069
1069
|
const r = e.slice(t + 1);
|
|
1070
1070
|
return n.has(r) && r !== "" ? { kind: "same-page", id: r } : { kind: "off-page" };
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1073
|
-
const t = n.offPageMessage ??
|
|
1074
|
-
return e.replace(
|
|
1075
|
-
const
|
|
1076
|
-
if (!
|
|
1077
|
-
const
|
|
1078
|
-
if (
|
|
1079
|
-
if (
|
|
1080
|
-
return `<a${
|
|
1081
|
-
const
|
|
1082
|
-
return `<a${
|
|
1083
|
-
}).replace(
|
|
1084
|
-
const
|
|
1085
|
-
return
|
|
1072
|
+
function Dn(e, n = {}) {
|
|
1073
|
+
const t = n.offPageMessage ?? _n, r = Nn(e);
|
|
1074
|
+
return e.replace($n, (o, l) => {
|
|
1075
|
+
const u = de.exec(l);
|
|
1076
|
+
if (!u) return o;
|
|
1077
|
+
const m = Re(u[1], r);
|
|
1078
|
+
if (m.kind === "keep") return o;
|
|
1079
|
+
if (m.kind === "same-page")
|
|
1080
|
+
return `<a${l.replace(de, ` href="#${m.id}"`)}>`;
|
|
1081
|
+
const f = $e.exec(l), v = Pn(t), w = f ? `${f[1]} — ${v}` : v;
|
|
1082
|
+
return `<a${l.replace(de, "").replace($e, "")} title="${w}" aria-disabled="true" style="cursor:default">`;
|
|
1083
|
+
}).replace(kn, (o, l) => {
|
|
1084
|
+
const u = Re(l, r);
|
|
1085
|
+
return u.kind === "same-page" ? `\\href{#${u.id}}` : o;
|
|
1086
1086
|
});
|
|
1087
1087
|
}
|
|
1088
|
-
function
|
|
1089
|
-
return
|
|
1088
|
+
function Mn() {
|
|
1089
|
+
return Oe(se(), "xsl");
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1091
|
+
function Cn() {
|
|
1092
1092
|
return "Suspending" in WebAssembly;
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1095
|
-
if (!
|
|
1094
|
+
function On() {
|
|
1095
|
+
if (!Cn())
|
|
1096
1096
|
throw new Error(
|
|
1097
1097
|
"WebAssembly JSPI is not enabled. Run Node with --experimental-wasm-jspi (or use the pretext-html CLI, which re-launches itself with the flag)."
|
|
1098
1098
|
);
|
|
1099
1099
|
}
|
|
1100
|
-
function
|
|
1100
|
+
function Y(e) {
|
|
1101
1101
|
return e.includes("'") ? e.includes('"') ? `concat(${e.split("'").map((t) => `'${t}'`).join(`, "'", `)})` : `"${e}"` : `'${e}'`;
|
|
1102
1102
|
}
|
|
1103
|
-
function
|
|
1103
|
+
function Bn(e) {
|
|
1104
1104
|
return e.replace(
|
|
1105
1105
|
/from '\.\/(https:\/\/[^']+)'/g,
|
|
1106
1106
|
(n, t) => `from '${t}'`
|
|
1107
1107
|
);
|
|
1108
1108
|
}
|
|
1109
|
-
const
|
|
1110
|
-
"cli.version":
|
|
1109
|
+
const jn = `https://cdn.jsdelivr.net/gh/PreTeXtBook/html-static@${je}/dist/`, Un = {
|
|
1110
|
+
"cli.version": je,
|
|
1111
1111
|
// Colon-delimited: pretext-runestone.xsl splits them with str:tokenize.
|
|
1112
|
-
"rs-js":
|
|
1113
|
-
"rs-css":
|
|
1114
|
-
"rs-version":
|
|
1112
|
+
"rs-js": xt.join(":"),
|
|
1113
|
+
"rs-css": Tt.join(":"),
|
|
1114
|
+
"rs-version": yt
|
|
1115
1115
|
};
|
|
1116
|
-
function
|
|
1116
|
+
function Fn(e) {
|
|
1117
1117
|
return e.replace(
|
|
1118
1118
|
/(<link\b[^>]*\bhref=["'])_static\//gi,
|
|
1119
|
-
`$1${
|
|
1119
|
+
`$1${jn}_static/`
|
|
1120
1120
|
);
|
|
1121
1121
|
}
|
|
1122
|
-
function
|
|
1122
|
+
function Wn(e) {
|
|
1123
1123
|
return e.slice(0, 65536).replace(/<\?[\s\S]*?\?>/g, " ").replace(/<!--[\s\S]*?-->/g, " ").replace(/<!DOCTYPE[^>]*>/gi, " ").match(/<\s*([A-Za-z][\w:-]*)/)?.[1];
|
|
1124
1124
|
}
|
|
1125
|
-
async function
|
|
1126
|
-
const n = await
|
|
1125
|
+
async function ke(e) {
|
|
1126
|
+
const n = await ce(e);
|
|
1127
1127
|
if (n === void 0)
|
|
1128
1128
|
throw new Error(
|
|
1129
1129
|
`Could not read ${e}. (In the browser build only absolute URLs are readable — pass sourceContent instead of relying on sourcePath.)`
|
|
1130
1130
|
);
|
|
1131
1131
|
return n;
|
|
1132
1132
|
}
|
|
1133
|
-
async function
|
|
1134
|
-
const t =
|
|
1133
|
+
async function Hn(e, n) {
|
|
1134
|
+
const t = I(e), r = await ce(t);
|
|
1135
1135
|
if (r !== void 0)
|
|
1136
|
-
return
|
|
1136
|
+
return wn(r, t, n);
|
|
1137
1137
|
}
|
|
1138
|
-
function
|
|
1138
|
+
function Vn(e, n, t, r) {
|
|
1139
1139
|
const i = e.replace(/^\uFEFF/, "").replace(/<\?xml[\s\S]*?\?>/, "").replace(/<!DOCTYPE[^>]*>/i, ""), o = t === "slides" ? "slideshow" : n === "chapter" || n === "part" ? "book" : "article";
|
|
1140
1140
|
return `<pretext>
|
|
1141
1141
|
${r?.trim() ? `${r.trim()}
|
|
@@ -1146,230 +1146,574 @@ ${i}
|
|
|
1146
1146
|
</pretext>
|
|
1147
1147
|
`;
|
|
1148
1148
|
}
|
|
1149
|
-
async function
|
|
1150
|
-
const i =
|
|
1151
|
-
(
|
|
1149
|
+
async function Xn(e, n, t, r) {
|
|
1150
|
+
const i = X(e).children.find(
|
|
1151
|
+
(v) => v.type === "element"
|
|
1152
1152
|
), o = i?.attributes["xml:id"];
|
|
1153
1153
|
if (!i || !o) return;
|
|
1154
|
-
const
|
|
1155
|
-
if (
|
|
1156
|
-
let
|
|
1154
|
+
const l = I(n), u = r ?? await ce(l);
|
|
1155
|
+
if (u === void 0) return;
|
|
1156
|
+
let m;
|
|
1157
1157
|
try {
|
|
1158
|
-
|
|
1158
|
+
m = (await Ee(u, l, t)).tree;
|
|
1159
1159
|
} catch {
|
|
1160
1160
|
return;
|
|
1161
1161
|
}
|
|
1162
|
-
if (!
|
|
1163
|
-
const
|
|
1164
|
-
if (
|
|
1165
|
-
return { ...
|
|
1162
|
+
if (!In(m, o, i)) return;
|
|
1163
|
+
const f = Ln(m, o);
|
|
1164
|
+
if (f)
|
|
1165
|
+
return { ...f, tree: m };
|
|
1166
1166
|
}
|
|
1167
|
-
let
|
|
1168
|
-
function
|
|
1167
|
+
let ot = !1;
|
|
1168
|
+
function Jn(e) {
|
|
1169
1169
|
return e instanceof Error && /\bAborted\(/.test(e.message);
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function zn(e) {
|
|
1172
1172
|
return e instanceof Error && /memory access|out of bounds/i.test(e.message);
|
|
1173
1173
|
}
|
|
1174
|
-
function
|
|
1175
|
-
if (
|
|
1174
|
+
function Gn() {
|
|
1175
|
+
if (ot)
|
|
1176
1176
|
throw new Error(
|
|
1177
1177
|
"The WebAssembly renderer aborted earlier in this process and cannot be reused. Restart the process (or reload the page) to render again."
|
|
1178
1178
|
);
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1181
|
-
if (
|
|
1182
|
-
throw
|
|
1180
|
+
function Ne(e) {
|
|
1181
|
+
if (Jn(e))
|
|
1182
|
+
throw ot = !0, new Error(
|
|
1183
1183
|
"The WebAssembly renderer aborted and cannot be reused. Restart the process (or reload the page) to render again.",
|
|
1184
1184
|
{ cause: e }
|
|
1185
1185
|
);
|
|
1186
|
-
if (
|
|
1186
|
+
if (zn(e))
|
|
1187
1187
|
throw new Error(
|
|
1188
1188
|
"The WebAssembly renderer hit a memory fault. Most often the document is too large for this build's stack — whole-book builds are a known limitation, so try a smaller document, or see the README about rebuilding libxslt-wasm with a larger stack. The same fault also results from running two renders concurrently against the shared libxslt state.",
|
|
1189
1189
|
{ cause: e }
|
|
1190
1190
|
);
|
|
1191
1191
|
}
|
|
1192
|
-
let
|
|
1193
|
-
async function
|
|
1194
|
-
return
|
|
1192
|
+
let fe;
|
|
1193
|
+
async function st() {
|
|
1194
|
+
return fe || (fe = (async () => {
|
|
1195
1195
|
const [e, n] = await Promise.all([
|
|
1196
1196
|
import("@pretextbook/libxslt-wasm"),
|
|
1197
1197
|
import("@pretextbook/libxslt-wasm/exslt")
|
|
1198
1198
|
]);
|
|
1199
1199
|
return n.registerAll(), e;
|
|
1200
|
-
})()),
|
|
1200
|
+
})()), fe;
|
|
1201
1201
|
}
|
|
1202
|
-
const
|
|
1202
|
+
const pe = /* @__PURE__ */ new Map(), Kn = {
|
|
1203
1203
|
html: "preview-html.xsl",
|
|
1204
1204
|
slides: "preview-revealjs.xsl"
|
|
1205
1205
|
};
|
|
1206
|
-
async function
|
|
1207
|
-
const t =
|
|
1208
|
-
let i =
|
|
1206
|
+
async function Yn(e, n) {
|
|
1207
|
+
const t = Kn[n], r = `${n}\0${e}`;
|
|
1208
|
+
let i = pe.get(r);
|
|
1209
1209
|
return i || (i = (async () => {
|
|
1210
|
-
const { XmlDocument: o, XsltStylesheet:
|
|
1211
|
-
if (
|
|
1210
|
+
const { XmlDocument: o, XsltStylesheet: l } = await st(), u = He(e), m = await Be(se(), `/${t}`);
|
|
1211
|
+
if (m === void 0)
|
|
1212
1212
|
throw new Error(
|
|
1213
|
-
`Could not read ${t} from ${
|
|
1213
|
+
`Could not read ${t} from ${se()}. Check the assets location (PRETEXT_HTML_ASSETS under Node, setAssetsBase() in the browser).`
|
|
1214
1214
|
);
|
|
1215
|
-
const
|
|
1216
|
-
url: `${
|
|
1215
|
+
const f = new TextDecoder().decode(m), v = await o.fromString(f, {
|
|
1216
|
+
url: `${u}/${t}`,
|
|
1217
1217
|
options: { noEnt: !0, dtdLoad: !0, huge: !0 }
|
|
1218
1218
|
});
|
|
1219
|
-
return
|
|
1220
|
-
})(),
|
|
1221
|
-
}
|
|
1222
|
-
let
|
|
1223
|
-
function
|
|
1224
|
-
const n =
|
|
1225
|
-
() =>
|
|
1226
|
-
() =>
|
|
1219
|
+
return l.fromXmlDocument(v);
|
|
1220
|
+
})(), pe.set(r, i), i.catch(() => pe.delete(r))), i;
|
|
1221
|
+
}
|
|
1222
|
+
let Pe = Promise.resolve();
|
|
1223
|
+
function cr(e) {
|
|
1224
|
+
const n = Pe.then(
|
|
1225
|
+
() => De(e),
|
|
1226
|
+
() => De(e)
|
|
1227
1227
|
);
|
|
1228
|
-
return
|
|
1228
|
+
return Pe = n.catch(() => {
|
|
1229
1229
|
}), n;
|
|
1230
1230
|
}
|
|
1231
|
-
async function
|
|
1232
|
-
|
|
1233
|
-
const { XmlDocument: n } = await
|
|
1234
|
-
e.projectDir ??
|
|
1235
|
-
), i = e.sourceContent ?? await
|
|
1231
|
+
async function De(e) {
|
|
1232
|
+
On(), Gn();
|
|
1233
|
+
const { XmlDocument: n } = await st(), t = I(e.sourcePath), r = I(
|
|
1234
|
+
e.projectDir ?? H(t)
|
|
1235
|
+
), i = e.sourceContent ?? await ke(t), o = ue(r, t);
|
|
1236
1236
|
if (o.startsWith(".."))
|
|
1237
1237
|
throw new Error(
|
|
1238
1238
|
`sourcePath (${t}) must live inside projectDir (${r})`
|
|
1239
1239
|
);
|
|
1240
|
-
const
|
|
1240
|
+
const l = ue(
|
|
1241
1241
|
r,
|
|
1242
|
-
|
|
1243
|
-
),
|
|
1242
|
+
I(e.mainSourcePath ?? t)
|
|
1243
|
+
), u = l.startsWith("..") ? o : l, m = He(r);
|
|
1244
1244
|
try {
|
|
1245
|
-
let
|
|
1245
|
+
let f, v = `${m}/__pretext-preview-publication.xml`;
|
|
1246
1246
|
if (e.publicationPath) {
|
|
1247
|
-
const
|
|
1248
|
-
|
|
1249
|
-
const
|
|
1250
|
-
|
|
1247
|
+
const h = I(e.publicationPath);
|
|
1248
|
+
f = await ke(h);
|
|
1249
|
+
const S = ue(r, h);
|
|
1250
|
+
S.startsWith("..") || (v = `${m}/${S.split(he).join("/")}`);
|
|
1251
1251
|
}
|
|
1252
|
-
let
|
|
1252
|
+
let w, b;
|
|
1253
1253
|
if (e.sourceMap) {
|
|
1254
|
-
const
|
|
1254
|
+
const h = await Ee(
|
|
1255
1255
|
i,
|
|
1256
1256
|
t,
|
|
1257
1257
|
r
|
|
1258
1258
|
);
|
|
1259
|
-
|
|
1259
|
+
w = h.tree, b = h.content;
|
|
1260
1260
|
} else
|
|
1261
|
-
|
|
1261
|
+
b = await pn(
|
|
1262
1262
|
i,
|
|
1263
1263
|
t,
|
|
1264
1264
|
r
|
|
1265
1265
|
);
|
|
1266
|
-
const
|
|
1266
|
+
const y = e.target ?? En(b), B = await Yn(e.xslDir ?? Mn(), y), $ = qt(f, {
|
|
1267
1267
|
cssTheme: e.cssTheme,
|
|
1268
1268
|
revealTheme: e.revealTheme,
|
|
1269
|
-
target:
|
|
1269
|
+
target: y
|
|
1270
1270
|
});
|
|
1271
|
-
|
|
1272
|
-
const
|
|
1273
|
-
external:
|
|
1274
|
-
generated:
|
|
1275
|
-
} : void 0,
|
|
1276
|
-
let
|
|
1277
|
-
if (
|
|
1271
|
+
Dt(v, $);
|
|
1272
|
+
const k = Zt($), J = H(I(r, u)), z = k.external !== void 0 && k.generated !== void 0 ? {
|
|
1273
|
+
external: I(J, k.external),
|
|
1274
|
+
generated: I(J, k.generated)
|
|
1275
|
+
} : void 0, N = Wn(b);
|
|
1276
|
+
let G = { parentId: "root", position: 1 }, j, Q = t;
|
|
1277
|
+
if (N !== "pretext" && N !== "mathbook") {
|
|
1278
1278
|
if (!e.fragment)
|
|
1279
1279
|
throw new Error(
|
|
1280
|
-
`The document root is <${
|
|
1280
|
+
`The document root is <${N ?? "?"}>, not <pretext> — this looks like an xi:included fragment. Render the project's main source file instead, or pass the fragment option.`
|
|
1281
1281
|
);
|
|
1282
1282
|
if (e.contextSourcePath || e.contextSourceContent) {
|
|
1283
|
-
const
|
|
1284
|
-
|
|
1285
|
-
|
|
1283
|
+
const h = e.contextSourcePath ?? at(H(t), "__pretext-preview-context.ptx"), S = await Xn(
|
|
1284
|
+
b,
|
|
1285
|
+
h,
|
|
1286
1286
|
r,
|
|
1287
1287
|
e.contextSourceContent
|
|
1288
1288
|
);
|
|
1289
|
-
|
|
1289
|
+
S && (b = S.content, w = e.sourceMap ? S.tree : void 0, Q = I(h), j = { divisionId: S.divisionId, level: S.level });
|
|
1290
1290
|
}
|
|
1291
|
-
if (
|
|
1292
|
-
const
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
),
|
|
1291
|
+
if (!j) {
|
|
1292
|
+
const h = e.docinfo ?? (e.docinfoSourcePath ? await Hn(e.docinfoSourcePath, r) : void 0);
|
|
1293
|
+
b = Vn(
|
|
1294
|
+
b,
|
|
1295
|
+
N,
|
|
1296
|
+
y,
|
|
1297
|
+
h
|
|
1298
|
+
), G = { parentId: h?.trim() ? "root-1-2" : "root-1-1", position: 2 };
|
|
1299
1299
|
}
|
|
1300
1300
|
}
|
|
1301
|
-
const
|
|
1302
|
-
url: `${
|
|
1301
|
+
const ee = w ? bn(w, Q, G) : void 0, te = await n.fromString(b, {
|
|
1302
|
+
url: `${m}/${u.split(he).join("/")}`,
|
|
1303
1303
|
options: { noEnt: !0, dtdLoad: !0, huge: !0 }
|
|
1304
|
-
}),
|
|
1305
|
-
publisher:
|
|
1304
|
+
}), M = {
|
|
1305
|
+
publisher: Y(v)
|
|
1306
1306
|
};
|
|
1307
|
-
for (const [
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
for (const [
|
|
1311
|
-
|
|
1312
|
-
let
|
|
1307
|
+
for (const [h, S] of Object.entries(Un))
|
|
1308
|
+
M[h] = Y(S);
|
|
1309
|
+
j && (M.subtree = Y(j.divisionId), M["subtree-level"] = Y(String(j.level)));
|
|
1310
|
+
for (const [h, S] of Object.entries(e.stringParams ?? {}))
|
|
1311
|
+
M[h] = Y(S);
|
|
1312
|
+
let K;
|
|
1313
1313
|
try {
|
|
1314
|
-
|
|
1315
|
-
} catch (
|
|
1316
|
-
throw
|
|
1314
|
+
K = await B.apply(te, M);
|
|
1315
|
+
} catch (h) {
|
|
1316
|
+
throw Ne(h), new Error(
|
|
1317
1317
|
"PreTeXt XSLT transform failed; see the PTX:ERROR/PTX:FATAL messages on stderr for details.",
|
|
1318
|
-
{ cause:
|
|
1318
|
+
{ cause: h }
|
|
1319
1319
|
);
|
|
1320
1320
|
} finally {
|
|
1321
|
-
|
|
1321
|
+
te.delete();
|
|
1322
1322
|
}
|
|
1323
1323
|
try {
|
|
1324
|
-
let
|
|
1325
|
-
|
|
1324
|
+
let h = Bn(K.toHtmlString());
|
|
1325
|
+
h = Dn(h, {
|
|
1326
1326
|
...e.offPageMessage !== void 0 ? { offPageMessage: e.offPageMessage } : {}
|
|
1327
|
-
}), (e.openKnowls ?? !0) && (
|
|
1327
|
+
}), (e.openKnowls ?? !0) && (h = _t(h)), y === "slides" ? (h = Fn(h), h = fn(h, e.revealView ?? "scroll", {
|
|
1328
1328
|
zoom: e.revealZoom
|
|
1329
|
-
})) : e.theme && (
|
|
1330
|
-
const
|
|
1331
|
-
return e.printPreview && (
|
|
1332
|
-
html:
|
|
1333
|
-
target:
|
|
1334
|
-
printouts:
|
|
1335
|
-
...
|
|
1336
|
-
...
|
|
1337
|
-
...
|
|
1329
|
+
})) : e.theme && (h = xn(h, e.theme)), e.previewBanner && (h = wt(h, e.previewBanner));
|
|
1330
|
+
const S = y === "slides" ? [] : Ve(h), ne = jt(S, N);
|
|
1331
|
+
return e.printPreview && (h = Jt(h, e.printPreview)), {
|
|
1332
|
+
html: h,
|
|
1333
|
+
target: y,
|
|
1334
|
+
printouts: S,
|
|
1335
|
+
...ee ? { sourceMap: ee } : {},
|
|
1336
|
+
...z ? { assetDirs: z } : {},
|
|
1337
|
+
...ne ? { rootPrintout: ne } : {}
|
|
1338
1338
|
};
|
|
1339
|
-
} catch (
|
|
1340
|
-
throw
|
|
1339
|
+
} catch (h) {
|
|
1340
|
+
throw Ne(h), h;
|
|
1341
1341
|
} finally {
|
|
1342
|
-
|
|
1342
|
+
K.delete();
|
|
1343
1343
|
}
|
|
1344
1344
|
} finally {
|
|
1345
|
-
|
|
1345
|
+
Pt(m);
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
const qn = "__ptxLivePatch";
|
|
1349
|
+
function Zn(e, n, t) {
|
|
1350
|
+
const r = "script, #latex-macros, [data-component], .ptx-runestone-container", i = /* @__PURE__ */ new Set([
|
|
1351
|
+
"BODY",
|
|
1352
|
+
"MAIN",
|
|
1353
|
+
"DIV",
|
|
1354
|
+
"SECTION",
|
|
1355
|
+
"ARTICLE",
|
|
1356
|
+
"ASIDE",
|
|
1357
|
+
"NAV",
|
|
1358
|
+
"HEADER",
|
|
1359
|
+
"FOOTER",
|
|
1360
|
+
"DETAILS",
|
|
1361
|
+
"FIGURE",
|
|
1362
|
+
"UL",
|
|
1363
|
+
"OL",
|
|
1364
|
+
"LI",
|
|
1365
|
+
"DL",
|
|
1366
|
+
"BLOCKQUOTE",
|
|
1367
|
+
"TABLE",
|
|
1368
|
+
"THEAD",
|
|
1369
|
+
"TBODY",
|
|
1370
|
+
"TFOOT",
|
|
1371
|
+
"TR"
|
|
1372
|
+
]), o = /* @__PURE__ */ new Set([
|
|
1373
|
+
"A",
|
|
1374
|
+
"ABBR",
|
|
1375
|
+
"B",
|
|
1376
|
+
"BDI",
|
|
1377
|
+
"BDO",
|
|
1378
|
+
"BR",
|
|
1379
|
+
"BUTTON",
|
|
1380
|
+
"CITE",
|
|
1381
|
+
"CODE",
|
|
1382
|
+
"DATA",
|
|
1383
|
+
"DEL",
|
|
1384
|
+
"DFN",
|
|
1385
|
+
"EM",
|
|
1386
|
+
"I",
|
|
1387
|
+
"IMG",
|
|
1388
|
+
"INPUT",
|
|
1389
|
+
"INS",
|
|
1390
|
+
"KBD",
|
|
1391
|
+
"LABEL",
|
|
1392
|
+
"MARK",
|
|
1393
|
+
"Q",
|
|
1394
|
+
"S",
|
|
1395
|
+
"SAMP",
|
|
1396
|
+
"SELECT",
|
|
1397
|
+
"SMALL",
|
|
1398
|
+
"SPAN",
|
|
1399
|
+
"STRONG",
|
|
1400
|
+
"SUB",
|
|
1401
|
+
"SUP",
|
|
1402
|
+
"SVG",
|
|
1403
|
+
"TEXTAREA",
|
|
1404
|
+
"TIME",
|
|
1405
|
+
"U",
|
|
1406
|
+
"VAR",
|
|
1407
|
+
"WBR"
|
|
1408
|
+
]), l = ["clipboardable"], u = 25e4, m = 3, f = [], v = /* @__PURE__ */ new Map();
|
|
1409
|
+
function w(s) {
|
|
1410
|
+
return { bail: s };
|
|
1411
|
+
}
|
|
1412
|
+
function b(s) {
|
|
1413
|
+
return typeof s == "object" && s !== null && typeof s.bail == "string";
|
|
1414
|
+
}
|
|
1415
|
+
function y(s) {
|
|
1416
|
+
return s.matches(r) || s.querySelector(r) !== null;
|
|
1417
|
+
}
|
|
1418
|
+
function B(s) {
|
|
1419
|
+
return s.tagName === "SCRIPT" && !s.hasAttribute("src") && (s.textContent ?? "").indexOf("ptx_lunr_docs") !== -1;
|
|
1420
|
+
}
|
|
1421
|
+
function $(s) {
|
|
1422
|
+
if (!i.has(s.tagName) || s.matches(".process-math") || // Never looked inside: a change anywhere in one is a change to it.
|
|
1423
|
+
s.matches(r))
|
|
1424
|
+
return !1;
|
|
1425
|
+
for (const a of Array.from(s.childNodes))
|
|
1426
|
+
if (a.nodeType === m && /\S/.test(a.nodeValue ?? ""))
|
|
1427
|
+
return !1;
|
|
1428
|
+
if (s.tagName === "DIV" || s.tagName === "LI") {
|
|
1429
|
+
for (const a of Array.from(s.children))
|
|
1430
|
+
if (o.has(a.tagName.toUpperCase()))
|
|
1431
|
+
return !1;
|
|
1432
|
+
}
|
|
1433
|
+
return !0;
|
|
1434
|
+
}
|
|
1435
|
+
function k(s) {
|
|
1436
|
+
return l.indexOf(s) !== -1;
|
|
1437
|
+
}
|
|
1438
|
+
function J(s, a) {
|
|
1439
|
+
if (s.tagName !== a.tagName)
|
|
1440
|
+
return !1;
|
|
1441
|
+
const c = a.getAttribute("id");
|
|
1442
|
+
if (c !== null && s.getAttribute("id") !== c)
|
|
1443
|
+
return !1;
|
|
1444
|
+
for (const d of Array.from(a.classList))
|
|
1445
|
+
if (!k(d))
|
|
1446
|
+
return s.classList.contains(d);
|
|
1447
|
+
return !0;
|
|
1346
1448
|
}
|
|
1449
|
+
function z(s, a) {
|
|
1450
|
+
const c = Array.from(s.children), d = [];
|
|
1451
|
+
let E = 0;
|
|
1452
|
+
for (const g of a) {
|
|
1453
|
+
let p = null;
|
|
1454
|
+
for (; !p && E < c.length; ) {
|
|
1455
|
+
const x = c[E++];
|
|
1456
|
+
J(x, g) ? p = { inner: x, outer: x } : x.tagName === "DIV" && l.some((R) => x.classList.contains(R)) && x.firstElementChild && J(x.firstElementChild, g) && (p = { inner: x.firstElementChild, outer: x });
|
|
1457
|
+
}
|
|
1458
|
+
if (!p)
|
|
1459
|
+
return null;
|
|
1460
|
+
d.push(p);
|
|
1461
|
+
}
|
|
1462
|
+
return d;
|
|
1463
|
+
}
|
|
1464
|
+
function N(s, a) {
|
|
1465
|
+
if (s.attributes.length !== a.attributes.length)
|
|
1466
|
+
return !1;
|
|
1467
|
+
for (const c of Array.from(s.attributes))
|
|
1468
|
+
if (a.getAttributeNS(c.namespaceURI, c.localName) !== c.value)
|
|
1469
|
+
return !1;
|
|
1470
|
+
return !0;
|
|
1471
|
+
}
|
|
1472
|
+
function G(s) {
|
|
1473
|
+
return s.outerHTML.replace(/<([A-Za-z][^\s/>]*)\s[^>]*>/g, "<$1>");
|
|
1474
|
+
}
|
|
1475
|
+
function j(s) {
|
|
1476
|
+
let a = v.get(s);
|
|
1477
|
+
return a === void 0 && (a = s.outerHTML.replace(/<span class="codenumber">[^<]*<\/span>/g, "").replace(/<([A-Za-z][^\s/>]*)\s[^>]*>/g, "<$1>"), v.set(s, a)), a;
|
|
1478
|
+
}
|
|
1479
|
+
function Q(s, a, c, d, E) {
|
|
1480
|
+
const g = /* @__PURE__ */ new Map(), p = (D) => {
|
|
1481
|
+
const P = j(D);
|
|
1482
|
+
let re = g.get(P);
|
|
1483
|
+
return re === void 0 && (re = g.size, g.set(P, re)), re;
|
|
1484
|
+
}, x = s.slice(c, d).map(p), R = a.slice(c, E).map(p), _ = x.length, A = R.length, T = A + 1, L = new Uint32Array((_ + 1) * T);
|
|
1485
|
+
for (let D = _ - 1; D >= 0; D--)
|
|
1486
|
+
for (let P = A - 1; P >= 0; P--)
|
|
1487
|
+
L[D * T + P] = x[D] === R[P] ? L[(D + 1) * T + P + 1] + 1 : Math.max(L[(D + 1) * T + P], L[D * T + P + 1]);
|
|
1488
|
+
const C = [];
|
|
1489
|
+
let U = 0, F = 0;
|
|
1490
|
+
for (; U < _ && F < A; )
|
|
1491
|
+
x[U] === R[F] ? (C.push([c + U, c + F]), U++, F++) : L[(U + 1) * T + F] >= L[U * T + F + 1] ? U++ : F++;
|
|
1492
|
+
return C;
|
|
1493
|
+
}
|
|
1494
|
+
function ee(s, a) {
|
|
1495
|
+
const c = a.map(() => -1);
|
|
1496
|
+
let d = 0;
|
|
1497
|
+
for (; d < s.length && d < a.length && s[d].isEqualNode(a[d]); )
|
|
1498
|
+
c[d] = d, d++;
|
|
1499
|
+
let E = s.length, g = a.length;
|
|
1500
|
+
for (; E > d && g > d && s[E - 1].isEqualNode(a[g - 1]); )
|
|
1501
|
+
E--, g--, c[g] = E;
|
|
1502
|
+
const p = E - d, x = g - d;
|
|
1503
|
+
if (p === 0 || x === 0)
|
|
1504
|
+
return c;
|
|
1505
|
+
const R = (p > 1 || x > 1) && p * x <= u ? Q(s, a, d, E, g) : [];
|
|
1506
|
+
R.push([E, g]);
|
|
1507
|
+
let _ = d, A = d;
|
|
1508
|
+
for (const [T, L] of R) {
|
|
1509
|
+
for (; _ < T && A < L; ) {
|
|
1510
|
+
if (s[_].tagName === a[A].tagName) {
|
|
1511
|
+
c[A++] = _++;
|
|
1512
|
+
continue;
|
|
1513
|
+
}
|
|
1514
|
+
let C = _ + 1;
|
|
1515
|
+
for (; C < T && s[C].tagName !== a[A].tagName; )
|
|
1516
|
+
C++;
|
|
1517
|
+
C < T ? _ = C : A++;
|
|
1518
|
+
}
|
|
1519
|
+
T < E && (c[L] = T), _ = T + 1, A = L + 1;
|
|
1520
|
+
}
|
|
1521
|
+
return c;
|
|
1522
|
+
}
|
|
1523
|
+
function te(s, a) {
|
|
1524
|
+
if (y(s) || y(a))
|
|
1525
|
+
throw w(`<${a.tagName.toLowerCase()}> needs a full page load`);
|
|
1526
|
+
return { next: a, replace: !0 };
|
|
1527
|
+
}
|
|
1528
|
+
function M(s, a, c) {
|
|
1529
|
+
N(a, c) || f.push({ live: s, old: a, next: c });
|
|
1530
|
+
const d = Array.from(a.children), E = Array.from(c.children);
|
|
1531
|
+
if (d.length !== E.length)
|
|
1532
|
+
return !1;
|
|
1533
|
+
let g = null;
|
|
1534
|
+
for (let p = 0; p < d.length; p++)
|
|
1535
|
+
if (!d[p].isEqualNode(E[p]) && (g = g ?? z(s, d), !g || !M(g[p].inner, d[p], E[p])))
|
|
1536
|
+
return !1;
|
|
1537
|
+
return !0;
|
|
1538
|
+
}
|
|
1539
|
+
function K(s, a, c) {
|
|
1540
|
+
if (a.isEqualNode(c) || B(a) && B(c))
|
|
1541
|
+
return { next: c, outer: s.outer };
|
|
1542
|
+
if (a.tagName === c.tagName && $(a) && $(c)) {
|
|
1543
|
+
const d = h(s.inner, a, c);
|
|
1544
|
+
if (d)
|
|
1545
|
+
return N(a, c) || f.push({ live: s.inner, old: a, next: c }), { next: c, outer: s.outer, sub: d };
|
|
1546
|
+
} else if (G(a) === G(c)) {
|
|
1547
|
+
const d = f.length;
|
|
1548
|
+
if (M(s.inner, a, c)) {
|
|
1549
|
+
if (y(a))
|
|
1550
|
+
throw w(
|
|
1551
|
+
"attributes changed inside an element that needs a full page load"
|
|
1552
|
+
);
|
|
1553
|
+
return { next: c, outer: s.outer };
|
|
1554
|
+
}
|
|
1555
|
+
f.length = d;
|
|
1556
|
+
}
|
|
1557
|
+
return { ...te(a, c), outer: s.outer };
|
|
1558
|
+
}
|
|
1559
|
+
function h(s, a, c) {
|
|
1560
|
+
const d = Array.from(a.children), E = Array.from(c.children), g = z(s, d);
|
|
1561
|
+
if (!g)
|
|
1562
|
+
return null;
|
|
1563
|
+
const p = ee(d, E), x = d.map(() => !1), R = [];
|
|
1564
|
+
E.forEach((A, T) => {
|
|
1565
|
+
const L = p[T];
|
|
1566
|
+
if (L === -1) {
|
|
1567
|
+
if (y(A))
|
|
1568
|
+
throw w(
|
|
1569
|
+
`new <${A.tagName.toLowerCase()}> needs a full page load`
|
|
1570
|
+
);
|
|
1571
|
+
R.push({ next: A });
|
|
1572
|
+
return;
|
|
1573
|
+
}
|
|
1574
|
+
x[L] = !0, R.push(K(g[L], d[L], A));
|
|
1575
|
+
});
|
|
1576
|
+
const _ = [];
|
|
1577
|
+
return d.forEach((A, T) => {
|
|
1578
|
+
if (!x[T]) {
|
|
1579
|
+
if (y(A))
|
|
1580
|
+
throw w(
|
|
1581
|
+
`removing <${A.tagName.toLowerCase()}> needs a full page load`
|
|
1582
|
+
);
|
|
1583
|
+
_.push(g[T].outer);
|
|
1584
|
+
}
|
|
1585
|
+
}), {
|
|
1586
|
+
live: s,
|
|
1587
|
+
first: g.length ? g[0].outer : null,
|
|
1588
|
+
items: R,
|
|
1589
|
+
removed: _
|
|
1590
|
+
};
|
|
1591
|
+
}
|
|
1592
|
+
function S() {
|
|
1593
|
+
const s = Array.from(n.head.children), a = Array.from(t.head.children);
|
|
1594
|
+
if (s.length !== a.length)
|
|
1595
|
+
throw w("the page head changed");
|
|
1596
|
+
let c = null;
|
|
1597
|
+
for (let d = 0; d < s.length; d++) {
|
|
1598
|
+
const E = s[d], g = a[d];
|
|
1599
|
+
if (!E.isEqualNode(g)) {
|
|
1600
|
+
if (E.tagName === "TITLE" && g.tagName === "TITLE")
|
|
1601
|
+
c = g.textContent ?? "";
|
|
1602
|
+
else if (E.tagName !== "META" || g.tagName !== "META")
|
|
1603
|
+
throw w("the page head changed");
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
return c;
|
|
1607
|
+
}
|
|
1608
|
+
function ne(s) {
|
|
1609
|
+
const { live: a, old: c, next: d } = s;
|
|
1610
|
+
for (const p of Array.from(c.attributes))
|
|
1611
|
+
p.name !== "class" && !d.hasAttributeNS(p.namespaceURI, p.localName) && a.removeAttributeNS(p.namespaceURI, p.localName);
|
|
1612
|
+
for (const p of Array.from(d.attributes))
|
|
1613
|
+
p.name !== "class" && c.getAttributeNS(p.namespaceURI, p.localName) !== p.value && a.setAttributeNS(p.namespaceURI, p.name, p.value);
|
|
1614
|
+
const E = Array.from(c.classList), g = Array.from(d.classList);
|
|
1615
|
+
for (const p of E)
|
|
1616
|
+
g.indexOf(p) === -1 && a.classList.remove(p);
|
|
1617
|
+
for (const p of g)
|
|
1618
|
+
E.indexOf(p) === -1 && a.classList.add(p);
|
|
1619
|
+
}
|
|
1620
|
+
const ye = [], le = [];
|
|
1621
|
+
function xe(s) {
|
|
1622
|
+
let a = null;
|
|
1623
|
+
for (const c of s.items) {
|
|
1624
|
+
if (!c.outer || c.replace) {
|
|
1625
|
+
const d = e.importNode(c.next, !0);
|
|
1626
|
+
c.outer ? (c.outer.replaceWith(d), le.push(c.outer)) : a ? a.after(d) : s.first ? s.first.before(d) : s.live.appendChild(d), ye.push(d), a = d;
|
|
1627
|
+
continue;
|
|
1628
|
+
}
|
|
1629
|
+
c.sub && xe(c.sub), a = c.outer;
|
|
1630
|
+
}
|
|
1631
|
+
for (const c of s.removed)
|
|
1632
|
+
c.remove(), le.push(c);
|
|
1633
|
+
}
|
|
1634
|
+
try {
|
|
1635
|
+
const s = S(), a = {
|
|
1636
|
+
live: e.documentElement,
|
|
1637
|
+
old: n.documentElement,
|
|
1638
|
+
next: t.documentElement
|
|
1639
|
+
};
|
|
1640
|
+
if (N(a.old, a.next) || f.push(a), !e.body || !$(n.body) || !$(t.body))
|
|
1641
|
+
throw w("the page body is not patchable");
|
|
1642
|
+
const c = h(e.body, n.body, t.body);
|
|
1643
|
+
if (!c)
|
|
1644
|
+
throw w("the live page no longer matches the previous render");
|
|
1645
|
+
return N(n.body, t.body) || f.push({ live: e.body, old: n.body, next: t.body }), f.forEach(ne), xe(c), s !== null && e.title !== s && (e.title = s), { ok: !0, added: ye, removed: le, attributeUpdates: f.length };
|
|
1646
|
+
} catch (s) {
|
|
1647
|
+
if (b(s))
|
|
1648
|
+
return {
|
|
1649
|
+
ok: !1,
|
|
1650
|
+
reason: s.bail,
|
|
1651
|
+
added: [],
|
|
1652
|
+
removed: [],
|
|
1653
|
+
attributeUpdates: 0
|
|
1654
|
+
};
|
|
1655
|
+
throw s;
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
function Qn(e, n) {
|
|
1659
|
+
const t = e.MathJax, r = t && t.startup;
|
|
1660
|
+
if (!t || !r || !r.promise || typeof t.typesetPromise != "function")
|
|
1661
|
+
return Promise.resolve();
|
|
1662
|
+
const i = [];
|
|
1663
|
+
for (const u of n.added)
|
|
1664
|
+
u.matches(".process-math") ? i.push(u) : i.push(...Array.from(u.querySelectorAll(".process-math")));
|
|
1665
|
+
const o = n.removed;
|
|
1666
|
+
if (i.length === 0 && o.length === 0)
|
|
1667
|
+
return Promise.resolve();
|
|
1668
|
+
const l = r.promise.then(() => (o.length && typeof t.typesetClear == "function" && t.typesetClear(o), i.length && t.typesetPromise ? t.typesetPromise(i) : void 0)).then(
|
|
1669
|
+
() => {
|
|
1670
|
+
},
|
|
1671
|
+
(u) => {
|
|
1672
|
+
console.error("pretext-html: typesetting a live patch failed", u);
|
|
1673
|
+
}
|
|
1674
|
+
);
|
|
1675
|
+
return r.promise = l, l;
|
|
1676
|
+
}
|
|
1677
|
+
function lr() {
|
|
1678
|
+
return [
|
|
1679
|
+
"<script>",
|
|
1680
|
+
`window[${JSON.stringify(qn)}] = {`,
|
|
1681
|
+
` patchDocument: ${Zn.toString()},`,
|
|
1682
|
+
` typeset: ${Qn.toString()}`,
|
|
1683
|
+
"};",
|
|
1684
|
+
"<\/script>"
|
|
1685
|
+
].join(`
|
|
1686
|
+
`);
|
|
1347
1687
|
}
|
|
1348
1688
|
export {
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1689
|
+
qn as LIVE_PATCH_GLOBAL,
|
|
1690
|
+
ct as PREVIEW_BANNER_STORAGE_KEY,
|
|
1691
|
+
Ze as PREVIEW_THEME_MESSAGE,
|
|
1692
|
+
Ut as PRINT_PREVIEW_GLOBAL,
|
|
1693
|
+
Mn as defaultXslDir,
|
|
1694
|
+
En as detectRenderTarget,
|
|
1695
|
+
or as findSourceMapEntry,
|
|
1696
|
+
qt as forcePortablePublication,
|
|
1697
|
+
wt as injectPreviewBanner,
|
|
1698
|
+
Jt as injectPrintPreview,
|
|
1699
|
+
fn as injectRevealBridge,
|
|
1700
|
+
xn as injectThemeBridge,
|
|
1701
|
+
Cn as isJspiAvailable,
|
|
1702
|
+
sr as isPreviewTheme,
|
|
1703
|
+
ir as isRevealView,
|
|
1704
|
+
Ve as listPrintouts,
|
|
1705
|
+
lr as livePatchScript,
|
|
1706
|
+
_t as openBornHiddenKnowls,
|
|
1707
|
+
Zn as patchDocument,
|
|
1708
|
+
ft as previewBannerScript,
|
|
1709
|
+
ar as previewThemeMessage,
|
|
1710
|
+
Ft as printPreviewBridgeScript,
|
|
1711
|
+
cr as renderHtml,
|
|
1712
|
+
an as revealBridgeScript,
|
|
1713
|
+
jt as rootPrintoutId,
|
|
1714
|
+
nr as setAssetsBase,
|
|
1715
|
+
rr as setMountReader,
|
|
1716
|
+
yn as themeBridgeScript,
|
|
1717
|
+
Qn as typesetPatch,
|
|
1718
|
+
Y as xpathStringLiteral
|
|
1375
1719
|
};
|