hyperframes 0.7.58 → 0.7.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/cli.js +3434 -2249
  2. package/dist/commands/layout-audit.browser.js +54 -30
  3. package/dist/hyperframe-runtime.js +26 -26
  4. package/dist/hyperframe.manifest.json +1 -1
  5. package/dist/hyperframe.runtime.iife.js +26 -26
  6. package/dist/hyperframes-player.global.js +1 -1
  7. package/dist/skills/hyperframes/SKILL.md +103 -124
  8. package/dist/skills/hyperframes/references/capability-menu.md +47 -0
  9. package/dist/skills/hyperframes/references/pitch-round.md +40 -0
  10. package/dist/skills/hyperframes/references/route-briefs.md +85 -0
  11. package/dist/skills/hyperframes/references/skill-lifecycle.md +33 -0
  12. package/dist/skills/hyperframes/references/workflow-catalog.md +70 -0
  13. package/dist/skills/hyperframes-cli/SKILL.md +99 -109
  14. package/dist/skills/hyperframes-cli/references/beats.md +19 -0
  15. package/dist/skills/hyperframes-cli/references/cloud.md +8 -3
  16. package/dist/skills/hyperframes-cli/references/cloudrun.md +62 -0
  17. package/dist/skills/hyperframes-cli/references/compare-and-batch.md +105 -0
  18. package/dist/skills/hyperframes-cli/references/lambda.md +77 -24
  19. package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +3 -3
  20. package/dist/skills/hyperframes-cli/references/preview-render.md +4 -0
  21. package/dist/skills/hyperframes-cli/references/upgrade-info-misc.md +2 -0
  22. package/dist/studio/assets/{hyperframes-player-CtTDO63S.js → hyperframes-player-Bm07FLkl.js} +1 -1
  23. package/dist/studio/assets/{index-C47jAC3Q.js → index-B995FG46.js} +1 -1
  24. package/dist/studio/assets/index-CrkAdJkb.js +426 -0
  25. package/dist/studio/assets/index-Dj5p8U_A.css +1 -0
  26. package/dist/studio/assets/{index-DeQPzqwH.js → index-FvzmPhfG.js} +1 -1
  27. package/dist/studio/index.d.ts +12 -3
  28. package/dist/studio/index.html +2 -2
  29. package/dist/studio/index.js +13514 -8528
  30. package/dist/studio/index.js.map +1 -1
  31. package/dist/studio/styles/tailwind-preset.d.ts +5 -0
  32. package/dist/studio/styles/tailwind-preset.js +8 -1
  33. package/dist/studio/styles/tailwind-preset.js.map +1 -1
  34. package/dist/templates/_shared/AGENTS.md +5 -4
  35. package/dist/templates/_shared/CLAUDE.md +5 -4
  36. package/package.json +2 -2
  37. package/dist/studio/assets/index-B_UvTX3E.js +0 -423
  38. package/dist/studio/assets/index-uahwWkgw.css +0 -1
@@ -1,6 +1,21 @@
1
- # lambda Cloud Rendering on AWS Lambda
1
+ # Lambda rendering on AWS
2
2
 
3
- Deploy HyperFrames distributed rendering to AWS Lambda and drive renders from your laptop or CI. Wraps `@hyperframes/aws-lambda` SDK plus AWS SAM. End-to-end is three commands:
3
+ Use `hyperframes lambda` when the user explicitly wants self-managed AWS infrastructure or needs distributed rendering. It wraps `@hyperframes/aws-lambda` and AWS SAM.
4
+
5
+ ## Contents
6
+
7
+ - [Choose Lambda or local rendering](#choose-lambda-or-local-rendering)
8
+ - [Prerequisites](#prerequisites)
9
+ - [Deploy](#deploy)
10
+ - [Upload a reusable site](#upload-a-reusable-site)
11
+ - [Render one composition](#render-one-composition)
12
+ - [Render a JSONL batch](#render-a-jsonl-batch)
13
+ - [Inspect progress](#inspect-progress)
14
+ - [Destroy the stack](#destroy-the-stack)
15
+ - [IAM policies](#iam-policies)
16
+ - [State, cost, and cleanup](#state-cost-and-cleanup)
17
+
18
+ The basic lifecycle is:
4
19
 
5
20
  ```bash
6
21
  npx hyperframes lambda deploy
@@ -8,7 +23,7 @@ npx hyperframes lambda render ./my-project --width 1920 --height 1080 --wait
8
23
  npx hyperframes lambda destroy
9
24
  ```
10
25
 
11
- ## When to Use Lambda vs Local Render
26
+ ## Choose Lambda or local rendering
12
27
 
13
28
  - **Local `render`** — dev-loop iteration, single host, anything under a few minutes at 1080p.
14
29
  - **`lambda render`** — long videos, 4K, large parallel batches, or anything where local Chrome would time out / exhaust RAM. Pay-per-invocation, no idle cost.
@@ -21,9 +36,7 @@ For one-off short renders Lambda is not worth the deploy overhead.
21
36
  - AWS SAM CLI on `PATH`.
22
37
  - `bun` on `PATH` (builds the Lambda handler ZIP).
23
38
 
24
- ## Subcommands
25
-
26
- ### deploy
39
+ ## Deploy
27
40
 
28
41
  ```bash
29
42
  npx hyperframes lambda deploy \
@@ -35,16 +48,17 @@ npx hyperframes lambda deploy \
35
48
 
36
49
  Builds `packages/aws-lambda/dist/handler.zip` and SAM-deploys the stack (Lambda + Step Functions + S3 + IAM). Idempotent — re-running on the same `--stack-name` is a no-op when nothing changed. Writes `<cwd>/.hyperframes/lambda-stack-<name>.json` so later subcommands don't need to call `describe-stacks`.
37
50
 
38
- | Flag | Default | Description |
39
- | --------------- | ------------------------------- | ----------------------------- |
40
- | `--stack-name` | `hyperframes-default` | CloudFormation stack name |
41
- | `--region` | `AWS_REGION` env or `us-east-1` | AWS region |
42
- | `--profile` | `AWS_PROFILE` env | Named AWS credentials profile |
43
- | `--concurrency` | `8` | Lambda reserved concurrency |
44
- | `--memory` | `10240` | Lambda memory in MB |
45
- | `--skip-build` | off | Reuse existing `handler.zip` |
51
+ | Flag | Default | Description |
52
+ | ----------------- | ------------------------------- | -------------------------------------- |
53
+ | `--stack-name` | `hyperframes-default` | CloudFormation stack name |
54
+ | `--region` | `AWS_REGION` env or `us-east-1` | AWS region |
55
+ | `--profile` | `AWS_PROFILE` env | Named AWS credentials profile |
56
+ | `--concurrency` | `8` | Lambda reserved concurrency |
57
+ | `--chrome-source` | `sparticuz` | `sparticuz` or `chrome-headless-shell` |
58
+ | `--memory` | `10240` | Lambda memory in MB |
59
+ | `--skip-build` | off | Reuse existing `handler.zip` |
46
60
 
47
- ### sites create
61
+ ## Upload a reusable site
48
62
 
49
63
  ```bash
50
64
  npx hyperframes lambda sites create ./my-project
@@ -55,7 +69,7 @@ npx hyperframes lambda render ./my-project --site-id=abc1234deadbeef0 ...
55
69
 
56
70
  Tars + uploads `<projectDir>` to S3 with a content-addressed key. Returns a stable `siteId` you can reuse — re-renders of the same tree skip the upload.
57
71
 
58
- ### render
72
+ ## Render one composition
59
73
 
60
74
  ```bash
61
75
  npx hyperframes lambda render ./my-project \
@@ -71,18 +85,59 @@ Starts a Step Functions execution. Returns immediately with a `renderId` unless
71
85
  | `--width` / `--height` | Output dimensions in pixels |
72
86
  | `--output-resolution` | Supersampling preset (engages Chrome `deviceScaleFactor`) — `landscape` / `landscape-4k` / `portrait` / `portrait-4k` / `square` / `square-4k`, plus aliases (`1080p`, `4k`, `uhd`, `hd`, `1080p-portrait`, `4k-portrait`, `1080p-square`, `4k-square`). Use this to render an authored-at-1080p composition at 4K without re-laying-out — see footgun below. |
73
87
  | `--fps` | `24` / `30` / `60` |
74
- | `--format` | `mp4` / `mov` / `png-sequence` (default `mp4`) |
88
+ | `--format` | `mp4` / `mov` / `png-sequence` / `webm` (default `mp4`) |
75
89
  | `--codec` | `h264` / `h265` (mp4 only) |
76
90
  | `--quality` | `draft` / `standard` / `high` |
77
91
  | `--chunk-size` | Frames per chunk (default `240`) |
78
92
  | `--max-parallel-chunks` | Max concurrent chunks (default `16`) |
93
+ | `--target-chunk-frames` | Cap frames per chunk and let the planner add chunks up to the parallel limit |
79
94
  | `--site-id` | Reuse an existing site (skip upload) |
95
+ | `--execution-name` | Explicit Step Functions execution name |
96
+ | `--output-key` | Explicit final S3 object key |
97
+ | `--variables` | Inline JSON object with composition variable values |
98
+ | `--variables-file` | JSON file containing one composition variable object |
99
+ | `--strict-variables` | Fail when supplied variables are undeclared or have the wrong type |
80
100
  | `--wait` | Block until completion, stream progress |
101
+ | `--wait-interval-ms` | Poll cadence while waiting (default `5000`) |
81
102
  | `--json` | Machine-parseable progress snapshot |
82
103
 
83
104
  **`--width` / `--height` footgun.** Setting `--width 3840 --height 2160` against a composition whose `data-width="1920"` silently produces 1080p — the runtime lays out the page at the composition's authored dimensions and the CLI flags are ignored for layout. To actually output at 4K, use `--output-resolution 4k` (supersamples via `deviceScaleFactor`). The CLI now prints a warning when CLI dimensions disagree with the composition's `data-width` / `data-height` and `--output-resolution` is not set; the warning is suppressed when `--json` is on or `index.html` isn't on disk (`--site-id` flows).
84
105
 
85
- ### progress
106
+ For variable-driven templates, declare the schema in the composition and pass either `--variables` or `--variables-file`, never both. `--strict-variables` checks local project input before any render starts. Also read [`variables-and-media.md`](../../hyperframes-core/references/variables-and-media.md#variables).
107
+
108
+ ## Render a JSONL batch
109
+
110
+ Use `render-batch` to upload one template once and start one Step Functions execution per nonblank JSONL line:
111
+
112
+ ```bash
113
+ npx hyperframes lambda render-batch ./template \
114
+ --batch ./users.jsonl \
115
+ --width 1920 --height 1080 \
116
+ --max-concurrent 10 \
117
+ --strict-variables \
118
+ --json
119
+ ```
120
+
121
+ Each line must be an object with a non-empty `outputKey`. Choose unique keys to prevent outputs from overwriting one another. `variables` and `executionName` are optional:
122
+
123
+ ```json
124
+ {
125
+ "outputKey": "renders/alice.mp4",
126
+ "variables": { "name": "Alice" },
127
+ "executionName": "alice-video"
128
+ }
129
+ ```
130
+
131
+ Batch rules:
132
+
133
+ - The project is uploaded once unless `--site-id` reuses an earlier upload.
134
+ - `--max-concurrent` defaults to `50` and limits in-flight render executions. `--max-parallel-chunks` separately limits chunks inside each render.
135
+ - `--strict-variables` checks every entry, reports all variable issues, and aborts before AWS calls.
136
+ - `--dry-run` performs no upload or AWS render call. Every manifest row becomes `would-invoke`.
137
+ - The emitted manifest preserves input order and records `inputLine`, `outputKey`, `executionArn`, and `status` (`started`, `would-invoke`, or `failed-to-start`), plus an error when applicable.
138
+ - A per-entry start failure does not hide other rows. Human-output mode exits nonzero when a row fails to start. In `--json` mode the current CLI prints the manifest and exits zero, so gate on every row's `status`, not the process code alone. Dispatch success is not render completion; inspect each execution with `progress`.
139
+
140
+ ## Inspect progress
86
141
 
87
142
  ```bash
88
143
  npx hyperframes lambda progress hf-render-abcd1234
@@ -91,7 +146,7 @@ npx hyperframes lambda progress arn:aws:states:us-east-1:...:execution:...
91
146
 
92
147
  Prints one snapshot — overall percent, frames rendered, Lambda invocations, accrued cost, and any errors. Accepts a bare `renderId` (resolved against the stack's state-machine ARN) or a full SFN execution ARN.
93
148
 
94
- ### destroy
149
+ ## Destroy the stack
95
150
 
96
151
  ```bash
97
152
  npx hyperframes lambda destroy
@@ -106,13 +161,13 @@ A subset of failures the Step Functions state machine short-circuits instead of
106
161
  - **`ChromeBinaryUnavailableError`** — `@sparticuz/chromium` returned an empty/missing executable path. A prior chunk hit `Sandbox.Timedout` mid-extraction and the warm instance is wedged until the execution environment recycles. Remedy: bump a Lambda env var (forces a new exec env) or `lambda deploy` again. Not a transient render failure; retries will burn budget on the same wedged instance.
107
162
  - **`FFMPEG_VERSION_MISMATCH`** / **`PLAN_HASH_MISMATCH`** — planner / executor version drift. Re-deploy.
108
163
 
109
- ### policies
164
+ ## IAM policies
110
165
 
111
166
  Print or validate the minimum IAM permissions the CLI needs.
112
167
 
113
168
  ```bash
114
169
  npx hyperframes lambda policies user # inline policy for an IAM user
115
- npx hyperframes lambda policies role --principal=cloudformation # { TrustRelationship, InlinePolicy }
170
+ npx hyperframes lambda policies role # { TrustRelationship, InlinePolicy }
116
171
  npx hyperframes lambda policies validate ./infra/iam/hf-deploy.json # CI gate
117
172
  ```
118
173
 
@@ -120,12 +175,10 @@ npx hyperframes lambda policies validate ./infra/iam/hf-deploy.json # CI gate
120
175
 
121
176
  The default action set is deliberately broad (`Resource: "*"`) because CloudFormation creates new ARNs on every adopter's first deploy. Tighten `Resource` after that first run if security posture requires it.
122
177
 
123
- ## State Files
178
+ ## State, cost, and cleanup
124
179
 
125
180
  `hyperframes lambda` stores per-stack metadata under `<cwd>/.hyperframes/lambda-stack-<name>.json` (bucket name, state-machine ARN, region). Not secret, but AWS-account-identifying. Commit it to a repo or `.gitignore` it per your workflow.
126
181
 
127
- ## Cost and Cleanup
128
-
129
182
  - `lambda destroy` removes the SAM stack but **leaves the S3 bucket** (`Retain`). Delete it manually if you want the storage back.
130
183
  - Lambda billing is per-invocation + duration. `progress` reports the accrued cost.
131
184
  - `--concurrency` caps parallel Lambda invocations — keep it aligned with your account quota.
@@ -1,12 +1,12 @@
1
1
  # lint, check, snapshot
2
2
 
3
- The correctness pipeline: `lint` (static, fast) while iterating, then `check` (one browser session: runtime + layout + motion + contrast) as the gate. `snapshot` is the standalone utility for capturing still frames and zoomed crops. `validate`, `inspect`, and `layout` still run but are deprecated: `check` covers all of them in one invocation.
3
+ Use `lint` for fast static feedback while iterating. Use `check` as the required final gate: it reruns the same linter, then audits runtime, layout, motion, and contrast in one browser session. Do not chain a redundant standalone `lint` immediately before `check`. `snapshot` is the standalone utility for capturing still frames and zoomed crops. `validate`, `inspect`, and `layout` still run but are deprecated: `check` covers all of them in one invocation.
4
4
 
5
5
  ## Discipline (motion-heavy work)
6
6
 
7
7
  When the composition is animation-driven, run the checks before you reach for `preview` or `render`:
8
8
 
9
- - Run `lint` after the first HTML pass, earlier rather than later.
9
+ - Run `lint` after the first HTML pass for early feedback. It is an iteration aid, not a separate final gate.
10
10
  - Run `check --snapshots` at the first full pass: the overview frames and per-finding crops show you what the auditor saw.
11
11
  - Look at the PNGs before tuning automated warnings: your eye catches what the auditor misses, and the auditor catches what your eye misses.
12
12
  - Treat layout errors as defects unless a snapshot proves the layering is intentional, in which case mark it with `data-layout-allow-overflow` / `data-layout-allow-overlap` / `data-layout-allow-occlusion`.
@@ -56,7 +56,7 @@ One command, one Chrome boot. `check` runs the linter first and skips the browse
56
56
 
57
57
  Every finding carries a selector, the element's `data-*` identity, the composition source file, a bbox, and the sample time: jump straight from the JSON to the HTML you must edit and re-run.
58
58
 
59
- **Severity is persistence-aware.** A dynamic issue observed at a single grid sample (an entrance/exit transient) demotes to info and never gates. Issues held across samples gate the exit code, a held `content_overlap` is an error, and a held, partially-visible `canvas_overflow` breaching ≥5% of the canvas promotes to warning. Coordinate-frame findings (`escaped_container`, `panel_out_of_canvas`, `connector_detached`) flag geometry computed in one frame but rendered in another — an element far outside its offset parent, a painted panel stuck across the canvas edge, a connector line detached from every node. If a 3s+ composition shows zero geometry change across every sample, `check` fails with `sweep_static`: a frozen timeline makes every green verdict unreliable, so it refuses to pass.
59
+ **Severity is persistence-aware.** A dynamic issue observed at a single grid sample (an entrance/exit transient) demotes to info and never gates. Issues held across samples gate the exit code, a held `content_overlap` is an error, and a held, partially-visible `canvas_overflow` breaching ≥5% of the canvas promotes to warning. Coordinate-frame findings (`escaped_container`, `panel_out_of_canvas`, `connector_detached`) flag geometry computed in one frame but rendered in another — an element far outside its offset parent, a painted panel stuck across the canvas edge, a connector line detached from every node. If a 3s+ composition shows zero geometry change across every sample, `check` fails with `sweep_static`: a frozen timeline makes every green verdict unreliable, so it refuses to pass. The fingerprint includes per-element opacity, so opacity-only reveals (code typing, staggered fades) count as motion — but only while they're still in flight at the sampled times. The classic trap is a reveal that completes early and then holds a static frame for the rest of the duration: every sample lands on the settled state and the run fails. Spread the reveal across the timeline or keep one continuously animated element alive (a blinking caret is idiomatic for code typing) — don't bolt on a slow position drift just to appease the check.
60
60
 
61
61
  **Escape hatches** (mark intent in the HTML, then re-run):
62
62
 
@@ -21,6 +21,10 @@ http://localhost:<port>/#project/<project-name>
21
21
 
22
22
  Use the actual port and project directory name; treat `index.html` as source-code context, not the preview surface. For example, after `npx hyperframes preview --port 3017` in `codex-openai-video`, report `http://localhost:3017/#project/codex-openai-video`.
23
23
 
24
+ To land the user on the **Storyboard view** instead of the timeline, put `?view=storyboard` ahead of the hash: `http://localhost:<port>/?view=storyboard#project/<project-name>`. Hand this URL whenever the storyboard is the thing to review and nothing is assembled yet — before `index.html` exists, the timeline stage has nothing to show, so the bare project URL opens on an empty player.
25
+
26
+ Two ways a handed URL turns out dead — check both before handing it back: the URL is missing its `#project/<project-name>` hash (Studio loads but has no project to open), or the server is not actually running. `preview` is a long-running process — start it from the project directory as a background task, and if that task reports it exited ("completed"), the server is down: restart it, don't hand out the link.
27
+
24
28
  ### Agent context from Studio selection
25
29
 
26
30
  `preview --context` and `preview --selection` are the agent bridge into a running Studio session. They do **not** start a new server; they find the active preview server for the current project, read agent-useful state from Studio, print it, and exit.
@@ -23,6 +23,8 @@ npx hyperframes upgrade --yes # print upgrade commands without promptin
23
23
 
24
24
  Compares the installed CLI version against npm latest.
25
25
 
26
+ `--project [dir]` bumps a **project's** pinned scripts instead of the global install: it rewrites every `npx …hyperframes@<version>…` in `<dir>/package.json` (default cwd) to npm-latest. Always invoke it unpinned (`npx hyperframes@latest upgrade --project`) — a project scaffolded on an old CLI stays frozen otherwise. `--project --check` reports the delta without writing; add `--json` for `{ changed, from, to, path }`.
27
+
26
28
  ## compositions, docs
27
29
 
28
30
  ```bash
@@ -1,4 +1,4 @@
1
- var ue=Object.defineProperty;var ce=(r,t,e)=>t in r?ue(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var u=(r,t,e)=>ce(r,typeof t!="symbol"?t+"":t,e);import{i as pe,r as me}from"./index-B_UvTX3E.js";function fe(r){return r.hasRuntime||r.runtimeInjected?!1:!!(r.hasNestedCompositions||r.hasTimelines&&r.attempts>=5)}function F(r){return typeof r=="object"&&r!==null}function _e(r){return F(r)&&typeof r.getDuration=="function"}function ge(r){return F(r)&&typeof r.duration=="function"&&typeof r.time=="function"&&typeof r.seek=="function"&&typeof r.play=="function"&&typeof r.pause=="function"}function ye(r){if(!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(r))throw new Error(`Invalid HyperFrames runtime version: ${r}`);return`https://cdn.jsdelivr.net/npm/@hyperframes/core@${r}/dist/hyperframe.runtime.iife.js`}const ve=typeof __HYPERFRAMES_RUNTIME_CDN_URL__=="string"?__HYPERFRAMES_RUNTIME_CDN_URL__:ye("0.0.0-dev");function H(r){if(r===null)return null;const t=Number.parseInt(r,10);return Number.isFinite(t)&&t>0?t:null}function be(r){const t=(r==null?void 0:r.querySelector("[data-composition-id][data-width][data-height]"))??(r==null?void 0:r.querySelector("[data-width][data-height]"));if(!t)return null;const e=H(t.getAttribute("data-width")),i=H(t.getAttribute("data-height"));return e!==null&&i!==null?{width:e,height:i}:null}class we{constructor(t,e){u(this,"_interval",null);u(this,"_runtimeInjected",!1);this._iframe=t,this._callbacks=e}get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._runtimeInjected=!1;let t=0;this._interval=setInterval(()=>{var e;t++;try{const i=this._iframe.contentWindow;if(!i)return;const s=!!(i.__hf||i.__player),o=!!(i.__timelines&&Object.keys(i.__timelines).length>0),a=!!((e=this._iframe.contentDocument)!=null&&e.querySelector("[data-composition-src]"));if(fe({hasRuntime:s,hasTimelines:o,hasNestedCompositions:a,runtimeInjected:this._runtimeInjected,attempts:t})){this._injectRuntime();return}if(this._runtimeInjected&&!s)return;const d=this._resolvePlaybackDurationAdapter(i);if(d&&d.getDuration()>0){this.stop();const h=be(this._iframe.contentDocument);this._callbacks.onReady({duration:d.getDuration(),adapter:d,compositionSize:h});return}}catch{}t>=40&&(this.stop(),this._callbacks.onError("Composition timeline not found after 8s"))},200)}stop(){this._interval!==null&&(clearInterval(this._interval),this._interval=null)}resolveDirectTimelineAdapter(){try{const t=this._iframe.contentWindow;return t?this._resolveDirectTimelineAdapterFromWindow(t):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(t){return this._resolveDirectTimelineAdapterFromWindow(t)}hasRuntimeBridge(t){return Reflect.get(t,"__hf")!==void 0||F(Reflect.get(t,"__player"))}_injectRuntime(){var t,e;this._runtimeInjected=!0;try{const i=this._iframe.contentDocument;if(!i)return;const s=i.createElement("script");s.src=ve,(i.head||i.documentElement).appendChild(s),(e=(t=this._callbacks).onRuntimeInjected)==null||e.call(t)}catch{}}_resolveDirectTimelineAdapterFromWindow(t){var d,h;if(this.hasRuntimeBridge(t))return null;const e=Reflect.get(t,"__timelines");if(!F(e))return null;const i=Object.keys(e);if(i.length===0)return null;const s=(h=(d=this._iframe.contentDocument)==null?void 0:d.querySelector("[data-composition-id]"))==null?void 0:h.getAttribute("data-composition-id"),o=s&&s in e?s:i[i.length-1],a=e[o];return ge(a)?a:null}_resolvePlaybackDurationAdapter(t){const e=Reflect.get(t,"__player");if(_e(e))return{kind:"runtime",getDuration:()=>e.getDuration()};const i=this._resolveDirectTimelineAdapterFromWindow(t);return i?{kind:"direct-timeline",timeline:i,getDuration:()=>i.duration()}:null}}const Ae=`
1
+ var ue=Object.defineProperty;var ce=(r,t,e)=>t in r?ue(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var u=(r,t,e)=>ce(r,typeof t!="symbol"?t+"":t,e);import{i as pe,r as me}from"./index-CrkAdJkb.js";function fe(r){return r.hasRuntime||r.runtimeInjected?!1:!!(r.hasNestedCompositions||r.hasTimelines&&r.attempts>=5)}function F(r){return typeof r=="object"&&r!==null}function _e(r){return F(r)&&typeof r.getDuration=="function"}function ge(r){return F(r)&&typeof r.duration=="function"&&typeof r.time=="function"&&typeof r.seek=="function"&&typeof r.play=="function"&&typeof r.pause=="function"}function ye(r){if(!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(r))throw new Error(`Invalid HyperFrames runtime version: ${r}`);return`https://cdn.jsdelivr.net/npm/@hyperframes/core@${r}/dist/hyperframe.runtime.iife.js`}const ve=typeof __HYPERFRAMES_RUNTIME_CDN_URL__=="string"?__HYPERFRAMES_RUNTIME_CDN_URL__:ye("0.0.0-dev");function H(r){if(r===null)return null;const t=Number.parseInt(r,10);return Number.isFinite(t)&&t>0?t:null}function be(r){const t=(r==null?void 0:r.querySelector("[data-composition-id][data-width][data-height]"))??(r==null?void 0:r.querySelector("[data-width][data-height]"));if(!t)return null;const e=H(t.getAttribute("data-width")),i=H(t.getAttribute("data-height"));return e!==null&&i!==null?{width:e,height:i}:null}class we{constructor(t,e){u(this,"_interval",null);u(this,"_runtimeInjected",!1);this._iframe=t,this._callbacks=e}get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._runtimeInjected=!1;let t=0;this._interval=setInterval(()=>{var e;t++;try{const i=this._iframe.contentWindow;if(!i)return;const s=!!(i.__hf||i.__player),o=!!(i.__timelines&&Object.keys(i.__timelines).length>0),a=!!((e=this._iframe.contentDocument)!=null&&e.querySelector("[data-composition-src]"));if(fe({hasRuntime:s,hasTimelines:o,hasNestedCompositions:a,runtimeInjected:this._runtimeInjected,attempts:t})){this._injectRuntime();return}if(this._runtimeInjected&&!s)return;const d=this._resolvePlaybackDurationAdapter(i);if(d&&d.getDuration()>0){this.stop();const h=be(this._iframe.contentDocument);this._callbacks.onReady({duration:d.getDuration(),adapter:d,compositionSize:h});return}}catch{}t>=40&&(this.stop(),this._callbacks.onError("Composition timeline not found after 8s"))},200)}stop(){this._interval!==null&&(clearInterval(this._interval),this._interval=null)}resolveDirectTimelineAdapter(){try{const t=this._iframe.contentWindow;return t?this._resolveDirectTimelineAdapterFromWindow(t):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(t){return this._resolveDirectTimelineAdapterFromWindow(t)}hasRuntimeBridge(t){return Reflect.get(t,"__hf")!==void 0||F(Reflect.get(t,"__player"))}_injectRuntime(){var t,e;this._runtimeInjected=!0;try{const i=this._iframe.contentDocument;if(!i)return;const s=i.createElement("script");s.src=ve,(i.head||i.documentElement).appendChild(s),(e=(t=this._callbacks).onRuntimeInjected)==null||e.call(t)}catch{}}_resolveDirectTimelineAdapterFromWindow(t){var d,h;if(this.hasRuntimeBridge(t))return null;const e=Reflect.get(t,"__timelines");if(!F(e))return null;const i=Object.keys(e);if(i.length===0)return null;const s=(h=(d=this._iframe.contentDocument)==null?void 0:d.querySelector("[data-composition-id]"))==null?void 0:h.getAttribute("data-composition-id"),o=s&&s in e?s:i[i.length-1],a=e[o];return ge(a)?a:null}_resolvePlaybackDurationAdapter(t){const e=Reflect.get(t,"__player");if(_e(e))return{kind:"runtime",getDuration:()=>e.getDuration()};const i=this._resolveDirectTimelineAdapterFromWindow(t);return i?{kind:"direct-timeline",timeline:i,getDuration:()=>i.duration()}:null}}const Ae=`
2
2
  :host {
3
3
  display: block;
4
4
  position: relative;
@@ -1,4 +1,4 @@
1
- import{n as Qi}from"./index-B_UvTX3E.js";/*!
1
+ import{n as Qi}from"./index-CrkAdJkb.js";/*!
2
2
  * Copyright (c) 2026-present, Vanilagy and contributors
3
3
  *
4
4
  * This Source Code Form is subject to the terms of the Mozilla Public