orz-slides 0.1.1 → 0.3.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/README.md CHANGED
@@ -9,7 +9,7 @@ syntax, and stays *quietly editable*. Built on
9
9
  One file. Open it in a browser to present. Pop out a per-slide editor to change
10
10
  a slide. Save it back in place. Nothing to install for the audience.
11
11
 
12
- > **Status: published (v0.1.0).** The authoring syntax, CLI, engine, and in-file
12
+ > **Status: published (v0.1.1).** The authoring syntax, CLI, engine, and in-file
13
13
  > editor all work (see [DESIGN.md](./DESIGN.md)). Two packages publish in
14
14
  > lockstep: the [`orz-slides`](https://www.npmjs.com/package/orz-slides) CLI and
15
15
  > the [`orz-slides-browser`](https://www.npmjs.com/package/orz-slides-browser)
@@ -178,6 +178,15 @@ A deck that uses math/diagrams/charts needs internet for those content
178
178
  libraries, cached after first open. With `--inline` (default), the engine,
179
179
  reveal's core CSS, and all themes are embedded.
180
180
 
181
+ ## Host embedding
182
+
183
+ `.slides.html` files conform to **`orz-host-save@1`**: a platform can embed a
184
+ deck in an iframe, announce itself with a `postMessage` handshake, and receive
185
+ saves (`{ source, html }`) instead of the file-system path — standalone
186
+ behavior and Export are unchanged, and nothing activates without the
187
+ handshake. The canonical spec lives in the orz-mdhtml repo:
188
+ [PROTOCOL.md](https://github.com/wangyu16/orz-mdhtml/blob/main/PROTOCOL.md).
189
+
181
190
  ## Security — treat these as programs, not documents
182
191
 
183
192
  A `.slides.html` is **self-contained executable HTML**: opening one runs the
package/assets/app.js CHANGED
@@ -299,8 +299,59 @@
299
299
  }
300
300
 
301
301
  // ---- dirty / save (self-reproducing) -------------------------------------
302
- function markDirty() { if (!dirty) { dirty = true; root.setAttribute('data-dirty', '1'); } }
303
- function clearDirty() { dirty = false; root.setAttribute('data-dirty', '0'); }
302
+ function markDirty() { if (!dirty) { dirty = true; root.setAttribute('data-dirty', '1'); hostPostDirty(true); } }
303
+ function clearDirty() { if (dirty) hostPostDirty(false); dirty = false; root.setAttribute('data-dirty', '0'); }
304
+
305
+ // ---- host embedding (orz-host-save@1) -------------------------------------
306
+ // When a platform embeds this file in an iframe and announces the
307
+ // orz-host-save protocol (spec: PROTOCOL.md in the orz-mdhtml repo), Save
308
+ // posts the document to the host instead of touching the file system. Never
309
+ // enabled without the host's hello; protocol messages are accepted only from
310
+ // window.parent, and after the handshake only from the recorded host origin.
311
+ // Message content is read as data, never evaluated. Export keeps working.
312
+ var HOST_PROTOCOL = 'orz-host-save';
313
+ var HOST_VERSION = 1;
314
+ var hostOrigin = null; // recorded at handshake; null = unhosted
315
+ var hostSaveTimer = null; // watchdog for a save awaiting acknowledgement
316
+
317
+ function isHosted() { return hostOrigin !== null; }
318
+ // An opaque embedder (sandboxed/srcdoc host) serializes as the string 'null',
319
+ // which postMessage rejects as a targetOrigin — fall back to '*' (the payload
320
+ // contains nothing the host doesn't already have).
321
+ function hostTarget() { return hostOrigin && hostOrigin !== 'null' ? hostOrigin : '*'; }
322
+ function hostPost(msg) { try { window.parent.postMessage(msg, hostTarget()); } catch (e) {} }
323
+ function hostPostDirty(d) {
324
+ if (!isHosted()) return;
325
+ hostPost({ type: 'orz-host-dirty', protocol: HOST_PROTOCOL, version: HOST_VERSION, dirty: !!d });
326
+ }
327
+ function hostSave(src, html) {
328
+ if (hostSaveTimer) return; // one save in flight at a time
329
+ hostSaveTimer = setTimeout(function () {
330
+ hostSaveTimer = null;
331
+ toast('Save failed — no response from the host'); // document intact, still dirty
332
+ }, 10000);
333
+ hostPost({ type: 'orz-host-save', protocol: HOST_PROTOCOL, version: HOST_VERSION, source: src, html: html });
334
+ }
335
+ function onHostMessage(event) {
336
+ // only the embedding parent may speak the protocol
337
+ if (window.parent === window || event.source !== window.parent) return;
338
+ var d = event.data;
339
+ if (!d || typeof d !== 'object') return;
340
+ // after the handshake, hold the parent to the origin it introduced itself with
341
+ if (isHosted() && hostOrigin !== 'null' && event.origin !== hostOrigin) return;
342
+ if (d.type === 'orz-host-hello' && d.protocol === HOST_PROTOCOL && typeof d.version === 'number' && d.version >= 1) {
343
+ hostOrigin = event.origin;
344
+ // reply with the highest version we support ≤ the host's (we speak only 1)
345
+ hostPost({ type: 'orz-host-ready', protocol: HOST_PROTOCOL, version: HOST_VERSION, kind: 'slides' });
346
+ if (dirty) hostPostDirty(true); // catch the host up on edits made pre-handshake
347
+ } else if (d.type === 'orz-host-saved' && hostSaveTimer) {
348
+ clearTimeout(hostSaveTimer); hostSaveTimer = null;
349
+ if (d.ok) { clearDirty(); toast('Saved'); }
350
+ else { toast('Save failed' + (d.error ? ' — ' + String(d.error) : '')); }
351
+ }
352
+ }
353
+ // listen from script load so an early hello isn't missed
354
+ window.addEventListener('message', onHostMessage);
304
355
 
305
356
  function serializeDoc() {
306
357
  var clone = root.cloneNode(true);
@@ -372,6 +423,9 @@
372
423
  function save() {
373
424
  if (cm) { slides[curIndex] = cm.getValue(); writeDeck(); }
374
425
  var html = serializeDoc();
426
+ // A hosting platform (verified handshake) receives the save instead of the
427
+ // file system; the host acknowledges with orz-host-saved (see PROTOCOL.md).
428
+ if (isHosted()) { hostSave(fullSource(), html); return; }
375
429
  if (isServed() && !fileHandle) { if (dirty) showServedNote(); return; }
376
430
  if (window.showSaveFilePicker) {
377
431
  acquireHandle()
@@ -0,0 +1 @@
1
+ export {};
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js CHANGED
@@ -12,64 +12,19 @@
12
12
  * --inline embed the engine bundle + theme CSS in the file (default)
13
13
  * --cdn reference the engine + theme from jsDelivr (small files)
14
14
  * --title <text> document <title> (fallback; deck `title:` wins)
15
+ *
16
+ * The inline path (the default) is shared with the programmatic library entry
17
+ * `buildSlidesHtml` (src/lib.ts) — there is ONE composition path. The CDN path
18
+ * lives here.
15
19
  */
16
- import { readFileSync, writeFileSync, existsSync } from 'node:fs';
20
+ import { readFileSync, writeFileSync } from 'node:fs';
17
21
  import { basename, extname, dirname, resolve, join } from 'node:path';
18
- import { fileURLToPath } from 'node:url';
19
- import { createRequire } from 'node:module';
20
22
  import { randomUUID } from 'node:crypto';
21
23
  import { getBrowserRuntimeScript } from 'orz-markdown/runtime';
22
24
  import { PREVIEW_CDN } from 'orz-markdown/preview-frame';
23
25
  import { parseDeck } from './slide-parser.js';
24
26
  import { buildHtml } from './template.js';
25
- /** The seven shipped slide themes (served from the orz-slides package on CDN). */
26
- const THEME_DEFS = [
27
- { id: 'paper', name: 'Paper', scheme: 'light' },
28
- { id: 'architect', name: 'Architect', scheme: 'light' },
29
- { id: 'executive', name: 'Executive', scheme: 'light' },
30
- { id: 'sage', name: 'Sage', scheme: 'light' },
31
- { id: 'poppy', name: 'Poppy', scheme: 'light' },
32
- { id: 'neon', name: 'Neon', scheme: 'dark' },
33
- { id: 'chalk', name: 'Chalk', scheme: 'dark' },
34
- ];
35
- const require = createRequire(import.meta.url);
36
- const HERE = dirname(fileURLToPath(import.meta.url));
37
- function pkgVersion(name, fallback = '0.0.0') {
38
- try {
39
- let dir = dirname(require.resolve(name));
40
- while (!existsSync(join(dir, 'package.json')))
41
- dir = dirname(dir);
42
- return JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8')).version || fallback;
43
- }
44
- catch {
45
- return fallback;
46
- }
47
- }
48
- /** orz-slides' own version — pins the engine bundle + theme CDN + version check. */
49
- function selfVersion() {
50
- for (const p of [join(HERE, '..', 'package.json'), join(HERE, '..', '..', 'package.json')]) {
51
- try {
52
- const j = JSON.parse(readFileSync(p, 'utf8'));
53
- if (j.name === 'orz-slides' && j.version)
54
- return j.version;
55
- }
56
- catch { /* keep looking */ }
57
- }
58
- return '0.0.0';
59
- }
60
- /** assets/ sits next to dist/ when published, and next to src/ in dev. */
61
- function findAsset(rel) {
62
- for (const p of [join(HERE, '..', 'assets', rel), join(HERE, '..', '..', 'assets', rel)]) {
63
- if (existsSync(p))
64
- return p;
65
- }
66
- throw new Error(`asset not found: ${rel}`);
67
- }
68
- /** A theme's CSS without its `@import url('./base.css')` (base is inlined once). */
69
- function themeOnly(id) {
70
- const css = readFileSync(findAsset(`themes/theme-${id}.css`), 'utf8');
71
- return css.replace(/@import\s+url\(\s*['"]?\.\/base\.css['"]?\s*\)\s*;/, '');
72
- }
27
+ import { THEME_DEFS, selfVersion, findAsset, pkgVersion, buildSlidesHtmlWithDocId, } from './lib.js';
73
28
  function parseArgs(argv) {
74
29
  const a = { delivery: 'inline' };
75
30
  for (let i = 0; i < argv.length; i++) {
@@ -89,74 +44,26 @@ function parseArgs(argv) {
89
44
  }
90
45
  return a;
91
46
  }
92
- function main() {
93
- const args = parseArgs(process.argv.slice(2));
94
- if (!args.input) {
95
- console.error('Usage: orz-slides <input.md> [-o out] [--theme name] [--inline|--cdn]');
96
- process.exit(1);
97
- }
98
- const inputPath = resolve(args.input);
99
- const source = readFileSync(inputPath, 'utf8');
100
- const base = basename(inputPath, extname(inputPath)).replace(/\.slides$/, '');
101
- const outPath = args.out ? resolve(args.out) : join(dirname(inputPath), `${base}.slides.html`);
102
- // The deck's own config wins; CLI flags are fallbacks.
103
- const deck = parseDeck(source);
104
- const ver = selfVersion();
105
- const themeBase = `https://cdn.jsdelivr.net/npm/orz-slides@${ver}/assets/themes`;
106
- const themes = THEME_DEFS.map((t) => ({ ...t, href: `${themeBase}/theme-${t.id}.css` }));
107
- const wanted = deck.config.theme || args.theme || 'paper';
108
- const defaultTheme = themes.some((t) => t.id === wanted) ? wanted : themes[0].id;
109
- const ratio = deck.config.ratio || '16:9';
110
- const title = deck.config.title || args.title || base;
111
- // Engine + theme delivery.
112
- let renderer;
113
- let theme;
114
- if (args.delivery === 'inline') {
115
- const bundlePath = [
116
- join(HERE, 'orz-slides.browser.js'),
117
- join(HERE, '..', 'dist', 'orz-slides.browser.js'),
118
- ].find(existsSync);
119
- if (!bundlePath) {
120
- console.error('Inline mode needs the engine bundle. Run: npm run bundle');
121
- process.exit(1);
122
- }
123
- renderer = { mode: 'inline', js: readFileSync(bundlePath, 'utf8') };
124
- theme = {
125
- mode: 'inline',
126
- base: readFileSync(findAsset('themes/base.css'), 'utf8'),
127
- themes: THEME_DEFS.map((t) => ({ id: t.id, css: themeOnly(t.id) })),
128
- };
129
- }
130
- else {
131
- renderer = { mode: 'cdn', src: `https://cdn.jsdelivr.net/npm/orz-slides-browser@${ver}/orz-slides.browser.js` };
132
- theme = { mode: 'cdn' };
133
- }
47
+ /** The CDN delivery path (engine + themes referenced from jsDelivr). */
48
+ function buildCdnHtml(source, title, base, docId, ver, themes, defaultTheme, ratio) {
49
+ const renderer = {
50
+ mode: 'cdn',
51
+ src: `https://cdn.jsdelivr.net/npm/orz-slides-browser@${ver}/orz-slides.browser.js`,
52
+ };
53
+ const theme = { mode: 'cdn' };
134
54
  const revealVer = pkgVersion('reveal.js', '5.0.4');
135
- // reveal's reset.css + reveal.css contain only data: URIs (no external refs),
136
- // so --inline embeds them and the deck presents fully offline.
137
- let revealCss;
138
- if (args.delivery === 'inline') {
139
- const revealDist = dirname(require.resolve('reveal.js'));
140
- revealCss = {
141
- mode: 'inline',
142
- reset: readFileSync(join(revealDist, 'reset.css'), 'utf8'),
143
- core: readFileSync(join(revealDist, 'reveal.css'), 'utf8'),
144
- };
145
- }
146
- else {
147
- revealCss = {
148
- mode: 'cdn',
149
- resetUrl: `https://cdn.jsdelivr.net/npm/reveal.js@${revealVer}/dist/reset.css`,
150
- coreUrl: `https://cdn.jsdelivr.net/npm/reveal.js@${revealVer}/dist/reveal.css`,
151
- };
152
- }
55
+ const revealCss = {
56
+ mode: 'cdn',
57
+ resetUrl: `https://cdn.jsdelivr.net/npm/reveal.js@${revealVer}/dist/reset.css`,
58
+ coreUrl: `https://cdn.jsdelivr.net/npm/reveal.js@${revealVer}/dist/reveal.css`,
59
+ };
153
60
  const appJs = readFileSync(findAsset('app.js'), 'utf8');
154
61
  const CM = 'https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16';
155
- const html = buildHtml({
62
+ return buildHtml({
156
63
  source,
157
64
  title,
158
65
  filename: base,
159
- docId: randomUUID(),
66
+ docId,
160
67
  rendererVersion: ver,
161
68
  renderer,
162
69
  theme,
@@ -182,6 +89,39 @@ function main() {
182
89
  chartJs: PREVIEW_CDN.chartJs,
183
90
  },
184
91
  });
92
+ }
93
+ function main() {
94
+ const args = parseArgs(process.argv.slice(2));
95
+ if (!args.input) {
96
+ console.error('Usage: orz-slides <input.md> [-o out] [--theme name] [--inline|--cdn]');
97
+ process.exit(1);
98
+ }
99
+ const inputPath = resolve(args.input);
100
+ const source = readFileSync(inputPath, 'utf8');
101
+ const base = basename(inputPath, extname(inputPath)).replace(/\.slides$/, '');
102
+ const outPath = args.out ? resolve(args.out) : join(dirname(inputPath), `${base}.slides.html`);
103
+ const deck = parseDeck(source);
104
+ const docId = randomUUID();
105
+ // Resolve the effective (validated) theme once, for the log line and CDN path.
106
+ const wanted = deck.config.theme || args.theme || 'paper';
107
+ const defaultTheme = THEME_DEFS.some((t) => t.id === wanted) ? wanted : THEME_DEFS[0].id;
108
+ let html;
109
+ if (args.delivery === 'inline') {
110
+ // Shared inline composition — the library and the CLI produce byte-identical
111
+ // output for the same source (modulo docId). The deck-config precedence and
112
+ // the 'Untitled' fallbacks live in lib.ts; the CLI passes its filename-based
113
+ // title as the fallback so the deck's own title still wins.
114
+ html = buildSlidesHtmlWithDocId({ markdown: source, title: args.title ?? base, theme: args.theme }, docId);
115
+ }
116
+ else {
117
+ // The deck's own config wins; CLI flags are fallbacks.
118
+ const ver = selfVersion();
119
+ const themeBase = `https://cdn.jsdelivr.net/npm/orz-slides@${ver}/assets/themes`;
120
+ const themes = THEME_DEFS.map((t) => ({ ...t, href: `${themeBase}/theme-${t.id}.css` }));
121
+ const ratio = deck.config.ratio || '16:9';
122
+ const title = deck.config.title || args.title || base;
123
+ html = buildCdnHtml(source, title, base, docId, ver, themes, defaultTheme, ratio);
124
+ }
185
125
  writeFileSync(outPath, html, 'utf8');
186
126
  console.log(`Wrote ${outPath} (${args.delivery}, theme: ${defaultTheme}, ${deck.slides.length} slides)`);
187
127
  }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * WP2 — Layout engine. Layout tree → nested CSS-grid DOM.
3
+ *
4
+ * Takes a fully-expanded `LayoutNode` (the parser has already expanded any
5
+ * preset alias), so this module depends only on ./types — nothing else.
6
+ * Pure string building; no DOM API.
7
+ *
8
+ * See BUILD-PLAN.md WP2 and docs/dom-contract.md ("Layout grid (WP2 output)").
9
+ */
10
+ import type { LayoutNode, GridRender } from './types.js';
11
+ /**
12
+ * Render a layout tree to nested grid DOM with empty region cells.
13
+ * Returns the inner HTML for `.orz-content` and the region names in order.
14
+ */
15
+ export declare function renderLayout(node: LayoutNode): GridRender;
package/dist/lib.d.ts ADDED
@@ -0,0 +1,39 @@
1
+ import { type ThemeEntry } from './template.js';
2
+ /** The seven shipped slide themes (served from the orz-slides package on CDN). */
3
+ export declare const THEME_DEFS: Array<Omit<ThemeEntry, 'href'>>;
4
+ export declare function pkgVersion(name: string, fallback?: string): string;
5
+ /** orz-slides' own version — pins the engine bundle + theme CDN + version check. */
6
+ export declare function selfVersion(): string;
7
+ /** assets/ sits next to dist/ when published, and next to src/ in dev. */
8
+ export declare function findAsset(rel: string): string;
9
+ /** A theme's CSS without its `@import url('./base.css')` (base is inlined once). */
10
+ export declare function themeOnly(id: string): string;
11
+ export interface BuildSlidesOptions {
12
+ /** The deck source (orz-markdown + slide layout syntax). */
13
+ markdown: string;
14
+ /** Document `<title>` fallback; the deck's own `title:` wins. */
15
+ title?: string;
16
+ /** Theme id fallback; the deck's own `theme:` wins. Validated against THEME_DEFS. */
17
+ theme?: string;
18
+ }
19
+ /**
20
+ * Shared inline-composition path. Both {@link buildSlidesHtml} and the CLI's
21
+ * `--inline` branch call this; the ONLY difference between them is the `docId`
22
+ * they pass, so with the same `docId` the outputs are byte-identical.
23
+ *
24
+ * @internal — exported for tests / the CLI, not part of the primary API surface.
25
+ */
26
+ export declare function buildSlidesHtmlWithDocId(opts: BuildSlidesOptions, docId: string): string;
27
+ /**
28
+ * Generate a fully self-contained, presentable `.slides.html` document from a
29
+ * deck source string, in-process. Returns the FULL document string.
30
+ *
31
+ * The output is always fully-inline (engine + base/theme CSS + reveal CSS +
32
+ * embedded deck source), byte-identical to the CLI `--inline` output for the
33
+ * same markdown/title/theme (modulo the random docId).
34
+ *
35
+ * Deck-config precedence: the deck's own `title:`/`theme:`/`ratio:` always win;
36
+ * `opts.title`/`opts.theme` are fallbacks (title falls back to `'Untitled'`,
37
+ * theme to `'paper'`, validated against THEME_DEFS).
38
+ */
39
+ export declare function buildSlidesHtml(opts: BuildSlidesOptions): string;
package/dist/lib.js ADDED
@@ -0,0 +1,177 @@
1
+ /**
2
+ * orz-slides — programmatic library entry.
3
+ *
4
+ * Exposes {@link buildSlidesHtml}, which generates a fully self-contained,
5
+ * presentable `.slides.html` document IN-PROCESS from a deck source string
6
+ * (orz-markdown + the slide layout syntax) — no CLI, no shelling out, no
7
+ * filesystem input file.
8
+ *
9
+ * The output is ALWAYS fully-inline (inlined engine bundle + inlined base/theme
10
+ * CSS + inlined reveal.js CSS + embedded deck source; no CDN engine/theme pins),
11
+ * byte-identical to the CLI `--inline` path for the same markdown/title/theme
12
+ * (modulo the random docId).
13
+ *
14
+ * This module also owns the shared inline-composition helpers (`selfVersion`,
15
+ * `findAsset`, `themeOnly`, `THEME_DEFS`, reveal.js CSS reading, `pkgVersion`)
16
+ * so there is ONE composition path and the CLI imports them rather than
17
+ * duplicating the logic.
18
+ *
19
+ * Asset resolution is ALWAYS via `import.meta.url` (never `process.cwd()`), so
20
+ * the entry works when consumed from an installed npm package.
21
+ */
22
+ import { readFileSync, existsSync } from 'node:fs';
23
+ import { dirname, join } from 'node:path';
24
+ import { fileURLToPath } from 'node:url';
25
+ import { createRequire } from 'node:module';
26
+ import { randomUUID } from 'node:crypto';
27
+ import { getBrowserRuntimeScript } from 'orz-markdown/runtime';
28
+ import { PREVIEW_CDN } from 'orz-markdown/preview-frame';
29
+ import { parseDeck } from './slide-parser.js';
30
+ import { buildHtml } from './template.js';
31
+ /** The seven shipped slide themes (served from the orz-slides package on CDN). */
32
+ export const THEME_DEFS = [
33
+ { id: 'paper', name: 'Paper', scheme: 'light' },
34
+ { id: 'architect', name: 'Architect', scheme: 'light' },
35
+ { id: 'executive', name: 'Executive', scheme: 'light' },
36
+ { id: 'sage', name: 'Sage', scheme: 'light' },
37
+ { id: 'poppy', name: 'Poppy', scheme: 'light' },
38
+ { id: 'neon', name: 'Neon', scheme: 'dark' },
39
+ { id: 'chalk', name: 'Chalk', scheme: 'dark' },
40
+ ];
41
+ const require = createRequire(import.meta.url);
42
+ // Asset resolution anchors on THIS module's location, never process.cwd().
43
+ const HERE = dirname(fileURLToPath(import.meta.url));
44
+ export function pkgVersion(name, fallback = '0.0.0') {
45
+ try {
46
+ let dir = dirname(require.resolve(name));
47
+ while (!existsSync(join(dir, 'package.json')))
48
+ dir = dirname(dir);
49
+ return JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8')).version || fallback;
50
+ }
51
+ catch {
52
+ return fallback;
53
+ }
54
+ }
55
+ /** orz-slides' own version — pins the engine bundle + theme CDN + version check. */
56
+ export function selfVersion() {
57
+ for (const p of [join(HERE, '..', 'package.json'), join(HERE, '..', '..', 'package.json')]) {
58
+ try {
59
+ const j = JSON.parse(readFileSync(p, 'utf8'));
60
+ if (j.name === 'orz-slides' && j.version)
61
+ return j.version;
62
+ }
63
+ catch { /* keep looking */ }
64
+ }
65
+ return '0.0.0';
66
+ }
67
+ /** assets/ sits next to dist/ when published, and next to src/ in dev. */
68
+ export function findAsset(rel) {
69
+ for (const p of [join(HERE, '..', 'assets', rel), join(HERE, '..', '..', 'assets', rel)]) {
70
+ if (existsSync(p))
71
+ return p;
72
+ }
73
+ throw new Error(`asset not found: ${rel}`);
74
+ }
75
+ /** A theme's CSS without its `@import url('./base.css')` (base is inlined once). */
76
+ export function themeOnly(id) {
77
+ const css = readFileSync(findAsset(`themes/theme-${id}.css`), 'utf8');
78
+ return css.replace(/@import\s+url\(\s*['"]?\.\/base\.css['"]?\s*\)\s*;/, '');
79
+ }
80
+ /** The inlined engine bundle (dist/orz-slides.browser.js), read from disk. */
81
+ function readEngineBundle() {
82
+ const bundlePath = [
83
+ join(HERE, 'orz-slides.browser.js'),
84
+ join(HERE, '..', 'dist', 'orz-slides.browser.js'),
85
+ ].find(existsSync);
86
+ if (!bundlePath) {
87
+ throw new Error('Inline mode needs the engine bundle. Run: npm run bundle');
88
+ }
89
+ return readFileSync(bundlePath, 'utf8');
90
+ }
91
+ /** reveal.js reset.css + reveal.css (both contain only data: URIs — offline-safe). */
92
+ function readRevealCss() {
93
+ const revealDist = dirname(require.resolve('reveal.js'));
94
+ return {
95
+ reset: readFileSync(join(revealDist, 'reset.css'), 'utf8'),
96
+ core: readFileSync(join(revealDist, 'reveal.css'), 'utf8'),
97
+ };
98
+ }
99
+ /**
100
+ * Shared inline-composition path. Both {@link buildSlidesHtml} and the CLI's
101
+ * `--inline` branch call this; the ONLY difference between them is the `docId`
102
+ * they pass, so with the same `docId` the outputs are byte-identical.
103
+ *
104
+ * @internal — exported for tests / the CLI, not part of the primary API surface.
105
+ */
106
+ export function buildSlidesHtmlWithDocId(opts, docId) {
107
+ // The deck's own config wins; the passed options are fallbacks. The library
108
+ // has no input filename, so 'Untitled' stands in where the CLI used `base`.
109
+ const deck = parseDeck(opts.markdown);
110
+ const ver = selfVersion();
111
+ const themeBase = `https://cdn.jsdelivr.net/npm/orz-slides@${ver}/assets/themes`;
112
+ const themes = THEME_DEFS.map((t) => ({ ...t, href: `${themeBase}/theme-${t.id}.css` }));
113
+ const wanted = deck.config.theme || opts.theme || 'paper';
114
+ const defaultTheme = themes.some((t) => t.id === wanted) ? wanted : themes[0].id;
115
+ const ratio = deck.config.ratio || '16:9';
116
+ const title = deck.config.title || opts.title || 'Untitled';
117
+ // Engine + theme delivery — always fully inline.
118
+ const renderer = { mode: 'inline', js: readEngineBundle() };
119
+ const theme = {
120
+ mode: 'inline',
121
+ base: readFileSync(findAsset('themes/base.css'), 'utf8'),
122
+ themes: THEME_DEFS.map((t) => ({ id: t.id, css: themeOnly(t.id) })),
123
+ };
124
+ const reveal = readRevealCss();
125
+ const revealCss = {
126
+ mode: 'inline',
127
+ reset: reveal.reset,
128
+ core: reveal.core,
129
+ };
130
+ const appJs = readFileSync(findAsset('app.js'), 'utf8');
131
+ const CM = 'https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16';
132
+ return buildHtml({
133
+ source: opts.markdown,
134
+ title,
135
+ filename: 'Untitled',
136
+ docId,
137
+ rendererVersion: ver,
138
+ renderer,
139
+ theme,
140
+ defaultTheme,
141
+ themes,
142
+ ratio,
143
+ versionManifest: 'https://data.jsdelivr.com/v1/packages/npm/orz-slides-browser/resolved',
144
+ appJs,
145
+ runtime: getBrowserRuntimeScript(),
146
+ editorLibs: {
147
+ codemirrorCss: `${CM}/codemirror.min.css`,
148
+ codemirrorLightThemeCss: `${CM}/theme/eclipse.min.css`,
149
+ codemirrorDarkThemeCss: `${CM}/theme/material-darker.min.css`,
150
+ codemirrorJs: `${CM}/codemirror.min.js`,
151
+ codemirrorMarkdownJs: `${CM}/mode/markdown/markdown.min.js`,
152
+ codemirrorContinuelistJs: `${CM}/addon/edit/continuelist.min.js`,
153
+ },
154
+ revealCss,
155
+ cdn: {
156
+ katexCss: PREVIEW_CDN.katexCss,
157
+ mermaidJs: PREVIEW_CDN.mermaidJs,
158
+ smilesJs: PREVIEW_CDN.smilesJs,
159
+ chartJs: PREVIEW_CDN.chartJs,
160
+ },
161
+ });
162
+ }
163
+ /**
164
+ * Generate a fully self-contained, presentable `.slides.html` document from a
165
+ * deck source string, in-process. Returns the FULL document string.
166
+ *
167
+ * The output is always fully-inline (engine + base/theme CSS + reveal CSS +
168
+ * embedded deck source), byte-identical to the CLI `--inline` output for the
169
+ * same markdown/title/theme (modulo the random docId).
170
+ *
171
+ * Deck-config precedence: the deck's own `title:`/`theme:`/`ratio:` always win;
172
+ * `opts.title`/`opts.theme` are fallbacks (title falls back to `'Untitled'`,
173
+ * theme to `'paper'`, validated against THEME_DEFS).
174
+ */
175
+ export function buildSlidesHtml(opts) {
176
+ return buildSlidesHtmlWithDocId(opts, randomUUID());
177
+ }
@@ -373,7 +373,7 @@ ${JSON.stringify(i,null,2).replace(/<\/script>/gi,"<\\/script>")}
373
373
  <div class="r-overlay-help-content">${t}</div>
374
374
  </div>
375
375
  `,this.dom.querySelector(".r-overlay-close").addEventListener("click",i=>{this.close(),i.preventDefault()},!1),this.Reveal.dispatchEvent({type:"showhelp"})}}isOpen(){return!!this.dom}close(){return!!this.dom&&(this.dom.remove(),this.dom=null,this.state={},this.Reveal.dispatchEvent({type:"closeoverlay"}),!0)}getState(){return this.state}setState(t){this.stateProps.every(r=>this.state[r]===t[r])||(t.previewIframe?this.previewIframe(t.previewIframe):t.previewImage?this.previewImage(t.previewImage,t.previewFit):t.previewVideo?this.previewVideo(t.previewVideo,t.previewFit):this.close())}onSlidesClicked(t){let r=t.target,a=r.closest(this.iframeTriggerSelector),i=r.closest(this.mediaTriggerSelector);if(a){if(t.metaKey||t.shiftKey||t.altKey)return;let c=a.getAttribute("href")||a.getAttribute("data-preview-link");c&&(this.previewIframe(c),t.preventDefault())}else if(i){if(i.hasAttribute("data-preview-image")){let c=i.dataset.previewImage||i.getAttribute("src");c&&(this.previewImage(c,i.dataset.previewFit),t.preventDefault())}else if(i.hasAttribute("data-preview-video")){let c=i.dataset.previewVideo||i.getAttribute("src");if(!c){let d=i.querySelector("source");d&&(c=d.getAttribute("src"))}c&&(this.previewVideo(c,i.dataset.previewFit),t.preventDefault())}}}destroy(){this.close()}},io=class{constructor(t){this.Reveal=t,this.touchStartX=0,this.touchStartY=0,this.touchStartCount=0,this.touchCaptured=!1,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this)}bind(){let t=this.Reveal.getRevealElement();"onpointerdown"in window?(t.addEventListener("pointerdown",this.onPointerDown,!1),t.addEventListener("pointermove",this.onPointerMove,!1),t.addEventListener("pointerup",this.onPointerUp,!1)):window.navigator.msPointerEnabled?(t.addEventListener("MSPointerDown",this.onPointerDown,!1),t.addEventListener("MSPointerMove",this.onPointerMove,!1),t.addEventListener("MSPointerUp",this.onPointerUp,!1)):(t.addEventListener("touchstart",this.onTouchStart,!1),t.addEventListener("touchmove",this.onTouchMove,!1),t.addEventListener("touchend",this.onTouchEnd,!1))}unbind(){let t=this.Reveal.getRevealElement();t.removeEventListener("pointerdown",this.onPointerDown,!1),t.removeEventListener("pointermove",this.onPointerMove,!1),t.removeEventListener("pointerup",this.onPointerUp,!1),t.removeEventListener("MSPointerDown",this.onPointerDown,!1),t.removeEventListener("MSPointerMove",this.onPointerMove,!1),t.removeEventListener("MSPointerUp",this.onPointerUp,!1),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("touchend",this.onTouchEnd,!1)}isSwipePrevented(t){if(as(t,"video[controls], audio[controls]"))return!0;for(;t&&typeof t.hasAttribute=="function";){if(t.hasAttribute("data-prevent-swipe"))return!0;t=t.parentNode}return!1}onTouchStart(t){if(this.touchCaptured=!1,this.isSwipePrevented(t.target))return!0;this.touchStartX=t.touches[0].clientX,this.touchStartY=t.touches[0].clientY,this.touchStartCount=t.touches.length}onTouchMove(t){if(this.isSwipePrevented(t.target))return!0;let r=this.Reveal.getConfig();if(this.touchCaptured)Yu&&t.preventDefault();else{this.Reveal.onUserInput(t);let a=t.touches[0].clientX,i=t.touches[0].clientY;if(t.touches.length===1&&this.touchStartCount!==2){let c=this.Reveal.availableRoutes({includeFragments:!0}),d=a-this.touchStartX,u=i-this.touchStartY;d>40&&Math.abs(d)>Math.abs(u)?(this.touchCaptured=!0,r.navigationMode==="linear"?r.rtl?this.Reveal.next():this.Reveal.prev():this.Reveal.left()):d<-40&&Math.abs(d)>Math.abs(u)?(this.touchCaptured=!0,r.navigationMode==="linear"?r.rtl?this.Reveal.prev():this.Reveal.next():this.Reveal.right()):u>40&&c.up?(this.touchCaptured=!0,r.navigationMode==="linear"?this.Reveal.prev():this.Reveal.up()):u<-40&&c.down&&(this.touchCaptured=!0,r.navigationMode==="linear"?this.Reveal.next():this.Reveal.down()),r.embedded?(this.touchCaptured||this.Reveal.isVerticalSlide())&&t.preventDefault():t.preventDefault()}}}onTouchEnd(t){this.touchCaptured=!1}onPointerDown(t){t.pointerType!==t.MSPOINTER_TYPE_TOUCH&&t.pointerType!=="touch"||(t.touches=[{clientX:t.clientX,clientY:t.clientY}],this.onTouchStart(t))}onPointerMove(t){t.pointerType!==t.MSPOINTER_TYPE_TOUCH&&t.pointerType!=="touch"||(t.touches=[{clientX:t.clientX,clientY:t.clientY}],this.onTouchMove(t))}onPointerUp(t){t.pointerType!==t.MSPOINTER_TYPE_TOUCH&&t.pointerType!=="touch"||(t.touches=[{clientX:t.clientX,clientY:t.clientY}],this.onTouchEnd(t))}},Hi="focus",Gu="blur",oo=class{constructor(t){this.Reveal=t,this.onRevealPointerDown=this.onRevealPointerDown.bind(this),this.onDocumentPointerDown=this.onDocumentPointerDown.bind(this)}configure(t,r){t.embedded?this.blur():(this.focus(),this.unbind())}bind(){this.Reveal.getConfig().embedded&&this.Reveal.getRevealElement().addEventListener("pointerdown",this.onRevealPointerDown,!1)}unbind(){this.Reveal.getRevealElement().removeEventListener("pointerdown",this.onRevealPointerDown,!1),document.removeEventListener("pointerdown",this.onDocumentPointerDown,!1)}focus(){this.state!==Hi&&(this.Reveal.getRevealElement().classList.add("focused"),document.addEventListener("pointerdown",this.onDocumentPointerDown,!1)),this.state=Hi}blur(){this.state!==Gu&&(this.Reveal.getRevealElement().classList.remove("focused"),document.removeEventListener("pointerdown",this.onDocumentPointerDown,!1)),this.state=Gu}isFocused(){return this.state===Hi}destroy(){this.Reveal.getRevealElement().classList.remove("focused")}onRevealPointerDown(t){this.focus()}onDocumentPointerDown(t){let r=gt(t.target,".reveal");r&&r===this.Reveal.getRevealElement()||this.blur()}},co=class{constructor(t){this.Reveal=t}render(){this.element=document.createElement("div"),this.element.className="speaker-notes",this.element.setAttribute("data-prevent-swipe",""),this.element.setAttribute("tabindex","0"),this.Reveal.getRevealElement().appendChild(this.element)}configure(t,r){t.showNotes&&this.element.setAttribute("data-layout",typeof t.showNotes=="string"?t.showNotes:"inline")}update(){this.Reveal.getConfig().showNotes&&this.element&&this.Reveal.getCurrentSlide()&&!this.Reveal.isScrollView()&&!this.Reveal.isPrintView()&&(this.element.innerHTML=this.getSlideNotes()||'<span class="notes-placeholder">No notes on this slide.</span>')}updateVisibility(){this.Reveal.getConfig().showNotes&&this.hasNotes()&&!this.Reveal.isScrollView()&&!this.Reveal.isPrintView()?this.Reveal.getRevealElement().classList.add("show-notes"):this.Reveal.getRevealElement().classList.remove("show-notes")}hasNotes(){return this.Reveal.getSlidesElement().querySelectorAll("[data-notes], aside.notes").length>0}isSpeakerNotesWindow(){return!!window.location.search.match(/receiver/gi)}getSlideNotes(t=this.Reveal.getCurrentSlide()){if(t.hasAttribute("data-notes"))return t.getAttribute("data-notes");let r=t.querySelectorAll("aside.notes");return r?Array.from(r).map(a=>a.innerHTML).join(`
376
- `):null}destroy(){this.element.remove()}},lo=class{constructor(t,r){this.diameter=100,this.diameter2=this.diameter/2,this.thickness=6,this.playing=!1,this.progress=0,this.progressOffset=1,this.container=t,this.progressCheck=r,this.canvas=document.createElement("canvas"),this.canvas.className="playback",this.canvas.width=this.diameter,this.canvas.height=this.diameter,this.canvas.style.width=this.diameter2+"px",this.canvas.style.height=this.diameter2+"px",this.context=this.canvas.getContext("2d"),this.container.appendChild(this.canvas),this.render()}setPlaying(t){let r=this.playing;this.playing=t,!r&&this.playing?this.animate():this.render()}animate(){let t=this.progress;this.progress=this.progressCheck(),t>.8&&this.progress<.2&&(this.progressOffset=this.progress),this.render(),this.playing&&requestAnimationFrame(this.animate.bind(this))}render(){let t=this.playing?this.progress:0,r=this.diameter2-this.thickness,a=this.diameter2,i=this.diameter2,c=28;this.progressOffset+=.1*(1-this.progressOffset);let d=-Math.PI/2+t*(2*Math.PI),u=-Math.PI/2+this.progressOffset*(2*Math.PI);this.context.save(),this.context.clearRect(0,0,this.diameter,this.diameter),this.context.beginPath(),this.context.arc(a,i,r+4,0,2*Math.PI,!1),this.context.fillStyle="rgba( 0, 0, 0, 0.4 )",this.context.fill(),this.context.beginPath(),this.context.arc(a,i,r,0,2*Math.PI,!1),this.context.lineWidth=this.thickness,this.context.strokeStyle="rgba( 255, 255, 255, 0.2 )",this.context.stroke(),this.playing&&(this.context.beginPath(),this.context.arc(a,i,r,u,d,!1),this.context.lineWidth=this.thickness,this.context.strokeStyle="#fff",this.context.stroke()),this.context.translate(a-14,i-14),this.playing?(this.context.fillStyle="#fff",this.context.fillRect(0,0,10,c),this.context.fillRect(18,0,10,c)):(this.context.beginPath(),this.context.translate(4,0),this.context.moveTo(0,0),this.context.lineTo(24,14),this.context.lineTo(0,c),this.context.fillStyle="#fff",this.context.fill()),this.context.restore()}on(t,r){this.canvas.addEventListener(t,r,!1)}off(t,r){this.canvas.removeEventListener(t,r,!1)}destroy(){this.playing=!1,this.canvas.parentNode&&this.container.removeChild(this.canvas)}},Cy={width:960,height:700,margin:.04,minScale:.2,maxScale:2,controls:!0,controlsTutorial:!0,controlsLayout:"bottom-right",controlsBackArrows:"faded",progress:!0,slideNumber:!1,showSlideNumber:"all",hashOneBasedIndex:!1,hash:!1,respondToHashChanges:!0,jumpToSlide:!0,history:!1,keyboard:!0,keyboardCondition:null,disableLayout:!1,overview:!0,center:!0,touch:!0,loop:!1,rtl:!1,navigationMode:"default",shuffle:!1,fragments:!0,fragmentInURL:!0,embedded:!1,help:!0,pause:!0,showNotes:!1,showHiddenSlides:!1,autoPlayMedia:null,preloadIframes:null,autoAnimate:!0,autoAnimateMatcher:null,autoAnimateEasing:"ease",autoAnimateDuration:1,autoAnimateUnmatched:!0,autoAnimateStyles:["opacity","color","background-color","padding","font-size","line-height","letter-spacing","border-width","border-color","border-radius","outline","outline-offset"],autoSlide:0,autoSlideStoppable:!0,autoSlideMethod:null,defaultTiming:null,mouseWheel:!1,previewLinks:!1,postMessage:!0,postMessageEvents:!1,focusBodyOnPageVisibilityChange:!0,transition:"slide",transitionSpeed:"default",backgroundTransition:"fade",parallaxBackgroundImage:"",parallaxBackgroundSize:"",parallaxBackgroundRepeat:"",parallaxBackgroundPosition:"",parallaxBackgroundHorizontal:null,parallaxBackgroundVertical:null,view:null,scrollLayout:"full",scrollSnap:"mandatory",scrollProgress:"auto",scrollActivationWidth:435,pdfMaxPagesPerSlide:Number.POSITIVE_INFINITY,pdfSeparateFragments:!0,pdfPageHeightOffset:-1,viewDistance:3,mobileViewDistance:2,display:"block",hideInactiveCursor:!0,hideCursorTime:5e3,sortFragmentsOnSync:!0,dependencies:[],plugins:[]},Ju="5.2.1";function Qu(e,t){arguments.length<2&&(t=arguments[0],e=document.querySelector(".reveal"));let r={},a,i,c,d,u,f={},k=!1,w=!1,x={hasNavigatedHorizontally:!1,hasNavigatedVertically:!1},h=[],g=1,z={layout:"",overview:""},E={},B="idle",H=0,O=0,X=-1,$=!1,V=new Ui(r),G=new Vi(r),ee=new Wi(r),le=new Xi(r),ie=new Gi(r),I=new Zi(r),de=new Ki(r),ke=new Yi(r),ve=new Ji(r),Ee=new Qi(r),Le=new eo(r),ce=new to(r),ht=new ro(r),Tr=new ao(r),yt=new no(r),Ve=new so(r),wt=new oo(r),ba=new io(r),St=new co(r);function os(){k!==!1&&(w=!0,f.showHiddenSlides||me(E.wrapper,'section[data-visibility="hidden"]').forEach(R=>{let j=R.parentNode;j.childElementCount===1&&/section/i.test(j.nodeName)?j.remove():R.remove()}),function(){E.slides.classList.add("no-transition"),ga?E.wrapper.classList.add("no-hover"):E.wrapper.classList.remove("no-hover"),ie.render(),G.render(),ee.render(),ce.render(),ht.render(),St.render(),E.pauseOverlay=((R,j,Y,Q="")=>{let re=R.querySelectorAll("."+Y);for(let Ae=0;Ae<re.length;Ae++){let Be=re[Ae];if(Be.parentNode===R)return Be}let ye=document.createElement(j);return ye.className=Y,ye.innerHTML=Q,R.appendChild(ye),ye})(E.wrapper,"div","pause-overlay",f.controls?'<button class="resume-button">Resume presentation</button>':null),E.statusElement=function(){let R=E.wrapper.querySelector(".aria-status");return R||(R=document.createElement("div"),R.style.position="absolute",R.style.height="1px",R.style.width="1px",R.style.overflow="hidden",R.style.clip="rect( 1px, 1px, 1px, 1px )",R.classList.add("aria-status"),R.setAttribute("aria-live","polite"),R.setAttribute("aria-atomic","true"),E.wrapper.appendChild(R)),R}(),E.wrapper.setAttribute("role","application")}(),f.postMessage&&window.addEventListener("message",Lt,!1),setInterval(()=>{(!I.isActive()&&E.wrapper.scrollTop!==0||E.wrapper.scrollLeft!==0)&&(E.wrapper.scrollTop=0,E.wrapper.scrollLeft=0)},1e3),document.addEventListener("fullscreenchange",or),document.addEventListener("webkitfullscreenchange",or),Gt().forEach(R=>{me(R,"section").forEach((j,Y)=>{Y>0&&(j.classList.remove("present"),j.classList.remove("past"),j.classList.add("future"),j.setAttribute("aria-hidden","true"))})}),nn(),ie.update(!0),function(){let R=f.view==="print",j=f.view==="scroll"||f.view==="reader";(R||j)&&(R?Gr():ba.unbind(),E.viewport.classList.add("loading-scroll-mode"),R?document.readyState==="complete"?de.activate():window.addEventListener("load",()=>de.activate()):I.activate())}(),Le.readURL(),setTimeout(()=>{E.slides.classList.remove("no-transition"),E.wrapper.classList.add("ready"),pt({type:"ready",data:{indexh:a,indexv:i,currentSlide:d}})},1))}function ka(R){E.statusElement.textContent=R}function Wr(R){let j="";if(R.nodeType===3)j+=R.textContent;else if(R.nodeType===1){let Y=R.getAttribute("aria-hidden"),Q=window.getComputedStyle(R).display==="none";Y==="true"||Q||Array.from(R.childNodes).forEach(re=>{j+=Wr(re)})}return j=j.trim(),j===""?"":j+" "}function nn(R){let j={...f};if(typeof R=="object"&&ma(f,R),r.isReady()===!1)return;let Y=E.wrapper.querySelectorAll(Ur).length;E.wrapper.classList.remove(j.transition),E.wrapper.classList.add(f.transition),E.wrapper.setAttribute("data-transition-speed",f.transitionSpeed),E.wrapper.setAttribute("data-background-transition",f.backgroundTransition),E.viewport.style.setProperty("--slide-width",typeof f.width=="string"?f.width:f.width+"px"),E.viewport.style.setProperty("--slide-height",typeof f.height=="string"?f.height:f.height+"px"),f.shuffle&&Ea(),ji(E.wrapper,"embedded",f.embedded),ji(E.wrapper,"rtl",f.rtl),ji(E.wrapper,"center",f.center),f.pause===!1&&Rr(),le.reset(),u&&(u.destroy(),u=null),Y>1&&f.autoSlide&&f.autoSlideStoppable&&(u=new lo(E.wrapper,()=>Math.min(Math.max((Date.now()-X)/H,0),1)),u.on("click",be),$=!1),f.navigationMode!=="default"?E.wrapper.setAttribute("data-navigation-mode",f.navigationMode):E.wrapper.removeAttribute("data-navigation-mode"),St.configure(f,j),wt.configure(f,j),Tr.configure(f,j),ce.configure(f,j),ht.configure(f,j),Ee.configure(f,j),ke.configure(f,j),G.configure(f,j),Sa()}function sn(){window.addEventListener("resize",qa,!1),f.touch&&ba.bind(),f.keyboard&&Ee.bind(),f.progress&&ht.bind(),f.respondToHashChanges&&Le.bind(),ce.bind(),wt.bind(),E.slides.addEventListener("click",Ma,!1),E.slides.addEventListener("transitionend",L,!1),E.pauseOverlay.addEventListener("click",Rr,!1),f.focusBodyOnPageVisibilityChange&&document.addEventListener("visibilitychange",Ra,!1)}function Gr(){ba.unbind(),wt.unbind(),Ee.unbind(),ce.unbind(),ht.unbind(),Le.unbind(),window.removeEventListener("resize",qa,!1),E.slides.removeEventListener("click",Ma,!1),E.slides.removeEventListener("transitionend",L,!1),E.pauseOverlay.removeEventListener("click",Rr,!1)}function on(R,j,Y){e.addEventListener(R,j,Y)}function _a(R,j,Y){e.removeEventListener(R,j,Y)}function wa(R){typeof R.layout=="string"&&(z.layout=R.layout),typeof R.overview=="string"&&(z.overview=R.overview),z.layout?Dr(E.slides,z.layout+" "+z.overview):Dr(E.slides,z.overview)}function pt({target:R=E.wrapper,type:j,data:Y,bubbles:Q=!0}){let re=document.createEvent("HTMLEvents",1,2);return re.initEvent(j,Q,!0),ma(re,Y),R.dispatchEvent(re),R===E.wrapper&&va(j),re}function cn(R){pt({type:"slidechanged",data:{indexh:a,indexv:i,previousSlide:c,currentSlide:d,origin:R}})}function va(R,j){if(f.postMessageEvents&&window.parent!==window.self){let Y={namespace:"reveal",eventName:R,state:v()};ma(Y,j),window.parent.postMessage(JSON.stringify(Y),"*")}}function qe(){if(E.wrapper&&!de.isActive()){let R=E.viewport.offsetWidth,j=E.viewport.offsetHeight;if(!f.disableLayout){ga&&!f.embedded&&document.documentElement.style.setProperty("--vh",.01*window.innerHeight+"px");let Y=I.isActive()?Et(R,j):Et(),Q=g;te(f.width,f.height),E.slides.style.width=Y.width+"px",E.slides.style.height=Y.height+"px",g=Math.min(Y.presentationWidth/Y.width,Y.presentationHeight/Y.height),g=Math.max(g,f.minScale),g=Math.min(g,f.maxScale),g===1||I.isActive()?(E.slides.style.zoom="",E.slides.style.left="",E.slides.style.top="",E.slides.style.bottom="",E.slides.style.right="",wa({layout:""})):(E.slides.style.zoom="",E.slides.style.left="50%",E.slides.style.top="50%",E.slides.style.bottom="auto",E.slides.style.right="auto",wa({layout:"translate(-50%, -50%) scale("+g+")"}));let re=Array.from(E.wrapper.querySelectorAll(Ur));for(let ye=0,Ae=re.length;ye<Ae;ye++){let Be=re[ye];Be.style.display!=="none"&&(f.center||Be.classList.contains("center")?Be.classList.contains("stack")?Be.style.top=0:Be.style.top=Math.max((Y.height-Be.scrollHeight)/2,0)+"px":Be.style.top="")}Q!==g&&pt({type:"resize",data:{oldScale:Q,scale:g,size:Y}})}(function(){if(E.wrapper&&!f.disableLayout&&!de.isActive()&&typeof f.scrollActivationWidth=="number"&&f.view!=="scroll"){let Y=Et();Y.presentationWidth>0&&Y.presentationWidth<=f.scrollActivationWidth?I.isActive()||(ie.create(),I.activate()):I.isActive()&&I.deactivate()}})(),E.viewport.style.setProperty("--slide-scale",g),E.viewport.style.setProperty("--viewport-width",R+"px"),E.viewport.style.setProperty("--viewport-height",j+"px"),I.layout(),ht.update(),ie.updateParallax(),ve.isActive()&&ve.update()}}function te(R,j){me(E.slides,"section > .stretch, section > .r-stretch").forEach(Y=>{let Q=((re,ye=0)=>{if(re){let Ae,Be=re.style.height;return re.style.height="0px",re.parentNode.style.height="auto",Ae=ye-re.parentNode.offsetHeight,re.style.height=Be+"px",re.parentNode.style.removeProperty("height"),Ae}return ye})(Y,j);if(/(img|video)/gi.test(Y.nodeName)){let re=Y.naturalWidth||Y.videoWidth,ye=Y.naturalHeight||Y.videoHeight,Ae=Math.min(R/re,Q/ye);Y.style.width=re*Ae+"px",Y.style.height=ye*Ae+"px"}else Y.style.width=R+"px",Y.style.height=Q+"px"})}function Et(R,j){let Y=f.width,Q=f.height;f.disableLayout&&(Y=E.slides.offsetWidth,Q=E.slides.offsetHeight);let re={width:Y,height:Q,presentationWidth:R||E.wrapper.offsetWidth,presentationHeight:j||E.wrapper.offsetHeight};return re.presentationWidth-=re.presentationWidth*f.margin,re.presentationHeight-=re.presentationHeight*f.margin,typeof re.width=="string"&&/%$/.test(re.width)&&(re.width=parseInt(re.width,10)/100*re.presentationWidth),typeof re.height=="string"&&/%$/.test(re.height)&&(re.height=parseInt(re.height,10)/100*re.presentationHeight),re}function xa(R,j){typeof R=="object"&&typeof R.setAttribute=="function"&&R.setAttribute("data-previous-indexv",j||0)}function za(R){if(typeof R=="object"&&typeof R.setAttribute=="function"&&R.classList.contains("stack")){let j=R.hasAttribute("data-start-indexv")?"data-start-indexv":"data-previous-indexv";return parseInt(R.getAttribute(j)||0,10)}return 0}function Mr(R=d){return R&&R.parentNode&&!!R.parentNode.nodeName.match(/section/i)}function Aa(){return!(!d||!Mr(d))&&!d.nextElementSibling}function mr(){return a===0&&i===0}function qr(){return!!d&&!d.nextElementSibling&&(!Mr(d)||!d.parentNode.nextElementSibling)}function ln(){if(f.pause){let R=E.wrapper.classList.contains("paused");Fe(),E.wrapper.classList.add("paused"),R===!1&&pt({type:"paused"})}}function Rr(){let R=E.wrapper.classList.contains("paused");E.wrapper.classList.remove("paused"),D(),R&&pt({type:"resumed"})}function bt(R){typeof R=="boolean"?R?ln():Rr():kt()?Rr():ln()}function kt(){return E.wrapper.classList.contains("paused")}function tt(R,j,Y,Q){if(pt({type:"beforeslidechange",data:{indexh:R===void 0?a:R,indexv:j===void 0?i:j,origin:Q}}).defaultPrevented)return;c=d;let re=E.wrapper.querySelectorAll(Cr);if(I.isActive()){let W=I.getSlideByIndices(R,j);return void(W&&I.scrollToSlide(W))}if(re.length===0)return;j!==void 0||ve.isActive()||(j=za(re[R])),c&&c.parentNode&&c.parentNode.classList.contains("stack")&&xa(c.parentNode,i);let ye=h.concat();h.length=0;let Ae=a||0,Be=i||0;a=Ct(Cr,R===void 0?a:R),i=Ct(Uu,j===void 0?i:j);let vt=a!==Ae||i!==Be;vt||(c=null);let cr=re[a],ct=cr.querySelectorAll("section");e.classList.toggle("is-vertical-slide",ct.length>1),d=ct[i]||cr;let je=!1;vt&&c&&d&&!ve.isActive()&&(B="running",je=Lr(c,d,Ae,Be),je&&E.slides.classList.add("disable-slide-transitions")),Da(),qe(),ve.isActive()&&ve.update(),Y!==void 0&&ke.goto(Y),c&&c!==d&&(c.classList.remove("present"),c.setAttribute("aria-hidden","true"),mr()&&setTimeout(()=>{me(E.wrapper,Cr+".stack").forEach(W=>{xa(W,0)})},0));e:for(let W=0,Xt=h.length;W<Xt;W++){for(let Ot=0;Ot<ye.length;Ot++)if(ye[Ot]===h[W]){ye.splice(Ot,1);continue e}E.viewport.classList.add(h[W]),pt({type:h[W]})}for(;ye.length;)E.viewport.classList.remove(ye.pop());vt&&cn(Q),!vt&&c||(V.stopEmbeddedContent(c),V.startEmbeddedContent(d)),requestAnimationFrame(()=>{ka(Wr(d))}),ht.update(),ce.update(),St.update(),ie.update(),ie.updateParallax(),G.update(),ke.update(),Le.writeURL(),D(),je&&(setTimeout(()=>{E.slides.classList.remove("disable-slide-transitions")},0),f.autoAnimate&&le.run(c,d))}function Lr(R,j,Y,Q){return R.hasAttribute("data-auto-animate")&&j.hasAttribute("data-auto-animate")&&R.getAttribute("data-auto-animate-id")===j.getAttribute("data-auto-animate-id")&&!(a>Y||i>Q?j:R).hasAttribute("data-auto-animate-restart")}function Sa(){Gr(),sn(),qe(),H=f.autoSlide,D(),ie.create(),Le.writeURL(),f.sortFragmentsOnSync===!0&&ke.sortAll(),ce.update(),ht.update(),Da(),St.update(),St.updateVisibility(),Ve.update(),ie.update(!0),G.update(),V.formatEmbeddedContent(),f.autoPlayMedia===!1?V.stopEmbeddedContent(d,{unloadIframes:!1}):V.startEmbeddedContent(d),ve.isActive()&&ve.layout()}function Ea(R=Gt()){R.forEach((j,Y)=>{let Q=R[Math.floor(Math.random()*R.length)];Q.parentNode===j.parentNode&&j.parentNode.insertBefore(j,Q);let re=j.querySelectorAll("section");re.length&&Ea(re)})}function Ct(R,j){let Y=me(E.wrapper,R),Q=Y.length,re=I.isActive()||de.isActive(),ye=!1,Ae=!1;if(Q){f.loop&&(j>=Q&&(ye=!0),(j%=Q)<0&&(j=Q+j,Ae=!0)),j=Math.max(Math.min(j,Q-1),0);for(let ct=0;ct<Q;ct++){let je=Y[ct],W=f.rtl&&!Mr(je);je.classList.remove("past"),je.classList.remove("present"),je.classList.remove("future"),je.setAttribute("hidden",""),je.setAttribute("aria-hidden","true"),je.querySelector("section")&&je.classList.add("stack"),re?je.classList.add("present"):ct<j?(je.classList.add(W?"future":"past"),f.fragments&&Fr(je)):ct>j?(je.classList.add(W?"past":"future"),f.fragments&&Ca(je)):ct===j&&f.fragments&&(ye?Ca(je):Ae&&Fr(je))}let Be=Y[j],vt=Be.classList.contains("present");Be.classList.add("present"),Be.removeAttribute("hidden"),Be.removeAttribute("aria-hidden"),vt||pt({target:Be,type:"visible",bubbles:!1});let cr=Be.getAttribute("data-state");cr&&(h=h.concat(cr.split(" ")))}else j=0;return j}function Fr(R){me(R,".fragment").forEach(j=>{j.classList.add("visible"),j.classList.remove("current-fragment")})}function Ca(R){me(R,".fragment.visible").forEach(j=>{j.classList.remove("visible","current-fragment")})}function Da(){let R,j,Y=Gt(),Q=Y.length;if(Q&&a!==void 0){let re=ve.isActive()?10:f.viewDistance;ga&&(re=ve.isActive()?6:f.mobileViewDistance),de.isActive()&&(re=Number.MAX_VALUE);for(let ye=0;ye<Q;ye++){let Ae=Y[ye],Be=me(Ae,"section"),vt=Be.length;if(R=Math.abs((a||0)-ye)||0,f.loop&&(R=Math.abs(((a||0)-ye)%(Q-re))||0),R<re?V.load(Ae):V.unload(Ae),vt){let cr=za(Ae);for(let ct=0;ct<vt;ct++){let je=Be[ct];j=Math.abs(ye===(a||0)?(i||0)-ct:ct-cr),R+j<re?V.load(je):V.unload(je)}}}m()?E.wrapper.classList.add("has-vertical-slides"):E.wrapper.classList.remove("has-vertical-slides"),$e()?E.wrapper.classList.add("has-horizontal-slides"):E.wrapper.classList.remove("has-horizontal-slides")}}function Dt({includeFragments:R=!1}={}){let j=E.wrapper.querySelectorAll(Cr),Y=E.wrapper.querySelectorAll(Uu),Q={left:a>0,right:a<j.length-1,up:i>0,down:i<Y.length-1};if(f.loop&&(j.length>1&&(Q.left=!0,Q.right=!0),Y.length>1&&(Q.up=!0,Q.down=!0)),j.length>1&&f.navigationMode==="linear"&&(Q.right=Q.right||Q.down,Q.left=Q.left||Q.up),R===!0){let re=ke.availableRoutes();Q.left=Q.left||re.prev,Q.up=Q.up||re.prev,Q.down=Q.down||re.next,Q.right=Q.right||re.next}if(f.rtl){let re=Q.left;Q.left=Q.right,Q.right=re}return Q}function Xr(R=d){let j=Gt(),Y=0;e:for(let Q=0;Q<j.length;Q++){let re=j[Q],ye=re.querySelectorAll("section");for(let Ae=0;Ae<ye.length;Ae++){if(ye[Ae]===R)break e;ye[Ae].dataset.visibility!=="uncounted"&&Y++}if(re===R)break;re.classList.contains("stack")===!1&&re.dataset.visibility!=="uncounted"&&Y++}return Y}function un(R){let j,Y=a,Q=i;if(R)if(I.isActive())Y=parseInt(R.getAttribute("data-index-h"),10),R.getAttribute("data-index-v")&&(Q=parseInt(R.getAttribute("data-index-v"),10));else{let re=Mr(R),ye=re?R.parentNode:R,Ae=Gt();Y=Math.max(Ae.indexOf(ye),0),Q=void 0,re&&(Q=Math.max(me(R.parentNode,"section").indexOf(R),0))}if(!R&&d&&d.querySelectorAll(".fragment").length>0){let re=d.querySelector(".current-fragment");j=re&&re.hasAttribute("data-fragment-index")?parseInt(re.getAttribute("data-fragment-index"),10):d.querySelectorAll(".fragment.visible").length-1}return{h:Y,v:Q,f:j}}function Ta(){return me(E.wrapper,Ur+':not(.stack):not([data-visibility="uncounted"])')}function Gt(){return me(E.wrapper,Cr)}function Br(){return me(E.wrapper,".slides>section>section")}function $e(){return Gt().length>1}function m(){return Br().length>1}function y(){return Ta().length}function K(R,j){let Y=Gt()[R],Q=Y&&Y.querySelectorAll("section");return Q&&Q.length&&typeof j=="number"?Q?Q[j]:void 0:Y}function v(){let R=un();return{indexh:R.h,indexv:R.v,indexf:R.f,paused:kt(),overview:ve.isActive(),...Ve.getState()}}function D(){if(Fe(),d&&f.autoSlide!==!1){let R=d.querySelector(".current-fragment[data-autoslide]"),j=R?R.getAttribute("data-autoslide"):null,Y=d.parentNode?d.parentNode.getAttribute("data-autoslide"):null,Q=d.getAttribute("data-autoslide");j?H=parseInt(j,10):Q?H=parseInt(Q,10):Y?H=parseInt(Y,10):(H=f.autoSlide,d.querySelectorAll(".fragment").length===0&&me(d,"video, audio").forEach(re=>{re.hasAttribute("data-autoplay")&&H&&1e3*re.duration/re.playbackRate>H&&(H=1e3*re.duration/re.playbackRate+1e3)})),!H||$||kt()||ve.isActive()||qr()&&!ke.availableRoutes().next&&f.loop!==!0||(O=setTimeout(()=>{typeof f.autoSlideMethod=="function"?f.autoSlideMethod():T(),D()},H),X=Date.now()),u&&u.setPlaying(O!==-1)}}function Fe(){clearTimeout(O),O=-1}function ne(){H&&!$&&($=!0,pt({type:"autoslidepaused"}),clearTimeout(O),u&&u.setPlaying(!1))}function Ke(){H&&$&&($=!1,pt({type:"autoslideresumed"}),D())}function jt({skipFragments:R=!1}={}){if(x.hasNavigatedHorizontally=!0,I.isActive())return I.prev();f.rtl?(ve.isActive()||R||ke.next()===!1)&&Dt().left&&tt(a+1,f.navigationMode==="grid"?i:void 0):(ve.isActive()||R||ke.prev()===!1)&&Dt().left&&tt(a-1,f.navigationMode==="grid"?i:void 0)}function pe({skipFragments:R=!1}={}){if(x.hasNavigatedHorizontally=!0,I.isActive())return I.next();f.rtl?(ve.isActive()||R||ke.prev()===!1)&&Dt().right&&tt(a-1,f.navigationMode==="grid"?i:void 0):(ve.isActive()||R||ke.next()===!1)&&Dt().right&&tt(a+1,f.navigationMode==="grid"?i:void 0)}function Ue({skipFragments:R=!1}={}){if(I.isActive())return I.prev();(ve.isActive()||R||ke.prev()===!1)&&Dt().up&&tt(a,i-1)}function ft({skipFragments:R=!1}={}){if(x.hasNavigatedVertically=!0,I.isActive())return I.next();(ve.isActive()||R||ke.next()===!1)&&Dt().down&&tt(a,i+1)}function Pr({skipFragments:R=!1}={}){if(I.isActive())return I.prev();if(R||ke.prev()===!1)if(Dt().up)Ue({skipFragments:R});else{let j;if(j=f.rtl?me(E.wrapper,Cr+".future").pop():me(E.wrapper,Cr+".past").pop(),j&&j.classList.contains("stack")){let Y=j.querySelectorAll("section").length-1||void 0;tt(a-1,Y)}else f.rtl?pe({skipFragments:R}):jt({skipFragments:R})}}function T({skipFragments:R=!1}={}){if(x.hasNavigatedHorizontally=!0,x.hasNavigatedVertically=!0,I.isActive())return I.next();if(R||ke.next()===!1){let j=Dt();j.down&&j.right&&f.loop&&Aa()&&(j.down=!1),j.down?ft({skipFragments:R}):f.rtl?jt({skipFragments:R}):pe({skipFragments:R})}}function Lt(R){let j=R.data;if(typeof j=="string"&&j.charAt(0)==="{"&&j.charAt(j.length-1)==="}"&&(j=JSON.parse(j),j.method&&typeof r[j.method]=="function"))if(Ey.test(j.method)===!1){let Y=r[j.method].apply(r,j.args);va("callback",{method:j.method,result:Y})}else console.warn('reveal.js: "'+j.method+'" is is blacklisted from the postMessage API')}function L(R){B==="running"&&/section/gi.test(R.target.nodeName)&&(B="idle",pt({type:"slidetransitionend",data:{indexh:a,indexv:i,previousSlide:c,currentSlide:d}}))}function Ma(R){let j=gt(R.target,'a[href^="#"]');if(j){let Y=j.getAttribute("href"),Q=Le.getIndicesFromHash(Y);Q&&(r.slide(Q.h,Q.v,Q.f),R.preventDefault())}}function qa(R){qe()}function Ra(R){document.hidden===!1&&document.activeElement!==document.body&&(typeof document.activeElement.blur=="function"&&document.activeElement.blur(),document.body.focus())}function or(R){(document.fullscreenElement||document.webkitFullscreenElement)===E.wrapper&&(R.stopImmediatePropagation(),setTimeout(()=>{r.layout(),r.focus.focus()},1))}function be(R){qr()&&f.loop===!1?(tt(0,0),Ke()):$?Ke():ne()}let Zr={VERSION:Ju,initialize:function(R){if(!e)throw'Unable to find presentation root (<div class="reveal">).';if(k)throw"Reveal.js has already been initialized.";if(k=!0,E.wrapper=e,E.slides=e.querySelector(".slides"),!E.slides)throw'Unable to find slides container (<div class="slides">).';return f={...Cy,...f,...t,...R,...$u()},/print-pdf/gi.test(window.location.search)&&(f.view="print"),function(){f.embedded===!0?E.viewport=gt(e,".reveal-viewport")||e:(E.viewport=document.body,document.documentElement.classList.add("reveal-full-page")),E.viewport.classList.add("reveal-viewport")}(),window.addEventListener("load",qe,!1),yt.load(f.plugins,f.dependencies).then(os),new Promise(j=>r.on("ready",j))},configure:nn,destroy:function(){k=!1,w!==!1&&(Gr(),Fe(),St.destroy(),wt.destroy(),Ve.destroy(),yt.destroy(),Tr.destroy(),ce.destroy(),ht.destroy(),ie.destroy(),G.destroy(),ee.destroy(),document.removeEventListener("fullscreenchange",or),document.removeEventListener("webkitfullscreenchange",or),document.removeEventListener("visibilitychange",Ra,!1),window.removeEventListener("message",Lt,!1),window.removeEventListener("load",qe,!1),E.pauseOverlay&&E.pauseOverlay.remove(),E.statusElement&&E.statusElement.remove(),document.documentElement.classList.remove("reveal-full-page"),E.wrapper.classList.remove("ready","center","has-horizontal-slides","has-vertical-slides"),E.wrapper.removeAttribute("data-transition-speed"),E.wrapper.removeAttribute("data-background-transition"),E.viewport.classList.remove("reveal-viewport"),E.viewport.style.removeProperty("--slide-width"),E.viewport.style.removeProperty("--slide-height"),E.slides.style.removeProperty("width"),E.slides.style.removeProperty("height"),E.slides.style.removeProperty("zoom"),E.slides.style.removeProperty("left"),E.slides.style.removeProperty("top"),E.slides.style.removeProperty("bottom"),E.slides.style.removeProperty("right"),E.slides.style.removeProperty("transform"),Array.from(E.wrapper.querySelectorAll(Ur)).forEach(R=>{R.style.removeProperty("display"),R.style.removeProperty("top"),R.removeAttribute("hidden"),R.removeAttribute("aria-hidden")}))},sync:Sa,syncSlide:function(R=d){ie.sync(R),ke.sync(R),V.load(R),ie.update(),St.update()},syncFragments:ke.sync.bind(ke),slide:tt,left:jt,right:pe,up:Ue,down:ft,prev:Pr,next:T,navigateLeft:jt,navigateRight:pe,navigateUp:Ue,navigateDown:ft,navigatePrev:Pr,navigateNext:T,navigateFragment:ke.goto.bind(ke),prevFragment:ke.prev.bind(ke),nextFragment:ke.next.bind(ke),on,off:_a,addEventListener:on,removeEventListener:_a,layout:qe,shuffle:Ea,availableRoutes:Dt,availableFragments:ke.availableRoutes.bind(ke),toggleHelp:Ve.toggleHelp.bind(Ve),toggleOverview:ve.toggle.bind(ve),toggleScrollView:I.toggle.bind(I),togglePause:bt,toggleAutoSlide:function(R){typeof R=="boolean"?R?Ke():ne():$?Ke():ne()},toggleJumpToSlide:function(R){typeof R=="boolean"?R?ee.show():ee.hide():ee.isVisible()?ee.hide():ee.show()},isFirstSlide:mr,isLastSlide:qr,isLastVerticalSlide:Aa,isVerticalSlide:Mr,isVerticalStack:function(R=d){return R.classList.contains(".stack")||R.querySelector("section")!==null},isPaused:kt,isAutoSliding:function(){return!(!H||$)},isSpeakerNotes:St.isSpeakerNotesWindow.bind(St),isOverview:ve.isActive.bind(ve),isFocused:wt.isFocused.bind(wt),isOverlayOpen:Ve.isOpen.bind(Ve),isScrollView:I.isActive.bind(I),isPrintView:de.isActive.bind(de),isReady:()=>w,loadSlide:V.load.bind(V),unloadSlide:V.unload.bind(V),startEmbeddedContent:()=>V.startEmbeddedContent(d),stopEmbeddedContent:()=>V.stopEmbeddedContent(d,{unloadIframes:!1}),previewIframe:Ve.previewIframe.bind(Ve),previewImage:Ve.previewImage.bind(Ve),previewVideo:Ve.previewVideo.bind(Ve),showPreview:Ve.previewIframe.bind(Ve),hidePreview:Ve.close.bind(Ve),addEventListeners:sn,removeEventListeners:Gr,dispatchEvent:pt,getState:v,setState:function(R){if(typeof R=="object"){tt(pa(R.indexh),pa(R.indexv),pa(R.indexf));let j=pa(R.paused),Y=pa(R.overview);typeof j=="boolean"&&j!==kt()&&bt(j),typeof Y=="boolean"&&Y!==ve.isActive()&&ve.toggle(Y),Ve.setState(R)}},getProgress:function(){let R=y(),j=Xr();if(d){let Y=d.querySelectorAll(".fragment");Y.length>0&&(j+=d.querySelectorAll(".fragment.visible").length/Y.length*.9)}return Math.min(j/(R-1),1)},getIndices:un,getSlidesAttributes:function(){return Ta().map(R=>{let j={};for(let Y=0;Y<R.attributes.length;Y++){let Q=R.attributes[Y];j[Q.name]=Q.value}return j})},getSlidePastCount:Xr,getTotalSlides:y,getSlide:K,getPreviousSlide:()=>c,getCurrentSlide:()=>d,getSlideBackground:function(R,j){let Y=typeof R=="number"?K(R,j):R;if(Y)return Y.slideBackgroundElement},getSlideNotes:St.getSlideNotes.bind(St),getSlides:Ta,getHorizontalSlides:Gt,getVerticalSlides:Br,hasHorizontalSlides:$e,hasVerticalSlides:m,hasNavigatedHorizontally:()=>x.hasNavigatedHorizontally,hasNavigatedVertically:()=>x.hasNavigatedVertically,shouldAutoAnimateBetween:Lr,addKeyBinding:Ee.addKeyBinding.bind(Ee),removeKeyBinding:Ee.removeKeyBinding.bind(Ee),triggerKey:Ee.triggerKey.bind(Ee),registerKeyboardShortcut:Ee.registerKeyboardShortcut.bind(Ee),getComputedSlideSize:Et,setCurrentScrollPage:function(R,j,Y){let Q=a||0;a=j,i=Y;let re=d!==R;c=d,d=R,d&&c&&f.autoAnimate&&Lr(c,d,Q,i)&&le.run(c,d),re&&(c&&(V.stopEmbeddedContent(c),V.stopEmbeddedContent(c.slideBackgroundElement)),V.startEmbeddedContent(d),V.startEmbeddedContent(d.slideBackgroundElement)),requestAnimationFrame(()=>{ka(Wr(d))}),cn()},getScale:()=>g,getConfig:()=>f,getQueryHash:$u,getSlidePath:Le.getHash.bind(Le),getRevealElement:()=>e,getSlidesElement:()=>E.slides,getViewportElement:()=>E.viewport,getBackgroundsElement:()=>ie.element,registerPlugin:yt.registerPlugin.bind(yt),hasPlugin:yt.hasPlugin.bind(yt),getPlugin:yt.getPlugin.bind(yt),getPlugins:yt.getRegisteredPlugins.bind(yt)};return ma(r,{...Zr,announceStatus:ka,getStatusText:Wr,focus:wt,scroll:I,progress:ht,controls:ce,location:Le,overview:ve,keyboard:Ee,fragments:ke,backgrounds:ie,slideContent:V,slideNumber:G,onUserInput:function(R){f.autoSlideStoppable&&ne()},closeOverlay:Ve.close.bind(Ve),updateSlidesVisibility:Da,layoutSlideContents:te,transformSlides:wa,cueAutoSlide:D,cancelAutoSlide:Fe}),Zr}var Ne=Qu,Xu=[];Ne.initialize=e=>(Object.assign(Ne,new Qu(document.querySelector(".reveal"),e)),Xu.map(t=>t(Ne)),Ne.initialize()),["configure","on","off","addEventListener","removeEventListener","registerPlugin"].forEach(e=>{Ne[e]=(...t)=>{Xu.push(r=>r[e].call(null,...t))}}),Ne.isReady=()=>!1,Ne.VERSION=Ju;var Dy="0.1.1";function uo(e){return new Promise((t,r)=>{if(!e||document.querySelector(`script[data-lib="${e}"]`))return t();let a=document.createElement("script");a.src=e,a.async=!0,a.setAttribute("data-lib",e),a.onload=()=>t(),a.onerror=()=>r(new Error("failed to load "+e)),document.head.appendChild(a)})}function sd(e){let t=e&&e.enhancers||{},r=[];return t.mermaidJs&&document.querySelector(".mermaid")&&r.push(uo(t.mermaidJs)),t.smilesJs&&document.querySelector("canvas[data-smiles]")&&r.push(uo(t.smilesJs)),t.chartJs&&document.querySelector("canvas.orz-chart")&&r.push(uo(t.chartJs)),Promise.all(r).catch(()=>{})}function Ty(){let e=window.__ORZ_SLIDES__||{},t=document.documentElement.getAttribute("data-theme")||e.defaultTheme,r=(e.themes||[]).find(a=>a.id===t);return!!(r&&r.scheme==="dark")}function id(){let e=window;try{if(e.mermaid){e.mermaid.initialize({startOnLoad:!1});let t=e.mermaid.run({querySelector:".mermaid:not([data-processed])"});t&&t.then&&t.then(()=>ns()).catch(()=>{})}}catch{}try{if(e.SmilesDrawer){let t=Ty()?"dark":"light";document.querySelectorAll("canvas[data-smiles]").forEach(r=>{let a=r;if(a.__scheme===t||a.__pending===t)return;a.__pending=t,a.__ow===void 0&&(a.__ow=r.width,a.__oh=r.height),r.width=a.__ow,r.height=a.__oh;let i=new e.SmilesDrawer.Drawer({width:a.__ow,height:a.__oh});e.SmilesDrawer.parse(r.getAttribute("data-smiles"),c=>{try{i.draw(c,r,t,!1),a.__scheme=t}catch{}a.__pending=null,ns()})})}}catch{}try{e.Chart&&(Ne.getCurrentSlide&&Ne.getCurrentSlide()||document).querySelectorAll("canvas.orz-chart[data-chart]").forEach(r=>{if(!e.Chart.getChart(r))try{let a=JSON.parse(r.getAttribute("data-chart")||"{}");a.options=a.options||{},a.options.responsive=!1,a.options.maintainAspectRatio=!1,a.options.animation=!1,new e.Chart(r,a)}catch{}})}catch{}qy(),My()}function My(){location.protocol==="file:"&&document.querySelectorAll(".youtube-embed").forEach(e=>{if(e.__ytFacade)return;let t=e.querySelector("iframe"),a=(t&&t.getAttribute("src")||"").match(/embed\/([\w-]{6,})/);if(!t||!a)return;e.__ytFacade=!0;let i=a[1],c=document.createElement("a");c.href="https://www.youtube.com/watch?v="+i,c.target="_blank",c.rel="noopener noreferrer",c.className="youtube-facade",c.setAttribute("aria-label","Play video on YouTube"),c.style.backgroundImage="url('https://i.ytimg.com/vi/"+i+"/hqdefault.jpg')",c.innerHTML='<span class="youtube-facade-play" aria-hidden="true"></span>',t.replaceWith(c)})}function qy(){document.querySelectorAll(".tabs:not([data-js])").forEach(e=>{let t=Array.from(e.querySelectorAll(":scope > .tab"));if(!t.length)return;let r=document.createElement("div");r.className="tabs-bar",t.forEach((a,i)=>{let c=document.createElement("button");c.className="tabs-bar-btn"+(i===0?" active":""),c.textContent=a.getAttribute("data-label")||"Tab "+(i+1),c.addEventListener("click",()=>{r.querySelectorAll(".tabs-bar-btn").forEach(d=>d.classList.remove("active")),t.forEach(d=>d.classList.remove("active")),c.classList.add("active"),a.classList.add("active")}),r.appendChild(c),i===0&&a.classList.add("active")}),e.insertBefore(r,t[0]),e.setAttribute("data-js","1")})}var ed=.6;function Ry(e){e.style.removeProperty("--region-scale");let t=e.firstElementChild;if(!t)return;let r=1;for(let a=0;a<12&&!(t.scrollHeight<=e.clientHeight+1&&t.scrollWidth<=e.clientWidth+1);a++){if(r-=.07,r<ed){r=ed,e.style.setProperty("--region-scale",String(r));break}e.style.setProperty("--region-scale",String(r))}e.setAttribute("data-scale",r.toFixed(2))}function td(e,t){let r=e.clientWidth,a=t.closest(".markdown-body");if(!a)return{w:r,h:e.clientHeight};let i=t;for(;i.parentElement&&i.parentElement!==a;)i=i.parentElement;let c=0;return Array.prototype.forEach.call(a.children,d=>{d!==i&&(c+=d.offsetHeight)}),{w:r,h:Math.max(40,e.clientHeight-c-6)}}function Ly(e){if(!e.clientWidth||!e.clientHeight)return;e.querySelectorAll(".mermaid svg").forEach(r=>{let a=td(e,r),i=r.viewBox&&r.viewBox.baseVal,c=i&&i.height?i.width/i.height:1,d=a.w,u=d/c;u>a.h&&(u=a.h,d=u*c),r.style.maxWidth="none",r.style.width=Math.floor(d)+"px",r.style.height=Math.floor(u)+"px"});let t=window.Chart;t&&t.getChart&&e.querySelectorAll("canvas.orz-chart").forEach(r=>{let a=t.getChart(r);if(a){let i=td(e,r);try{a.resize(i.w,i.h)}catch{}}})}function ns(){let e=Ne.getCurrentSlide&&Ne.getCurrentSlide()||null;!e||e.getAttribute("data-fit")==="off"||e.querySelectorAll(".orz-region").forEach(t=>{Ry(t),Ly(t)})}function rd(){let e=document.getElementById("orz-deck");return(e&&e.textContent||"").replace(/^\n/,"").replace(/\n\s*$/,"")}function od(e){let t=document.querySelector(".reveal .slides");t&&(t.innerHTML=Ni(rs(e),ho.md)),cd()}var tn=()=>{if(id(),cd())try{Ne.sync()}catch{}ns()};function Fy(e){od(e);try{Ne.sync()}catch{}sd(window.__ORZ_SLIDES__||{}).then(tn)}function By(){let e=window.__ORZ_SLIDES__||{},t=rs(rd());od(rd());let r=(t.config.ratio||e.ratio||"16:9").split(":").map(Number),a=960,i=Math.round(a*(r[1]||9)/(r[0]||16));ss=a,is=i,Ne.initialize({width:a,height:i,margin:.03,minScale:.2,maxScale:4,hash:!0,controls:!0,progress:!0,slideNumber:"c/t"}),window.orzslides.reveal=Ne;try{Ne.addKeyBinding({keyCode:83,key:"S",description:"Speaker view"},pd),Ne.addKeyBinding({keyCode:84,key:"T",description:"Toggle timer/clock"},hd)}catch{}Ne.on("slidechanged",an),Ne.on("fragmentshown",an),Ne.on("fragmenthidden",an);let c=()=>{try{Ne.layout()}catch{}};sd(e).then(()=>{c(),tn()}),Ne.on("slidechanged",()=>{id(),[80,500,1400].forEach(d=>setTimeout(tn,d))}),[200,700,1500,2600].forEach(d=>setTimeout(()=>{c(),tn()},d)),window.addEventListener("resize",()=>setTimeout(()=>{c(),ns()},60)),document.addEventListener("click",d=>{let u=d.target,f=u&&u.closest?u.closest(".qrcode"):null;if(!f)return;let k=f.querySelector("svg");if(!k)return;d.stopPropagation(),d.preventDefault();let w=document.createElement("div");w.className="orz-qr-overlay",w.appendChild(k.cloneNode(!0));let x=()=>{w.remove(),document.removeEventListener("keydown",h,!0)},h=g=>{g.key==="Escape"&&(g.stopPropagation(),g.preventDefault(),x())};w.addEventListener("click",x),document.addEventListener("keydown",h,!0),document.body.appendChild(w)},!0)}function Py(e){let t=[];return Array.prototype.forEach.call(e.children,r=>{let a=r.tagName.toLowerCase();a==="ul"||a==="ol"?Array.prototype.forEach.call(r.children,i=>{i.tagName.toLowerCase()==="li"&&t.push(i)}):t.push(r)}),t}function cd(){let e=!1;return document.querySelectorAll("section[data-step] .orz-region .markdown-body").forEach(t=>{Py(t).forEach(r=>{r.classList.contains("fragment")||(r.classList.add("fragment"),e=!0)})}),e}var ss=960,is=540,rn=0,pr=null,ir=null,Vr={startMs:0,accumMs:0,running:!1,start(){this.running||(this.startMs=Date.now(),this.running=!0)},pause(){this.running&&(this.accumMs+=Date.now()-this.startMs,this.running=!1)},toggle(){this.running?this.pause():this.start()},reset(){this.accumMs=0,this.startMs=Date.now()},elapsed(){return this.accumMs+(this.running?Date.now()-this.startMs:0)}};function ya(e){return e<10?"0"+e:""+e}function ld(e){let t=Math.floor(e/1e3),r=Math.floor(t/3600),a=Math.floor(t%3600/60),i=t%60;return r>0?r+":"+ya(a)+":"+ya(i):a+":"+ya(i)}function ud(){let e=new Date;return ya(e.getHours())+":"+ya(e.getMinutes())+":"+ya(e.getSeconds())}function dd(){rn||(rn=window.setInterval(fo,1e3))}function fo(){let e=!!(ir&&!ir.closed);if(!pr&&!e){rn&&(clearInterval(rn),rn=0);return}if(fd(),e){let t=ir.document,r=(a,i)=>{let c=t.getElementById(a);c&&(c.textContent=i)};r("sv-clock",ud()),r("sv-timer",ld(Vr.elapsed())),r("sv-ttoggle",Vr.running?"Pause":"Start")}}function fd(){pr&&(pr.innerHTML='<span class="orz-timer-clock">'+ud()+'</span><span class="orz-timer-elapsed">'+ld(Vr.elapsed())+"</span>")}function hd(){if(pr){pr.remove(),pr=null;return}Vr.start(),pr=document.createElement("div"),pr.className="orz-timer",document.body.appendChild(pr),fd(),dd()}function Iy(){return Array.prototype.slice.call(document.querySelectorAll(".reveal > .slides > section"))}function ad(e){if(!e)return'<div class="sv-end">\u2014 End \u2014</div>';let t=e.cloneNode(!0);return t.querySelectorAll("aside.notes").forEach(r=>r.remove()),t.classList.add("present"),t.removeAttribute("hidden"),t.style.cssText="",'<div class="reveal"><div class="slides">'+t.outerHTML+"</div></div>"}function nd(e){let t=e.querySelector(".slides");if(!t||!e.clientWidth)return;let r=e.clientWidth/ss;t.style.transform="scale("+r+")",e.style.height=is*r+"px"}function an(){if(!ir||ir.closed)return;let e=ir.document,t=Ne.getCurrentSlide&&Ne.getCurrentSlide()||null,r=Iy(),a=t?r.indexOf(t):-1,i=a>=0&&r[a+1]||null,c=e.getElementById("sv-cur"),d=e.getElementById("sv-nxt"),u=e.getElementById("sv-notes"),f=e.getElementById("sv-pos");if(c&&(c.innerHTML=ad(t),nd(c)),d&&(d.innerHTML=ad(i),nd(d)),u){let k=t?t.querySelector("aside.notes"):null;u.innerHTML=k&&k.innerHTML.trim()?k.innerHTML:'<em class="sv-nonotes">No notes for this slide.</em>'}f&&(f.textContent=a+1+" / "+r.length)}function Ny(e){return'<!DOCTYPE html><html><head><meta charset="utf-8"><title>Speaker View \u2014 orz-slides</title>'+e+"<style>*{box-sizing:border-box}html,body{margin:0;height:100%;background:#16161a;color:#e8e8ea;font:14px/1.45 system-ui,-apple-system,sans-serif}.sv-top{display:flex;align-items:center;gap:18px;padding:8px 16px;background:#000;border-bottom:1px solid #2a2a30}.sv-clock{font-size:20px;font-variant-numeric:tabular-nums;opacity:.85}.sv-tbox{display:flex;align-items:center;gap:8px}.sv-tbox #sv-timer{font-size:22px;font-variant-numeric:tabular-nums;min-width:74px}.sv-tbox button{font:inherit;font-size:12px;padding:3px 10px;border:1px solid #4a4a52;background:#23232a;color:#e8e8ea;border-radius:6px;cursor:pointer}.sv-tbox button:hover{background:#30303a}.sv-pos{margin-left:auto;font-size:17px;opacity:.8;font-variant-numeric:tabular-nums}.sv-main{display:grid;grid-template-columns:1.7fr 1fr;gap:14px;padding:14px;height:calc(100% - 49px)}.sv-current{min-height:0;display:flex;flex-direction:column}.sv-side{display:grid;grid-template-rows:auto 1fr;gap:14px;min-height:0}.sv-label{font-size:11px;letter-spacing:.09em;text-transform:uppercase;opacity:.5;margin:0 0 5px}.sv-stage{position:relative;overflow:hidden;background:#000;border:1px solid #2a2a30;border-radius:7px}.sv-stage .reveal{position:static;width:auto;height:auto}.sv-stage .slides{position:absolute;left:0;top:0;width:"+ss+"px;height:"+is+"px;transform-origin:0 0;margin:0;padding:0;text-align:left}.sv-stage .slides>section{position:relative!important;display:block!important;left:0!important;top:0!important;transform:none!important;width:"+ss+"px!important;height:"+is+'px!important;opacity:1!important;visibility:visible!important;background:var(--bg,#fff)}.sv-stage .fragment{opacity:1!important;visibility:visible!important}.sv-notes{background:#fbfbfa;color:#16161a;border-radius:7px;padding:16px 18px;overflow:auto;min-height:0;font-size:16px;line-height:1.5}.sv-notes :first-child{margin-top:0}.sv-notes .sv-nonotes{color:#888}.sv-end{display:flex;align-items:center;justify-content:center;height:100%;opacity:.45;font-size:18px}</style></head><body><div class="sv-top"><div class="sv-clock" id="sv-clock">--:--:--</div><div class="sv-tbox"><span id="sv-timer">0:00</span><button id="sv-ttoggle">Pause</button><button id="sv-treset">Reset</button></div><div class="sv-pos" id="sv-pos">\u2013 / \u2013</div></div><div class="sv-main"><div class="sv-current"><div class="sv-label">Current</div><div class="sv-stage" id="sv-cur"></div></div><div class="sv-side"><div><div class="sv-label">Next</div><div class="sv-stage" id="sv-nxt"></div></div><div style="display:flex;flex-direction:column;min-height:0"><div class="sv-label">Notes</div><div class="sv-notes" id="sv-notes"></div></div></div></div></body></html>'}function pd(){if(ir&&!ir.closed){ir.focus();return}let e=window.open("","orz-speaker","width=1280,height=800");if(!e)return;ir=e;let t=Array.prototype.slice.call(document.querySelectorAll('link[rel="stylesheet"], style')).map(c=>c.outerHTML).join(`
376
+ `):null}destroy(){this.element.remove()}},lo=class{constructor(t,r){this.diameter=100,this.diameter2=this.diameter/2,this.thickness=6,this.playing=!1,this.progress=0,this.progressOffset=1,this.container=t,this.progressCheck=r,this.canvas=document.createElement("canvas"),this.canvas.className="playback",this.canvas.width=this.diameter,this.canvas.height=this.diameter,this.canvas.style.width=this.diameter2+"px",this.canvas.style.height=this.diameter2+"px",this.context=this.canvas.getContext("2d"),this.container.appendChild(this.canvas),this.render()}setPlaying(t){let r=this.playing;this.playing=t,!r&&this.playing?this.animate():this.render()}animate(){let t=this.progress;this.progress=this.progressCheck(),t>.8&&this.progress<.2&&(this.progressOffset=this.progress),this.render(),this.playing&&requestAnimationFrame(this.animate.bind(this))}render(){let t=this.playing?this.progress:0,r=this.diameter2-this.thickness,a=this.diameter2,i=this.diameter2,c=28;this.progressOffset+=.1*(1-this.progressOffset);let d=-Math.PI/2+t*(2*Math.PI),u=-Math.PI/2+this.progressOffset*(2*Math.PI);this.context.save(),this.context.clearRect(0,0,this.diameter,this.diameter),this.context.beginPath(),this.context.arc(a,i,r+4,0,2*Math.PI,!1),this.context.fillStyle="rgba( 0, 0, 0, 0.4 )",this.context.fill(),this.context.beginPath(),this.context.arc(a,i,r,0,2*Math.PI,!1),this.context.lineWidth=this.thickness,this.context.strokeStyle="rgba( 255, 255, 255, 0.2 )",this.context.stroke(),this.playing&&(this.context.beginPath(),this.context.arc(a,i,r,u,d,!1),this.context.lineWidth=this.thickness,this.context.strokeStyle="#fff",this.context.stroke()),this.context.translate(a-14,i-14),this.playing?(this.context.fillStyle="#fff",this.context.fillRect(0,0,10,c),this.context.fillRect(18,0,10,c)):(this.context.beginPath(),this.context.translate(4,0),this.context.moveTo(0,0),this.context.lineTo(24,14),this.context.lineTo(0,c),this.context.fillStyle="#fff",this.context.fill()),this.context.restore()}on(t,r){this.canvas.addEventListener(t,r,!1)}off(t,r){this.canvas.removeEventListener(t,r,!1)}destroy(){this.playing=!1,this.canvas.parentNode&&this.container.removeChild(this.canvas)}},Cy={width:960,height:700,margin:.04,minScale:.2,maxScale:2,controls:!0,controlsTutorial:!0,controlsLayout:"bottom-right",controlsBackArrows:"faded",progress:!0,slideNumber:!1,showSlideNumber:"all",hashOneBasedIndex:!1,hash:!1,respondToHashChanges:!0,jumpToSlide:!0,history:!1,keyboard:!0,keyboardCondition:null,disableLayout:!1,overview:!0,center:!0,touch:!0,loop:!1,rtl:!1,navigationMode:"default",shuffle:!1,fragments:!0,fragmentInURL:!0,embedded:!1,help:!0,pause:!0,showNotes:!1,showHiddenSlides:!1,autoPlayMedia:null,preloadIframes:null,autoAnimate:!0,autoAnimateMatcher:null,autoAnimateEasing:"ease",autoAnimateDuration:1,autoAnimateUnmatched:!0,autoAnimateStyles:["opacity","color","background-color","padding","font-size","line-height","letter-spacing","border-width","border-color","border-radius","outline","outline-offset"],autoSlide:0,autoSlideStoppable:!0,autoSlideMethod:null,defaultTiming:null,mouseWheel:!1,previewLinks:!1,postMessage:!0,postMessageEvents:!1,focusBodyOnPageVisibilityChange:!0,transition:"slide",transitionSpeed:"default",backgroundTransition:"fade",parallaxBackgroundImage:"",parallaxBackgroundSize:"",parallaxBackgroundRepeat:"",parallaxBackgroundPosition:"",parallaxBackgroundHorizontal:null,parallaxBackgroundVertical:null,view:null,scrollLayout:"full",scrollSnap:"mandatory",scrollProgress:"auto",scrollActivationWidth:435,pdfMaxPagesPerSlide:Number.POSITIVE_INFINITY,pdfSeparateFragments:!0,pdfPageHeightOffset:-1,viewDistance:3,mobileViewDistance:2,display:"block",hideInactiveCursor:!0,hideCursorTime:5e3,sortFragmentsOnSync:!0,dependencies:[],plugins:[]},Ju="5.2.1";function Qu(e,t){arguments.length<2&&(t=arguments[0],e=document.querySelector(".reveal"));let r={},a,i,c,d,u,f={},k=!1,w=!1,x={hasNavigatedHorizontally:!1,hasNavigatedVertically:!1},h=[],g=1,z={layout:"",overview:""},E={},B="idle",H=0,O=0,X=-1,$=!1,V=new Ui(r),G=new Vi(r),ee=new Wi(r),le=new Xi(r),ie=new Gi(r),I=new Zi(r),de=new Ki(r),ke=new Yi(r),ve=new Ji(r),Ee=new Qi(r),Le=new eo(r),ce=new to(r),ht=new ro(r),Tr=new ao(r),yt=new no(r),Ve=new so(r),wt=new oo(r),ba=new io(r),St=new co(r);function os(){k!==!1&&(w=!0,f.showHiddenSlides||me(E.wrapper,'section[data-visibility="hidden"]').forEach(R=>{let j=R.parentNode;j.childElementCount===1&&/section/i.test(j.nodeName)?j.remove():R.remove()}),function(){E.slides.classList.add("no-transition"),ga?E.wrapper.classList.add("no-hover"):E.wrapper.classList.remove("no-hover"),ie.render(),G.render(),ee.render(),ce.render(),ht.render(),St.render(),E.pauseOverlay=((R,j,Y,Q="")=>{let re=R.querySelectorAll("."+Y);for(let Ae=0;Ae<re.length;Ae++){let Be=re[Ae];if(Be.parentNode===R)return Be}let ye=document.createElement(j);return ye.className=Y,ye.innerHTML=Q,R.appendChild(ye),ye})(E.wrapper,"div","pause-overlay",f.controls?'<button class="resume-button">Resume presentation</button>':null),E.statusElement=function(){let R=E.wrapper.querySelector(".aria-status");return R||(R=document.createElement("div"),R.style.position="absolute",R.style.height="1px",R.style.width="1px",R.style.overflow="hidden",R.style.clip="rect( 1px, 1px, 1px, 1px )",R.classList.add("aria-status"),R.setAttribute("aria-live","polite"),R.setAttribute("aria-atomic","true"),E.wrapper.appendChild(R)),R}(),E.wrapper.setAttribute("role","application")}(),f.postMessage&&window.addEventListener("message",Lt,!1),setInterval(()=>{(!I.isActive()&&E.wrapper.scrollTop!==0||E.wrapper.scrollLeft!==0)&&(E.wrapper.scrollTop=0,E.wrapper.scrollLeft=0)},1e3),document.addEventListener("fullscreenchange",or),document.addEventListener("webkitfullscreenchange",or),Gt().forEach(R=>{me(R,"section").forEach((j,Y)=>{Y>0&&(j.classList.remove("present"),j.classList.remove("past"),j.classList.add("future"),j.setAttribute("aria-hidden","true"))})}),nn(),ie.update(!0),function(){let R=f.view==="print",j=f.view==="scroll"||f.view==="reader";(R||j)&&(R?Gr():ba.unbind(),E.viewport.classList.add("loading-scroll-mode"),R?document.readyState==="complete"?de.activate():window.addEventListener("load",()=>de.activate()):I.activate())}(),Le.readURL(),setTimeout(()=>{E.slides.classList.remove("no-transition"),E.wrapper.classList.add("ready"),pt({type:"ready",data:{indexh:a,indexv:i,currentSlide:d}})},1))}function ka(R){E.statusElement.textContent=R}function Wr(R){let j="";if(R.nodeType===3)j+=R.textContent;else if(R.nodeType===1){let Y=R.getAttribute("aria-hidden"),Q=window.getComputedStyle(R).display==="none";Y==="true"||Q||Array.from(R.childNodes).forEach(re=>{j+=Wr(re)})}return j=j.trim(),j===""?"":j+" "}function nn(R){let j={...f};if(typeof R=="object"&&ma(f,R),r.isReady()===!1)return;let Y=E.wrapper.querySelectorAll(Ur).length;E.wrapper.classList.remove(j.transition),E.wrapper.classList.add(f.transition),E.wrapper.setAttribute("data-transition-speed",f.transitionSpeed),E.wrapper.setAttribute("data-background-transition",f.backgroundTransition),E.viewport.style.setProperty("--slide-width",typeof f.width=="string"?f.width:f.width+"px"),E.viewport.style.setProperty("--slide-height",typeof f.height=="string"?f.height:f.height+"px"),f.shuffle&&Ea(),ji(E.wrapper,"embedded",f.embedded),ji(E.wrapper,"rtl",f.rtl),ji(E.wrapper,"center",f.center),f.pause===!1&&Rr(),le.reset(),u&&(u.destroy(),u=null),Y>1&&f.autoSlide&&f.autoSlideStoppable&&(u=new lo(E.wrapper,()=>Math.min(Math.max((Date.now()-X)/H,0),1)),u.on("click",be),$=!1),f.navigationMode!=="default"?E.wrapper.setAttribute("data-navigation-mode",f.navigationMode):E.wrapper.removeAttribute("data-navigation-mode"),St.configure(f,j),wt.configure(f,j),Tr.configure(f,j),ce.configure(f,j),ht.configure(f,j),Ee.configure(f,j),ke.configure(f,j),G.configure(f,j),Sa()}function sn(){window.addEventListener("resize",qa,!1),f.touch&&ba.bind(),f.keyboard&&Ee.bind(),f.progress&&ht.bind(),f.respondToHashChanges&&Le.bind(),ce.bind(),wt.bind(),E.slides.addEventListener("click",Ma,!1),E.slides.addEventListener("transitionend",L,!1),E.pauseOverlay.addEventListener("click",Rr,!1),f.focusBodyOnPageVisibilityChange&&document.addEventListener("visibilitychange",Ra,!1)}function Gr(){ba.unbind(),wt.unbind(),Ee.unbind(),ce.unbind(),ht.unbind(),Le.unbind(),window.removeEventListener("resize",qa,!1),E.slides.removeEventListener("click",Ma,!1),E.slides.removeEventListener("transitionend",L,!1),E.pauseOverlay.removeEventListener("click",Rr,!1)}function on(R,j,Y){e.addEventListener(R,j,Y)}function _a(R,j,Y){e.removeEventListener(R,j,Y)}function wa(R){typeof R.layout=="string"&&(z.layout=R.layout),typeof R.overview=="string"&&(z.overview=R.overview),z.layout?Dr(E.slides,z.layout+" "+z.overview):Dr(E.slides,z.overview)}function pt({target:R=E.wrapper,type:j,data:Y,bubbles:Q=!0}){let re=document.createEvent("HTMLEvents",1,2);return re.initEvent(j,Q,!0),ma(re,Y),R.dispatchEvent(re),R===E.wrapper&&va(j),re}function cn(R){pt({type:"slidechanged",data:{indexh:a,indexv:i,previousSlide:c,currentSlide:d,origin:R}})}function va(R,j){if(f.postMessageEvents&&window.parent!==window.self){let Y={namespace:"reveal",eventName:R,state:v()};ma(Y,j),window.parent.postMessage(JSON.stringify(Y),"*")}}function qe(){if(E.wrapper&&!de.isActive()){let R=E.viewport.offsetWidth,j=E.viewport.offsetHeight;if(!f.disableLayout){ga&&!f.embedded&&document.documentElement.style.setProperty("--vh",.01*window.innerHeight+"px");let Y=I.isActive()?Et(R,j):Et(),Q=g;te(f.width,f.height),E.slides.style.width=Y.width+"px",E.slides.style.height=Y.height+"px",g=Math.min(Y.presentationWidth/Y.width,Y.presentationHeight/Y.height),g=Math.max(g,f.minScale),g=Math.min(g,f.maxScale),g===1||I.isActive()?(E.slides.style.zoom="",E.slides.style.left="",E.slides.style.top="",E.slides.style.bottom="",E.slides.style.right="",wa({layout:""})):(E.slides.style.zoom="",E.slides.style.left="50%",E.slides.style.top="50%",E.slides.style.bottom="auto",E.slides.style.right="auto",wa({layout:"translate(-50%, -50%) scale("+g+")"}));let re=Array.from(E.wrapper.querySelectorAll(Ur));for(let ye=0,Ae=re.length;ye<Ae;ye++){let Be=re[ye];Be.style.display!=="none"&&(f.center||Be.classList.contains("center")?Be.classList.contains("stack")?Be.style.top=0:Be.style.top=Math.max((Y.height-Be.scrollHeight)/2,0)+"px":Be.style.top="")}Q!==g&&pt({type:"resize",data:{oldScale:Q,scale:g,size:Y}})}(function(){if(E.wrapper&&!f.disableLayout&&!de.isActive()&&typeof f.scrollActivationWidth=="number"&&f.view!=="scroll"){let Y=Et();Y.presentationWidth>0&&Y.presentationWidth<=f.scrollActivationWidth?I.isActive()||(ie.create(),I.activate()):I.isActive()&&I.deactivate()}})(),E.viewport.style.setProperty("--slide-scale",g),E.viewport.style.setProperty("--viewport-width",R+"px"),E.viewport.style.setProperty("--viewport-height",j+"px"),I.layout(),ht.update(),ie.updateParallax(),ve.isActive()&&ve.update()}}function te(R,j){me(E.slides,"section > .stretch, section > .r-stretch").forEach(Y=>{let Q=((re,ye=0)=>{if(re){let Ae,Be=re.style.height;return re.style.height="0px",re.parentNode.style.height="auto",Ae=ye-re.parentNode.offsetHeight,re.style.height=Be+"px",re.parentNode.style.removeProperty("height"),Ae}return ye})(Y,j);if(/(img|video)/gi.test(Y.nodeName)){let re=Y.naturalWidth||Y.videoWidth,ye=Y.naturalHeight||Y.videoHeight,Ae=Math.min(R/re,Q/ye);Y.style.width=re*Ae+"px",Y.style.height=ye*Ae+"px"}else Y.style.width=R+"px",Y.style.height=Q+"px"})}function Et(R,j){let Y=f.width,Q=f.height;f.disableLayout&&(Y=E.slides.offsetWidth,Q=E.slides.offsetHeight);let re={width:Y,height:Q,presentationWidth:R||E.wrapper.offsetWidth,presentationHeight:j||E.wrapper.offsetHeight};return re.presentationWidth-=re.presentationWidth*f.margin,re.presentationHeight-=re.presentationHeight*f.margin,typeof re.width=="string"&&/%$/.test(re.width)&&(re.width=parseInt(re.width,10)/100*re.presentationWidth),typeof re.height=="string"&&/%$/.test(re.height)&&(re.height=parseInt(re.height,10)/100*re.presentationHeight),re}function xa(R,j){typeof R=="object"&&typeof R.setAttribute=="function"&&R.setAttribute("data-previous-indexv",j||0)}function za(R){if(typeof R=="object"&&typeof R.setAttribute=="function"&&R.classList.contains("stack")){let j=R.hasAttribute("data-start-indexv")?"data-start-indexv":"data-previous-indexv";return parseInt(R.getAttribute(j)||0,10)}return 0}function Mr(R=d){return R&&R.parentNode&&!!R.parentNode.nodeName.match(/section/i)}function Aa(){return!(!d||!Mr(d))&&!d.nextElementSibling}function mr(){return a===0&&i===0}function qr(){return!!d&&!d.nextElementSibling&&(!Mr(d)||!d.parentNode.nextElementSibling)}function ln(){if(f.pause){let R=E.wrapper.classList.contains("paused");Fe(),E.wrapper.classList.add("paused"),R===!1&&pt({type:"paused"})}}function Rr(){let R=E.wrapper.classList.contains("paused");E.wrapper.classList.remove("paused"),D(),R&&pt({type:"resumed"})}function bt(R){typeof R=="boolean"?R?ln():Rr():kt()?Rr():ln()}function kt(){return E.wrapper.classList.contains("paused")}function tt(R,j,Y,Q){if(pt({type:"beforeslidechange",data:{indexh:R===void 0?a:R,indexv:j===void 0?i:j,origin:Q}}).defaultPrevented)return;c=d;let re=E.wrapper.querySelectorAll(Cr);if(I.isActive()){let W=I.getSlideByIndices(R,j);return void(W&&I.scrollToSlide(W))}if(re.length===0)return;j!==void 0||ve.isActive()||(j=za(re[R])),c&&c.parentNode&&c.parentNode.classList.contains("stack")&&xa(c.parentNode,i);let ye=h.concat();h.length=0;let Ae=a||0,Be=i||0;a=Ct(Cr,R===void 0?a:R),i=Ct(Uu,j===void 0?i:j);let vt=a!==Ae||i!==Be;vt||(c=null);let cr=re[a],ct=cr.querySelectorAll("section");e.classList.toggle("is-vertical-slide",ct.length>1),d=ct[i]||cr;let je=!1;vt&&c&&d&&!ve.isActive()&&(B="running",je=Lr(c,d,Ae,Be),je&&E.slides.classList.add("disable-slide-transitions")),Da(),qe(),ve.isActive()&&ve.update(),Y!==void 0&&ke.goto(Y),c&&c!==d&&(c.classList.remove("present"),c.setAttribute("aria-hidden","true"),mr()&&setTimeout(()=>{me(E.wrapper,Cr+".stack").forEach(W=>{xa(W,0)})},0));e:for(let W=0,Xt=h.length;W<Xt;W++){for(let Ot=0;Ot<ye.length;Ot++)if(ye[Ot]===h[W]){ye.splice(Ot,1);continue e}E.viewport.classList.add(h[W]),pt({type:h[W]})}for(;ye.length;)E.viewport.classList.remove(ye.pop());vt&&cn(Q),!vt&&c||(V.stopEmbeddedContent(c),V.startEmbeddedContent(d)),requestAnimationFrame(()=>{ka(Wr(d))}),ht.update(),ce.update(),St.update(),ie.update(),ie.updateParallax(),G.update(),ke.update(),Le.writeURL(),D(),je&&(setTimeout(()=>{E.slides.classList.remove("disable-slide-transitions")},0),f.autoAnimate&&le.run(c,d))}function Lr(R,j,Y,Q){return R.hasAttribute("data-auto-animate")&&j.hasAttribute("data-auto-animate")&&R.getAttribute("data-auto-animate-id")===j.getAttribute("data-auto-animate-id")&&!(a>Y||i>Q?j:R).hasAttribute("data-auto-animate-restart")}function Sa(){Gr(),sn(),qe(),H=f.autoSlide,D(),ie.create(),Le.writeURL(),f.sortFragmentsOnSync===!0&&ke.sortAll(),ce.update(),ht.update(),Da(),St.update(),St.updateVisibility(),Ve.update(),ie.update(!0),G.update(),V.formatEmbeddedContent(),f.autoPlayMedia===!1?V.stopEmbeddedContent(d,{unloadIframes:!1}):V.startEmbeddedContent(d),ve.isActive()&&ve.layout()}function Ea(R=Gt()){R.forEach((j,Y)=>{let Q=R[Math.floor(Math.random()*R.length)];Q.parentNode===j.parentNode&&j.parentNode.insertBefore(j,Q);let re=j.querySelectorAll("section");re.length&&Ea(re)})}function Ct(R,j){let Y=me(E.wrapper,R),Q=Y.length,re=I.isActive()||de.isActive(),ye=!1,Ae=!1;if(Q){f.loop&&(j>=Q&&(ye=!0),(j%=Q)<0&&(j=Q+j,Ae=!0)),j=Math.max(Math.min(j,Q-1),0);for(let ct=0;ct<Q;ct++){let je=Y[ct],W=f.rtl&&!Mr(je);je.classList.remove("past"),je.classList.remove("present"),je.classList.remove("future"),je.setAttribute("hidden",""),je.setAttribute("aria-hidden","true"),je.querySelector("section")&&je.classList.add("stack"),re?je.classList.add("present"):ct<j?(je.classList.add(W?"future":"past"),f.fragments&&Fr(je)):ct>j?(je.classList.add(W?"past":"future"),f.fragments&&Ca(je)):ct===j&&f.fragments&&(ye?Ca(je):Ae&&Fr(je))}let Be=Y[j],vt=Be.classList.contains("present");Be.classList.add("present"),Be.removeAttribute("hidden"),Be.removeAttribute("aria-hidden"),vt||pt({target:Be,type:"visible",bubbles:!1});let cr=Be.getAttribute("data-state");cr&&(h=h.concat(cr.split(" ")))}else j=0;return j}function Fr(R){me(R,".fragment").forEach(j=>{j.classList.add("visible"),j.classList.remove("current-fragment")})}function Ca(R){me(R,".fragment.visible").forEach(j=>{j.classList.remove("visible","current-fragment")})}function Da(){let R,j,Y=Gt(),Q=Y.length;if(Q&&a!==void 0){let re=ve.isActive()?10:f.viewDistance;ga&&(re=ve.isActive()?6:f.mobileViewDistance),de.isActive()&&(re=Number.MAX_VALUE);for(let ye=0;ye<Q;ye++){let Ae=Y[ye],Be=me(Ae,"section"),vt=Be.length;if(R=Math.abs((a||0)-ye)||0,f.loop&&(R=Math.abs(((a||0)-ye)%(Q-re))||0),R<re?V.load(Ae):V.unload(Ae),vt){let cr=za(Ae);for(let ct=0;ct<vt;ct++){let je=Be[ct];j=Math.abs(ye===(a||0)?(i||0)-ct:ct-cr),R+j<re?V.load(je):V.unload(je)}}}m()?E.wrapper.classList.add("has-vertical-slides"):E.wrapper.classList.remove("has-vertical-slides"),$e()?E.wrapper.classList.add("has-horizontal-slides"):E.wrapper.classList.remove("has-horizontal-slides")}}function Dt({includeFragments:R=!1}={}){let j=E.wrapper.querySelectorAll(Cr),Y=E.wrapper.querySelectorAll(Uu),Q={left:a>0,right:a<j.length-1,up:i>0,down:i<Y.length-1};if(f.loop&&(j.length>1&&(Q.left=!0,Q.right=!0),Y.length>1&&(Q.up=!0,Q.down=!0)),j.length>1&&f.navigationMode==="linear"&&(Q.right=Q.right||Q.down,Q.left=Q.left||Q.up),R===!0){let re=ke.availableRoutes();Q.left=Q.left||re.prev,Q.up=Q.up||re.prev,Q.down=Q.down||re.next,Q.right=Q.right||re.next}if(f.rtl){let re=Q.left;Q.left=Q.right,Q.right=re}return Q}function Xr(R=d){let j=Gt(),Y=0;e:for(let Q=0;Q<j.length;Q++){let re=j[Q],ye=re.querySelectorAll("section");for(let Ae=0;Ae<ye.length;Ae++){if(ye[Ae]===R)break e;ye[Ae].dataset.visibility!=="uncounted"&&Y++}if(re===R)break;re.classList.contains("stack")===!1&&re.dataset.visibility!=="uncounted"&&Y++}return Y}function un(R){let j,Y=a,Q=i;if(R)if(I.isActive())Y=parseInt(R.getAttribute("data-index-h"),10),R.getAttribute("data-index-v")&&(Q=parseInt(R.getAttribute("data-index-v"),10));else{let re=Mr(R),ye=re?R.parentNode:R,Ae=Gt();Y=Math.max(Ae.indexOf(ye),0),Q=void 0,re&&(Q=Math.max(me(R.parentNode,"section").indexOf(R),0))}if(!R&&d&&d.querySelectorAll(".fragment").length>0){let re=d.querySelector(".current-fragment");j=re&&re.hasAttribute("data-fragment-index")?parseInt(re.getAttribute("data-fragment-index"),10):d.querySelectorAll(".fragment.visible").length-1}return{h:Y,v:Q,f:j}}function Ta(){return me(E.wrapper,Ur+':not(.stack):not([data-visibility="uncounted"])')}function Gt(){return me(E.wrapper,Cr)}function Br(){return me(E.wrapper,".slides>section>section")}function $e(){return Gt().length>1}function m(){return Br().length>1}function y(){return Ta().length}function K(R,j){let Y=Gt()[R],Q=Y&&Y.querySelectorAll("section");return Q&&Q.length&&typeof j=="number"?Q?Q[j]:void 0:Y}function v(){let R=un();return{indexh:R.h,indexv:R.v,indexf:R.f,paused:kt(),overview:ve.isActive(),...Ve.getState()}}function D(){if(Fe(),d&&f.autoSlide!==!1){let R=d.querySelector(".current-fragment[data-autoslide]"),j=R?R.getAttribute("data-autoslide"):null,Y=d.parentNode?d.parentNode.getAttribute("data-autoslide"):null,Q=d.getAttribute("data-autoslide");j?H=parseInt(j,10):Q?H=parseInt(Q,10):Y?H=parseInt(Y,10):(H=f.autoSlide,d.querySelectorAll(".fragment").length===0&&me(d,"video, audio").forEach(re=>{re.hasAttribute("data-autoplay")&&H&&1e3*re.duration/re.playbackRate>H&&(H=1e3*re.duration/re.playbackRate+1e3)})),!H||$||kt()||ve.isActive()||qr()&&!ke.availableRoutes().next&&f.loop!==!0||(O=setTimeout(()=>{typeof f.autoSlideMethod=="function"?f.autoSlideMethod():T(),D()},H),X=Date.now()),u&&u.setPlaying(O!==-1)}}function Fe(){clearTimeout(O),O=-1}function ne(){H&&!$&&($=!0,pt({type:"autoslidepaused"}),clearTimeout(O),u&&u.setPlaying(!1))}function Ke(){H&&$&&($=!1,pt({type:"autoslideresumed"}),D())}function jt({skipFragments:R=!1}={}){if(x.hasNavigatedHorizontally=!0,I.isActive())return I.prev();f.rtl?(ve.isActive()||R||ke.next()===!1)&&Dt().left&&tt(a+1,f.navigationMode==="grid"?i:void 0):(ve.isActive()||R||ke.prev()===!1)&&Dt().left&&tt(a-1,f.navigationMode==="grid"?i:void 0)}function pe({skipFragments:R=!1}={}){if(x.hasNavigatedHorizontally=!0,I.isActive())return I.next();f.rtl?(ve.isActive()||R||ke.prev()===!1)&&Dt().right&&tt(a-1,f.navigationMode==="grid"?i:void 0):(ve.isActive()||R||ke.next()===!1)&&Dt().right&&tt(a+1,f.navigationMode==="grid"?i:void 0)}function Ue({skipFragments:R=!1}={}){if(I.isActive())return I.prev();(ve.isActive()||R||ke.prev()===!1)&&Dt().up&&tt(a,i-1)}function ft({skipFragments:R=!1}={}){if(x.hasNavigatedVertically=!0,I.isActive())return I.next();(ve.isActive()||R||ke.next()===!1)&&Dt().down&&tt(a,i+1)}function Pr({skipFragments:R=!1}={}){if(I.isActive())return I.prev();if(R||ke.prev()===!1)if(Dt().up)Ue({skipFragments:R});else{let j;if(j=f.rtl?me(E.wrapper,Cr+".future").pop():me(E.wrapper,Cr+".past").pop(),j&&j.classList.contains("stack")){let Y=j.querySelectorAll("section").length-1||void 0;tt(a-1,Y)}else f.rtl?pe({skipFragments:R}):jt({skipFragments:R})}}function T({skipFragments:R=!1}={}){if(x.hasNavigatedHorizontally=!0,x.hasNavigatedVertically=!0,I.isActive())return I.next();if(R||ke.next()===!1){let j=Dt();j.down&&j.right&&f.loop&&Aa()&&(j.down=!1),j.down?ft({skipFragments:R}):f.rtl?jt({skipFragments:R}):pe({skipFragments:R})}}function Lt(R){let j=R.data;if(typeof j=="string"&&j.charAt(0)==="{"&&j.charAt(j.length-1)==="}"&&(j=JSON.parse(j),j.method&&typeof r[j.method]=="function"))if(Ey.test(j.method)===!1){let Y=r[j.method].apply(r,j.args);va("callback",{method:j.method,result:Y})}else console.warn('reveal.js: "'+j.method+'" is is blacklisted from the postMessage API')}function L(R){B==="running"&&/section/gi.test(R.target.nodeName)&&(B="idle",pt({type:"slidetransitionend",data:{indexh:a,indexv:i,previousSlide:c,currentSlide:d}}))}function Ma(R){let j=gt(R.target,'a[href^="#"]');if(j){let Y=j.getAttribute("href"),Q=Le.getIndicesFromHash(Y);Q&&(r.slide(Q.h,Q.v,Q.f),R.preventDefault())}}function qa(R){qe()}function Ra(R){document.hidden===!1&&document.activeElement!==document.body&&(typeof document.activeElement.blur=="function"&&document.activeElement.blur(),document.body.focus())}function or(R){(document.fullscreenElement||document.webkitFullscreenElement)===E.wrapper&&(R.stopImmediatePropagation(),setTimeout(()=>{r.layout(),r.focus.focus()},1))}function be(R){qr()&&f.loop===!1?(tt(0,0),Ke()):$?Ke():ne()}let Zr={VERSION:Ju,initialize:function(R){if(!e)throw'Unable to find presentation root (<div class="reveal">).';if(k)throw"Reveal.js has already been initialized.";if(k=!0,E.wrapper=e,E.slides=e.querySelector(".slides"),!E.slides)throw'Unable to find slides container (<div class="slides">).';return f={...Cy,...f,...t,...R,...$u()},/print-pdf/gi.test(window.location.search)&&(f.view="print"),function(){f.embedded===!0?E.viewport=gt(e,".reveal-viewport")||e:(E.viewport=document.body,document.documentElement.classList.add("reveal-full-page")),E.viewport.classList.add("reveal-viewport")}(),window.addEventListener("load",qe,!1),yt.load(f.plugins,f.dependencies).then(os),new Promise(j=>r.on("ready",j))},configure:nn,destroy:function(){k=!1,w!==!1&&(Gr(),Fe(),St.destroy(),wt.destroy(),Ve.destroy(),yt.destroy(),Tr.destroy(),ce.destroy(),ht.destroy(),ie.destroy(),G.destroy(),ee.destroy(),document.removeEventListener("fullscreenchange",or),document.removeEventListener("webkitfullscreenchange",or),document.removeEventListener("visibilitychange",Ra,!1),window.removeEventListener("message",Lt,!1),window.removeEventListener("load",qe,!1),E.pauseOverlay&&E.pauseOverlay.remove(),E.statusElement&&E.statusElement.remove(),document.documentElement.classList.remove("reveal-full-page"),E.wrapper.classList.remove("ready","center","has-horizontal-slides","has-vertical-slides"),E.wrapper.removeAttribute("data-transition-speed"),E.wrapper.removeAttribute("data-background-transition"),E.viewport.classList.remove("reveal-viewport"),E.viewport.style.removeProperty("--slide-width"),E.viewport.style.removeProperty("--slide-height"),E.slides.style.removeProperty("width"),E.slides.style.removeProperty("height"),E.slides.style.removeProperty("zoom"),E.slides.style.removeProperty("left"),E.slides.style.removeProperty("top"),E.slides.style.removeProperty("bottom"),E.slides.style.removeProperty("right"),E.slides.style.removeProperty("transform"),Array.from(E.wrapper.querySelectorAll(Ur)).forEach(R=>{R.style.removeProperty("display"),R.style.removeProperty("top"),R.removeAttribute("hidden"),R.removeAttribute("aria-hidden")}))},sync:Sa,syncSlide:function(R=d){ie.sync(R),ke.sync(R),V.load(R),ie.update(),St.update()},syncFragments:ke.sync.bind(ke),slide:tt,left:jt,right:pe,up:Ue,down:ft,prev:Pr,next:T,navigateLeft:jt,navigateRight:pe,navigateUp:Ue,navigateDown:ft,navigatePrev:Pr,navigateNext:T,navigateFragment:ke.goto.bind(ke),prevFragment:ke.prev.bind(ke),nextFragment:ke.next.bind(ke),on,off:_a,addEventListener:on,removeEventListener:_a,layout:qe,shuffle:Ea,availableRoutes:Dt,availableFragments:ke.availableRoutes.bind(ke),toggleHelp:Ve.toggleHelp.bind(Ve),toggleOverview:ve.toggle.bind(ve),toggleScrollView:I.toggle.bind(I),togglePause:bt,toggleAutoSlide:function(R){typeof R=="boolean"?R?Ke():ne():$?Ke():ne()},toggleJumpToSlide:function(R){typeof R=="boolean"?R?ee.show():ee.hide():ee.isVisible()?ee.hide():ee.show()},isFirstSlide:mr,isLastSlide:qr,isLastVerticalSlide:Aa,isVerticalSlide:Mr,isVerticalStack:function(R=d){return R.classList.contains(".stack")||R.querySelector("section")!==null},isPaused:kt,isAutoSliding:function(){return!(!H||$)},isSpeakerNotes:St.isSpeakerNotesWindow.bind(St),isOverview:ve.isActive.bind(ve),isFocused:wt.isFocused.bind(wt),isOverlayOpen:Ve.isOpen.bind(Ve),isScrollView:I.isActive.bind(I),isPrintView:de.isActive.bind(de),isReady:()=>w,loadSlide:V.load.bind(V),unloadSlide:V.unload.bind(V),startEmbeddedContent:()=>V.startEmbeddedContent(d),stopEmbeddedContent:()=>V.stopEmbeddedContent(d,{unloadIframes:!1}),previewIframe:Ve.previewIframe.bind(Ve),previewImage:Ve.previewImage.bind(Ve),previewVideo:Ve.previewVideo.bind(Ve),showPreview:Ve.previewIframe.bind(Ve),hidePreview:Ve.close.bind(Ve),addEventListeners:sn,removeEventListeners:Gr,dispatchEvent:pt,getState:v,setState:function(R){if(typeof R=="object"){tt(pa(R.indexh),pa(R.indexv),pa(R.indexf));let j=pa(R.paused),Y=pa(R.overview);typeof j=="boolean"&&j!==kt()&&bt(j),typeof Y=="boolean"&&Y!==ve.isActive()&&ve.toggle(Y),Ve.setState(R)}},getProgress:function(){let R=y(),j=Xr();if(d){let Y=d.querySelectorAll(".fragment");Y.length>0&&(j+=d.querySelectorAll(".fragment.visible").length/Y.length*.9)}return Math.min(j/(R-1),1)},getIndices:un,getSlidesAttributes:function(){return Ta().map(R=>{let j={};for(let Y=0;Y<R.attributes.length;Y++){let Q=R.attributes[Y];j[Q.name]=Q.value}return j})},getSlidePastCount:Xr,getTotalSlides:y,getSlide:K,getPreviousSlide:()=>c,getCurrentSlide:()=>d,getSlideBackground:function(R,j){let Y=typeof R=="number"?K(R,j):R;if(Y)return Y.slideBackgroundElement},getSlideNotes:St.getSlideNotes.bind(St),getSlides:Ta,getHorizontalSlides:Gt,getVerticalSlides:Br,hasHorizontalSlides:$e,hasVerticalSlides:m,hasNavigatedHorizontally:()=>x.hasNavigatedHorizontally,hasNavigatedVertically:()=>x.hasNavigatedVertically,shouldAutoAnimateBetween:Lr,addKeyBinding:Ee.addKeyBinding.bind(Ee),removeKeyBinding:Ee.removeKeyBinding.bind(Ee),triggerKey:Ee.triggerKey.bind(Ee),registerKeyboardShortcut:Ee.registerKeyboardShortcut.bind(Ee),getComputedSlideSize:Et,setCurrentScrollPage:function(R,j,Y){let Q=a||0;a=j,i=Y;let re=d!==R;c=d,d=R,d&&c&&f.autoAnimate&&Lr(c,d,Q,i)&&le.run(c,d),re&&(c&&(V.stopEmbeddedContent(c),V.stopEmbeddedContent(c.slideBackgroundElement)),V.startEmbeddedContent(d),V.startEmbeddedContent(d.slideBackgroundElement)),requestAnimationFrame(()=>{ka(Wr(d))}),cn()},getScale:()=>g,getConfig:()=>f,getQueryHash:$u,getSlidePath:Le.getHash.bind(Le),getRevealElement:()=>e,getSlidesElement:()=>E.slides,getViewportElement:()=>E.viewport,getBackgroundsElement:()=>ie.element,registerPlugin:yt.registerPlugin.bind(yt),hasPlugin:yt.hasPlugin.bind(yt),getPlugin:yt.getPlugin.bind(yt),getPlugins:yt.getRegisteredPlugins.bind(yt)};return ma(r,{...Zr,announceStatus:ka,getStatusText:Wr,focus:wt,scroll:I,progress:ht,controls:ce,location:Le,overview:ve,keyboard:Ee,fragments:ke,backgrounds:ie,slideContent:V,slideNumber:G,onUserInput:function(R){f.autoSlideStoppable&&ne()},closeOverlay:Ve.close.bind(Ve),updateSlidesVisibility:Da,layoutSlideContents:te,transformSlides:wa,cueAutoSlide:D,cancelAutoSlide:Fe}),Zr}var Ne=Qu,Xu=[];Ne.initialize=e=>(Object.assign(Ne,new Qu(document.querySelector(".reveal"),e)),Xu.map(t=>t(Ne)),Ne.initialize()),["configure","on","off","addEventListener","removeEventListener","registerPlugin"].forEach(e=>{Ne[e]=(...t)=>{Xu.push(r=>r[e].call(null,...t))}}),Ne.isReady=()=>!1,Ne.VERSION=Ju;var Dy="0.3.0";function uo(e){return new Promise((t,r)=>{if(!e||document.querySelector(`script[data-lib="${e}"]`))return t();let a=document.createElement("script");a.src=e,a.async=!0,a.setAttribute("data-lib",e),a.onload=()=>t(),a.onerror=()=>r(new Error("failed to load "+e)),document.head.appendChild(a)})}function sd(e){let t=e&&e.enhancers||{},r=[];return t.mermaidJs&&document.querySelector(".mermaid")&&r.push(uo(t.mermaidJs)),t.smilesJs&&document.querySelector("canvas[data-smiles]")&&r.push(uo(t.smilesJs)),t.chartJs&&document.querySelector("canvas.orz-chart")&&r.push(uo(t.chartJs)),Promise.all(r).catch(()=>{})}function Ty(){let e=window.__ORZ_SLIDES__||{},t=document.documentElement.getAttribute("data-theme")||e.defaultTheme,r=(e.themes||[]).find(a=>a.id===t);return!!(r&&r.scheme==="dark")}function id(){let e=window;try{if(e.mermaid){e.mermaid.initialize({startOnLoad:!1});let t=e.mermaid.run({querySelector:".mermaid:not([data-processed])"});t&&t.then&&t.then(()=>ns()).catch(()=>{})}}catch{}try{if(e.SmilesDrawer){let t=Ty()?"dark":"light";document.querySelectorAll("canvas[data-smiles]").forEach(r=>{let a=r;if(a.__scheme===t||a.__pending===t)return;a.__pending=t,a.__ow===void 0&&(a.__ow=r.width,a.__oh=r.height),r.width=a.__ow,r.height=a.__oh;let i=new e.SmilesDrawer.Drawer({width:a.__ow,height:a.__oh});e.SmilesDrawer.parse(r.getAttribute("data-smiles"),c=>{try{i.draw(c,r,t,!1),a.__scheme=t}catch{}a.__pending=null,ns()})})}}catch{}try{e.Chart&&(Ne.getCurrentSlide&&Ne.getCurrentSlide()||document).querySelectorAll("canvas.orz-chart[data-chart]").forEach(r=>{if(!e.Chart.getChart(r))try{let a=JSON.parse(r.getAttribute("data-chart")||"{}");a.options=a.options||{},a.options.responsive=!1,a.options.maintainAspectRatio=!1,a.options.animation=!1,new e.Chart(r,a)}catch{}})}catch{}qy(),My()}function My(){location.protocol==="file:"&&document.querySelectorAll(".youtube-embed").forEach(e=>{if(e.__ytFacade)return;let t=e.querySelector("iframe"),a=(t&&t.getAttribute("src")||"").match(/embed\/([\w-]{6,})/);if(!t||!a)return;e.__ytFacade=!0;let i=a[1],c=document.createElement("a");c.href="https://www.youtube.com/watch?v="+i,c.target="_blank",c.rel="noopener noreferrer",c.className="youtube-facade",c.setAttribute("aria-label","Play video on YouTube"),c.style.backgroundImage="url('https://i.ytimg.com/vi/"+i+"/hqdefault.jpg')",c.innerHTML='<span class="youtube-facade-play" aria-hidden="true"></span>',t.replaceWith(c)})}function qy(){document.querySelectorAll(".tabs:not([data-js])").forEach(e=>{let t=Array.from(e.querySelectorAll(":scope > .tab"));if(!t.length)return;let r=document.createElement("div");r.className="tabs-bar",t.forEach((a,i)=>{let c=document.createElement("button");c.className="tabs-bar-btn"+(i===0?" active":""),c.textContent=a.getAttribute("data-label")||"Tab "+(i+1),c.addEventListener("click",()=>{r.querySelectorAll(".tabs-bar-btn").forEach(d=>d.classList.remove("active")),t.forEach(d=>d.classList.remove("active")),c.classList.add("active"),a.classList.add("active")}),r.appendChild(c),i===0&&a.classList.add("active")}),e.insertBefore(r,t[0]),e.setAttribute("data-js","1")})}var ed=.6;function Ry(e){e.style.removeProperty("--region-scale");let t=e.firstElementChild;if(!t)return;let r=1;for(let a=0;a<12&&!(t.scrollHeight<=e.clientHeight+1&&t.scrollWidth<=e.clientWidth+1);a++){if(r-=.07,r<ed){r=ed,e.style.setProperty("--region-scale",String(r));break}e.style.setProperty("--region-scale",String(r))}e.setAttribute("data-scale",r.toFixed(2))}function td(e,t){let r=e.clientWidth,a=t.closest(".markdown-body");if(!a)return{w:r,h:e.clientHeight};let i=t;for(;i.parentElement&&i.parentElement!==a;)i=i.parentElement;let c=0;return Array.prototype.forEach.call(a.children,d=>{d!==i&&(c+=d.offsetHeight)}),{w:r,h:Math.max(40,e.clientHeight-c-6)}}function Ly(e){if(!e.clientWidth||!e.clientHeight)return;e.querySelectorAll(".mermaid svg").forEach(r=>{let a=td(e,r),i=r.viewBox&&r.viewBox.baseVal,c=i&&i.height?i.width/i.height:1,d=a.w,u=d/c;u>a.h&&(u=a.h,d=u*c),r.style.maxWidth="none",r.style.width=Math.floor(d)+"px",r.style.height=Math.floor(u)+"px"});let t=window.Chart;t&&t.getChart&&e.querySelectorAll("canvas.orz-chart").forEach(r=>{let a=t.getChart(r);if(a){let i=td(e,r);try{a.resize(i.w,i.h)}catch{}}})}function ns(){let e=Ne.getCurrentSlide&&Ne.getCurrentSlide()||null;!e||e.getAttribute("data-fit")==="off"||e.querySelectorAll(".orz-region").forEach(t=>{Ry(t),Ly(t)})}function rd(){let e=document.getElementById("orz-deck");return(e&&e.textContent||"").replace(/^\n/,"").replace(/\n\s*$/,"")}function od(e){let t=document.querySelector(".reveal .slides");t&&(t.innerHTML=Ni(rs(e),ho.md)),cd()}var tn=()=>{if(id(),cd())try{Ne.sync()}catch{}ns()};function Fy(e){od(e);try{Ne.sync()}catch{}sd(window.__ORZ_SLIDES__||{}).then(tn)}function By(){let e=window.__ORZ_SLIDES__||{},t=rs(rd());od(rd());let r=(t.config.ratio||e.ratio||"16:9").split(":").map(Number),a=960,i=Math.round(a*(r[1]||9)/(r[0]||16));ss=a,is=i,Ne.initialize({width:a,height:i,margin:.03,minScale:.2,maxScale:4,hash:!0,controls:!0,progress:!0,slideNumber:"c/t"}),window.orzslides.reveal=Ne;try{Ne.addKeyBinding({keyCode:83,key:"S",description:"Speaker view"},pd),Ne.addKeyBinding({keyCode:84,key:"T",description:"Toggle timer/clock"},hd)}catch{}Ne.on("slidechanged",an),Ne.on("fragmentshown",an),Ne.on("fragmenthidden",an);let c=()=>{try{Ne.layout()}catch{}};sd(e).then(()=>{c(),tn()}),Ne.on("slidechanged",()=>{id(),[80,500,1400].forEach(d=>setTimeout(tn,d))}),[200,700,1500,2600].forEach(d=>setTimeout(()=>{c(),tn()},d)),window.addEventListener("resize",()=>setTimeout(()=>{c(),ns()},60)),document.addEventListener("click",d=>{let u=d.target,f=u&&u.closest?u.closest(".qrcode"):null;if(!f)return;let k=f.querySelector("svg");if(!k)return;d.stopPropagation(),d.preventDefault();let w=document.createElement("div");w.className="orz-qr-overlay",w.appendChild(k.cloneNode(!0));let x=()=>{w.remove(),document.removeEventListener("keydown",h,!0)},h=g=>{g.key==="Escape"&&(g.stopPropagation(),g.preventDefault(),x())};w.addEventListener("click",x),document.addEventListener("keydown",h,!0),document.body.appendChild(w)},!0)}function Py(e){let t=[];return Array.prototype.forEach.call(e.children,r=>{let a=r.tagName.toLowerCase();a==="ul"||a==="ol"?Array.prototype.forEach.call(r.children,i=>{i.tagName.toLowerCase()==="li"&&t.push(i)}):t.push(r)}),t}function cd(){let e=!1;return document.querySelectorAll("section[data-step] .orz-region .markdown-body").forEach(t=>{Py(t).forEach(r=>{r.classList.contains("fragment")||(r.classList.add("fragment"),e=!0)})}),e}var ss=960,is=540,rn=0,pr=null,ir=null,Vr={startMs:0,accumMs:0,running:!1,start(){this.running||(this.startMs=Date.now(),this.running=!0)},pause(){this.running&&(this.accumMs+=Date.now()-this.startMs,this.running=!1)},toggle(){this.running?this.pause():this.start()},reset(){this.accumMs=0,this.startMs=Date.now()},elapsed(){return this.accumMs+(this.running?Date.now()-this.startMs:0)}};function ya(e){return e<10?"0"+e:""+e}function ld(e){let t=Math.floor(e/1e3),r=Math.floor(t/3600),a=Math.floor(t%3600/60),i=t%60;return r>0?r+":"+ya(a)+":"+ya(i):a+":"+ya(i)}function ud(){let e=new Date;return ya(e.getHours())+":"+ya(e.getMinutes())+":"+ya(e.getSeconds())}function dd(){rn||(rn=window.setInterval(fo,1e3))}function fo(){let e=!!(ir&&!ir.closed);if(!pr&&!e){rn&&(clearInterval(rn),rn=0);return}if(fd(),e){let t=ir.document,r=(a,i)=>{let c=t.getElementById(a);c&&(c.textContent=i)};r("sv-clock",ud()),r("sv-timer",ld(Vr.elapsed())),r("sv-ttoggle",Vr.running?"Pause":"Start")}}function fd(){pr&&(pr.innerHTML='<span class="orz-timer-clock">'+ud()+'</span><span class="orz-timer-elapsed">'+ld(Vr.elapsed())+"</span>")}function hd(){if(pr){pr.remove(),pr=null;return}Vr.start(),pr=document.createElement("div"),pr.className="orz-timer",document.body.appendChild(pr),fd(),dd()}function Iy(){return Array.prototype.slice.call(document.querySelectorAll(".reveal > .slides > section"))}function ad(e){if(!e)return'<div class="sv-end">\u2014 End \u2014</div>';let t=e.cloneNode(!0);return t.querySelectorAll("aside.notes").forEach(r=>r.remove()),t.classList.add("present"),t.removeAttribute("hidden"),t.style.cssText="",'<div class="reveal"><div class="slides">'+t.outerHTML+"</div></div>"}function nd(e){let t=e.querySelector(".slides");if(!t||!e.clientWidth)return;let r=e.clientWidth/ss;t.style.transform="scale("+r+")",e.style.height=is*r+"px"}function an(){if(!ir||ir.closed)return;let e=ir.document,t=Ne.getCurrentSlide&&Ne.getCurrentSlide()||null,r=Iy(),a=t?r.indexOf(t):-1,i=a>=0&&r[a+1]||null,c=e.getElementById("sv-cur"),d=e.getElementById("sv-nxt"),u=e.getElementById("sv-notes"),f=e.getElementById("sv-pos");if(c&&(c.innerHTML=ad(t),nd(c)),d&&(d.innerHTML=ad(i),nd(d)),u){let k=t?t.querySelector("aside.notes"):null;u.innerHTML=k&&k.innerHTML.trim()?k.innerHTML:'<em class="sv-nonotes">No notes for this slide.</em>'}f&&(f.textContent=a+1+" / "+r.length)}function Ny(e){return'<!DOCTYPE html><html><head><meta charset="utf-8"><title>Speaker View \u2014 orz-slides</title>'+e+"<style>*{box-sizing:border-box}html,body{margin:0;height:100%;background:#16161a;color:#e8e8ea;font:14px/1.45 system-ui,-apple-system,sans-serif}.sv-top{display:flex;align-items:center;gap:18px;padding:8px 16px;background:#000;border-bottom:1px solid #2a2a30}.sv-clock{font-size:20px;font-variant-numeric:tabular-nums;opacity:.85}.sv-tbox{display:flex;align-items:center;gap:8px}.sv-tbox #sv-timer{font-size:22px;font-variant-numeric:tabular-nums;min-width:74px}.sv-tbox button{font:inherit;font-size:12px;padding:3px 10px;border:1px solid #4a4a52;background:#23232a;color:#e8e8ea;border-radius:6px;cursor:pointer}.sv-tbox button:hover{background:#30303a}.sv-pos{margin-left:auto;font-size:17px;opacity:.8;font-variant-numeric:tabular-nums}.sv-main{display:grid;grid-template-columns:1.7fr 1fr;gap:14px;padding:14px;height:calc(100% - 49px)}.sv-current{min-height:0;display:flex;flex-direction:column}.sv-side{display:grid;grid-template-rows:auto 1fr;gap:14px;min-height:0}.sv-label{font-size:11px;letter-spacing:.09em;text-transform:uppercase;opacity:.5;margin:0 0 5px}.sv-stage{position:relative;overflow:hidden;background:#000;border:1px solid #2a2a30;border-radius:7px}.sv-stage .reveal{position:static;width:auto;height:auto}.sv-stage .slides{position:absolute;left:0;top:0;width:"+ss+"px;height:"+is+"px;transform-origin:0 0;margin:0;padding:0;text-align:left}.sv-stage .slides>section{position:relative!important;display:block!important;left:0!important;top:0!important;transform:none!important;width:"+ss+"px!important;height:"+is+'px!important;opacity:1!important;visibility:visible!important;background:var(--bg,#fff)}.sv-stage .fragment{opacity:1!important;visibility:visible!important}.sv-notes{background:#fbfbfa;color:#16161a;border-radius:7px;padding:16px 18px;overflow:auto;min-height:0;font-size:16px;line-height:1.5}.sv-notes :first-child{margin-top:0}.sv-notes .sv-nonotes{color:#888}.sv-end{display:flex;align-items:center;justify-content:center;height:100%;opacity:.45;font-size:18px}</style></head><body><div class="sv-top"><div class="sv-clock" id="sv-clock">--:--:--</div><div class="sv-tbox"><span id="sv-timer">0:00</span><button id="sv-ttoggle">Pause</button><button id="sv-treset">Reset</button></div><div class="sv-pos" id="sv-pos">\u2013 / \u2013</div></div><div class="sv-main"><div class="sv-current"><div class="sv-label">Current</div><div class="sv-stage" id="sv-cur"></div></div><div class="sv-side"><div><div class="sv-label">Next</div><div class="sv-stage" id="sv-nxt"></div></div><div style="display:flex;flex-direction:column;min-height:0"><div class="sv-label">Notes</div><div class="sv-notes" id="sv-notes"></div></div></div></div></body></html>'}function pd(){if(ir&&!ir.closed){ir.focus();return}let e=window.open("","orz-speaker","width=1280,height=800");if(!e)return;ir=e;let t=Array.prototype.slice.call(document.querySelectorAll('link[rel="stylesheet"], style')).map(c=>c.outerHTML).join(`
377
377
  `);e.document.open(),e.document.write(Ny(t)),e.document.close();let r=e.document,a=r.getElementById("sv-ttoggle"),i=r.getElementById("sv-treset");a&&a.addEventListener("click",()=>{Vr.toggle(),fo()}),i&&i.addEventListener("click",()=>{Vr.reset(),fo()}),r.addEventListener("keydown",c=>{let d=c.key;d===" "||d==="ArrowRight"||d==="ArrowDown"||d==="PageDown"||d==="n"||d==="N"?(c.preventDefault(),Ne.next()):(d==="ArrowLeft"||d==="ArrowUp"||d==="PageUp"||d==="p"||d==="P")&&(c.preventDefault(),Ne.prev())}),e.addEventListener("resize",an),Vr.start(),dd(),an(),e.focus()}window.orzslides={version:Dy,md:ho.md,parseDeck:rs,renderDeck:Ni,renderSlide:Ii,mount:By,renderAll:Fy,refresh:tn,openSpeaker:pd,toggleTimer:hd,reveal:null};})();
378
378
  /*! Bundled license information:
379
379
 
@@ -0,0 +1,18 @@
1
+ /**
2
+ * WP5 — Assembler. A parsed `Slide` → a reveal.js `<section>` per
3
+ * docs/dom-contract.md: title band + content grid (regions filled with
4
+ * orz-markdown) + footer + floats + speaker notes.
5
+ *
6
+ * Pure: takes a markdown renderer (orz-markdown's `md`) so this module has no
7
+ * direct orz-markdown dependency and stays unit-testable in node.
8
+ */
9
+ import type { Slide, DeckConfig, Deck } from './types.js';
10
+ /** Minimal markdown renderer interface (orz-markdown's `md` satisfies it). */
11
+ export interface Renderer {
12
+ render(src: string): string;
13
+ renderInline?(src: string): string;
14
+ }
15
+ /** Render one slide to a reveal `<section>`. */
16
+ export declare function renderSlide(slide: Slide, md: Renderer, deck: DeckConfig): string;
17
+ /** Render a whole deck's slides (joined `<section>`s for `.reveal .slides`). */
18
+ export declare function renderDeck(deck: Deck, md: Renderer): string;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * WP1 — Slide parser. Deck source → Deck AST.
3
+ *
4
+ * Pure functions only (no DOM, no network). Implements DESIGN.md §4–§5:
5
+ * - split the source into slides at `<!-- slide … -->` markers,
6
+ * - parse a leading `<!-- deck … -->` block into DeckConfig,
7
+ * - expand a preset alias (or parse a raw row/col split grammar) into a
8
+ * fully-expanded LayoutNode tree (the layout engine never sees a preset
9
+ * name — the parser owns expansion, §5.4.1),
10
+ * - parse region bodies (`<!-- @name -->`), reserved regions
11
+ * (`@notes` / `@footer` / `@float`), per-slide options, the leading-h2
12
+ * title, and the heading lint rules (§5.2).
13
+ */
14
+ import type { Deck } from './types.js';
15
+ export declare function parseDeck(source: string): Deck;
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Builds the self-contained `.slides.html` shell:
3
+ * <head> reveal.js CSS + KaTeX CSS + the slide theme (inline or CDN link)
4
+ * + the editor chrome styles
5
+ * <body> an empty .reveal/.slides container, the editor chrome (FAB + docked
6
+ * CodeMirror panel + banners), the embedded deck source in
7
+ * <script id="orz-deck">, the engine bundle (inline or CDN), a config
8
+ * object, the boot call, and the in-file app (assets/app.js).
9
+ *
10
+ * The deck source in #orz-deck is the single source of truth: the engine renders
11
+ * it on load, and the editor re-serialises it on save (self-reproducing).
12
+ */
13
+ export interface ThemeEntry {
14
+ id: string;
15
+ name: string;
16
+ scheme: 'light' | 'dark';
17
+ href: string;
18
+ }
19
+ export type RendererSpec = {
20
+ mode: 'inline';
21
+ js: string;
22
+ } | {
23
+ mode: 'cdn';
24
+ src: string;
25
+ };
26
+ export type ThemeSpec = {
27
+ mode: 'inline';
28
+ base: string;
29
+ themes: Array<{
30
+ id: string;
31
+ css: string;
32
+ }>;
33
+ } | {
34
+ mode: 'cdn';
35
+ };
36
+ export type RevealCssSpec = {
37
+ mode: 'inline';
38
+ reset: string;
39
+ core: string;
40
+ } | {
41
+ mode: 'cdn';
42
+ resetUrl: string;
43
+ coreUrl: string;
44
+ };
45
+ export interface EditorLibs {
46
+ codemirrorCss: string;
47
+ codemirrorLightThemeCss: string;
48
+ codemirrorDarkThemeCss: string;
49
+ codemirrorJs: string;
50
+ codemirrorMarkdownJs: string;
51
+ codemirrorContinuelistJs: string;
52
+ }
53
+ export interface BuildOptions {
54
+ source: string;
55
+ title: string;
56
+ filename: string;
57
+ docId: string;
58
+ rendererVersion: string;
59
+ renderer: RendererSpec;
60
+ theme: ThemeSpec;
61
+ defaultTheme: string;
62
+ themes: ThemeEntry[];
63
+ ratio: string;
64
+ versionManifest: string;
65
+ appJs: string;
66
+ runtime: string;
67
+ editorLibs: EditorLibs;
68
+ revealCss: RevealCssSpec;
69
+ cdn: {
70
+ katexCss: string;
71
+ mermaidJs: string;
72
+ smilesJs: string;
73
+ chartJs: string;
74
+ };
75
+ }
76
+ export declare function buildHtml(o: BuildOptions): string;
@@ -0,0 +1,127 @@
1
+ /**
2
+ * orz-slides — shared types (the locked interface for all modules).
3
+ *
4
+ * The parser (WP1) produces a `Deck`; the layout engine (WP2) turns a
5
+ * `LayoutNode` into grid DOM; the assembler (WP5) renders a `Slide` to a reveal
6
+ * `<section>`. These types are the contract — do not change them without
7
+ * updating BUILD-PLAN.md and the affected modules.
8
+ *
9
+ * See DESIGN.md §5 for the authoring syntax these types model, and
10
+ * docs/dom-contract.md for the rendered DOM/CSS contract.
11
+ */
12
+ /** Deck-level config from the leading `<!-- deck … -->` block. */
13
+ export interface DeckConfig {
14
+ title?: string;
15
+ /** Theme id, e.g. 'paper' | 'executive' | 'neon' … (default chosen by app). */
16
+ theme?: string;
17
+ /** Slide aspect ratio: '16:9' (default) | '4:3'. */
18
+ ratio?: string;
19
+ author?: string;
20
+ /** Deck-wide footer (markdown/text), shown on normal slides unless overridden. */
21
+ footer?: string;
22
+ /** Default reveal transition. */
23
+ transition?: string;
24
+ }
25
+ /**
26
+ * A grid track size token, as written in the layout grammar:
27
+ * '2' (= 2fr) · 'auto' · '1fr' · '30%' · '200px'
28
+ * The layout engine normalizes bare numbers to `fr`.
29
+ */
30
+ export type Track = string;
31
+ /** A layout node is either a split (row/col) or a region leaf. */
32
+ export type LayoutNode = SplitNode | RegionLeaf;
33
+ export interface SplitNode {
34
+ kind: 'split';
35
+ dir: 'row' | 'col';
36
+ /** One track per child (same length as `children`). */
37
+ tracks: Track[];
38
+ children: LayoutNode[];
39
+ }
40
+ export interface RegionLeaf {
41
+ kind: 'region';
42
+ /** Region name; filled by a `<!-- @name -->` marker. Flat + unique per slide. */
43
+ name: string;
44
+ }
45
+ /** A content region: the markdown that fills one layout leaf. */
46
+ export interface Region {
47
+ name: string;
48
+ /** Raw orz-markdown for this region (rendered by the assembler). */
49
+ markdown: string;
50
+ }
51
+ /** A free-positioned overlay box (`<!-- @float … -->`), outside the grid. */
52
+ export interface FloatRegion {
53
+ /** Geometry; values are CSS lengths ('30%', '200px'). z defaults to order. */
54
+ geom: {
55
+ left?: string;
56
+ right?: string;
57
+ top?: string;
58
+ bottom?: string;
59
+ w?: string;
60
+ h?: string;
61
+ z?: number;
62
+ };
63
+ markdown: string;
64
+ }
65
+ /** Per-slide options from the `<!-- slide … -->` marker. */
66
+ export interface SlideOptions {
67
+ /** Background color or image. */
68
+ bg?: string;
69
+ transition?: string;
70
+ /** Overflow behavior; default 'fit' (scale-to-fit). */
71
+ fit?: 'fit' | 'scroll' | 'off';
72
+ class?: string;
73
+ id?: string;
74
+ /** Step-reveal: auto-tag the slide's content as reveal fragments (lists
75
+ * reveal per-item, other top-level blocks one at a time, in document order). */
76
+ step?: boolean;
77
+ }
78
+ export interface LintMsg {
79
+ level: 'error' | 'warn';
80
+ message: string;
81
+ }
82
+ export type SlideKind = 'normal' | 'template';
83
+ export interface Slide {
84
+ /** 0-based position in the deck. */
85
+ index: number;
86
+ kind: SlideKind;
87
+ /** For kind==='template': 'title' | 'section' | 'outline' | 'closing'. */
88
+ template?: string;
89
+ /** Template visual variant (from `v=`). */
90
+ templateVariant?: number;
91
+ /**
92
+ * Normal slide title — the markdown of the single leading h2 (without the
93
+ * `## `), auto-lifted into the title band. Undefined if none.
94
+ */
95
+ title?: string;
96
+ /** Content-area layout (normal slides). Template slides carry their own. */
97
+ layout: LayoutNode;
98
+ /** Content regions (by name) parsed from `<!-- @name -->` markers. */
99
+ regions: Region[];
100
+ /** Float overlays (`<!-- @float … -->`), in declaration order. */
101
+ floats: FloatRegion[];
102
+ /** Slide-level footer markdown (`<!-- @footer -->`), overrides deck footer. */
103
+ footer?: string;
104
+ /** Speaker notes markdown (`<!-- @notes -->`). */
105
+ notes?: string;
106
+ options: SlideOptions;
107
+ /** Lint findings (heading rules, unknown regions, etc.). */
108
+ lint: LintMsg[];
109
+ /** Original source text of this slide (for lossless round-trip on save). */
110
+ raw: string;
111
+ }
112
+ export interface Deck {
113
+ config: DeckConfig;
114
+ slides: Slide[];
115
+ }
116
+ /** WP1 — parse a deck source into a `Deck`. */
117
+ export type ParseDeck = (source: string) => Deck;
118
+ /** WP2 — expand a preset alias (+ optional ratio like '3/2') to a layout tree. */
119
+ export type ExpandPreset = (name: string, ratio?: string) => LayoutNode | null;
120
+ /** WP2 — render a layout tree to nested grid DOM with empty region cells. */
121
+ export interface GridRender {
122
+ /** Grid container HTML; leaves are `<div class="orz-region" data-region="…">`. */
123
+ html: string;
124
+ /** Region names in document order (for the assembler to fill). */
125
+ regions: string[];
126
+ }
127
+ export type RenderLayout = (node: LayoutNode) => GridRender;
@@ -26,7 +26,7 @@ You write only the **deck source**. Never hand-write the surrounding HTML
26
26
  edit the deck source (in a `.md`-ish file fed to the CLI, or in-browser) and let
27
27
  the tool re-serialize.
28
28
 
29
- > Status: orz-slides is **published to npm** (v0.1.0) as two lockstep packages —
29
+ > Status: orz-slides is **published to npm** (v0.1.1) as two lockstep packages —
30
30
  > the `orz-slides` CLI and the `orz-slides-browser` engine. Generate decks with
31
31
  > the CLI (`npx orz-slides deck.md`, or install it globally). Speaker view
32
32
  > (**S**), step-reveal fragments, an on-deck timer (**T**), and slide numbers are
package/package.json CHANGED
@@ -1,8 +1,16 @@
1
1
  {
2
2
  "name": "orz-slides",
3
- "version": "0.1.1",
3
+ "version": "0.3.0",
4
4
  "description": "Self-contained, editable HTML slide decks (.slides.html) authored in orz-markdown with a layout syntax. Sibling of orz-mdhtml.",
5
5
  "type": "module",
6
+ "main": "./dist/lib.js",
7
+ "types": "./dist/lib.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/lib.d.ts",
11
+ "default": "./dist/lib.js"
12
+ }
13
+ },
6
14
  "bin": {
7
15
  "orz-slides": "dist/cli.js"
8
16
  },