Release v1.0.0: Universal PPTX/DOCX/MD/HTML to Motion Video Agent Skill + Full Offline Bundle
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .gitattributes+35
- DockerfileAdded+21
- README.mdAdded+90
- SKILL.mdAdded+73
- __init__.pyAdded+1
- assets/bgm/deno-bgm-001.mp3Added+3
- assets/bgm/offline_ambient_pad.wavAdded+3
- assets/fonts/PretendardVariable.woff2Added+3
- assets/js/gsap.min.jsAdded+11
- assets/sfx/sfx_card_pop.wavAdded
- assets/sfx/sfx_counter_tick.wavAdded+3
- assets/sfx/sfx_highlighter_sweep.wavAdded+3
- assets/sfx/sfx_insight_chime.wavAdded+3
- assets/sfx/sfx_terminal_type.wavAdded+3
- assets/sfx/sfx_whoosh.wavAdded+3
- bgm_engine.pyAdded+83
- deck2video_offline_full.zipAdded+3
- html_builder.pyAdded+1572
- ingest_parser.pyAdded+731
- install_mac_linux.shAdded+36
- install_offline_mac_linux.shAdded+23
- install_offline_windows.ps1Added+19
- install_windows.ps1Added+33
- offline_renderer.pyAdded+387
- offline_vendor/wheels/aiohappyeyeballs-2.7.1-py3-none-any.whlAdded
- offline_vendor/wheels/aiohttp-3.14.5-cp312-cp312-macosx_11_0_arm64.whlAdded+3
- offline_vendor/wheels/aiohttp-3.14.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whlAdded+3
- offline_vendor/wheels/aiohttp-3.14.5-cp312-cp312-win_amd64.whlAdded+3
- offline_vendor/wheels/aiosignal-1.4.0-py3-none-any.whlAdded
- offline_vendor/wheels/attrs-26.1.0-py3-none-any.whlAdded
- offline_vendor/wheels/beautifulsoup4-4.15.0-py3-none-any.whlAdded+3
- offline_vendor/wheels/certifi-2026.10.23-py3-none-any.whlAdded+3
- offline_vendor/wheels/edge_tts-7.3.1-py3-none-any.whlAdded
- offline_vendor/wheels/frozenlist-1.8.0-cp312-cp312-macosx_11_0_arm64.whlAdded
- offline_vendor/wheels/frozenlist-1.8.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whlAdded+3
- offline_vendor/wheels/frozenlist-1.8.0-cp312-cp312-win_amd64.whlAdded
- offline_vendor/wheels/idna-3.20-py3-none-any.whlAdded
- offline_vendor/wheels/lxml-6.1.3-cp312-cp312-macosx_10_13_universal2.whlAdded+3
- offline_vendor/wheels/lxml-6.1.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whlAdded+3
- offline_vendor/wheels/lxml-6.1.3-cp312-cp312-win_amd64.whlAdded+3
- offline_vendor/wheels/multidict-7.2.1-cp312-cp312-macosx_11_0_arm64.whlAdded+3
- offline_vendor/wheels/multidict-7.2.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whlAdded+3
- offline_vendor/wheels/multidict-7.2.1-cp312-cp312-win_amd64.whlAdded
- offline_vendor/wheels/numpy-2.2.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whlAdded+3
- offline_vendor/wheels/numpy-2.5.5-cp312-cp312-macosx_14_0_arm64.whlAdded+3
- offline_vendor/wheels/numpy-2.5.5-cp312-cp312-win_amd64.whlAdded+3
- offline_vendor/wheels/packaging-26.3-py3-none-any.whlAdded+3
- offline_vendor/wheels/pillow-12.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whlAdded+3
- offline_vendor/wheels/pillow-13.0.0-cp312-cp312-macosx_11_0_arm64.whlAdded+3
- offline_vendor/wheels/pillow-13.0.0-cp312-cp312-win_amd64.whlAdded+3
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines333435363738394041424344454647484950515253545556575859606162636465666768697032 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textassets/bgm/deno-bgm-001.mp3 filter=lfs diff=lfs merge=lfs -textassets/bgm/offline_ambient_pad.wav filter=lfs diff=lfs merge=lfs -textassets/fonts/PretendardVariable.woff2 filter=lfs diff=lfs merge=lfs -textassets/sfx/sfx_counter_tick.wav filter=lfs diff=lfs merge=lfs -textassets/sfx/sfx_highlighter_sweep.wav filter=lfs diff=lfs merge=lfs -textassets/sfx/sfx_insight_chime.wav filter=lfs diff=lfs merge=lfs -textassets/sfx/sfx_terminal_type.wav filter=lfs diff=lfs merge=lfs -textassets/sfx/sfx_whoosh.wav filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/aiohttp-3.14.5-cp312-cp312-macosx_11_0_arm64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/aiohttp-3.14.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/aiohttp-3.14.5-cp312-cp312-win_amd64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/beautifulsoup4-4.15.0-py3-none-any.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/certifi-2026.10.23-py3-none-any.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/frozenlist-1.8.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/lxml-6.1.3-cp312-cp312-macosx_10_13_universal2.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/lxml-6.1.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/lxml-6.1.3-cp312-cp312-win_amd64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/multidict-7.2.1-cp312-cp312-macosx_11_0_arm64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/multidict-7.2.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/numpy-2.2.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/numpy-2.5.5-cp312-cp312-macosx_14_0_arm64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/numpy-2.5.5-cp312-cp312-win_amd64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/packaging-26.3-py3-none-any.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/pillow-12.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/pillow-13.0.0-cp312-cp312-macosx_11_0_arm64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/pillow-13.0.0-cp312-cp312-win_amd64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/propcache-0.5.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/python_docx-1.2.0-py3-none-any.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/python_pptx-1.0.2-py3-none-any.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/setuptools-84.2.1-py3-none-any.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/xlsxwriter-3.3.1-py3-none-any.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/yarl-1.25.1-cp312-cp312-macosx_11_0_arm64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/yarl-1.25.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl filter=lfs diff=lfs merge=lfs -textoffline_vendor/wheels/yarl-1.25.1-cp312-cp312-win_amd64.whl filter=lfs diff=lfs merge=lfs -textsamples/sample_sync_deck.mp4 filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021FROM node:22-bookworm
RUN apt-get update && apt-get install -y --no-install-recommends \ python3 python3-pip python3-venv ffmpeg \ libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \ libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \ libgbm1 libasound2 libpango-1.0-0 libcairo2 fonts-noto-cjk \ && rm -rf /var/lib/apt/lists/*
WORKDIR /app/deck_video_pipelineCOPY . /app/deck_video_pipeline
RUN python3 -m venv /opt/venv \ && /opt/venv/bin/pip install --no-cache-dir --upgrade pip \ && /opt/venv/bin/pip install --no-cache-dir -r requirements.txt \ && /opt/venv/bin/pip install --no-cache-dir -e . \ && npx --yes hyperframes --version
ENV PATH="/opt/venv/bin:${PATH}"ENTRYPOINT ["deck2video"]CMD ["--demo"]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990---license: mitlanguage: - ko - entags: - agent-skill - presentation-to-video - pptx-to-video - docx-to-video - html-motion - hyperframes - claude-code - antigravity - offline-ready---
# 🎬 Deck2Video Agent Skill (`PPTX · DOCX · MD · HTML ➔ HTML 모션 + UI 효과음 ➔ 1080p MP4`)
파워포인트(`.pptx`), 워드(`.docx`), 마크다운(`.md`/`.txt`), 웹 슬라이드·문서(`.html`)에서 발표 구조를 자동 추출하여 **다크 네온 글래스 UI + 3D 파티클 웨이브 배경 + 상단 챕터 진행바 + 5종 모션 레이아웃 + 내레이션 + 6종 UI 효과음 + 자동 덕킹 배경음악**이 결합된 `1920×1080` MP4 영상을 생성하는 **온·오프라인 겸용 AI 에이전트 스킬**입니다.
---
## 🤖 AI 에이전트용 원클릭 설치 프롬프트 (복사해서 붙여넣기)
사용하시는 AI 코딩 에이전트(**Google Antigravity, Claude Code, Cursor, Codex, Windsurf** 등) 채팅창에 아래 프롬프트를 그대로 붙여넣으면 에이전트가 스스로 스킬을 다운로드·설치·검증합니다.
```texthttps://huggingface.co/VanyaJ/deck2video-skill 저장소를 클론해서 내 로컬 AI 에이전트 스킬 디렉토리(Antigravity는 ~/.gemini/config/skills/deck-video-pipeline, Claude Code는 ~/.claude/skills/deck-video-pipeline, 또는 현재 프로젝트의 .agents/skills/deck-video-pipeline)에 설치해 줘.설치 후 SKILL.md를 읽고 내 OS(Mac/Windows/Linux)에 맞춰 파이썬 의존성(온라인이면 install_mac_linux.sh / install_windows.ps1, 폐쇄망 오프라인이면 install_offline_mac_linux.sh / install_offline_windows.ps1)을 세팅한 뒤, 샘플 문서로 동작 테스트까지 마치고 보고해 줘.```
---
## 📦 포함된 구성품 (온라인 + 100% 폐쇄망 오프라인 패키지 완비)
* **`SKILL.md`**: AI 에이전트 자동 인식용 스킬 명세서* **`produce_deck_video.py`** (`deck2video` CLI): 통합 변환 실행기 (`--offline` 무네트워크 모드 지원)* **`ingest_parser.py`**: `.pptx` / `.docx` / `.md` / `.txt` / `.html` / `.json` 다중 문서 파서* **`html_builder.py`**: 3D 도트 웨이브 캔버스 + 상단 챕터 HUD + 5종 모션 씬(`arc_cards`, `mockup_steps`, `book_quote`, `terminal_flow`, `metric_summary`) + 한·영 이중 자막 컴파일러* **`sfx_engine.py` & `bgm_engine.py`**: 외부 유료 음원 없이 자체 합성하는 48kHz 스테레오 UI 효과음 6종 + 온·오프라인 하이브리드 BGM* **`offline_renderer.py`**: Node.js/npm이나 인터넷이 전혀 없는 폐쇄망 PC에서도 로컬 Chrome/Edge 브라우저(CDP) + FFmpeg만으로 1080p MP4를 렌더링하는 무의존성 오프라인 렌더러* **`offline_vendor/wheels/`**: Windows(`win_amd64`), macOS(`arm64`), Linux(`manylinux_x86_64`)용 오프라인 Python `.whl` 패키지 일체 내장* **`assets/`**: `PretendardVariable.woff2` 한글 가변 폰트, `gsap.min.js`, 6종 UI 효과음 WAV, 배경음악 MP3/WAV 사전 번들링* **`samples/`**: 테스트용 `.pptx`, `.docx`, `.md`, `.html` 샘플 문서 및 완성 샘플 영상(`sample_sync_deck.mp4`)
---
## 🚀 수동 설치 및 사용법
### 1) 온라인 PC 설치 (macOS / Linux / Windows)```bashgit clone https://huggingface.co/VanyaJ/deck2video-skill deck-video-pipelinecd deck-video-pipeline
# macOS / Linux./install_mac_linux.sh && source .venv/bin/activate
# Windows (PowerShell)# powershell -ExecutionPolicy Bypass -File .\install_windows.ps1# .\.venv\Scripts\Activate.ps1```
### 2) 폐쇄망 / 오프라인 PC 설치 (인터넷 연결 불필요)저장소 폴더(또는 `deck2video_offline_full.zip`)를 USB/사내망으로 복사한 뒤 실행합니다(PC에 Python 3.12, FFmpeg, Chrome 또는 Edge 브라우저만 있으면 동작).```bash# macOS / Linux 오프라인 설치./install_offline_mac_linux.sh && source .venv/bin/activate
# Windows 오프라인 설치 (PowerShell)# powershell -ExecutionPolicy Bypass -File .\install_offline_windows.ps1
# 100% 오프라인 모드로 영상 렌더링 (OS 내장 한국어 TTS + 로컬 브라우저 CDP 렌더링)python3 produce_deck_video.py --input samples/sample_ai_sync_lecture.pptx --offline --output output/offline_lecture.mp4```
### 3) 포맷별 변환 예시```bash# 파워포인트 (.pptx)deck2video --input lecture.pptx --output output/lecture.mp4
# 워드 (.docx)deck2video --input proposal.docx --output output/proposal.mp4
# 마크다운 (.md)deck2video --input notes.md --voice ko-KR-SunHiNeural --output output/notes.mp4
# 웹 슬라이드 / HTML (.html)deck2video --input slides.html --output output/slides.mp4```12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273---name: deck-video-pipelinedescription: > Convert PowerPoint (.pptx), Word (.docx), Markdown (.md/.txt), or HTML (.html) presentations and educational materials into sleek code-rendered 1920x1080 MP4 motion videos complete with dark glassmorphism UI, 3D horizon particle waves, top chapter progress bars, Korean/multilingual TTS voiceover, 6 procedural UI sound effects (SFX), and auto-ducked ambient BGM. Supports both Online mode (HyperFrames + Edge-TTS) and 100% Air-Gapped Offline mode (--offline).---
# Deck-to-Video Motion Presentation Skill (`deck-video-pipeline`)
Use this skill whenever the user asks to:- Turn a **PowerPoint (`.pptx`)**, **Word document (`.docx`)**, **Markdown/text note (`.md`/`.txt`)**, or **HTML presentation/article (`.html`)** into a presentation video, lecture video, explainer video, or YouTube tech presentation (like *쫑대표의 딸깍일기* / code-rendered dark glass UI decks).- Generate a presentation video **with UI sound effects (SFX)**, chapter progress HUD, big stat counters, 3D card arcs, textbook quote highlights, or terminal flow animations.- Run presentation video conversion in **offline / air-gapped environments** (`--offline`).
---
## 1. Skill Directory & Entrypoint
Locate `produce_deck_video.py` inside this skill folder (`<SKILL_DIR>/produce_deck_video.py`).
### Quick Verification```bashpython3 "<SKILL_DIR>/produce_deck_video.py" --help```
If Python dependencies are not yet installed on the machine:- **Online install**: `bash "<SKILL_DIR>/install_mac_linux.sh"` (macOS/Linux) or `powershell -ExecutionPolicy Bypass -File "<SKILL_DIR>\install_windows.ps1"` (Windows).- **Offline (air-gapped) install**: `bash "<SKILL_DIR>/install_offline_mac_linux.sh"` or `powershell -ExecutionPolicy Bypass -File "<SKILL_DIR>\install_offline_windows.ps1"`.
---
## 2. Standard Execution Commands
### A. Convert PowerPoint (`.pptx`), Word (`.docx`), Markdown (`.md`), or HTML (`.html`) to MP4```bashpython3 "<SKILL_DIR>/produce_deck_video.py" \ --input "/absolute/path/to/material.pptx" \ --output "/absolute/path/to/output_video.mp4"```
### B. 100% Offline / Air-Gapped Mode (Zero Internet, Zero NPM Required)Uses OS-native TTS (macOS `say`, Windows `System.Speech`, Linux `espeak-ng`), bundled `PretendardVariable.woff2` + `gsap.min.js`, procedural 48kHz stereo SFX + offline ambient pad BGM, and local Chrome/Edge headless CDP frame pipe:```bashpython3 "<SKILL_DIR>/produce_deck_video.py" \ --input "/absolute/path/to/material.docx" \ --offline \ --output "/absolute/path/to/output_video.mp4"```
### C. Customize Voice, Pacing, or Audio Layers- `--voice ko-KR-InJoonNeural` (default calm male) or `--voice ko-KR-SunHiNeural` (bright female) or any `edge-tts` voice (e.g. `en-US-AndrewNeural`, `ja-JP-KeitaNeural`)- `--rate "+8%"` (adjust speaking speed)- `--no-sfx` (mute UI sound effects) / `--no-bgm` (mute background music)- `--html-only` (generate `index.html` and run layout/WCAG contrast checks without encoding MP4)
---
## 3. Authoring & Formatting Tips for Best Visual Output
When the user asks you to create a presentation from a topic or rough notes first, write a `.md` or `.json` (or `.pptx`) using these conventions before running `produce_deck_video.py`:
1. **5 Built-in Visual Scene Archetypes** (auto-assigned, or override via `[ARCHETYPE: <name>]` line): - `arc_cards`: 3D cylindrical concave card carousel + big glowing stat counter (`[STAT_PREFIX: ...]`, `[STAT_NUM: 9]`, `[STAT_SUFFIX: 종]`). Best for intro / overview of N items. - `mockup_steps`: Left glass app/slide monitor + Right 3 stacked cards that light up sequentially per spoken beat with `card_pop` SFX. Best for 3-step comparisons or problem diagnosis. - `book_quote`: 3D perspective open manual spread + animated sky-blue highlighter sweep (`[QUOTE: ...]`). Best for core principles, rules, or definitions. - `terminal_flow`: Dark macOS-style terminal typing (`[COMMAND: ...]`) + glowing `INPUT ──●──▶ OUTPUT` node pulse. Best for workflows, CLI commands, or system pipelines. - `metric_summary`: 3 neon glass pillars (`01`, `02`, `03`) + bottom takeaway pill (`[SUBTITLE: ...]`). Best for conclusions and action items.2. **Card Label Splitting**: Format bullets as `핵심 키워드 | 부연 설명 한 줄` so cards display a bold title and crisp subtitle.3. **Bilingual Dual Subtitles**: In PPTX speaker notes, Word quotes, or Markdown `>` lines, write `한국어 내레이션 문장입니다. || Optional English subtitle line.` to render dual KR/EN subtitles automatically.1"""Deck-to-Video (PPTX / Markdown / JSON -> HTML Motion + SFX -> MP4) Pipeline."""123version https://git-lfs.github.com/spec/v1oid sha256:1fe33de255fa9ac731624d8c6ead4d7f95b66ce28c0f1a6761458cba37f3bca5size 4441685123version https://git-lfs.github.com/spec/v1oid sha256:9a4b7248e9bd15b95b86c71290e9e3d5635d22152752ac46c88471aa3089a64asize 5760044123version https://git-lfs.github.com/spec/v1oid sha256:9599f12fd42fc0bce1cd50b47a0c022e108d7aa64dd0d1bb0ed44f3282d900b4size 20576881234567891011/*! * GSAP 3.14.2 * https://gsap.com * * @license Copyright 2025, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license. * @author: Jack Doyle, jack@greensock.com */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(e){"use strict";function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function r(t){return"string"==typeof t}function s(t){return"function"==typeof t}function t(t){return"number"==typeof t}function u(t){return void 0===t}function v(t){return"object"==typeof t}function w(t){return!1!==t}function x(){return"undefined"!=typeof window}function y(t){return s(t)||r(t)}function R(t){return(i=bt(t,ht))&&Fe}function S(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")}function T(t,e){return!e&&console.warn(t)}function U(t,e){return t&&(ht[t]=e)&&i&&(i[t]=e)||ht}function V(){return 0}function ga(t){var e,r,i=t[0];if(v(i)||s(i)||(t=[t]),!(e=(i._gsap||{}).harness)){for(r=yt.length;r--&&!yt[r].targetTest(i););e=yt[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new Xt(t[r],e)))||t.splice(r,1);return t}function ha(t){return t._gsap||ga(Pt(t))[0]._gsap}function ia(t,e,r){return(r=t[e])&&s(r)?t[e]():u(r)&&t.getAttribute&&t.getAttribute(e)||r}function ja(t,e){return(t=t.split(",")).forEach(e)||t}function ka(t){return Math.round(1e5*t)/1e5||0}function la(t){return Math.round(1e7*t)/1e7||0}function ma(t,e){var r=e.charAt(0),i=parseFloat(e.substr(2));return t=parseFloat(t),"+"===r?t+i:"-"===r?t-i:"*"===r?t*i:t/i}function na(t,e){for(var r=e.length,i=0;t.indexOf(e[i])<0&&++i<r;);return i<r}function oa(){var t,e,r=pt.length,i=pt.slice(0);for(_t={},t=pt.length=0;t<r;t++)(e=i[t])&&e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0)._lazy=0)}function pa(t){return!!(t._initted||t._startAt||t.add)}function qa(t,e,r,i){pt.length&&!I&&oa(),t.render(e,r,i||!!(I&&e<0&&pa(t))),pt.length&&!I&&oa()}function ra(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(ot).length<2?e:r(t)?t.trim():t}function sa(t){return t}function ta(t,e){for(var r in e)r in t||(t[r]=e[r]);return t}function wa(t,e){for(var r in e)"__proto__"!==r&&"constructor"!==r&&"prototype"!==r&&(t[r]=v(e[r])?wa(t[r]||(t[r]={}),e[r]):e[r]);return t}function xa(t,e){var r,i={};for(r in t)r in e||(i[r]=t[r]);return i}function ya(t){var e=t.parent||L,r=t.keyframes?function _setKeyframeDefaults(i){return function(t,e){for(var r in e)r in t||"duration"===r&&i||"ease"===r||(t[r]=e[r])}}($(t.keyframes)):ta;if(w(t.inherit))for(;e;)r(t,e.vars.defaults),e=e.parent||e._dp;return t}function Aa(t,e,r,i,n){void 0===r&&(r="_first"),void 0===i&&(i="_last");var a,s=t[i];if(n)for(a=e[n];s&&s[n]>a;)s=s._prev;return s?(e._next=s._next,s._next=e):(e._next=t[r],t[r]=e),e._next?e._next._prev=e:t[i]=e,e._prev=s,e.parent=e._dp=t,e}function Ba(t,e,r,i){void 0===r&&(r="_first"),void 0===i&&(i="_last");var n=e._prev,a=e._next;n?n._next=a:t[r]===e&&(t[r]=a),a?a._prev=n:t[i]===e&&(t[i]=n),e._next=e._prev=e.parent=null}function Ca(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0}function Da(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t}function Fa(t,e,r,i){return t._startAt&&(I?t._startAt.revert(ft):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))}function Ha(t){return t._repeat?wt(t._tTime,t=t.duration()+t._rDelay)*t:0}function Ja(t,e){return(t-e._start)*e._ts+(0<=e._ts?0:e._dirty?e.totalDuration():e._tDur)}function Ka(t){return t._end=la(t._start+(t._tDur/Math.abs(t._ts||t._rts||q)||0))}function La(t,e){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=la(r._time-(0<t._ts?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Ka(t),r._dirty||Da(r,t)),t}function Ma(t,e){var r;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(r=Ja(t.rawTime(),e),(!e._dur||Mt(0,e.totalDuration(),r)-e._tTime>q)&&e.render(r,!0)),Da(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(r=t;r._dp;)0<=r.rawTime()&&r.totalTime(r._tTime),r=r._dp;t._zTime=-q}}function Na(e,r,i,n){return r.parent&&Ca(r),r._start=la((t(i)?i:i||e!==L?Ot(e,i,r):e._time)+r._delay),r._end=la(r._start+(r.totalDuration()/Math.abs(r.timeScale())||0)),Aa(e,r,"_first","_last",e._sort?"_start":0),xt(r)||(e._recent=r),n||Ma(e,r),e._ts<0&&La(e,e._tTime),e}function Oa(t,e){return(ht.ScrollTrigger||S("scrollTrigger",e))&&ht.ScrollTrigger.create(e,t)}function Pa(t,e,r,i,n){return Qt(t,e,n),t._initted?!r&&t._pt&&!I&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&f!==It.frame?(pt.push(t),t._lazy=[n,i],1):void 0:1}function Ua(t,e,r,i){var n=t._repeat,a=la(e)||0,s=t._tTime/t._tDur;return s&&!i&&(t._time*=a/t._dur),t._dur=a,t._tDur=n?n<0?1e10:la(a*(n+1)+t._rDelay*n):a,0<s&&!i&&La(t,t._tTime=t._tDur*s),t.parent&&Ka(t),r||Da(t.parent,t),t}function Va(t){return t instanceof Zt?Da(t):Ua(t,t._dur)}function Ya(e,r,i){var n,a,s=t(r[1]),o=(s?2:1)+(e<2?0:1),u=r[o];if(s&&(u.duration=r[1]),u.parent=i,e){for(n=u,a=i;a&&!("immediateRender"in n);)n=a.vars.defaults||{},a=w(a.vars.inherit)&&a.parent;u.immediateRender=w(n.immediateRender),e<2?u.runBackwards=1:u.startAt=r[o-1]}return new te(r[0],u,r[1+o])}function Za(t,e){return t||0===t?e(t):e}function _a(t,e){return r(t)&&(e=ut.exec(t))?e[1]:""}function cb(t,e){return t&&v(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&v(t[0]))&&!t.nodeType&&t!==h}function fb(r){return r=Pt(r)[0]||T("Invalid scope")||{},function(t){var e=r.current||r.nativeElement||r;return Pt(t,e.querySelectorAll?e:e===r?T("Invalid scope")||a.createElement("div"):r)}}function gb(t){return t.sort(function(){return.5-Math.random()})}function hb(t){if(s(t))return t;var p=v(t)?t:{each:t},_=Vt(p.ease),m=p.from||0,g=parseFloat(p.base)||0,y={},e=0<m&&m<1,T=isNaN(m)||e,b=p.axis,w=m,x=m;return r(m)?w=x={center:.5,edges:.5,end:1}[m]||0:!e&&T&&(w=m[0],x=m[1]),function(t,e,r){var i,n,a,s,o,u,h,l,f,d=(r||p).length,c=y[d];if(!c){if(!(f="auto"===p.grid?0:(p.grid||[1,X])[1])){for(h=-X;h<(h=r[f++].getBoundingClientRect().left)&&f<d;);f<d&&f--}for(c=y[d]=[],i=T?Math.min(f,d)*w-.5:m%f,n=f===X?0:T?d*x/f-.5:m/f|0,l=X,u=h=0;u<d;u++)a=u%f-i,s=n-(u/f|0),c[u]=o=b?Math.abs("y"===b?s:a):J(a*a+s*s),h<o&&(h=o),o<l&&(l=o);"random"===m&&gb(c),c.max=h-l,c.min=l,c.v=d=(parseFloat(p.amount)||parseFloat(p.each)*(d<f?d-1:b?"y"===b?d/f:f:Math.max(f,d/f))||0)*("edges"===m?-1:1),c.b=d<0?g-d:g,c.u=_a(p.amount||p.each)||0,_=_&&d<0?jt(_):_}return d=(c[t]-c.min)/c.max||0,la(c.b+(_?_(d):d)*c.v)+c.u}}function ib(i){var n=Math.pow(10,((i+"").split(".")[1]||"").length);return function(e){var r=la(Math.round(parseFloat(e)/i)*i*n);return(r-r%1)/n+(t(e)?0:_a(e))}}function jb(h,e){var l,f,r=$(h);return!r&&v(h)&&(l=r=h.radius||X,h.values?(h=Pt(h.values),(f=!t(h[0]))&&(l*=l)):h=ib(h.increment)),Za(e,r?s(h)?function(t){return f=h(t),Math.abs(f-t)<=l?f:t}:function(e){for(var r,i,n=parseFloat(f?e.x:e),a=parseFloat(f?e.y:0),s=X,o=0,u=h.length;u--;)(r=f?(r=h[u].x-n)*r+(i=h[u].y-a)*i:Math.abs(h[u]-n))<s&&(s=r,o=u);return o=!l||s<=l?h[o]:e,f||o===e||t(e)?o:o+_a(e)}:ib(h))}function kb(t,e,r,i){return Za($(t)?!e:!0===r?!!(r=0):!i,function(){return $(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(i=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(e-t+.99*r))/r)*r*i)/i})}function ob(e,r,t){return Za(t,function(t){return e[~~r(t)]})}function rb(t){return t.replace(tt,function(t){var e=t.indexOf("[")+1,r=t.substring(e||7,e?t.indexOf("]"):t.length-1).split(et);return kb(e?r:+r[0],e?0:+r[1],+r[2]||1e-5)})}function ub(t,e,r){var i,n,a,s=t.labels,o=X;for(i in s)(n=s[i]-e)<0==!!r&&n&&o>(n=Math.abs(n))&&(a=i,o=n);return a}function wb(t){return Ca(t),t.scrollTrigger&&t.scrollTrigger.kill(!!I),t.progress()<1&&Dt(t,"onInterrupt"),t}function zb(t){if(t)if(t=!t.name&&t.default||t,x()||t.headless){var e=t.name,r=s(t),i=e&&!r&&t.init?function(){this._props=[]}:t,n={init:V,render:ve,add:Jt,kill:Te,modifier:ye,rawVars:0},a={targetTest:0,get:0,getSetter:le,aliases:{},register:0};if(Lt(),t!==i){if(mt[e])return;ta(i,ta(xa(t,n),a)),bt(i.prototype,bt(n,xa(t,a))),mt[i.prop=e]=i,t.targetTest&&(yt.push(i),ct[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}U(e,i),t.register&&t.register(Fe,i,we)}else St.push(t)}function Cb(t,e,r){return(6*(t+=t<0?1:1<t?-1:0)<1?e+(r-e)*t*6:t<.5?r:3*t<2?e+(r-e)*(2/3-t)*6:e)*zt+.5|0}function Db(e,r,i){var n,a,s,o,u,h,l,f,d,c,p=e?t(e)?[e>>16,e>>8&zt,e&zt]:0:Et.black;if(!p){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),Et[e])p=Et[e];else if("#"===e.charAt(0)){if(e.length<6&&(e="#"+(n=e.charAt(1))+n+(a=e.charAt(2))+a+(s=e.charAt(3))+s+(5===e.length?e.charAt(4)+e.charAt(4):"")),9===e.length)return[(p=parseInt(e.substr(1,6),16))>>16,p>>8&zt,p&zt,parseInt(e.substr(7),16)/255];p=[(e=parseInt(e.substr(1),16))>>16,e>>8&zt,e&zt]}else if("hsl"===e.substr(0,3))if(p=c=e.match(rt),r){if(~e.indexOf("="))return p=e.match(it),i&&p.length<4&&(p[3]=1),p}else o=+p[0]%360/360,u=p[1]/100,n=2*(h=p[2]/100)-(a=h<=.5?h*(u+1):h+u-h*u),3<p.length&&(p[3]*=1),p[0]=Cb(o+1/3,n,a),p[1]=Cb(o,n,a),p[2]=Cb(o-1/3,n,a);else p=e.match(rt)||Et.transparent;p=p.map(Number)}return r&&!c&&(n=p[0]/zt,a=p[1]/zt,s=p[2]/zt,h=((l=Math.max(n,a,s))+(f=Math.min(n,a,s)))/2,l===f?o=u=0:(d=l-f,u=.5<h?d/(2-l-f):d/(l+f),o=l===n?(a-s)/d+(a<s?6:0):l===a?(s-n)/d+2:(n-a)/d+4,o*=60),p[0]=~~(o+.5),p[1]=~~(100*u+.5),p[2]=~~(100*h+.5)),i&&p.length<4&&(p[3]=1),p}function Eb(t){var r=[],i=[],n=-1;return t.split(Rt).forEach(function(t){var e=t.match(nt)||[];r.push.apply(r,e),i.push(n+=e.length+1)}),r.c=i,r}function Fb(t,e,r){var i,n,a,s,o="",u=(t+o).match(Rt),h=e?"hsla(":"rgba(",l=0;if(!u)return t;if(u=u.map(function(t){return(t=Db(t,e,1))&&h+(e?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"}),r&&(a=Eb(t),(i=r.c).join(o)!==a.c.join(o)))for(s=(n=t.replace(Rt,"1").split(nt)).length-1;l<s;l++)o+=n[l]+(~i.indexOf(l)?u.shift()||h+"0,0,0,0)":(a.length?a:u.length?u:r).shift());if(!n)for(s=(n=t.split(Rt)).length-1;l<s;l++)o+=n[l]+u[l];return o+n[s]}function Ib(t){var e,r=t.join(" ");if(Rt.lastIndex=0,Rt.test(r))return e=Ft.test(r),t[1]=Fb(t[1],e),t[0]=Fb(t[0],e,Eb(t[1])),!0}function Rb(t){var e=(t+"").split("("),r=Bt[e[0]];return r&&1<e.length&&r.config?r.config.apply(null,~t.indexOf("{")?[function _parseObjectInString(t){for(var e,r,i,n={},a=t.substr(1,t.length-3).split(":"),s=a[0],o=1,u=a.length;o<u;o++)r=a[o],e=o!==u-1?r.lastIndexOf(","):r.length,i=r.substr(0,e),n[s]=isNaN(i)?i.replace(Nt,"").trim():+i,s=r.substr(e+1).trim();return n}(e[1])]:function _valueInParentheses(t){var e=t.indexOf("(")+1,r=t.indexOf(")"),i=t.indexOf("(",e);return t.substring(e,~i&&i<r?t.indexOf(")",r+1):r)}(t).split(",").map(ra)):Bt._CE&&Yt.test(t)?Bt._CE("",t):r}function Tb(t,e){for(var r,i=t._first;i;)i instanceof Zt?Tb(i,e):!i.vars.yoyoEase||i._yoyo&&i._repeat||i._yoyo===e||(i.timeline?Tb(i.timeline,e):(r=i._ease,i._ease=i._yEase,i._yEase=r,i._yoyo=e)),i=i._next}function Vb(t,e,r,i){void 0===r&&(r=function easeOut(t){return 1-e(1-t)}),void 0===i&&(i=function easeInOut(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2});var n,a={easeIn:e,easeOut:r,easeInOut:i};return ja(t,function(t){for(var e in Bt[t]=ht[t]=a,Bt[n=t.toLowerCase()]=r,a)Bt[n+("easeIn"===e?".in":"easeOut"===e?".out":".inOut")]=Bt[t+"."+e]=a[e]}),a}function Wb(e){return function(t){return t<.5?(1-e(1-2*t))/2:.5+e(2*(t-.5))/2}}function Xb(r,t,e){function Lm(t){return 1===t?1:i*Math.pow(2,-10*t)*G((t-a)*n)+1}var i=1<=t?t:1,n=(e||(r?.3:.45))/(t<1?t:1),a=n/Z*(Math.asin(1/i)||0),s="out"===r?Lm:"in"===r?function(t){return 1-Lm(1-t)}:Wb(Lm);return n=Z/n,s.config=function(t,e){return Xb(r,t,e)},s}function Yb(e,r){function Tm(t){return t?--t*t*((r+1)*t+r)+1:0}void 0===r&&(r=1.70158);var t="out"===e?Tm:"in"===e?function(t){return 1-Tm(1-t)}:Wb(Tm);return t.config=function(t){return Yb(e,t)},t}var F,I,l,L,h,n,a,i,o,f,d,c,p,_,m,g,b,k,O,M,C,P,A,D,z,E,B,Y,N={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},j={duration:.5,overwrite:!1,delay:0},X=1e8,q=1/X,Z=2*Math.PI,W=Z/4,H=0,J=Math.sqrt,Q=Math.cos,G=Math.sin,K="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},$=Array.isArray,tt=/random\([^)]+\)/g,et=/,\s*/g,rt=/(?:-?\.?\d|\.)+/gi,it=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,nt=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,at=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,st=/[+-]=-?[.\d]+/,ot=/[^,'"\[\]\s]+/gi,ut=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,ht={},lt={suppressEvents:!0,isStart:!0,kill:!1},ft={suppressEvents:!0,kill:!1},dt={suppressEvents:!0},ct={},pt=[],_t={},mt={},gt={},vt=30,yt=[],Tt="",bt=function _merge(t,e){for(var r in e)t[r]=e[r];return t},wt=function _animationCycle(t,e){var r=Math.floor(t=la(t/e));return t&&r===t?r-1:r},xt=function _isFromOrFromStart(t){var e=t.data;return"isFromStart"===e||"isStart"===e},kt={_start:0,endTime:V,totalDuration:V},Ot=function _parsePosition(t,e,i){var n,a,s,o=t.labels,u=t._recent||kt,h=t.duration()>=X?u.endTime(!1):t._dur;return r(e)&&(isNaN(e)||e in o)?(a=e.charAt(0),s="%"===e.substr(-1),n=e.indexOf("="),"<"===a||">"===a?(0<=n&&(e=e.replace(/=/,"")),("<"===a?u._start:u.endTime(0<=u._repeat))+(parseFloat(e.substr(1))||0)*(s?(n<0?u:i).totalDuration()/100:1)):n<0?(e in o||(o[e]=h),o[e]):(a=parseFloat(e.charAt(n-1)+e.substr(n+1)),s&&i&&(a=a/100*($(i)?i[0]:i).totalDuration()),1<n?_parsePosition(t,e.substr(0,n-1),i)+a:h+a)):null==e?h:+e},Mt=function _clamp(t,e,r){return r<t?t:e<r?e:r},Ct=[].slice,Pt=function toArray(t,e,i){return l&&!e&&l.selector?l.selector(t):!r(t)||i||!n&&Lt()?$(t)?function _flatten(t,e,i){return void 0===i&&(i=[]),t.forEach(function(t){return r(t)&&!e||cb(t,1)?i.push.apply(i,Pt(t)):i.push(t)})||i}(t,i):cb(t)?Ct.call(t,0):t?[t]:[]:Ct.call((e||a).querySelectorAll(t),0)},At=function mapRange(e,t,r,i,n){var a=t-e,s=i-r;return Za(n,function(t){return r+((t-e)/a*s||0)})},Dt=function _callback(t,e,r){var i,n,a,s=t.vars,o=s[e],u=l,h=t._ctx;if(o)return i=s[e+"Params"],n=s.callbackScope||t,r&&pt.length&&oa(),h&&(l=h),a=i?o.apply(n,i):o.call(n),l=u,a},St=[],zt=255,Et={aqua:[0,zt,zt],lime:[0,zt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,zt],navy:[0,0,128],white:[zt,zt,zt],olive:[128,128,0],yellow:[zt,zt,0],orange:[zt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[zt,0,0],pink:[zt,192,203],cyan:[0,zt,zt],transparent:[zt,zt,zt,0]},Rt=function(){var t,e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(t in Et)e+="|"+t+"\\b";return new RegExp(e+")","gi")}(),Ft=/hsl[a]?\(/,It=(O=Date.now,M=500,C=33,P=O(),A=P,z=D=1e3/240,g={time:0,frame:0,tick:function tick(){Al(!0)},deltaRatio:function deltaRatio(t){return b/(1e3/(t||60))},wake:function wake(){o&&(!n&&x()&&(h=n=window,a=h.document||{},ht.gsap=Fe,(h.gsapVersions||(h.gsapVersions=[])).push(Fe.version),R(i||h.GreenSockGlobals||!h.gsap&&h||{}),St.forEach(zb)),m="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame,p&&g.sleep(),_=m||function(t){return setTimeout(t,z-1e3*g.time+1|0)},c=1,Al(2))},sleep:function sleep(){(m?cancelAnimationFrame:clearTimeout)(p),c=0,_=V},lagSmoothing:function lagSmoothing(t,e){M=t||1/0,C=Math.min(e||33,M)},fps:function fps(t){D=1e3/(t||240),z=1e3*g.time+D},add:function add(n,t,e){var a=t?function(t,e,r,i){n(t,e,r,i),g.remove(a)}:n;return g.remove(n),E[e?"unshift":"push"](a),Lt(),a},remove:function remove(t,e){~(e=E.indexOf(t))&&E.splice(e,1)&&e<=k&&k--},_listeners:E=[]}),Lt=function _wake(){return!c&&It.wake()},Bt={},Yt=/^[\d.\-M][\d.\-,\s]/,Nt=/["']/g,jt=function _invertEase(e){return function(t){return 1-e(1-t)}},Vt=function _parseEase(t,e){return t&&(s(t)?t:Bt[t]||Rb(t))||e};function Al(t){var e,r,i,n,a=O()-A,s=!0===t;if((M<a||a<0)&&(P+=a-C),(0<(e=(i=(A+=a)-P)-z)||s)&&(n=++g.frame,b=i-1e3*g.time,g.time=i/=1e3,z+=e+(D<=e?4:D-e),r=1),s||(p=_(Al)),r)for(k=0;k<E.length;k++)E[k](i,b,n,t)}function jn(t){return t<Y?B*t*t:t<.7272727272727273?B*Math.pow(t-1.5/2.75,2)+.75:t<.9090909090909092?B*(t-=2.25/2.75)*t+.9375:B*Math.pow(t-2.625/2.75,2)+.984375}ja("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var r=e<5?e+1:e;Vb(t+",Power"+(r-1),e?function(t){return Math.pow(t,r)}:function(t){return t},function(t){return 1-Math.pow(1-t,r)},function(t){return t<.5?Math.pow(2*t,r)/2:1-Math.pow(2*(1-t),r)/2})}),Bt.Linear.easeNone=Bt.none=Bt.Linear.easeIn,Vb("Elastic",Xb("in"),Xb("out"),Xb()),B=7.5625,Y=1/2.75,Vb("Bounce",function(t){return 1-jn(1-t)},jn),Vb("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)}),Vb("Circ",function(t){return-(J(1-t*t)-1)}),Vb("Sine",function(t){return 1===t?1:1-Q(t*W)}),Vb("Back",Yb("in"),Yb("out"),Yb()),Bt.SteppedEase=Bt.steps=ht.SteppedEase={config:function config(t,e){void 0===t&&(t=1);var r=1/t,i=t+(e?0:1),n=e?1:0;return function(t){return((i*Mt(0,.99999999,t)|0)+n)*r}}},j.ease=Bt["quad.out"],ja("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return Tt+=t+","+t+"Params,"});var Ut,Xt=function GSCache(t,e){this.id=H++,(t._gsap=this).target=t,this.harness=e,this.get=e?e.get:ia,this.set=e?e.getSetter:le},qt=((Ut=Animation.prototype).delay=function delay(t){return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},Ut.duration=function duration(t){return arguments.length?this.totalDuration(0<this._repeat?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},Ut.totalDuration=function totalDuration(t){return arguments.length?(this._dirty=0,Ua(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},Ut.totalTime=function totalTime(t,e){if(Lt(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(La(this,t),!r._dp||r.parent||Ma(r,this);r&&r.parent;)r.parent._time!==r._start+(0<=r._ts?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(0<this._ts&&t<this._tDur||this._ts<0&&0<t||!this._tDur&&!t)&&Na(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===q||!this._initted&&this._dur&&t||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),qa(this,t,e)),this},Ut.time=function time(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+Ha(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},Ut.totalProgress=function totalProgress(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):0<=this.rawTime()&&this._initted?1:0},Ut.progress=function progress(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+Ha(this),e):this.duration()?Math.min(1,this._time/this._dur):0<this.rawTime()?1:0},Ut.iteration=function iteration(t,e){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*r,e):this._repeat?wt(this._tTime,r)+1:1},Ut.timeScale=function timeScale(t,e){if(!arguments.length)return this._rts===-q?0:this._rts;if(this._rts===t)return this;var r=this.parent&&this._ts?Ja(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||t===-q?0:this._rts,this.totalTime(Mt(-Math.abs(this._delay),this.totalDuration(),r),!1!==e),Ka(this),function _recacheAncestors(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t}(this)},Ut.paused=function paused(t){return arguments.length?(this._ps!==t&&((this._ps=t)?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Lt(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==q&&(this._tTime-=q)))),this):this._ps},Ut.startTime=function startTime(t){if(arguments.length){this._start=la(t);var e=this.parent||this._dp;return!e||!e._sort&&this.parent||Na(e,this,this._start-this._delay),this}return this._start},Ut.endTime=function endTime(t){return this._start+(w(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},Ut.rawTime=function rawTime(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Ja(e.rawTime(t),this):this._tTime:this._tTime},Ut.revert=function revert(t){void 0===t&&(t=dt);var e=I;return I=t,pa(this)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),"nested"!==this.data&&!1!==t.kill&&this.kill(),I=e,this},Ut.globalTime=function globalTime(t){for(var e=this,r=arguments.length?t:e.rawTime();e;)r=e._start+r/(Math.abs(e._ts)||1),e=e._dp;return!this.parent&&this._sat?this._sat.globalTime(t):r},Ut.repeat=function repeat(t){return arguments.length?(this._repeat=t===1/0?-2:t,Va(this)):-2===this._repeat?1/0:this._repeat},Ut.repeatDelay=function repeatDelay(t){if(arguments.length){var e=this._time;return this._rDelay=t,Va(this),e?this.time(e):this}return this._rDelay},Ut.yoyo=function yoyo(t){return arguments.length?(this._yoyo=t,this):this._yoyo},Ut.seek=function seek(t,e){return this.totalTime(Ot(this,t),w(e))},Ut.restart=function restart(t,e){return this.play().totalTime(t?-this._delay:0,w(e)),this._dur||(this._zTime=-q),this},Ut.play=function play(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},Ut.reverse=function reverse(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},Ut.pause=function pause(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},Ut.resume=function resume(){return this.paused(!1)},Ut.reversed=function reversed(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-q:0)),this):this._rts<0},Ut.invalidate=function invalidate(){return this._initted=this._act=0,this._zTime=-q,this},Ut.isActive=function isActive(){var t,e=this.parent||this._dp,r=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=r&&t<this.endTime(!0)-q))},Ut.eventCallback=function eventCallback(t,e,r){var i=this.vars;return 1<arguments.length?(e?(i[t]=e,r&&(i[t+"Params"]=r),"onUpdate"===t&&(this._onUpdate=e)):delete i[t],this):i[t]},Ut.then=function then(t){var i=this,n=i._prom;return new Promise(function(e){function Fo(){var t=i.then;i.then=null,n&&n(),s(r)&&(r=r(i))&&(r.then||r===i)&&(i.then=t),e(r),i.then=t}var r=s(t)?t:sa;i._initted&&1===i.totalProgress()&&0<=i._ts||!i._tTime&&i._ts<0?Fo():i._prom=Fo})},Ut.kill=function kill(){wb(this)},Animation);function Animation(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Ua(this,+t.duration,1,1),this.data=t.data,l&&(this._ctx=l).data.push(this),c||It.wake()}ta(qt.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-q,_prom:0,_ps:!1,_rts:1});var Zt=function(i){function Timeline(t,e){var r;return void 0===t&&(t={}),(r=i.call(this,t)||this).labels={},r.smoothChildTiming=!!t.smoothChildTiming,r.autoRemoveChildren=!!t.autoRemoveChildren,r._sort=w(t.sortChildren),L&&Na(t.parent||L,_assertThisInitialized(r),e),t.reversed&&r.reverse(),t.paused&&r.paused(!0),t.scrollTrigger&&Oa(_assertThisInitialized(r),t.scrollTrigger),r}_inheritsLoose(Timeline,i);var e=Timeline.prototype;return e.to=function to(t,e,r){return Ya(0,arguments,this),this},e.from=function from(t,e,r){return Ya(1,arguments,this),this},e.fromTo=function fromTo(t,e,r,i){return Ya(2,arguments,this),this},e.set=function set(t,e,r){return e.duration=0,e.parent=this,ya(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new te(t,e,Ot(this,r),1),this},e.call=function call(t,e,r){return Na(this,te.delayedCall(0,t,e),r)},e.staggerTo=function staggerTo(t,e,r,i,n,a,s){return r.duration=e,r.stagger=r.stagger||i,r.onComplete=a,r.onCompleteParams=s,r.parent=this,new te(t,r,Ot(this,n)),this},e.staggerFrom=function staggerFrom(t,e,r,i,n,a,s){return r.runBackwards=1,ya(r).immediateRender=w(r.immediateRender),this.staggerTo(t,e,r,i,n,a,s)},e.staggerFromTo=function staggerFromTo(t,e,r,i,n,a,s,o){return i.startAt=r,ya(i).immediateRender=w(i.immediateRender),this.staggerTo(t,e,i,n,a,s,o)},e.render=function render(t,e,r){var i,n,a,s,o,u,h,l,f,d,c,p,_=this._time,m=this._dirty?this.totalDuration():this._tDur,g=this._dur,v=t<=0?0:la(t),y=this._zTime<0!=t<0&&(this._initted||!g);if(this!==L&&m<v&&0<=t&&(v=m),v!==this._tTime||r||y){if(_!==this._time&&g&&(v+=this._time-_,t+=this._time-_),i=v,f=this._start,u=!(l=this._ts),y&&(g||(_=this._zTime),!t&&e||(this._zTime=t)),this._repeat){if(c=this._yoyo,o=g+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*o+t,e,r);if(i=la(v%o),v===m?(s=this._repeat,i=g):((s=~~(d=la(v/o)))&&s===d&&(i=g,s--),g<i&&(i=g)),d=wt(this._tTime,o),!_&&this._tTime&&d!==s&&this._tTime-d*o-this._dur<=0&&(d=s),c&&1&s&&(i=g-i,p=1),s!==d&&!this._lock){var T=c&&1&d,b=T===(c&&1&s);if(s<d&&(T=!T),_=T?0:v%g?g:v,this._lock=1,this.render(_||(p?0:la(s*o)),e,!g)._lock=0,this._tTime=v,!e&&this.parent&&Dt(this,"onRepeat"),this.vars.repeatRefresh&&!p&&(this.invalidate()._lock=1,d=s),_&&_!==this._time||u!=!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(g=this._dur,m=this._tDur,b&&(this._lock=2,_=T?g:-1e-4,this.render(_,!0),this.vars.repeatRefresh&&!p&&this.invalidate()),this._lock=0,!this._ts&&!u)return this;Tb(this,p)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(h=function _findNextPauseTween(t,e,r){var i;if(e<r)for(i=t._first;i&&i._start<=r;){if("isPause"===i.data&&i._start>e)return i;i=i._next}else for(i=t._last;i&&i._start>=r;){if("isPause"===i.data&&i._start<e)return i;i=i._prev}}(this,la(_),la(i)))&&(v-=i-(i=h._start)),this._tTime=v,this._time=i,this._act=!l,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,_=0),!_&&v&&g&&!e&&!d&&(Dt(this,"onStart"),this._tTime!==v))return this;if(_<=i&&0<=t)for(n=this._first;n;){if(a=n._next,(n._act||i>=n._start)&&n._ts&&h!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(0<n._ts?(i-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(i-n._start)*n._ts,e,r),i!==this._time||!this._ts&&!u){h=0,a&&(v+=this._zTime=-q);break}}n=a}else{n=this._last;for(var w=t<0?t:i;n;){if(a=n._prev,(n._act||w<=n._end)&&n._ts&&h!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(0<n._ts?(w-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(w-n._start)*n._ts,e,r||I&&pa(n)),i!==this._time||!this._ts&&!u){h=0,a&&(v+=this._zTime=w?-q:q);break}}n=a}}if(h&&!e&&(this.pause(),h.render(_<=i?0:-q)._zTime=_<=i?1:-1,this._ts))return this._start=f,Ka(this),this.render(t,e,r);this._onUpdate&&!e&&Dt(this,"onUpdate",!0),(v===m&&this._tTime>=this.totalDuration()||!v&&_)&&(f!==this._start&&Math.abs(l)===Math.abs(this._ts)||this._lock||(!t&&g||!(v===m&&0<this._ts||!v&&this._ts<0)||Ca(this,1),e||t<0&&!_||!v&&!_&&m||(Dt(this,v===m&&0<=t?"onComplete":"onReverseComplete",!0),!this._prom||v<m&&0<this.timeScale()||this._prom())))}return this},e.add=function add(e,i){var n=this;if(t(i)||(i=Ot(this,i,e)),!(e instanceof qt)){if($(e))return e.forEach(function(t){return n.add(t,i)}),this;if(r(e))return this.addLabel(e,i);if(!s(e))return this;e=te.delayedCall(0,e)}return this!==e?Na(this,e,i):this},e.getChildren=function getChildren(t,e,r,i){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===r&&(r=!0),void 0===i&&(i=-X);for(var n=[],a=this._first;a;)a._start>=i&&(a instanceof te?e&&n.push(a):(r&&n.push(a),t&&n.push.apply(n,a.getChildren(!0,e,r)))),a=a._next;return n},e.getById=function getById(t){for(var e=this.getChildren(1,1,1),r=e.length;r--;)if(e[r].vars.id===t)return e[r]},e.remove=function remove(t){return r(t)?this.removeLabel(t):s(t)?this.killTweensOf(t):(t.parent===this&&Ba(this,t),t===this._recent&&(this._recent=this._last),Da(this))},e.totalTime=function totalTime(t,e){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=la(It.time-(0<this._ts?t/this._ts:(this.totalDuration()-t)/-this._ts))),i.prototype.totalTime.call(this,t,e),this._forcing=0,this):this._tTime},e.addLabel=function addLabel(t,e){return this.labels[t]=Ot(this,e),this},e.removeLabel=function removeLabel(t){return delete this.labels[t],this},e.addPause=function addPause(t,e,r){var i=te.delayedCall(0,e||V,r);return i.data="isPause",this._hasPause=1,Na(this,i,Ot(this,t))},e.removePause=function removePause(t){var e=this._first;for(t=Ot(this,t);e;)e._start===t&&"isPause"===e.data&&Ca(e),e=e._next},e.killTweensOf=function killTweensOf(t,e,r){for(var i=this.getTweensOf(t,r),n=i.length;n--;)Wt!==i[n]&&i[n].kill(t,e);return this},e.getTweensOf=function getTweensOf(e,r){for(var i,n=[],a=Pt(e),s=this._first,o=t(r);s;)s instanceof te?na(s._targets,a)&&(o?(!Wt||s._initted&&s._ts)&&s.globalTime(0)<=r&&s.globalTime(s.totalDuration())>r:!r||s.isActive())&&n.push(s):(i=s.getTweensOf(a,r)).length&&n.push.apply(n,i),s=s._next;return n},e.tweenTo=function tweenTo(t,e){e=e||{};var r,i=this,n=Ot(i,t),a=e.startAt,s=e.onStart,o=e.onStartParams,u=e.immediateRender,h=te.to(i,ta({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:n,overwrite:"auto",duration:e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale())||q,onStart:function onStart(){if(i.pause(),!r){var t=e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale());h._dur!==t&&Ua(h,t,0,1).render(h._time,!0,!0),r=1}s&&s.apply(h,o||[])}},e));return u?h.render(0):h},e.tweenFromTo=function tweenFromTo(t,e,r){return this.tweenTo(e,ta({startAt:{time:Ot(this,t)}},r))},e.recent=function recent(){return this._recent},e.nextLabel=function nextLabel(t){return void 0===t&&(t=this._time),ub(this,Ot(this,t))},e.previousLabel=function previousLabel(t){return void 0===t&&(t=this._time),ub(this,Ot(this,t),1)},e.currentLabel=function currentLabel(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+q)},e.shiftChildren=function shiftChildren(t,e,r){void 0===r&&(r=0);var i,n=this._first,a=this.labels;for(t=la(t);n;)n._start>=r&&(n._start+=t,n._end+=t),n=n._next;if(e)for(i in a)a[i]>=r&&(a[i]+=t);return Da(this)},e.invalidate=function invalidate(t){var e=this._first;for(this._lock=0;e;)e.invalidate(t),e=e._next;return i.prototype.invalidate.call(this,t)},e.clear=function clear(t){void 0===t&&(t=!0);for(var e,r=this._first;r;)e=r._next,this.remove(r),r=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),Da(this)},e.totalDuration=function totalDuration(t){var e,r,i,n=0,a=this,s=a._last,o=X;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-t:t));if(a._dirty){for(i=a.parent;s;)e=s._prev,s._dirty&&s.totalDuration(),o<(r=s._start)&&a._sort&&s._ts&&!a._lock?(a._lock=1,Na(a,s,r-s._delay,1)._lock=0):o=r,r<0&&s._ts&&(n-=r,(!i&&!a._dp||i&&i.smoothChildTiming)&&(a._start+=la(r/a._ts),a._time-=r,a._tTime-=r),a.shiftChildren(-r,!1,-Infinity),o=0),s._end>n&&s._ts&&(n=s._end),s=e;Ua(a,a===L&&a._time>n?a._time:n,1,1),a._dirty=0}return a._tDur},Timeline.updateRoot=function updateRoot(t){if(L._ts&&(qa(L,Ja(t,L)),f=It.frame),It.frame>=vt){vt+=N.autoSleep||120;var e=L._first;if((!e||!e._ts)&&N.autoSleep&&It._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||It.sleep()}}},Timeline}(qt);ta(Zt.prototype,{_lock:0,_hasPause:0,_forcing:0});function dc(t,e,i,n,a,o){var u,h,l,f;if(mt[t]&&!1!==(u=new mt[t]).init(a,u.rawVars?e[t]:function _processVars(t,e,i,n,a){if(s(t)&&(t=Gt(t,a,e,i,n)),!v(t)||t.style&&t.nodeType||$(t)||K(t))return r(t)?Gt(t,a,e,i,n):t;var o,u={};for(o in t)u[o]=Gt(t[o],a,e,i,n);return u}(e[t],n,a,o,i),i,n,o)&&(i._pt=h=new we(i._pt,a,t,0,1,u.render,u,0,u.priority),i!==d))for(l=i._ptLookup[i._targets.indexOf(a)],f=u._props.length;f--;)l[u._props[f]]=h;return u}function jc(t,r,e,i){var n,a,s=r.ease||i||"power1.inOut";if($(r))a=e[t]||(e[t]=[]),r.forEach(function(t,e){return a.push({t:e/(r.length-1)*100,v:t,e:s})});else for(n in r)a=e[n]||(e[n]=[]),"ease"===n||a.push({t:parseFloat(t),v:r[n],e:s})}var Wt,Ht,Jt=function _addPropTween(t,e,i,n,a,o,u,h,l,f){s(n)&&(n=n(a||0,t,o));var d,c=t[e],p="get"!==i?i:s(c)?l?t[e.indexOf("set")||!s(t["get"+e.substr(3)])?e:"get"+e.substr(3)](l):t[e]():c,_=s(c)?l?ue:re:ee;if(r(n)&&(~n.indexOf("random(")&&(n=rb(n)),"="===n.charAt(1)&&(!(d=ma(p,n)+(_a(p)||0))&&0!==d||(n=d))),!f||p!==n||Ht)return isNaN(p*n)||""===n?(c||e in t||S(e,n),function _addComplexStringPropTween(t,e,r,i,n,a,s){var o,u,h,l,f,d,c,p,_=new we(this._pt,t,e,0,1,ge,null,n),m=0,g=0;for(_.b=r,_.e=i,r+="",(c=~(i+="").indexOf("random("))&&(i=rb(i)),a&&(a(p=[r,i],t,e),r=p[0],i=p[1]),u=r.match(at)||[];o=at.exec(i);)l=o[0],f=i.substring(m,o.index),h?h=(h+1)%5:"rgba("===f.substr(-5)&&(h=1),l!==u[g++]&&(d=parseFloat(u[g-1])||0,_._pt={_next:_._pt,p:f||1===g?f:",",s:d,c:"="===l.charAt(1)?ma(d,l)-d:parseFloat(l)-d,m:h&&h<4?Math.round:0},m=at.lastIndex);return _.c=m<i.length?i.substring(m,i.length):"",_.fp=s,(st.test(i)||c)&&(_.e=0),this._pt=_}.call(this,t,e,p,n,_,h||N.stringFilter,l)):(d=new we(this._pt,t,e,+p||0,n-(p||0),"boolean"==typeof c?_e:ce,0,_),l&&(d.fp=l),u&&d.modifier(u,this,t),this._pt=d)},Qt=function _initTween(t,e,r){var i,n,a,s,o,u,h,l,f,d,c,p,_,m=t.vars,g=m.ease,v=m.startAt,y=m.immediateRender,T=m.lazy,b=m.onUpdate,x=m.runBackwards,k=m.yoyoEase,O=m.keyframes,M=m.autoRevert,C=t._dur,P=t._startAt,A=t._targets,D=t.parent,S=D&&"nested"===D.data?D.vars.targets:A,z="auto"===t._overwrite&&!F,E=t.timeline;if(!E||O&&g||(g="none"),t._ease=Vt(g,j.ease),t._yEase=k?jt(Vt(!0===k?g:k,j.ease)):0,k&&t._yoyo&&!t._repeat&&(k=t._yEase,t._yEase=t._ease,t._ease=k),t._from=!E&&!!m.runBackwards,!E||O&&!m.stagger){if(p=(l=A[0]?ha(A[0]).harness:0)&&m[l.prop],i=xa(m,ct),P&&(P._zTime<0&&P.progress(1),e<0&&x&&y&&!M?P.render(-1,!0):P.revert(x&&C?ft:lt),P._lazy=0),v){if(Ca(t._startAt=te.set(A,ta({data:"isStart",overwrite:!1,parent:D,immediateRender:!0,lazy:!P&&w(T),startAt:null,delay:0,onUpdate:b&&function(){return Dt(t,"onUpdate")},stagger:0},v))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(I||!y&&!M)&&t._startAt.revert(ft),y&&C&&e<=0&&r<=0)return void(e&&(t._zTime=e))}else if(x&&C&&!P)if(e&&(y=!1),a=ta({overwrite:!1,data:"isFromStart",lazy:y&&!P&&w(T),immediateRender:y,stagger:0,parent:D},i),p&&(a[l.prop]=p),Ca(t._startAt=te.set(A,a)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(I?t._startAt.revert(ft):t._startAt.render(-1,!0)),t._zTime=e,y){if(!e)return}else _initTween(t._startAt,q,q);for(t._pt=t._ptCache=0,T=C&&w(T)||T&&!C,n=0;n<A.length;n++){if(h=(o=A[n])._gsap||ga(A)[n]._gsap,t._ptLookup[n]=d={},_t[h.id]&&pt.length&&oa(),c=S===A?n:S.indexOf(o),l&&!1!==(f=new l).init(o,p||i,t,c,S)&&(t._pt=s=new we(t._pt,o,f.name,0,1,f.render,f,0,f.priority),f._props.forEach(function(t){d[t]=s}),f.priority&&(u=1)),!l||p)for(a in i)mt[a]&&(f=dc(a,i,t,c,o,S))?f.priority&&(u=1):d[a]=s=Jt.call(t,o,a,"get",i[a],c,S,0,m.stringFilter);t._op&&t._op[n]&&t.kill(o,t._op[n]),z&&t._pt&&(Wt=t,L.killTweensOf(o,d,t.globalTime(e)),_=!t.parent,Wt=0),t._pt&&T&&(_t[h.id]=1)}u&&be(t),t._onInit&&t._onInit(t)}t._onUpdate=b,t._initted=(!t._op||t._pt)&&!_,O&&e<=0&&E.render(X,!0,!0)},Gt=function _parseFuncOrString(t,e,i,n,a){return s(t)?t.call(e,i,n,a):r(t)&&~t.indexOf("random(")?rb(t):t},Kt=Tt+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",$t={};ja(Kt+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return $t[t]=1});var te=function(R){function Tween(e,r,i,n){var a;"number"==typeof r&&(i.duration=r,r=i,i=null);var s,o,u,h,l,f,d,c,p=(a=R.call(this,n?r:ya(r))||this).vars,_=p.duration,m=p.delay,g=p.immediateRender,b=p.stagger,x=p.overwrite,k=p.keyframes,O=p.defaults,M=p.scrollTrigger,C=p.yoyoEase,P=r.parent||L,A=($(e)||K(e)?t(e[0]):"length"in r)?[e]:Pt(e);if(a._targets=A.length?ga(A):T("GSAP target "+e+" not found. https://gsap.com",!N.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=x,k||b||y(_)||y(m)){if(r=a.vars,(s=a.timeline=new Zt({data:"nested",defaults:O||{},targets:P&&"nested"===P.data?P.vars.targets:A})).kill(),s.parent=s._dp=_assertThisInitialized(a),s._start=0,b||y(_)||y(m)){if(h=A.length,d=b&&hb(b),v(b))for(l in b)~Kt.indexOf(l)&&((c=c||{})[l]=b[l]);for(o=0;o<h;o++)(u=xa(r,$t)).stagger=0,C&&(u.yoyoEase=C),c&&bt(u,c),f=A[o],u.duration=+Gt(_,_assertThisInitialized(a),o,f,A),u.delay=(+Gt(m,_assertThisInitialized(a),o,f,A)||0)-a._delay,!b&&1===h&&u.delay&&(a._delay=m=u.delay,a._start+=m,u.delay=0),s.to(f,u,d?d(o,f,A):0),s._ease=Bt.none;s.duration()?_=m=0:a.timeline=0}else if(k){ya(ta(s.vars.defaults,{ease:"none"})),s._ease=Vt(k.ease||r.ease||"none");var D,S,z,E=0;if($(k))k.forEach(function(t){return s.to(A,t,">")}),s.duration();else{for(l in u={},k)"ease"===l||"easeEach"===l||jc(l,k[l],u,k.easeEach);for(l in u)for(D=u[l].sort(function(t,e){return t.t-e.t}),o=E=0;o<D.length;o++)(z={ease:(S=D[o]).e,duration:(S.t-(o?D[o-1].t:0))/100*_})[l]=S.v,s.to(A,z,E),E+=z.duration;s.duration()<_&&s.to({},{duration:_-s.duration()})}}_||a.duration(_=s.duration())}else a.timeline=0;return!0!==x||F||(Wt=_assertThisInitialized(a),L.killTweensOf(A),Wt=0),Na(P,_assertThisInitialized(a),i),r.reversed&&a.reverse(),r.paused&&a.paused(!0),(g||!_&&!k&&a._start===la(P._time)&&w(g)&&function _hasNoPausedAncestors(t){return!t||t._ts&&_hasNoPausedAncestors(t.parent)}(_assertThisInitialized(a))&&"nested"!==P.data)&&(a._tTime=-q,a.render(Math.max(0,-m)||0)),M&&Oa(_assertThisInitialized(a),M),a}_inheritsLoose(Tween,R);var e=Tween.prototype;return e.render=function render(t,e,r){var i,n,a,s,o,u,h,l,f,d=this._time,c=this._tDur,p=this._dur,_=t<0,m=c-q<t&&!_?c:t<q?0:t;if(p){if(m!==this._tTime||!t||r||!this._initted&&this._tTime||this._startAt&&this._zTime<0!=_||this._lazy){if(i=m,l=this.timeline,this._repeat){if(s=p+this._rDelay,this._repeat<-1&&_)return this.totalTime(100*s+t,e,r);if(i=la(m%s),m===c?(a=this._repeat,i=p):(a=~~(o=la(m/s)))&&a===o?(i=p,a--):p<i&&(i=p),(u=this._yoyo&&1&a)&&(f=this._yEase,i=p-i),o=wt(this._tTime,s),i===d&&!r&&this._initted&&a===o)return this._tTime=m,this;a!==o&&(l&&this._yEase&&Tb(l,u),this.vars.repeatRefresh&&!u&&!this._lock&&i!==s&&this._initted&&(this._lock=r=1,this.render(la(s*a),!0).invalidate()._lock=0))}if(!this._initted){if(Pa(this,_?t:i,r,e,m))return this._tTime=0,this;if(!(d===this._time||r&&this.vars.repeatRefresh&&a!==o))return this;if(p!==this._dur)return this.render(t,e,r)}if(this._tTime=m,this._time=i,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=h=(f||this._ease)(i/p),this._from&&(this.ratio=h=1-h),!d&&m&&!e&&!o&&(Dt(this,"onStart"),this._tTime!==m))return this;for(n=this._pt;n;)n.r(h,n.d),n=n._next;l&&l.render(t<0?t:l._dur*l._ease(i/this._dur),e,r)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(_&&Fa(this,t,0,r),Dt(this,"onUpdate")),this._repeat&&a!==o&&this.vars.onRepeat&&!e&&this.parent&&Dt(this,"onRepeat"),m!==this._tDur&&m||this._tTime!==m||(_&&!this._onUpdate&&Fa(this,t,0,!0),!t&&p||!(m===this._tDur&&0<this._ts||!m&&this._ts<0)||Ca(this,1),e||_&&!d||!(m||d||u)||(Dt(this,m===c?"onComplete":"onReverseComplete",!0),!this._prom||m<c&&0<this.timeScale()||this._prom()))}}else!function _renderZeroDurationTween(t,e,r,i){var n,a,s,o=t.ratio,u=e<0||!e&&(!t._start&&function _parentPlayheadIsBeforeStart(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||_parentPlayheadIsBeforeStart(e))}(t)&&(t._initted||!xt(t))||(t._ts<0||t._dp._ts<0)&&!xt(t))?0:1,h=t._rDelay,l=0;if(h&&t._repeat&&(l=Mt(0,t._tDur,e),a=wt(l,h),t._yoyo&&1&a&&(u=1-u),a!==wt(t._tTime,h)&&(o=1-u,t.vars.repeatRefresh&&t._initted&&t.invalidate())),u!==o||I||i||t._zTime===q||!e&&t._zTime){if(!t._initted&&Pa(t,e,i,r,l))return;for(s=t._zTime,t._zTime=e||(r?q:0),r=r||e&&!s,t.ratio=u,t._from&&(u=1-u),t._time=0,t._tTime=l,n=t._pt;n;)n.r(u,n.d),n=n._next;e<0&&Fa(t,e,0,!0),t._onUpdate&&!r&&Dt(t,"onUpdate"),l&&t._repeat&&!r&&t.parent&&Dt(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===u&&(u&&Ca(t,1),r||I||(Dt(t,u?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,r);return this},e.targets=function targets(){return this._targets},e.invalidate=function invalidate(t){return t&&this.vars.runBackwards||(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),R.prototype.invalidate.call(this,t)},e.resetTo=function resetTo(t,e,r,i,n){c||It.wake(),this._ts||this.play();var a,s=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||Qt(this,s),a=this._ease(s/this._dur),function _updatePropTweens(t,e,r,i,n,a,s,o){var u,h,l,f,d=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!d)for(d=t._ptCache[e]=[],l=t._ptLookup,f=t._targets.length;f--;){if((u=l[f][e])&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return Ht=1,t.vars[e]="+=0",Qt(t,s),Ht=0,o?T(e+" not eligible for reset"):1;d.push(u)}for(f=d.length;f--;)(u=(h=d[f])._pt||h).s=!i&&0!==i||n?u.s+(i||0)+a*u.c:i,u.c=r-u.s,h.e&&(h.e=ka(r)+_a(h.e)),h.b&&(h.b=u.s+_a(h.b))}(this,t,e,r,i,a,s,n)?this.resetTo(t,e,r,i,1):(La(this,0),this.parent||Aa(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function kill(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?wb(this):this.scrollTrigger&&this.scrollTrigger.kill(!!I),this;if(this.timeline){var i=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Wt&&!0!==Wt.vars.overwrite)._first||wb(this),this.parent&&i!==this.timeline.totalDuration()&&Ua(this,this._dur*this.timeline._tDur/i,0,1),this}var n,a,s,o,u,h,l,f=this._targets,d=t?Pt(t):f,c=this._ptLookup,p=this._pt;if((!e||"all"===e)&&function _arraysMatch(t,e){for(var r=t.length,i=r===e.length;i&&r--&&t[r]===e[r];);return r<0}(f,d))return"all"===e&&(this._pt=0),wb(this);for(n=this._op=this._op||[],"all"!==e&&(r(e)&&(u={},ja(e,function(t){return u[t]=1}),e=u),e=function _addAliasesToVars(t,e){var r,i,n,a,s=t[0]?ha(t[0]).harness:0,o=s&&s.aliases;if(!o)return e;for(i in r=bt({},e),o)if(i in r)for(n=(a=o[i].split(",")).length;n--;)r[a[n]]=r[i];return r}(f,e)),l=f.length;l--;)if(~d.indexOf(f[l]))for(u in a=c[l],"all"===e?(n[l]=e,o=a,s={}):(s=n[l]=n[l]||{},o=e),o)(h=a&&a[u])&&("kill"in h.d&&!0!==h.d.kill(u)||Ba(this,h,"_pt"),delete a[u]),"all"!==s&&(s[u]=1);return this._initted&&!this._pt&&p&&wb(this),this},Tween.to=function to(t,e,r){return new Tween(t,e,r)},Tween.from=function from(t,e){return Ya(1,arguments)},Tween.delayedCall=function delayedCall(t,e,r,i){return new Tween(e,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:e,onReverseComplete:e,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},Tween.fromTo=function fromTo(t,e,r){return Ya(2,arguments)},Tween.set=function set(t,e){return e.duration=0,e.repeatDelay||(e.repeat=0),new Tween(t,e)},Tween.killTweensOf=function killTweensOf(t,e,r){return L.killTweensOf(t,e,r)},Tween}(qt);ta(te.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ja("staggerTo,staggerFrom,staggerFromTo",function(r){te[r]=function(){var t=new Zt,e=Ct.call(arguments,0);return e.splice("staggerFromTo"===r?5:4,0,0),t[r].apply(t,e)}});function rc(t,e,r){return t.setAttribute(e,r)}function zc(t,e,r,i){i.mSet(t,e,i.m.call(i.tween,r,i.mt),i)}var ee=function _setterPlain(t,e,r){return t[e]=r},re=function _setterFunc(t,e,r){return t[e](r)},ue=function _setterFuncWithParam(t,e,r,i){return t[e](i.fp,r)},le=function _getSetter(t,e){return s(t[e])?re:u(t[e])&&t.setAttribute?rc:ee},ce=function _renderPlain(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},_e=function _renderBoolean(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},ge=function _renderComplexString(t,e){var r=e._pt,i="";if(!t&&e.b)i=e.b;else if(1===t&&e.e)i=e.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*t):Math.round(1e4*(r.s+r.c*t))/1e4)+i,r=r._next;i+=e.c}e.set(e.t,e.p,i,e)},ve=function _renderPropTweens(t,e){for(var r=e._pt;r;)r.r(t,r.d),r=r._next},ye=function _addPluginModifier(t,e,r,i){for(var n,a=this._pt;a;)n=a._next,a.p===i&&a.modifier(t,e,r),a=n},Te=function _killPropTweensOf(t){for(var e,r,i=this._pt;i;)r=i._next,i.p===t&&!i.op||i.op===t?Ba(this,i,"_pt"):i.dep||(e=1),i=r;return!e},be=function _sortPropTweensByPriority(t){for(var e,r,i,n,a=t._pt;a;){for(e=a._next,r=i;r&&r.pr>a.pr;)r=r._next;(a._prev=r?r._prev:n)?a._prev._next=a:i=a,(a._next=r)?r._prev=a:n=a,a=e}t._pt=i},we=(PropTween.prototype.modifier=function modifier(t,e,r){this.mSet=this.mSet||this.set,this.set=zc,this.m=t,this.mt=r,this.tween=e},PropTween);function PropTween(t,e,r,i,n,a,s,o,u){this.t=e,this.s=i,this.c=n,this.p=r,this.r=a||ce,this.d=s||this,this.set=o||ee,this.pr=u||0,(this._next=t)&&(t._prev=this)}ja(Tt+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(t){return ct[t]=1}),ht.TweenMax=ht.TweenLite=te,ht.TimelineLite=ht.TimelineMax=Zt,L=new Zt({sortChildren:!1,defaults:j,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),N.stringFilter=Ib;function Hc(t){return(Oe[t]||Me).map(function(t){return t()})}function Ic(){var t=Date.now(),o=[];2<t-Ce&&(Hc("matchMediaInit"),ke.forEach(function(t){var e,r,i,n,a=t.queries,s=t.conditions;for(r in a)(e=h.matchMedia(a[r]).matches)&&(i=1),e!==s[r]&&(s[r]=e,n=1);n&&(t.revert(),i&&o.push(t))}),Hc("matchMediaRevert"),o.forEach(function(e){return e.onMatch(e,function(t){return e.add(null,t)})}),Ce=t,Hc("matchMedia"))}var xe,ke=[],Oe={},Me=[],Ce=0,Pe=0,De=((xe=Context.prototype).add=function add(t,i,n){function Jw(){var t,e=l,r=a.selector;return e&&e!==a&&e.data.push(a),n&&(a.selector=fb(n)),l=a,t=i.apply(a,arguments),s(t)&&a._r.push(t),l=e,a.selector=r,a.isReverted=!1,t}s(t)&&(n=i,i=t,t=s);var a=this;return a.last=Jw,t===s?Jw(a,function(t){return a.add(null,t)}):t?a[t]=Jw:Jw},xe.ignore=function ignore(t){var e=l;l=null,t(this),l=e},xe.getTweens=function getTweens(){var e=[];return this.data.forEach(function(t){return t instanceof Context?e.push.apply(e,t.getTweens()):t instanceof te&&!(t.parent&&"nested"===t.parent.data)&&e.push(t)}),e},xe.clear=function clear(){this._r.length=this.data.length=0},xe.kill=function kill(i,t){var n=this;if(i?function(){for(var t,e=n.getTweens(),r=n.data.length;r--;)"isFlip"===(t=n.data[r]).data&&(t.revert(),t.getChildren(!0,!0,!1).forEach(function(t){return e.splice(e.indexOf(t),1)}));for(e.map(function(t){return{g:t._dur||t._delay||t._sat&&!t._sat.vars.immediateRender?t.globalTime(0):-1/0,t:t}}).sort(function(t,e){return e.g-t.g||-1/0}).forEach(function(t){return t.t.revert(i)}),r=n.data.length;r--;)(t=n.data[r])instanceof Zt?"nested"!==t.data&&(t.scrollTrigger&&t.scrollTrigger.revert(),t.kill()):t instanceof te||!t.revert||t.revert(i);n._r.forEach(function(t){return t(i,n)}),n.isReverted=!0}():this.data.forEach(function(t){return t.kill&&t.kill()}),this.clear(),t)for(var e=ke.length;e--;)ke[e].id===this.id&&ke.splice(e,1)},xe.revert=function revert(t){this.kill(t||{})},Context);function Context(t,e){this.selector=e&&fb(e),this.data=[],this._r=[],this.isReverted=!1,this.id=Pe++,t&&this.add(t)}var Se,Ee=((Se=MatchMedia.prototype).add=function add(t,e,r){v(t)||(t={matches:t});var i,n,a,s=new De(0,r||this.scope),o=s.conditions={};for(n in l&&!s.selector&&(s.selector=l.selector),this.contexts.push(s),e=s.add("onMatch",e),s.queries=t)"all"===n?a=1:(i=h.matchMedia(t[n]))&&(ke.indexOf(s)<0&&ke.push(s),(o[n]=i.matches)&&(a=1),i.addListener?i.addListener(Ic):i.addEventListener("change",Ic));return a&&e(s,function(t){return s.add(null,t)}),this},Se.revert=function revert(t){this.kill(t||{})},Se.kill=function kill(e){this.contexts.forEach(function(t){return t.kill(e,!0)})},MatchMedia);function MatchMedia(t){this.contexts=[],this.scope=t,l&&l.data.push(this)}var Re={registerPlugin:function registerPlugin(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e.forEach(function(t){return zb(t)})},timeline:function timeline(t){return new Zt(t)},getTweensOf:function getTweensOf(t,e){return L.getTweensOf(t,e)},getProperty:function getProperty(i,t,e,n){r(i)&&(i=Pt(i)[0]);var a=ha(i||{}).get,s=e?sa:ra;return"native"===e&&(e=""),i?t?s((mt[t]&&mt[t].get||a)(i,t,e,n)):function(t,e,r){return s((mt[t]&&mt[t].get||a)(i,t,e,r))}:i},quickSetter:function quickSetter(r,e,i){if(1<(r=Pt(r)).length){var n=r.map(function(t){return Fe.quickSetter(t,e,i)}),a=n.length;return function(t){for(var e=a;e--;)n[e](t)}}r=r[0]||{};var s=mt[e],o=ha(r),u=o.harness&&(o.harness.aliases||{})[e]||e,h=s?function(t){var e=new s;d._pt=0,e.init(r,i?t+i:t,d,0,[r]),e.render(1,e),d._pt&&ve(1,d)}:o.set(r,u);return s?h:function(t){return h(r,u,i?t+i:t,o,1)}},quickTo:function quickTo(t,i,e){function by(t,e,r){return n.resetTo(i,t,e,r)}var r,n=Fe.to(t,ta(((r={})[i]="+=0.1",r.paused=!0,r.stagger=0,r),e||{}));return by.tween=n,by},isTweening:function isTweening(t){return 0<L.getTweensOf(t,!0).length},defaults:function defaults(t){return t&&t.ease&&(t.ease=Vt(t.ease,j.ease)),wa(j,t||{})},config:function config(t){return wa(N,t||{})},registerEffect:function registerEffect(t){var i=t.name,n=t.effect,e=t.plugins,a=t.defaults,r=t.extendTimeline;(e||"").split(",").forEach(function(t){return t&&!mt[t]&&!ht[t]&&T(i+" effect requires "+t+" plugin.")}),gt[i]=function(t,e,r){return n(Pt(t),ta(e||{},a),r)},r&&(Zt.prototype[i]=function(t,e,r){return this.add(gt[i](t,v(e)?e:(r=e)&&{},this),r)})},registerEase:function registerEase(t,e){Bt[t]=Vt(e)},parseEase:function parseEase(t,e){return arguments.length?Vt(t,e):Bt},getById:function getById(t){return L.getById(t)},exportRoot:function exportRoot(t,e){void 0===t&&(t={});var r,i,n=new Zt(t);for(n.smoothChildTiming=w(t.smoothChildTiming),L.remove(n),n._dp=0,n._time=n._tTime=L._time,r=L._first;r;)i=r._next,!e&&!r._dur&&r instanceof te&&r.vars.onComplete===r._targets[0]||Na(n,r,r._start-r._delay),r=i;return Na(L,n,0),n},context:function context(t,e){return t?new De(t,e):l},matchMedia:function matchMedia(t){return new Ee(t)},matchMediaRefresh:function matchMediaRefresh(){return ke.forEach(function(t){var e,r,i=t.conditions;for(r in i)i[r]&&(i[r]=!1,e=1);e&&t.revert()})||Ic()},addEventListener:function addEventListener(t,e){var r=Oe[t]||(Oe[t]=[]);~r.indexOf(e)||r.push(e)},removeEventListener:function removeEventListener(t,e){var r=Oe[t],i=r&&r.indexOf(e);0<=i&&r.splice(i,1)},utils:{wrap:function wrap(e,t,r){var i=t-e;return $(e)?ob(e,wrap(0,e.length),t):Za(r,function(t){return(i+(t-e)%i)%i+e})},wrapYoyo:function wrapYoyo(e,t,r){var i=t-e,n=2*i;return $(e)?ob(e,wrapYoyo(0,e.length-1),t):Za(r,function(t){return e+(i<(t=(n+(t-e)%n)%n||0)?n-t:t)})},distribute:hb,random:kb,snap:jb,normalize:function normalize(t,e,r){return At(t,e,0,1,r)},getUnit:_a,clamp:function clamp(e,r,t){return Za(t,function(t){return Mt(e,r,t)})},splitColor:Db,toArray:Pt,selector:fb,mapRange:At,pipe:function pipe(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return e.reduce(function(t,e){return e(t)},t)}},unitize:function unitize(e,r){return function(t){return e(parseFloat(t))+(r||_a(t))}},interpolate:function interpolate(e,i,t,n){var a=isNaN(e+i)?0:function(t){return(1-t)*e+t*i};if(!a){var s,o,u,h,l,f=r(e),d={};if(!0===t&&(n=1)&&(t=null),f)e={p:e},i={p:i};else if($(e)&&!$(i)){for(u=[],h=e.length,l=h-2,o=1;o<h;o++)u.push(interpolate(e[o-1],e[o]));h--,a=function func(t){t*=h;var e=Math.min(l,~~t);return u[e](t-e)},t=i}else n||(e=bt($(e)?[]:{},e));if(!u){for(s in i)Jt.call(d,e,s,"get",i[s]);a=function func(t){return ve(t,d)||(f?e.p:e)}}}return Za(t,a)},shuffle:gb},install:R,effects:gt,ticker:It,updateRoot:Zt.updateRoot,plugins:mt,globalTimeline:L,core:{PropTween:we,globals:U,Tween:te,Timeline:Zt,Animation:qt,getCache:ha,_removeLinkedListItem:Ba,reverting:function reverting(){return I},context:function context(t){return t&&l&&(l.data.push(t),t._ctx=l),l},suppressOverwrites:function suppressOverwrites(t){return F=t}}};ja("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Re[t]=te[t]}),It.add(Zt.updateRoot),d=Re.to({},{duration:0});function Mc(t,e){for(var r=t._pt;r&&r.p!==e&&r.op!==e&&r.fp!==e;)r=r._next;return r}function Oc(t,a){return{name:t,headless:1,rawVars:1,init:function init(t,n,e){e._onInit=function(t){var e,i;if(r(n)&&(e={},ja(n,function(t){return e[t]=1}),n=e),a){for(i in e={},n)e[i]=a(n[i]);n=e}!function _addModifiers(t,e){var r,i,n,a=t._targets;for(r in e)for(i=a.length;i--;)(n=(n=t._ptLookup[i][r])&&n.d)&&(n._pt&&(n=Mc(n,r)),n&&n.modifier&&n.modifier(e[r],t,a[i],r))}(t,n)}}}}var Fe=Re.registerPlugin({name:"attr",init:function init(t,e,r,i,n){var a,s,o;for(a in this.tween=r,e)o=t.getAttribute(a)||"",(s=this.add(t,"setAttribute",(o||0)+"",e[a],i,n,0,0,a)).op=a,s.b=o,this._props.push(a)},render:function render(t,e){for(var r=e._pt;r;)I?r.set(r.t,r.p,r.b,r):r.r(t,r.d),r=r._next}},{name:"endArray",headless:1,init:function init(t,e){for(var r=e.length;r--;)this.add(t,r,t[r]||0,e[r],0,0,0,0,0,1)}},Oc("roundProps",ib),Oc("modifiers"),Oc("snap",jb))||Re;te.version=Zt.version=Fe.version="3.14.2",o=1,x()&&Lt();function yd(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)}function zd(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)}function Ad(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)}function Bd(t,e){return e.set(e.t,e.p,1===t?e.e:t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)}function Cd(t,e){var r=e.s+e.c*t;e.set(e.t,e.p,~~(r+(r<0?-.5:.5))+e.u,e)}function Dd(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)}function Ed(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)}function Fd(t,e,r){return t.style[e]=r}function Gd(t,e,r){return t.style.setProperty(e,r)}function Hd(t,e,r){return t._gsap[e]=r}function Id(t,e,r){return t._gsap.scaleX=t._gsap.scaleY=r}function Jd(t,e,r,i,n){var a=t._gsap;a.scaleX=a.scaleY=r,a.renderTransform(n,a)}function Kd(t,e,r,i,n){var a=t._gsap;a[e]=r,a.renderTransform(n,a)}function Nd(t,e){var r=this,i=this.target,n=i.style,a=i._gsap;if(t in hr&&n){if(this.tfm=this.tfm||{},"transform"===t)return mr.transform.split(",").forEach(function(t){return Nd.call(r,t,e)});if(~(t=mr[t]||t).indexOf(",")?t.split(",").forEach(function(t){return r.tfm[t]=xr(i,t)}):this.tfm[t]=a.x?a[t]:xr(i,t),t===vr&&(this.tfm.zOrigin=a.zOrigin),0<=this.props.indexOf(gr))return;a.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(vr,e,"")),t=gr}(n||e)&&this.props.push(t,e,n[t])}function Od(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))}function Pd(){var t,e,r=this.props,i=this.target,n=i.style,a=i._gsap;for(t=0;t<r.length;t+=3)r[t+1]?2===r[t+1]?i[r[t]](r[t+2]):i[r[t]]=r[t+2]:r[t+2]?n[r[t]]=r[t+2]:n.removeProperty("--"===r[t].substr(0,2)?r[t]:r[t].replace(cr,"-$1").toLowerCase());if(this.tfm){for(e in this.tfm)a[e]=this.tfm[e];a.svg&&(a.renderTransform(),i.setAttribute("data-svg-origin",this.svgo||"")),(t=Ue())&&t.isStart||n[gr]||(Od(n),a.zOrigin&&n[vr]&&(n[vr]+=" "+a.zOrigin+"px",a.zOrigin=0,a.renderTransform()),a.uncache=1)}}function Qd(t,e){var r={target:t,props:[],revert:Pd,save:Nd};return t._gsap||Fe.core.getCache(t),e&&t.style&&t.nodeType&&e.split(",").forEach(function(t){return r.save(t)}),r}function Sd(t,e){var r=Le.createElementNS?Le.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Le.createElement(t);return r&&r.style?r:Le.createElement(t)}function Td(t,e,r){var i=getComputedStyle(t);return i[e]||i.getPropertyValue(e.replace(cr,"-$1").toLowerCase())||i.getPropertyValue(e)||!r&&Td(t,Tr(e)||e,1)||""}function Wd(){(function _windowExists(){return"undefined"!=typeof window})()&&window.document&&(Ie=window,Le=Ie.document,Ye=Le.documentElement,je=Sd("div")||{style:{}},Sd("div"),gr=Tr(gr),vr=gr+"Origin",je.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Xe=!!Tr("perspective"),Ue=Fe.core.reverting,Ne=1)}function Xd(t){var e,r=t.ownerSVGElement,i=Sd("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=t.cloneNode(!0);n.style.display="block",i.appendChild(n),Ye.appendChild(i);try{e=n.getBBox()}catch(t){}return i.removeChild(n),Ye.removeChild(i),e}function Yd(t,e){for(var r=e.length;r--;)if(t.hasAttribute(e[r]))return t.getAttribute(e[r])}function Zd(e){var r,i;try{r=e.getBBox()}catch(t){r=Xd(e),i=1}return r&&(r.width||r.height)||i||(r=Xd(e)),!r||r.width||r.x||r.y?r:{x:+Yd(e,["x","cx","x1"])||0,y:+Yd(e,["y","cy","y1"])||0,width:0,height:0}}function $d(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!Zd(t))}function _d(t,e){if(e){var r,i=t.style;e in hr&&e!==vr&&(e=gr),i.removeProperty?("ms"!==(r=e.substr(0,2))&&"webkit"!==e.substr(0,6)||(e="-"+e),i.removeProperty("--"===r?e:e.replace(cr,"-$1").toLowerCase())):i.removeAttribute(e)}}function ae(t,e,r,i,n,a){var s=new we(t._pt,e,r,0,1,a?Ed:Dd);return(t._pt=s).b=i,s.e=n,t._props.push(r),s}function de(t,e,r,i){var n,a,s,o,u=parseFloat(r)||0,h=(r+"").trim().substr((u+"").length)||"px",l=je.style,f=pr.test(e),d="svg"===t.tagName.toLowerCase(),c=(d?"client":"offset")+(f?"Width":"Height"),p="px"===i,_="%"===i;if(i===h||!u||br[i]||br[h])return u;if("px"===h||p||(u=de(t,e,r,"px")),o=t.getCTM&&$d(t),(_||"%"===h)&&(hr[e]||~e.indexOf("adius")))return n=o?t.getBBox()[f?"width":"height"]:t[c],ka(_?u/n*100:u/100*n);if(l[f?"width":"height"]=100+(p?h:i),a="rem"!==i&&~e.indexOf("adius")||"em"===i&&t.appendChild&&!d?t:t.parentNode,o&&(a=(t.ownerSVGElement||{}).parentNode),a&&a!==Le&&a.appendChild||(a=Le.body),(s=a._gsap)&&_&&s.width&&f&&s.time===It.time&&!s.uncache)return ka(u/s.width*100);if(!_||"height"!==e&&"width"!==e)!_&&"%"!==h||wr[Td(a,"display")]||(l.position=Td(t,"position")),a===t&&(l.position="static"),a.appendChild(je),n=je[c],a.removeChild(je),l.position="absolute";else{var m=t.style[e];t.style[e]=100+i,n=t[c],m?t.style[e]=m:_d(t,e)}return f&&_&&((s=ha(a)).time=It.time,s.width=a[c]),ka(p?n*u/100:n&&u?100/n*u:0)}function fe(t,e,r,i){if(!r||"none"===r){var n=Tr(e,t,1),a=n&&Td(t,n,1);a&&a!==r?(e=n,r=a):"borderColor"===e&&(r=Td(t,"borderTopColor"))}var s,o,u,h,l,f,d,c,p,_,m,g=new we(this._pt,t.style,e,0,1,ge),v=0,y=0;if(g.b=r,g.e=i,r+="","var(--"===(i+="").substring(0,6)&&(i=Td(t,i.substring(4,i.indexOf(")")))),"auto"===i&&(f=t.style[e],t.style[e]=i,i=Td(t,e)||i,f?t.style[e]=f:_d(t,e)),Ib(s=[r,i]),i=s[1],u=(r=s[0]).match(nt)||[],(i.match(nt)||[]).length){for(;o=nt.exec(i);)d=o[0],p=i.substring(v,o.index),l?l=(l+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(l=1),d!==(f=u[y++]||"")&&(h=parseFloat(f)||0,m=f.substr((h+"").length),"="===d.charAt(1)&&(d=ma(h,d)+m),c=parseFloat(d),_=d.substr((c+"").length),v=nt.lastIndex-_.length,_||(_=_||N.units[e]||m,v===i.length&&(i+=_,g.e+=_)),m!==_&&(h=de(t,e,f,_)||0),g._pt={_next:g._pt,p:p||1===y?p:",",s:h,c:c-h,m:l&&l<4||"zIndex"===e?Math.round:0});g.c=v<i.length?i.substring(v,i.length):""}else g.r="display"===e&&"none"===i?Ed:Dd;return st.test(i)&&(g.e=0),this._pt=g}function he(t){var e=t.split(" "),r=e[0],i=e[1]||"50%";return"top"!==r&&"bottom"!==r&&"left"!==i&&"right"!==i||(t=r,r=i,i=t),e[0]=kr[r]||r,e[1]=kr[i]||i,e.join(" ")}function ie(t,e){if(e.tween&&e.tween._time===e.tween._dur){var r,i,n,a=e.t,s=a.style,o=e.u,u=a._gsap;if("all"===o||!0===o)s.cssText="",i=1;else for(n=(o=o.split(",")).length;-1<--n;)r=o[n],hr[r]&&(i=1,r="transformOrigin"===r?vr:gr),_d(a,r);i&&(_d(a,gr),u&&(u.svg&&a.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",Pr(a,1),u.uncache=1,Od(s)))}}function me(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t}function ne(t){var e=Td(t,gr);return me(e)?Mr:e.substr(7).match(it).map(ka)}function oe(t,e){var r,i,n,a,s=t._gsap||ha(t),o=t.style,u=ne(t);return s.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(u=[(n=t.transform.baseVal.consolidate().matrix).a,n.b,n.c,n.d,n.e,n.f]).join(",")?Mr:u:(u!==Mr||t.offsetParent||t===Ye||s.svg||(n=o.display,o.display="block",(r=t.parentNode)&&(t.offsetParent||t.getBoundingClientRect().width)||(a=1,i=t.nextElementSibling,Ye.appendChild(t)),u=ne(t),n?o.display=n:_d(t,"display"),a&&(i?r.insertBefore(t,i):r?r.appendChild(t):Ye.removeChild(t))),e&&6<u.length?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)}function pe(t,e,r,i,n,a){var s,o,u,h=t._gsap,l=n||oe(t,!0),f=h.xOrigin||0,d=h.yOrigin||0,c=h.xOffset||0,p=h.yOffset||0,_=l[0],m=l[1],g=l[2],v=l[3],y=l[4],T=l[5],b=e.split(" "),w=parseFloat(b[0])||0,x=parseFloat(b[1])||0;r?l!==Mr&&(o=_*v-m*g)&&(u=w*(-m/o)+x*(_/o)-(_*T-m*y)/o,w=w*(v/o)+x*(-g/o)+(g*T-v*y)/o,x=u):(w=(s=Zd(t)).x+(~b[0].indexOf("%")?w/100*s.width:w),x=s.y+(~(b[1]||b[0]).indexOf("%")?x/100*s.height:x)),i||!1!==i&&h.smooth?(y=w-f,T=x-d,h.xOffset=c+(y*_+T*g)-y,h.yOffset=p+(y*m+T*v)-T):h.xOffset=h.yOffset=0,h.xOrigin=w,h.yOrigin=x,h.smooth=!!i,h.origin=e,h.originIsAbsolute=!!r,t.style[vr]="0px 0px",a&&(ae(a,h,"xOrigin",f,w),ae(a,h,"yOrigin",d,x),ae(a,h,"xOffset",c,h.xOffset),ae(a,h,"yOffset",p,h.yOffset)),t.setAttribute("data-svg-origin",w+" "+x)}function se(t,e,r){var i=_a(e);return ka(parseFloat(e)+parseFloat(de(t,"x",r+"px",i)))+i}function ze(t,e,i,n,a){var s,o,u=360,h=r(a),l=parseFloat(a)*(h&&~a.indexOf("rad")?lr:1)-n,f=n+l+"deg";return h&&("short"===(s=a.split("_")[1])&&(l%=u)!==l%180&&(l+=l<0?u:-u),"cw"===s&&l<0?l=(l+36e9)%u-~~(l/u)*u:"ccw"===s&&0<l&&(l=(l-36e9)%u-~~(l/u)*u)),t._pt=o=new we(t._pt,e,i,n,l,zd),o.e=f,o.u="deg",t._props.push(i),o}function Ae(t,e){for(var r in e)t[r]=e[r];return t}function Be(t,e,r){var i,n,a,s,o,u,h,l=Ae({},r._gsap),f=r.style;for(n in l.svg?(a=r.getAttribute("transform"),r.setAttribute("transform",""),f[gr]=e,i=Pr(r,1),_d(r,gr),r.setAttribute("transform",a)):(a=getComputedStyle(r)[gr],f[gr]=e,i=Pr(r,1),f[gr]=a),hr)(a=l[n])!==(s=i[n])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(n)<0&&(o=_a(a)!==(h=_a(s))?de(r,n,a,h):parseFloat(a),u=parseFloat(s),t._pt=new we(t._pt,i,n,o,u-o,yd),t._pt.u=h||0,t._props.push(n));Ae(i,l)}var Ie,Le,Ye,Ne,je,Ve,Ue,Xe,qe=Bt.Power0,Ze=Bt.Power1,We=Bt.Power2,He=Bt.Power3,Je=Bt.Power4,Qe=Bt.Linear,Ge=Bt.Quad,Ke=Bt.Cubic,$e=Bt.Quart,tr=Bt.Quint,er=Bt.Strong,rr=Bt.Elastic,ir=Bt.Back,nr=Bt.SteppedEase,ar=Bt.Bounce,sr=Bt.Sine,or=Bt.Expo,ur=Bt.Circ,hr={},lr=180/Math.PI,fr=Math.PI/180,dr=Math.atan2,cr=/([A-Z])/g,pr=/(left|right|width|margin|padding|x)/i,_r=/[\s,\(]\S/,mr={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},gr="transform",vr=gr+"Origin",yr="O,Moz,ms,Ms,Webkit".split(","),Tr=function _checkPropPrefix(t,e,r){var i=(e||je).style,n=5;if(t in i&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);n--&&!(yr[n]+t in i););return n<0?null:(3===n?"ms":0<=n?yr[n]:"")+t},br={deg:1,rad:1,turn:1},wr={grid:1,flex:1},xr=function _get(t,e,r,i){var n;return Ne||Wd(),e in mr&&"transform"!==e&&~(e=mr[e]).indexOf(",")&&(e=e.split(",")[0]),hr[e]&&"transform"!==e?(n=Pr(t,i),n="transformOrigin"!==e?n[e]:n.svg?n.origin:Ar(Td(t,vr))+" "+n.zOrigin+"px"):(n=t.style[e])&&"auto"!==n&&!i&&!~(n+"").indexOf("calc(")||(n=Or[e]&&Or[e](t,e,r)||Td(t,e)||ia(t,e)||("opacity"===e?1:0)),r&&!~(n+"").trim().indexOf(" ")?de(t,e,n,r)+r:n},kr={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Or={clearProps:function clearProps(t,e,r,i,n){if("isFromStart"!==n.data){var a=t._pt=new we(t._pt,e,r,0,0,ie);return a.u=i,a.pr=-10,a.tween=n,t._props.push(r),1}}},Mr=[1,0,0,1,0,0],Cr={},Pr=function _parseTransform(t,e){var r=t._gsap||new Xt(t);if("x"in r&&!e&&!r.uncache)return r;var i,n,a,s,o,u,h,l,f,d,c,p,_,m,g,v,y,T,b,w,x,k,O,M,C,P,A,D,S,z,E,R,F=t.style,I=r.scaleX<0,L="deg",B=getComputedStyle(t),Y=Td(t,vr)||"0";return i=n=a=u=h=l=f=d=c=0,s=o=1,r.svg=!(!t.getCTM||!$d(t)),B.translate&&("none"===B.translate&&"none"===B.scale&&"none"===B.rotate||(F[gr]=("none"!==B.translate?"translate3d("+(B.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==B.rotate?"rotate("+B.rotate+") ":"")+("none"!==B.scale?"scale("+B.scale.split(" ").join(",")+") ":"")+("none"!==B[gr]?B[gr]:"")),F.scale=F.rotate=F.translate="none"),m=oe(t,r.svg),r.svg&&(M=r.uncache?(C=t.getBBox(),Y=r.xOrigin-C.x+"px "+(r.yOrigin-C.y)+"px",""):!e&&t.getAttribute("data-svg-origin"),pe(t,M||Y,!!M||r.originIsAbsolute,!1!==r.smooth,m)),p=r.xOrigin||0,_=r.yOrigin||0,m!==Mr&&(T=m[0],b=m[1],w=m[2],x=m[3],i=k=m[4],n=O=m[5],6===m.length?(s=Math.sqrt(T*T+b*b),o=Math.sqrt(x*x+w*w),u=T||b?dr(b,T)*lr:0,(f=w||x?dr(w,x)*lr+u:0)&&(o*=Math.abs(Math.cos(f*fr))),r.svg&&(i-=p-(p*T+_*w),n-=_-(p*b+_*x))):(R=m[6],z=m[7],A=m[8],D=m[9],S=m[10],E=m[11],i=m[12],n=m[13],a=m[14],h=(g=dr(R,S))*lr,g&&(M=k*(v=Math.cos(-g))+A*(y=Math.sin(-g)),C=O*v+D*y,P=R*v+S*y,A=k*-y+A*v,D=O*-y+D*v,S=R*-y+S*v,E=z*-y+E*v,k=M,O=C,R=P),l=(g=dr(-w,S))*lr,g&&(v=Math.cos(-g),E=x*(y=Math.sin(-g))+E*v,T=M=T*v-A*y,b=C=b*v-D*y,w=P=w*v-S*y),u=(g=dr(b,T))*lr,g&&(M=T*(v=Math.cos(g))+b*(y=Math.sin(g)),C=k*v+O*y,b=b*v-T*y,O=O*v-k*y,T=M,k=C),h&&359.9<Math.abs(h)+Math.abs(u)&&(h=u=0,l=180-l),s=ka(Math.sqrt(T*T+b*b+w*w)),o=ka(Math.sqrt(O*O+R*R)),g=dr(k,O),f=2e-4<Math.abs(g)?g*lr:0,c=E?1/(E<0?-E:E):0),r.svg&&(M=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!me(Td(t,gr)),M&&t.setAttribute("transform",M))),90<Math.abs(f)&&Math.abs(f)<270&&(I?(s*=-1,f+=u<=0?180:-180,u+=u<=0?180:-180):(o*=-1,f+=f<=0?180:-180)),e=e||r.uncache,r.x=i-((r.xPercent=i&&(!e&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-i)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+"px",r.y=n-((r.yPercent=n&&(!e&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-n)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+"px",r.z=a+"px",r.scaleX=ka(s),r.scaleY=ka(o),r.rotation=ka(u)+L,r.rotationX=ka(h)+L,r.rotationY=ka(l)+L,r.skewX=f+L,r.skewY=d+L,r.transformPerspective=c+"px",(r.zOrigin=parseFloat(Y.split(" ")[2])||!e&&r.zOrigin||0)&&(F[vr]=Ar(Y)),r.xOffset=r.yOffset=0,r.force3D=N.force3D,r.renderTransform=r.svg?Fr:Xe?Rr:Dr,r.uncache=0,r},Ar=function _firstTwoOnly(t){return(t=t.split(" "))[0]+" "+t[1]},Dr=function _renderNon3DTransforms(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Rr(t,e)},Sr="0deg",zr="0px",Er=") ",Rr=function _renderCSSTransforms(t,e){var r=e||this,i=r.xPercent,n=r.yPercent,a=r.x,s=r.y,o=r.z,u=r.rotation,h=r.rotationY,l=r.rotationX,f=r.skewX,d=r.skewY,c=r.scaleX,p=r.scaleY,_=r.transformPerspective,m=r.force3D,g=r.target,v=r.zOrigin,y="",T="auto"===m&&t&&1!==t||!0===m;if(v&&(l!==Sr||h!==Sr)){var b,w=parseFloat(h)*fr,x=Math.sin(w),k=Math.cos(w);w=parseFloat(l)*fr,b=Math.cos(w),a=se(g,a,x*b*-v),s=se(g,s,-Math.sin(w)*-v),o=se(g,o,k*b*-v+v)}_!==zr&&(y+="perspective("+_+Er),(i||n)&&(y+="translate("+i+"%, "+n+"%) "),!T&&a===zr&&s===zr&&o===zr||(y+=o!==zr||T?"translate3d("+a+", "+s+", "+o+") ":"translate("+a+", "+s+Er),u!==Sr&&(y+="rotate("+u+Er),h!==Sr&&(y+="rotateY("+h+Er),l!==Sr&&(y+="rotateX("+l+Er),f===Sr&&d===Sr||(y+="skew("+f+", "+d+Er),1===c&&1===p||(y+="scale("+c+", "+p+Er),g.style[gr]=y||"translate(0, 0)"},Fr=function _renderSVGTransforms(t,e){var r,i,n,a,s,o=e||this,u=o.xPercent,h=o.yPercent,l=o.x,f=o.y,d=o.rotation,c=o.skewX,p=o.skewY,_=o.scaleX,m=o.scaleY,g=o.target,v=o.xOrigin,y=o.yOrigin,T=o.xOffset,b=o.yOffset,w=o.forceCSS,x=parseFloat(l),k=parseFloat(f);d=parseFloat(d),c=parseFloat(c),(p=parseFloat(p))&&(c+=p=parseFloat(p),d+=p),d||c?(d*=fr,c*=fr,r=Math.cos(d)*_,i=Math.sin(d)*_,n=Math.sin(d-c)*-m,a=Math.cos(d-c)*m,c&&(p*=fr,s=Math.tan(c-p),n*=s=Math.sqrt(1+s*s),a*=s,p&&(s=Math.tan(p),r*=s=Math.sqrt(1+s*s),i*=s)),r=ka(r),i=ka(i),n=ka(n),a=ka(a)):(r=_,a=m,i=n=0),(x&&!~(l+"").indexOf("px")||k&&!~(f+"").indexOf("px"))&&(x=de(g,"x",l,"px"),k=de(g,"y",f,"px")),(v||y||T||b)&&(x=ka(x+v-(v*r+y*n)+T),k=ka(k+y-(v*i+y*a)+b)),(u||h)&&(s=g.getBBox(),x=ka(x+u/100*s.width),k=ka(k+h/100*s.height)),s="matrix("+r+","+i+","+n+","+a+","+x+","+k+")",g.setAttribute("transform",s),w&&(g.style[gr]=s)};ja("padding,margin,Width,Radius",function(e,r){var t="Right",i="Bottom",n="Left",o=(r<3?["Top",t,i,n]:["Top"+n,"Top"+t,i+t,i+n]).map(function(t){return r<2?e+t:"border"+t+e});Or[1<r?"border"+e:e]=function(e,t,r,i,n){var a,s;if(arguments.length<4)return a=o.map(function(t){return xr(e,t,r)}),5===(s=a.join(" ")).split(a[0]).length?a[0]:s;a=(i+"").split(" "),s={},o.forEach(function(t,e){return s[t]=a[e]=a[e]||a[(e-1)/2|0]}),e.init(t,s,n)}});var Ir,Lr,Br,Yr={name:"css",register:Wd,targetTest:function targetTest(t){return t.style&&t.nodeType},init:function init(t,e,i,n,a){var s,o,u,h,l,f,d,c,p,_,m,g,v,y,T,b,w,x=this._props,k=t.style,O=i.vars.startAt;for(d in Ne||Wd(),this.styles=this.styles||Qd(t),b=this.styles.props,this.tween=i,e)if("autoRound"!==d&&(o=e[d],!mt[d]||!dc(d,e,i,n,t,a)))if(l=typeof o,f=Or[d],"function"===l&&(l=typeof(o=o.call(i,n,t,a))),"string"===l&&~o.indexOf("random(")&&(o=rb(o)),f)f(this,t,d,o,i)&&(T=1);else if("--"===d.substr(0,2))s=(getComputedStyle(t).getPropertyValue(d)+"").trim(),o+="",Rt.lastIndex=0,Rt.test(s)||(c=_a(s),(p=_a(o))?c!==p&&(s=de(t,d,s,p)+p):c&&(o+=c)),this.add(k,"setProperty",s,o,n,a,0,0,d),x.push(d),b.push(d,0,k[d]);else if("undefined"!==l){if(O&&d in O?(s="function"==typeof O[d]?O[d].call(i,n,t,a):O[d],r(s)&&~s.indexOf("random(")&&(s=rb(s)),_a(s+"")||"auto"===s||(s+=N.units[d]||_a(xr(t,d))||""),"="===(s+"").charAt(1)&&(s=xr(t,d))):s=xr(t,d),h=parseFloat(s),(_="string"===l&&"="===o.charAt(1)&&o.substr(0,2))&&(o=o.substr(2)),u=parseFloat(o),d in mr&&("autoAlpha"===d&&(1===h&&"hidden"===xr(t,"visibility")&&u&&(h=0),b.push("visibility",0,k.visibility),ae(this,k,"visibility",h?"inherit":"hidden",u?"inherit":"hidden",!u)),"scale"!==d&&"transform"!==d&&~(d=mr[d]).indexOf(",")&&(d=d.split(",")[0])),m=d in hr){if(this.styles.save(d),w=o,"string"===l&&"var(--"===o.substring(0,6)){if("calc("===(o=Td(t,o.substring(4,o.indexOf(")")))).substring(0,5)){var M=t.style.perspective;t.style.perspective=o,o=Td(t,"perspective"),M?t.style.perspective=M:_d(t,"perspective")}u=parseFloat(o)}if(g||((v=t._gsap).renderTransform&&!e.parseTransform||Pr(t,e.parseTransform),y=!1!==e.smoothOrigin&&v.smooth,(g=this._pt=new we(this._pt,k,gr,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===d)this._pt=new we(this._pt,v,"scaleY",v.scaleY,(_?ma(v.scaleY,_+u):u)-v.scaleY||0,yd),this._pt.u=0,x.push("scaleY",d),d+="X";else{if("transformOrigin"===d){b.push(vr,0,k[vr]),o=he(o),v.svg?pe(t,o,0,y,0,this):((p=parseFloat(o.split(" ")[2])||0)!==v.zOrigin&&ae(this,v,"zOrigin",v.zOrigin,p),ae(this,k,d,Ar(s),Ar(o)));continue}if("svgOrigin"===d){pe(t,o,1,y,0,this);continue}if(d in Cr){ze(this,v,d,h,_?ma(h,_+o):o);continue}if("smoothOrigin"===d){ae(this,v,"smooth",v.smooth,o);continue}if("force3D"===d){v[d]=o;continue}if("transform"===d){Be(this,o,t);continue}}}else d in k||(d=Tr(d)||d);if(m||(u||0===u)&&(h||0===h)&&!_r.test(o)&&d in k)u=u||0,(c=(s+"").substr((h+"").length))!==(p=_a(o)||(d in N.units?N.units[d]:c))&&(h=de(t,d,s,p)),this._pt=new we(this._pt,m?v:k,d,h,(_?ma(h,_+u):u)-h,m||"px"!==p&&"zIndex"!==d||!1===e.autoRound?yd:Cd),this._pt.u=p||0,m&&w!==o?(this._pt.b=s,this._pt.e=w,this._pt.r=Bd):c!==p&&"%"!==p&&(this._pt.b=s,this._pt.r=Ad);else if(d in k)fe.call(this,t,d,s,_?_+o:o);else if(d in t)this.add(t,d,s||t[d],_?_+o:o,n,a);else if("parseTransform"!==d){S(d,o);continue}m||(d in k?b.push(d,0,k[d]):"function"==typeof t[d]?b.push(d,2,t[d]()):b.push(d,1,s||t[d])),x.push(d)}T&&be(this)},render:function render(t,e){if(e.tween._time||!Ue())for(var r=e._pt;r;)r.r(t,r.d),r=r._next;else e.styles.revert()},get:xr,aliases:mr,getSetter:function getSetter(t,e,r){var i=mr[e];return i&&i.indexOf(",")<0&&(e=i),e in hr&&e!==vr&&(t._gsap.x||xr(t,"x"))?r&&Ve===r?"scale"===e?Id:Hd:(Ve=r||{})&&("scale"===e?Jd:Kd):t.style&&!u(t.style[e])?Fd:~e.indexOf("-")?Gd:le(t,e)},core:{_removeProperty:_d,_getMatrix:oe}};Fe.utils.checkPrefix=Tr,Fe.core.getStyleSaver=Qd,Br=ja((Ir="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(Lr="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",function(t){hr[t]=1}),ja(Lr,function(t){N.units[t]="deg",Cr[t]=1}),mr[Br[13]]=Ir+","+Lr,ja("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",function(t){var e=t.split(":");mr[e[1]]=Br[e[0]]}),ja("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){N.units[t]="px"}),Fe.registerPlugin(Yr);var Nr=Fe.registerPlugin(Yr)||Fe,jr=Nr.core.Tween;e.Back=ir,e.Bounce=ar,e.CSSPlugin=Yr,e.Circ=ur,e.Cubic=Ke,e.Elastic=rr,e.Expo=or,e.Linear=Qe,e.Power0=qe,e.Power1=Ze,e.Power2=We,e.Power3=He,e.Power4=Je,e.Quad=Ge,e.Quart=$e,e.Quint=tr,e.Sine=sr,e.SteppedEase=nr,e.Strong=er,e.TimelineLite=Zt,e.TimelineMax=Zt,e.TweenLite=te,e.TweenMax=jr,e.default=Nr,e.gsap=Nr;if (typeof(window)==="undefined"||window!==e){Object.defineProperty(e,"__esModule",{value:!0})} else {delete e.default}});
123version https://git-lfs.github.com/spec/v1oid sha256:15091ce8bb3f94f418ab604f1b8b8298193cf940798722f97927744eee43816esize 182444123version https://git-lfs.github.com/spec/v1oid sha256:ad290d5a69d1c1e2108b45596dd6f4f170770f9677cb629b341ed91fa74511desize 124844123version https://git-lfs.github.com/spec/v1oid sha256:e40cd92ea516c1b88e86a975cff15f870212fcc443ee855add3ec80f0b0afe1asize 240044123version https://git-lfs.github.com/spec/v1oid sha256:474d12bec4565448f99802e5827d77012ce66c024d44c360bfcdc806539611ddsize 211244123version https://git-lfs.github.com/spec/v1oid sha256:fc5b2fef76f303d1be61e2434a7d7c227fc2cf889b829c2232830e1f4c5fda32size 1075641234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283"""Standalone Ambient BGM Engine (`bgm_engine.py`)1. Fetches & caches royalty-free GPL-3.0 ambient piano/focus tracks from DENO Music Library.2. Falls back to procedural warm stereo ambient pad synthesis if offline/firewalled.Zero external workspace dependencies — 100% portable across Mac / Windows / Linux."""
from __future__ import annotationsimport urllib.requestimport wavefrom pathlib import Pathimport numpy as np
DENO_PRESET_TRACKS = { "focused": ( "deno-bgm-001", "F-Major Glass Piano Soft Groove", "https://pub-5eb8d6eced784b6d934b539c312b02af.r2.dev/mp3/deno-bgm-f-major-glass-piano-soft-groove.mp3", ), "bright": ( "deno-bgm-002", "Bright Piano Chill House 03", "https://pub-5eb8d6eced784b6d934b539c312b02af.r2.dev/mp3/deno-bgm-bright-piano-chill-house-03.mp3", ),}
def synth_offline_ambient_pad(out_wav: Path, duration_sec: float = 30.0, sr: int = 48000) -> Path: """Generates a warm Fmaj9 stereo ambient synth pad WAV when offline.""" out_wav.parent.mkdir(parents=True, exist_ok=True) dur = max(6.0, min(duration_sec, 90.0)) n = int(sr * dur) t = np.linspace(0.0, dur, n, endpoint=False)
# Fmaj9 warm chord frequencies (F3, A3, C4, E4, G4) freqs = [174.61, 220.00, 261.63, 329.63, 392.00] amps = [0.32, 0.24, 0.22, 0.16, 0.12] left = np.zeros(n) right = np.zeros(n)
for idx, (f, a) in enumerate(zip(freqs, amps)): lfo = 0.82 + 0.18 * np.sin(2.0 * np.pi * (0.09 + idx * 0.03) * t + idx) left += np.sin(2.0 * np.pi * f * t) * a * lfo right += np.sin(2.0 * np.pi * (f * 1.0012) * t + 0.4 * idx) * a * lfo
fade = np.minimum(t / 1.5, 1.0) * np.minimum((dur - t) / 1.8, 1.0) left *= fade right *= fade
peak = max(float(np.max(np.abs(left))), float(np.max(np.abs(right))), 1e-6) stereo = np.stack([left / peak * 0.65, right / peak * 0.65], axis=-1) pcm = np.clip(stereo * 32767.0, -32768, 32767).astype(np.int16)
with wave.open(str(out_wav), "wb") as wf: wf.setnchannels(2) wf.setsampwidth(2) wf.setframerate(sr) wf.writeframes(pcm.tobytes()) return out_wav
def get_or_create_bgm_source(cache_dir: Path, mood: str = "focused", duration_sec: float = 60.0) -> tuple[Path, str]: """Returns `(audio_path, title)` for ambient BGM, downloading once or synthesizing offline.""" cache_dir.mkdir(parents=True, exist_ok=True) track_id, title, url = DENO_PRESET_TRACKS.get(mood.lower(), DENO_PRESET_TRACKS["focused"]) mp3_path = cache_dir / f"{track_id}.mp3"
if mp3_path.exists() and mp3_path.stat().st_size > 4096: return mp3_path, title
try: req = urllib.request.Request(url, headers={"User-Agent": "Deck2Video/1.0"}) with urllib.request.urlopen(req, timeout=15) as resp: data = resp.read() if len(data) > 4096: mp3_path.write_bytes(data) return mp3_path, title except Exception as exc: print(f"[BGM Info] Offline or CDN unreachable ({exc}); using procedural ambient pad.")
wav_fallback = cache_dir / "offline_ambient_pad.wav" synth_offline_ambient_pad(wav_fallback, duration_sec=duration_sec) return wav_fallback, "Procedural Fmaj9 Ambient Pad"123version https://git-lfs.github.com/spec/v1oid sha256:62bd0d702b10d8008bdb33fb4ec32732fa233099383ede8d7505d9a00fecfaffsize 91651717123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572"""HyperFrames HTML Composition Compiler (`html_builder.py`)Compiles an enriched `DeckSpec` (with exact TTS beat timings & SFX cues) intoa deterministic, WCAG-compliant 1920x1080 HyperFrames `index.html` compositioninspired by modern Korean AI presentation videos (Dark Glass UI, 3D ParticleHorizon Wave, Top Chapter Progress Bar, 5 Scene Archetypes, Dual KR/EN Captions,and Multi-Track Voiceover + UI SFX + BGM Audio)."""
from __future__ import annotationsimport htmlimport jsonimport shutilimport urllib.requestfrom pathlib import Pathfrom typing import Any
PIPELINE_ROOT = Path(__file__).resolve().parentPRETENDARD_URL = "https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/packages/pretendard/dist/web/variable/woff2/PretendardVariable.woff2"GSAP_URL = "https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"
def _ensure_static_vendor_assets() -> tuple[Path, Path]: font_src = PIPELINE_ROOT / "assets" / "fonts" / "PretendardVariable.woff2" gsap_src = PIPELINE_ROOT / "assets" / "js" / "gsap.min.js" font_src.parent.mkdir(parents=True, exist_ok=True) gsap_src.parent.mkdir(parents=True, exist_ok=True) if not font_src.exists() or font_src.stat().st_size < 100_000: urllib.request.urlretrieve(PRETENDARD_URL, str(font_src)) if not gsap_src.exists() or gsap_src.stat().st_size < 10_000: urllib.request.urlretrieve(GSAP_URL, str(gsap_src)) return font_src, gsap_src
def _esc(val: Any) -> str: return html.escape(str(val or ""), quote=True)
def _split_card_item(raw: str, idx: int) -> tuple[str, str]: if "|" in raw: left, right = [x.strip() for x in raw.split("|", 1)] return left, right if "·" in raw: left, right = [x.strip() for x in raw.split("·", 1)] return left, right words = raw.strip().split() if len(words) >= 3: return " ".join(words[:2]), " ".join(words[2:]) return f"모듈 {idx + 1:02d}", raw.strip()
def _render_arc_cards_scene(slide: dict[str, Any], s_idx: int) -> str: sid = f"s{s_idx + 1}" items = slide.get("bullets") or ["기획 모듈 | 구조화", "모션 모듈 | 렌더링", "사운드 모듈 | 효과음"] items = items[:9] n_items = len(items) mid = (n_items - 1) / 2.0
cards_html = [] for i, item in enumerate(items): role_short, role_desc = _split_card_item(item, i) offset = i - mid rot_y = round(offset * -7.2, 2) trans_z = round(-abs(offset) * 22.0, 1) ascii_prefix = "".join(ch for ch in role_short if ch.isascii() and ch.isalnum()) badge_word = ascii_prefix[:3].upper() if len(ascii_prefix) >= 2 else role_short[:2] cards_html.append(f""" <div class="arc-slot" style="transform: perspective(1350px) rotateY({rot_y}deg) translateZ({trans_z}px);"> <div id="{sid}-arc-card-{i}" class="arc-card"> <div class="arc-avatar"><span>{_esc(badge_word)}</span></div> <div class="arc-name">{_esc(role_short)}</div> <div class="arc-desc">{_esc(role_desc[:14])}</div> <div class="arc-status"><span class="status-dot"></span><span>가동 중</span></div> </div> </div>""")
return f""" <div id="{sid}-inner" class="scene-inner scene-arc"> <div id="{sid}-pill" class="top-pill"> <span class="pill-dot"></span> <span>{_esc(slide.get("badge", "AI SYNC ENGINE"))}</span> </div> <div id="{sid}-hero-stat" class="hero-stat-row"> <span class="stat-prefix">{_esc(slide.get("stat_prefix", "AI 모듈"))}</span> <span id="{sid}-counter" class="stat-big-num">{int(slide.get("stat_number", n_items))}</span> <span class="stat-suffix">{_esc(slide.get("stat_suffix", "종"))}</span> </div> <div class="arc-stage"> {"".join(cards_html)} </div> </div>"""
def _render_mockup_steps_scene(slide: dict[str, Any], s_idx: int) -> str: sid = f"s{s_idx + 1}" raw_items = slide.get("bullets") or [ "정지 슬라이드의 한계 | 초반 이탈 발생", "수동 타임라인 편집 | 자막·효과음 병목", "코드 기반 자동 동기화 | 즉시 MP4 완성", ] while len(raw_items) < 3: raw_items.append(f"핵심 포인트 {len(raw_items) + 1} | 자동 동기화 처리") step_items = raw_items[:3]
icons = ["01", "02", "03"] right_cards = [] left_rows = [] for i, raw in enumerate(step_items): head, desc = _split_card_item(raw, i) right_cards.append(f""" <div id="{sid}-step-card-{i}" class="step-card"> <div class="step-icon-ring"><span>{icons[i]}</span></div> <div class="step-text-col"> <div class="step-head">{_esc(head)}</div> <div class="step-sub">{_esc(desc)}</div> </div> </div>""") left_rows.append(f""" <div id="{sid}-mock-row-{i}" class="mock-chat-row"> <div class="mock-avatar">S{i + 1}</div> <div class="mock-lines"> <div class="mock-line-title">{_esc(head[:16])}</div> <div class="mock-bar-track"><div class="mock-bar-fill" style="width: {62 + i * 14}%;"></div></div> </div> <div class="mock-badge">{i + 1}</div> </div>""")
return f""" <div id="{sid}-inner" class="scene-inner scene-split"> <div id="{sid}-left-mock" class="mock-phone-panel"> <div class="mock-header"> <span class="mock-blue-dot"></span> <span class="mock-header-title">{_esc(slide.get("badge", "Slide Sync Monitor"))}</span> </div> <div class="mock-body"> {"".join(left_rows)} </div> </div> <div class="steps-col"> {"".join(right_cards)} </div> </div>"""
def _render_book_quote_scene(slide: dict[str, Any], s_idx: int) -> str: sid = f"s{s_idx + 1}" quote = slide.get("highlight_quote") or slide.get("title", "") bullets = slide.get("bullets") or [] left_p1 = bullets[0] if len(bullets) > 0 else "반복되는 발표 자료 제작 과정을 분석해 일관된 시각 시스템으로 정의합니다." left_p2 = bullets[1] if len(bullets) > 1 else "폰트 크기, 여백, 챕터 표시줄, 효과음 타이밍이 하나의 규칙 파일로 통합됩니다."
return f""" <div id="{sid}-inner" class="scene-inner scene-book"> <div id="{sid}-pill" class="top-pill"> <span class="pill-dot"></span> <span>{_esc(slide.get("badge", "CHAPTER · CORE PRINCIPLE"))}</span> </div> <div class="book-perspective-wrap" style="perspective: 1400px;"> <div id="{sid}-book-spread" class="book-spread"> <div class="book-page book-page-left"> <div class="book-kicker">WORKFLOW MANUAL</div> <div class="book-left-title">{_esc(slide.get("title", ""))}</div> <p class="book-para">{_esc(left_p1)}</p> <p class="book-para">{_esc(left_p2)}</p> <div class="book-page-num">104</div> </div> <div class="book-spine" data-layout-ignore></div> <div class="book-page book-page-right"> <div class="book-kicker">KEY RULE · SYNC</div> <div class="book-quote-box"> <div id="{sid}-hl-bar" class="book-hl-bar" data-layout-ignore></div> <p class="book-quote-text">{_esc(quote)}</p> </div> <p class="book-para">한 번 검증된 모션과 사운드 설계는 코드로 고정되어 다음 교안에서도 오차 없이 재현됩니다.</p> <div class="book-page-num right">105</div> </div> </div> </div> </div>"""
def _render_terminal_flow_scene(slide: dict[str, Any], s_idx: int) -> str: sid = f"s{s_idx + 1}" cmd_str = slide.get("command", "python3 produce_deck_video.py --input lecture.pptx --sfx on") f_left = slide.get("flow_left", "파워포인트 · 교안") f_left_sub = slide.get("flow_left_sub", "슬라이드 · 발표노트 파싱") f_right = slide.get("flow_right", "1080p 모션 MP4") f_right_sub = slide.get("flow_right_sub", "HTML 렌더링 + 효과음 싱크")
return f""" <div id="{sid}-inner" class="scene-inner scene-terminal"> <div class="term-badges-row"> <div id="{sid}-badge-a" class="top-pill"><span>CLI 자동화 엔진</span></div> <div id="{sid}-badge-b" class="top-pill accent"><span>SFX · 자막 실시간 합성</span></div> </div> <div id="{sid}-term-win" class="terminal-window"> <div class="term-titlebar"> <div class="term-dots" data-layout-ignore> <span class="tdot tdot-a"></span> <span class="tdot tdot-b"></span> <span class="tdot tdot-c"></span> </div> <div class="term-title">Deck-to-Video Compiler</div> </div> <div class="term-content"> <div class="term-prompt-row"> <span class="term-chevron">></span> <div id="{sid}-cmd-clip" class="term-cmd-reveal"> <span class="term-cmd-text">{_esc(cmd_str)}</span> </div> <span id="{sid}-caret" class="term-caret" data-layout-ignore></span> </div> <div id="{sid}-term-log" class="term-log-line"> ✓ 슬라이드 파싱 완료 → 음성 타임스탬프 정렬 → 6종 UI 효과음 믹싱 → 1080p 렌더링 </div> </div> </div> <div class="flow-nodes-row"> <div id="{sid}-node-l" class="flow-node active-node"> <div class="flow-node-tag">INPUT</div> <div class="flow-node-title">{_esc(f_left)}</div> <div class="flow-node-sub">{_esc(f_left_sub)}</div> </div> <div class="flow-connector" data-layout-ignore> <div class="flow-line"></div> <div id="{sid}-pulse-dot" class="flow-pulse-dot"></div> </div> <div id="{sid}-node-r" class="flow-node"> <div class="flow-node-tag">OUTPUT</div> <div class="flow-node-title">{_esc(f_right)}</div> <div class="flow-node-sub">{_esc(f_right_sub)}</div> </div> </div> </div>"""
def _render_metric_summary_scene(slide: dict[str, Any], s_idx: int) -> str: sid = f"s{s_idx + 1}" raw_items = slide.get("bullets") or [ "교안 자동 파싱 | PPTX · 마크다운 즉시 변환", "모션 · 효과음 | 3D 웨이브 · 네온 UI 사운드", "무손실 MP4 | 1920x1080 고화질 직출력", ] while len(raw_items) < 3: raw_items.append(f"핵심 단계 {len(raw_items) + 1} | 원스톱 파이프라인")
pillars_html = [] for i, raw in enumerate(raw_items[:3]): head, desc = _split_card_item(raw, i) pillars_html.append(f""" <div id="{sid}-pillar-{i}" class="pillar-card"> <div class="pillar-num">{i + 1:02d}</div> <div class="pillar-ring"><span class="pillar-ring-dot"></span></div> <div class="pillar-title">{_esc(head)}</div> <div class="pillar-desc">{_esc(desc)}</div> </div>""")
sub_summary = slide.get("subtitle") or slide.get("title", "핵심 요약 · 3단계 자동화") return f""" <div id="{sid}-inner" class="scene-inner scene-pillars"> <div class="pillars-grid"> {"".join(pillars_html)} </div> <div id="{sid}-summary-foot" class="pillars-footer"> <span class="pill-dot"></span> <span>{_esc(sub_summary)}</span> </div> </div>"""
def compile_hyperframes_project(spec: dict[str, Any], project_dir: Path) -> Path: """ Writes `index.html` and copies required fonts/JS assets into `project_dir`. Returns path to `index.html`. """ fonts_dst = project_dir / "assets" / "fonts" js_dst = project_dir / "assets" / "js" fonts_dst.mkdir(parents=True, exist_ok=True) js_dst.mkdir(parents=True, exist_ok=True)
font_src, gsap_src = _ensure_static_vendor_assets() if font_src.exists(): shutil.copy2(font_src, fonts_dst / "PretendardVariable.woff2") if gsap_src.exists(): shutil.copy2(gsap_src, js_dst / "gsap.min.js")
total_dur = spec["total_duration"] chapters = spec.get("chapters", [])
# 1. Top Chapter HUD Bar chapter_tabs_html = [] for c_idx, ch in enumerate(chapters): chapter_tabs_html.append(f""" <div id="chap-tab-{c_idx}" class="chap-tab"> <div class="chap-tab-row"> <span class="chap-num">{_esc(ch['num'])}</span> <span class="chap-label">{_esc(ch['label'])}</span> </div> <div class="chap-bar-bg" data-layout-ignore> <div id="chap-fill-{c_idx}" class="chap-bar-fill"></div> </div> </div>""")
# 2. Scene Clips (Track 0) scenes_html = [] for s_idx, slide in enumerate(spec["slides"]): arch = slide["archetype"] if arch == "arc_cards": inner_markup = _render_arc_cards_scene(slide, s_idx) elif arch == "mockup_steps": inner_markup = _render_mockup_steps_scene(slide, s_idx) elif arch == "book_quote": inner_markup = _render_book_quote_scene(slide, s_idx) elif arch == "terminal_flow": inner_markup = _render_terminal_flow_scene(slide, s_idx) else: inner_markup = _render_metric_summary_scene(slide, s_idx)
scenes_html.append(f""" <section id="scene-clip-{s_idx + 1}" class="clip scene-slot" data-start="{slide['start']}" data-duration="{slide['duration']}" data-track-index="0" >{inner_markup} </section>""")
# 3. Subtitle Clips (Track 1) & Voiceover Audio Clips (Track 2) captions_html = [] vo_audio_html = [] for s_idx, slide in enumerate(spec["slides"]): for b_idx, beat in enumerate(slide["beats"]): cid = f"cap-s{s_idx + 1}-b{b_idx + 1}" sub_en_markup = ( f'<div class="cap-en">{_esc(beat["sub_en"])}</div>' if beat.get("sub_en") else "" ) # Extend subtitle window slightly across inter-beat breath for smooth reading next_start = ( slide["beats"][b_idx + 1]["start"] if b_idx + 1 < len(slide["beats"]) else slide["end"] ) cap_dur = round(max(0.25, next_start - beat["start"] - 0.02), 3) captions_html.append(f""" <div id="{cid}" class="clip caption-slot" data-start="{beat['start']}" data-duration="{cap_dur}" data-track-index="1" data-layout-allow-caption-zone > <div id="{cid}-box" class="caption-box"> <div class="cap-ko">{_esc(beat['sub_ko'])}</div> {sub_en_markup} </div> </div>""")
vo_audio_html.append(f""" <audio id="{beat['id']}" src="{_esc(beat['src'])}" data-start="{beat['start']}" data-duration="{beat['duration']}" data-track-index="2" data-volume="1.0" ></audio>""")
# 4. SFX Audio Clips (Track 3) & BGM Bed (Track 4) sfx_audio_html = [] for ev in spec.get("sfx_events", []): sfx_audio_html.append(f""" <audio id="{ev['id']}" src="{_esc(ev['src'])}" data-start="{ev['start']}" data-duration="{ev['duration']}" data-track-index="3" data-volume="{ev['volume']}" ></audio>""")
bgm_html = "" if spec.get("bgm"): bgm = spec["bgm"] bgm_html = f""" <audio id="{bgm['id']}" src="{_esc(bgm['src'])}" data-start="{bgm['start']}" data-duration="{bgm['duration']}" data-track-index="4" data-volume="{bgm['volume']}" ></audio>"""
# Embed compact JSON timeline spec for deterministic GSAP choreography choreo_payload = { "totalDuration": total_dur, "chaptersCount": len(chapters), "slides": [ { "index": i, "chapterIndex": s["chapter_index"], "archetype": s["archetype"], "start": s["start"], "duration": s["duration"], "end": s["end"], "statNumber": int(s.get("stat_number", 9)), "bulletsCount": len(s.get("bullets", [])), "beats": [ {"start": b["start"], "duration": b["duration"], "end": b["end"]} for b in s["beats"] ], } for i, s in enumerate(spec["slides"]) ], } choreo_json = json.dumps(choreo_payload, ensure_ascii=False)
html_doc = f"""<!doctype html><html lang="ko" data-resolution="landscape"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=1920, height=1080" /> <title>{_esc(spec.get("title", "AI SYNC Presentation"))}</title> <script src="assets/js/gsap.min.js"></script> <style> @font-face {{ font-family: "PretendardLocal"; src: url("assets/fonts/PretendardVariable.woff2") format("woff2-variations"); font-weight: 100 900; font-style: normal; font-display: block; }}
:root {{ --bg-deep: #050811; --bg-card: rgba(13, 22, 40, 0.84); --bg-card-active: rgba(18, 34, 64, 0.94); --border-subtle: rgba(148, 163, 184, 0.22); --border-neon: #60a5fa; --text-primary: #f8fafc; --text-secondary: #cbd5e1; --text-accent: #7dd3fc; --font-ui: "PretendardLocal", sans-serif; }}
* {{ margin: 0; padding: 0; box-sizing: border-box; }}
html, body {{ width: 1920px; height: 1080px; overflow: hidden; background: var(--bg-deep); color: var(--text-primary); font-family: var(--font-ui); word-break: keep-all; -webkit-font-smoothing: antialiased; }}
#root {{ position: relative; width: 100%; height: 1080px; overflow: hidden; background: var(--bg-deep); }}
.bg-atmosphere {{ position: absolute; inset: 0; background: radial-gradient(ellipse 68% 46% at 50% 42%, rgba(37, 99, 235, 0.22) 0%, rgba(14, 28, 58, 0.10) 48%, rgba(5, 8, 17, 0) 78%), linear-gradient(180deg, #04070f 0%, #070e1e 56%, #04070f 100%); pointer-events: none; }}
#wave-canvas {{ position: absolute; inset: 0; width: 1920px; height: 1080px; display: block; pointer-events: none; }}
/* Persistent Top Chapter Bar */ .chapter-hud {{ position: absolute; top: 28px; left: 64px; right: 64px; height: 62px; padding: 8px 14px; border-radius: 18px; background: rgba(8, 14, 28, 0.82); border: 1px solid rgba(148, 163, 184, 0.18); display: grid; grid-template-columns: repeat({max(1, len(chapters))}, 1fr); gap: 12px; align-items: center; z-index: 20; }}
.chap-tab {{ height: 46px; padding: 6px 16px; border-radius: 12px; border: 1px solid transparent; display: flex; flex-direction: column; justify-content: center; gap: 6px; }}
.chap-tab-row {{ display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; color: #cbd5e1; white-space: nowrap; overflow: hidden; }}
.chap-num {{ color: #7dd3fc; font-weight: 700; }}
.chap-bar-bg {{ width: 100%; height: 3px; border-radius: 99px; background: rgba(148, 163, 184, 0.20); overflow: hidden; }}
.chap-bar-fill {{ display: block; width: 100%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #38bdf8, #93c5fd); transform-origin: left center; }}
/* Scene Stage */ .scene-slot {{ position: absolute; inset: 0; padding: 112px 96px 190px 96px; display: flex; align-items: center; justify-content: center; z-index: 10; }}
.scene-inner {{ width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; }}
.top-pill {{ display: inline-flex; align-items: center; gap: 10px; padding: 10px 24px; border-radius: 999px; background: rgba(15, 28, 54, 0.90); border: 1px solid rgba(96, 165, 250, 0.48); box-shadow: 0 0 24px rgba(56, 189, 248, 0.18); font-size: 21px; font-weight: 700; color: #f8fafc; letter-spacing: -0.01em; }}
.top-pill.accent {{ border-color: rgba(125, 211, 252, 0.72); color: #bae6fd; }}
.pill-dot {{ display: block; width: 10px; height: 10px; border-radius: 50%; background: #38bdf8; box-shadow: 0 0 12px #38bdf8; }}
/* Archetype 1: 3D Arc Cards + Big Counter */ .hero-stat-row {{ display: flex; align-items: baseline; justify-content: center; gap: 18px; }}
.stat-prefix, .stat-suffix {{ font-size: 58px; font-weight: 800; color: #e2e8f0; letter-spacing: -0.03em; }}
.stat-big-num {{ font-size: 132px; font-weight: 900; line-height: 1; color: #7dd3fc; text-shadow: 0 0 42px rgba(56, 189, 248, 0.52); letter-spacing: -0.04em; }}
.arc-stage {{ width: 100%; max-width: 1680px; height: 320px; display: flex; align-items: center; justify-content: center; gap: 14px; }}
.arc-slot {{ flex: 0 0 168px; height: 256px; display: flex; }}
.arc-card {{ width: 100%; height: 100%; padding: 20px 14px; border-radius: 20px; background: linear-gradient(180deg, rgba(16, 29, 56, 0.92) 0%, rgba(9, 16, 32, 0.94) 100%); border: 1px solid rgba(96, 165, 250, 0.36); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center; }}
.arc-avatar {{ width: 66px; height: 66px; border-radius: 50%; background: rgba(30, 58, 110, 0.65); border: 2px solid #60a5fa; box-shadow: 0 0 18px rgba(56, 189, 248, 0.32); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: #f8fafc; }}
.arc-name {{ font-size: 22px; font-weight: 800; color: #f8fafc; letter-spacing: -0.02em; }}
.arc-desc {{ font-size: 15px; font-weight: 500; color: #cbd5e1; }}
.arc-status {{ padding: 5px 12px; border-radius: 999px; background: rgba(15, 23, 42, 0.9); border: 1px solid rgba(56, 189, 248, 0.35); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: #bae6fd; }}
.status-dot {{ display: block; width: 7px; height: 7px; border-radius: 50%; background: #38bdf8; }}
/* Archetype 2: Left Mockup + Right Focus Step Cards */ .scene-split {{ flex-direction: row; gap: 54px; max-width: 1480px; }}
.mock-phone-panel {{ width: 440px; height: 540px; border-radius: 30px; background: rgba(10, 18, 34, 0.94); border: 1.5px solid rgba(148, 163, 184, 0.28); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); overflow: hidden; display: flex; flex-direction: column; }}
.mock-header {{ padding: 24px 28px; background: rgba(20, 34, 62, 0.85); border-bottom: 1px solid rgba(148, 163, 184, 0.18); display: flex; align-items: center; gap: 12px; }}
.mock-blue-dot {{ display: block; width: 24px; height: 24px; border-radius: 50%; background: #38bdf8; }}
.mock-header-title {{ font-size: 23px; font-weight: 800; color: #f8fafc; }}
.mock-body {{ padding: 24px; display: flex; flex-direction: column; gap: 18px; }}
.mock-chat-row {{ padding: 16px 18px; border-radius: 16px; background: rgba(18, 30, 56, 0.82); border: 1px solid rgba(148, 163, 184, 0.2); display: flex; align-items: center; gap: 14px; }}
.mock-avatar {{ width: 46px; height: 46px; border-radius: 50%; background: rgba(37, 99, 235, 0.35); border: 1px solid #60a5fa; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; color: #f8fafc; flex-shrink: 0; }}
.mock-lines {{ flex: 1; display: flex; flex-direction: column; gap: 8px; }}
.mock-line-title {{ font-size: 18px; font-weight: 700; color: #f1f5f9; }}
.mock-bar-track {{ width: 100%; height: 8px; border-radius: 99px; background: rgba(148, 163, 184, 0.2); overflow: hidden; }}
.mock-bar-fill {{ height: 100%; border-radius: 99px; background: #60a5fa; }}
.mock-badge {{ padding: 4px 12px; border-radius: 999px; background: #2563eb; font-size: 15px; font-weight: 800; color: #ffffff; }}
.steps-col {{ flex: 1; display: flex; flex-direction: column; gap: 22px; }}
.step-card {{ width: 100%; min-height: 156px; padding: 28px 34px; border-radius: 24px; background: rgba(13, 23, 44, 0.90); border: 2px solid rgba(96, 165, 250, 0.30); display: flex; align-items: center; gap: 26px; }}
.step-icon-ring {{ width: 74px; height: 74px; border-radius: 50%; background: rgba(30, 58, 110, 0.55); border: 2px solid #60a5fa; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; color: #bae6fd; flex-shrink: 0; }}
.step-text-col {{ display: flex; flex-direction: column; gap: 8px; }}
.step-head {{ font-size: 34px; font-weight: 800; color: #f8fafc; letter-spacing: -0.02em; }}
.step-sub {{ font-size: 22px; font-weight: 500; color: #cbd5e1; }}
/* Archetype 3: 3D Open Book / Manual Spread */ .book-perspective-wrap {{ display: flex; align-items: center; justify-content: center; }}
.book-spread {{ width: 1180px; height: 540px; border-radius: 16px; background: #f8fafc; box-shadow: 0 34px 80px rgba(0, 0, 0, 0.65), 0 0 40px rgba(56, 189, 248, 0.16); display: flex; overflow: hidden; }}
.book-page {{ flex: 1; padding: 44px 48px; background: #f8fafc; color: #0f172a; display: flex; flex-direction: column; justify-content: space-between; position: relative; }}
.book-spine {{ width: 6px; background: linear-gradient(90deg, #cbd5e1, #94a3b8, #cbd5e1); }}
.book-kicker {{ font-size: 15px; font-weight: 800; letter-spacing: 0.08em; color: #0369a1; }}
.book-left-title {{ font-size: 32px; font-weight: 800; line-height: 1.32; color: #0f172a; letter-spacing: -0.02em; }}
.book-para {{ font-size: 21px; font-weight: 500; line-height: 1.62; color: #1e293b; }}
.book-quote-box {{ position: relative; padding: 24px 26px; border-radius: 14px; background: #e0f2fe; border-left: 5px solid #0284c7; overflow: hidden; }}
.book-hl-bar {{ position: absolute; inset: 0; background: rgba(125, 211, 252, 0.45); transform-origin: left center; }}
.book-quote-text {{ position: relative; font-size: 24px; font-weight: 800; line-height: 1.5; color: #0c4a6e; }}
.book-page-num {{ font-size: 15px; font-weight: 700; color: #475569; }}
.book-page-num.right {{ text-align: right; }}
/* Archetype 4: Terminal Window + Node Flow */ .term-badges-row {{ display: flex; gap: 16px; }}
.terminal-window {{ width: 1180px; border-radius: 22px; background: rgba(9, 15, 29, 0.95); border: 1.5px solid rgba(96, 165, 250, 0.42); box-shadow: 0 26px 68px rgba(0, 0, 0, 0.6), 0 0 34px rgba(56, 189, 248, 0.14); overflow: hidden; }}
.term-titlebar {{ padding: 16px 24px; background: rgba(20, 32, 58, 0.9); border-bottom: 1px solid rgba(148, 163, 184, 0.18); display: flex; align-items: center; gap: 16px; }}
.term-dots {{ display: flex; gap: 8px; }}
.tdot {{ display: block; width: 12px; height: 12px; border-radius: 50%; }} .tdot-a {{ background: #60a5fa; }} .tdot-b {{ background: #38bdf8; opacity: 0.7; }} .tdot-c {{ background: #94a3b8; opacity: 0.5; }}
.term-title {{ font-size: 19px; font-weight: 700; color: #e2e8f0; }}
.term-content {{ padding: 30px 34px; display: flex; flex-direction: column; gap: 18px; }}
.term-prompt-row {{ display: flex; align-items: center; gap: 14px; font-family: monospace; font-size: 25px; font-weight: 700; }}
.term-chevron {{ color: #38bdf8; }}
.term-cmd-reveal {{ display: inline-block; overflow: hidden; white-space: nowrap; }}
.term-cmd-text {{ color: #f8fafc; }}
.term-caret {{ display: inline-block; width: 12px; height: 28px; background: #38bdf8; }}
.term-log-line {{ font-size: 20px; font-weight: 600; color: #7dd3fc; }}
.flow-nodes-row {{ width: 1180px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }}
.flow-node {{ width: 470px; padding: 26px 32px; border-radius: 22px; background: rgba(13, 23, 44, 0.92); border: 2px solid rgba(96, 165, 250, 0.35); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }}
.flow-node.active-node {{ border-color: #60a5fa; box-shadow: 0 0 32px rgba(56, 189, 248, 0.25); }}
.flow-node-tag {{ font-size: 14px; font-weight: 800; letter-spacing: 0.1em; color: #7dd3fc; }}
.flow-node-title {{ font-size: 32px; font-weight: 800; color: #f8fafc; }}
.flow-node-sub {{ font-size: 19px; font-weight: 500; color: #cbd5e1; }}
.flow-connector {{ flex: 1; height: 30px; position: relative; display: flex; align-items: center; }}
.flow-line {{ width: 100%; height: 3px; background: rgba(96, 165, 250, 0.35); border-radius: 99px; }}
.flow-pulse-dot {{ position: absolute; left: 0; top: 7px; width: 16px; height: 16px; border-radius: 50%; background: #f8fafc; box-shadow: 0 0 18px #38bdf8, 0 0 32px #60a5fa; }}
/* Archetype 5: 3 Neon Pillars Summary */ .pillars-grid {{ width: 1320px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }}
.pillar-card {{ height: 410px; padding: 38px 30px; border-radius: 26px; background: linear-gradient(180deg, rgba(16, 30, 58, 0.94) 0%, rgba(10, 18, 36, 0.94) 100%); border: 2px solid rgba(96, 165, 250, 0.45); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.48), 0 0 28px rgba(56, 189, 248, 0.15); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; }}
.pillar-num {{ font-size: 24px; font-weight: 800; color: #7dd3fc; }}
.pillar-ring {{ width: 84px; height: 84px; border-radius: 50%; background: rgba(37, 99, 235, 0.24); border: 2px solid #60a5fa; display: flex; align-items: center; justify-content: center; }}
.pillar-ring-dot {{ display: block; width: 22px; height: 22px; border-radius: 50%; background: #7dd3fc; box-shadow: 0 0 18px #38bdf8; }}
.pillar-title {{ font-size: 36px; font-weight: 800; color: #f8fafc; letter-spacing: -0.02em; }}
.pillar-desc {{ font-size: 21px; font-weight: 500; color: #cbd5e1; line-height: 1.45; }}
.pillars-footer {{ padding: 14px 30px; border-radius: 999px; background: rgba(14, 26, 50, 0.92); border: 1px solid rgba(125, 211, 252, 0.45); display: inline-flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 700; color: #e2e8f0; }}
/* Bottom Dual Subtitle Band */ .caption-slot {{ position: absolute; left: 120px; right: 120px; bottom: 34px; height: 132px; display: flex; align-items: center; justify-content: center; z-index: 30; pointer-events: none; }}
.caption-box {{ padding: 14px 32px; border-radius: 18px; background: rgba(4, 8, 18, 0.84); border: 1px solid rgba(148, 163, 184, 0.16); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; max-width: 1520px; }}
.cap-ko {{ font-size: 40px; font-weight: 800; color: #ffffff; letter-spacing: -0.02em; line-height: 1.25; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85); }}
.cap-en {{ font-size: 23px; font-weight: 600; color: #cbd5e1; letter-spacing: -0.01em; line-height: 1.25; }} </style> </head> <body> <div id="root" data-composition-id="main" data-start="0" data-duration="{total_dur}" data-width="1920" data-height="1080" > <div class="bg-atmosphere" data-layout-ignore></div> <canvas id="wave-canvas" width="1920" height="1080" data-layout-allow-overflow data-layout-ignore ></canvas>
<header class="chapter-hud"> {"".join(chapter_tabs_html)} </header>
{"".join(scenes_html)} {"".join(captions_html)} {"".join(vo_audio_html)} {"".join(sfx_audio_html)} {bgm_html} </div>
<script> const CHOREO = {choreo_json};
// Deterministic 3D Perspective Horizon Dot-Wave Renderer const waveCanvas = document.getElementById("wave-canvas"); const wCtx = waveCanvas.getContext("2d");
function drawHorizonWave(timeSec) {{ wCtx.clearRect(0, 0, 1920, 1080);
// Subtle glowing horizon line const horizonY = 588; const grad = wCtx.createLinearGradient(160, horizonY, 1760, horizonY); grad.addColorStop(0.0, "rgba(56, 189, 248, 0.0)"); grad.addColorStop(0.5, "rgba(96, 165, 250, 0.34)"); grad.addColorStop(1.0, "rgba(56, 189, 248, 0.0)"); wCtx.fillStyle = grad; wCtx.fillRect(160, horizonY, 1600, 1.5);
const cols = 46; const rows = 22; const fov = 520; const camY = 125;
for (let r = 0; r < rows; r++) {{ const z = 140 + r * 52; const scale = fov / (fov + z); for (let c = 0; c < cols; c++) {{ const nx = c - (cols - 1) / 2; const worldX = nx * 64; const waveA = Math.sin(nx * 0.28 + timeSec * 1.85 + r * 0.24) * 20; const waveB = Math.cos(r * 0.36 - timeSec * 1.35) * 12; const worldY = camY + waveA + waveB;
const sx = 960 + worldX * scale; const sy = horizonY + worldY * scale + r * 14.5; if (sx < -20 || sx > 1940 || sy < horizonY - 15 || sy > 1090) continue;
const crest = Math.max(0, (waveA + waveB + 32) / 64); const depthFade = 1.0 - r / (rows + 3); const alpha = Math.min(0.88, (0.16 + crest * 0.62) * depthFade); const radius = Math.max(1.3, (1.8 + crest * 2.1) * scale * 1.35);
wCtx.beginPath(); wCtx.arc(sx, sy, radius, 0, Math.PI * 2); if (crest > 0.66) {{ wCtx.fillStyle = "rgba(224, 242, 254, " + alpha.toFixed(3) + ")"; }} else {{ wCtx.fillStyle = "rgba(96, 165, 250, " + alpha.toFixed(3) + ")"; }} wCtx.fill(); }} }} }}
const tl = gsap.timeline({{ paused: true }});
// 1. Continuous seek-safe 3D particle wave across entire composition const waveProxy = {{ t: 0 }}; drawHorizonWave(0); tl.to( waveProxy, {{ t: CHOREO.totalDuration, duration: CHOREO.totalDuration, ease: "none", onUpdate: function () {{ drawHorizonWave(waveProxy.t); }}, }}, 0 );
// 2. Top Chapter Progress Bars & Active Pill Highlighting for (let ci = 0; ci < CHOREO.chaptersCount; ci++) {{ gsap.set("#chap-fill-" + ci, {{ scaleX: 0 }}); }}
CHOREO.slides.forEach(function (s, idx) {{ const sid = "s" + (idx + 1); const st = s.start; const dur = s.duration; const ci = s.chapterIndex;
// Highlight active chapter tab if (ci < CHOREO.chaptersCount) {{ tl.fromTo( "#chap-tab-" + ci, {{ backgroundColor: "rgba(18, 36, 68, 0.95)", borderColor: "rgba(96, 165, 250, 0.72)", }}, {{ backgroundColor: "rgba(18, 36, 68, 0.95)", borderColor: "rgba(96, 165, 250, 0.72)", duration: Math.max(0.1, dur - 0.05), immediateRender: false, }}, st ); tl.to( "#chap-tab-" + ci, {{ backgroundColor: "rgba(18, 36, 68, 0.0)", borderColor: "rgba(96, 165, 250, 0.0)", duration: 0.04, immediateRender: false, }}, st + dur - 0.04 ); tl.fromTo( "#chap-fill-" + ci, {{ scaleX: 0.05 }}, {{ scaleX: 1.0, duration: dur, ease: "none", immediateRender: false }}, st ); }}
// Smooth scene entrance & gentle exit tl.fromTo( "#" + sid + "-inner", {{ opacity: 0, y: 24 }}, {{ opacity: 1, y: 0, duration: 0.42, ease: "power3.out" }}, st ); if (dur > 0.8) {{ tl.to( "#" + sid + "-inner", {{ opacity: 0, y: -14, duration: 0.24, ease: "power2.in", immediateRender: false }}, st + dur - 0.25 ); }}
// Per-archetype choreography if (s.archetype === "arc_cards") {{ const numEl = document.getElementById(sid + "-counter"); const counterProxy = {{ val: 0 }}; if (numEl) {{ tl.fromTo( counterProxy, {{ val: 0 }}, {{ val: s.statNumber, duration: Math.min(1.05, dur * 0.45), ease: "power2.out", onUpdate: function () {{ numEl.textContent = String(Math.round(counterProxy.val)); }}, }}, st + 0.16 ); }} const cardCount = Math.min(9, Math.max(1, s.bulletsCount)); for (let k = 0; k < cardCount; k++) {{ tl.fromTo( "#" + sid + "-arc-card-" + k, {{ opacity: 0, y: 36, scale: 0.92 }}, {{ opacity: 1, y: 0, scale: 1.0, duration: 0.46, ease: "back.out(1.35)" }}, st + 0.14 + k * 0.055 ); // Gentle floating breath across rest of scene const floatStart = st + 0.75 + k * 0.05; if (floatStart + 0.6 < st + dur - 0.3) {{ tl.to( "#" + sid + "-arc-card-" + k, {{ y: -8, duration: (dur - 1.1) * 0.5, ease: "sine.inOut", yoyo: true, repeat: 1, immediateRender: false }}, floatStart ); }} }} }} else if (s.archetype === "mockup_steps") {{ tl.fromTo( "#" + sid + "-left-mock", {{ opacity: 0, x: -34 }}, {{ opacity: 1, x: 0, duration: 0.48, ease: "power3.out" }}, st + 0.08 ); for (let k = 0; k < 3; k++) {{ tl.fromTo( "#" + sid + "-step-card-" + k, {{ opacity: 0, x: 36 }}, {{ opacity: 0.48, x: 0, duration: 0.38, ease: "power2.out" }}, st + 0.12 + k * 0.08 ); const beatInfo = s.beats[Math.min(k, s.beats.length - 1)]; const focusTime = beatInfo ? Math.max(st + 0.32, beatInfo.start) : (st + 0.35 + k * 1.2); tl.to( "#" + sid + "-step-card-" + k, {{ opacity: 1, scale: 1.02, borderColor: "#60a5fa", backgroundColor: "rgba(20, 39, 74, 0.96)", boxShadow: "0 0 34px rgba(56, 189, 248, 0.32)", duration: 0.28, ease: "power2.out", immediateRender: false, }}, focusTime ); tl.fromTo( "#" + sid + "-mock-row-" + k, {{ opacity: 0.45, x: -10 }}, {{ opacity: 1, x: 0, borderColor: "#60a5fa", duration: 0.28, ease: "power2.out", immediateRender: false }}, focusTime ); }} }} else if (s.archetype === "book_quote") {{ tl.fromTo( "#" + sid + "-book-spread", {{ opacity: 0, scale: 0.92, rotationX: 12 }}, {{ opacity: 1, scale: 1.0, rotationX: 3, duration: 0.58, ease: "power3.out" }}, st + 0.08 ); const hlTime = s.beats.length > 1 ? s.beats[1].start : st + 1.0; tl.fromTo( "#" + sid + "-hl-bar", {{ scaleX: 0 }}, {{ scaleX: 1, duration: 0.68, ease: "power2.inOut" }}, Math.max(st + 0.45, hlTime) ); }} else if (s.archetype === "terminal_flow") {{ tl.fromTo( "#" + sid + "-term-win", {{ opacity: 0, y: 24 }}, {{ opacity: 1, y: 0, duration: 0.45, ease: "power3.out" }}, st + 0.08 ); tl.fromTo( "#" + sid + "-cmd-clip", {{ clipPath: "inset(0 100% 0 0)" }}, {{ clipPath: "inset(0 0% 0 0)", duration: 1.05, ease: "steps(28)" }}, st + 0.26 ); tl.fromTo( "#" + sid + "-term-log", {{ opacity: 0, y: 8 }}, {{ opacity: 1, y: 0, duration: 0.35, ease: "power2.out" }}, st + 1.38 ); const flowTime = s.beats.length > 1 ? s.beats[1].start : st + 1.6; tl.fromTo( "#" + sid + "-pulse-dot", {{ x: 0, opacity: 0 }}, {{ x: 180, opacity: 1, duration: 0.72, ease: "power2.inOut" }}, Math.max(st + 0.6, flowTime - 0.1) ); tl.to( "#" + sid + "-node-r", {{ borderColor: "#60a5fa", backgroundColor: "rgba(20, 39, 74, 0.96)", boxShadow: "0 0 36px rgba(56, 189, 248, 0.34)", scale: 1.03, duration: 0.34, ease: "back.out(1.4)", immediateRender: false, }}, Math.max(st + 1.1, flowTime + 0.45) ); }} else {{ for (let k = 0; k < 3; k++) {{ tl.fromTo( "#" + sid + "-pillar-" + k, {{ opacity: 0, y: 36, scale: 0.94 }}, {{ opacity: 1, y: 0, scale: 1.0, duration: 0.45, ease: "back.out(1.3)" }}, st + 0.16 + k * 0.24 ); }} const footTime = s.beats.length > 1 ? s.beats[s.beats.length - 1].start : st + 1.1; tl.fromTo( "#" + sid + "-summary-foot", {{ opacity: 0, y: 18, scale: 0.96 }}, {{ opacity: 1, y: 0, scale: 1.0, boxShadow: "0 0 32px rgba(56, 189, 248, 0.28)", duration: 0.42, ease: "power3.out" }}, Math.max(st + 0.65, footTime) ); }}
// Subtle crisp entrance on each subtitle beat s.beats.forEach(function (b, bIdx) {{ const boxId = "#cap-s" + (idx + 1) + "-b" + (bIdx + 1) + "-box"; tl.fromTo( boxId, {{ opacity: 0, y: 10 }}, {{ opacity: 1, y: 0, duration: 0.18, ease: "power2.out" }}, b.start ); }}); }});
window.__timelines["main"] = tl; tl.seek(0); </script> </body></html>"""
index_path = project_dir / "index.html" index_path.write_text(html_doc, encoding="utf-8") return index_path123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731"""Universal Document-to-Deck Ingestion Parser (`ingest_parser.py`)Supports: - PowerPoint (.pptx) — Slides, bullets, tables, speaker notes - Word (.docx) — Headings, paragraphs, bullet lists, quotes, tables - Markdown (.md/.txt) — #, ##, -, >, tables - HTML (.html/.htm) — Reveal.js <section>, .slide, or <h1>/<h2>/<ul>/<p>/<blockquote> - JSON (.json) — Direct DeckSpec schema
Maps every extracted slide into one of 5 visual motion archetypes: 1. `arc_cards` — 3D cylindrical card carousel + glowing big counter 2. `mockup_steps` — Left app/slide list mockup + Right 3-card sequential focus glow 3. `book_quote` — 3D perspective open manual/book spread + cyan highlighter sweep 4. `terminal_flow` — Dark glass CLI/code window typing + glowing node flow diagram 5. `metric_summary` — 3 neon glass pillars + final takeaway callout badge"""
from __future__ import annotationsimport jsonimport refrom pathlib import Pathfrom typing import Any
ARCHETYPES = ["arc_cards", "mockup_steps", "book_quote", "terminal_flow", "metric_summary"]
def _split_sentences(text: str) -> list[str]: text = re.sub(r"\s+", " ", text.strip()) if not text: return [] parts = re.split(r"(?<=[.!?다요죠])\s+", text) cleaned = [p.strip() for p in parts if p.strip()] return cleaned if cleaned else [text]
def _clean_chapter_label(raw_ch: str) -> str: cleaned = re.sub(r"^\d+\s*[.·\-:]?\s*", "", raw_ch.strip()).strip() return (cleaned or raw_ch.strip())[:16]
def _infer_archetype(idx: int, title: str, bullets: list[str], notes: str) -> str: combined = f"{title} {' '.join(bullets)} {notes}".lower() if idx == 0 and (re.search(r"\d+", title) or len(bullets) >= 5): return "arc_cards" if any(k in combined for k in ["명령어", "코드", "파이프라인", "cli", "터미널", "자동화", "실행", "command", "python", "claude", "워크플로우"]): return "terminal_flow" if any(k in combined for k in ["원칙", "책", "매뉴얼", "정의", "인용", "핵심 문장", "chapter", "법칙", "철학"]): return "book_quote" if any(k in combined for k in ["요약", "정리", "결론", "3가지", "핵심 3", "마무리", "체크리스트"]): return "metric_summary" if len(bullets) >= 5: return "arc_cards" return ARCHETYPES[idx % len(ARCHETYPES)]
def _parse_notes_into_beats(title: str, bullets: list[str], notes_lines: list[str]) -> list[dict[str, str]]: beats: list[dict[str, str]] = [] for ln in notes_lines: ln = ln.strip() if not ln: continue if "||" in ln: ko_part, en_part = [x.strip() for x in ln.split("||", 1)] beats.append({"narration": ko_part, "sub_ko": ko_part, "sub_en": en_part}) else: for sent in _split_sentences(ln): beats.append({"narration": sent, "sub_ko": sent, "sub_en": ""})
if not beats: intro_sent = title if title.endswith(("다.", "요.", "죠.", "?")) else f"{title}에 대해 핵심만 짚어보겠습니다." beats.append({"narration": intro_sent, "sub_ko": title, "sub_en": ""}) for b in bullets[:3]: display_b = b.replace("|", " · ").strip() spoken_b = b.replace("|", ", ").replace("→", "에서 ").strip() if not spoken_b.endswith(("다.", "요.", "죠.", "!", "?")): spoken_b = f"{spoken_b}입니다." beats.append({"narration": spoken_b, "sub_ko": display_b, "sub_en": ""}) return beats
def _compile_raw_slides_to_spec(deck_title: str, raw_slides: list[dict[str, Any]]) -> dict[str, Any]: if not raw_slides: raw_slides = [{ "title": deck_title, "bullets": ["핵심 내용 요약 | 자동 생성 슬라이드"], "notes_lines": [f"{deck_title} 프레젠테이션을 시작합니다."], "meta": {}, }]
chapters: list[dict[str, str]] = [] seen_chapters: dict[str, int] = {} for item in raw_slides: raw_ch = item.get("meta", {}).get("CHAPTER") or item.get("chapter") or item["title"] ch_label = _clean_chapter_label(raw_ch) if ch_label not in seen_chapters and len(chapters) < 6: seen_chapters[ch_label] = len(chapters) chapters.append({ "num": f"{len(chapters) + 1:02d}", "label": ch_label, })
slides_spec: list[dict[str, Any]] = [] for s_idx, item in enumerate(raw_slides): meta = item.get("meta", {}) raw_ch = meta.get("CHAPTER") or item.get("chapter") or item["title"] ch_label = _clean_chapter_label(raw_ch) ch_idx = seen_chapters.get(ch_label, min(s_idx, max(len(chapters) - 1, 0)))
bullets = item.get("bullets") or [item["title"]] notes_lines = item.get("notes_lines", []) archetype = meta.get("ARCHETYPE") or _infer_archetype(s_idx, item["title"], bullets, " ".join(notes_lines)) beats = _parse_notes_into_beats(item["title"], bullets, notes_lines)
num_match = re.search(r"^(.*?)\s*(\d+)\s*([^\d]*)$", item["title"]) stat_prefix = meta.get("STAT_PREFIX", item["title"][:16]) stat_number = ( int(meta["STAT_NUM"]) if "STAT_NUM" in meta and str(meta["STAT_NUM"]).isdigit() else (int(num_match.group(2)) if num_match else len(bullets)) ) stat_suffix = meta.get("STAT_SUFFIX", num_match.group(3).strip()[:6] if num_match else "핵심") if num_match and "STAT_PREFIX" not in meta and num_match.group(1).strip(): stat_prefix = num_match.group(1).strip()
slides_spec.append({ "id": f"slide_{s_idx + 1:02d}", "chapter_index": ch_idx, "archetype": archetype, "badge": meta.get("BADGE", f"SECTION {s_idx + 1:02d}"), "title": item["title"], "subtitle": meta.get("SUBTITLE", ""), "stat_prefix": stat_prefix, "stat_number": stat_number, "stat_suffix": stat_suffix, "bullets": bullets, "highlight_quote": meta.get("QUOTE") or item.get("quote") or (bullets[0] if bullets else item["title"]), "command": meta.get("COMMAND", "deck2video --input document.pptx --sfx on"), "flow_left": meta.get("FLOW_LEFT", "원본 교안 문서"), "flow_left_sub": meta.get("FLOW_LEFT_SUB", "PPTX · DOCX · MD · HTML"), "flow_right": meta.get("FLOW_RIGHT", "1080p 모션 MP4"), "flow_right_sub": meta.get("FLOW_RIGHT_SUB", "HTML 렌더링 + 효과음 싱크"), "beats": beats, })
return { "title": deck_title, "voice": "ko-KR-InJoonNeural", "voice_rate": "+6%", "bgm_mood": "focused", "chapters": chapters, "slides": slides_spec, }
# ---------------------------------------------------------------------------# 1. PowerPoint (.pptx) Parser# ---------------------------------------------------------------------------def parse_pptx_to_spec(pptx_path: Path) -> dict[str, Any]: from pptx import Presentation
prs = Presentation(str(pptx_path)) raw_slides: list[dict[str, Any]] = []
for s_idx, slide in enumerate(prs.slides): title = "" if slide.shapes.title and slide.shapes.title.text.strip(): title = slide.shapes.title.text.strip().replace("\n", " ")
bullets: list[str] = [] meta_tags: dict[str, str] = {}
for shape in slide.shapes: if shape == slide.shapes.title: continue if getattr(shape, "has_text_frame", False): for para in shape.text_frame.paragraphs: line = para.text.strip() if not line: continue m_tag = re.match(r"^\[([A-Z_]+):\s*(.+)\]$", line) if m_tag: meta_tags[m_tag.group(1).upper()] = m_tag.group(2).strip() else: bullets.append(line) elif getattr(shape, "has_table", False): for row in shape.table.rows: cells = [c.text.strip().replace("\n", " ") for c in row.cells if c.text.strip()] if cells: bullets.append(" | ".join(cells[:2]) if len(cells) >= 2 else cells[0])
if not title and bullets: title = bullets.pop(0) if not title: title = f"슬라이드 {s_idx + 1}"
notes_lines: list[str] = [] if slide.has_notes_slide and slide.notes_slide.notes_text_frame: raw_notes = slide.notes_slide.notes_text_frame.text.strip() notes_lines = [ln.strip() for ln in raw_notes.splitlines() if ln.strip()]
raw_slides.append({ "title": title, "bullets": bullets, "notes_lines": notes_lines, "meta": meta_tags, })
deck_title = raw_slides[0]["title"] if raw_slides else pptx_path.stem return _compile_raw_slides_to_spec(deck_title, raw_slides)
# ---------------------------------------------------------------------------# 2. Microsoft Word (.docx) Parser# ---------------------------------------------------------------------------def parse_docx_to_spec(docx_path: Path) -> dict[str, Any]: from docx import Document from docx.oxml.table import CT_Tbl from docx.oxml.text.paragraph import CT_P from docx.table import Table from docx.text.paragraph import Paragraph
doc = Document(str(docx_path)) deck_title = docx_path.stem current_chapter = "" raw_slides: list[dict[str, Any]] = [] cur_slide: dict[str, Any] | None = None
def flush_slide() -> None: nonlocal cur_slide if cur_slide and (cur_slide["title"] or cur_slide["bullets"] or cur_slide["notes_lines"]): if not cur_slide["title"]: cur_slide["title"] = cur_slide["bullets"].pop(0) if cur_slide["bullets"] else f"섹션 {len(raw_slides) + 1}" raw_slides.append(cur_slide) cur_slide = None
for child in doc.element.body.iterchildren(): if isinstance(child, CT_P): para = Paragraph(child, doc) text = para.text.strip() if not text: continue style_name = (para.style.name if para.style else "").lower()
if "title" in style_name and not raw_slides and cur_slide is None: deck_title = text continue
if style_name.startswith("heading 1"): flush_slide() current_chapter = text cur_slide = { "title": text, "chapter": current_chapter, "bullets": [], "notes_lines": [], "quote": "", "meta": {}, } continue
if style_name.startswith(("heading 2", "heading 3")) or re.match(r"^(?:\d+\.|Step\s*\d+|슬라이드\s*\d+)\s+\S+", text, re.I): # If cur_slide was just created from Heading 1 and still empty, adopt this Heading 2 as its title if cur_slide and not cur_slide["bullets"] and not cur_slide["notes_lines"] and cur_slide["title"] == current_chapter: cur_slide["title"] = text else: flush_slide() cur_slide = { "title": text, "chapter": current_chapter or text, "bullets": [], "notes_lines": [], "quote": "", "meta": {}, } continue
if cur_slide is None: cur_slide = { "title": text if len(text) <= 36 else deck_title, "chapter": current_chapter or deck_title, "bullets": [] if len(text) <= 36 else [text], "notes_lines": [], "quote": "", "meta": {}, } continue
m_tag = re.match(r"^\[([A-Z_]+):\s*(.+)\]$", text) if m_tag: cur_slide["meta"][m_tag.group(1).upper()] = m_tag.group(2).strip() elif "quote" in style_name or text.startswith((">", "💬", "[발표노트]", "[내레이션]", "노트:")): cleaned_note = re.sub(r"^(?:>|💬|\[발표노트\]|\[내레이션\]|노트:)\s*", "", text).strip() if "quote" in style_name and not cur_slide["quote"]: cur_slide["quote"] = cleaned_note cur_slide["notes_lines"].append(cleaned_note) elif "list" in style_name or text.startswith(("- ", "• ", "* ", "▪ ")): cur_slide["bullets"].append(re.sub(r"^[-•*▪]\s*", "", text).strip()) else: # Long prose sentence becomes spoken narration; concise phrase becomes bullet if len(text) > 52 and text.endswith(("다.", "요.", "죠.", "!", "?")): cur_slide["notes_lines"].append(text) else: cur_slide["bullets"].append(text)
# Auto-chunk if a flat Word doc has too many bullets in one section if len(cur_slide["bullets"]) >= 7 and not current_chapter: flush_slide()
elif isinstance(child, CT_Tbl): tbl = Table(child, doc) if cur_slide is None: cur_slide = { "title": deck_title, "chapter": current_chapter or deck_title, "bullets": [], "notes_lines": [], "quote": "", "meta": {}, } for r_i, row in enumerate(tbl.rows): cells = [c.text.strip().replace("\n", " ") for c in row.cells if c.text.strip()] if not cells: continue if r_i == 0 and any(h in cells[0].lower() for h in ["구분", "항목", "단계", "모듈", "category", "step"]): continue cur_slide["bullets"].append(" | ".join(cells[:2]) if len(cells) >= 2 else cells[0])
flush_slide() if raw_slides and deck_title == docx_path.stem: deck_title = raw_slides[0]["title"] return _compile_raw_slides_to_spec(deck_title, raw_slides)
# ---------------------------------------------------------------------------# 3. Markdown / Plain Text (.md / .txt) Parser# ---------------------------------------------------------------------------def parse_markdown_to_spec(md_path: Path) -> dict[str, Any]: text = md_path.read_text(encoding="utf-8") lines = text.splitlines() deck_title = md_path.stem current_chapter = "" raw_slides: list[dict[str, Any]] = [] cur_slide: dict[str, Any] | None = None
def flush_slide() -> None: nonlocal cur_slide if cur_slide and (cur_slide["title"] or cur_slide["bullets"] or cur_slide["notes_lines"]): raw_slides.append(cur_slide) cur_slide = None
for raw_ln in lines: ln = raw_ln.strip() if not ln or ln.startswith("---") or re.match(r"^\|[\s\-:|]+\|$", ln): continue
if ln.startswith("# ") and not ln.startswith("## "): h1 = ln[2:].strip() if not raw_slides and cur_slide is None and deck_title == md_path.stem: deck_title = h1 current_chapter = h1 else: flush_slide() current_chapter = h1 continue
if ln.startswith(("## ", "### ")): flush_slide() title = ln.lstrip("#").strip() cur_slide = { "title": title, "chapter": current_chapter or title, "bullets": [], "notes_lines": [], "quote": "", "meta": {}, } continue
if cur_slide is None: cur_slide = { "title": deck_title, "chapter": current_chapter or deck_title, "bullets": [], "notes_lines": [], "quote": "", "meta": {}, }
m_tag = re.match(r"^\[([A-Z_]+):\s*(.+)\]$", ln) if m_tag: cur_slide["meta"][m_tag.group(1).upper()] = m_tag.group(2).strip() elif ln.startswith(">"): cur_slide["notes_lines"].append(ln.lstrip("> ").strip()) elif ln.startswith(("- ", "* ", "• ")): cur_slide["bullets"].append(ln[2:].strip()) elif ln.startswith("|") and ln.endswith("|"): cells = [c.strip() for c in ln.strip("|").split("|") if c.strip()] if cells and cells[0].lower() not in ("구분", "항목", "옵션", "방식"): cur_slide["bullets"].append(" | ".join(cells[:2]) if len(cells) >= 2 else cells[0]) else: if len(ln) > 50 and ln.endswith(("다.", "요.", "죠.", "!", "?")): cur_slide["notes_lines"].append(ln) else: cur_slide["bullets"].append(ln)
flush_slide() return _compile_raw_slides_to_spec(deck_title, raw_slides)
# ---------------------------------------------------------------------------# 4. HTML Presentation / Web Article (.html / .htm) Parser# ---------------------------------------------------------------------------def parse_html_to_spec(html_path: Path) -> dict[str, Any]: from bs4 import BeautifulSoup
soup = BeautifulSoup(html_path.read_text(encoding="utf-8"), "html.parser") for tag in soup(["script", "style", "noscript", "svg", "nav", "footer"]): tag.decompose()
deck_title = (soup.title.string.strip() if soup.title and soup.title.string else "") or html_path.stem h1_first = soup.find("h1") if h1_first and h1_first.get_text(strip=True): deck_title = h1_first.get_text(" ", strip=True)
raw_slides: list[dict[str, Any]] = []
# Case A: Slide-based HTML (<section>, .slide, [data-slide]) slide_nodes = soup.select("section, div.slide, article.slide, [data-slide]") # Filter out outer wrapper sections that contain nested <section> slides (like Reveal.js vertical stacks) leaf_slides = [ node for node in slide_nodes if not node.find(["section"]) and node.get_text(strip=True) ]
if leaf_slides: for idx, node in enumerate(leaf_slides): heading = node.find(["h1", "h2", "h3", "h4"]) title = heading.get_text(" ", strip=True) if heading else f"슬라이드 {idx + 1}" chapter = node.get("data-chapter") or title
notes_lines: list[str] = [] if node.get("data-notes"): notes_lines.append(str(node["data-notes"]).strip()) for aside in node.select("aside.notes, .speaker-notes, [data-narration]"): nt = aside.get_text("\n", strip=True) if nt: notes_lines.extend([x.strip() for x in nt.splitlines() if x.strip()]) aside.decompose()
quote_txt = "" for bq in node.find_all("blockquote"): qt = bq.get_text(" ", strip=True) if qt and not quote_txt: quote_txt = qt bq.decompose()
bullets: list[str] = [] for li in node.find_all("li"): t = li.get_text(" ", strip=True) if t: bullets.append(t) for tr in node.find_all("tr"): cells = [td.get_text(" ", strip=True) for td in tr.find_all(["td", "th"]) if td.get_text(strip=True)] if len(cells) >= 2 and tr.find("td"): bullets.append(" | ".join(cells[:2])) if not bullets: for p in node.find_all("p"): pt = p.get_text(" ", strip=True) if pt and pt != title: if len(pt) > 55: notes_lines.append(pt) else: bullets.append(pt)
meta = {} if node.get("data-archetype"): meta["ARCHETYPE"] = str(node["data-archetype"]).strip() if node.get("data-badge"): meta["BADGE"] = str(node["data-badge"]).strip() if node.get("data-command"): meta["COMMAND"] = str(node["data-command"]).strip()
raw_slides.append({ "title": title, "chapter": chapter, "bullets": bullets or [title], "notes_lines": notes_lines, "quote": quote_txt, "meta": meta, }) return _compile_raw_slides_to_spec(deck_title, raw_slides)
# Case B: General Web Document / Article HTML (<h2>/<h3> sections) current_chapter = deck_title cur_slide: dict[str, Any] | None = None
def flush_html_slide() -> None: nonlocal cur_slide if cur_slide and (cur_slide["bullets"] or cur_slide["notes_lines"] or cur_slide["title"]): raw_slides.append(cur_slide) cur_slide = None
body = soup.body or soup for el in body.find_all(["h1", "h2", "h3", "li", "p", "blockquote", "pre", "code"], recursive=True): txt = el.get_text(" ", strip=True) if not txt: continue if el.name == "h1": current_chapter = txt elif el.name in ("h2", "h3"): flush_html_slide() cur_slide = { "title": txt, "chapter": current_chapter, "bullets": [], "notes_lines": [], "quote": "", "meta": {}, } else: if cur_slide is None: cur_slide = { "title": deck_title, "chapter": current_chapter, "bullets": [], "notes_lines": [], "quote": "", "meta": {}, } if el.name == "blockquote": cur_slide["quote"] = cur_slide["quote"] or txt cur_slide["notes_lines"].append(txt) elif el.name in ("pre", "code") and len(txt) < 120: cur_slide["meta"]["COMMAND"] = txt.splitlines()[0] cur_slide["meta"].setdefault("ARCHETYPE", "terminal_flow") elif el.name == "li": if txt not in cur_slide["bullets"]: cur_slide["bullets"].append(txt) elif el.name == "p" and not el.find_parent(["li", "blockquote"]): if len(txt) > 50: cur_slide["notes_lines"].append(txt) elif txt not in cur_slide["bullets"]: cur_slide["bullets"].append(txt)
flush_html_slide() return _compile_raw_slides_to_spec(deck_title, raw_slides)
# ---------------------------------------------------------------------------# Unified Dispatcher# ---------------------------------------------------------------------------def load_input_to_spec(input_path: Path) -> dict[str, Any]: suffix = input_path.suffix.lower() if suffix == ".json": return json.loads(input_path.read_text(encoding="utf-8")) if suffix == ".pptx": return parse_pptx_to_spec(input_path) if suffix == ".docx": return parse_docx_to_spec(input_path) if suffix in (".md", ".markdown", ".txt"): return parse_markdown_to_spec(input_path) if suffix in (".html", ".htm"): return parse_html_to_spec(input_path) raise ValueError( f"Unsupported input format '{suffix}'. Supported: .pptx, .docx, .md, .txt, .html, .htm, .json" )
# ---------------------------------------------------------------------------# Sample Template Generators (PPTX, DOCX, HTML)# ---------------------------------------------------------------------------def create_sample_pptx(output_pptx: Path) -> Path: from pptx import Presentation
output_pptx.parent.mkdir(parents=True, exist_ok=True) prs = Presentation() layout = prs.slide_layouts[1]
sample_slides = [ { "title": "AI 교육 에이전트 9종", "body": [ "[CHAPTER: 01 에이전트 군체]", "[ARCHETYPE: arc_cards]", "[BADGE: PPTX × HyperFrames Engine]", "[STAT_PREFIX: AI 제작 모듈]", "[STAT_NUM: 9]", "[STAT_SUFFIX: 종]", "교안분석 | 슬라이드 구조 추출", "대본설계 | 발표 노트 호흡 분할", "모션엔진 | HTML 3D 캔버스 생성", "성우합성 | 자연스러운 내레이션", "효과음봇 | 전환·팝업 사운드 싱크", "자막엔진 | 한·영 이중 자막 정렬", "차트모듈 | 숫자 카운트업 연출", "BGM덕킹 | 배경음악 볼륨 자동조절", "렌더러 | 1080p 무손실 MP4 추출", ], "notes": ( "파워포인트 교안만 넣으면 아홉 개의 AI 모듈이 동시에 움직입니다. || Put in a PowerPoint deck, and 9 AI modules spring into action.\n" "정지된 슬라이드를 코드 기반 모션 영상으로 자동 변환해 주죠. || Turning static slides into code-rendered motion videos automatically." ), }, { "title": "왜 기존 강의 영상 제작은 오래 걸렸을까", "body": [ "[CHAPTER: 02 병목 진단]", "[ARCHETYPE: mockup_steps]", "[BADGE: Lecture Deck Analysis]", "정지된 PPT 녹화의 한계 | 화면 변화가 없어 초반 시청 지속률 급락", "수동 영상 편집의 병목 | 자막과 효과음 싱크를 손으로 맞추느라 시간 소모", "코드 기반 SYNC 자동화 | 대본 타임스탬프에 맞춰 카드와 사운드가 즉시 반응", ], "notes": ( "기존에 PPT를 띄워놓고 화면만 녹화하면 시청자가 금방 지루해집니다. || Recording static PPT slides quickly loses viewer attention.\n" "그렇다고 프리미어로 카드와 효과음을 일일이 맞추면 편집 시간이 열 배로 늘어나죠. || Yet syncing cards and SFX manually in Premiere takes 10x longer.\n" "해결책은 음성과 화면, 효과음을 코드로 한 번에 동기화하는 것입니다. || The answer is syncing voice, visuals, and SFX together in code." ), }, { "title": "반복되는 편집 규칙은 매뉴얼과 코드로 남긴다", "body": [ "[CHAPTER: 03 SYNC 원칙]", "[ARCHETYPE: book_quote]", "[BADGE: CHAPTER 03 · DESIGN SYSTEM]", "[QUOTE: 같은 디자인과 편집을 두 번 반복했다면, 이제 그 작업은 타임라인이 아니라 코드 템플릿에 있어야 한다.]", "상단 챕터 진행바와 하단 이중 자막 레이아웃을 고정 규칙으로 자산화", "교안 텍스트만 바뀌어도 일관된 브랜드 톤앤매너와 가독성 100% 유지", ], "notes": ( "매번 같은 스타일의 강조 효과와 자막을 손으로 찍고 있다면 바꿔야 합니다. || If you repeat the same highlights and captions by hand, change the workflow.\n" "디자인 규칙과 효과음 타이밍을 코드 템플릿으로 남겨두면 교안만 바꿔 계속 쓸 수 있습니다. || Once baked into a code template, any new deck inherits the exact same polish." ), }, { "title": "명령어 한 줄로 끝나는 PPTX 영상 변환 파이프라인", "body": [ "[CHAPTER: 04 자동 변환]", "[ARCHETYPE: terminal_flow]", "[BADGE: Automated CLI Pipeline]", "[COMMAND: python3 produce_deck_video.py --input lecture.pptx --sfx on]", "[FLOW_LEFT: 교육자료 · PPTX]", "[FLOW_LEFT_SUB: 슬라이드 · 발표노트 파싱]", "[FLOW_RIGHT: 1080p 모션 MP4]", "[FLOW_RIGHT_SUB: HTML 렌더링 + UI 효과음]", "슬라이드 제목·본문·발표자 노트를 읽어 씬 레이아웃 자동 배정", "전환 스우시, 카드 포커스 팝, 타이핑 사운드를 0.01초 단위로 배치", ], "notes": ( "실제 사용법은 아주 간단합니다. 교육자료나 파워포인트 파일 하나만 지정해 주세요. || Usage is simple: just point the pipeline at your PPTX or lesson file.\n" "엔진이 슬라이드 구조를 분석해 HTML 모션과 효과음까지 입힌 MP4 영상을 바로 뽑아냅니다. || It parses your slides and renders an MP4 complete with HTML motion and UI SFX." ), }, { "title": "앞으로 교육 영상 제작이 바뀌는 3단계", "body": [ "[CHAPTER: 05 핵심 요약]", "[ARCHETYPE: metric_summary]", "[BADGE: Ready For Production]", "[SUBTITLE: 자료 입력부터 효과음 마스터링까지 원스톱 자동화]", "교안 입력 | PPTX · 워드 · 마크다운 · HTML 지원", "모션·효과음 | 3D 웨이브·네온 카드·사운드 자동 싱크", "고화질 렌더링 | 끊김 없는 1080p MP4 영상 즉시 완성", ], "notes": ( "이제 파워포인트나 워드 교안만 준비하시면 모션 그래픽과 효과음은 파이프라인이 맡습니다. || Prepare your PPTX or Word docs—the pipeline handles motion and SFX.\n" "언제든 새로운 교육자료를 넣어 같은 포맷의 고품질 프레젠테이션 영상을 만들어 보세요! || Feed in any future training deck to produce sleek presentation videos anytime!" ), }, ]
for s in sample_slides: slide = prs.slides.add_slide(layout) slide.shapes.title.text = s["title"] tf = slide.placeholders[1].text_frame tf.clear() for idx, line in enumerate(s["body"]): p = tf.paragraphs[0] if idx == 0 else tf.add_paragraph() p.text = line slide.notes_slide.notes_text_frame.text = s["notes"]
prs.save(str(output_pptx)) return output_pptx
def create_sample_docx(output_docx: Path) -> Path: from docx import Document
output_docx.parent.mkdir(parents=True, exist_ok=True) doc = Document() doc.add_heading("AI 문서 자동 영상화 가이드", 0)
doc.add_heading("01 다중 포맷 입력", level=1) doc.add_heading("네 가지 실무 문서를 그대로 영상으로", level=2) doc.add_paragraph("파워포인트 | 발표 슬라이드와 발표자 노트 자동 추출", style="List Bullet") doc.add_paragraph("워드 문서 | 제목 스타일과 표·본문 단락 구조화", style="List Bullet") doc.add_paragraph("마크다운 · HTML | 기술 문서와 웹 슬라이드 즉시 파싱", style="List Bullet") doc.add_paragraph("> 실무에서 이미 쓰던 워드 기획서나 교육 교안을 새로 편집할 필요가 없습니다. || No need to re-edit existing Word specs or training docs.")
doc.add_heading("02 핵심 원칙", level=1) doc.add_heading("문서 구조가 곧 모션 스토리보드가 된다", level=2) doc.add_paragraph("같은 레이아웃 작업을 두 번 반복하지 말고 코드 파이프라인에 맡긴다.", style="Quote") doc.add_paragraph("제목은 챕터 바로, 목록은 네온 포커스 카드로 자동 매핑됩니다.")
doc.save(str(output_docx)) return output_docx
def create_sample_html_slides(output_html: Path) -> Path: output_html.parent.mkdir(parents=True, exist_ok=True) content = """<!doctype html><html lang="ko"><head><meta charset="utf-8"><title>웹 슬라이드 영상 변환 샘플</title></head><body> <section data-chapter="웹 슬라이드" data-badge="HTML Deck Import"> <h2>HTML 프레젠테이션도 그대로 MP4로</h2> <ul> <li>섹션 자동 인식 | Reveal.js 및 일반 웹 슬라이드 태그 파싱</li> <li>발표 노트 연동 | aside.notes 태그를 읽어 성우 내레이션 합성</li> <li>효과음 결합 | 화면 전환과 카드 포커스에 맞춰 UI 사운드 믹싱</li> </ul> <aside class="notes"> 웹으로 만든 HTML 발표 자료도 명령어 한 줄이면 효과음이 들어간 MP4 영상으로 변환됩니다. || Even HTML slide decks convert into SFX-synced MP4 videos in a single command. </aside> </section></body></html>""" output_html.write_text(content, encoding="utf-8") return output_html123456789101112131415161718192021222324252627282930313233343536#!/usr/bin/env bashset -euo pipefail
echo "=== Deck2Video Portable Setup (macOS / Linux) ==="SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"cd "$SCRIPT_DIR"
if ! command -v node >/dev/null 2>&1; then echo "[!] Node.js (v22+) is required. Install via: brew install node (macOS) or https://nodejs.org" exit 1fi
if ! command -v ffmpeg >/dev/null 2>&1; then echo "[!] FFmpeg is required. Install via: brew install ffmpeg (macOS) or sudo apt install ffmpeg (Linux)" exit 1fi
echo "[1/3] Creating Python virtual environment (.venv) and installing dependencies..."python3 -m venv .venvsource .venv/bin/activatepip install --upgrade pippip install -r requirements.txtpip install -e .
echo "[2/3] Warming up HyperFrames CLI & Headless Chromium..."npx --yes hyperframes --versionnpx --yes hyperframes browser ensure || true
echo "[3/3] Generating sample PPTX, DOCX, Markdown, and HTML templates..."python produce_deck_video.py --generate-samples
echo ""echo "✅ Setup Complete! Run with:"echo " source .venv/bin/activate"echo " deck2video --demo"echo " deck2video --input my_slides.pptx --output output/my_video.mp4"1234567891011121314151617181920212223#!/usr/bin/env bashset -euo pipefail
echo "=== Deck2Video 100% Offline Installer (macOS / Linux) ==="SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"cd "$SCRIPT_DIR"
WHEEL_DIR="$SCRIPT_DIR/offline_vendor/wheels"if [ ! -d "$WHEEL_DIR" ]; then echo "[!] offline_vendor/wheels not found. Please download the full offline package from Hugging Face." exit 1fi
python3 -m venv .venvsource .venv/bin/activatepip install --no-index --find-links="$WHEEL_DIR" -r requirements.txtpip install --no-index --find-links="$WHEEL_DIR" --no-build-isolation -e . || true
echo ""echo "✅ Offline Python environment ready!"echo " Ensure FFmpeg and Google Chrome / Chromium / Edge are installed locally, then run:"echo " source .venv/bin/activate"echo " python3 produce_deck_video.py --input samples/sample_ai_sync_lecture.pptx --offline --output output/offline_demo.mp4"12345678910111213141516171819$ErrorActionPreference = "Stop"Write-Host "=== Deck2Video 100% Offline Installer (Windows 10/11) ===" -ForegroundColor Cyan
Set-Location $PSScriptRoot$WheelDir = Join-Path $PSScriptRoot "offline_vendor\wheels"
if (-not (Test-Path $WheelDir)) { Write-Host "[!] offline_vendor\wheels not found. Download the full offline bundle from Hugging Face." -ForegroundColor Red exit 1}
python -m venv .venv& ".\.venv\Scripts\pip.exe" install --no-index --find-links="$WheelDir" -r requirements.txt& ".\.venv\Scripts\pip.exe" install --no-index --find-links="$WheelDir" --no-build-isolation -e .
Write-Host ""Write-Host "Offline setup complete! Run with:" -ForegroundColor GreenWrite-Host " .\.venv\Scripts\Activate.ps1"Write-Host " python produce_deck_video.py --input samples\sample_ai_sync_lecture.pptx --offline --output output\offline_demo.mp4"123456789101112131415161718192021222324252627282930313233$ErrorActionPreference = "Stop"Write-Host "=== Deck2Video Portable Setup (Windows 10/11 PowerShell) ===" -ForegroundColor Cyan
Set-Location $PSScriptRoot
if (-not (Get-Command node -ErrorAction SilentlyContinue)) { Write-Host "[!] Node.js (v22+) not found. Install via: winget install OpenJS.NodeJS.LTS" -ForegroundColor Yellow exit 1}
if (-not (Get-Command ffmpeg -ErrorAction SilentlyContinue)) { Write-Host "[!] FFmpeg not found. Install via: winget install Gyan.FFmpeg" -ForegroundColor Yellow exit 1}
Write-Host "[1/3] Creating Python virtual environment (.venv) and installing packages..."python -m venv .venv& ".\.venv\Scripts\python.exe" -m pip install --upgrade pip& ".\.venv\Scripts\pip.exe" install -r requirements.txt& ".\.venv\Scripts\pip.exe" install -e .
Write-Host "[2/3] Warming up HyperFrames CLI & Headless Chromium..."npx.cmd --yes hyperframes --versionnpx.cmd --yes hyperframes browser ensure
Write-Host "[3/3] Generating sample PPTX, DOCX, Markdown, and HTML templates..."& ".\.venv\Scripts\python.exe" produce_deck_video.py --generate-samples
Write-Host ""Write-Host "Setup Complete! Run with:" -ForegroundColor GreenWrite-Host " .\.venv\Scripts\Activate.ps1"Write-Host " deck2video --demo"Write-Host " deck2video --input C:\path\to\lecture.pptx --output .\output\lecture.mp4"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387"""Zero-NPM Air-Gapped Offline HTML-to-MP4 Renderer (`offline_renderer.py`)Drives any locally installed Chromium / Google Chrome / Microsoft Edge via rawChrome DevTools Protocol (CDP) over localhost WebSocket (Python stdlib only —zero Playwright / zero Node.js required!) + sample-accurate NumPy/FFmpeg audiomixing for Voiceover + UI SFX + BGM."""
from __future__ import annotationsimport base64import http.serverimport jsonimport osimport platformimport shutilimport socketimport structimport subprocessimport tempfileimport threadingimport timeimport urllib.requestimport wavefrom pathlib import Pathfrom typing import Anyimport numpy as np
def _is_working_browser(path_str: str) -> bool: if not path_str or not Path(path_str).exists(): return False try: res = subprocess.run([path_str, "--version"], capture_output=True, timeout=4) return res.returncode == 0 except Exception: return False
def _find_local_browser() -> str: env_b = os.environ.get("CHROME_BIN") if env_b and _is_working_browser(env_b): return env_b
# Check HyperFrames cached headless shell first if present hf_cache = Path.home() / ".cache" / "hyperframes" / "chrome" if hf_cache.exists(): for exe_name in ("chrome-headless-shell", "chrome", "chrome.exe"): for m in hf_cache.rglob(exe_name): if _is_working_browser(str(m)): return str(m)
candidates = [] sys_name = platform.system().lower() if sys_name == "darwin": candidates = [ "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge", "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser", "/Applications/Chromium.app/Contents/MacOS/Chromium", ] elif sys_name == "windows": pf = os.environ.get("PROGRAMFILES", r"C:\Program Files") pfx86 = os.environ.get("PROGRAMFILES(X86)", r"C:\Program Files (x86)") local_app = os.environ.get("LOCALAPPDATA", "") candidates = [ rf"{pf}\Google\Chrome\Application\chrome.exe", rf"{pfx86}\Google\Chrome\Application\chrome.exe", rf"{local_app}\Google\Chrome\Application\chrome.exe", rf"{pf}\Microsoft\Edge\Application\msedge.exe", rf"{pfx86}\Microsoft\Edge\Application\msedge.exe", ] else: candidates = ["/usr/bin/google-chrome", "/usr/bin/chromium", "/usr/bin/chromium-browser"]
for cmd in ("google-chrome", "chromium", "chromium-browser", "msedge", "brave-browser"): found = shutil.which(cmd) if found: candidates.append(found)
for c in candidates: if _is_working_browser(c): return c
raise RuntimeError("No working local Chrome, Edge, or Chromium browser found for offline rendering.")
class _MiniCDPClient: """Minimal stdlib WebSocket client for localhost Chrome DevTools Protocol."""
def __init__(self, ws_url: str): # ws://127.0.0.1:PORT/devtools/page/ID rest = ws_url.replace("ws://", "") host_port, path = rest.split("/", 1) host, port_s = host_port.split(":") self.sock = socket.create_connection((host, int(port_s)), timeout=30) key = base64.b64encode(os.urandom(16)).decode("ascii") handshake = ( f"GET /{path} HTTP/1.1\r\n" f"Host: {host_port}\r\n" "Upgrade: websocket\r\n" "Connection: Upgrade\r\n" f"Sec-WebSocket-Key: {key}\r\n" "Sec-WebSocket-Version: 13\r\n\r\n" ) self.sock.sendall(handshake.encode("ascii")) buf = b"" while b"\r\n\r\n" not in buf: buf += self.sock.recv(4096) self._msg_id = 0
def _send_frame(self, text: str) -> None: payload = text.encode("utf-8") mask_key = os.urandom(4) header = bytearray([0x81]) # FIN + text frame length = len(payload) if length < 126: header.append(0x80 | length) elif length < 65536: header.append(0x80 | 126) header.extend(struct.pack("!H", length)) else: header.append(0x80 | 127) header.extend(struct.pack("!Q", length)) header.extend(mask_key) masked = bytes(b ^ mask_key[i % 4] for i, b in enumerate(payload)) self.sock.sendall(bytes(header) + masked)
def _recv_exact(self, n: int) -> bytes: chunks = [] rem = n while rem > 0: chunk = self.sock.recv(rem) if not chunk: raise EOFError("CDP socket closed") chunks.append(chunk) rem -= len(chunk) return b"".join(chunks)
def _recv_frame(self) -> str: while True: b1, b2 = self._recv_exact(2) opcode = b1 & 0x0F masked = bool(b2 & 0x80) length = b2 & 0x7F if length == 126: length = struct.unpack("!H", self._recv_exact(2))[0] elif length == 127: length = struct.unpack("!Q", self._recv_exact(8))[0] mask_key = self._recv_exact(4) if masked else b"" data = self._recv_exact(length) if masked: data = bytes(b ^ mask_key[i % 4] for i, b in enumerate(data)) if opcode == 0x8: raise EOFError("CDP WebSocket closed") if opcode == 0x9: # Ping -> Pong pong = bytearray([0x8A, 0x80]) + os.urandom(4) self.sock.sendall(bytes(pong)) continue if opcode == 0x1: return data.decode("utf-8")
def call(self, method: str, params: dict[str, Any] | None = None) -> dict[str, Any]: self._msg_id += 1 mid = self._msg_id self._send_frame(json.dumps({"id": mid, "method": method, "params": params or {}})) while True: msg = json.loads(self._recv_frame()) if msg.get("id") == mid: if "error" in msg: raise RuntimeError(f"CDP error on {method}: {msg['error']}") return msg.get("result", {})
def close(self) -> None: try: self.sock.close() except Exception: pass
def _decode_to_pcm48k(ffmpeg_bin: str, src_path: Path) -> np.ndarray: cmd = [ ffmpeg_bin, "-v", "error", "-i", str(src_path), "-f", "s16le", "-acodec", "pcm_s16le", "-ar", "48000", "-ac", "2", "-", ] res = subprocess.run(cmd, capture_output=True, check=True) arr = np.frombuffer(res.stdout, dtype=np.int16).astype(np.float32) / 32768.0 return arr.reshape(-1, 2)
def mix_offline_master_audio(ffmpeg_bin: str, spec: dict[str, Any], project_dir: Path, out_wav: Path) -> Path: """Sample-accurate 48kHz stereo master mix of all Voiceover + SFX + BGM tracks.""" sr = 48000 total_samples = int(round(spec["total_duration"] * sr)) + sr // 4 master = np.zeros((total_samples, 2), dtype=np.float32)
def place_clip(rel_src: str, start_sec: float, gain: float) -> None: p = project_dir / rel_src if not p.exists(): return pcm = _decode_to_pcm48k(ffmpeg_bin, p) * gain s0 = max(0, int(round(start_sec * sr))) s1 = min(total_samples, s0 + len(pcm)) if s1 > s0: master[s0:s1] += pcm[: s1 - s0]
if spec.get("bgm"): place_clip(spec["bgm"]["src"], float(spec["bgm"]["start"]), float(spec["bgm"]["volume"]))
for slide in spec.get("slides", []): for beat in slide.get("beats", []): place_clip(beat["src"], float(beat["start"]), 1.0)
for ev in spec.get("sfx_events", []): place_clip(ev["src"], float(ev["start"]), float(ev.get("volume", 0.3)))
# Soft limiter ceiling at -1.0 dBFS peak = float(np.max(np.abs(master))) if peak > 0.89: master *= 0.89 / peak
trim_len = int(round(spec["total_duration"] * sr)) pcm16 = np.clip(master[:trim_len] * 32767.0, -32768, 32767).astype(np.int16) out_wav.parent.mkdir(parents=True, exist_ok=True) with wave.open(str(out_wav), "wb") as wf: wf.setnchannels(2) wf.setsampwidth(2) wf.setframerate(sr) wf.writeframes(pcm16.tobytes()) return out_wav
def render_offline_via_local_browser( project_dir: Path, spec: dict[str, Any], output_mp4: Path, fps: int = 30,) -> Path: """Renders `project_dir/index.html` + audio stems to `output_mp4` with zero npm/internet.""" ffmpeg_bin = shutil.which("ffmpeg") or "/opt/homebrew/bin/ffmpeg" browser_bin = _find_local_browser()
# 1. Serve `project_dir` on an ephemeral localhost port class QuietHandler(http.server.SimpleHTTPRequestHandler): def __init__(self, *args: Any, **kwargs: Any): super().__init__(*args, directory=str(project_dir), **kwargs)
def log_message(self, format: str, *args: Any) -> None: pass
httpd = http.server.ThreadingHTTPServer(("127.0.0.1", 0), QuietHandler) http_port = httpd.server_address[1] srv_thread = threading.Thread(target=httpd.serve_forever, daemon=True) srv_thread.start()
with socket.socket() as s: s.bind(("127.0.0.1", 0)) cdp_port = s.getsockname()[1]
tmp_profile = Path(tempfile.mkdtemp(prefix="deck2video_cdp_")) master_wav = tmp_profile / "master_mix.wav" mix_offline_master_audio(ffmpeg_bin, spec, project_dir, master_wav)
is_headless_shell = "headless-shell" in Path(browser_bin).name.lower() browser_args = [browser_bin] if not is_headless_shell: browser_args.append("--headless=new") browser_args.extend([ "--disable-gpu-vsync", "--hide-scrollbars", "--mute-audio", "--no-first-run", "--no-default-browser-check", "--window-size=1920,1080", f"--user-data-dir={tmp_profile / 'profile'}", f"--remote-debugging-port={cdp_port}", f"http://127.0.0.1:{http_port}/index.html", ])
browser_proc = subprocess.Popen( browser_args, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, )
cdp: _MiniCDPClient | None = None try: ws_url = "" for _ in range(50): try: with urllib.request.urlopen(f"http://127.0.0.1:{cdp_port}/json", timeout=1) as resp: targets = json.loads(resp.read().decode("utf-8")) for tgt in targets: if tgt.get("type") == "page" and "webSocketDebuggerUrl" in tgt: ws_url = tgt["webSocketDebuggerUrl"] break if ws_url: break except Exception: time.sleep(0.15) if not ws_url: raise RuntimeError("Failed to attach to headless browser CDP endpoint.")
cdp = _MiniCDPClient(ws_url) cdp.call("Page.enable") cdp.call("Runtime.enable") cdp.call( "Emulation.setDeviceMetricsOverride", {"width": 1920, "height": 1080, "deviceScaleFactor": 1, "mobile": False}, )
# Wait for fonts and timeline registration cdp.call( "Runtime.evaluate", { "expression": "document.fonts.ready.then(() => Boolean(window.__timelines && window.__timelines['main']))", "awaitPromise": True, }, )
# Inject clip visibility helper matching HyperFrames [data-start, data-start + data-duration] init_js = """ window.__offlineSeek = function(t) { var clips = document.querySelectorAll('.clip[data-start]'); for (var i = 0; i < clips.length; i++) { var el = clips[i]; var st = parseFloat(el.getAttribute('data-start') || '0'); var dur = parseFloat(el.getAttribute('data-duration') || '999999'); el.style.visibility = (t >= st && t < st + dur) ? 'visible' : 'hidden'; } if (window.__timelines && window.__timelines['main']) { window.__timelines['main'].seek(t, false); } }; """ cdp.call("Runtime.evaluate", {"expression": init_js})
total_frames = max(1, int(round(spec["total_duration"] * fps))) output_mp4.parent.mkdir(parents=True, exist_ok=True)
ff_cmd = [ ffmpeg_bin, "-y", "-f", "image2pipe", "-vcodec", "mjpeg", "-framerate", str(fps), "-i", "-", "-i", str(master_wav), "-c:v", "libx264", "-preset", "fast", "-crf", "17", "-pix_fmt", "yuv420p", "-c:a", "aac", "-b:a", "192k", "-shortest", str(output_mp4), ] ff_proc = subprocess.Popen(ff_cmd, stdin=subprocess.PIPE, stderr=subprocess.PIPE) assert ff_proc.stdin is not None
for frame_idx in range(total_frames): t_sec = frame_idx / float(fps) cdp.call("Runtime.evaluate", {"expression": f"window.__offlineSeek({t_sec:.5f});"}) shot = cdp.call("Page.captureScreenshot", {"format": "jpeg", "quality": 94}) ff_proc.stdin.write(base64.b64decode(shot["data"])) if frame_idx % 60 == 0 or frame_idx == total_frames - 1: pct = int((frame_idx + 1) * 100 / total_frames) print(f"\r [Offline Renderer] {pct:3d}% ({frame_idx + 1}/{total_frames} frames)", end="", flush=True)
print() ff_proc.stdin.close() ff_proc.stdin = None _, stderr_bytes = ff_proc.communicate() if ff_proc.returncode != 0: raise RuntimeError(f"FFmpeg encode failed: {stderr_bytes.decode('utf-8', errors='ignore')[:600]}")
finally: if cdp: cdp.close() browser_proc.terminate() httpd.shutdown() shutil.rmtree(tmp_profile, ignore_errors=True)
return output_mp4123version https://git-lfs.github.com/spec/v1oid sha256:d079c0a0135c36e7beb6f1c88087c8f108dc5891cdd0b5eafa778421bda70ed2size 548067123version https://git-lfs.github.com/spec/v1oid sha256:20f085697d7e911f1f73c43ed03fafbed1e7121797e2eb5428efa80398060584size 1919630123version https://git-lfs.github.com/spec/v1oid sha256:2cc38a4f2b516bef1714e690df87a0e043faf1a7693c82d860091684453d5111size 506141123version https://git-lfs.github.com/spec/v1oid sha256:d6f88de62e1d4e38ecb1077eb9724cd0eff29d2a08ca16a401e9b9e93f117cf9size 109924123version https://git-lfs.github.com/spec/v1oid sha256:e9b54de76e530bb6cf0ccd036787103acb58fd42ba930ea8bf948ddbaa2f61d1size 135082123version https://git-lfs.github.com/spec/v1oid sha256:494a5952b1c597ba44e0e78113a7266e656b9794eec897b19ead706bd7074383size 242411123version https://git-lfs.github.com/spec/v1oid sha256:0c0710ac085a157b593c38fbcacd950f15c4afa8e2057527185875ab302752bcsize 8602094123version https://git-lfs.github.com/spec/v1oid sha256:379f8a75cf6eb7eef0af074b55f49ab73b868388a98de14646abcdfa4564bb11size 5105247123version https://git-lfs.github.com/spec/v1oid sha256:3e9a00d1c2c30936f7add097c41afc5da6556c580909104aafd382cac92a855csize 4005999123version https://git-lfs.github.com/spec/v1oid sha256:d37773029ba034a2cc970b6eeb67dad3bff9d894393c51f6bb1c6b4f563a032csize 103911123version https://git-lfs.github.com/spec/v1oid sha256:1fb8c1a3480c130c3a6422d5f16f3cad6552bf08c2089dd288ba7134649183b5size 516796123version https://git-lfs.github.com/spec/v1oid sha256:fd83c01228a688733f1ded5201c678f0c53ecc1006ffbc404db9f7a899ac6249size 16527618123version https://git-lfs.github.com/spec/v1oid sha256:a3856a97e48ed8371c680fb04120b99fbcc29f2076ebe6dc3deb34f77947c5casize 5513680123version https://git-lfs.github.com/spec/v1oid sha256:919eb420662b0b4ba34889df503f3d5329775b0c1d5f7e5f5af4fba8315b1e30size 12580189123version https://git-lfs.github.com/spec/v1oid sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1csize 129956123version https://git-lfs.github.com/spec/v1oid sha256:b86024e52a1b269467a802258c25521e6d742349d760728092e1bc2d135b4d76size 8094744123version https://git-lfs.github.com/spec/v1oid sha256:fc481f742ccda20e9ed760b8f978dff50f2a4e9bc253ac167fb0a05b0783ef52size 4852329123version https://git-lfs.github.com/spec/v1oid sha256:ff3fe9eb621fbb9db4c4be33ab946f6bac5f98ab50ca8d3260503653656c961bsize 7272166.gitattributes+35
DockerfileAdded+21
README.mdAdded+90
SKILL.mdAdded+73
__init__.pyAdded+1
assets/bgm/deno-bgm-001.mp3Added+3
assets/bgm/offline_ambient_pad.wavAdded+3
assets/fonts/PretendardVariable.woff2Added+3
assets/js/gsap.min.jsAdded+11
assets/sfx/sfx_card_pop.wavAdded
assets/sfx/sfx_counter_tick.wavAdded+3
assets/sfx/sfx_highlighter_sweep.wavAdded+3
assets/sfx/sfx_insight_chime.wavAdded+3
assets/sfx/sfx_terminal_type.wavAdded+3
assets/sfx/sfx_whoosh.wavAdded+3
bgm_engine.pyAdded+83
deck2video_offline_full.zipAdded+3
html_builder.pyAdded+1572
ingest_parser.pyAdded+731
install_mac_linux.shAdded+36
install_offline_mac_linux.shAdded+23
install_offline_windows.ps1Added+19
install_windows.ps1Added+33
offline_renderer.pyAdded+387
offline_vendor/wheels/aiohappyeyeballs-2.7.1-py3-none-any.whlAdded
offline_vendor/wheels/aiohttp-3.14.5-cp312-cp312-macosx_11_0_arm64.whlAdded+3
offline_vendor/wheels/aiohttp-3.14.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whlAdded+3
offline_vendor/wheels/aiohttp-3.14.5-cp312-cp312-win_amd64.whlAdded+3
offline_vendor/wheels/aiosignal-1.4.0-py3-none-any.whlAdded
offline_vendor/wheels/attrs-26.1.0-py3-none-any.whlAdded
offline_vendor/wheels/beautifulsoup4-4.15.0-py3-none-any.whlAdded+3
offline_vendor/wheels/certifi-2026.10.23-py3-none-any.whlAdded+3
offline_vendor/wheels/edge_tts-7.3.1-py3-none-any.whlAdded
offline_vendor/wheels/frozenlist-1.8.0-cp312-cp312-macosx_11_0_arm64.whlAdded
offline_vendor/wheels/frozenlist-1.8.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whlAdded+3
offline_vendor/wheels/frozenlist-1.8.0-cp312-cp312-win_amd64.whlAdded
offline_vendor/wheels/idna-3.20-py3-none-any.whlAdded
offline_vendor/wheels/lxml-6.1.3-cp312-cp312-macosx_10_13_universal2.whlAdded+3
offline_vendor/wheels/lxml-6.1.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whlAdded+3
offline_vendor/wheels/lxml-6.1.3-cp312-cp312-win_amd64.whlAdded+3
offline_vendor/wheels/multidict-7.2.1-cp312-cp312-macosx_11_0_arm64.whlAdded+3
offline_vendor/wheels/multidict-7.2.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whlAdded+3
offline_vendor/wheels/multidict-7.2.1-cp312-cp312-win_amd64.whlAdded
offline_vendor/wheels/numpy-2.2.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whlAdded+3
offline_vendor/wheels/numpy-2.5.5-cp312-cp312-macosx_14_0_arm64.whlAdded+3
offline_vendor/wheels/numpy-2.5.5-cp312-cp312-win_amd64.whlAdded+3
offline_vendor/wheels/packaging-26.3-py3-none-any.whlAdded+3
offline_vendor/wheels/pillow-12.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whlAdded+3
offline_vendor/wheels/pillow-13.0.0-cp312-cp312-macosx_11_0_arm64.whlAdded+3
offline_vendor/wheels/pillow-13.0.0-cp312-cp312-win_amd64.whlAdded+3