slidetake 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,1456 @@
1
+ /* Slidetake 0.1.1 · https://slidetake.com · Apache-2.0 */
2
+ "use strict";(()=>{var _=(e,t)=>()=>(e&&(t=e(e=0)),t);var Nt,Rn=_(()=>{Nt=`---
3
+ title: Slidetake \u2014 write in markdown, record without timeline editing
4
+ brand: slidetake
5
+ pip: bottom-right
6
+ ---
7
+
8
+ <!-- camera: on, full, on -->
9
+
10
+ # ![](/favicon.svg) Slidetake
11
+
12
+ **Write in markdown. Present on a spatial canvas. Record without timeline editing.**
13
+
14
+ For developers and technical educators who explain things on video. You're inside a Slidetake deck right now: press \u2192 to walk it, **O** for the map.
15
+
16
+ ## \u2702\uFE0F Stop editing on a timeline
17
+
18
+ **Retake by slide.** The slide is the timeline marker, so a fumbled line costs one press, not an editing session.
19
+
20
+ ### Every slide is a take
21
+
22
+ Stumbled on a slide? Press \u2190 and say it again. Every attempt is kept, and recording carries on.
23
+
24
+ ### Pick, don't scrub
25
+
26
+ Choose the best take of each slide. Slidetake writes the frame-exact **ffmpeg** cut, the YouTube **chapters** and the description.
27
+
28
+ ## \u{1F5FA}\uFE0F A map, not a stack
29
+
30
+ <!-- view: overview -->
31
+
32
+ Your headings are the hierarchy: zoom out for the whole system, zoom in for one part. This slide just showed you the map.
33
+
34
+ ### Headings become cards
35
+
36
+ \`#\` is the first card, \`##\` branches from it, \`###\` goes a level deeper. No layout to draw.
37
+
38
+ ### A path your viewer can follow
39
+
40
+ \u2192 always walks the same order, and **path** lays it out as a staircase, so the audience never loses its place.
41
+
42
+ ## \u{1F3A5} The camera is part of the deck
43
+
44
+ <!-- camera: on, full, on -->
45
+
46
+ A comment in a slide moves you: corner, full screen, or off. Turn on **Camera** and watch this slide do it.
47
+
48
+ ### Broadcast-quality recording
49
+
50
+ **[OBS](https://obsproject.com)** records at full quality; Slidetake drives it. No scenes to switch, no recording to watch.
51
+
52
+ ### One session, one finished video
53
+
54
+ Write, present and record in one sitting. What comes out is ready to upload.
55
+
56
+ ## \u270D\uFE0F Plain text in
57
+
58
+ Markdown you already know: headings, lists, tables, code, diagrams, charts, images and YouTube links. [See every example \u2192](/examples)
59
+
60
+ ### Your copy
61
+
62
+ Type in any deck, this one included, and it becomes your own copy. The original stays as it is.
63
+
64
+ ### Open and share
65
+
66
+ **\u21E3 Load** a GitHub file or gist, start from a template, and **Share** a link with the deck inside it.
67
+
68
+ ## \u{1F49B} Free and open
69
+
70
+ Open source, Apache 2.0: [github.com/slidetake/slidetake](https://github.com/slidetake/slidetake).
71
+
72
+ Everything else is in the guide: **[slidetake.com/help](/help)**.
73
+ `});var _n,Dn=_(()=>{_n=`---
74
+ title: Slidetake help
75
+ brand: slidetake
76
+ pip: none
77
+ ---
78
+
79
+ # ![](/favicon.svg) Slidetake help
80
+
81
+ The details behind the [home deck](/): writing, sharing, presenting, recording and the camera. Press \u2192 to read in order, \u2193 \u2191 to go into a section and back out, or **O** for the whole map.
82
+
83
+ ## \u270D\uFE0F Writing a deck
84
+
85
+ A deck is an ordinary markdown file. **Every heading becomes a card**, and a heading branches off the nearest shallower heading above it.
86
+
87
+ \`\`\`md
88
+ # Product \u2190 the first card
89
+ Intro text.
90
+
91
+ ## Pricing \u2190 branches from Product
92
+ ### Enterprise \u2190 branches from Pricing
93
+ ## Roadmap {#plan} \u2190 branches from Product, id "plan"
94
+
95
+ See the [roadmap](#plan).
96
+ \`\`\`
97
+
98
+ ### Rules
99
+
100
+ - Text before the first heading becomes a card of its own.
101
+ - Headings inside fenced code blocks are ignored.
102
+ - A card's id is its heading slugified (\`## Moving around\` \u2192 \`moving-around\`), or set one with \`{#id}\` at the end of the heading.
103
+ - A link to \`#id\` flies to that card.
104
+
105
+ ### What a card can hold
106
+
107
+ Plain markdown, and the layout follows from what's on the card. [See every one \u2192](/examples)
108
+
109
+ | Write | Get |
110
+ |---|---|
111
+ | \`<!-- steps -->\` before a list | one item per press |
112
+ | \` \`\`\`dot \`, \` \`\`\`d2 \` | a Graphviz or D2 diagram |
113
+ | \` \`\`\`echarts \` with JSON options | a chart, in the deck's colors for dark and light |
114
+ | \` \`\`\`svg \` or \`![](drawing.svg)\` | an SVG drawing |
115
+ | an image alone | an image card: a phone shot sits beside the heading and caption, a landscape one spans the card between them, a 16:9 one fills it |
116
+ | an image and text | a split card: the image sits on the side written first |
117
+ | a list of images | a gallery; with \`<!-- steps -->\` a carousel, one image per press, laid out like an image card |
118
+ | \`<!-- view: full -->\` in a card | the card fills the whole screen |
119
+ | images in one paragraph | a grid, up to four a row |
120
+ | a YouTube link alone on a line | the video: the next press plays it, leaving pauses it |
121
+
122
+ The first and last cards animate in on their own. The alt text of an image is its caption.
123
+
124
+ ### reveal.js decks
125
+
126
+ Decks written for reveal.js open as they are: \`---\` starts a slide and \`--\` a vertical one beneath it, and the first slide becomes the root card.
127
+
128
+ Supported: fragments (\`fade-up\`, \`fade-in-then-out\`, \`grow\`, \u2026, one per \u2192), \`r-stack\`, \`<!-- .element: \u2026 -->\`, \`<section>\` slides, \`data-autoslide\`, Graphviz \`dot\` diagrams, ECharts charts, \`data-gsap\` entrance animations and \`title-scramble\`.
129
+
130
+ ### Older +++ decks
131
+
132
+ Decks that separate slides with \`+++\` and use \`id\`, \`parent\`, \`x\`, \`y\` frontmatter still load.
133
+
134
+ ### Wide content
135
+
136
+ Cards widen for wide tables, columns, diagrams and embeds; anything wider still is scaled to fit.
137
+
138
+ ## \u{1F517} Opening, editing and sharing
139
+
140
+ Every deck you open is **read-only**: Slidetake's own decks, templates, files on the web and shared links. Viewing one never changes anything.
141
+
142
+ **Type in it**, and it becomes **your copy**, at \`/edit\`. Your copy lives in this browser, remembers where it came from, and is there whenever you come back: the **Your copy \u2192** button at the top takes you to it.
143
+
144
+ ### Where decks come from
145
+
146
+ Press **\u270E Editor**, then **\u21E3 Load**, and paste a link: a GitHub file or folder, a gist, or any URL that lets other sites read it. Or link straight to a deck:
147
+
148
+ | Link | Opens |
149
+ |---|---|
150
+ | \`/gh/owner/repo/path/deck.md\` | a GitHub file, default branch |
151
+ | \`/gh/owner/repo@branch/deck.md\` | another branch or tag |
152
+ | \`/gist/<id>\` | a gist's first markdown file |
153
+ | \`/?src=https://\u2026/deck.md\` | anything else |
154
+ | \`/share#deflate:\u2026\` | a shared deck, carried inside the link |
155
+ | \`/new\` | a template: blank, talk or recording |
156
+
157
+ Images next to the deck load as they are. **Open** opens a markdown file from your computer, straight into your copy.
158
+
159
+ ### Your copy
160
+
161
+ There's one working copy at a time. The editor bar says whose copy it is, and marks **edited** while it has changes you haven't saved or shared.
162
+
163
+ - **Reset to original** throws your edits away and goes back to the deck you started from.
164
+ - Starting a new copy, by typing in another deck or opening a file, asks first if the old one has edits you haven't kept.
165
+
166
+ ### Saving and sharing
167
+
168
+ **Save** downloads your markdown as a file. **Share** copies a link: the short link while your copy still matches an online original, and otherwise a \`/share#deflate:\u2026\` link with the whole deck compressed inside it. That part of a link is never sent to a server, so nothing is uploaded. Shared links never include \`?obs=\`.
169
+
170
+ For a file from your computer whose images sit next to it online, add \`base: https://\u2026/deck-folder/\` to its top block.
171
+
172
+ ### Address options
173
+
174
+ | Option | Does |
175
+ |---|---|
176
+ | \`?edit=1\` | opens the editor |
177
+ | \`?layout=tree\` (radial, path, focus) | picks the layout |
178
+ | \`?mode=light\` | light theme |
179
+ | \`?duration=10m\` | talk length for the timer |
180
+ | \`#card-id\` | opens at a card |
181
+
182
+ ## \u{1F9ED} Moving around
183
+
184
+ | Key | Does |
185
+ |---|---|
186
+ | \u2192 \u2190 Space | next / previous step, in document order |
187
+ | \u2193 \u2191 | first child / parent |
188
+ | O | the whole map; O or Esc goes back to your slide |
189
+ | 1 2 3 4 | tree, radial, path, focus |
190
+ | F | fullscreen |
191
+ | + \u2212 | bigger / smaller slides (remembered) |
192
+ | E | editor |
193
+ | L | light / dark |
194
+ | K or ? | keys (also \u2328 Keys on screen) |
195
+ | C \xB7 V \xB7 R | camera, camera layouts, record |
196
+
197
+ Click a card to fly to it. Drag to pan; scroll or pinch to zoom. On a touch screen, the bottom bar adds \u2190 \u2192 buttons.
198
+
199
+ ### Layouts
200
+
201
+ **Tree** is a top-down chart and **radial** rings out from the root.
202
+
203
+ **Path** is made for video: a staircase in presenting order. Each section is a row, and the next one starts just below where the last ended, so every move is a short step right or down.
204
+
205
+ **Focus** doesn't travel at all: the next slide fades in where the last one was.
206
+
207
+ ### Steady text
208
+
209
+ Text keeps one size within a section and only changes when the section does. Charts and diagrams are fitted on their own.
210
+
211
+ ### Map moments
212
+
213
+ \`<!-- view: overview -->\` on a slide pulls back to the whole map for a beat before flying in: a good start to a chapter.
214
+
215
+ ## \u{1F3AC} Presenting
216
+
217
+ **F** goes fullscreen. The current slide fills the screen, and the cursor and controls hide after two seconds without the mouse moving.
218
+
219
+ ### Progress and talk timer
220
+
221
+ While presenting, a thin bar along the bottom fills with every press.
222
+
223
+ Give the deck a length, \`duration: 10m\` (or \`90s\`, \`1h\`, \`12:30\`), and a lighter layer of the same colour grows behind it with the clock: if the lighter stretch shows past the solid fill, you're behind; if it reaches the end, the bar pulses.
224
+
225
+ The timer is for you, so recordings show progress only, unless the deck says \`timer: always\`. \`progress: off\` hides the bar.
226
+
227
+ ## \u23FA\uFE0F Recording
228
+
229
+ Recording needs **[OBS Studio](https://obsproject.com)** (free) with its WebSocket server on: in OBS, Tools \u2192 WebSocket Server Settings. OBS records; Slidetake drives it.
230
+
231
+ ### Connecting to OBS
232
+
233
+ Press **\u25CF Record** and enter where OBS is: host, port and the password from OBS's WebSocket settings. Tick *Remember* to skip this next time.
234
+
235
+ \`?obs=localhost:4455\` (or \`?obs=host:port:password\`) in the address fills this in and connects as the page opens.
236
+
237
+ ### A 16:9 screen
238
+
239
+ YouTube is 16:9, and many laptop screens aren't. The Record dialog checks yours: if it isn't 16:9, move the window to a screen that is, physical or virtual (say 1920\xD71080), and press **F** there.
240
+
241
+ ### OBS on another computer
242
+
243
+ From https://slidetake.com, OBS must be on the same computer (\`localhost\`): browsers block secure pages from reaching plain \`ws://\` addresses elsewhere. For OBS on another machine, serve a local copy of [\`dist/index.html\`](https://github.com/slidetake/slidetake) over http.
244
+
245
+ ### Taking a take
246
+
247
+ **\u25CF Record** (or **R**) connects to OBS, counts down and starts recording. From then on the deck drives everything: camera layouts, reveals and slides follow \u2192 (a Bluetooth clicker works).
248
+
249
+ - **\u2190** takes the current slide again, keeping every attempt
250
+ - **B** pauses and resumes
251
+ - one press past the last step stops OBS
252
+
253
+ Clicks, dragging and the map are locked so the take only moves forward.
254
+
255
+ ### Review and cut
256
+
257
+ Then the review opens: every slide with its takes (the last one picked), previews from the OBS file, a ready-to-run **ffmpeg** command for the picked takes (frame-exact), and the YouTube title, description with **chapters** and links, and tags.
258
+
259
+ Sessions are kept in this browser, so a take can be reviewed again later from \u25CF Record.
260
+
261
+ ## \u{1F4F7} Camera
262
+
263
+ **C** (or **Camera** in the bottom bar) turns your webcam on in its box; a plain screen recording then captures you and the slides together. The camera is off every time the page opens, and until it's on, the deck's camera settings are ignored, so readers get slides using the whole screen.
264
+
265
+ ### Deck settings
266
+
267
+ An optional block at the top of the file:
268
+
269
+ \`\`\`yaml
270
+ ---
271
+ brand: example.com/talks \u2190 text in the top-right corner
272
+ logo: https://\u2026/logo.png \u2190 image beside it
273
+ pip: bottom-right \u2190 camera corner, or none
274
+ pip_size: 24% \u2190 camera box width
275
+ pip_shape: rect \u2190 rect (16:9) or circle
276
+ pip_mirror: yes \u2190 mirror the webcam
277
+ camera: 24%, 40%, full, off \u2190 layouts V cycles through
278
+ ---
279
+ \`\`\`
280
+
281
+ Slides are always placed clear of the brand and the camera box.
282
+
283
+ ### Camera per slide
284
+
285
+ A comment in a slide changes the camera from that slide on:
286
+
287
+ \`\`\`md
288
+ ## Intro
289
+ <!-- camera: full --> \u2190 camera fills the screen
290
+
291
+ ## Pricing
292
+ <!-- camera: 18% flip --> \u2190 small, on the other side
293
+ \`\`\`
294
+
295
+ Words you can combine: \`on\`, \`off\`, \`full\`, a size like \`30%\`, a corner, \`flip\`, \`circle\` / \`rect\`, \`mirror\` / \`unmirror\`.
296
+
297
+ ### Several steps on one slide
298
+
299
+ List layouts with commas to step through them: \`full, on\` opens full screen on you, and the next \u2192 shrinks the camera to its corner and shows the slide. \`on, full, on, off\` ends a closing slide on you, then the slide again, then without the camera.
300
+
301
+ **V** steps through the deck's \`camera:\` list for the current slide.
302
+
303
+ ## \u{1F4CB} Publish pack
304
+
305
+ The review fills the YouTube description from the deck's top block:
306
+
307
+ | Key | Used for |
308
+ |---|---|
309
+ | \`title\` | the video title |
310
+ | \`summary\` | the description's first paragraph |
311
+ | \`related\` | a list of \`[Title](url)\` links |
312
+ | \`tags\` | tags (any other list ending in \`_tags\` is added too) |
313
+ | \`permalink\` or \`site\` | the link back to the deck |
314
+
315
+ ## \u{1F512} Your data
316
+
317
+ Your draft and settings stay in this browser. Decks inside links live in the part of the address after \`#\`, which browsers never send to a server. Slidetake has no accounts and stores no decks.
318
+
319
+ slidetake.com counts visits with Google Analytics. What it records leaves out the \`#\` part and \`?obs=\`, so neither your deck nor an OBS password reaches it. Copies you host yourself send nothing.
320
+
321
+ Slidetake is open source: [github.com/slidetake/slidetake](https://github.com/slidetake/slidetake).
322
+ `});var Nn,jn=_(()=>{Nn=`---
323
+ title: My deck
324
+ ---
325
+
326
+ # My deck
327
+
328
+ Start typing: this becomes your own copy, and the template stays as it is.
329
+
330
+ ## A section
331
+
332
+ Every heading is a card. \`##\` sections branch from the first card.
333
+
334
+ ### A detail
335
+
336
+ \`###\` branches from the section above it.
337
+ `});var Wn,Hn=_(()=>{Wn=`---
338
+ title: Talk title
339
+ duration: 15m
340
+ ---
341
+
342
+ # Talk title
343
+
344
+ One line on what the audience will take away.
345
+
346
+ ## \u{1F9ED} Why this matters
347
+
348
+ - The problem, in the audience's words
349
+ - Why now
350
+ - What changes if it's solved
351
+
352
+ ## \u{1F4A1} The idea
353
+
354
+ The one thing to remember, stated plainly.
355
+
356
+ ### How it works
357
+
358
+ Three steps, a diagram or a table.
359
+
360
+ ### An example
361
+
362
+ Something concrete the audience will recognise.
363
+
364
+ ## \u2696\uFE0F Trade-offs
365
+
366
+ - What it costs
367
+ - When not to use it
368
+
369
+ ## \u2705 Summary
370
+
371
+ - Point one
372
+ - Point two
373
+ - Point three
374
+
375
+ ## \u{1F64F} Thank you
376
+
377
+ Where to find you, and the link to these slides.
378
+ `});var Un,Fn=_(()=>{Un=`---
379
+ title: Video title
380
+ duration: 10m
381
+ pip: bottom-right
382
+ pip_size: 24%
383
+ camera: 24%, 40%, full, off
384
+ ---
385
+
386
+ <!-- camera: full, on -->
387
+
388
+ # Video title
389
+
390
+ Opens full screen on you; the next press shows this slide with you in the corner.
391
+
392
+ ## \u{1F4CC} Disclaimer
393
+
394
+ <!-- camera: off, on -->
395
+
396
+ Opens without the camera, so the text has the whole screen; the next press brings you back.
397
+
398
+ ## \u{1F9ED} Contents
399
+
400
+ - Part one
401
+ - Part two
402
+ - Part three
403
+
404
+ ## \u{1F539} Part one
405
+
406
+ <!-- view: overview -->
407
+
408
+ The overview comment pulls back to the whole map first: a good start to a chapter.
409
+
410
+ ### A detail
411
+
412
+ Slides you talk over in the corner.
413
+
414
+ ## \u{1F538} Part two
415
+
416
+ ### A detail
417
+
418
+ ## \u{1F537} Part three
419
+
420
+ ### A detail
421
+
422
+ ## \u{1F64F} Thanks for watching
423
+
424
+ <!-- camera: on, full, on, off -->
425
+
426
+ Ends on you full screen, then back to the slide, then without the camera.
427
+ `});var $n,qn=_(()=>{$n=`---
428
+ title: Slidetake examples
429
+ brand: slidetake
430
+ duration: 10m
431
+ ---
432
+
433
+ # Slidetake examples
434
+
435
+ Everything a deck can hold, written in plain markdown. Open **\u270E Editor** to see the source of any card, or press **O** for the map.
436
+
437
+ ## \u270D\uFE0F Text
438
+
439
+ Paragraphs, **bold**, *italic*, \`code\`, [links](https://slidetake.com) and lists, as markdown writes them.
440
+
441
+ - One point
442
+ - Another point
443
+ - A detail under it
444
+
445
+ ### Steps
446
+
447
+ Put \`<!-- steps -->\` before a list and it reveals one item per press:
448
+
449
+ <!-- steps -->
450
+ - First, the problem
451
+ - Then, the idea
452
+ - Finally, the result
453
+
454
+ ### Quotes and tables
455
+
456
+ > A quote stands out from the text around it.
457
+
458
+ | Plan | Price | Users |
459
+ |---|---:|---:|
460
+ | Free | \u20B90 | 1 |
461
+ | Team | \u20B9499 | 10 |
462
+
463
+ ### Code
464
+
465
+ \`\`\`python
466
+ def take(slide):
467
+ return slide.best_attempt()
468
+ \`\`\`
469
+
470
+ ## \u{1F9ED} Diagrams
471
+
472
+ Write the diagram in a fenced block named after its language.
473
+
474
+ ### Graphviz
475
+
476
+ \`\`\`dot
477
+ digraph {
478
+ rankdir=LR
479
+ node [shape=box style=rounded]
480
+ Markdown -> Deck -> Takes -> Video
481
+ }
482
+ \`\`\`
483
+
484
+ ### D2
485
+
486
+ \`\`\`d2
487
+ direction: right
488
+ write: Write {shape: rectangle}
489
+ present: Present
490
+ record: Record
491
+ write -> present -> record: one session
492
+ \`\`\`
493
+
494
+ ### SVG
495
+
496
+ \`\`\`svg
497
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 120">
498
+ <rect x="10" y="20" width="90" height="80" rx="10" fill="#e0b024"/>
499
+ <rect x="115" y="20" width="90" height="80" rx="10" fill="#e0b024" opacity=".7"/>
500
+ <rect x="220" y="20" width="90" height="80" rx="10" fill="#e0b024" opacity=".4"/>
501
+ </svg>
502
+ \`\`\`
503
+
504
+ ## \u{1F4CA} Charts
505
+
506
+ ECharts, as a fenced \`echarts\` block of JSON options.
507
+
508
+ ### A bar chart
509
+
510
+ \`\`\`echarts
511
+ {
512
+ "xAxis": {"type": "category", "data": ["Jan", "Feb", "Mar", "Apr", "May"]},
513
+ "yAxis": {"type": "value"},
514
+ "series": [{"type": "bar", "data": [12, 19, 15, 24, 30]}]
515
+ }
516
+ \`\`\`
517
+
518
+ ### A donut
519
+
520
+ \`\`\`echarts
521
+ {
522
+ "series": [{"type": "pie", "radius": ["45%", "70%"],
523
+ "data": [{"name": "Equity", "value": 85}, {"name": "Debt", "value": 5}, {"name": "Gold", "value": 10}]}]
524
+ }
525
+ \`\`\`
526
+
527
+ ## \u{1F5BC}\uFE0F Images
528
+
529
+ The layout comes from what's on the slide; the alt text is the caption.
530
+
531
+ ### One image
532
+
533
+ ![An image alone fills the card edge to edge](https://slidetake.com/og.jpg)
534
+
535
+ ### Image and text
536
+
537
+ ![Written first, so it sits on the left](https://slidetake.com/og.jpg)
538
+
539
+ An image beside text makes a split card. Write the text first and the image moves to the right.
540
+
541
+ ### A gallery
542
+
543
+ A list of images is a gallery. With \`<!-- steps -->\` it becomes a carousel: one image at a time, the next on each press.
544
+
545
+ <!-- steps -->
546
+ - ![The logo](https://slidetake.com/favicon.svg)
547
+ - ![The home-screen icon](https://slidetake.com/apple-touch-icon.png)
548
+ - ![The link preview](https://slidetake.com/og.jpg)
549
+
550
+ ### A grid
551
+
552
+ Several images in one paragraph sit side by side, up to four a row:
553
+
554
+ ![Logo](https://slidetake.com/favicon.svg) ![Icon](https://slidetake.com/apple-touch-icon.png) ![Preview](https://slidetake.com/og.jpg)
555
+
556
+ ### Full screen
557
+
558
+ <!-- view: full -->
559
+
560
+ ![A card tagged view: full fills the whole screen](https://slidetake.com/og.jpg)
561
+
562
+ ## \u25B6\uFE0F YouTube
563
+
564
+ A YouTube link alone on a line becomes the video. The next press plays it; leaving the slide pauses it.
565
+
566
+ https://www.youtube.com/watch?v=jNQXAC9IVRw
567
+
568
+ ## \u{1F3A5} Camera and map
569
+
570
+ <!-- camera: on, full, on -->
571
+ <!-- view: overview -->
572
+
573
+ Two comments do what markdown can't: \`<!-- camera: on, full, on -->\` moves the presenter's camera, and \`<!-- view: overview -->\` shows the whole map first.
574
+
575
+ ## \u{1F680} Start your own
576
+
577
+ Press **New** for a template (blank, talk or recording), or type in this deck to make it your copy.
578
+
579
+ The templates and this deck live in [examples/](https://github.com/slidetake/slidetake/tree/main/examples) on GitHub.
580
+ `});function Te(e){return e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"")||"card"}function Ne(e){return e.replace(/!?\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/[*_`~]/g,"").trim()}function C(e){return String(e).replace(/[&<>"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[t])}function Yn(e){if(typeof document<"u"){let t=document.createElement("textarea");return t.innerHTML=e,t.value}return e.replace(/&(#x[\da-f]+|#\d+|\w+);/gi,(t,n)=>n[0]==="#"?String.fromCodePoint(n[1].toLowerCase()==="x"?parseInt(n.slice(2),16):parseInt(n.slice(1),10)):Aa[n.toLowerCase()]??t)}function He(e){let t={};for(let n of e.matchAll(/([\w-]+)="([^"]*)"/g))t[n[1]]=n[2];return t}function We(e,t){let n=[[]],o=null;return e.split(`
581
+ `).forEach(a=>{let r=a.match(/^\s{0,3}(`{3,}|~{3,})/);r&&(o?r[1][0]===o[0]&&r[1].length>=o.length&&(o=null):o=r[1]),!o&&!r&&t.test(a)?n.push([]):n[n.length-1].push(a)}),n.map(a=>a.join(`
582
+ `))}function Gn(e){let t=String(e??"").trim().toLowerCase();if(!t)return 0;let n=t.match(/^(\d+):(\d{1,2})$/);if(n)return(+n[1]*60+ +n[2])*1e3;if(n=t.match(/^(\d+(?:\.\d+)?)\s*(h|hrs?|hours?|m|mins?|minutes?|s|secs?|seconds?)?$/),!n)return 0;let o=(n[2]||"m")[0];return parseFloat(n[1])*(o==="h"?3600:o==="s"?1:60)*1e3}function K(e){let t=Math.max(0,Math.round(e/1e3)),n=Math.floor(t/3600),o=Math.floor(t%3600/60),a=t%60;return(n?n+":"+String(o).padStart(2,"0"):o)+":"+String(a).padStart(2,"0")}var Aa,it=_(()=>{"use strict";Aa={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",rsquo:"\u2019",lsquo:"\u2018",rdquo:"\u201D",ldquo:"\u201C"}});function Vn(e){let t=null;return e.split(`
583
+ `).filter(n=>{let o=n.match(/^\s{0,3}(`{3,}|~{3,})/);return o?(t?o[1][0]===t[0]&&o[1].length>=t.length&&(t=null):t=o[1],!1):!t}).join(`
584
+ `).replace(/`[^`\n]*`/g,"")}function Ht(e){return/<!--\s*view\s*:\s*(overview|map)\s*-->/i.test(Vn(e))}function Wt(e){let t=Vn(e).match(/<!--\s*camera\s*:\s*([\s\S]*?)\s*-->/i);return t?t[1].trim():null}function Ra(e){let t={},n=e.match(/^---[ \t]*\n([\s\S]*?)\n---[ \t]*(?:\n|$)/);if(!n)return{deck:t,body:e};let o=null;return n[1].split(`
585
+ `).forEach(a=>{let r=a.match(/^\s+-\s+(.*)$/);if(r&&o){t[o].push(r[1].trim().replace(/^["']|["']$/g,""));return}let i=a.match(/^([A-Za-z_][\w-]*)\s*:\s*(.*)$/);if(!i){o=null;return}let s=i[1].toLowerCase(),l=i[2].trim().replace(/^["']|["']$/g,"");l===""?(t[s]=[],o=s):(t[s]=l,o=null)}),{deck:t,body:e.slice(n[0].length)}}function Xn(e){let t=a=>typeof a=="string"||typeof a=="number"||typeof a=="boolean",n=a=>String(a).replace(/\s*\n\s*/g," "),o=[];for(let[a,r]of Object.entries(e||{}))/^[A-Za-z_][\w-]*$/.test(a)&&(t(r)?o.push(a+": "+n(r)):Array.isArray(r)&&r.every(t)&&(o.push(a+":"),r.forEach(i=>o.push(" - "+n(i)))));return o.length?`---
586
+ `+o.join(`
587
+ `)+`
588
+ ---
589
+ `:""}function Da(e){let t=e.split(`
590
+ `),n={},o=e;if(t[0]!==void 0&&t[0].trim()==="---"){let a=-1;for(let r=1;r<t.length;r++)if(t[r].trim()==="---"){a=r;break}a!==-1&&(t.slice(1,a).forEach(r=>{let i=r.indexOf(":");i>-1&&(n[r.slice(0,i).trim()]=r.slice(i+1).trim().replace(/^["']|["']$/g,""))}),o=t.slice(a+1).join(`
591
+ `).replace(/^\n+/,""))}return{meta:n,body:o}}function _a(e){let t=e.replace(/<!--[\s\S]*?-->/g,""),n=t.match(/^\s{0,3}#{1,6}\s+(.+?)\s*#*\s*$/m),o=t.match(/<h[1-6][^>]*>([\s\S]*?)<\/h[1-6]>/i),a=null;if(n&&(!o||n.index<o.index)?a=n[1]:o&&(a=o[1].replace(/<[^>]+>/g," ")),!a){let r=t.split(`
592
+ `).map(i=>i.replace(/<[^>]+>/g,"").trim()).find(i=>i&&!/^[-|:\s]+$/.test(i));a=r?r.slice(0,60):null}return a?Yn(Ne(a)).replace(/\s+/g," ").trim():null}function Kn(e){let t=e.match(/<!--\s*\.slide:([\s\S]*?)-->/i);return t?He(t[1]):{}}function Jn(e,{render:t=n=>({html:n,err:null})}={}){let n=new Map,o=b=>{let E=b,g=2;for(;n.has(E);)E=b+"-"+g++;return E},a=b=>(n.set(b.id,{x:null,y:null,children:[],...b}),b.id);e=e.replace(/\r\n?/g,`
593
+ `);let r=/^\+\+\+[ \t]*$/m.test(e),i={};r||({deck:i,body:e}=Ra(e));let s=/^slides?$/i.test(String(i.layout||""))||/^slides?$/i.test(String(i.type||"")),l=!r&&(We(e,/^--\s*$/).length>1||s&&We(e,/^---\s*$/).length>1),c=r?N():l?M():f();return n.forEach(b=>{(!b.parent||b.parent===b.id||!n.has(b.parent))&&(b.parent=null)}),n.forEach(b=>{let E=new Set([b.id]),g=b.parent;for(;g;){if(E.has(g)){b.parent=null;break}E.add(g),g=n.get(g).parent}}),n.forEach(b=>{b.parent&&n.get(b.parent).children.push(b.id)}),{deck:i,nodes:n,format:r?"+++":l?"reveal":"headings",errCount:c};function f(){let b=[],E=null,g=null,B={level:0,title:null,explicitId:null,lines:[]};e.split(`
594
+ `).forEach(m=>{let v=m.match(/^\s{0,3}(`{3,}|~{3,})/);v&&(g?v[1][0]===g[0]&&v[1].length>=g.length&&(g=null):g=v[1]);let L=!g&&!v?m.match(/^\s{0,3}(#{1,6})\s+(.+?)\s*#*\s*$/):null;if(L){let D=L[2],le=null,ne=D.match(/\s*\{#([\w\-:.]+)\}\s*$/);ne&&(le=ne[1],D=D.slice(0,ne.index)),E={level:L[1].length,title:Ne(D),explicitId:le,lines:[L[1]+" "+D]},b.push(E)}else(E||B).lines.push(m)});let G=B.lines.join(`
595
+ `);G.trim()&&(b.length&&!G.replace(/<!--[\s\S]*?-->/g,"").trim()?b[0].lines.splice(1,0,...B.lines):b.unshift(B));let w=[];return b.forEach(m=>{for(;w.length&&w[w.length-1].level>=m.level;)w.pop();let v=w.length?w[w.length-1].id:null,L=m.lines.join(`
596
+ `).trim(),D=m.title||Ne((L.split(`
597
+ `).find(be=>be.trim())||"Intro").slice(0,48));m.id=o(m.explicitId||Te(D));let{html:le,err:ne}=t(L);a({id:m.id,parent:v,title:D,html:le,err:ne,camera:Wt(L),mapFirst:Ht(L)}),w.push(m)}),0}function N(){let b=e.split(/\n\+\+\+[ \t]*\n/).map(B=>B.trim()).filter(B=>B.length),E=null,g=0;return b.forEach((B,G)=>{let{meta:w,body:m}=Da(B),v=o(w.id||"slide-"+(G+1)),L="parent"in w?w.parent||null:E,D=m.match(/^#{1,6}\s+(.+)$/m),le=w.title||(D?Ne(D[1]):v),{html:ne,err:be}=t(m);be&&g++,a({id:v,parent:L,title:le,html:ne,err:be,camera:w.camera||Wt(m),mapFirst:Ht(m),x:w.x!==void 0?parseFloat(w.x):null,y:w.y!==void 0?parseFloat(w.y):null}),E=v}),g}function M(){let b=0,E=0,g=null;function B(w,m){let v=w.body.trim();E++;let L=_a(v)||"Slide "+E,D=m?n.get(m).title:null;D&&L.startsWith(D+" / ")&&(L=L.slice(D.length+3));let le=o(Te(L)),{html:ne,err:be}=t(v);return be&&b++,a({id:le,parent:m,title:L,html:ne,err:be,camera:Wt(v),mapFirst:Ht(v),autoslide:parseInt(w.attrs["data-autoslide"],10)||0})}let G=[];return We(e,/^---\s*$/).forEach(w=>{if(/<section\b/i.test(w)){for(let L of w.matchAll(/<section\b([^>]*)>([\s\S]*?)<\/section>/gi))G.push([{body:L[2],attrs:He(L[1])}]);let v=w.replace(/<section\b[^>]*>[\s\S]*?<\/section>/gi,"");v.trim()&&G.push([{body:v,attrs:Kn(v)}]);return}let m=We(w,/^--\s*$/).filter(v=>v.trim()).map(v=>({body:v,attrs:Kn(v)}));m.length&&G.push(m)}),G.forEach(w=>{let m=null;w.forEach((v,L)=>{if(!g){g=m=B(v,null);return}L===0?m=B(v,g):B(v,m)})}),b}}var Zn=_(()=>{"use strict";it()});function st(e,t){return String(t||"").toLowerCase().split(/\s+/).forEach(n=>{n&&(n==="off"||n==="hide"?e.off=!0:n==="on"||n==="pip"||n==="show"?(e.off=!1,e.full=!1,e.used=!0):n==="full"||n==="fullscreen"?(e.full=!0,e.off=!1,e.used=!0):/^\d+(\.\d+)?%?$/.test(n)?(e.size=Ft(parseFloat(n)),e.used=!0):Fe.includes(n)?(e.corner=n,e.used=!0):n==="flip"?(e.flip=!e.flip,e.used=!0):n==="circle"?e.circle=!0:n==="rect"?e.circle=!1:n==="mirror"?e.mirror=!0:(n==="unmirror"||n==="no-mirror")&&(e.mirror=!1))}),e}function Qn(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}function eo(e,t){let n=[];if(!e.length){for(let a=0;a<=t;a++)n.push({cam:0,frag:a});return n}let o=e.findIndex(a=>!st({},a).full);o<0&&(o=e.length-1);for(let a=0;a<=o;a++)n.push({cam:a,frag:0});for(let a=1;a<=t;a++)n.push({cam:o,frag:a});for(let a=o+1;a<e.length;a++)n.push({cam:a,frag:t});return n}var Fe,Ft,to=_(()=>{"use strict";Fe=["top-left","top-right","bottom-left","bottom-right"],Ft=e=>Math.max(8,Math.min(60,e))});function no(e){let t=String(e||"").trim();if(!t)return null;let n;try{n=new URL(/^[a-z]+:\/\//i.test(t)?t:"https://"+t)}catch{return null}let o=n.pathname.split("/").filter(Boolean);if(n.hostname==="github.com"||n.hostname==="www.github.com"){let[a,r,i,s,...l]=o;if(a&&r&&(i==="blob"||i==="raw"||i==="tree")&&s){let c=l.join("/");return(i==="tree"||!/\.(md|markdown|txt)$/i.test(c))&&(c=(c?c+"/":"")+"index.md"),{kind:"url",url:Ut+[a,r,s].join("/")+"/"+c}}if(a&&r&&!i)return{kind:"url",url:Ut+a+"/"+r+"/HEAD/README.md"}}if(n.hostname==="gist.github.com"){let a=o.length>=2?o[1]:o[0];if(a&&/^[\da-f]+$/i.test(a))return{kind:"gist",id:a}}if(n.hostname==="slidetake.com"||n.hostname==="www.slidetake.com"){let a=qt(n.pathname);if(a)return a;let r=n.searchParams.get("src");if(r)return{kind:"url",url:r}}return{kind:"url",url:n.href}}function qt(e){let t=String(e||"").split("/").filter(Boolean).map(n=>{try{return decodeURIComponent(n)}catch{return n}});if(t[0]==="gh"&&t.length>=4){let[,n,o,...a]=t,r=o.indexOf("@"),i=r<0?o:o.slice(0,r),s=r<0?"HEAD":o.slice(r+1);return!n||!i||!s?null:{kind:"url",url:Ut+[n,i,s,...a].map(encodeURIComponent).join("/")}}return t.length===1&&t[0]==="help"?{kind:"builtin",id:"help"}:t.length===1&&t[0]==="examples"?{kind:"builtin",id:"showcase"}:t[0]==="gist"&&t[1]&&/^[\da-f]+$/i.test(t[1])?t[2]?{kind:"gist",id:t[1],file:t[2]}:{kind:"gist",id:t[1]}:null}function oo(e){if(e.kind==="builtin")return e.id==="home"?"/":e.id==="showcase"?"/examples":e.id.startsWith("template:")?"/new?template="+e.id.slice(9):"/"+e.id;if(e.kind==="gist")return"/gist/"+e.id+(e.file?"/"+encodeURIComponent(e.file):"");let t=e.url.match(/^https:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\/([^/]+)\/(.+)$/);if(t){let[,n,o,a,r]=t;if(!/^refs$/.test(a))return"/gh/"+n+"/"+o+(a==="HEAD"?"":"@"+a)+"/"+r}return"/?src="+encodeURIComponent(e.url)}var Ut,$t=_(()=>{"use strict";Ut="https://raw.githubusercontent.com/"});function ja(e){let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Na(e){let t=atob(e.replace(/-/g,"+").replace(/_/g,"/")+"===".slice((e.length+3)%4));return Uint8Array.from(t,n=>n.charCodeAt(0))}async function ao(e,t){let n=new Response(new Blob([e]).stream().pipeThrough(t));return new Uint8Array(await n.arrayBuffer())}async function ro(e){return ja(await ao(new TextEncoder().encode(e),new CompressionStream("deflate-raw")))}async function io(e){return new TextDecoder().decode(await ao(Na(e),new DecompressionStream("deflate-raw")))}function lt(e){let t=e.replace(/^#/,"");if(!t.startsWith(Yt)){let r=t;try{r=decodeURIComponent(t)}catch{}return{data:null,slide:r}}let n=t.slice(Yt.length),o=n.indexOf("~"),a=o<0?"":n.slice(o+1);try{a=decodeURIComponent(a)}catch{}return{data:o<0?n:n.slice(0,o),slide:a}}function Gt(e,t){return"#"+Yt+e+(t?"~"+encodeURIComponent(t):"")}var Yt,Kt=_(()=>{"use strict";Yt="deflate:"});function so(e,t,n){let o=e.replace(/\/+$/,"")||"/",a=new URLSearchParams(t),{data:r,slide:i}=lt(n);if(o==="/share")return r?{page:"share",data:r,slide:i}:{page:"source",source:{kind:"builtin",id:"home"},slide:""};if(o==="/edit")return{page:"edit",slide:i};if(o==="/new"){let c=a.get("template");return c&&Ha.includes(c)?{page:"source",source:{kind:"builtin",id:"template:"+c},slide:i}:{page:"pick"}}let s=qt(o);if(s)return{page:"source",source:s,slide:i};let l=a.get("src");return o==="/"&&l?{page:"source",source:{kind:"url",url:l},slide:i}:{page:"source",source:{kind:"builtin",id:"home"},slide:i}}function oe(e){switch(e.kind){case"builtin":return e.id==="home"?"Home":e.id==="help"?"Help":e.id==="showcase"?"the examples":"the "+e.id.replace(/^template:/,"")+" template";case"gist":return"a gist"+(e.file?" ("+e.file+")":"");case"shared":return"a shared deck";case"file":return e.name;case"url":{let t=e.url.match(/^https:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\/[^/]+\/(.+)$/);if(t)return t[1]+"/"+t[2]+"/"+t[3];try{let n=new URL(e.url);return n.hostname+n.pathname}catch{return e.url}}}}function dt(e,t,{exported:n=!1}={}){return{text:e,origin:t,originText:e,exported:n?e:null}}function ct(e){return e.text!==(e.exported??e.originText)}function pt(e){return e.text===e.originText}function lo(e){try{let t=JSON.parse(e||"null");return!t||typeof t.text!="string"||!t.origin||typeof t.origin.kind!="string"?null:{text:t.text,origin:t.origin,originText:typeof t.originText=="string"?t.originText:t.text,exported:typeof t.exported=="string"?t.exported:null}}catch{return null}}var Ha,co=_(()=>{"use strict";$t();Kt();Ha=["blank","talk","recording"]});function po(e){let t;try{t=new URL(e)}catch{return null}let n=t.hostname.replace(/^(www\.|m\.)/,""),o=null,a=!1;if(n==="youtu.be")o=t.pathname.slice(1).split("/")[0];else if(n==="youtube.com"||n==="youtube-nocookie.com"){let r=t.pathname.split("/").filter(Boolean);r[0]==="watch"?o=t.searchParams.get("v"):["shorts","live","embed"].includes(r[0])&&(o=r[1]||null,a=r[0]==="shorts")}return!o||!/^[\w-]{6,}$/.test(o)?null:{id:o,start:Wa(t.searchParams.get("t")||t.searchParams.get("start")||""),portrait:a}}function Wa(e){if(/^\d+$/.test(e))return+e;let t=e.match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);return t&&e?+(t[1]||0)*3600+ +(t[2]||0)*60+ +(t[3]||0):0}function uo(e){return"https://www.youtube-nocookie.com/embed/"+encodeURIComponent(e.id)+"?enablejsapi=1&rel=0&playsinline=1"+(e.start?"&start="+e.start:"")}var ho=_(()=>{"use strict"});function Ue(e){let t=new Map,n=e.totalObs??e.total;return e.events.forEach((o,a)=>{t.has(o.id)||t.set(o.id,{id:o.id,title:o.title,takes:[]});let r=t.get(o.id),i=e.events[a+1];r.takes.push({no:r.takes.length+1,start:mo(o),end:i?mo(i):n})}),t}function qe(e){let t=[],n=ht(e);return Ue(e).forEach(o=>{let a=e.picks[o.id]??o.takes.length;if(!a)return;let r=o.takes[a-1];if(!r)return;let i=fo(r.start,n),s=fo(r.end,n);s>i&&t.push({id:o.id,title:o.title,f0:i,f1:s,start:i*1e3/n,end:s*1e3/n})}),t}function Fa(e){let t=[];return e.forEach(n=>{let o=t[t.length-1];o&&n.f0===o.f1?(o.f1=n.f1,o.end=n.end):t.push({f0:n.f0,f1:n.f1,start:n.start,end:n.end})}),t}function Vt(e,t){let n=0,o=[];return qe(e).forEach(a=>{let{sec:r,title:i}=t(a.id,a.title),s=o[o.length-1];(!s||s.sec!==r&&s.title!==i)&&o.push({sec:r,title:i,t:n}),n+=a.end-a.start}),{list:o,length:n}}function bo(e,t){let{list:n,length:o}=Vt(e,t),a=n.filter((r,i)=>i===0||(n[i+1]?n[i+1].t:o)-r.t>=1e4);return a.length&&(a[0].t=0),{lines:a.map(r=>K(r.t)+" "+r.title),dropped:n.length-a.length,length:o}}function yo(e,t,{input:n,outputName:o,sectionOf:a}){let r=Fa(qe(e));if(!e.withObs)return"# This was a rehearsal: nothing was recorded.";if(!r.length)return"# Every slide is left out: nothing to render.";let i=Ua(n)+o,{list:s,length:l}=Vt(e,a),c=m=>String(m).replace(/[=;#\\\n]/g,v=>"\\"+v),N=`cat > /tmp/slidetake-chapters.txt <<'EOF'
598
+ `+(`;FFMETADATA1
599
+ title=`+c(e.deckTitle)+`
600
+ `+s.map((m,v)=>`[CHAPTER]
601
+ TIMEBASE=1/1000
602
+ START=`+Math.round(m.t)+`
603
+ END=`+Math.round(s[v+1]?s[v+1].t:l)+`
604
+ title=`+c(m.title)).join(`
605
+ `))+`
606
+ EOF
607
+ `,M=" -map 0:v:0 -map 0:a:0 -map_metadata 1 -map_chapters 1";if(t==="copy"){let m=r.map(L=>"file "+ut(n)+`
608
+ inpoint `+go(L.start)+`
609
+ outpoint `+go(L.end)).join(`
610
+ `);return(r.length>1?`# Careful: without re-encoding, cuts can only land on keyframes (OBS puts one about every 2 s),
611
+ # so `+(r.length===2?"the cut":"each of the "+(r.length-1)+" cuts")+` here may keep or lose up to ~2 s. Use a frame-accurate option for retakes.
612
+ `:"")+`cat > /tmp/slidetake-cuts.txt <<'EOF'
613
+ `+m+`
614
+ EOF
615
+ `+N+"ffmpeg -f concat -safe 0 -i /tmp/slidetake-cuts.txt -i /tmp/slidetake-chapters.txt"+M+" -c copy -movflags +faststart "+ut(i)}let b=ht(e),E=m=>(m/b).toFixed(6),g=m=>((m-.5)/b).toFixed(6),B=r.map(m=>"gte(t,"+g(m.f0)+")*lt(t,"+g(m.f1)+")").join("+"),G=r.map(m=>"gte(t,"+E(m.f0)+")*lt(t,"+E(m.f1)+")").join("+"),w=t==="mac"?"-c:v h264_videotoolbox -b:v 12M":"-c:v libx264 -crf 18 -preset medium";return N+"ffmpeg -i "+ut(n)+" -i /tmp/slidetake-chapters.txt"+M+` -vf "select='`+B+`',setpts=N/FRAME_RATE/TB" -af "asetnsamples=n=48:p=0,aselect='`+G+`',asetpts=N/SR/TB" `+w+" -c:a aac -b:a 192k -movflags +faststart "+ut(i)}var mo,ht,fo,Ce,Ua,ut,go,vo=_(()=>{"use strict";it();mo=e=>e.obsT??e.t,ht=e=>e.fps||60,fo=(e,t)=>Math.round(e*t/1e3);Ce=e=>String(e||"").split(/[\\/]/).pop()||"",Ua=e=>{let t=Math.max(String(e).lastIndexOf("/"),String(e).lastIndexOf("\\"));return t>=0?String(e).slice(0,t+1):""},ut=e=>"'"+String(e).replace(/'/g,"'\\''")+"'",go=e=>(e/1e3).toFixed(3)});var gi={};function Z(e){try{let t=localStorage.getItem(e);if(t!==null||!e.startsWith("slidetake:"))return t;let n=e.slice(10);return localStorage.getItem("slidetake:"+n)??localStorage.getItem("traverse:"+n)}catch{return null}}function Q(e,t){try{localStorage.setItem(e,t)}catch{}}function er(e){try{return{html:window.marked?window.marked.parse(e):"<pre>"+C(e)+"</pre>",err:null}}catch{return{html:"<p>(could not render)</p>",err:"render error"}}}function yt(){let e=x.brand||"",t=x.logo||"",n=/^chip$/i.test(x.brand_style||""),o=/^slidetake$/i.test(e)?'<span class="st-mark">'+No+'<span class="word">Slide<span>take</span></span></span>':(t?'<img alt="" src="'+C(t)+'">':"")+(e?"<span"+(n?' class="chip"':"")+">"+C(e)+"</span>":"");if(de.dataset.html!==o){de.dataset.html=o,de.innerHTML=o;let r=de.querySelector("img");r&&(r.onload=r.onerror=()=>te(!0))}de.hidden=!o,yn(),document.title=x.title||"Slidetake";let a=String(x.theme||x.palette||"").toLowerCase();a?document.body.dataset.palette=a:delete document.body.dataset.palette,Ho()}function vt(){if(O&&O.themeKey&&!ko){let t=Z(O.themeKey);return t==="light"||t==="dark"?t:matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return String(ko||Z("slidetake:mode")||x.mode||"dark").toLowerCase()==="light"?"light":"dark"}function Ho(){let e=vt()==="light";e?document.body.dataset.mode="light":delete document.body.dataset.mode;let t=document.getElementById("btn-mode");t&&(t.innerHTML=e?'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>':'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="4.5"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>',t.title=(e?"Dark theme":"Light theme")+" (L)",t.setAttribute("aria-label",t.title))}function Wo(){let e=vt()==="light"?"dark":"light";O&&O.themeKey?(Q(O.themeKey,e),document.documentElement.classList.toggle("dark",e==="dark")):Q("slidetake:mode",e),Ho(),F.querySelector(".echarts-container, .diagram.d2")&&It(!0)}function tr(){let t=(x.camera||"").replace(/^\[|\]$/g,"").split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean);return t.length?t:["on","full","off"]}function rn(e){return!q&&e?Qn(e.camera):[]}function Le(e){return eo(rn(e),e&&e.frags?e.frags.length:0)}function Fo(){let e=Le(d.get(p));return e[Math.min(ee,e.length-1)]||{cam:0,frag:0}}function nr(){if(!p)return null;let e=rn(d.get(p));if(e.length)return e[Math.min(Fo().cam,e.length-1)];for(let t=h.indexOf(p)-1;t>=0;t--){let n=rn(d.get(h[t]));if(n.length)return n[n.length-1]}return null}function or(){let e={corner:(x.pip||"none").toLowerCase(),size:Ft(parseFloat(x.pip_size)||24),circle:(x.pip_shape||"").toLowerCase()==="circle",mirror:!/^(no|false|off)$/i.test(x.pip_mirror||""),full:!1,off:!1,flip:!1,used:!1};return st(e,nr()),st(e,fe),!Fe.includes(e.corner)&&(U||e.used)&&(e.corner="bottom-right"),e.flip&&Fe.includes(e.corner)&&(e.corner=e.corner.includes("left")?e.corner.replace("left","right"):e.corner.replace("right","left")),e}function yn(){let e=!z.hidden&&z.offsetWidth?z.getBoundingClientRect():null,t=Ie=or(),n=Fe.includes(t.corner);if(z.className=n?[t.corner,t.circle&&"circle",U&&"live",t.mirror&&"mirror",t.full&&"full"].filter(Boolean).join(" "):"",z.style.width=t.size+"%",z.hidden=!n||q||t.off,Qa.dataset.pip=z.hidden||t.full?"none":t.corner,z.hidden||De||!z.animate)return;let o="cubic-bezier(.65,0,.35,1)";if(!e){z.animate([{opacity:0},{opacity:1}],{duration:300,easing:"ease-out"});return}let a=z.getBoundingClientRect();Math.abs(e.left-a.left)+Math.abs(e.top-a.top)+Math.abs(e.width-a.width)+Math.abs(e.height-a.height)<2||z.animate([{transformOrigin:"0 0",transform:"translate("+(e.left-a.left)+"px,"+(e.top-a.top)+"px) scale("+e.width/a.width+","+e.height/a.height+")"},{transformOrigin:"0 0",transform:"none"}],{duration:600,easing:o})}function ar(){let e=Ie;if(!e||z.hidden||e.full)return null;let t=T.clientWidth,n=T.clientHeight,o=16,a=t*e.size/100,r=e.circle?a:a*9/16,i=e.corner.includes("left")?o:t-o-a,s=e.corner.includes("top")?o:n-o-r;return{x0:i,y0:s,x1:i+a,y1:s+r}}function rr(){if(!Qe)return;if(q){zn(!0);return}let e=tr();ce=(ce+1)%e.length,fe=e[ce],yn(),R||Be("Camera: "+fe),!U&&!z.hidden?at():te()}function Uo(e){let t=Jn(e,{render:er});x=t.deck,d=t.nodes,yt();let n={"+++":"+++ format",reveal:"reveal.js format",headings:"headings"}[t.format];qa.textContent=d.size+(d.size===1?" card":" cards")+" \xB7 "+n,Xe.textContent=t.errCount?t.errCount+" card(s) had errors":""}function qo(){se=[...d.values()].filter(o=>!o.parent).map(o=>o.id);let e=0;function t(o,a){let r=d.get(o);if(r.depth=a,r.children.length===0)r._slot=e++;else{r.children.forEach(s=>t(s,a+1));let i=r.children.map(s=>d.get(s)._slot);r._slot=(Math.min(...i)+Math.max(...i))/2}}se.forEach(o=>t(o,0)),h=[];function n(o){h.push(o),d.get(o).children.forEach(n)}return se.forEach(n),Math.max(1,e)}function ir(){let e=[],t=[],n=[];return d.forEach(o=>{e[o.depth]=Math.max(e[o.depth]||0,o._h),t[o.depth]=Math.max(t[o.depth]||0,o._w),n[o.depth]=(n[o.depth]||0)+1}),{maxH:e,maxW:t,count:n,maxDepth:e.length-1}}function $o(e){e.x!==null&&!isNaN(e.x)&&(e.cx=e.x+e._w/2),e.y!==null&&!isNaN(e.y)&&(e.cy=e.y+e._h/2)}function sr(){let{maxH:e,maxDepth:t}=ir(),n=[0];for(let l=1;l<=t;l++)n[l]=n[l-1]+e[l-1]+Ka;let o=Ga-ze,a=[],r=(l,c)=>{let f=d.get(l);f.cx+=c,f.children.forEach(N=>r(N,c))},i=l=>{let c=d.get(l);a[c.depth]=Math.max(a[c.depth]??-1/0,c.cx+c._w/2),c.children.forEach(i)};function s(l){let c=d.get(l),f=a[c.depth]!==void 0?a[c.depth]+o:-1/0;c.children.length?(c.children.forEach(s),c.cx=(d.get(c.children[0]).cx+d.get(c.children[c.children.length-1]).cx)/2,c.cx-c._w/2<f&&r(l,f-(c.cx-c._w/2))):c.cx=(f===-1/0?0:f)+c._w/2,i(l)}se.forEach(s),d.forEach(l=>{l.cy=n[l.depth]+l._h/2,$o(l)})}function lr(e){let t=Math.PI*2/e,n=32,o=[],a=(s,l)=>Math.abs(s.cx-l.cx)<(s._w+l._w)/2+n&&Math.abs(s.cy-l.cy)<(s._h+l._h)/2+n,r=Math.max(0,...[...d.values()].map(s=>s.depth)),i=0;for(let s=0;s<=r;s++){let l=[...d.values()].filter(f=>f.depth===s);if(!l.length)continue;let c=s===0?se.length>1?Xa*.5:0:i+Va;for(let f=0;f<400&&(l.forEach(M=>{let b=(M._slot+.5)*t-Math.PI/2;M.cx=c*Math.cos(b),M.cy=c*Math.sin(b),$o(M)}),!!l.some((M,b)=>l.some((E,g)=>g>b&&a(M,E))||o.some(E=>a(M,E))));f++)c=c*1.02+10;i=c,o.push(...l)}}function dr(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),n=[];for(;t.nextNode();)n.push(t.currentNode);n.forEach(o=>{let a=o.data.match(/^\s*\.element:\s*([\s\S]*)$/);if(!a)return;let r=o.previousSibling;for(;r&&r.nodeType===3&&!r.data.trim();)r=r.previousSibling;let i=r&&r.nodeType===1?r:o.parentElement;i&&Object.entries(He(a[1])).forEach(([s,l])=>{s==="class"?i.classList.add(...l.split(/\s+/).filter(Boolean)):s==="style"?i.style.cssText+=";"+l:i.setAttribute(s,l)})})}function Zt(e){let t=document.createElement("figure");t.className="media",e.replaceWith(t),t.appendChild(e);let n=e.getAttribute("alt");return n&&t.insertAdjacentHTML("beforeend","<figcaption>"+C(n)+"</figcaption>"),t}function cr(e,t){let n=document.createElement("figure");return n.className="media yt fragment yt-play"+(e.portrait?" portrait":""),n.innerHTML='<div class="frame"><iframe src="'+uo(e)+'" title="'+C(t||"YouTube video")+'" allow="autoplay; encrypted-media; picture-in-picture; fullscreen" allowfullscreen loading="lazy"></iframe></div>'+(t?"<figcaption>"+C(t)+"</figcaption>":""),n}function Eo(e,t){let n=t<=4?t:t<=6?3:4;e.style.setProperty("--cols",n),e.style.setProperty("--rows",Math.ceil(t/n))}function ur(e,t){t.querySelectorAll("pre > code.language-svg").forEach(r=>{let i=document.createElement("img");i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(r.textContent.trim()),i.alt="";let s=document.createElement("p");s.appendChild(i),r.parentElement.replaceWith(s)}),t.querySelectorAll(":scope > p").forEach(r=>{let i=r.children.length===1?r.children[0]:null;if(!i)return;let s=i.tagName==="A"&&r.textContent.trim()===i.textContent.trim()?i.getAttribute("href"):i.tagName==="IMG"?i.getAttribute("src"):null,l=s&&po(s);l&&r.replaceWith(cr(l,i.tagName==="IMG"?i.getAttribute("alt"):""))}),t.querySelectorAll(":scope > ul, :scope > ol").forEach(r=>{let i=[...r.children];!i.length||!i.every(s=>s.querySelector("img")&&!s.textContent.trim())||(r.classList.add("gallery"),i.forEach(s=>{let l=s.querySelector("img");s.innerHTML="",s.appendChild(l),Zt(l)}),i.length>1&&i.every(s=>s.classList.contains("fragment"))?(r.classList.add("carousel"),i[0].classList.remove("fragment","fade-up"),i.forEach((s,l)=>{s.classList.replace("fade-up","current-visible");let c=s.querySelector("figcaption");c&&(c.dataset.count=l+1+" / "+i.length)})):Eo(r,i.length))}),t.querySelectorAll(":scope > p").forEach(r=>{if(!pr(r))return;let i=[...r.querySelectorAll("img")];if(i.length===1){r.replaceWith(i[0]),Zt(i[0]);return}let s=document.createElement("div");s.className="gallery grid",r.replaceWith(s),i.forEach(l=>{s.appendChild(l),Zt(l)}),Eo(s,i.length)});let n=[...t.children].filter(r=>!/^H[1-6]$/.test(r.tagName)&&!(r.nodeType===1&&r.tagName==="HR")),o=n.filter(r=>r.matches("figure.media"));o.length===1&&n.length===1&&e.classList.add("card-media"),n.length===1&&(n[0].matches("figure.media:not(.yt)")||n[0].matches(".gallery.carousel"))&&e.classList.add("card-bleed");let a=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT);for(;a.nextNode();)if(/^\s*view\s*:\s*full\s*$/i.test(a.currentNode.data))e.classList.add("card-full");else if(o.length===1){e.classList.add("card-split",n.indexOf(o[0])===0?"media-first":"media-last");let r=document.createElement("div");r.className="split-text",n.filter(i=>i!==o[0]).forEach(i=>r.appendChild(i)),o[0].after(r),n.indexOf(o[0])!==0&&r.after(o[0])}t.querySelector(".gallery")&&e.classList.add("card-gallery")}function Yo(e,t){let n=e.querySelector("iframe");n&&n.contentWindow&&n.contentWindow.postMessage(JSON.stringify({event:"command",func:t,args:[]}),"*")}function hr(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),n=[];for(;t.nextNode();)/^\s*steps\s*$/i.test(t.currentNode.data)&&n.push(t.currentNode);n.forEach(o=>{let a=o.nextSibling;for(;a&&a.nodeType!==1;)a=a.nextSibling;a&&/^(UL|OL)$/.test(a.tagName)&&a.querySelectorAll(":scope > li").forEach(r=>r.classList.add("fragment","fade-up"))})}function mr(e){let t=[...e.querySelectorAll(".fragment")].map((a,r)=>({e:a,i:r,k:a.dataset.fragmentIndex}));if(t.every(a=>a.k===void 0))return t.map(a=>[a.e]);let n=0;t.forEach(a=>{a.k=a.k===void 0?n:parseFloat(a.k),n=Math.max(n,a.k)+1}),t.sort((a,r)=>a.k-r.k||a.i-r.i);let o=[];return t.forEach((a,r)=>{r&&t[r-1].k===a.k?o[o.length-1].push(a.e):o.push([a.e])}),o}function vn(e,t,n){!e||!e.frags||(n&&e.el.classList.add("snap"),e.frags.forEach((o,a)=>o.forEach(r=>{let i=r.classList.contains("visible");r.classList.toggle("visible",a<t),r.classList.toggle("current-fragment",a===t-1),r.classList.contains("yt-play")&&i!==a<t&&!n&&Yo(r,a<t?"playVideo":"pauseVideo")})),n&&(e.el.offsetWidth,e.el.classList.remove("snap")))}function fr(){try{return x.base?new URL(x.base,X||location.href):X?new URL(X):null}catch{return null}}function gr(e){let t=fr(),n=0;return e.querySelectorAll("img[src], source[src], video[src], iframe[src], a[href]").forEach(o=>{let a=o.hasAttribute("src")?"src":"href",r=o.getAttribute(a);if(!r||/^(#|[a-z][a-z0-9+.-]*:|\/\/)/i.test(r))return;if(!t){a==="src"&&n++;return}let i=t;try{x.site&&(i=new URL(x.site,t))}catch{}o.setAttribute(a,new URL(r,r.startsWith("/")?i:t).href)}),n}function Ot(e){let t=e.el,n=t.querySelector(".body");t.classList.add("measuring"),n.style.zoom="";let o=ze;e.visual=!!n.querySelector("iframe, .echarts-container, pre > code.language-dot, pre > code.language-d2, pre > code.language-echarts, .diagram, figure.media"),e.visual&&(o=ae);let a=t.classList.contains("card-full");if(t.classList.remove("img-portrait","img-landscape","img-overlay"),a&&(o=ae),t.classList.contains("card-bleed")){let s=Math.max(0,...[...n.querySelectorAll("img")].map(l=>l.naturalWidth&&l.naturalHeight?l.naturalWidth/l.naturalHeight:0))||1.7777777777777777;if(a||Math.abs(s-16/9)<.08)t.classList.add("img-overlay"),o=ae;else if(s<1.3){let l=Math.min(Math.round(wo*s),ae-300);t.classList.add("img-portrait"),t.style.setProperty("--img-w",l+"px"),o=Math.min(ae,Math.max(Jt,l*2))}else t.classList.add("img-landscape"),o=Math.round(Math.max(ze,Math.min(ae,(wo-Ya)*s))),t.style.setProperty("--img-h",Math.round(o/s)+"px")}else(n.querySelector('[style*="flex"], [style*="grid"], .r-hstack')||n.querySelectorAll("img").length>=4)&&(o=Jt);let r=n.querySelectorAll("table");if(r.length){t.style.width=ae+"px";let s=t.offsetWidth-n.clientWidth;r.forEach(l=>{o=Math.max(o,Math.min(Jt,Math.ceil(l.offsetWidth)+s+12))})}let i=n.querySelectorAll(".fragment.grow");if(i.length){t.style.width=o+"px";let s=t.offsetWidth-n.clientWidth;i.forEach(l=>{o=Math.max(o,Math.min(ae,Math.ceil(l.offsetWidth*1.3)+s))})}t.style.width=o+"px",t.scrollWidth>o+2&&(t.style.width=(o=Math.min(ae,t.scrollWidth+24))+"px"),n.scrollWidth>n.clientWidth+2&&(n.style.zoom=(n.clientWidth/n.scrollWidth).toFixed(3)),e._w=o,e._h=t.offsetHeight||an,t.classList.remove("measuring")}function br(){clearTimeout(So),So=setTimeout(()=>{d.forEach(Ot),et(),te(!0)},200)}function wr(){Object.entries(xr).forEach(([e,t])=>{let n={axisLine:{lineStyle:{color:t.line}},axisTick:{lineStyle:{color:t.line}},axisLabel:{color:t.muted},splitLine:{lineStyle:{color:t.split}},nameTextStyle:{color:t.muted}};echarts.registerTheme("slidetake-"+e,{color:t.palette,backgroundColor:"transparent",textStyle:{color:t.text,fontFamily:"'IBM Plex Sans', sans-serif"},title:{textStyle:{color:t.text},subtextStyle:{color:t.muted}},legend:{textStyle:{color:t.text}},tooltip:{backgroundColor:t.tip,borderColor:t.line,textStyle:{color:t.text}},categoryAxis:n,valueAxis:n,logAxis:n,timeAxis:n,line:{symbolSize:6,lineStyle:{width:2.5}}})})}function sn(e){return Qt[e]||(Qt[e]=new Promise((t,n)=>{let o=document.createElement("script");o.src=e,o.onload=t,o.onerror=()=>{delete Qt[e],n(new Error("could not load "+e))},document.head.appendChild(o)}))}async function Lr(){let e=ye,t=[...F.querySelectorAll(".node pre > code.language-dot")];F.querySelectorAll(".node pre > code.language-echarts").forEach(r=>{let i=document.createElement("div");i.className="echarts-container",i.dataset.chart=r.textContent,r.parentElement.replaceWith(i)});let n=[...F.querySelectorAll(".node .echarts-container[data-chart]")],o=[...F.querySelectorAll(".node pre > code.language-d2")];if(!t.length&&!n.length&&!o.length)return;let a=[];if(t.length)try{if(await sn(yr),en=en||await Viz.instance(),e!==ye)return;t.forEach(r=>{let i=document.createElement("div");i.className="diagram";try{i.appendChild(en.renderSVGElement(r.textContent))}catch(s){i.className="diagram err",i.textContent="Diagram error: "+s.message}r.parentElement.replaceWith(i)})}catch{a.push("diagrams")}if(o.length)try{if(!mt){let i=await import(kr);mt=new i.D2}if(e!==ye)return;let r=Er[vt()];for(let i of o){let s=document.createElement("div");s.className="diagram d2";try{let l=await mt.compile(Sr(i.textContent));s.innerHTML=await mt.render(l.diagram,{...l.renderOptions||{},themeOverrides:r,darkThemeOverrides:r})}catch(l){s.className="diagram err",s.textContent="Diagram error: "+(l.message||l)}if(e!==ye)return;i.parentElement.replaceWith(s)}}catch{a.push("D2 diagrams")}if(n.length)try{if(await sn(vr),e!==ye)return;echarts._slidetakeThemes||(wr(),echarts._slidetakeThemes=!0),n.forEach(r=>{let i;try{i=JSON.parse(r.dataset.chart)}catch{r.textContent="Chart data is not valid JSON.";return}echarts.init(r,"slidetake-"+(vt()==="light"?"light":"dark"),{renderer:"svg"}).setOption(Object.assign({backgroundColor:"transparent",animation:!De},i))})}catch{a.push("charts")}e===ye&&(a.length&&(Xe.textContent="Could not load the "+a.join(" and ")+" renderer (offline?)"),d.forEach(Ot),et(),te(!0))}function Tr(){let e=[];return h.forEach(t=>{let n=Ze(t),o=e[e.length-1];o&&o.sec===n?o.ids.push(t):e.push({sec:n,ids:[t]})}),e}function Cr(){let n=0,o=0,a=0;Tr().forEach((r,i)=>{let s=Math.max(...r.ids.map(f=>d.get(f)._h));i&&(n+=a/2+120+s/2);let l=o,c=o;r.ids.forEach((f,N)=>{let M=d.get(f);N&&(l+=90+M._w/2),M.cx=l,M.cy=n,c=l,l+=M._w/2}),o=c,a=s})}function Mr(){d.forEach(e=>{e.cx=0,e.cy=0})}function Go(){ye++,window.echarts&&F.querySelectorAll(".echarts-container").forEach(n=>{let o=echarts.getInstanceByDom(n);o&&o.dispose()}),F.querySelectorAll("div.node").forEach(n=>n.remove());let e=qo(),t=0;d.forEach(n=>{let o=document.createElement("div");o.className="node",o.tabIndex=0,o.dataset.id=n.id;let a=n.parent?zt(n.id).slice(0,-1).map(i=>d.get(i).title).join(" / "):"";o.innerHTML=(a?'<div class="crumb">'+C(a)+"</div>":"")+'<div class="body">'+n.html+"</div>"+(n.err?'<div class="err-badge">!</div>':"");let r=o.querySelector(".body");dr(r),hr(r),ur(o,r),r.querySelectorAll("thead").forEach(i=>{i.textContent.trim()||i.remove()}),t+=gr(r),n.frags=mr(r),r.querySelectorAll("img").forEach(i=>{i.complete||i.addEventListener("load",br,{once:!0})}),o.querySelectorAll("a[href]").forEach(i=>{let s=i.getAttribute("href");if(s.startsWith("#")){let l=decodeURIComponent(s.slice(1));d.has(l)&&(i.classList.add("xlink"),i.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),u.active||A(l)}))}else i.target="_blank",i.rel="noopener",i.addEventListener("click",l=>l.stopPropagation())}),o.addEventListener("click",()=>{u.active||A(n.id)}),o.addEventListener("keydown",i=>{i.key==="Enter"&&i.target===o&&A(n.id)}),F.appendChild(o),n.el=o,vn(n,n.frags.length)}),t&&!Xe.textContent&&(Xe.textContent=t+" image(s) use relative paths: add base: to the deck, or open it with ?src="),d.forEach(Ot),et(e),Lr()}function et(e){e===void 0&&(e=qo()),P==="radial"?lr(e):P==="path"?Cr():P==="focus"?Mr():sr(),F.classList.toggle("focus",P==="focus"),d.forEach(t=>{let n=t.el.style;n.setProperty("--cx",t.cx),n.setProperty("--cy",t.cy)}),Br(),_e(),En()}function Br(){let e="";if(P==="focus"){Xt.innerHTML="";return}if(P==="path"){for(let t=1;t<h.length;t++){let n=d.get(h[t-1]),o=d.get(h[t]);e+='<path data-from="'+n.id+'" data-to="'+o.id+'" d="M '+n.cx+" "+n.cy+" L "+o.cx+" "+o.cy+'"/>'}Xt.innerHTML=e;return}d.forEach(t=>{if(!t.parent)return;let n=d.get(t.parent);if(P==="radial")e+='<path data-from="'+n.id+'" data-to="'+t.id+'" d="M '+n.cx+" "+n.cy+" L "+t.cx+" "+t.cy+'"/>';else{let o=n.cy+n._h/2,a=t.cy-t._h/2,r=o+(a-o)/2;e+='<path data-from="'+n.id+'" data-to="'+t.id+'" d="M '+n.cx+" "+o+" L "+n.cx+" "+r+" L "+t.cx+" "+r+" L "+t.cx+" "+a+'"/>'}}),Xt.innerHTML=e}function zt(e){let t=[],n=e;for(;n;)t.unshift(n),n=d.get(n).parent;return t}function Pe(){let e=T.clientWidth,t=T.clientHeight;F.style.transform="translate("+e/2+"px,"+t/2+"px) scale("+S.zoom+") translate("+-S.x+"px,"+-S.y+"px)",ea()}function xn(){Ke&&(Ke.kill(),Ke=null)}function ln(e,t){if(xn(),t||De||!window.gsap){Object.assign(S,e),Pe();return}let n=T.clientWidth,o=Math.hypot(e.x-S.x,e.y-S.y),a=e.zoom,r=gsap.timeline({onUpdate:Pe,onComplete:()=>{Ke=null}}),{zoom:i,...s}=e,l=o*Math.min(S.zoom,a),c=Math.max(.55,Math.min(1.3,.55+l/n*.3));if(r.to(S,{...s,duration:c,ease:"power2.inOut"},0),l>n*1.2){let f=Math.max(.06,Math.min(S.zoom,a,n*.9/(o+ze)));r.to(S,{zoom:f,duration:c/2,ease:"sine.out"},0).to(S,{zoom:a,duration:c/2,ease:"sine.in"},c/2)}else r.to(S,{zoom:a,duration:c,ease:"power2.inOut"},0);Ke=r}function Or(){let e=T.getBoundingClientRect(),t=14,n=[];if(!de.hidden&&de.offsetWidth){let a=de.getBoundingClientRect();n.push({x0:a.left-e.left-t,y0:a.top-e.top-t,x1:a.right-e.left+t,y1:a.bottom-e.top+t})}let o=ar();return o&&n.push({x0:o.x0-t,y0:o.y0-t,x1:o.x1+t,y1:o.y1+t}),n}function zr(){let e=T.clientWidth,t=T.clientHeight,n=[{x0:16,y0:R?20:56,x1:e-16,y1:t-(R?20:74)}];return Or().forEach(o=>{let a=[];n.forEach(r=>{if(o.x1<=r.x0||o.x0>=r.x1||o.y1<=r.y0||o.y0>=r.y1){a.push(r);return}[{...r,x1:Math.min(r.x1,o.x0)},{...r,x0:Math.max(r.x0,o.x1)},{...r,y1:Math.min(r.y1,o.y0)},{...r,y0:Math.max(r.y0,o.y1)}].forEach(i=>{i.x1-i.x0>80&&i.y1-i.y0>80&&a.push(i)})}),a.length&&(n=a)}),n}function dn(e,t,n){let o=T.clientWidth,a=T.clientHeight,r=null;return zr().forEach(i=>{let s=n*Math.min((i.x1-i.x0)/e,(i.y1-i.y0)/t);(!r||s>r.zoom)&&(r={zoom:s,sx:(i.x0+i.x1)/2-o/2,sy:(i.y0+i.y1)/2-a/2})}),r}function Ko(e,t,n,o){return{x:e-n.sx/o,y:t-n.sy/o}}function Se(e,t){let n=d.get(e);if(!n)return;if(document.body.classList.toggle("full-card",n.el.classList.contains("card-full")),n.el.classList.contains("card-full")){let l=Math.min(T.clientWidth/n._w,T.clientHeight/n._h);ln({x:n.cx,y:n.cy,zoom:l},t);return}let o=dn(n._w,n._h,Je),a=Ze(e),r=h.filter(l=>Ze(l)===a&&!d.get(l).visual).map(l=>{let c=d.get(l);return dn(c._w,c._h,Je).zoom}).sort((l,c)=>l-c),i=r.length?r[Math.floor((r.length-1)/2)]:o.zoom,s=Math.max(.2,Math.min(5,o.zoom,i));ln(Object.assign(Ko(n.cx,n.cy,o,s),{zoom:s}),t)}function tt(e){document.body.classList.remove("full-card");let t=[...d.values()];if(!t.length)return;let n=T.clientWidth,o=T.clientHeight,a=Math.min(...t.map(f=>f.cx-f._w/2)),r=Math.max(...t.map(f=>f.cx+f._w/2)),i=Math.min(...t.map(f=>f.cy-f._h/2)),s=Math.max(...t.map(f=>f.cy+f._h/2)),l=dn(r-a,s-i,.94),c=Math.max(.05,Math.min(1,l.zoom));ln(Object.assign(Ko((a+r)/2,(i+s)/2,l,c),{zoom:c}),e)}function te(e){p&&d.has(p)?Se(p,e):tt(e)}function _e(){let e=p?zt(p):[];d.forEach(t=>{let n=t.el;n.classList.toggle("current",t.id===p),n.classList.toggle("active-path",e.includes(t.id))}),F.querySelectorAll("#connectors path").forEach(t=>{let n=P==="path"?!!p&&h.indexOf(t.dataset.to)<=h.indexOf(p):e.includes(t.dataset.from)&&e.includes(t.dataset.to);t.classList.toggle("active",n)}),Rr(e),Xo()}function Vo(){return Gn(new URLSearchParams(location.search).get("duration")??x.duration)}function Ir(){return R&&Vo()>0&&(!u.active||/^always$/i.test(x.timer||""))}function xt(){let e=Ir()&&pe.start>0;if(xe.classList.toggle("timed",e),!e){xe.classList.remove("over");return}let n=(u.active&&u.t0?St():performance.now()-pe.start)/Vo();xe.firstChild.style.width=Math.min(100,n*100)+"%",xe.classList.toggle("over",n>=1)}function Pr(){pe.start=performance.now(),clearInterval(pe.timer),pe.timer=setInterval(xt,1e3),xt()}function Ar(){clearInterval(pe.timer),pe.timer=null,pe.start=0,xt()}function Xo(){let e=R&&h.length>1&&!/^(off|no|false)$/i.test(x.progress||"");if(xe.classList.toggle("show",e),!e)return;xt();let t=h.indexOf(p),n=0,o=0;h.forEach((a,r)=>{let i=Le(d.get(a)).length;n+=i,r<t?o+=i:r===t&&(o+=Math.min(ee,i-1)+1)}),xe.lastChild.style.width=(n?o/n*100:0)+"%"}function Rr(e){xo.innerHTML=e.map((t,n)=>(n>0?'<span class="sep">\u203A</span>':"")+'<button class="crumb-btn'+(t===p?" here":"")+'" data-id="'+C(t)+'">'+C(d.get(t).title)+"</button>").join(""),xo.querySelectorAll(".crumb-btn").forEach(t=>t.addEventListener("click",()=>{u.active||A(t.dataset.id)}))}function nt(e){let t=d.get(p);t&&(vn(t,Fo().frag,e),yn(),(z.hidden||!Ie||!Ie.full)&&jr(t),kn(t))}function _r(e){return!h.length||e.id!==h[0]&&e.id!==h[h.length-1]||e.el.querySelector("[data-gsap], .title-scramble")?null:[...e.el.querySelector(".body").children].filter(t=>!t.classList.contains("fragment"))}function jr(e){if(e._played||!window.gsap||De)return;e._played=!0;let t=_r(e);if(t&&t.length){e._auto=t;let[n,...o]=t;/^H[1-3]$/.test(n.tagName)&&!n.children.length?(n.classList.add("auto-scramble"),Lo(n)):o.unshift(n),gsap.from(o,{opacity:0,y:24,duration:.7,ease:"power2.out",delay:.5,stagger:.45})}e.el.querySelectorAll("[data-gsap]").forEach(n=>{let o;try{o=JSON.parse(n.dataset.gsap)}catch{return}let a={duration:o.duration??1,delay:o.delay??0,ease:o.ease||"power2.out"};o.to?gsap.fromTo(n,o.from||{},Object.assign({},o.to,a)):o.from&&gsap.from(n,Object.assign({},o.from,a))}),e.el.querySelectorAll(".title-scramble").forEach(Lo)}function wn(e){!e||!e._played||(e._played=!1,window.gsap&&(e._auto&&(e._auto.forEach(t=>{gsap.killTweensOf(t),gsap.set(t,{clearProps:"opacity,transform"})}),e._auto=null),e.el.querySelectorAll("[data-gsap]").forEach(t=>{gsap.killTweensOf(t);let n={};try{n=JSON.parse(t.dataset.gsap)}catch{}let o=new Set(Object.keys(Object.assign({},n.from,n.to)).map(a=>Dr.includes(a)?"transform":a));o.size&&gsap.set(t,{clearProps:[...o].join(",")})}),e.el.querySelectorAll(".title-scramble, .auto-scramble").forEach(t=>{t._scramble&&t._scramble.kill(),t.dataset.text&&(t.textContent=t.dataset.text)})))}function Lo(e){let t=e.dataset.text||(e.dataset.text=e.textContent),n=Array.from(t),o="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#%&*+=?",a={p:0};e._scramble=gsap.to(a,{p:1,duration:1.4,ease:"none",onUpdate(){let r=Math.floor(a.p*n.length);e.textContent=n.map((i,s)=>s<r||/\s/.test(i)?i:o[Math.random()*o.length|0]).join("")},onComplete(){e.textContent=t}})}function kn(e){clearTimeout(Ae),!(!R||!e||!e.autoslide||u.active&&(!u.t0||u.paused))&&(Ae=setTimeout(()=>{p===e.id&&Re(1)},e.autoslide))}function Jo(e){let t=e&&e!==h[0]?e:"";try{y&&y.kind==="share"?history.replaceState(null,"",location.pathname+location.search+Gt(y.data,t)):history.replaceState(null,"",e?"#"+encodeURIComponent(e):location.pathname+location.search)}catch{}}function A(e,t,n){if(!d.has(e))return;if(e!==p){fe=null,ce=-1,ee=n?Le(d.get(e)).length-1:0;let r=d.get(p);r&&P==="focus"&&!t&&(r.el.classList.add("leaving"),setTimeout(()=>r.el.classList.remove("leaving"),600)),Zo()}let o=e!==p;if(p=e,clearTimeout(V),V=null,o&&P==="focus"&&!t&&!De){let r=d.get(e).el;r.classList.add("entering"),r.offsetWidth,r.classList.remove("entering")}nt(o),o&&Mn("slide",e);let a=d.get(e);o&&a.mapFirst&&!n&&!t&&P!=="focus"?(tt(),V=setTimeout(()=>{V=null,p===e&&Se(e)},1900)):Se(e,t),_e(),En(),Jo(e)}function Zo(){let e=d.get(p);e&&(e.el.querySelectorAll("figure.yt").forEach(t=>Yo(t,"pauseVideo")),vn(e,e.frags.length,!0),wn(e))}function Nr(){if(!p&&we&&d.has(we)){Qo();return}p&&(we=p),P==="focus"&&ke("path"),Zo(),clearTimeout(Ae),p=null,_e(),En(),tt(),Jo(null)}function Qo(){if(V)return clearTimeout(V),V=null,Se(p),!0;if(!p&&we&&d.has(we)){let e=we;return we=null,A(e),!0}return!1}function Re(e){if(!p){h.length&&A(h[e>0?0:h.length-1]);return}if(V&&e>0){clearTimeout(V),V=null,Se(p);return}let t=Le(d.get(p)),n=Math.min(ee,t.length-1)+e;if(n>=0&&n<t.length){ee=n,fe=null,ce=-1,nt(),!U&&!z.hidden&&Ie.used?at():te(),_e();return}let o=h.indexOf(p)+e;o>=0&&o<h.length&&A(h[o],!1,e<0)}function Hr(){let e=d.get(p);e&&e.parent&&A(e.parent)}function Wr(){let e=d.get(p);e&&e.children.length?A(e.children[0]):!p&&h.length&&A(h[0])}function En(){let e=[...d.values()];if(!e.length){on.innerHTML="",re=null;return}$a.textContent="map";let t=g=>g.cx,n=g=>g.cy,o=Math.min(...e.map(t))-ze/2,a=Math.max(...e.map(t))+ze/2,r=Math.min(...e.map(n))-an/2,i=Math.max(...e.map(n))+an/2,s=16,l=180,c=130,f=Math.min((l-2*s)/Math.max(1,a-o),(c-2*s-6)/Math.max(1,i-r)),N=l/2-(o+a)/2*f,M=c/2+5-(r+i)/2*f,b=p?zt(p):[],E="";e.forEach(g=>{if(!g.parent)return;let B=d.get(g.parent);E+='<line x1="'+(t(B)*f+N)+'" y1="'+(n(B)*f+M)+'" x2="'+(t(g)*f+N)+'" y2="'+(n(g)*f+M)+'" stroke="var(--panel-line)" stroke-width="1"/>'}),e.forEach(g=>{let B=g.id===p?"var(--accent)":b.includes(g.id)?"var(--accent-teal)":"var(--node-border)";E+='<circle data-id="'+C(g.id)+'" cx="'+(t(g)*f+N)+'" cy="'+(n(g)*f+M)+'" r="'+(g.id===p?4:3)+'" fill="'+B+'"><title>'+C(g.title)+"</title></circle>"}),E+='<rect id="mm-viewport" fill="none" stroke="var(--accent)" stroke-width="1" opacity="0.7"/>',on.innerHTML=E,re={s:f,ox:N,oy:M},ea()}function ea(){let e=document.getElementById("mm-viewport");if(!e||!re)return;let t=T.clientWidth/S.zoom,n=T.clientHeight/S.zoom;e.setAttribute("x",(S.x-t/2)*re.s+re.ox),e.setAttribute("y",(S.y-n/2)*re.s+re.oy),e.setAttribute("width",Math.max(2,t*re.s)),e.setAttribute("height",Math.max(2,n*re.s))}function It(e){Uo(J.value),p&&!d.has(p)&&(p=null),Go(),p?A(p,e):h.length?A(h[0],e):(p=null,tt(!0))}function ke(e,t){P=e,Q("slidetake:layout",e),document.querySelectorAll("#layout-toggle .seg-btn").forEach(n=>n.classList.toggle("active",n.dataset.mode===e)),d.size&&(!t&&!De&&(F.classList.add("morph"),setTimeout(()=>F.classList.remove("morph"),700)),et(),Pe(),p?Se(p,t):tt(t))}function ta(e){return Math.max(.04,Math.min(5,e))}function Fr(e){Je=Math.round(Math.max(Ja,Math.min(Za,e))*100)/100,Q("slidetake:slideSize",Je),p&&Se(p)}function Co(e){p?Fr(Je+e*.1):na(e>0?1.2:1/1.2)}function na(e,t,n){xn();let o=ta(S.zoom*e);if(t!==void 0){let a=T.getBoundingClientRect(),r=t-a.left-a.width/2,i=n-a.top-a.height/2;S.x+=r/S.zoom-r/o,S.y+=i/S.zoom-i/o}S.zoom=o,Pe()}function Pt(){O||(me.classList.toggle("collapsed"),document.getElementById("btn-edit-toggle").classList.toggle("active",!me.classList.contains("collapsed")))}function ge(e){R=e,document.body.classList.toggle("presenting",e),va();let t=document.documentElement;e&&t.requestFullscreen&&!document.fullscreenElement&&t.requestFullscreen().catch(()=>{}),!e&&document.fullscreenElement&&document.exitFullscreen&&document.exitFullscreen().catch(()=>{}),e&&!p&&h.length&&A(h[0]);let n=x.camera||[...d.values()].some(o=>o.camera);e&&n&&!U&&!q&&at(),e?kn(d.get(p)):clearTimeout(Ae),e?Pr():Ar(),Xo()}function St(){return(u.paused?u.pauseAt:performance.now())-u.t0-u.pausedMs}function At(e){e.classList.add("open")}function Tn(){document.querySelectorAll(".modal.open").forEach(e=>e.classList.remove("open"))}function Yr(){let e=new URLSearchParams(location.search).get("obs");if(e){let[t,n,...o]=e.split(":");return wt.value=t||"localhost",kt.value=n||"4455",Et.value=o.join(":"),!0}try{let t=JSON.parse(Z("slidetake:obs")||"null");t&&(wt.value=t.host||"localhost",kt.value=t.port||"4455",Et.value=t.password||"",Sn.checked=!0)}catch{}return!1}function ra(){if(Sn.checked)Q("slidetake:obs",JSON.stringify({host:wt.value.trim(),port:kt.value.trim(),password:Et.value}));else try{localStorage.removeItem("slidetake:obs")}catch{}}function $e(e,t){Io.textContent=e,Io.className=t||""}function Kr(e){return location.protocol==="https:"&&!Gr(e)}async function ia(){let e=wt.value.trim()||"localhost",t="ws://"+e+":"+(kt.value.trim()||"4455");if(Kr(e)){ve=!1,Ve.disabled=!0,$e(Vr,"err");return}$e("Connecting to "+t+"\u2026");try{await sn(Ur);let n=window.OBSWebSocket&&(window.OBSWebSocket.default||window.OBSWebSocket);if(W)try{await W.disconnect()}catch{}W=new n,W.on("ConnectionClosed",()=>{ve=!1,$e("Disconnected from OBS","err"),Ve.disabled=!0}),W.on("RecordStateChanged",a=>{a.outputState==="OBS_WEBSOCKET_OUTPUT_STARTED"&&Ee&&(Ee(),Ee=null),a.outputState==="OBS_WEBSOCKET_OUTPUT_STOPPED"&&u.active&&u.withObs&&!u.finishing&&Rt("Stopped in OBS")});let o=await W.connect(t,Et.value||void 0);ve=!0;try{let a=await W.call("GetVideoSettings");a&&a.fpsNumerator&&a.fpsDenominator&&(oa=a.fpsNumerator/a.fpsDenominator)}catch{}$e("Connected"+(o&&o.obsWebSocketVersion?" \xB7 OBS WebSocket "+o.obsWebSocketVersion:""),"ok"),ra()}catch(n){ve=!1,$e("Could not connect ("+(n&&n.message||n)+"). Is OBS running with its WebSocket server on, and is the password right?","err")}Ve.disabled=!ve}function Xr(){let e=document.getElementById("rec-screen"),t=screen.width,n=screen.height;if(Math.abs(t/n-16/9)<.02){e.innerHTML='<span class="ok">This screen is 16:9 ('+t+"\xD7"+n+"), right for YouTube.</span>";return}let o=[["16:10",1.6],["3:2",1.5],["4:3",4/3],["21:9",21/9],["16:9",16/9]],[a,r]=o.reduce((s,l)=>Math.abs(l[1]-t/n)<Math.abs(s[1]-t/n)?l:s),i=Math.abs(r-t/n)<.005?a:"about "+a;e.innerHTML='<span class="warn">This screen is '+i+" ("+t+"\xD7"+n+"), not 16:9, so the video will have bars or be cropped. Move this window to a 16:9 screen, physical or virtual (say 1920\xD71080), then press F there.</span>"}function pn(){if(!Qe)return;let e=h.reduce((n,o)=>n+Le(d.get(o)).length,0),t=x.camera||[...d.values()].some(n=>n.camera);document.getElementById("rec-deck-info").innerHTML=C(x.title||(se[0]?d.get(se[0]).title:"This deck"))+" \xB7 "+h.length+" slides \xB7 "+e+" presses"+(t&&q?'<br><span class="warn">The camera is off. Press C first if this take should include your webcam.</span>':""),Ve.disabled=!ve,ti(),Xr(),At(qr)}async function sa(e){if(u.active||!h.length)return;Tn(),Object.assign(u,{active:!0,withObs:e,counting:!0,paused:!1,finishing:!1,t0:0,pausedMs:0,events:[],outputPath:null}),document.body.classList.add("recording"),ba();let t=document.getElementById("rec-layout").value;t!=="current"&&t!==P&&ke(t,!0),R||ge(!0),p===h[0]&&(ee=0,fe=null,ce=-1),A(h[0],!0);for(let o=3;o>0;o--)if(ft.querySelector(".num").textContent=o,ft.classList.add("show"),await Ln(1e3),!u.active)return;if(ft.classList.remove("show"),await aa(),e){let o=new Promise(a=>{Ee=a,setTimeout(()=>{Ee&&(Ee(),Ee=null)},2500)});try{await W.call("StartRecord")}catch(a){Cn("OBS could not start recording: "+(a&&a.message||a));return}if(await o,!u.active)return}u.counting=!1,u.t0=performance.now();let n=d.get(p);wn(n),nt(!0),Mn("slide",p)}function Cn(e){u.active=!1,u.counting=!1,ft.classList.remove("show"),document.body.classList.remove("recording"),R&&ge(!1),Be(e)}function Mn(e,t){if(!u.active||!u.t0||u.finishing)return;let n=d.get(t),o={id:t,title:n?n.title:t,retake:e==="retake",t:Math.round(St()),obsT:null};u.events.push(o),u.withObs&&ve&&(W.call("GetRecordStatus").then(a=>{a&&typeof a.outputDuration=="number"&&(o.obsT=a.outputDuration)}).catch(()=>{}),n&&W.call("CreateRecordChapter",{chapterName:(o.retake?"RETAKE \xB7 ":"")+n.title}).catch(()=>{}))}function Jr(e){let t=e.key;if((Bo.includes(t)||Oo.includes(t)||zo.includes(t)||t==="Escape")&&e.preventDefault(),t==="Escape"){u.counting?Cn("Take cancelled"):Rt("Stopped early");return}if(!(u.counting||u.finishing)){if(zo.includes(t)){ei();return}u.paused||(Bo.includes(t)?Zr():Oo.includes(t)&&Qr())}}function Zr(){let e=Le(d.get(p));Math.min(ee,e.length-1)>=e.length-1&&h.indexOf(p)===h.length-1?Rt():Re(1)}function Qr(){let e=d.get(p);e&&(Mn("retake",p),ee=0,fe=null,ce=-1,wn(e),nt(!0),!U&&!z.hidden&&Ie.used?at():te(),_e())}async function ei(){u.t0&&(u.paused?(cn.classList.remove("show"),await aa(),u.withObs&&await W.call("ResumeRecord").catch(()=>{}),u.pausedMs+=performance.now()-u.pauseAt,u.paused=!1,kn(d.get(p))):(u.paused=!0,u.pauseAt=performance.now(),clearTimeout(Ae),u.withObs&&await W.call("PauseRecord").catch(()=>{}),cn.classList.add("show")))}async function Rt(e){if(!u.active||u.finishing)return;if(u.counting){Cn("Take cancelled");return}u.finishing=!0,clearTimeout(Ae),u.paused&&(u.pausedMs+=performance.now()-u.pauseAt,u.paused=!1,cn.classList.remove("show"));let t=Math.round(St()),n=null;if(u.withObs){await Ln(1200),t=Math.round(St());try{let a=await W.call("GetRecordStatus");a&&typeof a.outputDuration=="number"&&(n=a.outputDuration)}catch{}try{let a=await W.call("StopRecord");u.outputPath=a&&a.outputPath}catch(a){e=(e?e+". ":"")+"OBS did not confirm the stop ("+(a&&a.message||a)+")"}}u.active=!1,u.finishing=!1,document.body.classList.remove("recording"),R&&ge(!1);let o={key:Dt(),deckTitle:x.title||d.get(h[0]).title,date:new Date().toISOString(),withObs:u.withObs,outputPath:u.outputPath,reason:e||"",total:t,totalObs:n,fps:oa,events:u.events.map(a=>({id:a.id,title:a.title,retake:a.retake,t:a.t,obsT:a.obsT})),picks:{}};Bn(o),ma(o)}function Dt(){return Te(x.title||(h[0]?d.get(h[0]).title:"deck"))}function la(){try{return JSON.parse(Z("slidetake:sessions")||"[]")}catch{return[]}}function Bn(e){let t=la().filter(n=>n.date!==e.date);t.unshift(e),Q("slidetake:sessions",JSON.stringify(t.slice(0,12)))}function ti(){let e=document.getElementById("rec-sessions"),t=la().filter(n=>n.key===Dt());e.innerHTML=t.length?"<h3>Earlier takes of this deck</h3>"+t.map((n,o)=>'<div class="row"><button class="btn small" data-session="'+o+'">Review</button><span>'+C(new Date(n.date).toLocaleString())+" \xB7 "+K(n.totalObs??n.total)+(n.withObs?"":" \xB7 rehearsal")+(n.outputPath?" \xB7 "+C(Ce(n.outputPath)):"")+"</span></div>").join(""):"",e.querySelectorAll("[data-session]").forEach(n=>n.onclick=()=>{Tn(),ma(t[+n.dataset.session])})}function Ze(e){let t=d.has(e)?zt(e):[e];return t[Math.min(1,t.length-1)]}function da(e,t){let n=Ze(e);return{sec:n,title:d.has(n)?d.get(n).title:t}}function ua(){let e=Object.keys(x).filter(t=>t==="tags"||/_tags$/.test(t)).flatMap(t=>[].concat(x[t])).filter(t=>typeof t=="string");return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}function ni(){return[].concat(x.related||[]).map(e=>{let t=String(e).match(/^\[([^\]]+)\]\(([^)]+)\)$/),n=String(e).split("|");return t?t[1]+": "+t[2]:n.length===2?n[0].trim()+": "+n[1].trim():String(e)})}function oi(){if(x.permalink||x.url)return x.permalink||x.url;let e=x.site||Z("slidetake:site");if(!e||!X)return"";try{let t=new URL(X).pathname.replace(/\/index\.md$/i,"/").replace(/\.md$/i,"/");return new URL(t,e).href}catch{return""}}function ha(e){let t=ca(e),n=document.getElementById("rv-link").value.trim(),o=ni(),a=ua(),r=[];x.summary&&r.push(x.summary),n&&r.push("\u{1F4D1} Slides: "+n),t.lines.length>=3&&r.push(`Chapters
616
+ `+t.lines.join(`
617
+ `)),o.length&&r.push(`Related
618
+ `+o.map(i=>"\u2022 "+i).join(`
619
+ `)),a.length&&r.push(a.slice(0,3).map(i=>"#"+i.replace(/[^\p{L}\p{N}]+/gu,"")).join(" ")),document.getElementById("rv-yt-desc").value=r.join(`
620
+
621
+ `),document.getElementById("rv-chapters-note").textContent=(t.dropped?t.dropped+" section"+(t.dropped>1?"s were":" was")+" under 10 seconds and folded into the chapter before, as YouTube requires. ":"")+(t.lines.length<3?"YouTube needs at least three chapters, so none are listed. ":"")+"Final length "+K(t.length)+"."}function ma(e){j=e,H=null;let t=Ue(e),n=e.events.filter(a=>a.retake).length;document.getElementById("rv-title").textContent=(e.withObs?"Review the take \xB7 ":"Rehearsal \xB7 ")+e.deckTitle,document.getElementById("rv-info").textContent=[e.reason,new Date(e.date).toLocaleString(),(e.withObs?"recorded ":"ran ")+K(e.totalObs??e.total),t.size+" slides",n?n+" retake"+(n>1?"s":""):"no retakes",e.outputPath?"saved to "+e.outputPath:e.withObs?"":"nothing was recorded"].filter(Boolean).join(" \xB7 "),document.getElementById("rv-file").textContent=e.outputPath?" ("+Ce(e.outputPath)+")":"",document.getElementById("rv-yt-title").value=e.deckTitle;let o=ht(e);Lt.value=[...Lt.options].reduce((a,r)=>Math.abs(r.value-o)<Math.abs(a.value-o)?r:a).value,document.getElementById("rv-yt-tags").value=ua().join(", "),document.getElementById("rv-link").value=oi(),I.src&&ue!==Ce(e.outputPath)&&e.outputPath&&(I.removeAttribute("src"),I.load(),ue=""),document.getElementById("rv-novideo").hidden=!!I.src,_t(),At($r),si(e)}function _t(){let e=j,t=document.getElementById("rv-list"),n=null;t.innerHTML=[...Ue(e).values()].map(o=>{let a=e.picks[o.id]??o.takes.length,r=Ze(o.id),i=r!==n;n=r;let s=o.takes.map(l=>'<button class="rv-chip'+(a===l.no?" on":"")+'" data-id="'+C(o.id)+'" data-take="'+l.no+'">'+(o.takes.length>1?"Take "+l.no+" \xB7 ":"")+K(l.end-l.start)+"</button>").join("")+'<button class="rv-chip skip'+(a===0?" on":"")+'" data-id="'+C(o.id)+'" data-take="0">Leave out</button>';return'<div class="rv-row'+(i?" sec":"")+'"><div class="t">'+C(o.title)+"<small>"+K(o.takes[0].start)+'</small></div><div class="rv-chips">'+s+"</div></div>"}).join(""),t.querySelectorAll(".rv-chip").forEach(o=>o.onclick=()=>{e.picks[o.dataset.id]=+o.dataset.take,Bn(e),_t();let a=Ue(e).get(o.dataset.id),r=a&&a.takes[+o.dataset.take-1];r&&Ct([{start:r.start,end:r.end,title:a.title+(a.takes.length>1?" \xB7 take "+r.no:"")}])}),document.getElementById("rv-ffmpeg").value=pa(e,document.getElementById("rv-mode").value),ha(e)}function Ct(e){if(!I.src){Tt=e,$.textContent=hn?"Opening the recording\u2026 it plays when ready.":"Open the recording to preview.";return}Tt=null,H={ranges:e,i:0},$.textContent="\u25B6 "+e[0].title;let t=()=>{I.currentTime=e[0].start/1e3,I.play().catch(n=>{n&&n.name!=="AbortError"&&($.textContent="Could not play: "+n.message)})};I.readyState>=1?t():I.addEventListener("loadedmetadata",t,{once:!0})}function fa(e){return new Promise((t,n)=>{let o=indexedDB.open(e||"slidetake",1);o.onupgradeneeded=()=>o.result.createObjectStore("kv"),o.onsuccess=()=>t(o.result),o.onerror=()=>n(o.error)})}async function ai(e){let t=async n=>{let o=await fa(n);return await new Promise(a=>{let r=o.transaction("kv").objectStore("kv").get(e);r.onsuccess=()=>a(r.result),r.onerror=()=>a(null)})};try{return await t()??await t("markcast")??await t("traverse")??null}catch{return null}}async function ri(e,t){try{(await fa()).transaction("kv","readwrite").objectStore("kv").put(t,e)}catch{}}async function jt(e){hn=!0;try{return await ii(e)}finally{hn=!1}}async function ii(e){let t=await e.getFile();for(let n=0;n<10;n++){await new Promise(a=>setTimeout(a,1e3));let o=await e.getFile();if(o.size===t.size&&o.lastModified===t.lastModified)return o;t=o}return t}function ot(e,t,n){I.src&&URL.revokeObjectURL(I.src),Ye=t||null,n||(un=0),I.src=URL.createObjectURL(e),ue=e.name,document.getElementById("rv-novideo").hidden=!0,$.textContent="Loaded "+e.name+". Click a take to preview it.",Tt?Ct(Tt):n&&H&&Ct(H.ranges.slice(H.i)),j&&(document.getElementById("rv-ffmpeg").value=pa(j,document.getElementById("rv-mode").value))}async function si(e){let t=Ce(e.outputPath);if(!(!t||!window.showDirectoryPicker)&&!(ue===t&&I.src))try{let n=await ai("obs-folder");if(!n||await n.queryPermission({mode:"read"})!=="granted")return;let o=await n.getFileHandle(t);$.textContent="Opening "+t+"\u2026",ot(await jt(o),o)}catch{}}function Be(e,t){u.active||(gt.textContent=e,gt.classList.add("show"),clearTimeout(mn),t||(mn=setTimeout(()=>gt.classList.remove("show"),9e3)))}function ba(){clearTimeout(mn),gt.classList.remove("show")}function nn(){let e=!1;try{e=window.top!==window.self}catch{e=!0}return e?" This page is running inside a preview frame that may not allow cameras. Open Slidetake directly in Chrome (from localhost or as a file).":window.isSecureContext?" Allow camera access for this page in the browser\u2019s site settings (the icon at the left of the address bar), then try again.":" Browsers only allow cameras on secure pages. Open it from http://localhost or as a local file in Chrome."}function ya(){U&&U.getTracks().forEach(t=>t.stop()),U=null;let e=z.querySelector("video");e&&e.remove()}async function at(){if(!(U||q)){{if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia){Be("Camera not available on this page."+nn());return}if(ie.disabled)return;ie.disabled=!0,Be("Waiting for camera permission \u2014 check the browser prompt near the address bar.",!0);try{U=await navigator.mediaDevices.getUserMedia({video:{width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}},audio:!1}),ba()}catch(t){let n=t&&t.name;Be(n==="NotAllowedError"||n==="SecurityError"?"Camera access was blocked."+nn():n==="NotFoundError"||n==="OverconstrainedError"?"No camera was found. Check that a webcam is connected.":n==="NotReadableError"?"The camera is busy \u2014 close other apps using it (Zoom, OBS, FaceTime) and try again.":"Could not start the camera"+(n?" ("+n+")":"")+"."+nn());return}finally{ie.disabled=!1,On()}U.getVideoTracks().forEach(t=>t.addEventListener("ended",()=>{ya(),yt(),te()}));let e=document.createElement("video");e.autoplay=!0,e.muted=!0,e.playsInline=!0,e.srcObject=U,z.appendChild(e)}yt(),te()}}function On(){ie.querySelector("svg")||(ie.innerHTML=li+'<span class="lbl"> Camera</span>'),ie.classList.toggle("on",!q),ie.setAttribute("aria-pressed",String(!q)),ie.title=q?"Camera is off for every slide (C)":"Camera is on and follows the deck (C)"}function zn(e){e&&!Qe||(q=!e,q&&ya(),fe=null,ce=-1,ee=Math.min(ee,Math.max(0,Le(d.get(p)).length-1)),On(),yt(),nt(),_e(),te(),R||Be(e?"Camera on \u2014 slides follow their camera settings.":"Camera off \u2014 camera settings are ignored and slides use the whole screen."),e&&at())}function va(){document.body.classList.remove("idle"),clearTimeout(Po),R&&(Po=setTimeout(()=>document.body.classList.add("idle"),2e3))}function Mt(e,t){Oe.textContent=e,Oe.classList.add("show"),clearTimeout(Ro),Ro=setTimeout(()=>Oe.classList.remove("show"),t||2500)}function fn(e,{keepObs:t=!0,keepEdit:n=!0,slide:o=""}={}){let a=new URL(oo(e),location.origin);return new URLSearchParams(location.search).forEach((r,i)=>{i==="src"||i==="obs"&&!t||i==="edit"&&!n||a.searchParams.set(i,r)}),o&&(a.hash=o),a.href.replace(a.pathname,a.pathname.replace(/%40/g,"@"))}async function ci(e){let t={keepObs:!1,keepEdit:!1,slide:e};if(y.kind==="source")return{link:fn(y.source,t),inside:!1};if(y.kind==="copy"&&pt(k)&&["url","gist","builtin"].includes(k.origin.kind))return{link:fn(k.origin,t),inside:!1};let o=y.kind==="share"?y.data:await ro(J.value),a=new URLSearchParams(location.search);return["src","obs","edit"].forEach(r=>a.delete(r)),{link:location.origin+"/share"+(a.toString()?"?"+a:"")+Gt(o,e),inside:!0}}function pi(){let e=Z("slidetake:draft");if(!e||e===Nt)return null;let t=dt(e,{kind:"file",name:"your earlier draft"},{exported:!0});Q("slidetake:copy",JSON.stringify(t));try{localStorage.removeItem("slidetake:draft")}catch{}return t}function rt(){Q("slidetake:copy",JSON.stringify(k))}function je(){if(O)return;let e;if(y.kind==="copy")e='<span class="mine">Your copy of '+C(oe(k.origin))+"</span>"+(ct(k)?' <span class="edited">\xB7 edited</span>':"");else{let n=y.kind==="share"?"a shared deck":oe(y.source);e='<span class="mine">'+C(n.charAt(0).toUpperCase()+n.slice(1))+'</span> <span class="ro">\xB7 read-only, typing makes your copy</span>'}document.getElementById("doc-state").innerHTML=e,me.classList.toggle("unsaved",y.kind==="copy"&&ct(k)),document.getElementById("btn-reset").hidden=!(y.kind==="copy"&&!pt(k));let t=document.getElementById("continue");t.hidden=y.kind==="copy"||!k,k&&(t.textContent="Your copy \u2192",t.title="Continue your copy of "+oe(k.origin))}function xa(e){return!k||!ct(k)?!0:confirm("Your copy of "+oe(k.origin)+" has edits you haven't saved or shared. Replace it with "+e+"?")}function wa(){let e=new URLSearchParams(location.search);return e.delete("src"),e.delete("template"),"/edit"+(e.toString()?"?"+e:"")}function ui(){let e=y.kind==="share"?{kind:"shared"}:y.source;return xa("a copy of "+oe(e))?(k=dt(y.text,e),y={kind:"copy"},history.pushState(null,"",wa()+(p&&p!==h[0]?"#"+encodeURIComponent(p):"")),Mt("Editing your own copy of "+oe(e)+". The original is unchanged.",4e3),!0):(J.value=y.text,!1)}function hi(){y={kind:"copy"},history.pushState(null,"",wa()),me.classList.contains("collapsed")&&Pt(),J.value=k.text,It(!0),je()}async function mi(e){if(e.kind==="builtin")return bt[e.id]??bt.home;if(e.kind==="gist"){let n=await fetch("https://api.github.com/gists/"+encodeURIComponent(e.id));if(!n.ok)throw new Error(n.status===404?"no such gist":n.status+" "+n.statusText);let o=Object.values((await n.json()).files||{}),a=o.find(r=>r.filename===e.file)||o.find(r=>/\.(md|markdown)$/i.test(r.filename))||o[0];if(!a)throw new Error("the gist has no files");return X=a.raw_url,a.truncated?await(await fetch(a.raw_url)).text():a.content}let t=await fetch(e.url);if(!t.ok)throw new Error(t.status===404?"not found":t.status+" "+t.statusText);return X=new URL(e.url,location.href).href,await t.text()}function jo(){return y={kind:"source",source:{kind:"builtin",id:"home"},text:bt.home},y.text}async function fi(){if(O)return X=O.base||location.href,y={kind:"source",source:{kind:"url",url:X},text:Xn(O.settings||{})+String(O.markdown||"")},y.text;if(Y.page==="edit"){if(k)return y={kind:"copy"},k.text;history.replaceState(null,"","/new"+location.search),Y.page="pick"}if(Y.page==="pick")return At(document.getElementById("new-dialog")),y={kind:"source",source:{kind:"builtin",id:"template:blank"},text:bt["template:blank"]},y.text;if(Y.page==="share")try{let e=await io(Y.data);return y={kind:"share",data:Y.data,text:e},e}catch{return Mt("This link's deck is damaged or cut short, so it could not be opened.",6e3),jo()}try{let e=await mi(Y.source);return y={kind:"source",source:Y.source,text:e},e}catch(e){return Xe.textContent="Could not load the deck ("+e.message+")",Mt("Could not load "+oe(Y.source)+": "+e.message,6e3),jo()}}var O,No,Qe,De,bt,J,T,F,Xt,xo,qa,Xe,on,$a,me,wo,Ya,ze,Jt,ae,an,Ga,Ka,Va,Xa,Ja,Za,Je,d,h,se,p,P,R,x,q,U,de,z,Qa,S,Ke,ko,ee,fe,ce,Ie,pr,X,So,yr,vr,xr,kr,mt,Er,Sr,Qt,ye,en,xe,pe,Dr,Ae,V,we,re,To,tn,Me,Mo,Ur,Bo,Oo,zo,qr,$r,ft,cn,wt,kt,Et,Sn,Io,Ve,W,ve,Ee,oa,u,Ln,aa,Gr,Vr,ue,ca,pa,j,H,I,$,Lt,Tt,Ye,un,hn,Ge,ga,ie,gt,mn,li,Po,he,Ao,Oe,Ro,di,gn,bn,Do,Bt,Y,_o,y,k,ka=_(()=>{"use strict";Rn();Dn();jn();Hn();Fn();qn();it();Zn();to();$t();Kt();co();ho();vo();O=window.SLIDETAKE||null,No=document.querySelector("header .mark .logo").outerHTML;document.documentElement.classList.toggle("embed",!!O);Qe=!O||O.recording===!0||new URLSearchParams(location.search).has("obs");document.documentElement.classList.toggle("no-record",!Qe);De=window.matchMedia("(prefers-reduced-motion: reduce)").matches,bt={home:Nt,help:_n,showcase:$n,"template:blank":Nn,"template:talk":Wn,"template:recording":Un},J=document.getElementById("editor"),T=document.getElementById("stage"),F=document.getElementById("world"),Xt=document.getElementById("connectors"),xo=document.getElementById("breadcrumbs"),qa=document.getElementById("status-count"),Xe=document.getElementById("status-err"),on=document.getElementById("mm-svg"),$a=document.getElementById("mm-label"),me=document.getElementById("editor-pane"),wo=540,Ya=96,ze=440,Jt=720,ae=960,an=180,Ga=540,Ka=100,Va=110,Xa=420,Ja=.35,Za=1,Je=parseFloat(Z("slidetake:slideSize"))||.92,d=new Map,h=[],se=[],p=null,P="tree",R=!1,x={},q=!0,U=null,de=document.getElementById("brand"),z=document.getElementById("pip"),Qa=document.getElementById("stage-wrap"),S={x:0,y:0,zoom:.6},Ke=null;ko=new URLSearchParams(location.search).get("mode");ee=0;fe=null,ce=-1,Ie=null;pr=e=>e.querySelector("img")&&!e.textContent.trim()&&[...e.children].every(t=>/^(IMG|BR)$/.test(t.tagName));X=null;So=null;yr="https://cdn.jsdelivr.net/npm/@viz-js/viz@3.4.0/lib/viz-standalone.js",vr="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.5.0/echarts.min.js",xr={dark:{palette:["#e0b024","#60a5fa","#34d399","#f472b6","#a78bfa","#fb923c","#a1a1aa"],text:"#e4e4e7",muted:"#a1a1aa",line:"#3f3f46",split:"#27272a",tip:"#18181b"},light:{palette:["#c4930f","#2563eb","#059669","#db2777","#7c3aed","#ea580c","#71717a"],text:"#27272a",muted:"#71717a",line:"#d4d4d8",split:"#e4e4e7",tip:"#ffffff"}};kr="https://esm.sh/@terrastruct/d2@0.1.33",mt=null,Er={dark:{N1:"#e4e4e7",N2:"#a1a1aa",N3:"#a1a1aa",N4:"#323238",N5:"#27272a",N6:"#18181b",N7:"#09090b",B1:"#e0b024",B2:"#907320",B3:"#68551f",B4:"#483c1d",B5:"#38301c",B6:"#2c271c"},light:{N1:"#27272a",N2:"#71717a",N3:"#71717a",N4:"#e4e4e7",N5:"#e4e4e7",N6:"#f4f4f5",N7:"#ffffff",B1:"#7a5c12",B2:"#e5cf87",B3:"#eedfaf",B4:"#f5eccf",B5:"#f8f2df",B6:"#fbf7eb"}},Sr=e=>/d2-config\s*:/.test(e)?e:`vars: {
622
+ d2-config: {
623
+ layout-engine: elk
624
+ }
625
+ }
626
+ `+e,Qt={};ye=0,en=null;xe=document.getElementById("progress");xe.innerHTML="<b></b><i></i>";pe={start:0,timer:null};Dr=["x","y","xPercent","yPercent","scale","scaleX","scaleY","rotation","rotate","skewX","skewY"];Ae=null;V=null;we=null;re=null;on.addEventListener("click",e=>{let t=e.target.closest("circle");t&&!u.active&&A(t.dataset.id)});To=null;J.addEventListener("input",()=>{y.kind!=="copy"&&!ui()||(k.text=J.value,je(),clearTimeout(To),To=setTimeout(()=>{rt(),It(!0)},300))});document.querySelectorAll("#layout-toggle .seg-btn").forEach(e=>{e.addEventListener("click",()=>{e.dataset.mode!==P&&ke(e.dataset.mode)})});(function(){let e=new Map,t=0,n=!1,o=null,a=()=>{let[i,s]=[...e.values()];return Math.hypot(i.x-s.x,i.y-s.y)||1};T.addEventListener("pointerdown",i=>{i.pointerType==="mouse"&&i.button!==0||u.active||i.target.closest("a, pre, code, input, textarea")||(e.set(i.pointerId,{x:i.clientX,y:i.clientY}),t=0,n=!1,e.size===2&&(o={d:a(),zoom:S.zoom}))}),window.addEventListener("pointermove",i=>{let s=e.get(i.pointerId);if(!s)return;let l=i.clientX-s.x,c=i.clientY-s.y;e.set(i.pointerId,{x:i.clientX,y:i.clientY}),t+=Math.abs(l)+Math.abs(c),!n&&t>5&&(n=!0,xn(),T.classList.add("dragging")),n&&(e.size===2&&o?S.zoom=ta(o.zoom*a()/o.d):(S.x-=l/S.zoom,S.y-=c/S.zoom),Pe())});let r=i=>{e.delete(i.pointerId),e.size<2&&(o=null),e.size||T.classList.remove("dragging")};window.addEventListener("pointerup",r),window.addEventListener("pointercancel",r),T.addEventListener("click",i=>{n&&(i.stopPropagation(),i.preventDefault(),n=!1)},!0)})();T.addEventListener("wheel",e=>{e.preventDefault(),!u.active&&na(Math.exp(-e.deltaY*(e.ctrlKey?.01:.0015)),e.clientX,e.clientY)},{passive:!1});document.getElementById("nav-prev").onclick=()=>Re(-1);document.getElementById("nav-next").onclick=()=>Re(1);document.getElementById("btn-open").onclick=()=>document.getElementById("file-input").click();document.getElementById("file-input").addEventListener("change",e=>{let t=e.target.files[0];if(!t)return;let n=new FileReader;n.onload=()=>{xa("a copy of "+t.name)&&(k=dt(String(n.result),{kind:"file",name:t.name},{exported:!0}),rt(),X=null,p=null,hi())},n.readAsText(t),e.target.value=""});document.getElementById("btn-save").onclick=()=>{let e=new Blob([J.value],{type:"text/markdown"}),t=document.createElement("a");t.href=URL.createObjectURL(e),t.download=(se[0]?Te(d.get(se[0]).title):"deck")+".md",t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),1e3),y.kind==="copy"&&(k.exported=k.text,rt(),je())};document.getElementById("btn-reset").onclick=()=>{y.kind!=="copy"||pt(k)||confirm("Discard your edits and go back to "+oe(k.origin)+" as it was?")&&(k.text=k.originText,rt(),J.value=k.text,p=null,It(!0),je())};document.getElementById("btn-edit-toggle").onclick=Pt;tn=document.querySelector("main"),Me=document.getElementById("editor-resizer"),Mo=parseFloat(Z("slidetake:editorWidth"));Mo&&me.style.setProperty("--editor-w",Mo+"px");Me.addEventListener("pointerdown",e=>{e.preventDefault(),Me.setPointerCapture(e.pointerId),tn.classList.add("resizing");let t=tn.getBoundingClientRect().right,n=a=>{let r=Math.round(Math.max(280,Math.min(window.innerWidth*.75,t-a.clientX)));me.style.setProperty("--editor-w",r+"px")},o=()=>{tn.classList.remove("resizing"),Me.removeEventListener("pointermove",n),Q("slidetake:editorWidth",String(me.getBoundingClientRect().width))};Me.addEventListener("pointermove",n),Me.addEventListener("pointerup",o,{once:!0})});Me.addEventListener("dblclick",()=>{me.style.removeProperty("--editor-w");try{localStorage.removeItem("slidetake:editorWidth")}catch{}});document.getElementById("btn-mode").onclick=Wo;document.getElementById("btn-present").onclick=()=>ge(!R);Ur="https://cdn.jsdelivr.net/npm/obs-websocket-js@5.0.5/dist/obs-ws.min.js",Bo=["ArrowRight","PageDown"," ","ArrowDown","Enter"],Oo=["ArrowLeft","PageUp","ArrowUp","r","R"],zo=["b","B","."],qr=document.getElementById("rec-dialog"),$r=document.getElementById("review"),ft=document.getElementById("rec-countdown"),cn=document.getElementById("rec-paused"),wt=document.getElementById("obs-host"),kt=document.getElementById("obs-port"),Et=document.getElementById("obs-pass"),Sn=document.getElementById("obs-remember"),Io=document.getElementById("obs-status"),Ve=document.getElementById("rec-start"),W=null,ve=!1,Ee=null,oa=null,u={active:!1,withObs:!1,counting:!1,paused:!1,finishing:!1,t0:0,pauseAt:0,pausedMs:0,events:[],outputPath:null},Ln=e=>new Promise(t=>setTimeout(t,e)),aa=()=>Promise.race([new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e))),Ln(100)]);document.querySelectorAll(".modal").forEach(e=>{e.addEventListener("click",t=>{(t.target===e||t.target.closest("[data-close]"))&&e.classList.remove("open")})});document.querySelectorAll("[data-copy]").forEach(e=>e.addEventListener("click",()=>{let t=document.getElementById(e.dataset.copy);t.select(),(navigator.clipboard?navigator.clipboard.writeText(t.value):Promise.reject()).catch(()=>document.execCommand("copy")),e.textContent="Copied",setTimeout(()=>{e.textContent="Copy"},1500)}));Gr=e=>/^(localhost|127(\.\d+){3}|\[?::1\]?)$/i.test(e);Vr="This page is served over https, and browsers block it from reaching OBS on another computer (OBS only offers plain ws://). Run OBS on this computer and use localhost, or open Slidetake from a local copy: download dist/index.html from github.com/slidetake/slidetake and serve it with python3 -m http.server.";document.getElementById("obs-connect").onclick=ia;Sn.addEventListener("change",ra);document.getElementById("btn-record").onclick=pn;Ve.onclick=()=>sa(!0);document.getElementById("rec-rehearse").onclick=()=>sa(!1);ue="";ca=e=>bo(e,da),pa=(e,t)=>yo(e,t,{input:e.outputPath||ue||"recording.mov",outputName:Dt()+"-final.mp4",sectionOf:da});j=null,H=null,I=document.getElementById("rv-video"),$=document.getElementById("rv-now");document.getElementById("rv-mode").onchange=()=>_t();Lt=document.getElementById("rv-fps");Lt.onchange=()=>{j&&(j.fps=parseFloat(Lt.value),Bn(j),_t())};document.getElementById("rv-link").addEventListener("input",e=>{try{Q("slidetake:site",new URL(e.target.value.trim()).origin)}catch{}j&&ha(j)});Tt=null;I.addEventListener("timeupdate",()=>{if(!H)return;let e=H.ranges[H.i];if(I.currentTime*1e3<e.end)return;if(H.i++,H.i>=H.ranges.length){I.pause(),H=null,$.textContent="";return}let t=H.ranges[H.i];I.currentTime=t.start/1e3,$.textContent="\u25B6 "+t.title});document.getElementById("rv-play-final").onclick=()=>{j&&Ct(qe(j).map(e=>({start:e.start,end:e.end,title:e.title})))};Ye=null,un=0,hn=!1;I.addEventListener("error",async()=>{if(I.getAttribute("src")){if(Ye&&un<5){un++,$.textContent="Reloading "+ue+" (OBS was still finishing it)\u2026",await new Promise(e=>setTimeout(e,1500));try{ot(await jt(Ye),Ye,!0);return}catch{}}$.textContent=Ye?"Chrome cannot play "+ue+". In OBS set Recording Format to Hybrid MP4 (or MP4) with H.264 video; the ffmpeg command still works with this file.":"Could not play "+(ue||"this file")+". If OBS was still finishing it when you opened it, open it again; if it still fails, set OBS to Hybrid MP4 (or MP4) with H.264 video."}});Ge=document.getElementById("rv-file-input");Ge.addEventListener("change",()=>{Ge.files[0]&&ot(Ge.files[0]),Ge.value=""});document.getElementById("rv-open").onclick=async()=>{if(!window.showOpenFilePicker)return Ge.click();try{let[e]=await window.showOpenFilePicker({id:"obs-recordings",types:[{description:"Recordings",accept:{"video/*":[".mov",".mp4",".m4v",".mkv",".webm"]}}]});$.textContent="Opening "+e.name+"\u2026",ot(await jt(e),e)}catch(e){(!e||e.name!=="AbortError")&&($.textContent="Could not open that file.")}};ga=document.getElementById("rv-folder");ga.hidden=!window.showDirectoryPicker;ga.onclick=async()=>{let e=j&&Ce(j.outputPath);try{let t=await window.showDirectoryPicker({id:"obs-recordings",mode:"read"});if(ri("obs-folder",t),!e){$.textContent="Folder remembered. This session has no file name from OBS; open the file instead.";return}let n=await t.getFileHandle(e);ot(await jt(n),n)}catch(t){if(t&&t.name==="AbortError")return;$.textContent=(e?e+" is not in that folder":"Could not read that folder")+". Use \u201COpen the recording file\u2026\u201D instead."}};document.getElementById("rv-download").onclick=()=>{if(!j)return;let e=j,t=ca(e),n="# "+document.getElementById("rv-yt-title").value+`
627
+
628
+ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath:"")+" \xB7 final length "+K(t.length)+`
629
+
630
+ ## Render
631
+
632
+ \`\`\`sh
633
+ `+document.getElementById("rv-ffmpeg").value+`
634
+ \`\`\`
635
+
636
+ ## YouTube title
637
+
638
+ `+document.getElementById("rv-yt-title").value+`
639
+
640
+ ## YouTube description
641
+
642
+ `+document.getElementById("rv-yt-desc").value+`
643
+
644
+ ## Tags
645
+
646
+ `+document.getElementById("rv-yt-tags").value+`
647
+
648
+ ## Picked takes
649
+
650
+ `+qe(e).map(a=>"- "+K(a.start)+"\u2013"+K(a.end)+" "+a.title).join(`
651
+ `)+`
652
+ `,o=document.createElement("a");o.href=URL.createObjectURL(new Blob([n],{type:"text/markdown"})),o.download=Dt()+"-publish.md",o.click(),setTimeout(()=>URL.revokeObjectURL(o.href),1e3)};Yr()&&new URLSearchParams(location.search).get("obs")&&ia();ie=document.getElementById("btn-camera"),gt=document.getElementById("pip-msg"),mn=null;li='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><rect x="2" y="6" width="14" height="12" rx="2"/><path d="M16 10.5 22 7v10l-6-3.5z"/></svg>';ie.onclick=()=>zn(q);On();Po=null;window.addEventListener("pointermove",va);document.addEventListener("fullscreenchange",()=>{document.fullscreenElement||(u.active?Rt("Stopped: the browser left fullscreen"):R&&ge(!1))});he=document.getElementById("help");document.getElementById("btn-help").onclick=()=>window.open(O?"https://slidetake.com/help":"/help","_blank","noopener");document.getElementById("btn-keys").onclick=()=>he.classList.add("open");document.getElementById("help-close").onclick=()=>he.classList.remove("open");he.addEventListener("click",e=>{e.target===he&&he.classList.remove("open")});window.addEventListener("keydown",e=>{if(e.key==="F5"){e.preventDefault(),u.active||pn();return}if(u.active){Jr(e);return}if(document.querySelector(".modal.open")){e.key==="Escape"&&Tn();return}let t=document.activeElement&&document.activeElement.tagName;if(t==="TEXTAREA"||t==="INPUT"||e.metaKey||e.ctrlKey||e.altKey)return;if(he.classList.contains("open")){e.key==="Escape"&&he.classList.remove("open");return}let n=e.key;n==="ArrowRight"||n===" "||n==="PageDown"?(e.preventDefault(),Re(1)):n==="ArrowLeft"||n==="PageUp"?(e.preventDefault(),Re(-1)):n==="ArrowDown"?(e.preventDefault(),Wr()):n==="ArrowUp"?(e.preventDefault(),Hr()):n==="Home"?h.length&&A(h[0]):n==="End"?h.length&&A(h[h.length-1]):n==="o"||n==="O"?Nr():n==="e"||n==="E"?Pt():n==="f"||n==="F"||n==="p"||n==="P"?ge(!R):n==="r"||n==="R"?pn():n==="1"?ke("tree"):n==="2"?ke("radial"):n==="3"?ke("path"):n==="4"?ke("focus"):n==="c"||n==="C"?zn(q):n==="v"||n==="V"?rr():n==="l"||n==="L"?Wo():n==="+"||n==="="?Co(1):n==="-"||n==="_"?Co(-1):n==="?"||n==="k"||n==="K"?he.classList.add("open"):n==="Escape"&&!Qo()&&R&&ge(!1)});window.addEventListener("hashchange",()=>{let{data:e,slide:t}=lt(location.hash);if(e&&!(y&&y.kind==="share"&&e===y.data)){location.reload();return}t&&t!==p&&d.has(t)&&A(t)});Ao="";new ResizeObserver(()=>{let e=T.clientWidth+"x"+T.clientHeight;e!==Ao&&(Ao=e,Pe(),te(!0))}).observe(T);Oe=document.createElement("div");Oe.id="toast";Oe.setAttribute("role","status");document.body.appendChild(Oe);Ro=null;di=document.getElementById("open-dialog"),gn=document.getElementById("open-url"),bn=document.getElementById("open-error");document.getElementById("btn-load").onclick=()=>{bn.hidden=!0,At(di),gn.focus(),gn.select()};document.getElementById("open-form").onsubmit=e=>{e.preventDefault();let t=no(gn.value);if(!t){bn.textContent="That doesn't look like a link.",bn.hidden=!1;return}location.href=fn(t)};document.getElementById("btn-share").onclick=async()=>{let{link:e,inside:t}=await ci(p&&p!==h[0]?p:""),n=t?"Link copied, with the whole deck inside it ("+(e.length/1024).toFixed(1)+" KB)"+(e.length>8e3?". Some chat apps cut long links short: a GitHub file or gist makes a shorter one.":"."):"Link copied.";try{await navigator.clipboard.writeText(e),Mt(n,5e3)}catch{prompt("Copy this link:",e)}y.kind==="copy"&&(k.exported=k.text,rt(),je())};Do=Z("slidetake:layout");P=["tree","radial","path","focus"].includes(Do)?Do:"tree";document.querySelectorAll("#layout-toggle .seg-btn").forEach(e=>e.classList.toggle("active",e.dataset.mode===P));Bt=new URLSearchParams(location.search);["tree","radial","path","focus"].includes(Bt.get("layout"))&&(P=Bt.get("layout"),document.querySelectorAll("#layout-toggle .seg-btn").forEach(e=>e.classList.toggle("active",e.dataset.mode===P)));if(O){let e=(Array.isArray(O.trail)?O.trail:O.back?[O.back]:[]).filter(a=>a&&a.label),t=document.querySelector("header .brand");e.length&&(t.innerHTML='<nav class="trail" aria-label="Site">'+e.map((a,r)=>(r?'<span class="sep" aria-hidden="true">|</span>':"")+(a.url?'<a href="'+C(a.url)+'">'+C(a.label)+"</a>":"<span>"+C(a.label)+"</span>")).join("")+"</nav>");let n=document.createElement("a");n.id="credit",n.href="https://slidetake.com",n.target="_blank",n.rel="noopener",n.title="Made with Slidetake",n.setAttribute("aria-label","Made with Slidetake"),n.innerHTML=No+'<span class="word">Slide<span>take</span></span>';let o=document.querySelector("header .hdr-actions");o.insertBefore(n,o.firstChild),Qe||(o.insertAdjacentHTML("beforeend",'<button class="btn" id="hdr-keys" title="Keyboard shortcuts (K)">\u2328 Keys</button><button class="btn" id="hdr-full" title="Fullscreen (F)">\u26F6 Fullscreen</button>'),document.getElementById("hdr-keys").onclick=()=>document.getElementById("help").classList.add("open"),document.getElementById("hdr-full").onclick=()=>ge(!R))}Y=so(location.pathname,location.search,location.hash),_o=Y.page==="pick"?"":Y.slide,y=null,k=lo(Z("slidetake:copy"))||pi();window.addEventListener("popstate",()=>location.reload());(Bt.get("edit")==="1"||Y.page==="edit"&&k&&Bt.get("edit")!=="0")&&Pt();fi().then(e=>(J.value=e,je(),Uo(J.value),Go(),document.fonts?document.fonts.ready:null)).then(()=>{d.forEach(Ot),et(),A(d.has(_o)?_o:h[0],!0)})});var In=` /* One palette, Slidetake gold, at two levels: bright gold on zinc in dark mode, deep gold on white in
653
+ light mode (the same values as sakthipriyan.com's Building Wealth section, so its decks match). */
654
+ :root{
655
+ --bg:#09090b;
656
+ --grid-dot:#1d1d21;
657
+ --panel:#111113;
658
+ --panel-line:#27272a;
659
+ --node-bg:#18181b;
660
+ --node-border:#323238;
661
+ --accent:#e0b024;
662
+ --accent-teal:#f5c542; /* headings below h2 */
663
+ --text:#e4e4e7;
664
+ --text-muted:#a1a1aa;
665
+ --danger:#e0645c;
666
+ --code-bg:#0f0f12;
667
+ --overlay:rgba(17,17,19,.9); /* breadcrumbs, nav bar, minimap */
668
+ --on-accent:#1a1408; /* text on an accent-filled button */
669
+ --card-shadow:0 6px 24px rgba(0,0,0,.35);
670
+ --brand-shadow:0 1px 6px rgba(0,0,0,.6);
671
+ --mono: 'IBM Plex Mono', ui-monospace, monospace;
672
+ --display: 'Space Grotesk', sans-serif;
673
+ --body: 'IBM Plex Sans', sans-serif;
674
+ }
675
+ /* Tokens derived from others are declared on body, not :root: a custom property resolves var() where
676
+ it is declared, so on :root these would freeze the default palette's colours. */
677
+ body{
678
+ --accent-line:#966f04; /* borders and connector lines on the active path */
679
+ --accent-ring:var(--accent); /* the current slide's border, glow and the progress bar */
680
+ --edge:var(--node-border); /* connector lines off the active path */
681
+ }
682
+ /* Light mode (L, mode: light, ?mode=light): #7a5c12 carries text (6.2:1 on white); the brighter gold
683
+ only rings and lines, which never need to be read. */
684
+ body[data-mode="light"]{
685
+ --bg:#fafaf9; --grid-dot:#e7e5e4; --panel:#ffffff; --panel-line:#e4e4e7;
686
+ --node-bg:#ffffff; --node-border:#e4e4e7; --edge:#d4d4d8;
687
+ --accent:#7a5c12; --accent-teal:#8a6610; --accent-line:#d4af37; --accent-ring:#d4af37;
688
+ --text:#27272a; --text-muted:#71717a; --danger:#c2410c;
689
+ --code-bg:#f4f4f5; --overlay:rgba(255,255,255,.92); --on-accent:#ffffff;
690
+ --card-shadow:0 4px 18px rgba(24,24,27,.08); --brand-shadow:0 1px 4px rgba(255,255,255,.9);
691
+ }
692
+ body[data-mode="light"] .node .body pre code{color:var(--text);}
693
+ body[data-mode="light"] #help, body[data-mode="light"] .modal{background:rgba(24,24,27,.45);}
694
+ *{box-sizing:border-box;}
695
+ html,body{height:100%;margin:0;}
696
+ body{
697
+ background:var(--bg);
698
+ color:var(--text);
699
+ font-family:var(--body);
700
+ overflow:hidden;
701
+ display:flex;
702
+ flex-direction:column;
703
+ }
704
+ ::selection{background:var(--accent);color:var(--on-accent);}
705
+ :focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
706
+ button{font-family:var(--mono);}
707
+
708
+ /* ---------- header ---------- */
709
+ header{
710
+ min-height:56px;flex:none;
711
+ display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;
712
+ padding:8px 16px;
713
+ background:var(--panel);
714
+ border-bottom:1px solid var(--panel-line);
715
+ z-index:20;
716
+ }
717
+ .brand{display:flex;align-items:baseline;gap:10px;}
718
+ .brand .mark{font-family:var(--display);font-weight:700;font-size:17px;letter-spacing:.02em;color:inherit;text-decoration:none;display:inline-flex;align-items:center;gap:7px;align-self:center;}
719
+ .brand .mark .logo{width:20px;height:20px;fill:var(--accent);flex:none;}
720
+ .brand .mark .word > span{color:var(--accent);}
721
+ .brand .tagline{font-family:var(--mono);font-size:13px;color:var(--text-muted);}
722
+ .hdr-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
723
+ .btn{
724
+ background:transparent;color:var(--text);
725
+ border:1px solid var(--node-border);border-radius:6px;
726
+ padding:7px 12px;font-size:12px;letter-spacing:.02em;cursor:pointer;
727
+ display:flex;align-items:center;gap:6px;
728
+ transition:border-color .15s, color .15s, background .15s;
729
+ }
730
+ a.btn{text-decoration:none;}
731
+ .btn:hover{border-color:var(--accent);color:var(--accent);}
732
+ .btn.primary{border-color:var(--accent);color:var(--accent);}
733
+ .btn.primary:hover{background:var(--accent);color:var(--on-accent);}
734
+ .btn.active{background:var(--node-border);}
735
+ .seg{display:flex;border:1px solid var(--node-border);border-radius:6px;overflow:hidden;}
736
+ .seg-btn{
737
+ background:transparent;border:none;color:var(--text-muted);font-family:var(--mono);
738
+ font-size:12px;padding:7px 12px;cursor:pointer;transition:background .15s,color .15s;
739
+ }
740
+ .seg-btn:hover{color:var(--accent);}
741
+ .seg-btn.active{background:var(--node-border);color:var(--accent);}
742
+
743
+ /* ---------- main layout ---------- */
744
+ main{flex:1;display:flex;min-height:0;}
745
+ /* the editor sits on the right; its width is dragged with #editor-resizer and remembered */
746
+ #editor-pane{
747
+ width:var(--editor-w, 38%);min-width:280px;max-width:75vw;
748
+ display:flex;flex-direction:column;
749
+ background:var(--panel);border-left:1px solid var(--panel-line);
750
+ transition:width .25s ease, min-width .25s ease, opacity .2s ease;
751
+ overflow:hidden;
752
+ }
753
+ #editor-pane.collapsed{width:0;min-width:0;opacity:0;border-left:none;}
754
+ main.resizing #editor-pane{transition:none;}
755
+ main.resizing{cursor:col-resize;user-select:none;}
756
+ #editor-resizer{flex:none;width:6px;margin-right:-3px;margin-left:-3px;z-index:5;cursor:col-resize;position:relative;}
757
+ #editor-resizer:hover, main.resizing #editor-resizer{background:var(--accent-line, var(--accent));opacity:.6;}
758
+ #editor-resizer:has(+ #editor-pane.collapsed){display:none;}
759
+ .pane-bar{flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px 8px 14px;border-bottom:1px solid var(--panel-line);}
760
+ .pane-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;}
761
+ #doc-state{text-transform:none;letter-spacing:.02em;font-size:11px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
762
+ #doc-state .ro{color:var(--text-muted);}
763
+ #doc-state .mine{color:var(--text);}
764
+ #doc-state .edited{color:var(--accent);}
765
+ #continue{color:var(--accent);border-color:var(--accent-line);}
766
+ #continue[hidden]{display:none;}
767
+ .modal ul.templates{list-style:none;padding:0;display:grid;gap:8px;margin:12px 0;}
768
+ .modal ul.templates a{display:flex;flex-direction:column;gap:2px;padding:10px 12px;border:1px solid var(--panel-line);border-radius:8px;text-decoration:none;color:var(--text);}
769
+ .modal ul.templates a:hover{border-color:var(--accent);}
770
+ .modal ul.templates span{font-size:12px;color:var(--text-muted);}
771
+ #editor-pane.unsaved .pane-bar{box-shadow:inset 0 -2px 0 var(--accent);}
772
+ #editor-pane.unsaved #btn-share, #editor-pane.unsaved #btn-save{border-color:var(--accent);color:var(--accent);}
773
+ .btn.small{padding:3px 9px;font-size:11px;}
774
+ .btn.icon{padding:4px 9px;min-width:30px;display:inline-flex;align-items:center;justify-content:center;}
775
+ .btn.icon svg{width:15px;height:15px;display:block;}
776
+ .pane-label{
777
+ font-family:var(--mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;
778
+ color:var(--text-muted);flex:none;
779
+ }
780
+ #editor{
781
+ flex:1;resize:none;border:none;outline:none;padding-top:10px !important;
782
+ background:var(--panel);color:var(--text);
783
+ font-family:var(--mono);font-size:12.5px;line-height:1.65;
784
+ padding:0 14px 14px;tab-size:2;
785
+ }
786
+ #status-line{
787
+ flex:none;padding:6px 14px;font-family:var(--mono);font-size:11px;
788
+ color:var(--text-muted);border-top:1px solid var(--panel-line);
789
+ display:flex;justify-content:space-between;gap:10px;
790
+ }
791
+ #status-line .err{color:var(--danger);}
792
+ #btn-reset{background:none;border:none;color:var(--text-muted);font-size:11px;cursor:pointer;padding:0;text-decoration:underline;}
793
+ #btn-reset:hover{color:var(--accent);}
794
+
795
+ body.presenting header, body.presenting #editor-pane, body.presenting #editor-resizer{display:none;}
796
+ #breadcrumbs, #navbar, #minimap{transition:opacity .4s;}
797
+ body.presenting.idle #breadcrumbs, body.presenting.idle #navbar, body.presenting.idle #minimap{opacity:0;pointer-events:none;}
798
+ body.presenting.idle, body.presenting.idle *{cursor:none !important;}
799
+
800
+ /* ---------- stage ---------- */
801
+ #stage-wrap{flex:1;position:relative;overflow:hidden;}
802
+ #stage{
803
+ position:absolute;inset:0;
804
+ background-color:var(--bg);
805
+ background-image:radial-gradient(var(--grid-dot) 1.2px, transparent 1.2px);
806
+ background-size:28px 28px;
807
+ overflow:hidden;cursor:grab;touch-action:none;
808
+ }
809
+ #stage.dragging{cursor:grabbing;user-select:none;}
810
+ #world{position:absolute;left:0;top:0;transform-origin:0 0;}
811
+ #connectors{position:absolute;left:0;top:0;overflow:visible;pointer-events:none;}
812
+ #connectors path{fill:none;stroke:var(--edge);stroke-width:1.5;transition:stroke .2s;}
813
+ #connectors path.active{stroke:var(--accent-line);stroke-width:2;}
814
+
815
+ div.node{ /* div: Graphviz also puts class="node" on its SVG shapes */
816
+ position:absolute;left:0;top:0;width:440px;
817
+ /* centre of the card sits at (--cx, --cy); --push is Focus's settle-in scale */
818
+ transform:translate(calc(var(--cx,0) * 1px), calc(var(--cy,0) * 1px)) scale(var(--push,1)) translate(-50%,-50%);
819
+ transform-origin:0 0; /* the last translate puts the card centre at 0,0, so the scale pivots on it */
820
+ background:var(--node-bg);
821
+ border:1px solid var(--node-border);border-radius:8px;
822
+ padding:16px 18px 18px;cursor:pointer;
823
+ box-shadow:var(--card-shadow);
824
+ transition:border-color .18s, box-shadow .18s, opacity .3s;
825
+ }
826
+ /* Focus: every card sits at the same spot and only the current one shows; the next fades in with
827
+ a slight push-in instead of the camera travelling */
828
+ /* other cards vanish at once (no stacked fade on load or layout change); only the slide just left
829
+ fades out, beneath the incoming one */
830
+ #world.focus div.node{transition:none;}
831
+ #world.focus div.node:not(.current){opacity:0;pointer-events:none;}
832
+ #world.focus div.node.current{z-index:2;transition:opacity .55s ease, transform .8s cubic-bezier(.2,.7,.2,1), border-color .18s;}
833
+ #world.focus div.node.leaving{z-index:1;transition:opacity .45s ease;}
834
+ #world.focus div.node.entering{--push:.96;transition:none;}
835
+ #world.focus #connectors{display:none;}
836
+ /* progress: one continuous bar that moves with every press, reveals and camera steps included */
837
+ #progress{position:absolute;left:0;right:0;bottom:0;height:5px;z-index:9;display:none;
838
+ background:color-mix(in srgb, var(--text-muted) 22%, transparent);}
839
+ #progress.show{display:block;}
840
+ #progress i{position:absolute;inset:0 auto 0 0;width:0;background:var(--accent-ring);transition:width .5s ease;}
841
+ /* talk timer on the same bar, in the same colour: the clock grows a half-strength layer behind the
842
+ solid progress, so any half-strength stretch showing past the solid is how far behind the talk is */
843
+ #progress b{position:absolute;inset:0 auto 0 0;width:0;background:color-mix(in srgb, var(--accent-ring) 50%, transparent);transition:width 1s linear;display:none;}
844
+ #progress.timed b{display:block;}
845
+ #progress.over b{animation:over 1.4s ease-in-out infinite;}
846
+ @keyframes over{50%{opacity:.45;}}
847
+ #world.morph div.node{transition:transform .65s cubic-bezier(.65,0,.35,1), border-color .18s, opacity .3s;}
848
+ .node .body{overflow-wrap:anywhere;word-break:break-word;}
849
+ /* only the current slide is ringed in the accent; hover and the route back to the root are faint tints */
850
+ /* hover never touches the current slide, or its border would sit inside the ring as a second line */
851
+ .node:not(.current):hover{border-color:color-mix(in srgb, var(--accent-line) 35%, var(--node-border));}
852
+ body.presenting .node:not(.current):hover{border-color:var(--node-border);}
853
+ /* cards take focus on click; the current-slide ring already marks them, so no second outline
854
+ (Chrome re-shows :focus-visible when the window regains focus) */
855
+ .node:focus-visible{outline:none;}
856
+ .node:not(.current):focus-visible{border-color:var(--accent-line);}
857
+ .node.current{border-color:var(--accent-ring);box-shadow:0 0 0 1px var(--accent-ring), 0 10px 34px color-mix(in srgb, var(--accent-ring) 22%, transparent);}
858
+ .node.active-path:not(.current){border-color:color-mix(in srgb, var(--accent-line) 30%, var(--node-border));}
859
+ .node .crumb{
860
+ font-family:var(--mono);font-size:10px;color:var(--text-muted);overflow-wrap:anywhere;
861
+ letter-spacing:.06em;margin-bottom:8px;text-transform:uppercase;
862
+ }
863
+ .node .body h1,.node .body h2,.node .body h3,.node .body h4,.node .body h5,.node .body h6{
864
+ font-family:var(--display);color:var(--text);margin:0 0 8px;line-height:1.25;
865
+ }
866
+ .node .body h1{font-size:19px;}
867
+ .node .body h2{font-size:16px;}
868
+ .node .body h3{font-size:14px;color:var(--accent-teal);}
869
+ .node .body h4,.node .body h5,.node .body h6{font-size:13px;color:var(--accent-teal);}
870
+ .node .body p{margin:0 0 10px;font-size:13px;line-height:1.6;}
871
+ .node .body > :last-child{margin-bottom:0;}
872
+ .node .body ul,.node .body ol{margin:0 0 10px;padding-left:18px;font-size:13px;line-height:1.6;}
873
+ .node .body li{margin-bottom:3px;}
874
+ .node .body blockquote{margin:0 0 10px;padding-left:10px;border-left:2px solid var(--accent);color:var(--text-muted);font-size:13px;}
875
+ .node .body img{max-width:100%;border-radius:4px;}
876
+ .node .body table{border-collapse:collapse;font-size:12px;margin:0 0 10px;}
877
+ .node .body th,.node .body td{border:1px solid var(--panel-line);padding:3px 7px;}
878
+ .node .body code{
879
+ font-family:var(--mono);background:var(--code-bg);border:1px solid var(--panel-line);
880
+ padding:1px 5px;border-radius:4px;font-size:12px;color:var(--accent-teal);
881
+ }
882
+ .node .body pre{
883
+ background:var(--code-bg);border:1px solid var(--panel-line);border-radius:6px;
884
+ padding:10px 12px;overflow-x:auto;margin:0 0 10px;
885
+ }
886
+ .node .body pre code{border:none;background:none;padding:0;color:var(--text);}
887
+ .node .body strong{color:var(--accent);}
888
+ .node .body a{color:var(--accent-teal);}
889
+ .node .body a.xlink::after{content:" \u2197";font-size:10px;}
890
+ .node .err-badge{
891
+ position:absolute;top:-8px;right:-8px;background:var(--danger);color:#1a0a08;
892
+ font-family:var(--mono);font-size:10px;padding:2px 7px;border-radius:20px;font-weight:600;
893
+ }
894
+
895
+ /* ---------- recording ---------- */
896
+ .modal{position:fixed;inset:0;background:rgba(4,7,13,.72);z-index:50;display:none;align-items:center;justify-content:center;padding:16px;}
897
+ .modal.open{display:flex;}
898
+ .modal .panel{
899
+ position:relative;width:min(620px,100%);max-height:88vh;overflow-y:auto;
900
+ background:var(--panel);border:1px solid var(--panel-line);border-radius:12px;padding:24px 26px;
901
+ }
902
+ .modal .panel.wide{width:min(760px,100%);}
903
+ .modal h2{font-family:var(--display);font-size:18px;margin:0 0 6px;color:var(--accent);}
904
+ .modal h3{font-family:var(--display);font-size:13px;margin:18px 0 8px;color:var(--text);display:flex;align-items:center;gap:10px;}
905
+ .modal p, .modal li{font-size:13px;line-height:1.6;color:var(--text-muted);margin:0 0 6px;}
906
+ .modal ul{padding-left:18px;margin:0;}
907
+ .modal .close{position:absolute;top:14px;right:16px;background:none;border:none;color:var(--text-muted);font-size:18px;cursor:pointer;}
908
+ .modal .fields{display:grid;grid-template-columns:2fr 1fr 2fr;gap:10px;}
909
+ #open-form{display:flex;gap:8px;margin:12px 0 6px;}
910
+ #help table.keys{border-collapse:collapse;margin:6px 0 12px;font-size:13px;}
911
+ #help table.keys td{padding:5px 14px 5px 0;color:var(--text-muted);vertical-align:top;}
912
+ #help table.keys td:first-child{white-space:nowrap;}
913
+ #help a{color:var(--accent);}
914
+ #open-url{flex:1;min-width:0;}
915
+ .modal p.warn{color:var(--danger);}
916
+ #toast{position:fixed;left:50%;top:64px;transform:translateX(-50%) translateY(-8px);opacity:0;pointer-events:none;z-index:60;
917
+ background:var(--panel, #18181b);color:var(--text);border:1px solid var(--accent-line, var(--accent));border-radius:8px;
918
+ padding:8px 14px;font-family:var(--mono);font-size:12px;transition:opacity .2s, transform .2s;max-width:min(560px,calc(100vw - 32px));}
919
+ #toast.show{opacity:1;transform:translateX(-50%);}
920
+ .modal label{display:flex;flex-direction:column;gap:4px;font-family:var(--mono);font-size:11px;color:var(--text-muted);}
921
+ .modal label.check{flex-direction:row;align-items:center;gap:8px;margin-top:10px;}
922
+ .modal input[type=text], .modal input[type=password], .modal textarea{
923
+ background:var(--code-bg);border:1px solid var(--node-border);border-radius:6px;color:var(--text);
924
+ font-family:var(--mono);font-size:12.5px;padding:8px 10px;outline:none;
925
+ }
926
+ .modal input:focus, .modal textarea:focus{border-color:var(--accent);}
927
+ .modal textarea{width:100%;resize:vertical;line-height:1.6;}
928
+ .modal .row{display:flex;align-items:center;gap:10px;margin-top:12px;flex-wrap:wrap;}
929
+ .modal .row.end{justify-content:flex-end;margin-top:20px;}
930
+ .modal .btn[disabled]{opacity:.4;cursor:not-allowed;}
931
+ .modal .btn.small{padding:3px 9px;font-size:11px;}
932
+ #obs-status{font-family:var(--mono);font-size:12px;color:var(--text-muted);}
933
+ #obs-status.ok, #rec-screen .ok{color:#10b981;}
934
+ #rec-screen a{color:inherit;text-decoration:underline;}
935
+ #obs-status.err{color:var(--danger);}
936
+ .modal .warn{color:var(--accent);}
937
+ @media (max-width:560px){ .modal .fields{grid-template-columns:1fr;} }
938
+ #navbar #btn-record{color:#f87171;}
939
+ #navbar #btn-record:hover{color:#fff;background:#b91c1c;}
940
+ #navbar #btn-present{color:var(--accent);}
941
+ /* camera: a grey camera when off; green, with a live dot, when on */
942
+ #btn-camera{display:inline-flex;align-items:center;gap:6px;}
943
+ #btn-camera svg{display:block;}
944
+ #navbar #btn-camera.on{color:#22c55e;}
945
+ /* while a take runs nothing but the slides and the camera is on screen */
946
+ body.recording #breadcrumbs, body.recording #navbar, body.recording #minimap, body.recording #pip-msg{display:none !important;}
947
+ body.recording, body.recording *{cursor:none !important;}
948
+ #rec-countdown{
949
+ position:fixed;inset:0;z-index:70;display:none;align-items:center;justify-content:center;flex-direction:column;gap:14px;
950
+ background:rgba(4,7,13,.9);font-family:var(--display);color:var(--accent);
951
+ }
952
+ #rec-countdown.show{display:flex;}
953
+ #rec-countdown .num{font-size:180px;font-weight:700;line-height:1;}
954
+ #rec-countdown .hint{font-family:var(--mono);font-size:13px;color:var(--text-muted);}
955
+ #rec-paused{
956
+ position:fixed;inset:0;z-index:70;display:none;align-items:center;justify-content:center;
957
+ background:rgba(4,7,13,.94);font-family:var(--mono);font-size:15px;color:var(--text-muted);letter-spacing:.06em;
958
+ }
959
+ #rec-paused.show{display:flex;}
960
+ .modal .panel.xwide{width:min(1220px,100%);max-height:94vh;}
961
+ .rv-grid{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:18px;margin-top:12px;}
962
+ @media (max-width:900px){ .rv-grid{grid-template-columns:1fr;} }
963
+ .rv-video{position:relative;background:#000;border-radius:8px;overflow:hidden;aspect-ratio:16/9;}
964
+ .rv-video video{width:100%;height:100%;display:block;}
965
+ #rv-novideo{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:20px;text-align:center;}
966
+ #rv-novideo[hidden]{display:none;}
967
+ #rv-now{font-family:var(--mono);font-size:12px;color:var(--text-muted);margin-top:8px;min-height:1.4em;}
968
+ .rv-list{max-height:52vh;overflow-y:auto;border:1px solid var(--panel-line);border-radius:8px;}
969
+ .rv-row{padding:9px 12px;border-bottom:1px solid var(--panel-line);}
970
+ .rv-row:last-child{border-bottom:none;}
971
+ .rv-row .t{font-size:12.5px;color:var(--text);margin-bottom:6px;display:flex;justify-content:space-between;gap:8px;}
972
+ .rv-row .t small{font-family:var(--mono);color:var(--text-muted);font-size:10.5px;white-space:nowrap;}
973
+ .rv-row.sec .t{color:var(--accent-teal);}
974
+ .rv-chips{display:flex;flex-wrap:wrap;gap:6px;}
975
+ .rv-chip{background:transparent;border:1px solid var(--node-border);color:var(--text-muted);border-radius:20px;
976
+ font-family:var(--mono);font-size:11px;padding:3px 10px;cursor:pointer;}
977
+ .rv-chip:hover{border-color:var(--accent-teal);color:var(--text);}
978
+ .rv-chip.on{border-color:var(--accent);color:var(--accent);background:color-mix(in srgb, var(--accent) 10%, transparent);}
979
+ .rv-chip.skip.on{border-color:var(--danger);color:var(--danger);background:rgba(224,100,92,.1);}
980
+ .rv-out{margin-top:6px;}
981
+ .rv-out .two{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
982
+ @media (max-width:900px){ .rv-out .two{grid-template-columns:1fr;} }
983
+ .modal select{background:var(--code-bg);border:1px solid var(--node-border);border-radius:6px;color:var(--text);font-family:var(--mono);font-size:11.5px;padding:4px 8px;}
984
+ #rec-sessions{margin-top:14px;}
985
+
986
+ /* ---------- reveal.js compatibility: fragments, stacks, diagrams, charts ---------- */
987
+ .node .fragment{opacity:0;visibility:hidden;transition:opacity .45s ease, transform .45s ease, visibility 0s .45s;}
988
+ .node .fragment.visible{opacity:1;visibility:inherit;transition:opacity .45s ease, transform .45s ease;}
989
+ .node .fragment.fade-up{transform:translateY(24px);}
990
+ .node .fragment.fade-down{transform:translateY(-24px);}
991
+ .node .fragment.fade-left{transform:translateX(40px);}
992
+ .node .fragment.fade-right{transform:translateX(-40px);}
993
+ .node .fragment.zoom-in{transform:scale(.1);}
994
+ .node .fragment.visible:is(.fade-up,.fade-down,.fade-left,.fade-right,.zoom-in){transform:none;}
995
+ /* these start visible and change when their step comes */
996
+ .node .fragment:is(.grow,.shrink,.fade-out,.semi-fade-out,.strike,.highlight-red,.highlight-green,.highlight-blue){opacity:1;visibility:inherit;}
997
+ /* grow: sized to its content and growing rightwards, so the card can make room for its last step */
998
+ .node .fragment.grow{width:fit-content;max-width:100%;transform-origin:left center;}
999
+ .node .fragment.grow.visible{transform:scale(1.3);}
1000
+ .node .fragment.shrink.visible{transform:scale(.7);}
1001
+ .node .fragment.fade-out.visible{opacity:0;visibility:hidden;}
1002
+ .node .fragment.semi-fade-out.visible{opacity:.5;}
1003
+ .node .fragment.strike.visible{text-decoration:line-through;}
1004
+ .node .fragment.highlight-red.visible{color:var(--danger);}
1005
+ .node .fragment.highlight-green.visible{color:#10b981;}
1006
+ .node .fragment.highlight-blue.visible{color:#60a5fa;}
1007
+ /* shown only while it is the newest step */
1008
+ .node .fragment.visible:is(.fade-in-then-out,.current-visible):not(.current-fragment){opacity:0;visibility:hidden;}
1009
+ .node .fragment.fade-in-then-semi-out.visible:not(.current-fragment){opacity:.5;}
1010
+ .node .r-stack{display:grid;}
1011
+ .node .r-stack > *{grid-area:1/1;margin:auto;}
1012
+ .node .r-hstack{display:flex;flex-direction:row;align-items:center;justify-content:center;}
1013
+ .node .r-vstack{display:flex;flex-direction:column;align-items:center;justify-content:center;}
1014
+ .node .body img{max-width:100%;height:auto;object-fit:contain;}
1015
+ /* ---------- media from plain markdown (see applyMedia) ---------- */
1016
+ .node .body figure.media{margin:0;}
1017
+ .node .body figure.media img{display:block;width:100%;height:auto;max-height:70vh;object-fit:contain;border-radius:8px;}
1018
+ .node .body figure.media figcaption{margin-top:8px;font-size:.82em;color:var(--text-muted);line-height:1.45;}
1019
+ .node .body figure.yt .frame{position:relative;width:100%;aspect-ratio:16/9;border-radius:8px;overflow:hidden;background:#000;}
1020
+ .node .body figure.yt.portrait .frame{aspect-ratio:9/16;max-height:70vh;width:auto;margin:0 auto;}
1021
+ .node .body figure.yt iframe{position:absolute;inset:0;width:100%;height:100%;border:0;}
1022
+ /* the video is always on show; its step only plays it */
1023
+ .node .fragment.yt-play{opacity:1 !important;visibility:inherit !important;transform:none !important;}
1024
+ .node.card-split .body{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:4px 22px;align-items:center;}
1025
+ .node.card-split .body > :is(h1,h2,h3,h4,h5,h6){grid-column:1 / -1;}
1026
+ .node.card-split .body .split-text > :first-child{margin-top:0;}
1027
+ .node.card-split.media-last .body{grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);}
1028
+ .node .body .gallery{list-style:none;padding:0;margin:8px 0 0;display:grid;grid-template-columns:repeat(var(--cols,3),minmax(0,1fr));gap:14px;align-items:end;}
1029
+ .node .body .gallery li{margin:0;}
1030
+ .node .body .gallery figure.media img{max-height:calc(56vh / var(--rows,1));margin:0 auto;}
1031
+ .node .body .gallery figure.media figcaption{font-size:.72em;text-align:center;}
1032
+ /* a stepped gallery: the images stack in one place and each press brings the next */
1033
+ .node .body .gallery.carousel{grid-template-columns:minmax(0,1fr);}
1034
+ .node .body .gallery.carousel > li{grid-area:1/1;}
1035
+ .node .body .gallery.carousel figure.media img{max-height:58vh;}
1036
+ .node .body .gallery.carousel figure.media figcaption{font-size:.82em;}
1037
+ .node .body .gallery.carousel figcaption[data-count]::before{content:attr(data-count) " ";color:var(--accent);font-weight:600;white-space:pre;}
1038
+ .node .body .gallery.carousel:has(> li.visible) > li:not(.fragment){opacity:0;visibility:hidden;transition:opacity .45s ease, visibility 0s .45s;}
1039
+ .node .body .gallery.carousel > li:not(.fragment){transition:opacity .45s ease;}
1040
+ /* image cards: an image or carousel alone, laid out by the image's shape (see sizeCard) */
1041
+ div.node.card-bleed{padding:0;overflow:hidden;}
1042
+ .node.card-bleed .body .gallery{margin:0;}
1043
+ .node.card-bleed .body figure.media img,
1044
+ .node.card-bleed .body .gallery.carousel figure.media img{max-height:none;border-radius:0;background:var(--code-bg);}
1045
+ .node.card-bleed .body figure.media figcaption{margin:0;text-align:left;font-size:.9em;}
1046
+ /* landscape: the image spans the card; the heading sits above it, the caption below */
1047
+ .node.img-landscape .crumb{margin:12px 18px 4px;}
1048
+ .node.img-landscape .body > :is(h1,h2,h3,h4,h5,h6):first-child{margin:0 18px 10px;}
1049
+ .node.img-landscape .body figure.media img{width:100%;height:var(--img-h);object-fit:contain;}
1050
+ .node.img-landscape .body figure.media figcaption{padding:10px 18px 14px;}
1051
+ /* portrait or near-square: the image on the right at the card's height; the heading and caption share the left */
1052
+ div.node.img-portrait{height:540px;padding:20px calc(var(--img-w) + 26px) 22px 24px;}
1053
+ .node.img-portrait .body{display:flex;flex-direction:column;height:100%;}
1054
+ .node.img-portrait .crumb{margin-bottom:10px;}
1055
+ .node.img-portrait .body > :is(h1,h2,h3,h4,h5,h6):first-child{font-size:22px;}
1056
+ .node.img-portrait .body > .gallery, .node.img-portrait .body > figure.media{margin-top:auto;}
1057
+ .node.img-portrait .body figure.media img{position:absolute;top:0;right:0;width:var(--img-w);height:540px;object-fit:contain;}
1058
+ .node.img-portrait .body figure.media figcaption, .node.img-portrait .body .gallery.carousel figure.media figcaption{font-size:1.35em;line-height:1.45;color:var(--text);}
1059
+ /* 16:9, or a full-screen card: the image fills the card, the heading and caption over it */
1060
+ .node.img-overlay::before{content:"";position:absolute;inset:0 0 auto;height:96px;z-index:2;pointer-events:none;
1061
+ background:linear-gradient(rgba(0,0,0,.72), rgba(0,0,0,0));border-radius:8px 8px 0 0;}
1062
+ .node.img-overlay .crumb{position:absolute;top:12px;left:18px;right:18px;z-index:3;margin:0;color:rgba(255,255,255,.72);}
1063
+ .node.img-overlay .body > :is(h1,h2,h3,h4,h5,h6):first-child{position:absolute;top:28px;left:18px;right:18px;z-index:3;margin:0;
1064
+ color:#fff;text-shadow:0 1px 6px rgba(0,0,0,.6);}
1065
+ .node.img-overlay .body figure.media{position:relative;}
1066
+ .node.img-overlay .body figure.media img{width:100%;height:540px;object-fit:contain;}
1067
+ .node.card-full.img-overlay .body figure.media img{object-fit:cover;}
1068
+ .node.img-overlay .body figure.media figcaption{position:absolute;left:0;right:0;bottom:0;padding:36px 18px 14px;
1069
+ color:#f4f4f5;background:linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.78));}
1070
+ .node.img-overlay .body .gallery.carousel figure.media figcaption::before{color:#f5c542;}
1071
+ /* <!-- view: full -->: a 16:9 card that fills the screen, with the map and breadcrumbs out of the way */
1072
+ div.node.card-full{height:540px;overflow:hidden;}
1073
+ body.full-card #breadcrumbs, body.full-card #minimap{opacity:0;pointer-events:none;}
1074
+ /* measure cards at their resting size, without grow/zoom transforms */
1075
+ div.node.measuring .fragment{transform:none !important;transition:none !important;}
1076
+ /* a card re-measured mid-entrance (a theme switch replays it) must not count a gsap "from" state such
1077
+ as scale(3) as its width, or it shrinks the whole card to fit */
1078
+ div.node.measuring [data-gsap]{transform:none !important;}
1079
+ /* arriving at or leaving a slide snaps its fragments; only steps within the slide animate */
1080
+ div.node.snap .fragment{transition:none !important;}
1081
+ .node .body iframe{max-width:100%;border:0;border-radius:6px;background:#fff;}
1082
+ .node .diagram{background:#f8fafc;border:1px solid var(--panel-line);border-radius:8px;padding:12px;margin:0 0 10px;overflow:auto;}
1083
+ .node .diagram svg{display:block;width:100%;height:auto;max-height:640px;}
1084
+ .node .diagram.err{background:none;color:var(--danger);font-family:var(--mono);font-size:12px;padding:0;}
1085
+ /* D2 is drawn in the deck's own palette, so it needs no light backdrop */
1086
+ .node .diagram.d2{background:none;border:none;padding:0;}
1087
+ .node .diagram.d2 svg{max-height:62vh;}
1088
+ .node .echarts-container{width:100%;height:360px;margin:0 0 10px;}
1089
+
1090
+ /* ---------- overlays ---------- */
1091
+ #breadcrumbs{
1092
+ position:absolute;top:14px;left:14px;z-index:10;
1093
+ display:flex;align-items:center;gap:6px;flex-wrap:wrap;max-width:60%;
1094
+ font-family:var(--mono);font-size:11.5px;
1095
+ }
1096
+ #breadcrumbs .crumb-btn{
1097
+ background:var(--overlay);border:1px solid var(--panel-line);color:var(--text-muted);
1098
+ padding:4px 9px;border-radius:5px;cursor:pointer;backdrop-filter:blur(4px);
1099
+ }
1100
+ #breadcrumbs .crumb-btn:hover,#breadcrumbs .crumb-btn.here{color:var(--accent);border-color:var(--accent);}
1101
+ #breadcrumbs .sep{color:var(--text-muted);}
1102
+
1103
+ #navbar{
1104
+ position:absolute;bottom:16px;left:50%;transform:translateX(-50%);z-index:10;
1105
+ display:flex;align-items:center;gap:4px;
1106
+ background:var(--overlay);border:1px solid var(--panel-line);border-radius:9px;
1107
+ padding:6px;backdrop-filter:blur(6px);
1108
+ }
1109
+ #navbar button{
1110
+ background:transparent;border:none;color:var(--text-muted);white-space:nowrap;
1111
+ font-size:12px;padding:7px 11px;border-radius:6px;cursor:pointer;
1112
+ }
1113
+ #navbar button:hover{color:var(--accent);background:var(--node-bg);}
1114
+ #navbar .divider{width:1px;height:18px;background:var(--panel-line);margin:0 2px;}
1115
+ /* the arrows are for touch screens; keyboards and clickers use the keys */
1116
+ #navbar .touch-only{display:none;}
1117
+ @media (pointer:coarse){ #navbar .touch-only{display:inline-block;} }
1118
+
1119
+ #minimap{
1120
+ position:absolute;bottom:16px;right:14px;z-index:10;width:180px;height:130px;
1121
+ background:var(--overlay);border:1px solid var(--panel-line);border-radius:8px;
1122
+ backdrop-filter:blur(6px);overflow:hidden;
1123
+ }
1124
+ #minimap .mm-label{
1125
+ position:absolute;top:5px;left:8px;font-family:var(--mono);font-size:9px;
1126
+ color:var(--text-muted);letter-spacing:.1em;text-transform:uppercase;pointer-events:none;
1127
+ }
1128
+ #mm-svg circle{cursor:pointer;}
1129
+ #stage-wrap[data-pip="bottom-right"] #minimap{right:auto;left:14px;}
1130
+
1131
+ /* channel mark: fixed in the corner, never moves with the camera */
1132
+ #brand{
1133
+ position:absolute;top:16px;right:18px;z-index:12;pointer-events:none;
1134
+ display:flex;align-items:center;gap:10px;opacity:.9;
1135
+ font-family:var(--display);font-weight:600;font-size:18px;letter-spacing:.02em;color:var(--text);
1136
+ text-shadow:var(--brand-shadow);
1137
+ }
1138
+ #brand[hidden]{display:none;}
1139
+ /* embedded in a site page: one read-only deck, so no editor, links or copies */
1140
+ html.embed #btn-edit-toggle, html.embed #continue, html.embed #editor-pane, html.embed #editor-resizer{display:none !important;}
1141
+ html.embed .brand .trail{display:flex;align-items:center;gap:10px;font-family:var(--display);font-weight:600;font-size:15px;min-width:0;}
1142
+ html.embed .brand .trail a{color:var(--text);text-decoration:none;white-space:nowrap;}
1143
+ html.embed .brand .trail a:hover{color:var(--accent);}
1144
+ html.embed .brand .trail a:last-child{color:var(--accent);}
1145
+ html.embed .brand .trail .sep{color:var(--text-muted);font-weight:400;}
1146
+ #credit{display:inline-flex;align-items:center;gap:6px;padding:4px 6px;text-decoration:none;
1147
+ font-family:var(--display);font-weight:700;font-size:14px;color:var(--text);}
1148
+ #credit .logo{width:18px;height:18px;fill:var(--accent);}
1149
+ #credit .word > span{color:var(--accent);}
1150
+ #credit:hover{opacity:.85;}
1151
+ html.embed #btn-help{display:none !important;}
1152
+ /* a reader's page (embedded, not recording): no bottom bar, except the arrows on touch screens */
1153
+ html.embed.no-record #navbar{display:none;}
1154
+ @media (pointer:coarse){
1155
+ html.embed.no-record #navbar{display:flex;}
1156
+ html.embed.no-record #navbar > :not(.touch-only){display:none !important;}
1157
+ }
1158
+ html.no-record #btn-camera, html.no-record #btn-record, html.no-record #navbar .divider, html.no-record #pip, html.no-record #help tr.rec{display:none !important;}
1159
+ /* the logo written into a heading: # ![](/favicon.svg) Slidetake */
1160
+ .node .body :is(h1,h2) img[src$="favicon.svg"]{height:1em;width:auto;vertical-align:-.12em;margin-right:.25em;display:inline;}
1161
+ #brand .st-mark{display:inline-flex;align-items:center;gap:8px;font-family:var(--display);font-weight:700;font-size:20px;color:var(--text);}
1162
+ #brand .st-mark .logo{width:24px;height:24px;fill:var(--accent);}
1163
+ #brand .st-mark .word > span{color:var(--accent);}
1164
+ #brand img{height:40px;width:auto;display:block;}
1165
+ /* optional gold chip, as on the decks' title slides (brand_style: chip); plain text is the default */
1166
+ #brand .chip{display:inline-block;padding:5px 22px;border-radius:30px;color:#fff;font-family:var(--body);
1167
+ font-size:15px;font-weight:600;letter-spacing:.01em;text-shadow:none;
1168
+ background:linear-gradient(90deg, #fbbf24, #f59e0b);box-shadow:0 2px 10px rgba(0,0,0,.25);}
1169
+
1170
+ /* PIP camera: slides are laid out to keep clear of this box */
1171
+ #pip{
1172
+ position:absolute;z-index:11;pointer-events:none;aspect-ratio:16/9;
1173
+ border:2px dashed color-mix(in srgb, var(--accent-teal) 55%, transparent);border-radius:10px;
1174
+ display:flex;align-items:center;justify-content:center;
1175
+ font-family:var(--mono);font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--accent-teal);
1176
+ background:color-mix(in srgb, var(--accent-teal) 4%, transparent);
1177
+ }
1178
+ #pip[hidden]{display:none;}
1179
+ #pip.circle{aspect-ratio:1;border-radius:50%;}
1180
+ #pip.top-left{top:16px;left:16px;}
1181
+ #pip.top-right{top:16px;right:16px;}
1182
+ #pip.bottom-left{bottom:16px;left:16px;}
1183
+ #pip.bottom-right{bottom:16px;right:16px;}
1184
+ /* full: the camera takes the whole stage, under the brand and the controls */
1185
+ /* it also swallows clicks, so a click can't land on the hidden cards behind it */
1186
+ #pip.full{inset:0;width:100% !important;height:100%;aspect-ratio:auto;border-radius:0;z-index:9;pointer-events:auto;}
1187
+ /* while presenting the box is empty so the camera overlay sits on plain background */
1188
+ /* while presenting, the empty box stays as a faint guide for lining up a camera overlay */
1189
+ body.presenting #pip{border-color:color-mix(in srgb, var(--accent-teal) 30%, transparent);background:none;}
1190
+ body.presenting #pip span{opacity:.5;}
1191
+ /* live webcam inside the box */
1192
+ #pip.live{border:none;background:#000;overflow:hidden;box-shadow:0 8px 30px rgba(0,0,0,.55), 0 0 0 1px var(--panel-line);}
1193
+ #pip.live span{display:none;}
1194
+ #pip video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;}
1195
+ #pip.mirror video{transform:scaleX(-1);}
1196
+ #pip-msg{
1197
+ position:absolute;left:50%;top:70px;transform:translateX(-50%);z-index:30;
1198
+ background:var(--panel);border:1px solid var(--danger);color:var(--text);
1199
+ font-family:var(--mono);font-size:13px;line-height:1.5;padding:10px 16px;border-radius:6px;display:none;
1200
+ width:max-content;max-width:min(620px, 90%);text-align:center;box-shadow:0 8px 30px rgba(0,0,0,.5);
1201
+ }
1202
+ #pip-msg.show{display:block;}
1203
+
1204
+ /* ---------- help popover ---------- */
1205
+ #help{position:fixed;inset:0;background:rgba(4,7,13,.7);z-index:50;display:none;align-items:center;justify-content:center;}
1206
+ #help.open{display:flex;}
1207
+ #help .panel{
1208
+ position:relative;width:min(580px,92vw);max-height:84vh;overflow-y:auto;
1209
+ background:var(--panel);border:1px solid var(--panel-line);border-radius:12px;padding:26px 28px;
1210
+ }
1211
+ #help h2{font-family:var(--display);font-size:18px;margin:0 0 14px;color:var(--accent);}
1212
+ #help h3{font-family:var(--display);font-size:13px;margin:18px 0 6px;color:var(--text);}
1213
+ #help p, #help li{font-size:13px;line-height:1.65;color:var(--text-muted);margin:0 0 8px;}
1214
+ #help pre{
1215
+ background:var(--code-bg);border:1px solid var(--panel-line);border-radius:6px;
1216
+ padding:10px 12px;font-family:var(--mono);font-size:11.5px;color:var(--text);overflow-x:auto;
1217
+ }
1218
+ #help .close{position:absolute;top:16px;right:18px;background:none;border:none;color:var(--text-muted);font-size:18px;cursor:pointer;}
1219
+ kbd{
1220
+ font-family:var(--mono);background:var(--node-bg);border:1px solid var(--node-border);
1221
+ border-radius:4px;padding:1px 6px;font-size:11px;color:var(--accent);
1222
+ }
1223
+
1224
+ @media (max-width:760px){
1225
+ main{flex-direction:column;}
1226
+ #editor-pane{width:100% !important;max-width:none;min-width:0;height:40vh;border-left:none;border-top:1px solid var(--panel-line);}
1227
+ #editor-resizer{display:none;}
1228
+ #editor-pane.collapsed{height:0;}
1229
+ #stage-wrap{flex:1;}
1230
+ .brand .tagline{display:none;}
1231
+ #minimap{display:none;}
1232
+ #navbar .lbl{display:none;}
1233
+ }
1234
+ `;var Pn=`
1235
+ <noscript>
1236
+ <h1>Slidetake</h1>
1237
+ <p><strong>Write in markdown. Present on a spatial canvas. Record without timeline editing.</strong></p>
1238
+ <p>For developers and technical educators who explain things on video. Your headings become a map you move through; with OBS, every slide is a take, so a fumbled line is retaken on the spot, and Slidetake writes the frame-exact cut, YouTube chapters and description.</p>
1239
+ <p>Slidetake needs JavaScript. Read the <a href="/help.md">guide</a>, the <a href="/llms.txt">summary</a>, or the source on <a href="https://github.com/slidetake/slidetake">GitHub</a>.</p>
1240
+ </noscript>
1241
+
1242
+ <header>
1243
+ <div class="brand">
1244
+ <a class="mark" href="/" title="Slidetake home"><svg class="logo" viewBox="0 0 64 64" aria-hidden="true"><path d="M 10 8 H 38 C 41.3 8 44 10.7 44 14 V 18 H 22 C 16.5 18 12 22.5 12 28 V 36 H 10 C 6.7 36 4 33.3 4 30 V 14 C 4 10.7 6.7 8 10 8 Z" opacity="0.4"/><path fill-rule="evenodd" d="M 22 22 H 54 C 57.3 22 60 24.7 60 28 V 50 C 60 53.3 57.3 56 54 56 H 22 C 18.7 56 16 53.3 16 50 V 28 C 16 24.7 18.7 22 22 22 Z M 26 34 C 28.2 34 30 32.2 30 30 C 30 27.8 28.2 26 26 26 C 23.8 26 22 27.8 22 30 C 22 32.2 23.8 34 26 34 Z M 38 40 C 36.9 40 36 40.9 36 42 V 48 C 36 49.1 36.9 50 38 50 H 50 C 51.1 50 52 49.1 52 48 V 42 C 52 40.9 51.1 40 50 40 H 38 Z"/></svg><span class="word">Slide<span>take</span></span></a>
1245
+ <div class="tagline">plain markdown \u2192 spatial deck \u2192 video</div>
1246
+ </div>
1247
+ <div class="hdr-actions">
1248
+ <input type="file" id="file-input" accept=".md,.markdown,.txt,text/markdown" hidden>
1249
+ <div class="seg" id="layout-toggle">
1250
+ <button class="seg-btn" data-mode="tree" title="Tree (1)">tree</button>
1251
+ <button class="seg-btn" data-mode="radial" title="Radial (2)">radial</button>
1252
+ <button class="seg-btn" data-mode="path" title="Path: slides in presenting order (3)">path</button>
1253
+ <button class="seg-btn" data-mode="focus" title="Focus: one slide at a time, no travel (4)">focus</button>
1254
+ </div>
1255
+ <a class="btn" id="continue" href="/edit" hidden></a>
1256
+ <button class="btn" id="btn-edit-toggle" title="Editor: write, open, share (E)">\u270E Editor</button>
1257
+ <button class="btn icon" id="btn-mode" title="Light / dark (L)" aria-label="Light / dark"></button>
1258
+ <button class="btn icon" id="btn-help" title="Help: the full guide (? for keys)" aria-label="Help">?</button>
1259
+ </div>
1260
+ </header>
1261
+
1262
+ <main>
1263
+ <div id="stage-wrap">
1264
+ <div id="stage">
1265
+ <div id="world">
1266
+ <svg id="connectors"></svg>
1267
+ </div>
1268
+ </div>
1269
+ <div id="breadcrumbs"></div>
1270
+ <div id="navbar">
1271
+ <button id="btn-keys" title="Keyboard shortcuts (K)">\u2328<span class="lbl"> Keys</span></button>
1272
+ <button id="nav-prev" class="touch-only" title="Previous (\u2190)" aria-label="Previous">\u2190</button>
1273
+ <button id="nav-next" class="touch-only" title="Next (\u2192)" aria-label="Next">\u2192</button>
1274
+ <div class="divider"></div>
1275
+ <button id="btn-camera" title="Camera (C)" aria-pressed="false"></button>
1276
+ <button id="btn-record" title="Record a take with OBS (R)">\u25CF<span class="lbl"> Record</span></button>
1277
+ <button id="btn-present" title="Fullscreen (F)">\u26F6<span class="lbl"> Fullscreen</span></button>
1278
+ </div>
1279
+ <div id="progress" aria-hidden="true"></div>
1280
+ <div id="minimap"><div class="mm-label" id="mm-label">map</div><svg id="mm-svg" width="180" height="130"></svg></div>
1281
+ <div id="brand" hidden></div>
1282
+ <div id="pip" hidden><span>PIP camera</span></div>
1283
+ <div id="pip-msg" role="status"></div>
1284
+ </div>
1285
+ <div id="editor-resizer" role="separator" aria-orientation="vertical" aria-label="Resize the editor" title="Drag to resize"></div>
1286
+ <div id="editor-pane" class="collapsed">
1287
+ <div class="pane-bar">
1288
+ <span class="pane-label" id="doc-state" aria-live="polite"></span>
1289
+ <span class="pane-actions">
1290
+ <a class="btn small" id="btn-new" href="/new" title="Start from a template">New</a>
1291
+ <button class="btn small" id="btn-load" title="Load a deck from a link: GitHub, a gist or any URL">\u21E3 Load</button>
1292
+ <button class="btn small" id="btn-open" title="Open a markdown file from this computer">Open</button>
1293
+ <button class="btn small" id="btn-save" title="Save the markdown to a file on this computer">Save</button>
1294
+ <button class="btn small" id="btn-share" title="Copy a link to this deck">Share</button>
1295
+ </span>
1296
+ </div>
1297
+ <textarea id="editor" spellcheck="false"></textarea>
1298
+ <div id="status-line"><span id="status-count"></span><span id="status-err" class="err"></span><button id="btn-reset" hidden title="Discard your edits and go back to the original">reset to original</button></div>
1299
+ </div>
1300
+ </main>
1301
+
1302
+ <div id="help">
1303
+ <div class="panel">
1304
+ <button class="close" id="help-close" aria-label="Close">\u2715</button>
1305
+ <h2>Keys</h2>
1306
+ <table class="keys">
1307
+ <tr><td><kbd>\u2192</kbd> <kbd>\u2190</kbd> <kbd>Space</kbd></td><td>next / previous step</td></tr>
1308
+ <tr><td><kbd>\u2193</kbd> <kbd>\u2191</kbd></td><td>first child / parent</td></tr>
1309
+ <tr><td><kbd>O</kbd></td><td>the whole map; <kbd>O</kbd> or <kbd>Esc</kbd> goes back</td></tr>
1310
+ <tr><td><kbd>1</kbd>\u2013<kbd>4</kbd></td><td>tree, radial, path, focus</td></tr>
1311
+ <tr><td><kbd>F</kbd></td><td>fullscreen</td></tr>
1312
+ <tr><td><kbd>+</kbd> <kbd>\u2212</kbd></td><td>bigger / smaller slides</td></tr>
1313
+ <tr><td><kbd>E</kbd></td><td>editor: write, open, share</td></tr>
1314
+ <tr><td><kbd>L</kbd></td><td>light / dark</td></tr>
1315
+ <tr class="rec"><td><kbd>C</kbd> <kbd>V</kbd> <kbd>R</kbd></td><td>camera, camera layouts, record</td></tr>
1316
+ <tr><td><kbd>K</kbd> <kbd>?</kbd></td><td>this card</td></tr>
1317
+ </table>
1318
+ <p>Drag to pan, scroll or pinch to zoom, click a card to fly to it.</p>
1319
+ <p><a href="/help" target="_blank" rel="noopener">The full guide \u2192</a> writing decks, sharing, recording, camera, review and cut.</p>
1320
+ </div>
1321
+ </div>
1322
+
1323
+ <div id="new-dialog" class="modal" role="dialog" aria-labelledby="new-title">
1324
+ <div class="panel">
1325
+ <button class="close" data-close aria-label="Close">\u2715</button>
1326
+ <h2 id="new-title">Start a new deck</h2>
1327
+ <p>Pick a template. It opens as it is; start typing and it becomes your own copy at <code>/edit</code>.</p>
1328
+ <ul class="templates">
1329
+ <li><a href="/new?template=blank"><strong>Blank</strong><span>A first card, a section and a detail.</span></a></li>
1330
+ <li><a href="/new?template=talk"><strong>Talk</strong><span>Why it matters, the idea, trade-offs, summary.</span></a></li>
1331
+ <li><a href="/new?template=recording"><strong>Recording</strong><span>Camera steps, an overview moment and a closing on camera.</span></a></li>
1332
+ <li><a href="/examples"><strong>Examples</strong><span>Everything a deck can hold: diagrams, charts, images, YouTube.</span></a></li>
1333
+ </ul>
1334
+ <p>Or <strong>\u21E3 Load</strong> a deck from a link, or <strong>Open</strong> a file from this computer.</p>
1335
+ </div>
1336
+ </div>
1337
+
1338
+ <div id="open-dialog" class="modal" role="dialog" aria-labelledby="open-title">
1339
+ <div class="panel">
1340
+ <button class="close" data-close aria-label="Close">\u2715</button>
1341
+ <h2 id="open-title">Load a deck from a link</h2>
1342
+ <p>Paste a link to a markdown file: a GitHub file or folder, a gist, or any URL that allows other sites to read it.</p>
1343
+ <form id="open-form" class="row">
1344
+ <input type="text" id="open-url" placeholder="https://github.com/you/repo/blob/main/talk.md" spellcheck="false" autocomplete="off">
1345
+ <button class="btn primary" type="submit">Load</button>
1346
+ </form>
1347
+ <p id="open-error" class="warn" hidden></p>
1348
+ <h3>Try one</h3>
1349
+ <ul id="open-examples">
1350
+ <li><a href="/gh/slidetake/slidetake/examples/why-debt-is-not-bad.md">Why debt is a tool, not an enemy</a> (headings format)</li>
1351
+ <li><a href="/gh/sakthipriyan/sakthipriyan.github.io/content/building-wealth/slides/2025/invest-in-gold/index.md">Invest in gold</a> (a reveal.js deck)</li>
1352
+ </ul>
1353
+ <h3>Short links</h3>
1354
+ <p><code>slidetake.com/gh/owner/repo/path/deck.md</code> opens a file on GitHub (add <code>@branch</code> after the repo for another branch), and <code>slidetake.com/gist/&lt;id&gt;</code> a gist. Images next to the deck load as they are.</p>
1355
+ <p>A file on this computer? Use <strong>Open</strong>.</p>
1356
+ </div>
1357
+ </div>
1358
+
1359
+ <div id="rec-dialog" class="modal" role="dialog" aria-labelledby="rec-title">
1360
+ <div class="panel">
1361
+ <button class="close" data-close aria-label="Close">\u2715</button>
1362
+ <h2 id="rec-title">Record a take</h2>
1363
+ <p id="rec-deck-info"></p>
1364
+ <p id="rec-screen"></p>
1365
+ <h3>OBS</h3>
1366
+ <div class="fields">
1367
+ <label>Host<input type="text" id="obs-host" value="localhost" spellcheck="false"></label>
1368
+ <label>Port<input type="text" id="obs-port" value="4455" inputmode="numeric"></label>
1369
+ <label>Password<input type="password" id="obs-pass" autocomplete="off"></label>
1370
+ </div>
1371
+ <label class="check"><input type="checkbox" id="obs-remember"> Remember these on this computer</label>
1372
+ <div class="row"><button class="btn" id="obs-connect">Connect</button><span id="obs-status">Not connected</span></div>
1373
+ <p>In OBS: Tools \u2192 WebSocket Server Settings \u2192 enable it; the port and password are shown there. Point OBS at this browser window plus your microphone. No scenes are needed: the deck switches the camera itself.</p>
1374
+ <h3>During the take</h3>
1375
+ <ul>
1376
+ <li><kbd>\u2192</kbd> / clicker next: the next step. One more press after the last step ends the take and stops OBS.</li>
1377
+ <li><kbd>\u2190</kbd> / clicker back: <strong>take this slide again</strong>. Every attempt is kept; you pick the best one afterwards.</li>
1378
+ <li><kbd>B</kbd> / clicker blank: pause and resume the recording.</li>
1379
+ <li><kbd>Esc</kbd>: stop the take early.</li>
1380
+ </ul>
1381
+ <label style="margin-top:14px">Layout for this take
1382
+ <select id="rec-layout">
1383
+ <option value="path">Path: short, one-direction moves (recommended)</option>
1384
+ <option value="focus">Focus: no travel, slides fade in</option>
1385
+ <option value="current">Keep the current layout</option>
1386
+ </select>
1387
+ </label>
1388
+ <div id="rec-sessions"></div>
1389
+ <div class="row end">
1390
+ <button class="btn" id="rec-rehearse">Rehearse (no recording)</button>
1391
+ <button class="btn primary" id="rec-start" disabled>\u25CF Start recording</button>
1392
+ </div>
1393
+ </div>
1394
+ </div>
1395
+
1396
+ <div id="review" class="modal" role="dialog" aria-labelledby="rv-title">
1397
+ <div class="panel xwide">
1398
+ <button class="close" data-close aria-label="Close">\u2715</button>
1399
+ <h2 id="rv-title">Review the take</h2>
1400
+ <p id="rv-info"></p>
1401
+ <div class="rv-grid">
1402
+ <div>
1403
+ <div class="rv-video">
1404
+ <video id="rv-video" controls playsinline preload="metadata"></video>
1405
+ <div id="rv-novideo">
1406
+ <div class="row" style="justify-content:center;margin:0">
1407
+ <button class="btn primary" id="rv-open">Open the recording file\u2026</button>
1408
+ <button class="btn" id="rv-folder" hidden>Use my OBS recordings folder\u2026</button>
1409
+ </div>
1410
+ <p>Pick the file OBS saved<span id="rv-file"></span> (.mov, .mp4 or .mkv) to preview takes. Or choose your OBS recordings folder once, and later takes load by themselves.</p>
1411
+ </div>
1412
+ </div>
1413
+ <div class="row"><button class="btn small" id="rv-play-final">\u25B6 Play the final cut</button><span id="rv-now"></span></div>
1414
+ </div>
1415
+ <div class="rv-list" id="rv-list"></div>
1416
+ </div>
1417
+ <div class="rv-out">
1418
+ <h3>ffmpeg
1419
+ <select id="rv-mode">
1420
+ <option value="accurate">Frame-accurate (x264)</option>
1421
+ <option value="mac">Frame-accurate, Mac hardware encoder (faster)</option>
1422
+ <option value="copy">No re-encode (only when nothing is cut out)</option>
1423
+ </select>
1424
+ <select id="rv-fps" title="Recording frame rate: cut points snap to its frames">
1425
+ <option value="24">24 fps</option><option value="25">25 fps</option><option value="30">30 fps</option>
1426
+ <option value="50">50 fps</option><option value="60">60 fps</option>
1427
+ <option value="23.976">23.976 fps</option><option value="29.97">29.97 fps</option><option value="59.94">59.94 fps</option>
1428
+ </select>
1429
+ <button class="btn small" data-copy="rv-ffmpeg">Copy</button>
1430
+ </h3>
1431
+ <textarea id="rv-ffmpeg" rows="4" readonly spellcheck="false"></textarea>
1432
+ <h3>YouTube</h3>
1433
+ <div class="two">
1434
+ <label>Title<input type="text" id="rv-yt-title"></label>
1435
+ <label>Slides link (goes in the description)<input type="text" id="rv-link" placeholder="https://\u2026/slides/\u2026/" spellcheck="false"></label>
1436
+ </div>
1437
+ <h3>Description <button class="btn small" data-copy="rv-yt-desc">Copy</button></h3>
1438
+ <textarea id="rv-yt-desc" rows="10" spellcheck="false"></textarea>
1439
+ <p id="rv-chapters-note"></p>
1440
+ <h3>Tags <button class="btn small" data-copy="rv-yt-tags">Copy</button></h3>
1441
+ <input type="text" id="rv-yt-tags" spellcheck="false" style="width:100%">
1442
+ </div>
1443
+ <div class="row end">
1444
+ <button class="btn" id="rv-download">\u2193 Download script + publish pack</button>
1445
+ <button class="btn primary" data-close>Done</button>
1446
+ </div>
1447
+ </div>
1448
+ </div>
1449
+ <input type="file" id="rv-file-input" accept="video/*,video/quicktime,.mov,.mp4,.m4v,.mkv,.webm" hidden>
1450
+
1451
+ <div id="rec-countdown"><div class="num"></div><div class="hint">recording starts after the countdown \xB7 Esc to cancel</div></div>
1452
+ <div id="rec-paused">Paused \xB7 press B to resume</div>
1453
+
1454
+ <!-- The sample deck. Plain markdown, nothing else. -->
1455
+ `;var An=`<link rel="preconnect" href="https://fonts.googleapis.com">
1456
+ <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap" rel="stylesheet">`;var Ea=e=>new Promise((t,n)=>{let o=document.createElement("script");o.src=e,o.onload=t,o.onerror=()=>n(new Error("could not load "+e)),document.head.appendChild(o)});async function Sa(){document.head.insertAdjacentHTML("beforeend",An);let e=document.createElement("style");e.textContent=In,document.head.appendChild(e),document.body.insertAdjacentHTML("afterbegin",Pn),await Promise.all([window.gsap?null:Ea("https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"),window.marked?null:Ea("https://cdnjs.cloudflare.com/ajax/libs/marked/12.0.2/marked.min.js")]),await Promise.resolve().then(()=>(ka(),gi))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Sa,{once:!0}):Sa();})();